From 55eb85d5460523b60196df4eaa9b2d833a886735 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Sat, 18 Sep 2021 23:57:52 -0700 Subject: [PATCH 001/394] Updated MaterialPropertyId class in preparation for nested material property sets. Here the class has been generalized for a list of group names and a final property name, rather than assuming a single group containing the property. This included removing the unused GetPropertyName and GetGroupName functions. All that's really need from this class is conversion to a full property ID string. Testing: New unit test. Reprocessed all core material types and StandardPBR test materials used in Atom Sample Viewer's material screenshot test. Atom Sample Viewer material screenshot test script. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyId.h | 18 +-- .../RPI.Edit/Material/MaterialPropertyId.cpp | 83 ++++++----- .../RPI.Edit/Material/MaterialSourceData.cpp | 12 +- .../Material/MaterialTypeSourceData.cpp | 12 +- .../Material/MaterialPropertyIdTests.cpp | 131 ++++++++++++++++++ Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake | 1 + .../Code/Source/Document/MaterialDocument.cpp | 8 +- .../MaterialInspector/MaterialInspector.cpp | 4 +- .../EditorMaterialComponentInspector.cpp | 2 +- .../Material/EditorMaterialComponentUtil.cpp | 4 +- .../EditorMaterialModelUvNameMapInspector.cpp | 4 +- 11 files changed, 216 insertions(+), 63 deletions(-) create mode 100644 Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 77d49f3407..4b6d78c092 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -9,6 +9,7 @@ #pragma once #include +#include namespace AZ { @@ -16,27 +17,28 @@ namespace AZ { class MaterialAsset; - //! Utility for building material property names consisting of a group name and a property sub-name. - //! Represented as "[groupName].[propertyName]". - //! The group name is optional, in which case the ID will just be "[propertyName]". + //! Utility for building material property IDs. + //! These IDs are represented like "groupA.groupB.[...].propertyName". + //! The groups are optional, in which case the full property ID will just be like "propertyName". class MaterialPropertyId { public: static bool IsValidName(AZStd::string_view name); static bool IsValidName(const AZ::Name& name); - //! Creates a MaterialPropertyId from a full name string like "[groupName].[propertyName]" or just "[propertyName]" + //! Creates a MaterialPropertyId from a full name string like "groupA.groupB.[...].propertyName" or just "propertyName". + //! Also checks the name for validity. static MaterialPropertyId Parse(AZStd::string_view fullPropertyId); MaterialPropertyId() = default; + explicit MaterialPropertyId(AZStd::string_view propertyName); MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); + MaterialPropertyId(const AZStd::array_view names); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); - const Name& GetGroupName() const; - const Name& GetPropertyName() const; - const Name& GetFullName() const; + operator const Name&() const; //! Returns a pointer to the full name ("[groupName].[propertyName]"). //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. @@ -52,8 +54,6 @@ namespace AZ private: Name m_fullName; - Name m_groupName; - Name m_propertyName; }; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index e74ec3e6e0..1be5c4485c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -27,63 +27,84 @@ namespace AZ bool MaterialPropertyId::IsValid() const { - const bool groupNameIsValid = m_groupName.IsEmpty() || IsValidName(m_groupName); - const bool propertyNameIsValid = IsValidName(m_propertyName); - return groupNameIsValid && propertyNameIsValid; + return !m_fullName.IsEmpty(); } MaterialPropertyId MaterialPropertyId::Parse(AZStd::string_view fullPropertyId) { AZStd::vector tokens; - AzFramework::StringFunc::Tokenize(fullPropertyId.data(), tokens, '.', true, true); + AzFramework::StringFunc::Tokenize(fullPropertyId, tokens, '.', true, true); - if (tokens.size() == 1) + if (tokens.empty()) { - return MaterialPropertyId{"", tokens[0]}; + AZ_Error("MaterialPropertyId", false, "Property ID is empty.", fullPropertyId.data()); + return MaterialPropertyId{}; } - else if (tokens.size() == 2) + + for (const auto& token : tokens) { - return MaterialPropertyId{tokens[0], tokens[1]}; + if (!IsValidName(token)) + { + AZ_Error("MaterialPropertyId", false, "Property ID '%.*s' is not a valid identifier.", AZ_STRING_ARG(fullPropertyId)); + return MaterialPropertyId{}; + } + } + + MaterialPropertyId id; + id.m_fullName = fullPropertyId; + return id; + } + + MaterialPropertyId::MaterialPropertyId(AZStd::string_view propertyName) + { + if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "Property name '%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); } else { - AZ_Error("MaterialPropertyId", false, "Property ID '%s' is not a valid identifier.", fullPropertyId.data()); - return MaterialPropertyId{}; + m_fullName = propertyName; } } MaterialPropertyId::MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName) - : MaterialPropertyId(Name{groupName}, Name{propertyName}) { - } - - MaterialPropertyId::MaterialPropertyId(const Name& groupName, const Name& propertyName) - { - AZ_Error("MaterialPropertyId", groupName.IsEmpty() || IsValidName(groupName), "Group name '%s' is not a valid identifier.", groupName.GetCStr()); - AZ_Error("MaterialPropertyId", IsValidName(propertyName), "Property name '%s' is not a valid identifier.", propertyName.GetCStr()); - m_groupName = groupName; - m_propertyName = propertyName; - if (groupName.IsEmpty()) + if (!IsValidName(groupName)) { - m_fullName = m_propertyName.GetStringView(); + AZ_Error("MaterialPropertyId", false, "Group name '%.*s' is not a valid identifier.", AZ_STRING_ARG(groupName)); + } + else if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "Property name '%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); } else { - m_fullName = AZStd::string::format("%s.%s", m_groupName.GetCStr(), m_propertyName.GetCStr()); + m_fullName = AZStd::string::format("%.*s.%.*s", AZ_STRING_ARG(groupName), AZ_STRING_ARG(propertyName)); } } - - const Name& MaterialPropertyId::GetGroupName() const + + MaterialPropertyId::MaterialPropertyId(const Name& groupName, const Name& propertyName) + : MaterialPropertyId(groupName.GetStringView(), propertyName.GetStringView()) { - return m_groupName; + } + + MaterialPropertyId::MaterialPropertyId(const AZStd::array_view names) + { + for (const auto& name : names) + { + if (!IsValidName(name)) + { + AZ_Error("MaterialPropertyId", false, "'%s' is not a valid identifier.", name.c_str()); + return; + } + } + + AZStd::string fullName; + AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); + m_fullName = fullName; } - const Name& MaterialPropertyId::GetPropertyName() const - { - return m_propertyName; - } - - const Name& MaterialPropertyId::GetFullName() const + MaterialPropertyId::operator const Name&() const { return m_fullName; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index f697f33a3f..b48d0938a7 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -130,7 +130,7 @@ namespace AZ } else { - MaterialPropertyIndex propertyIndex = materialAssetCreator.m_materialPropertiesLayout->FindPropertyIndex(propertyId.GetFullName()); + MaterialPropertyIndex propertyIndex = materialAssetCreator.m_materialPropertiesLayout->FindPropertyIndex(propertyId); if (propertyIndex.IsValid()) { const MaterialPropertyDescriptor* propertyDescriptor = materialAssetCreator.m_materialPropertiesLayout->GetPropertyDescriptor(propertyIndex); @@ -145,11 +145,11 @@ namespace AZ auto& imageAsset = imageAssetResult.GetValue(); // Load referenced images when load material imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad); - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset); + materialAssetCreator.SetPropertyValue(propertyId, imageAsset); } else { - materialAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), property.second.m_value.GetValue().data()); + materialAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.second.m_value.GetValue().data()); } } break; @@ -163,18 +163,18 @@ namespace AZ } else { - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); + materialAssetCreator.SetPropertyValue(propertyId, enumValue); } } break; default: - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.second.m_value); + materialAssetCreator.SetPropertyValue(propertyId, property.second.m_value); break; } } else { - materialAssetCreator.ReportWarning("Can not find property id '%s' in MaterialPropertyLayout", propertyId.GetFullName().GetStringView().data()); + materialAssetCreator.ReportWarning("Can not find property id '%s' in MaterialPropertyLayout", propertyId.GetCStr()); } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index a13a8df16e..7134830fe8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -354,7 +354,7 @@ namespace AZ continue; } - materialTypeAssetCreator.BeginMaterialProperty(propertyId.GetFullName(), property.m_dataType); + materialTypeAssetCreator.BeginMaterialProperty(propertyId, property.m_dataType); if (property.m_dataType == MaterialPropertyDataType::Enum) { @@ -404,17 +404,17 @@ namespace AZ if (imageAssetResult.IsSuccess()) { - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAssetResult.GetValue()); + materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); } else { - materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), property.m_value.GetValue().data()); + materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.m_value.GetValue().data()); } } break; case MaterialPropertyDataType::Enum: { - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); + MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); AZ::Name enumName = AZ::Name(property.m_value.GetValue()); @@ -425,12 +425,12 @@ namespace AZ } else { - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); + materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); } } break; default: - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.m_value); + materialTypeAssetCreator.SetPropertyValue(propertyId, property.m_value); break; } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp new file mode 100644 index 0000000000..2b729ed8ef --- /dev/null +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp @@ -0,0 +1,131 @@ +/* + * 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 UnitTest +{ + using namespace AZ; + using namespace RPI; + + class MaterialPropertyIdTests + : public RPITestFixture + { + }; + + TEST_F(MaterialPropertyIdTests, TestConstructWithPropertyName) + { + MaterialPropertyId id{"color"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "color"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"color"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithPropertyName_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"color?"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames) + { + MaterialPropertyId id{"baseColor", "factor"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "baseColor.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"baseColor.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames_BadGroupName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"layer1.baseColor", "factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithTwoNames_BadPropertyName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id{"baseColor", ".factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleNames) + { + AZStd::vector names{"layer1", "clearCoat", "normal", "factor"}; + MaterialPropertyId id{names}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleNames_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clear-coat", "normal", "factor"}; + MaterialPropertyId id{names}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestParse) + { + MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal.factor"); + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestParse_BadName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal,factor"); + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestNameValidity) + { + EXPECT_TRUE(MaterialPropertyId::IsValidName("a")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("z")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("A")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("Z")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("_")); + EXPECT_TRUE(MaterialPropertyId::IsValidName("m_layer10bazBAZ")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("1layer")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base-color")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base.color")); + EXPECT_FALSE(MaterialPropertyId::IsValidName("base/color")); + } +} diff --git a/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake index e99e4e456b..923fdc9338 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_tests_files.cmake @@ -39,6 +39,7 @@ set(FILES Tests/Material/MaterialSourceDataTests.cpp Tests/Material/MaterialFunctorTests.cpp Tests/Material/MaterialFunctorSourceDataSerializerTests.cpp + Tests/Material/MaterialPropertyIdTests.cpp Tests/Material/MaterialPropertyValueSourceDataTests.cpp Tests/Material/MaterialTests.cpp Tests/Model/ModelTests.cpp diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 17e292ac16..3f4aa71a9c 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -596,7 +596,7 @@ namespace MaterialEditor const MaterialPropertyId propertyId(groupName, propertyName); - const auto it = m_properties.find(propertyId.GetFullName()); + const auto it = m_properties.find(propertyId); if (it != m_properties.end() && propertyFilter(it->second)) { MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); @@ -604,7 +604,7 @@ namespace MaterialEditor { if (!m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(propertyDefinition, propertyValue)) { - AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetFullName().GetCStr(), m_absolutePath.c_str()); + AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); result = false; return false; } @@ -774,7 +774,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = MaterialPropertyId(groupName, propertyName).GetCStr(); + propertyConfig.m_id = MaterialPropertyId(groupName, propertyName); const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); @@ -845,7 +845,7 @@ namespace MaterialEditor propertyConfig = {}; propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::String; - propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput).GetCStr(); + propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = shaderInput; propertyConfig.m_groupName = "UV Sets"; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index df0b179dc1..f6b42bf13a 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -145,7 +145,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, uvNamePair.m_shaderInput.ToString()).GetFullName()); + AZ::RPI::MaterialPropertyId(groupName, uvNamePair.m_shaderInput.ToString())); group.m_properties.push_back(property); property.SetValue(property.GetConfig().m_parentValue); @@ -182,7 +182,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName()); + AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name)); group.m_properties.push_back(property); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index f10a125456..c05b84db39 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -300,7 +300,7 @@ namespace AZ AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name); AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index 070c42fd7c..e851bc5fce 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -140,7 +140,7 @@ namespace AZ editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { const AZ::RPI::MaterialPropertyId propertyId(groupName, propertyName); const AZ::RPI::MaterialPropertyIndex propertyIndex = - editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); + editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; @@ -151,7 +151,7 @@ namespace AZ } // Check for and apply any property overrides before saving property values - auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId.GetFullName()); + auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) { propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp index 64bc54bae8..1fa6a4e58d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialModelUvNameMapInspector.cpp @@ -96,7 +96,7 @@ namespace AZ const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView(); propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum; - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = materialUvName; propertyConfig.m_description = shaderInput; @@ -248,7 +248,7 @@ namespace AZ const AZStd::string materialUvName = m_materialUvNames[i].m_uvName.GetStringView(); propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::Enum; - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput).GetFullName(); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = materialUvName; propertyConfig.m_description = shaderInput; From f0e8af72aed61a6163aa88d741c98480f27d4e5c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:08:54 -0700 Subject: [PATCH 002/394] Updated StringFunc::Tokenize to support returning a list of string_view instead of string, which should be more efficient. string is still supported as well, but users should prefer the string_view version. Testing: Updated unit tests. Reprocessed Atom material assets. Ran AtomSampleViewer material screenshot test. Opened, edited, saved materail in the Material Editor. Opened a level, edited material property overrides, saved and reloaded. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../AzCore/AzCore/StringFunc/StringFunc.cpp | 24 ++++++++++---- .../AzCore/AzCore/StringFunc/StringFunc.h | 12 ++++--- Code/Framework/AzCore/Tests/StringFunc.cpp | 31 +++++++++++++++---- 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp index ff30291a70..eec23b6bcb 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp @@ -759,13 +759,18 @@ namespace AZ } return value; } - - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) + + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return Tokenize(in, tokens, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); } - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); + + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) { auto insertVisitor = [&tokens](AZStd::string_view token) { @@ -773,6 +778,9 @@ namespace AZ }; return TokenizeVisitor(in, insertVisitor, delimiters, keepEmptyStrings, keepSpaceStrings); } + + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); void TokenizeVisitor(AZStd::string_view in, const TokenVisitor& tokenVisitor, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { @@ -920,8 +928,9 @@ namespace AZ return found; } - - void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) + + template + void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) { if (input.empty()) { @@ -941,7 +950,7 @@ namespace AZ } // Take the substring, not including the separator, and increment our offset - AZStd::string nextSubstring = input.substr(offset, nextOffset - offset); + AZStd::string_view nextSubstring = input.substr(offset, nextOffset - offset); if (keepEmptyStrings || keepSpaceStrings || !nextSubstring.empty()) { tokens.push_back(nextSubstring); @@ -950,6 +959,9 @@ namespace AZ offset = nextOffset + delimiters[nextMatch].size(); } } + + template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); + template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); int ToInt(const char* in) { diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h index 1e651afc93..51357312bc 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h @@ -258,17 +258,21 @@ namespace AZ bool Strip(AZStd::string& inout, const char* stripCharacters = " ", bool bCaseSensitive = false, bool bStripBeginning = false, bool bStripEnding = false); //! Tokenize - /*! Tokenize a c-string, into a vector of AZStd::string(s) optionally keeping empty string + /*! Tokenize a c-string, into a vector of strings optionally keeping empty string *! and optionally keeping space only strings + *! (The string type may be AZStd::string or AZStd::string_view. New code should use AZStd::string_view for better performance. AZStd::string version is preserved for compatibility.) Example: Tokenize the words of a sentence. StringFunc::Tokenize("Hello World", d, ' '); s[0] == "Hello", s[1] == "World" Example: Tokenize a comma and end line delimited string StringFunc::Tokenize("Hello,World\nHello,World", d, ' '); s[0] == "Hello", s[1] == "World" s[2] == "Hello", s[3] == "World" */ - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); //! TokenizeVisitor /*! Tokenize a string_view and invoke a handler for each token found. diff --git a/Code/Framework/AzCore/Tests/StringFunc.cpp b/Code/Framework/AzCore/Tests/StringFunc.cpp index 68821ba3f9..79dabe3462 100644 --- a/Code/Framework/AzCore/Tests/StringFunc.cpp +++ b/Code/Framework/AzCore/Tests/StringFunc.cpp @@ -199,7 +199,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 0); } @@ -207,7 +207,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter) { AZStd::string input = "a b,c"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 2); @@ -218,7 +218,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, " ,"); ASSERT_EQ(tokens.size(), 0); } @@ -226,7 +226,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); ASSERT_EQ(tokens.size(), 5); @@ -240,7 +240,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = {" -", " +"}; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); ASSERT_EQ(tokens.size(), 0); @@ -249,7 +249,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = { " -", " +" }; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); @@ -259,6 +259,25 @@ namespace AZ ASSERT_TRUE(tokens[2] == "c"); ASSERT_TRUE(tokens[3] == "d-e"); // Test for something like a guid, which contain typical separator characters } + + TEST_F(StringFuncTest, Tokenize_MultiDelimeters_String) + { + // Test with AZStd::string for backward compatibility. The functions + // use to only work with AZStd::string, and now they are templatized + // to support both AZStd::string and AZStd::string_view (the latter + // being perferred for performance). + + AZStd::string input = " -a +b +c -d-e"; + AZStd::vector tokens; + AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); + + ASSERT_EQ(tokens.size(), 5); + ASSERT_TRUE(tokens[0] == "a "); + ASSERT_TRUE(tokens[1] == "b "); + ASSERT_TRUE(tokens[2] == "c "); + ASSERT_TRUE(tokens[3] == "d"); + ASSERT_TRUE(tokens[4] == "e"); + } TEST_F(StringFuncTest, TokenizeVisitor_EmptyString_DoesNotInvokeVisitor) { From 1a99103999e132b21fc67ed4948401f788dc1c59 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:30:28 -0700 Subject: [PATCH 003/394] Overhauled the .materialtype file format to group all related properties data together. This prepares the way for a number of possible improvements, especially unlocking the ability to factor out material type configuration to be shared by multiple material types. Here we formalize the concept of a Property Set, which replaces property "groups", containing the group name and description, properties, and functors all in one place. The Property Set structure will allow arbitrarily deep nesting, whereas before you only had one level of grouping. This nesting is not fully supported yet throughout the system, particularly in the Material Editor. It was easier to go ahead and put in some of the nesting mechanims, parituclar in the implementation of MaterialTypeSourceData. This change is backward compatible, which is proved with unit tests, and by the fact that only MinimalPBR.materialtype has been updated to the new format. StandardPBR, EnhancedPBR, and others are still using the old format. (In a subsequent commit I'll update these as well, to prove that the new format works correctly). Other changes and improvements... - A new constructor for MaterialPropertyId - Improved API for MaterialTypeSourceData that hides a good deal more of it's data as private, with clear and convenient APIs. Especially AddProperty, AddPropertySet, FindProperty, FindPropertySet, EnumerateProperties, EnumeratePropertySets. - Added lots of new unit tests - Updated MinimalPBR.materialtype to the new format. Testing: - Updated unit tests. - Reprocessed Atom material assets. - Ran AtomSampleViewer material screenshot test. - Opened, edited, saved material in the Material Editor. - Opened a level, edited material property overrides, saved and reloaded. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyId.h | 4 + .../Material/MaterialTypeSourceData.h | 142 ++- .../RPI.Edit/Material/MaterialPropertyId.cpp | 35 + .../MaterialPropertyValueSerializer.cpp | 4 +- .../Material/MaterialSourceDataSerializer.cpp | 1 + .../Material/MaterialTypeSourceData.cpp | 749 ++++++++--- .../RPI.Edit/Material/MaterialUtils.cpp | 1 + .../Code/Tests/Common/ErrorMessageFinder.cpp | 2 +- .../Material/MaterialPropertyIdTests.cpp | 34 + .../Material/MaterialSourceDataTests.cpp | 117 +- .../Material/MaterialTypeSourceDataTests.cpp | 1134 +++++++++++++---- .../Materials/Types/MinimalPBR.materialtype | 80 +- .../Code/Source/Document/MaterialDocument.cpp | 113 +- .../MaterialInspector/MaterialInspector.cpp | 31 +- .../EditorMaterialComponentInspector.cpp | 42 +- .../Material/EditorMaterialComponentUtil.cpp | 70 +- 16 files changed, 1890 insertions(+), 669 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 4b6d78c092..496485d0d6 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -35,6 +35,7 @@ namespace AZ MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); MaterialPropertyId(const AZStd::array_view names); + MaterialPropertyId(const AZStd::array_view groupNames, AZStd::string_view propertyName); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); @@ -44,6 +45,9 @@ namespace AZ //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. const char* GetCStr() const; + //! Wraps Name::GetStringView() for convenience. + AZStd::string_view GetStringView() const; + //! Returns a hash of the full name. This is needed for compatibility with NameIdReflectionMap. Name::Hash GetHash() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 04b6222404..56f7c4612c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -68,8 +68,9 @@ namespace AZ struct PropertyDefinition { + AZ_CLASS_ALLOCATOR(PropertyDefinition, SystemAllocator, 0); AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyDefinition, "{E0DB3C0D-75DB-4ADB-9E79-30DA63FA18B7}"); - + static const float DefaultMin; static const float DefaultMax; static const float DefaultStep; @@ -117,68 +118,159 @@ namespace AZ AZStd::unordered_map m_shaderOptionValues; }; - using PropertyList = AZStd::vector; + using PropertyList = AZStd::vector>; + + struct PropertySet + { + friend class MaterialTypeSourceData; + + AZ_CLASS_ALLOCATOR(PropertySet, SystemAllocator, 0); + AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertySet, "{BA3AA0E4-C74D-4FD0-ADB2-00B060F06314}"); + + public: + + PropertySet() = default; + AZ_DISABLE_COPY(PropertySet) + + const AZStd::string& GetName() const { return m_name; } + const AZStd::string& GetDisplayName() const { return m_displayName; } + const AZStd::string& GetDescription() const { return m_description; } + const PropertyList& GetProperties() const { return m_properties; } + const AZStd::vector>& GetPropertySets() const { return m_propertySets; } + const AZStd::vector>& GetFunctors() const { return m_materialFunctorSourceData; } + + void SetDisplayName(AZStd::string_view displayName) { m_displayName = displayName; } + void SetDescription(AZStd::string_view description) { m_description = description; } + + PropertyDefinition* AddProperty(AZStd::string_view name); + PropertySet* AddPropertySet(AZStd::string_view name); + + private: + + static PropertySet* AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList); + + AZStd::string m_name; + AZStd::string m_displayName; + AZStd::string m_description; + PropertyList m_properties; + AZStd::vector> m_propertySets; + AZStd::vector> m_materialFunctorSourceData; + }; + struct PropertyLayout { AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyLayout, "{AE53CF3F-5C3B-44F5-B2FB-306F0EB06393}"); + PropertyLayout() = default; + AZ_DISABLE_COPY(PropertyLayout) + //! Indicates the version of the set of available properties. Can be used to detect materials that might need to be updated. uint32_t m_version = 0; + //! [Deprecated] Use m_propertySets instead //! List of groups that will contain the available properties AZStd::vector m_groups; + //! [Deprecated] Use m_propertySets instead //! Collection of all available user-facing properties - AZStd::map m_properties; + AZStd::map> m_properties; + + AZStd::vector> m_propertySets; }; + + PropertySet* AddPropertySet(AZStd::string_view propertySetId); + //PropertySet* AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name); + PropertyDefinition* AddProperty(AZStd::string_view propertyId); + //PropertyDefinition* AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name); - AZStd::string m_description; + const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } - PropertyLayout m_propertyLayout; + AZStd::string m_description; //< TODO: Make this private //! A list of shader variants that are always used at runtime; they cannot be turned off - AZStd::vector m_shaderCollection; + AZStd::vector m_shaderCollection; //< TODO: Make this private //! Material functors provide custom logic and calculations to configure shaders, render states, and more. See MaterialFunctor.h for details. - AZStd::vector> m_materialFunctorSourceData; + AZStd::vector> m_materialFunctorSourceData; //< TODO: Make this private //! Override names for UV input in the shaders of this material type. //! Using ordered map to sort names on loading. using UvNameMap = AZStd::map; - UvNameMap m_uvNameMap; + UvNameMap m_uvNameMap; //< TODO: Make this private //! Copy over UV custom names to the properties enum values. void ResolveUvEnums(); + + const PropertySet* FindPropertySet(AZStd::string_view propertySetId) const; - const GroupDefinition* FindGroup(AZStd::string_view groupName) const; + const PropertyDefinition* FindProperty(AZStd::string_view propertyId) const; - const PropertyDefinition* FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName) const; + //! Tokenizes an ID string like "itemA.itemB.itemC" into a vector like ["itemA", "itemB", "itemC"] + static AZStd::vector TokenizeId(AZStd::string_view id); + + //! Splits an ID string like "itemA.itemB.itemC" into a vector like ["itemA.itemB", "itemC"] + static AZStd::vector SplitId(AZStd::string_view id); - //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data - //! Groups with the same name will be consolidated into a single entry - AZStd::vector GetGroupDefinitionsInDisplayOrder() const; + //! Call back function type used with the enumeration functions + using EnumeratePropertySetsCallback = AZStd::function; + //! Recursively traverses all of the property sets contained in the material type, executing a callback function for each. + //! @return false if the enumeration was terminated early by the callback returning false. + bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const; //! Call back function type used with the numeration functions using EnumeratePropertiesCallback = AZStd::function; - - //! Traverse all of the properties contained in the source data executing a callback function - //! Traversal will occur in group alphabetical order and stop once all properties have been enumerated or the callback function returns false - void EnumerateProperties(const EnumeratePropertiesCallback& callback) const; - - //! Traverse all of the properties in the source data in display/storage order executing a callback function - //! Traversal will stop once all properties have been enumerated or the callback function returns false - void EnumeratePropertiesInDisplayOrder(const EnumeratePropertiesCallback& callback) const; + + //! Recursively traverses all of the properties contained in the material type, executing a callback function for each. + //! @return false if the enumeration was terminated early by the callback returning false. + bool EnumerateProperties(const EnumeratePropertiesCallback& callback) const; //! Convert the property value into the format that will be stored in the source data //! This is primarily needed to support conversions of special types like enums and images bool ConvertPropertyValueToSourceDataFormat(const PropertyDefinition& propertyDefinition, MaterialPropertyValue& propertyValue) const; Outcome> CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath = "", bool elevateWarnings = true) const; + + bool ConvertToNewDataFormat(); + + private: + + //PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList); + const PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const; + + //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList); + const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const; + + //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet); + //const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const; + + // Function overloads for recursion, returns false to indicate that recursion should end. + bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; + bool EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; + + //! Recursively populates a material asset with properties from the tree of material property sets. + //! @param materialTypeSourceFilePath path to the material type file that is being processed, used to look up relative paths + //! @param propertyNameContext the accumulated prefix that should be applied to any property names encountered in the current @propertySet + //! @param propertySet the current PropertySet that is being processed + //! @return false if errors are detected and processing should abort + bool BuildPropertyList( + const AZStd::string& materialTypeSourceFilePath, + MaterialTypeAssetCreator& materialTypeAssetCreator, + AZStd::vector& propertyNameContext, + const MaterialTypeSourceData::PropertySet* propertySet) const; + + //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data. + //! Groups with the same name will be consolidated into a single entry. + //! Operates on the old format PropertyLayout::m_groups, used for conversion to the new format. + AZStd::vector GetOldFormatGroupDefinitionsInDisplayOrder() const; + + PropertyLayout m_propertyLayout; }; //! The wrapper class for derived material functors. @@ -207,7 +299,7 @@ namespace AZ return m_actualSourceData ? m_actualSourceData->CreateFunctor(editorContext) : Failure(); } - const Ptr GetActualSourceData() const { return m_actualSourceData; } + Ptr GetActualSourceData() const { return m_actualSourceData; } private: Ptr m_actualSourceData = nullptr; // The derived material functor instance. }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index 1be5c4485c..47e41fa6fa 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -103,6 +103,36 @@ namespace AZ AzFramework::StringFunc::Join(fullName, names.begin(), names.end(), "."); m_fullName = fullName; } + + MaterialPropertyId::MaterialPropertyId(const AZStd::array_view groupNames, AZStd::string_view propertyName) + { + for (const auto& name : groupNames) + { + if (!IsValidName(name)) + { + AZ_Error("MaterialPropertyId", false, "'%s' is not a valid identifier.", name.c_str()); + return; + } + } + + if (!IsValidName(propertyName)) + { + AZ_Error("MaterialPropertyId", false, "'%.*s' is not a valid identifier.", AZ_STRING_ARG(propertyName)); + return; + } + + if (groupNames.empty()) + { + m_fullName = propertyName; + } + else + { + AZStd::string fullName; + AzFramework::StringFunc::Join(fullName, groupNames.begin(), groupNames.end(), "."); + fullName = AZStd::string::format("%s.%.*s", fullName.c_str(), AZ_STRING_ARG(propertyName)); + m_fullName = fullName; + } + } MaterialPropertyId::operator const Name&() const { @@ -113,6 +143,11 @@ namespace AZ { return m_fullName.GetCStr(); } + + AZStd::string_view MaterialPropertyId::GetStringView() const + { + return m_fullName.GetStringView(); + } Name::Hash MaterialPropertyId::GetHash() const { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp index 3b2d36451a..5bf78d1639 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,7 @@ namespace AZ } // Construct the full property name (groupName.propertyName) by parsing it from the JSON path string. + // Note we don't yet support full nested property sets, but eventually this should not be limited to just one group with one list of properties... size_t startPropertyName = context.GetPath().Get().rfind('/'); size_t startGroupName = context.GetPath().Get().rfind('/', startPropertyName-1); AZStd::string_view groupName = context.GetPath().Get().substr(startGroupName + 1, startPropertyName - startGroupName - 1); @@ -70,7 +72,7 @@ namespace AZ JSR::ResultCode result(JSR::Tasks::ReadField); - auto propertyDefinition = materialType->FindProperty(groupName, propertyName); + auto propertyDefinition = materialType->FindProperty(MaterialPropertyId{groupName, propertyName}.GetStringView()); if (!propertyDefinition) { AZStd::string message = AZStd::string::format("Property '%.*s.%.*s' not found in material type.", AZ_STRING_ARG(groupName), AZ_STRING_ARG(propertyName)); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp index 5e4af07aae..e24655b7a6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp @@ -103,6 +103,7 @@ namespace AZ settings.m_clearContainers = context.ShouldClearContainers(); JsonSerializationResult::ResultCode materialTypeLoadResult = JsonSerialization::Load(materialTypeData, materialTypeJson.GetValue(), settings); + materialTypeData.ConvertToNewDataFormat(); materialTypeData.ResolveUvEnums(); // Restore prior configuration diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index f69b082292..de55cbecb5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -56,7 +56,11 @@ namespace AZ serializeContext->Class()->Version(3); serializeContext->Class()->Version(4); serializeContext->Class()->Version(1); - + + serializeContext->RegisterGenericType>(); + serializeContext->RegisterGenericType>(); + serializeContext->RegisterGenericType>>(); + serializeContext->RegisterGenericType>>(); serializeContext->RegisterGenericType(); serializeContext->Class() @@ -66,11 +70,22 @@ namespace AZ ->Field("options", &ShaderVariantReferenceData::m_shaderOptionValues) ; + serializeContext->Class() + ->Version(1) + ->Field("name", &PropertySet::m_name) + ->Field("displayName", &PropertySet::m_displayName) + ->Field("description", &PropertySet::m_description) + ->Field("properties", &PropertySet::m_properties) + ->Field("propertySets", &PropertySet::m_propertySets) + ->Field("functors", &PropertySet::m_materialFunctorSourceData) + ; + serializeContext->Class() ->Version(1) ->Field("version", &PropertyLayout::m_version) - ->Field("groups", &PropertyLayout::m_groups) - ->Field("properties", &PropertyLayout::m_properties) + ->Field("groups", &PropertyLayout::m_groups) //< Old, preserved for backward compatibility, replaced by propertySets + ->Field("properties", &PropertyLayout::m_properties) //< Old, preserved for backward compatibility, replaced by propertySets + ->Field("propertySets", &PropertyLayout::m_propertySets) ; serializeContext->RegisterGenericType(); @@ -92,43 +107,397 @@ namespace AZ , m_shaderIndex(shaderIndex) { } - + const float MaterialTypeSourceData::PropertyDefinition::DefaultMin = std::numeric_limits::lowest(); const float MaterialTypeSourceData::PropertyDefinition::DefaultMax = std::numeric_limits::max(); const float MaterialTypeSourceData::PropertyDefinition::DefaultStep = 0.1f; - - const MaterialTypeSourceData::GroupDefinition* MaterialTypeSourceData::FindGroup(AZStd::string_view groupName) const + + /*static*/ MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList) { - for (const GroupDefinition& group : m_propertyLayout.m_groups) - { - if (group.m_name == groupName) + auto iter = AZStd::find_if(toPropertySetList.begin(), toPropertySetList.end(), [name](const AZStd::unique_ptr& existingPropertySet) { - return &group; + return existingPropertySet->m_name == name; + }); + + if (iter != toPropertySetList.end()) + { + AZ_Error("Material source data", false, "PropertySet named '%.*s' already exists", AZ_STRING_ARG(name)); + return nullptr; + } + + if (!MaterialPropertyId::IsValidName(name)) + { + AZ_Error("Material source data", false, "'%.*s' is not a valid identifier", AZ_STRING_ARG(name)); + return nullptr; + } + + toPropertySetList.push_back(AZStd::make_unique()); + toPropertySetList.back()->m_name = name; + return toPropertySetList.back().get(); + } + + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::PropertySet::AddProperty(AZStd::string_view name) + { + auto propertyIter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) + { + return existingProperty->m_name == name; + }); + + if (propertyIter != m_properties.end()) + { + AZ_Error("Material source data", false, "PropertySet '%s' already contains a property named '%.*s'", m_name.c_str(), AZ_STRING_ARG(name)); + return nullptr; + } + + auto propertySetIter = AZStd::find_if(m_propertySets.begin(), m_propertySets.end(), [name](const AZStd::unique_ptr& existingPropertySet) + { + return existingPropertySet->m_name == name; + }); + + if (propertySetIter != m_propertySets.end()) + { + AZ_Error("Material source data", false, "Property name '%.*s' collides with a PropertySet of the same name", AZ_STRING_ARG(name)); + return nullptr; + } + + if (!MaterialPropertyId::IsValidName(name)) + { + AZ_Error("Material source data", false, "'%.*s' is not a valid identifier", AZ_STRING_ARG(name)); + return nullptr; + } + + m_properties.emplace_back(AZStd::make_unique()); + m_properties.back()->m_name = name; + return m_properties.back().get(); + } + + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name) + { + auto iter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) + { + return existingProperty->m_name == name; + }); + + if (iter != m_properties.end()) + { + AZ_Error("Material source data", false, "PropertySet name '%.*s' collides with a Property of the same name", AZ_STRING_ARG(name)); + return nullptr; + } + + return AddPropertySet(name, m_propertySets); + } + + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view propertySetId) + { + AZStd::vector splitPropertySetId = SplitId(propertySetId); + + if (splitPropertySetId.size() == 1) + { + return PropertySet::AddPropertySet(propertySetId, m_propertyLayout.m_propertySets); + } + + // TODO: Delete + //return AddPropertySet(splitPropertySetId[0], splitPropertySetId[1]); + + PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertySetId[0])); + + if (!parentPropertySet) + { + AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(splitPropertySetId[0])); + return nullptr; + } + + return parentPropertySet->AddPropertySet(splitPropertySetId[1]); + } + + // TODO: Delete + //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name) + //{ + // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); + // + // if (!parentPropertySet) + // { + // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); + // return nullptr; + // } + + // return parentPropertySet->AddPropertySet(name); + //} + + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view propertyId) + { + AZStd::vector splitPropertyId = SplitId(propertyId); + //if (splitPropertyId.empty()) + //{ + // return nullptr; + //} + + if (splitPropertyId.size() == 1) + { + AZ_Error("Material source data", false, "Property id '%.*s' is invalid. Properties must be added to a PropertySet (i.e. \"general.%.*s\").", AZ_STRING_ARG(propertyId), AZ_STRING_ARG(propertyId)); + return nullptr; + } + + // TODO: Delete + //return AddProperty(splitPropertyId[0], splitPropertyId[1]); + + PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertyId[0])); + + if (!parentPropertySet) + { + AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(splitPropertyId[0])); + return nullptr; + } + + return parentPropertySet->AddProperty(splitPropertyId[1]); + } + + // TODO: Delete + //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name) + //{ + // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); + // + // if (!parentPropertySet) + // { + // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); + // return nullptr; + // } + + // return parentPropertySet->AddProperty(name); + //} + + const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const + { + for (const auto& propertySet : inPropertySetList) + { + if (propertySet->m_name != parsedPropertySetId[0]) + { + continue; + } + else if (parsedPropertySetId.size() == 1) + { + return propertySet.get(); + } + else + { + AZStd::array_view subPath{parsedPropertySetId.begin() + 1, parsedPropertySetId.end()}; + + if (!subPath.empty()) + { + const MaterialTypeSourceData::PropertySet* propertySubset = FindPropertySet(subPath, propertySet->m_propertySets); + if (propertySubset) + { + return propertySubset; + } + } } } return nullptr; } - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName) const - { - auto groupIter = m_propertyLayout.m_properties.find(groupName); - if (groupIter == m_propertyLayout.m_properties.end()) - { - return nullptr; - } + //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) + //{ + // return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); + //} - for (const PropertyDefinition& property : groupIter->second) + const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) const + { + AZStd::vector tokens = TokenizeId(propertySetId); + return FindPropertySet(tokens, m_propertyLayout.m_propertySets); + } + + //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet) + //{ + // if (parsedPropertyId.size() == 1) + // { + // for (AZStd::unique_ptr& property : inPropertySet.m_properties) + // { + // if (property->m_name == parsedPropertyId[0]) + // { + // return property.get(); + // } + // } + // } + + // return FindProperty(parsedPropertyId, inPropertySet.m_propertySets); + //} + + //const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const + //{ + // MaterialTypeSourceData* nonConstThis = const_cast(this); + // PropertySet& nonConstPropertySet = *const_cast(&inPropertySet); + // return const_cast(nonConstThis->FindProperty(parsedPropertyId, nonConstPropertySet)); + //} + + const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( + AZStd::array_view parsedPropertyId, + AZStd::array_view> inPropertySetList) const + { + for (const auto& propertySet : inPropertySetList) { - if (property.m_name == propertyName) + if (propertySet->m_name == parsedPropertyId[0]) { - return &property; + AZStd::array_view subPath {parsedPropertyId.begin() + 1, parsedPropertyId.end()}; + + if (subPath.size() == 1) + { + for (AZStd::unique_ptr& property : propertySet->m_properties) + { + if (property->m_name == subPath[0]) + { + return property.get(); + } + } + } + else if(subPath.size() > 1) + { + const MaterialTypeSourceData::PropertyDefinition* property = FindProperty(subPath, propertySet->m_propertySets); + if (property) + { + return property; + } + } } } return nullptr; } + //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) + //{ + // return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); + //} + + const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) const + { + AZStd::vector tokens = TokenizeId(propertyId); + return FindProperty(tokens, m_propertyLayout.m_propertySets); + } + + AZStd::vector MaterialTypeSourceData::TokenizeId(AZStd::string_view id) + { + AZStd::vector tokens; + AzFramework::StringFunc::Tokenize(id, tokens, "./", true, true); + return tokens; + } + + AZStd::vector MaterialTypeSourceData::SplitId(AZStd::string_view id) + { + AZStd::vector parts; + parts.reserve(2); + size_t lastDelim = id.rfind('.', id.size()-1); + if (lastDelim == AZStd::string::npos) + { + parts.push_back(id); + } + else + { + parts.push_back(AZStd::string_view{id.begin(), id.begin()+lastDelim}); + parts.push_back(AZStd::string_view{id.begin()+lastDelim+1, id.end()}); + } + + return parts; + } + + bool MaterialTypeSourceData::EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertySetList) const + { + for (auto& propertySet : inPropertySetList) + { + if (!callback(propertyNameContext, propertySet.get())) + { + return false; // Stop processing + } + + const AZStd::string propertyNameContext2 = propertyNameContext + propertySet->m_name + "."; + + if (!EnumeratePropertySets(callback, propertyNameContext2, propertySet->m_propertySets)) + { + return false; // Stop processing + } + } + + return true; + } + + bool MaterialTypeSourceData::EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const + { + if (!callback) + { + return false; + } + + return EnumeratePropertySets(callback, {}, m_propertyLayout.m_propertySets); + } + + bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertySetList) const + { + + for (auto& propertySet : inPropertySetList) + { + const AZStd::string propertyNameContext2 = propertyNameContext + propertySet->m_name + "."; + + for (auto& property : propertySet->m_properties) + { + if (!callback(propertyNameContext2, property.get())) + { + return false; // Stop processing + } + } + + if (!EnumerateProperties(callback, propertyNameContext2, propertySet->m_propertySets)) + { + return false; // Stop processing + } + } + + return true; + } + + bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback) const + { + if (!callback) + { + return false; + } + + return EnumerateProperties(callback, {}, m_propertyLayout.m_propertySets); + } + + bool MaterialTypeSourceData::ConvertToNewDataFormat() + { + for (const auto& group : GetOldFormatGroupDefinitionsInDisplayOrder()) + { + auto propertyListItr = m_propertyLayout.m_properties.find(group.m_name); + if (propertyListItr != m_propertyLayout.m_properties.end()) + { + const auto& propertyList = propertyListItr->second; + for (auto& propertyDefinition : propertyList) + { + PropertySet* propertySet = const_cast(const_cast(this)->FindPropertySet(group.m_name)); + + if (!propertySet) + { + m_propertyLayout.m_propertySets.emplace_back(AZStd::make_unique()); + m_propertyLayout.m_propertySets.back()->m_name = group.m_name; + m_propertyLayout.m_propertySets.back()->m_displayName = group.m_displayName; + m_propertyLayout.m_propertySets.back()->m_description = group.m_description; + propertySet = m_propertyLayout.m_propertySets.back().get(); + } + + PropertyDefinition* newProperty = propertySet->AddProperty(propertyDefinition.m_name); + + *newProperty = propertyDefinition; + } + } + } + + m_propertyLayout.m_groups.clear(); + m_propertyLayout.m_properties.clear(); + + return true; + } + void MaterialTypeSourceData::ResolveUvEnums() { AZStd::vector enumValues; @@ -137,20 +506,20 @@ namespace AZ { enumValues.push_back(uvNamePair.second); } - - for (auto& group : m_propertyLayout.m_properties) - { - for (PropertyDefinition& property : group.second) + + EnumerateProperties([&enumValues](const AZStd::string&, const MaterialTypeSourceData::PropertyDefinition* property) { - if (property.m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && property.m_enumIsUv) + if (property->m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && property->m_enumIsUv) { - property.m_enumValues = enumValues; + // const_cast is safe because this is internal to the MaterialTypeSourceData. It isn't worth complicating things + // by adding another version of EnumerateProperties. + const_cast(property)->m_enumValues = enumValues; } - } - } + return true; + }); } - AZStd::vector MaterialTypeSourceData::GetGroupDefinitionsInDisplayOrder() const + AZStd::vector MaterialTypeSourceData::GetOldFormatGroupDefinitionsInDisplayOrder() const { AZStd::vector groupDefinitions; groupDefinitions.reserve(m_propertyLayout.m_properties.size()); @@ -184,54 +553,7 @@ namespace AZ return groupDefinitions; } - void MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback) const - { - if (!callback) - { - return; - } - - for (const auto& propertyListPair : m_propertyLayout.m_properties) - { - const AZStd::string& groupName = propertyListPair.first; - const auto& propertyList = propertyListPair.second; - for (const auto& propertyDefinition : propertyList) - { - const AZStd::string& propertyName = propertyDefinition.m_name; - if (!callback(groupName, propertyName, propertyDefinition)) - { - return; - } - } - } - } - - void MaterialTypeSourceData::EnumeratePropertiesInDisplayOrder(const EnumeratePropertiesCallback& callback) const - { - if (!callback) - { - return; - } - - for (const auto& groupDefinition : GetGroupDefinitionsInDisplayOrder()) - { - const AZStd::string& groupName = groupDefinition.m_name; - const auto propertyListItr = m_propertyLayout.m_properties.find(groupName); - if (propertyListItr != m_propertyLayout.m_properties.end()) - { - const auto& propertyList = propertyListItr->second; - for (const auto& propertyDefinition : propertyList) - { - const AZStd::string& propertyName = propertyDefinition.m_name; - if (!callback(groupName, propertyName, propertyDefinition)) - { - return; - } - } - } - } - } - + // TODO: It looks like this function doesn't operate on MaterialTypeSourceData data, it belongs in MaterialUtils bool MaterialTypeSourceData::ConvertPropertyValueToSourceDataFormat(const PropertyDefinition& propertyDefinition, MaterialPropertyValue& propertyValue) const { if (propertyDefinition.m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && propertyValue.Is()) @@ -274,6 +596,178 @@ namespace AZ return true; } + bool MaterialTypeSourceData::BuildPropertyList( + const AZStd::string& materialTypeSourceFilePath, + MaterialTypeAssetCreator& materialTypeAssetCreator, + AZStd::vector& propertyNameContext, + const MaterialTypeSourceData::PropertySet* propertySet) const + { + for (const AZStd::unique_ptr& property : propertySet->m_properties) + { + // Register the property... + + MaterialPropertyId propertyId{propertyNameContext, property->m_name}; + + if (!propertyId.IsValid()) + { + // MaterialPropertyId reports an error message + return false; + } + + auto propertySetIter = AZStd::find_if(propertySet->GetPropertySets().begin(), propertySet->GetPropertySets().end(), + [&property](const AZStd::unique_ptr& existingPropertySet) + { + return existingPropertySet->GetName() == property->m_name; + }); + + if (propertySetIter != propertySet->GetPropertySets().end()) + { + AZ_Error("Material source data", false, "Material property '%s' collides with a PropertySet with the same ID.", propertyId.GetCStr()); + return false; + } + + materialTypeAssetCreator.BeginMaterialProperty(propertyId, property->m_dataType); + + if (property->m_dataType == MaterialPropertyDataType::Enum) + { + materialTypeAssetCreator.SetMaterialPropertyEnumNames(property->m_enumValues); + } + + for (auto& output : property->m_outputConnections) + { + switch (output.m_type) + { + case MaterialPropertyOutputType::ShaderInput: + { + materialTypeAssetCreator.ConnectMaterialPropertyToShaderInput(Name{output.m_fieldName}); + break; + } + case MaterialPropertyOutputType::ShaderOption: + { + if (output.m_shaderIndex >= 0) + { + materialTypeAssetCreator.ConnectMaterialPropertyToShaderOption(Name{output.m_fieldName}, output.m_shaderIndex); + } + else + { + materialTypeAssetCreator.ConnectMaterialPropertyToShaderOptions(Name{output.m_fieldName}); + } + break; + } + case MaterialPropertyOutputType::Invalid: + // Don't add any output mappings, this is the case when material functors are expected to process the property + break; + default: + AZ_Assert(false, "Unsupported MaterialPropertyOutputType"); + return false; + } + } + + materialTypeAssetCreator.EndMaterialProperty(); + + // Parse and set the property's value... + if (!property->m_value.IsValid()) + { + AZ_Warning("Material source data", false, "Source data for material property value is invalid."); + } + else + { + switch (property->m_dataType) + { + case MaterialPropertyDataType::Image: + { + Outcome> imageAssetResult = MaterialUtils::GetImageAssetReference(materialTypeSourceFilePath, property->m_value.GetValue()); + + if (imageAssetResult.IsSuccess()) + { + materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); + } + else + { + materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property->m_value.GetValue().data()); + } + } + break; + case MaterialPropertyDataType::Enum: + { + MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); + const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); + + AZ::Name enumName = AZ::Name(property->m_value.GetValue()); + uint32_t enumValue = propertyDescriptor->GetEnumValue(enumName); + if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) + { + materialTypeAssetCreator.ReportError("Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); + } + else + { + materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); + } + } + break; + default: + materialTypeAssetCreator.SetPropertyValue(propertyId, property->m_value); + break; + } + } + } + + for (const AZStd::unique_ptr& propertySubset : propertySet->m_propertySets) + { + propertyNameContext.push_back(propertySubset->m_name); + + bool success = BuildPropertyList( + materialTypeSourceFilePath, + materialTypeAssetCreator, + propertyNameContext, + propertySubset.get()); + + propertyNameContext.pop_back(); + + if (!success) + { + return false; + } + } + + // We cannot create the MaterialFunctor until after all the properties are added because + // CreateFunctor() may need to look up properties in the MaterialPropertiesLayout + for (auto& functorData : propertySet->m_materialFunctorSourceData) + { + MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor( + MaterialFunctorSourceData::RuntimeContext( + materialTypeSourceFilePath, + materialTypeAssetCreator.GetMaterialPropertiesLayout(), + materialTypeAssetCreator.GetMaterialShaderResourceGroupLayout(), + materialTypeAssetCreator.GetShaderCollection() + ) + ); + + if (result.IsSuccess()) + { + Ptr& functor = result.GetValue(); + if (functor != nullptr) + { + materialTypeAssetCreator.AddMaterialFunctor(functor); + + for (const AZ::Name& optionName : functorData->GetActualSourceData()->GetShaderOptionDependencies()) + { + materialTypeAssetCreator.ClaimShaderOptionOwnership(Name{optionName.GetCStr()}); + } + } + } + else + { + materialTypeAssetCreator.ReportError("Failed to create MaterialFunctor"); + return false; + } + } + + + return true; + } + + Outcome> MaterialTypeSourceData::CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath, bool elevateWarnings) const { MaterialTypeAssetCreator materialTypeAssetCreator; @@ -327,103 +821,16 @@ namespace AZ return Failure(); } } - - for (auto& groupIter : m_propertyLayout.m_properties) + + for (const AZStd::unique_ptr& propertySet : m_propertyLayout.m_propertySets) { - const AZStd::string& groupName = groupIter.first; + AZStd::vector propertyNameContext; + propertyNameContext.push_back(propertySet->m_name); + bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyNameContext, propertySet.get()); - for (const PropertyDefinition& property : groupIter.second) + if (!success) { - // Register the property... - - MaterialPropertyId propertyId{ groupName, property.m_name }; - - if (!propertyId.IsValid()) - { - materialTypeAssetCreator.ReportWarning("Cannot create material property with invalid ID '%s'.", propertyId.GetCStr()); - continue; - } - - materialTypeAssetCreator.BeginMaterialProperty(propertyId, property.m_dataType); - - if (property.m_dataType == MaterialPropertyDataType::Enum) - { - materialTypeAssetCreator.SetMaterialPropertyEnumNames(property.m_enumValues); - } - - for (auto& output : property.m_outputConnections) - { - switch (output.m_type) - { - case MaterialPropertyOutputType::ShaderInput: - materialTypeAssetCreator.ConnectMaterialPropertyToShaderInput(Name{ output.m_fieldName.data() }); - break; - case MaterialPropertyOutputType::ShaderOption: - if (output.m_shaderIndex >= 0) - { - materialTypeAssetCreator.ConnectMaterialPropertyToShaderOption(Name{ output.m_fieldName.data() }, output.m_shaderIndex); - } - else - { - materialTypeAssetCreator.ConnectMaterialPropertyToShaderOptions(Name{ output.m_fieldName.data() }); - } - break; - case MaterialPropertyOutputType::Invalid: - // Don't add any output mappings, this is the case when material functors are expected to process the property - break; - default: - AZ_Assert(false, "Unsupported MaterialPropertyOutputType"); - return Failure(); - } - } - - materialTypeAssetCreator.EndMaterialProperty(); - - // Parse and set the property's value... - if (!property.m_value.IsValid()) - { - AZ_Warning("Material source data", false, "Source data for material property value is invalid."); - } - else - { - switch (property.m_dataType) - { - case MaterialPropertyDataType::Image: - { - Outcome> imageAssetResult = MaterialUtils::GetImageAssetReference(materialTypeSourceFilePath, property.m_value.GetValue()); - - if (imageAssetResult.IsSuccess()) - { - materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); - } - else - { - materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property.m_value.GetValue().data()); - } - } - break; - case MaterialPropertyDataType::Enum: - { - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - - AZ::Name enumName = AZ::Name(property.m_value.GetValue()); - uint32_t enumValue = propertyDescriptor ? propertyDescriptor->GetEnumValue(enumName) : MaterialPropertyDescriptor::InvalidEnumValue; - if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) - { - materialTypeAssetCreator.ReportError("Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); - } - else - { - materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); - } - } - break; - default: - materialTypeAssetCreator.SetPropertyValue(propertyId, property.m_value); - break; - } - } + return Failure(); } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp index 90ce9e66ce..174a2e682a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp @@ -90,6 +90,7 @@ namespace AZ settings.m_metadata.Add(fileLoadContext); JsonSerialization::Load(materialType, *document, settings); + materialType.ConvertToNewDataFormat(); materialType.ResolveUvEnums(); if (reportingHelper.ErrorsReported()) diff --git a/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp b/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp index fa88f145a6..06cdb073e9 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp +++ b/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp @@ -84,7 +84,7 @@ namespace UnitTest } } - m_checked = true; + m_checked = true; } void ErrorMessageFinder::ReportFailure(const AZStd::string& failureMessage) diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp index 2b729ed8ef..80da59b430 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertyIdTests.cpp @@ -94,6 +94,40 @@ namespace UnitTest errorMessageFinder.CheckExpectedErrorsFound(); } + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleParentNamesSeparateFromPropertyName) + { + AZStd::vector names{"layer1", "clearCoat", "normal"}; + MaterialPropertyId id{names, "factor"}; + EXPECT_TRUE(id.IsValid()); + EXPECT_STREQ(id.GetCStr(), "layer1.clearCoat.normal.factor"); + AZ::Name idCastedToName = id; + EXPECT_EQ(idCastedToName, AZ::Name{"layer1.clearCoat.normal.factor"}); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleParentNamesSeparateFromPropertyName_BadParentName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clear-coat", "normal"}; + MaterialPropertyId id{names, "factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialPropertyIdTests, TestConstructWithMultipleParentNamesSeparateFromPropertyName_BadPropertyName) + { + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("not a valid identifier"); + + AZStd::vector names{"layer1", "clearCoat", "normal"}; + MaterialPropertyId id{names, "#factor"}; + EXPECT_FALSE(id.IsValid()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + TEST_F(MaterialPropertyIdTests, TestParse) { MaterialPropertyId id = MaterialPropertyId::Parse("layer1.clearCoat.normal.factor"); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index dd3b3b2711..293289b00f 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -201,33 +201,38 @@ namespace UnitTest TEST_F(MaterialSourceDataTests, TestJsonRoundTrip) { const char* materialTypeJson = - "{ \n" - " \"propertyLayout\": { \n" - " \"version\": 1, \n" - " \"groups\": [ \n" - " { \"name\": \"groupA\" }, \n" - " { \"name\": \"groupB\" }, \n" - " { \"name\": \"groupC\" } \n" - " ], \n" - " \"properties\": { \n" - " \"groupA\": [ \n" - " {\"name\": \"MyBool\", \"type\": \"bool\"}, \n" - " {\"name\": \"MyInt\", \"type\": \"int\"}, \n" - " {\"name\": \"MyUInt\", \"type\": \"uint\"} \n" - " ], \n" - " \"groupB\": [ \n" - " {\"name\": \"MyFloat\", \"type\": \"float\"}, \n" - " {\"name\": \"MyFloat2\", \"type\": \"vector2\"}, \n" - " {\"name\": \"MyFloat3\", \"type\": \"vector3\"} \n" - " ], \n" - " \"groupC\": [ \n" - " {\"name\": \"MyFloat4\", \"type\": \"vector4\"}, \n" - " {\"name\": \"MyColor\", \"type\": \"color\"}, \n" - " {\"name\": \"MyImage\", \"type\": \"image\"} \n" - " ] \n" - " } \n" - " } \n" - "} \n"; + R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "groupA", + "properties": [ + {"name": "MyBool", "type": "bool"}, + {"name": "MyInt", "type": "int"}, + {"name": "MyUInt", "type": "uint"} + ] + }, + { + "name": "groupB", + "properties": [ + {"name": "MyFloat", "type": "float"}, + {"name": "MyFloat2", "type": "vector2"}, + {"name": "MyFloat3", "type": "vector3"} + ] + }, + { + "name": "groupC", + "properties": [ + {"name": "MyFloat4", "type": "vector4"}, + {"name": "MyColor", "type": "color"}, + {"name": "MyImage", "type": "image"} + ] + } + ] + } + } + )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/roundTripTest.materialtype"; @@ -259,25 +264,29 @@ namespace UnitTest MaterialSourceData sourceDataCopy; JsonTestResult loadResult = LoadTestDataFromJson(sourceDataCopy, sourceDataSerialized); - + CheckEqual(sourceDataOriginal, sourceDataCopy); } TEST_F(MaterialSourceDataTests, Load_MaterialTypeAfterPropertyList) { const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ + { + "propertyLayout": { + "propertySets": + [ { - "name": "testColor", - "type": "color" + "name": "general", + "properties": [ + { + "name": "testColor", + "type": "color" + } + ] } ] } } - } )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/simpleMaterialType.materialtype"; @@ -376,18 +385,22 @@ namespace UnitTest TEST_F(MaterialSourceDataTests, Load_MaterialTypeMessagesAreReported) { const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ + { + "propertyLayout": { + "propertySets": + [ { - "name": "testColor", - "type": "color" + "name": "general", + "properties": [ + { + "name": "testColor", + "type": "color" + } + ] } ] } } - } )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/simpleMaterialType.materialtype"; @@ -416,24 +429,28 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); // propertyLayout is a field in the material type, not the material - EXPECT_TRUE(loadResult.ContainsMessage("[simpleMaterialType.materialtype]/propertyLayout/properties", "Successfully read")); + EXPECT_TRUE(loadResult.ContainsMessage("[simpleMaterialType.materialtype]/propertyLayout/propertySets", "Successfully read")); } TEST_F(MaterialSourceDataTests, Load_Error_PropertyNotFound) { const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ + { + "propertyLayout": { + "propertySets": + [ { - "name": "testColor", - "type": "color" + "name": "general", + "properties": [ + { + "name": "testColor", + "type": "color" + } + ] } ] } } - } )"; const char* materialTypeFilePath = "@exefolder@/Gems/Atom/RPI/Code/Tests/Material/Temp/simpleMaterialType.materialtype"; diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index ba4a58b9ff..00523abbd8 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -225,6 +226,7 @@ namespace UnitTest { serializeContext->Class() ->Version(1) + ->Field("enableProperty", &SetShaderOptionFunctorSourceData::m_enablePropertyName) ; } } @@ -243,6 +245,8 @@ namespace UnitTest Ptr functor = aznew SetShaderOptionFunctor; return Success(Ptr(functor)); } + + AZStd::string m_enablePropertyName; }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -350,9 +354,316 @@ namespace UnitTest EXPECT_EQ(propertyDescriptor->GetOutputConnections()[i].m_containerIndex.GetIndex(), expectedValues.m_outputConnections[i].m_shaderIndex); } } - }; + TEST_F(MaterialTypeSourceDataTests, PopulateAndSearchPropertyLayout) + { + MaterialTypeSourceData sourceData; + + // Here we are building up multiple layers of property sets and properties, using a variety of different Add functions, + // going through the MaterialTypeSourceData or going to the PropertySet directly. + + MaterialTypeSourceData::PropertySet* layer1 = sourceData.AddPropertySet("layer1"); + MaterialTypeSourceData::PropertySet* layer2 = sourceData.AddPropertySet("layer2"); + MaterialTypeSourceData::PropertySet* blend = sourceData.AddPropertySet("blend"); + + MaterialTypeSourceData::PropertySet* layer1_baseColor = layer1->AddPropertySet("baseColor"); + MaterialTypeSourceData::PropertySet* layer2_baseColor = layer2->AddPropertySet("baseColor"); + + MaterialTypeSourceData::PropertySet* layer1_roughness = sourceData.AddPropertySet("layer1.roughness"); + MaterialTypeSourceData::PropertySet* layer2_roughness = sourceData.AddPropertySet("layer2.roughness"); + + MaterialTypeSourceData::PropertyDefinition* layer1_baseColor_texture = layer1_baseColor->AddProperty("texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_baseColor_texture = layer2_baseColor->AddProperty("texture"); + + MaterialTypeSourceData::PropertyDefinition* layer1_roughness_texture = sourceData.AddProperty("layer1.roughness.texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_roughness_texture = sourceData.AddProperty("layer2.roughness.texture"); + + // We're doing clear coat only on layer2, for brevity + MaterialTypeSourceData::PropertySet* layer2_clearCoat = layer2->AddPropertySet("clearCoat"); + MaterialTypeSourceData::PropertySet* layer2_clearCoat_roughness = layer2_clearCoat->AddPropertySet("roughness"); + MaterialTypeSourceData::PropertySet* layer2_clearCoat_normal = layer2_clearCoat->AddPropertySet("normal"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_enabled = layer2_clearCoat->AddProperty("enabled"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_roughness_texture = layer2_clearCoat_roughness->AddProperty("texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_normal_texture = layer2_clearCoat_normal->AddProperty("texture"); + MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_normal_factor = layer2_clearCoat_normal->AddProperty("factor"); + + MaterialTypeSourceData::PropertyDefinition* blend_factor = blend->AddProperty("factor"); + + // Check the available Find functions + + EXPECT_EQ(nullptr, sourceData.FindProperty("DoesNotExist")); + EXPECT_EQ(nullptr, sourceData.FindProperty("layer1.DoesNotExist")); + EXPECT_EQ(nullptr, sourceData.FindProperty("layer1.baseColor.DoesNotExist")); + EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor.texture")); + EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor")); // This is a property set, not a property + EXPECT_EQ(nullptr, sourceData.FindPropertySet("baseColor.texture")); // This is a property, not a property set + + EXPECT_EQ(layer1, sourceData.FindPropertySet("layer1")); + EXPECT_EQ(layer2, sourceData.FindPropertySet("layer2")); + EXPECT_EQ(blend, sourceData.FindPropertySet("blend")); + + EXPECT_EQ(layer1_baseColor, sourceData.FindPropertySet("layer1.baseColor")); + EXPECT_EQ(layer2_baseColor, sourceData.FindPropertySet("layer2.baseColor")); + + EXPECT_EQ(layer1_roughness, sourceData.FindPropertySet("layer1.roughness")); + EXPECT_EQ(layer2_roughness, sourceData.FindPropertySet("layer2.roughness")); + + EXPECT_EQ(layer1_baseColor_texture, sourceData.FindProperty("layer1.baseColor.texture")); + EXPECT_EQ(layer2_baseColor_texture, sourceData.FindProperty("layer2.baseColor.texture")); + EXPECT_EQ(layer1_roughness_texture, sourceData.FindProperty("layer1.roughness.texture")); + EXPECT_EQ(layer2_roughness_texture, sourceData.FindProperty("layer2.roughness.texture")); + + EXPECT_EQ(layer2_clearCoat, sourceData.FindPropertySet("layer2.clearCoat")); + EXPECT_EQ(layer2_clearCoat_roughness, sourceData.FindPropertySet("layer2.clearCoat.roughness")); + EXPECT_EQ(layer2_clearCoat_normal, sourceData.FindPropertySet("layer2.clearCoat.normal")); + + EXPECT_EQ(layer2_clearCoat_enabled, sourceData.FindProperty("layer2.clearCoat.enabled")); + EXPECT_EQ(layer2_clearCoat_roughness_texture, sourceData.FindProperty("layer2.clearCoat.roughness.texture")); + EXPECT_EQ(layer2_clearCoat_normal_texture, sourceData.FindProperty("layer2.clearCoat.normal.texture")); + EXPECT_EQ(layer2_clearCoat_normal_factor, sourceData.FindProperty("layer2.clearCoat.normal.factor")); + + EXPECT_EQ(blend_factor, sourceData.FindProperty("blend.factor")); + + // Check EnumeratePropertySets + + struct EnumeratePropertySetsResult + { + AZStd::string m_propertyIdContext; + const MaterialTypeSourceData::PropertySet* m_propertySet; + + void Check(AZStd::string expectedIdContext, const MaterialTypeSourceData::PropertySet* expectedPropertySet) + { + EXPECT_EQ(expectedIdContext, m_propertyIdContext); + EXPECT_EQ(expectedPropertySet, m_propertySet); + } + }; + AZStd::vector enumeratePropertySetsResults; + + sourceData.EnumeratePropertySets([&enumeratePropertySetsResults](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertySet* propertySet) + { + enumeratePropertySetsResults.push_back(EnumeratePropertySetsResult{propertyIdContext, propertySet}); + return true; + }); + + int resultIndex = 0; + enumeratePropertySetsResults[resultIndex++].Check("", layer1); + enumeratePropertySetsResults[resultIndex++].Check("layer1.", layer1_baseColor); + enumeratePropertySetsResults[resultIndex++].Check("layer1.", layer1_roughness); + enumeratePropertySetsResults[resultIndex++].Check("", layer2); + enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_baseColor); + enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_roughness); + enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_clearCoat); + enumeratePropertySetsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_roughness); + enumeratePropertySetsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_normal); + enumeratePropertySetsResults[resultIndex++].Check("", blend); + EXPECT_EQ(resultIndex, enumeratePropertySetsResults.size()); + + // Check EnumerateProperties + + struct EnumeratePropertiesResult + { + AZStd::string m_propertyIdContext; + const MaterialTypeSourceData::PropertyDefinition* m_propertyDefinition; + + void Check(AZStd::string expectedIdContext, const MaterialTypeSourceData::PropertyDefinition* expectedPropertyDefinition) + { + EXPECT_EQ(expectedIdContext, m_propertyIdContext); + EXPECT_EQ(expectedPropertyDefinition, m_propertyDefinition); + } + }; + AZStd::vector enumeratePropertiesResults; + + sourceData.EnumerateProperties([&enumeratePropertiesResults](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertyDefinition* propertyDefinition) + { + enumeratePropertiesResults.push_back(EnumeratePropertiesResult{propertyIdContext, propertyDefinition}); + return true; + }); + + resultIndex = 0; + enumeratePropertiesResults[resultIndex++].Check("layer1.baseColor.", layer1_baseColor_texture); + enumeratePropertiesResults[resultIndex++].Check("layer1.roughness.", layer1_roughness_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.baseColor.", layer2_baseColor_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.roughness.", layer2_roughness_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_enabled); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.roughness.", layer2_clearCoat_roughness_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.normal.", layer2_clearCoat_normal_texture); + enumeratePropertiesResults[resultIndex++].Check("layer2.clearCoat.normal.", layer2_clearCoat_normal_factor); + enumeratePropertiesResults[resultIndex++].Check("blend.", blend_factor); + EXPECT_EQ(resultIndex, enumeratePropertiesResults.size()); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddPropertyWithInvalidName) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("'' is not a valid identifier"); + errorMessageFinder.AddExpectedErrorMessage("'main.' is not a valid identifier"); + errorMessageFinder.AddExpectedErrorMessage("'base-color' is not a valid identifier"); + + EXPECT_FALSE(propertySet->AddProperty("")); + EXPECT_FALSE(propertySet->AddProperty("main.")); + EXPECT_FALSE(sourceData.AddProperty("main.base-color")); + + EXPECT_TRUE(propertySet->GetProperties().empty()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_InvalidName) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("'' is not a valid identifier", 2); + errorMessageFinder.AddExpectedErrorMessage("'base-color' is not a valid identifier"); + errorMessageFinder.AddExpectedErrorMessage("'look@it' is not a valid identifier"); + + EXPECT_FALSE(propertySet->AddPropertySet("")); + EXPECT_FALSE(sourceData.AddPropertySet("")); + EXPECT_FALSE(sourceData.AddPropertySet("base-color")); + EXPECT_FALSE(sourceData.AddPropertySet("general.look@it")); + + EXPECT_TRUE(propertySet->GetProperties().empty()); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddDuplicateProperty) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("PropertySet 'main' already contains a property named 'foo'", 2); + + EXPECT_TRUE(propertySet->AddProperty("foo")); + EXPECT_FALSE(propertySet->AddProperty("foo")); + EXPECT_FALSE(sourceData.AddProperty("main.foo")); + + EXPECT_EQ(propertySet->GetProperties().size(), 1); + + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddLooseProperty) + { + MaterialTypeSourceData sourceData; + ErrorMessageFinder errorMessageFinder("Property id 'foo' is invalid. Properties must be added to a PropertySet"); + EXPECT_FALSE(sourceData.AddProperty("foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_PropertySetDoesNotExist ) + { + MaterialTypeSourceData sourceData; + ErrorMessageFinder errorMessageFinder("PropertySet 'DNE' does not exists"); + EXPECT_FALSE(sourceData.AddProperty("DNE.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_PropertySetDoesNotExist ) + { + MaterialTypeSourceData sourceData; + ErrorMessageFinder errorMessageFinder("PropertySet 'DNE' does not exists"); + EXPECT_FALSE(sourceData.AddPropertySet("DNE.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_AddDuplicatePropertySet) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + sourceData.AddPropertySet("main.level2"); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage("PropertySet named 'main' already exists", 1); + errorMessageFinder.AddExpectedErrorMessage("PropertySet named 'level2' already exists", 2); + + EXPECT_FALSE(sourceData.AddPropertySet("main")); + EXPECT_FALSE(sourceData.AddPropertySet("main.level2")); + EXPECT_FALSE(propertySet->AddPropertySet("level2")); + + errorMessageFinder.CheckExpectedErrorsFound(); + + EXPECT_EQ(sourceData.GetPropertyLayout().m_propertySets.size(), 1); + EXPECT_EQ(propertySet->GetPropertySets().size(), 1); + } + + TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_NameCollidesWithProperty ) + { + MaterialTypeSourceData sourceData; + sourceData.AddPropertySet("main"); + sourceData.AddProperty("main.foo"); + + ErrorMessageFinder errorMessageFinder("PropertySet name 'foo' collides with a Property of the same name"); + EXPECT_FALSE(sourceData.AddPropertySet("main.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_NameCollidesWithPropertySet ) + { + MaterialTypeSourceData sourceData; + sourceData.AddPropertySet("main"); + sourceData.AddPropertySet("main.foo"); + + ErrorMessageFinder errorMessageFinder("Property name 'foo' collides with a PropertySet of the same name"); + EXPECT_FALSE(sourceData.AddProperty("main.foo")); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, ResolveUvStreamAsEnum) + { + MaterialTypeSourceData sourceData; + + sourceData.m_uvNameMap["UV0"] = "Tiled"; + sourceData.m_uvNameMap["UV1"] = "Unwrapped"; + sourceData.m_uvNameMap["UV2"] = "Other"; + + sourceData.AddPropertySet("a"); + sourceData.AddPropertySet("a.b"); + sourceData.AddPropertySet("c"); + sourceData.AddPropertySet("c.d"); + sourceData.AddPropertySet("c.d.e"); + + MaterialTypeSourceData::PropertyDefinition* enum1 = sourceData.AddProperty("a.enum1"); + MaterialTypeSourceData::PropertyDefinition* enum2 = sourceData.AddProperty("a.b.enum2"); + MaterialTypeSourceData::PropertyDefinition* enum3 = sourceData.AddProperty("c.d.e.enum3"); + MaterialTypeSourceData::PropertyDefinition* notEnum = sourceData.AddProperty("c.d.myFloat"); + + enum1->m_dataType = MaterialPropertyDataType::Enum; + enum2->m_dataType = MaterialPropertyDataType::Enum; + enum3->m_dataType = MaterialPropertyDataType::Enum; + notEnum->m_dataType = MaterialPropertyDataType::Float; + + enum1->m_enumIsUv = true; + enum2->m_enumIsUv = false; + enum3->m_enumIsUv = true; + + sourceData.ResolveUvEnums(); + + EXPECT_STREQ(enum1->m_enumValues[0].c_str(), "Tiled"); + EXPECT_STREQ(enum1->m_enumValues[1].c_str(), "Unwrapped"); + EXPECT_STREQ(enum1->m_enumValues[2].c_str(), "Other"); + + EXPECT_STREQ(enum3->m_enumValues[0].c_str(), "Tiled"); + EXPECT_STREQ(enum3->m_enumValues[1].c_str(), "Unwrapped"); + EXPECT_STREQ(enum3->m_enumValues[2].c_str(), "Other"); + + // enum2 is not a UV stream enum + EXPECT_EQ(enum2->m_enumValues.size(), 0); + + // myFloat is not even an enum + EXPECT_EQ(notEnum->m_enumValues.size(), 0); + } + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_GetMaterialSrgAsset) { MaterialTypeSourceData sourceData; @@ -509,15 +820,14 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyBool"; - propertySource.m_displayName = "My Bool"; - propertySource.m_description = "This is a bool"; - propertySource.m_dataType = MaterialPropertyDataType::Bool; - propertySource.m_value = true; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_bool") }); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyBool"); + property->m_displayName = "My Bool"; + property->m_description = "This is a bool"; + property->m_dataType = MaterialPropertyDataType::Bool; + property->m_value = true; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_bool") }); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); @@ -525,7 +835,7 @@ namespace UnitTest const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{ "general.MyBool" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 7); } @@ -534,20 +844,19 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyFloat"; - propertySource.m_displayName = "My Float"; - propertySource.m_description = "This is a float"; - propertySource.m_min = 0.0f; - propertySource.m_max = 1.0f; - propertySource.m_softMin = 0.2f; - propertySource.m_softMax = 1.0f; - propertySource.m_step = 0.01f; - propertySource.m_dataType = MaterialPropertyDataType::Float; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_float") }); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyFloat"); + property->m_displayName = "My Float"; + property->m_description = "This is a float"; + property->m_min = 0.0f; + property->m_max = 1.0f; + property->m_softMin = 0.2f; + property->m_softMax = 1.0f; + property->m_step = 0.01f; + property->m_dataType = MaterialPropertyDataType::Float; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_float") }); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); @@ -555,7 +864,7 @@ namespace UnitTest const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.MyFloat" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 1); } @@ -564,15 +873,14 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyImage"; - propertySource.m_displayName = "My Image"; - propertySource.m_description = "This is an image"; - propertySource.m_dataType = MaterialPropertyDataType::Image; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_image") }); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyImage"); + property->m_displayName = "My Image"; + property->m_description = "This is an image"; + property->m_dataType = MaterialPropertyDataType::Image; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_image") }); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); @@ -580,7 +888,7 @@ namespace UnitTest const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.MyImage" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 0); } @@ -589,21 +897,20 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyInt"; - propertySource.m_displayName = "My Integer"; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("o_foo"), 0}); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + property->m_displayName = "My Integer"; + property->m_dataType = MaterialPropertyDataType::Int; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("o_foo"), 0}); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(MaterialPropertyIndex{0}); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(propertyDescriptor->GetOutputConnections()[0].m_itemIndex.GetIndex(), 1); } @@ -612,13 +919,12 @@ namespace UnitTest MaterialTypeSourceData sourceData; sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyInt"; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("DoesNotExist"), 0}); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + property->m_dataType = MaterialPropertyDataType::Int; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("DoesNotExist"), 0}); + AZ_TEST_START_TRACE_SUPPRESSION; auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); AZ_TEST_STOP_TRACE_SUPPRESSION(2); // There happens to be an extra assert for "Cannot continue building MaterialAsset because 1 error(s) reported" @@ -626,66 +932,140 @@ namespace UnitTest EXPECT_FALSE(materialTypeOutcome.IsSuccess()); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidGroupNameId) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidGroupName) { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "not a valid name because it has spaces", + "properties": [ + { + "name": "foo", + "type": "Bool" + } + ] + } + ] + } + } + )"; + MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_dataType = MaterialPropertyDataType::Int; - - propertySource.m_name = "a"; - sourceData.m_propertyLayout.m_properties["not a valid name because it has spaces"].push_back(propertySource); - - // Expected errors: - // Group name 'not a valid name because it has spaces' is not a valid identifier. - // Warning: Cannot create material property with invalid ID 'not a valid name because it has spaces'. - // Failed to build MaterialAsset because 1 warning(s) reported - AZ_TEST_START_TRACE_SUPPRESSION; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder{"'not a valid name because it has spaces' is not a valid identifier"}; auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidPropertyNameId) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_InvalidPropertyName) { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "general", + "properties": [ + { + "name": "not a valid name because it has spaces", + "type": "Bool" + } + ] + } + ] + } + } + )"; + MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_dataType = MaterialPropertyDataType::Int; - - propertySource.m_name = "not a valid name because it has spaces"; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - - // Expected errors: - // Property name 'not a valid name because it has spaces' is not a valid identifier. - // Warning: Cannot create material property with invalid ID 'not a valid name because it has spaces'. - // Failed to build MaterialAsset because 1 warning(s) reported - AZ_TEST_START_TRACE_SUPPRESSION; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder{"'not a valid name because it has spaces' is not a valid identifier"}; auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_DuplicatePropertyId) { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "general", + "properties": [ + { + "name": "foo", + "type": "Bool" + }, + { + "name": "foo", + "type": "Bool" + } + ] + } + ] + } + } + )"; + MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_name = "a"; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - - // Expected errors: - // Material property 'general.a': A property with this ID already exists. - // Cannot continue building MaterialAsset because 1 error(s) reported - AZ_TEST_START_TRACE_SUPPRESSION; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder("Material property 'general.foo': A property with this ID already exists"); + errorMessageFinder.AddExpectedErrorMessage("Cannot continue building MaterialTypeAsset"); auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_PropertyAndPropertySetNameCollision) + { + const AZStd::string inputJson = R"( + { + "propertyLayout": { + "propertySets": [ + { + "name": "general", + "properties": [ + { + "name": "foo", + "type": "Bool" + } + ], + "propertySets": [ + { + "name": "foo", + "properties": [ + { + "name": "bar", + "type": "Bool" + } + ] + } + ] + } + ] + } + } + )"; + + MaterialTypeSourceData sourceData; + JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); + EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); + + ErrorMessageFinder errorMessageFinder("Material property 'general.foo' collides with a PropertySet with the same ID"); + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); + EXPECT_FALSE(materialTypeOutcome.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyConnectedToMultipleOutputs) @@ -736,25 +1116,25 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderA.shader" }); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderB.shader" }); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderC.shader" }); + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyInt"; - propertySource.m_displayName = "Integer"; - propertySource.m_description = "Integer property that is connected to multiple shader settings"; - propertySource.m_dataType = MaterialPropertyDataType::Int; + property->m_displayName = "Integer"; + property->m_description = "Integer property that is connected to multiple shader settings"; + property->m_dataType = MaterialPropertyDataType::Int; // The value maps to m_int in the SRG - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_int") }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_int") }); // The value also maps to m_uint in the SRG - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_uint") }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string("m_uint") }); // The value also maps to the first shader's "o_speed" option - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 0 }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 0 }); // The value also maps to the second shader's "o_speed" option - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 1 }); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_speed"), 1 }); // This case doesn't specify an index, so it will apply to all shaders that have a "o_efficiency", which means it will create two outputs in the property descriptor. - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_efficiency") }); - - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderOption, AZStd::string("o_efficiency") }); + // Do the actual test... @@ -795,15 +1175,15 @@ namespace UnitTest TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyWithShaderInputFunctor) { MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("floatForFunctor"); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "NonAliasFloat"; - propertySource.m_displayName = "Non-Alias Float"; - propertySource.m_description = "This float is processed by a functor, not with a direct alias"; - propertySource.m_dataType = MaterialPropertyDataType::Float; - // Note that we don't fill propertySource.m_aliasOutputId because this is not an aliased property - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + property->m_displayName = "Float for Functor"; + property->m_description = "This float is processed by a functor, not with a direct connection"; + property->m_dataType = MaterialPropertyDataType::Float; + // Note that we don't fill property->m_outputConnections because this is not an aliased property + sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_materialFunctorSourceData.push_back( @@ -811,7 +1191,7 @@ namespace UnitTest ( aznew MaterialFunctorSourceDataHolder ( - aznew Splat3FunctorSourceData{ "general.NonAliasFloat", "m_float3" } + aznew Splat3FunctorSourceData{ "general.floatForFunctor", "m_float3" } ) ) ); @@ -820,10 +1200,10 @@ namespace UnitTest EXPECT_TRUE(materialTypeOutcome.IsSuccess()); Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); - const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.NonAliasFloat" }); + const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.floatForFunctor" }); const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - ValidateCommonDescriptorFields(propertySource, propertyDescriptor); + ValidateCommonDescriptorFields(*property, propertyDescriptor); EXPECT_EQ(1, materialTypeAsset->GetMaterialFunctors().size()); auto shaderInputFunctor = azrtti_cast(materialTypeAsset->GetMaterialFunctors()[0].get()); @@ -841,15 +1221,13 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "EnableSpecialPassA"; - propertySource.m_displayName = "Enable Special Pass"; - propertySource.m_description = "This is a bool to enable an extra shader/pass"; - propertySource.m_dataType = MaterialPropertyDataType::Bool; - // Note that we don't fill propertySource.m_outputConnections because this is not a direct-connected property - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - propertySource.m_name = "EnableSpecialPassB"; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property1 = propertySet->AddProperty("EnableSpecialPassA"); + MaterialTypeSourceData::PropertyDefinition* property2 = propertySet->AddProperty("EnableSpecialPassB"); + + property1->m_displayName = property2->m_displayName = "Enable Special Pass"; + property1->m_description = property2->m_description = "This is a bool to enable an extra shader/pass"; + property1->m_dataType = property2->m_dataType = MaterialPropertyDataType::Bool; sourceData.m_materialFunctorSourceData.push_back( Ptr @@ -880,8 +1258,8 @@ namespace UnitTest const MaterialPropertyIndex propertyBIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.EnableSpecialPassB"}); const MaterialPropertyDescriptor* propertyBDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyBIndex); - ValidateCommonDescriptorFields(propertySource, propertyADescriptor); - ValidateCommonDescriptorFields(propertySource, propertyBDescriptor); + ValidateCommonDescriptorFields(*sourceData.FindProperty("general.EnableSpecialPassA"), propertyADescriptor); + ValidateCommonDescriptorFields(*sourceData.FindProperty("general.EnableSpecialPassB"), propertyBDescriptor); EXPECT_EQ(2, materialTypeAsset->GetMaterialFunctors().size()); auto functorA = azrtti_cast(materialTypeAsset->GetMaterialFunctors()[0].get()); @@ -900,13 +1278,13 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyProperty"); - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "MyProperty"; - propertySource.m_dataType = MaterialPropertyDataType::Bool; - // Note that we don't fill propertySource.m_outputConnections because this is not a direct-connected property - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); - + property->m_dataType = MaterialPropertyDataType::Bool; + // Note that we don't fill property->m_outputConnections because this is not a direct-connected property + sourceData.m_materialFunctorSourceData.push_back( Ptr ( @@ -928,6 +1306,45 @@ namespace UnitTest EXPECT_TRUE(materialTypeAsset->GetShaderCollection()[0].MaterialOwnsShaderOption(Name{"o_foo"})); EXPECT_TRUE(materialTypeAsset->GetShaderCollection()[0].MaterialOwnsShaderOption(Name{"o_bar"})); } + + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_FunctorIsInsidePropertySet) + { + MaterialTypeSourceData sourceData; + + MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("floatForFunctor"); + + property->m_dataType = MaterialPropertyDataType::Float; + + sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); + + sourceData.m_materialFunctorSourceData.push_back( + Ptr + ( + aznew MaterialFunctorSourceDataHolder + ( + aznew Splat3FunctorSourceData{ "general.floatForFunctor", "m_float3" } + ) + ) + ); + + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); + EXPECT_TRUE(materialTypeOutcome.IsSuccess()); + Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); + + const MaterialPropertyIndex propertyIndex = materialTypeAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"general.floatForFunctor" }); + const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAsset->GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); + + ValidateCommonDescriptorFields(*property, propertyDescriptor); + + EXPECT_EQ(1, materialTypeAsset->GetMaterialFunctors().size()); + auto shaderInputFunctor = azrtti_cast(materialTypeAsset->GetMaterialFunctors()[0].get()); + EXPECT_TRUE(nullptr != shaderInputFunctor); + EXPECT_EQ(propertyIndex, shaderInputFunctor->m_floatIndex); + + const RHI::ShaderInputConstantIndex expectedVector3Index = materialTypeAsset->GetMaterialSrgLayout()->FindShaderInputConstantIndex(Name{ "m_float3" }); + EXPECT_EQ(expectedVector3Index, shaderInputFunctor->m_vector3Index); + } TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyValues_AllTypes) { @@ -937,23 +1354,23 @@ namespace UnitTest auto addProperty = [&sourceData](MaterialPropertyDataType dateType, const char* propertyName, const char* srgConstantName, const AZ::RPI::MaterialPropertyValue& value) { - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = propertyName; - propertySource.m_dataType = dateType; - propertySource.m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string(srgConstantName) }); - propertySource.m_value = value; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + MaterialTypeSourceData::PropertyDefinition* property = sourceData.AddProperty(propertyName); + property->m_dataType = dateType; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ MaterialPropertyOutputType::ShaderInput, AZStd::string(srgConstantName) }); + property->m_value = value; }; + + sourceData.AddPropertySet("general"); - addProperty(MaterialPropertyDataType::Bool, "MyBool", "m_bool", true); - addProperty(MaterialPropertyDataType::Float, "MyFloat", "m_float", 1.2f); - addProperty(MaterialPropertyDataType::Int, "MyInt", "m_int", -12); - addProperty(MaterialPropertyDataType::UInt, "MyUInt", "m_uint", 12u); - addProperty(MaterialPropertyDataType::Vector2, "MyFloat2", "m_float2", AZ::Vector2{1.1f, 2.2f}); - addProperty(MaterialPropertyDataType::Vector3, "MyFloat3", "m_float3", AZ::Vector3{3.3f, 4.4f, 5.5f}); - addProperty(MaterialPropertyDataType::Vector4, "MyFloat4", "m_float4", AZ::Vector4{6.6f, 7.7f, 8.8f, 9.9f}); - addProperty(MaterialPropertyDataType::Color, "MyColor", "m_color", AZ::Color{0.1f, 0.2f, 0.3f, 0.4f}); - addProperty(MaterialPropertyDataType::Image, "MyImage", "m_image", AZStd::string{TestImageFilename}); + addProperty(MaterialPropertyDataType::Bool, "general.MyBool", "m_bool", true); + addProperty(MaterialPropertyDataType::Float, "general.MyFloat", "m_float", 1.2f); + addProperty(MaterialPropertyDataType::Int, "general.MyInt", "m_int", -12); + addProperty(MaterialPropertyDataType::UInt, "general.MyUInt", "m_uint", 12u); + addProperty(MaterialPropertyDataType::Vector2, "general.MyFloat2", "m_float2", AZ::Vector2{1.1f, 2.2f}); + addProperty(MaterialPropertyDataType::Vector3, "general.MyFloat3", "m_float3", AZ::Vector3{3.3f, 4.4f, 5.5f}); + addProperty(MaterialPropertyDataType::Vector4, "general.MyFloat4", "m_float4", AZ::Vector4{6.6f, 7.7f, 8.8f, 9.9f}); + addProperty(MaterialPropertyDataType::Color, "general.MyColor", "m_color", AZ::Color{0.1f, 0.2f, 0.3f, 0.4f}); + addProperty(MaterialPropertyDataType::Image, "general.MyImage", "m_image", AZStd::string{TestImageFilename}); auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_TRUE(materialTypeOutcome.IsSuccess()); @@ -970,6 +1387,88 @@ namespace UnitTest CheckPropertyValue>(materialTypeAsset, Name{"general.MyImage"}, m_testImageAsset); } + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_NestedPropertySets) + { + RHI::Ptr layeredMaterialSrgLayout = RHI::ShaderResourceGroupLayout::Create(); + layeredMaterialSrgLayout->SetName(Name{"MaterialSrg"}); + layeredMaterialSrgLayout->SetBindingSlot(SrgBindingSlot::Material); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer1_baseColor_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer1_roughness_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_baseColor_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_roughness_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_clearCoat_roughness_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_layer2_clearCoat_normal_texture" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputConstantDescriptor{ Name{ "m_layer2_clearCoat_normal_factor" }, 0, 4, 0 }); + layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputConstantDescriptor{ Name{ "m_blendFactor" }, 4, 4, 0 }); + layeredMaterialSrgLayout->Finalize(); + + AZStd::vector boolOptionValues; + boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); + boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); + Ptr shaderOptionsLayout = ShaderOptionGroupLayout::Create(); + uint32_t order = 0; + shaderOptionsLayout->AddShaderOption(ShaderOptionDescriptor{Name{"o_layer2_clearCoat_enable"}, ShaderOptionType::Boolean, 0, order++, boolOptionValues, Name{"False"}}); + shaderOptionsLayout->Finalize(); + + Data::Asset layeredMaterialShaderAsset = CreateTestShaderAsset(Uuid::CreateRandom(), layeredMaterialSrgLayout, shaderOptionsLayout); + + Data::AssetInfo testShaderAssetInfo; + testShaderAssetInfo.m_assetId = layeredMaterialShaderAsset.GetId(); + m_assetSystemStub.RegisterSourceInfo("layeredMaterial.shader", testShaderAssetInfo, ""); + + MaterialTypeSourceData sourceData; + + sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "layeredMaterial.shader" }); + + auto addSrgProperty = [&sourceData](MaterialPropertyDataType dateType, MaterialPropertyOutputType connectionType, const char* propertyName, const char* srgConstantName, const AZ::RPI::MaterialPropertyValue& value) + { + MaterialTypeSourceData::PropertyDefinition* property = sourceData.AddProperty(propertyName); + property->m_dataType = dateType; + property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{ connectionType, AZStd::string(srgConstantName) }); + property->m_value = value; + }; + + sourceData.AddPropertySet("layer1"); + sourceData.AddPropertySet("layer2"); + sourceData.AddPropertySet("blend"); + sourceData.AddPropertySet("layer1.baseColor"); + sourceData.AddPropertySet("layer2.baseColor"); + sourceData.AddPropertySet("layer1.roughness"); + sourceData.AddPropertySet("layer2.roughness"); + sourceData.AddPropertySet("layer2.clearCoat"); + sourceData.AddPropertySet("layer2.clearCoat.roughness"); + sourceData.AddPropertySet("layer2.clearCoat.normal"); + + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer1.baseColor.texture", "m_layer1_baseColor_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer1.roughness.texture", "m_layer1_roughness_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.baseColor.texture", "m_layer2_baseColor_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.roughness.texture", "m_layer2_roughness_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Bool, MaterialPropertyOutputType::ShaderOption, "layer2.clearCoat.enabled", "o_layer2_clearCoat_enable", true); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.clearCoat.roughness.texture", "m_layer2_clearCoat_roughness_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer2.clearCoat.normal.texture", "m_layer2_clearCoat_normal_texture", AZStd::string{TestImageFilename}); + addSrgProperty(MaterialPropertyDataType::Float, MaterialPropertyOutputType::ShaderInput, "layer2.clearCoat.normal.factor", "m_layer2_clearCoat_normal_factor", 0.4f); + addSrgProperty(MaterialPropertyDataType::Float, MaterialPropertyOutputType::ShaderInput, "blend.factor", "m_blendFactor", 0.5f); + + auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); + EXPECT_TRUE(materialTypeOutcome.IsSuccess()); + Data::Asset materialTypeAsset = materialTypeOutcome.GetValue(); + + CheckPropertyValue>(materialTypeAsset, Name{"layer1.baseColor.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer1.roughness.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.baseColor.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.roughness.texture"}, m_testImageAsset); + CheckPropertyValue(materialTypeAsset, Name{"layer2.clearCoat.enabled"}, true); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.clearCoat.roughness.texture"}, m_testImageAsset); + CheckPropertyValue>(materialTypeAsset, Name{"layer2.clearCoat.normal.texture"}, m_testImageAsset); + CheckPropertyValue(materialTypeAsset, Name{"layer2.clearCoat.normal.factor"}, 0.4f); + CheckPropertyValue(materialTypeAsset, Name{"blend.factor"}, 0.5f); + + // Note it might be nice to check that the right property connections are prescribed in the final MaterialTypeAsset, + // but it's not really necessary because CreateMaterialTypeAsset reports errors when a connection target is not found + // in the shader options layout or SRG layout. If one of the output names like "m_layer2_roughness_texture" is wrong + // these errors will cause this test to fail. + } + TEST_F(MaterialTypeSourceDataTests, LoadAndStoreJson_AllFields) { // Note that serialization of individual fields within material properties is thoroughly tested in @@ -980,46 +1479,92 @@ namespace UnitTest "description": "This is a general description about the material", "propertyLayout": { "version": 2, - "groups": [ + "propertySets": [ { "name": "groupA", "displayName": "Property Group A", - "description": "Description of property group A" + "description": "Description of property group A", + "properties": [ + { + "name": "foo", + "type": "Bool", + "defaultValue": true + }, + { + "name": "bar", + "type": "Image", + "defaultValue": "Default.png", + "visibility": "Hidden" + } + ], + "functors": [ + { + "type": "EnableShader", + "args": { + "enablePassProperty": "foo", + "shaderIndex": 1 + } + } + ] }, { "name": "groupB", "displayName": "Property Group B", - "description": "Description of property group B" + "description": "Description of property group B", + "properties": [ + { + "name": "foo", + "type": "Float", + "defaultValue": 0.5 + }, + { + "name": "bar", + "type": "Color", + "defaultValue": [0.5, 0.5, 0.5], + "visibility": "Disabled" + } + ], + "functors": [ + { + "type": "Splat3", + "args": { + "floatPropertyInput": "foo", + "float3ShaderSettingOutput": "m_someFloat3" + } + } + ] + }, + { + "name": "groupC", + "displayName": "Property Group C", + "description": "Property group C has a nested property set", + "propertySets": [ + { + "name": "groupD", + "displayName": "Property Group D", + "description": "Description of property group D", + "properties": [ + { + "name": "foo", + "type": "Int", + "defaultValue": -1 + } + ] + }, + { + "name": "groupE", + "displayName": "Property Group E", + "description": "Description of property group E", + "properties": [ + { + "name": "bar", + "type": "UInt" + } + ] + } + ] } - ], - "properties": { - "groupA": [ - { - "name": "foo", - "type": "Bool", - "defaultValue": true - }, - { - "name": "bar", - "type": "Image", - "defaultValue": "Default.png", - "visibility": "Hidden" - } - ], - "groupB": [ - { - "name": "foo", - "type": "Float", - "defaultValue": 0.5 - }, - { - "name": "bar", - "type": "Color", - "defaultValue": [0.5, 0.5, 0.5], - "visibility": "Disabled" - } - ] - } + ] }, "shaders": [ { @@ -1040,17 +1585,9 @@ namespace UnitTest ], "functors": [ { - "type": "EnableShader", + "type": "SetShaderOption", "args": { - "enablePassProperty": "groupA.foo", - "shaderIndex": 1 - } - }, - { - "type": "Splat3", - "args": { - "floatPropertyInput": "groupB.foo", - "float3ShaderSettingOutput": "m_someFloat3" + "enableProperty": "groupA.foo" } } ] @@ -1062,35 +1599,72 @@ namespace UnitTest EXPECT_EQ(material.m_description, "This is a general description about the material"); - EXPECT_EQ(material.m_propertyLayout.m_version, 2); + EXPECT_EQ(material.GetPropertyLayout().m_version, 2); - EXPECT_EQ(material.m_propertyLayout.m_groups.size(), 2); - EXPECT_TRUE(material.FindGroup("groupA") != nullptr); - EXPECT_TRUE(material.FindGroup("groupB") != nullptr); - EXPECT_EQ(material.FindGroup("groupA")->m_displayName, "Property Group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_displayName, "Property Group B"); - EXPECT_EQ(material.FindGroup("groupA")->m_description, "Description of property group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_description, "Description of property group B"); + EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 3); + EXPECT_TRUE(material.FindPropertySet("groupA") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupB") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupC") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupC.groupD") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupC.groupE") != nullptr); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDisplayName(), "Property Group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDisplayName(), "Property Group B"); + EXPECT_EQ(material.FindPropertySet("groupC")->GetDisplayName(), "Property Group C"); + EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetDisplayName(), "Property Group D"); + EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetDisplayName(), "Property Group E"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDescription(), "Description of property group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDescription(), "Description of property group B"); + EXPECT_EQ(material.FindPropertySet("groupC")->GetDescription(), "Property group C has a nested property set"); + EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetDescription(), "Description of property group D"); + EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetDescription(), "Description of property group E"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertySet("groupB")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertySet("groupC")->GetProperties().size(), 0); + EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetProperties().size(), 1); + EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetProperties().size(), 1); + + EXPECT_NE(material.FindProperty("groupA.foo"), nullptr); + EXPECT_NE(material.FindProperty("groupA.bar"), nullptr); + EXPECT_NE(material.FindProperty("groupB.foo"), nullptr); + EXPECT_NE(material.FindProperty("groupB.bar"), nullptr); + EXPECT_NE(material.FindProperty("groupC.groupD.foo"), nullptr); + EXPECT_NE(material.FindProperty("groupC.groupE.bar"), nullptr); - EXPECT_EQ(material.m_propertyLayout.m_properties.size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_dataType, MaterialPropertyDataType::Bool); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_dataType, MaterialPropertyDataType::Image); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_dataType, MaterialPropertyDataType::Float); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_dataType, MaterialPropertyDataType::Color); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_visibility, MaterialPropertyVisibility::Hidden); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_visibility, MaterialPropertyVisibility::Disabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_value, true); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_value, AZStd::string{"Default.png"}); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_value, 0.5f); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_dataType, MaterialPropertyDataType::Bool); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_dataType, MaterialPropertyDataType::Image); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_dataType, MaterialPropertyDataType::Float); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_dataType, MaterialPropertyDataType::Color); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_dataType, MaterialPropertyDataType::Int); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_dataType, MaterialPropertyDataType::UInt); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_visibility, MaterialPropertyVisibility::Hidden); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_visibility, MaterialPropertyVisibility::Disabled); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_value, true); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_value, AZStd::string{"Default.png"}); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_value, 0.5f); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_value, -1); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_value, 0u); + + EXPECT_EQ(material.FindPropertySet("groupA")->GetFunctors().size(), 1); + EXPECT_EQ(material.FindPropertySet("groupB")->GetFunctors().size(), 1); + Ptr functorA = material.FindPropertySet("groupA")->GetFunctors()[0]->GetActualSourceData(); + Ptr functorB = material.FindPropertySet("groupB")->GetFunctors()[0]->GetActualSourceData(); + EXPECT_TRUE(azrtti_cast(functorA.get())); + EXPECT_EQ(azrtti_cast(functorA.get())->m_enablePassPropertyId, "foo"); + EXPECT_EQ(azrtti_cast(functorA.get())->m_shaderIndex, 1); + EXPECT_TRUE(azrtti_cast(functorB.get())); + EXPECT_EQ(azrtti_cast(functorB.get())->m_floatPropertyInputId, "foo"); + EXPECT_EQ(azrtti_cast(functorB.get())->m_float3ShaderSettingOutputId, "m_someFloat3"); EXPECT_EQ(material.m_shaderCollection.size(), 2); EXPECT_EQ(material.m_shaderCollection[0].m_shaderFilePath, "ForwardPass.shader"); @@ -1103,13 +1677,10 @@ namespace UnitTest EXPECT_EQ(material.m_shaderCollection[1].m_shaderOptionValues[Name{"o_optionD"}], Name{"2"}); EXPECT_EQ(material.m_shaderCollection[0].m_shaderTag, Name{"ForwardPass"}); - EXPECT_EQ(material.m_materialFunctorSourceData.size(), 2); - EXPECT_TRUE(azrtti_cast(material.m_materialFunctorSourceData[0]->GetActualSourceData().get())); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[0]->GetActualSourceData().get())->m_enablePassPropertyId, "groupA.foo"); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[0]->GetActualSourceData().get())->m_shaderIndex, 1); - EXPECT_TRUE(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_floatPropertyInputId, "groupB.foo"); - EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_float3ShaderSettingOutputId, "m_someFloat3"); + EXPECT_EQ(material.m_materialFunctorSourceData.size(), 1); + Ptr functorC = material.m_materialFunctorSourceData[0]->GetActualSourceData(); + EXPECT_TRUE(azrtti_cast(functorC.get())); + EXPECT_EQ(azrtti_cast(functorC.get())->m_enablePropertyName, "groupA.foo"); AZStd::string outputJson; JsonTestResult storeResult = StoreTestDataToJson(material, outputJson); @@ -1120,6 +1691,9 @@ namespace UnitTest { // The content of this test was copied from LoadAndStoreJson_AllFields to prove backward compatibility. // (The "store" part of the test was not included because the saved data will be the new format). + // Notable differences include: + // 1) the key "id" is used instead of "name" + // 2) the group metadata, property definitions, and functors are all defined in different sections rather than in a property set const AZStd::string inputJson = R"( { @@ -1206,37 +1780,57 @@ namespace UnitTest MaterialTypeSourceData material; JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); + // Before conversion to the new format, the data is in the old place + EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 0); + + material.ConvertToNewDataFormat(); + + // After conversion to the new format, the data is in the new place + EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 2); + EXPECT_EQ(material.m_description, "This is a general description about the material"); - EXPECT_EQ(material.m_propertyLayout.m_version, 2); + EXPECT_EQ(material.GetPropertyLayout().m_version, 2); - EXPECT_EQ(material.m_propertyLayout.m_groups.size(), 2); - EXPECT_TRUE(material.FindGroup("groupA") != nullptr); - EXPECT_TRUE(material.FindGroup("groupB") != nullptr); - EXPECT_EQ(material.FindGroup("groupA")->m_displayName, "Property Group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_displayName, "Property Group B"); - EXPECT_EQ(material.FindGroup("groupA")->m_description, "Description of property group A"); - EXPECT_EQ(material.FindGroup("groupB")->m_description, "Description of property group B"); + EXPECT_TRUE(material.FindPropertySet("groupA") != nullptr); + EXPECT_TRUE(material.FindPropertySet("groupB") != nullptr); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDisplayName(), "Property Group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDisplayName(), "Property Group B"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetDescription(), "Description of property group A"); + EXPECT_EQ(material.FindPropertySet("groupB")->GetDescription(), "Description of property group B"); + EXPECT_EQ(material.FindPropertySet("groupA")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertySet("groupB")->GetProperties().size(), 2); + + EXPECT_TRUE(material.FindProperty("groupA.foo") != nullptr); + EXPECT_TRUE(material.FindProperty("groupA.bar") != nullptr); + EXPECT_TRUE(material.FindProperty("groupB.foo") != nullptr); + EXPECT_TRUE(material.FindProperty("groupB.bar") != nullptr); - EXPECT_EQ(material.m_propertyLayout.m_properties.size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"].size(), 2); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_name, "foo"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_name, "bar"); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_dataType, MaterialPropertyDataType::Bool); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_dataType, MaterialPropertyDataType::Image); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_dataType, MaterialPropertyDataType::Float); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_dataType, MaterialPropertyDataType::Color); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_visibility, MaterialPropertyVisibility::Hidden); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_visibility, MaterialPropertyVisibility::Enabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_visibility, MaterialPropertyVisibility::Disabled); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][0].m_value, true); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupA"][1].m_value, AZStd::string{"Default.png"}); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][0].m_value, 0.5f); - EXPECT_EQ(material.m_propertyLayout.m_properties["groupB"][1].m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_name, "foo"); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_dataType, MaterialPropertyDataType::Bool); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_dataType, MaterialPropertyDataType::Image); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_dataType, MaterialPropertyDataType::Float); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_dataType, MaterialPropertyDataType::Color); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_visibility, MaterialPropertyVisibility::Hidden); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_visibility, MaterialPropertyVisibility::Enabled); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_visibility, MaterialPropertyVisibility::Disabled); + EXPECT_EQ(material.FindProperty("groupA.foo")->m_value, true); + EXPECT_EQ(material.FindProperty("groupA.bar")->m_value, AZStd::string{"Default.png"}); + EXPECT_EQ(material.FindProperty("groupB.foo")->m_value, 0.5f); + EXPECT_EQ(material.FindProperty("groupB.bar")->m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); + + // The functors can appear either at the top level or within each property set. The format conversion + // function doesn't know how to move the functors, and they will be left at the top level. + EXPECT_EQ(material.FindPropertySet("groupA")->GetFunctors().size(), 0); + EXPECT_EQ(material.FindPropertySet("groupB")->GetFunctors().size(), 0); EXPECT_EQ(material.m_shaderCollection.size(), 2); EXPECT_EQ(material.m_shaderCollection[0].m_shaderFilePath, "ForwardPass.shader"); @@ -1257,7 +1851,7 @@ namespace UnitTest EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_floatPropertyInputId, "groupB.foo"); EXPECT_EQ(azrtti_cast(material.m_materialFunctorSourceData[1]->GetActualSourceData().get())->m_float3ShaderSettingOutputId, "m_someFloat3"); } - + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_PropertyImagePath) { char inputJson[2048]; @@ -1267,27 +1861,25 @@ namespace UnitTest "description": "", "propertyLayout": { "version": 2, - "groups": [ + "propertySets": [ { "name": "general", "displayName": "General", - "description": "" + "description": "", + "properties": [ + { + "name": "absolute", + "type": "Image", + "defaultValue": "%s" + }, + { + "name": "relative", + "type": "Image", + "defaultValue": "%s" + } + ] } - ], - "properties": { - "general": [ - { - "name": "absolute", - "type": "Image", - "defaultValue": "%s" - }, - { - "name": "relative", - "type": "Image", - "defaultValue": "%s" - } - ] - } + ] } } )", diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype index 81ebd63c28..ce59ec8b8e 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype @@ -2,50 +2,48 @@ "description": "Base Material with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "settings", - "displayName": "Settings" + "displayName": "Settings", + "properties": [ + { + "name": "color", + "displayName": "Color", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "metallic", + "displayName": "Metallic", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallic" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughness" + } + } + ] } - ], - "properties": { - "settings": [ - { - "name": "color", - "displayName": "Color", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "metallic", - "displayName": "Metallic", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallic" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughness" - } - } - ] - } + ] }, "shaders": [ { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 3f4aa71a9c..cf3205a037 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -230,7 +230,7 @@ namespace MaterialEditor // create source data from properties MaterialSourceData sourceData; - sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.m_propertyLayout.m_version; + sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.GetPropertyLayout().m_version; sourceData.m_materialType = m_materialSourceData.m_materialType; sourceData.m_parentMaterial = m_materialSourceData.m_parentMaterial; @@ -302,7 +302,7 @@ namespace MaterialEditor // create source data from properties MaterialSourceData sourceData; - sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.m_propertyLayout.m_version; + sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.GetPropertyLayout().m_version; sourceData.m_materialType = m_materialSourceData.m_materialType; sourceData.m_parentMaterial = m_materialSourceData.m_parentMaterial; @@ -373,7 +373,7 @@ namespace MaterialEditor // create source data from properties MaterialSourceData sourceData; - sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.m_propertyLayout.m_version; + sourceData.m_propertyLayoutVersion = m_materialTypeSourceData.GetPropertyLayout().m_version; sourceData.m_materialType = m_materialSourceData.m_materialType; // Only assign a parent path if the source was a .material @@ -592,24 +592,26 @@ namespace MaterialEditor bool result = true; // populate sourceData with properties that meet the filter - m_materialTypeSourceData.EnumerateProperties([this, &sourceData, &propertyFilter, &result](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { + m_materialTypeSourceData.EnumerateProperties([this, &sourceData, &propertyFilter, &result](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { - const MaterialPropertyId propertyId(groupName, propertyName); + const AZStd::string propertyId = propertyIdContext + propertyDefinition->m_name; - const auto it = m_properties.find(propertyId); + const auto it = m_properties.find(Name{propertyId}); if (it != m_properties.end() && propertyFilter(it->second)) { MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); if (propertyValue.IsValid()) { - if (!m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(propertyDefinition, propertyValue)) + if (!m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(*propertyDefinition, propertyValue)) { - AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); + AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.c_str(), m_absolutePath.c_str()); result = false; return false; } - - sourceData.m_properties[groupName][propertyName].m_value = propertyValue; + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + const AZStd::string groupName = propertyId.substr(0, propertyId.size() - propertyDefinition->m_name.size() - 1); + sourceData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; } } return true; @@ -678,7 +680,7 @@ namespace MaterialEditor AZ_Error("MaterialDocument", false, "Material type source data could not be loaded: '%s'.", materialTypeSourceFilePath.c_str()); return false; } - m_materialTypeSourceData = materialTypeOutcome.GetValue(); + m_materialTypeSourceData = materialTypeOutcome.TakeValue(); } else if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), MaterialTypeSourceData::Extension)) { @@ -691,7 +693,7 @@ namespace MaterialEditor AZ_Error("MaterialDocument", false, "Material type source data could not be loaded: '%s'.", m_absolutePath.c_str()); return false; } - m_materialTypeSourceData = materialTypeOutcome.GetValue(); + m_materialTypeSourceData = materialTypeOutcome.TakeValue(); // The document represents a material, not a material type. // If the input data is a material type file we have to generate the material source data by referencing it. @@ -770,33 +772,41 @@ namespace MaterialEditor // Populate the property map from a combination of source data and assets // Assets must still be used for now because they contain the final accumulated value after all other materials // in the hierarchy are applied - m_materialTypeSourceData.EnumerateProperties([this, &parentPropertyValues](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { - AtomToolsFramework::DynamicPropertyConfig propertyConfig; - - // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = MaterialPropertyId(groupName, propertyName); - - const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); - const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); - AZ_Warning("MaterialDocument", propertyIndexInBounds, "Failed to add material property '%s' to document '%s'.", propertyConfig.m_id.GetCStr(), m_absolutePath.c_str()); - - if (propertyIndexInBounds) + m_materialTypeSourceData.EnumeratePropertySets([this, &parentPropertyValues](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertySet* propertySet) { - AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); - propertyConfig.m_showThumbnail = true; - propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(parentPropertyValues[propertyIndex.GetIndex()]); - auto groupDefinition = m_materialTypeSourceData.FindGroup(groupName); - propertyConfig.m_groupName = groupDefinition ? groupDefinition->m_displayName : groupName; - m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); - } - return true; - }); + AtomToolsFramework::DynamicPropertyConfig propertyConfig; + + for (const auto& propertyDefinition : propertySet->GetProperties()) + { + // Assign id before conversion so it can be used in dynamic description + propertyConfig.m_id = propertyIdContext + propertySet->GetName() + "." + propertyDefinition->m_name; + + const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); + const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); + AZ_Warning("MaterialDocument", propertyIndexInBounds, "Failed to add material property '%s' to document '%s'.", propertyConfig.m_id.GetCStr(), m_absolutePath.c_str()); + + if (propertyIndexInBounds) + { + AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, *propertyDefinition); + propertyConfig.m_showThumbnail = true; + propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); + propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(parentPropertyValues[propertyIndex.GetIndex()]); + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + // (Does DynamicPropertyConfig really even need m_groupName?) + propertyConfig.m_groupName = propertySet->GetDisplayName(); + m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); + } + } + + return true; + }); // Populate the property group visibility map - for (MaterialTypeSourceData::GroupDefinition& group : m_materialTypeSourceData.GetGroupDefinitionsInDisplayOrder()) + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + for (const AZStd::unique_ptr& propertySet : m_materialTypeSourceData.GetPropertyLayout().m_propertySets) { - m_propertyGroupVisibility[AZ::Name{group.m_name}] = true; + m_propertyGroupVisibility[AZ::Name{propertySet->GetName()}] = true; } // Adding properties for material type and parent as part of making dynamic @@ -877,6 +887,39 @@ namespace MaterialEditor return false; } } + + bool enumerateResult = m_materialTypeSourceData.EnumeratePropertySets( + [this, &materialTypeSourceFilePath](const AZStd::string&, const MaterialTypeSourceData::PropertySet* propertySet) + { + const MaterialFunctorSourceData::EditorContext editorContext = MaterialFunctorSourceData::EditorContext( + materialTypeSourceFilePath, m_materialAsset->GetMaterialPropertiesLayout()); + + for (Ptr functorData : propertySet->GetFunctors()) + { + MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor(editorContext); + + if (result.IsSuccess()) + { + Ptr& functor = result.GetValue(); + if (functor != nullptr) + { + m_editorFunctors.push_back(functor); + } + } + else + { + AZ_Error("MaterialDocument", false, "Material functors were not created: '%s'.", m_absolutePath.c_str()); + return false; + } + } + + return true; + }); + + if (!enumerateResult) + { + return false; + } AZ::RPI::MaterialPropertyFlags dirtyFlags; dirtyFlags.set(); // Mark all properties as dirty since we just loaded the material and need to initialize property visibility diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index f6b42bf13a..e279b7e5b0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -163,28 +163,23 @@ namespace MaterialEditor const AZ::RPI::MaterialTypeSourceData* materialTypeSourceData = nullptr; MaterialDocumentRequestBus::EventResult( materialTypeSourceData, m_documentId, &MaterialDocumentRequestBus::Events::GetMaterialTypeSourceData); - - for (const auto& groupDefinition : materialTypeSourceData->GetGroupDefinitionsInDisplayOrder()) + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + for (const AZStd::unique_ptr& propertySet : materialTypeSourceData->GetPropertyLayout().m_propertySets) { - const AZStd::string& groupName = groupDefinition.m_name; - const AZStd::string& groupDisplayName = !groupDefinition.m_displayName.empty() ? groupDefinition.m_displayName : groupName; - const AZStd::string& groupDescription = - !groupDefinition.m_description.empty() ? groupDefinition.m_description : groupDisplayName; + const AZStd::string& groupName = propertySet->GetName(); + const AZStd::string& groupDisplayName = !propertySet->GetDisplayName().empty() ? propertySet->GetDisplayName() : groupName; + const AZStd::string& groupDescription = !propertySet->GetDescription().empty() ? propertySet->GetDescription() : groupDisplayName; auto& group = m_groups[groupName]; - const auto& propertyLayout = materialTypeSourceData->m_propertyLayout; - const auto& propertyListItr = propertyLayout.m_properties.find(groupName); - if (propertyListItr != propertyLayout.m_properties.end()) + group.m_properties.reserve(propertySet->GetProperties().size()); + for (const auto& propertyDefinition : propertySet->GetProperties()) { - group.m_properties.reserve(propertyListItr->second.size()); - for (const auto& propertyDefinition : propertyListItr->second) - { - AtomToolsFramework::DynamicProperty property; - AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( - property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name)); - group.m_properties.push_back(property); - } + AtomToolsFramework::DynamicProperty property; + AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( + property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, + AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->m_name)); + group.m_properties.push_back(property); } // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index c05b84db39..86610ecc93 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -283,35 +283,31 @@ namespace AZ AddUvNamesGroup(); // Copy all of the properties from the material asset to the source data that will be exported - for (const auto& groupDefinition : m_editData.m_materialTypeSourceData.GetGroupDefinitionsInDisplayOrder()) + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + for (const AZStd::unique_ptr& propertySet : m_editData.m_materialTypeSourceData.GetPropertyLayout().m_propertySets) { - const AZStd::string& groupName = groupDefinition.m_name; - const AZStd::string& groupDisplayName = !groupDefinition.m_displayName.empty() ? groupDefinition.m_displayName : groupName; - const AZStd::string& groupDescription = !groupDefinition.m_description.empty() ? groupDefinition.m_description : groupDisplayName; + const AZStd::string& groupName = propertySet->GetName(); + const AZStd::string& groupDisplayName = !propertySet->GetDisplayName().empty() ? propertySet->GetDisplayName() : groupName; + const AZStd::string& groupDescription = !propertySet->GetDescription().empty() ? propertySet->GetDescription() : groupDisplayName; auto& group = m_groups[groupName]; - - const auto& propertyLayout = m_editData.m_materialTypeSourceData.m_propertyLayout; - const auto& propertyListItr = propertyLayout.m_properties.find(groupName); - if (propertyListItr != propertyLayout.m_properties.end()) + + group.m_properties.reserve(propertySet->GetProperties().size()); + for (const auto& propertyDefinition : propertySet->GetProperties()) { - group.m_properties.reserve(propertyListItr->second.size()); - for (const auto& propertyDefinition : propertyListItr->second) - { - AtomToolsFramework::DynamicPropertyConfig propertyConfig; + AtomToolsFramework::DynamicPropertyConfig propertyConfig; - // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition.m_name); + // Assign id before conversion so it can be used in dynamic description + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->m_name); - AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, propertyDefinition); + AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, *propertyDefinition.get()); - propertyConfig.m_groupName = groupDisplayName; - const auto& propertyIndex = m_editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); - propertyConfig.m_showThumbnail = true; - propertyConfig.m_defaultValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); - group.m_properties.emplace_back(propertyConfig); - } + propertyConfig.m_groupName = groupDisplayName; + const auto& propertyIndex = m_editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); + propertyConfig.m_showThumbnail = true; + propertyConfig.m_defaultValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); + propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); + propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); + group.m_properties.emplace_back(propertyConfig); } // Passing in same group as main and comparison instance to enable custom value comparison for highlighting modified properties diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index e851bc5fce..2593a12f19 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -91,7 +91,7 @@ namespace AZ AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to load material type source data: %s", editData.m_materialTypeSourcePath.c_str()); return false; } - editData.m_materialTypeSourceData = materialTypeOutcome.GetValue(); + editData.m_materialTypeSourceData = materialTypeOutcome.TakeValue(); return true; } @@ -99,7 +99,7 @@ namespace AZ { // Construct the material source data object that will be exported AZ::RPI::MaterialSourceData exportData; - exportData.m_propertyLayoutVersion = editData.m_materialTypeSourceData.m_propertyLayout.m_version; + exportData.m_propertyLayoutVersion = editData.m_materialTypeSourceData.GetPropertyLayout().m_version; // Converting absolute material paths to relative paths bool result = false; @@ -137,42 +137,46 @@ namespace AZ // Copy all of the properties from the material asset to the source data that will be exported result = true; - editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& groupName, const AZStd::string& propertyName, const auto& propertyDefinition) { - const AZ::RPI::MaterialPropertyId propertyId(groupName, propertyName); - const AZ::RPI::MaterialPropertyIndex propertyIndex = - editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - - AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - - AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition.m_value; - if (editData.m_materialParentAsset.IsReady()) + editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const AZ::RPI::MaterialTypeSourceData::PropertyDefinition* propertyDefinition) { - propertyValueDefault = editData.m_materialParentAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - } + AZ::Name propertyId(propertyIdContext + propertyDefinition->m_name); - // Check for and apply any property overrides before saving property values - auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); - if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) - { - propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); - } + const AZ::RPI::MaterialPropertyIndex propertyIndex = + editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - if (!editData.m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(propertyDefinition, propertyValue)) - { - AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str()); - result = false; - return false; - } + AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - // Don't export values if they are the same as the material type or parent - if (propertyValueDefault == propertyValue) - { + AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition->m_value; + if (editData.m_materialParentAsset.IsReady()) + { + propertyValueDefault = editData.m_materialParentAsset->GetPropertyValues()[propertyIndex.GetIndex()]; + } + + // Check for and apply any property overrides before saving property values + auto propertyOverrideItr = editData.m_materialPropertyOverrideMap.find(propertyId); + if(propertyOverrideItr != editData.m_materialPropertyOverrideMap.end()) + { + propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); + } + + if (!editData.m_materialTypeSourceData.ConvertPropertyValueToSourceDataFormat(*propertyDefinition, propertyValue)) + { + AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str()); + result = false; + return false; + } + + // Don't export values if they are the same as the material type or parent + if (propertyValueDefault == propertyValue) + { + return true; + } + + // TODO: Support populating the Material Editor with nested property sets, not just the top level. + const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1); + exportData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; return true; - } - - exportData.m_properties[groupName][propertyDefinition.m_name].m_value = propertyValue; - return true; - }); + }); return result && AZ::RPI::JsonUtils::SaveObjectToFile(path, exportData); } From 9d09656023899e3faa0dcd1e6a6633f8a4dfb1d7 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:33:05 -0700 Subject: [PATCH 004/394] Removed commented out code. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.h | 8 --- .../Material/MaterialTypeSourceData.cpp | 71 ------------------- 2 files changed, 79 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 56f7c4612c..1d918702ff 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -180,9 +180,7 @@ namespace AZ }; PropertySet* AddPropertySet(AZStd::string_view propertySetId); - //PropertySet* AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name); PropertyDefinition* AddProperty(AZStd::string_view propertyId); - //PropertyDefinition* AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name); const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } @@ -241,15 +239,9 @@ namespace AZ private: - //PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList); const PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const; - - //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList); const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const; - //PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet); - //const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const; - // Function overloads for recursion, returns false to indicate that recursion should end. bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; bool EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index de55cbecb5..816e9f4f8d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -196,9 +196,6 @@ namespace AZ return PropertySet::AddPropertySet(propertySetId, m_propertyLayout.m_propertySets); } - // TODO: Delete - //return AddPropertySet(splitPropertySetId[0], splitPropertySetId[1]); - PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertySetId[0])); if (!parentPropertySet) @@ -210,27 +207,9 @@ namespace AZ return parentPropertySet->AddPropertySet(splitPropertySetId[1]); } - // TODO: Delete - //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view parentPropertySetId, AZStd::string_view name) - //{ - // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); - // - // if (!parentPropertySet) - // { - // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); - // return nullptr; - // } - - // return parentPropertySet->AddPropertySet(name); - //} - MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view propertyId) { AZStd::vector splitPropertyId = SplitId(propertyId); - //if (splitPropertyId.empty()) - //{ - // return nullptr; - //} if (splitPropertyId.size() == 1) { @@ -238,9 +217,6 @@ namespace AZ return nullptr; } - // TODO: Delete - //return AddProperty(splitPropertyId[0], splitPropertyId[1]); - PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertyId[0])); if (!parentPropertySet) @@ -252,20 +228,6 @@ namespace AZ return parentPropertySet->AddProperty(splitPropertyId[1]); } - // TODO: Delete - //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view parentPropertySetId, AZStd::string_view name) - //{ - // PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(parentPropertySetId)); - // - // if (!parentPropertySet) - // { - // AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(parentPropertySetId)); - // return nullptr; - // } - - // return parentPropertySet->AddProperty(name); - //} - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const { for (const auto& propertySet : inPropertySetList) @@ -296,40 +258,12 @@ namespace AZ return nullptr; } - //MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) - //{ - // return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); - //} - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) const { AZStd::vector tokens = TokenizeId(propertySetId); return FindPropertySet(tokens, m_propertyLayout.m_propertySets); } - //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, PropertySet& inPropertySet) - //{ - // if (parsedPropertyId.size() == 1) - // { - // for (AZStd::unique_ptr& property : inPropertySet.m_properties) - // { - // if (property->m_name == parsedPropertyId[0]) - // { - // return property.get(); - // } - // } - // } - - // return FindProperty(parsedPropertyId, inPropertySet.m_propertySets); - //} - - //const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, const PropertySet& inPropertySet) const - //{ - // MaterialTypeSourceData* nonConstThis = const_cast(this); - // PropertySet& nonConstPropertySet = *const_cast(&inPropertySet); - // return const_cast(nonConstThis->FindProperty(parsedPropertyId, nonConstPropertySet)); - //} - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const @@ -364,11 +298,6 @@ namespace AZ return nullptr; } - //MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) - //{ - // return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); - //} - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) const { AZStd::vector tokens = TokenizeId(propertyId); From 95cfe056a1bc72eb5c77f01a347d538e9e7de8e8 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:00:45 -0700 Subject: [PATCH 005/394] Updated .materialtype files to use the new format, "propertySets" instead of "groups". First I used some local changes to do an auto-conversion that loaded, upgraded, and then saved each .materialtype but some details were lost in translation. For example, comments were lost, and default values changed slightly. So I grabbed an original copy of each file, and copied/pasted each section from the old file to the new one, while preserving the new layout. I did not update StandardMultilayerPBR because that will be too much work, will wait until after common property sets can be factored out. And I will likely discard that auto-conversion soon. Testing: AtomSampleViewer MaterialScreenshotTest script passed with the same results as before. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Special/ShadowCatcher.materialtype | 58 +- .../Materials/Types/EnhancedPBR.materialtype | 2761 ++++++++--------- .../Assets/Materials/Types/Skin.materialtype | 1848 ++++++----- .../Materials/Types/StandardPBR.materialtype | 1909 ++++++------ .../Materials/Types/AutoBrick.materialtype | 327 +- 5 files changed, 3446 insertions(+), 3457 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype index 74246f85db..62d3db022b 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype @@ -2,38 +2,40 @@ "description": "Base material for the reflection probe visualization model.", "propertyLayout": { "version": 1, - "properties": { - "settings": [ - { - "name": "opacity", - "displayName": "Opacity", - "description": "Opacity of the shadow effect.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacity" + "propertySets": [ + { + "name": "settings", + "properties": [ + { + "name": "opacity", + "displayName": "Opacity", + "description": "Opacity of the shadow effect.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacity" + } + }, + { + "name": "shadeAll", + "displayName": "Shade All", + "description": "Shades the entire geometry with the shadow color, not just what's in shadow. For debugging.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_shadeAll" + } } - }, - { - "name": "shadeAll", - "displayName": "Shade All", - "description": "Shades the entire geometry with the shadow color, not just what's in shadow. For debugging.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_shadeAll" - } - } - ] - } + ] + } + ] }, "shaders": [ { "file": "ShadowCatcher.shader" } ] -} - +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index bed3b69c4c..3d227a9aa0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -2,1456 +2,1453 @@ "description": "Material Type with properties used to define Enhanced PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model, with advanced features like subsurface scattering, transmission, and anisotropy.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not." + "description": "Properties for configuring whether the surface is metallic or not.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal." + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "detailLayerGroup", "displayName": "Detail Layer", - "description": "Properties for Fine Details Layer." + "description": "Properties for Fine Details Layer.", + "properties": [ + { + "name": "enableDetailLayer", + "displayName": "Enable Detail Layer", + "description": "Enable detail layer for fine details and scratches", + "type": "Bool", + "defaultValue": false + }, + { + "name": "blendDetailFactor", + "displayName": "Blend Factor", + "description": "Scales the overall impact of the detail layer.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendFactor" + } + }, + { + "name": "blendDetailMask", + "displayName": "Blend Mask", + "description": "Detailed blend mask for application of the detail maps.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_texture" + } + }, + { + "name": "enableDetailMaskTexture", + "displayName": " Use Texture", + "description": "Enable detail blend mask", + "type": "Bool", + "defaultValue": true + }, + { + "name": "blendDetailMaskUv", + "displayName": " Blend Mask UV", + "description": "Which UV set to use for sampling the detail blend mask", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_uvIndex" + } + }, + { + "name": "textureMapUv", + "displayName": "Detail Map UVs", + "description": "Which UV set to use for detail map sampling", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_detail_allMapsUvIndex" + } + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color", + "description": "Enable detail blending for base color", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorDetailMap", + "displayName": " Texture", + "description": "Detailed Base Color Texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_texture" + } + }, + { + "name": "baseColorDetailBlend", + "displayName": " Blend Factor", + "description": "How much to blend the detail layer into the base color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_factor" + } + }, + { + "name": "enableNormals", + "displayName": "Enable Normal", + "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalDetailStrength", + "displayName": " Factor", + "description": "Strength factor for scaling the Detail Normal", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_factor" + } + }, + { + "name": "normalDetailMap", + "displayName": " Texture", + "description": "Detailed Normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_texture" + } + }, + { + "name": "normalDetailFlipX", + "displayName": " Flip X Channel", + "description": "Flip Detail tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipX" + } + }, + { + "name": "normalDetailFlipY", + "displayName": " Flip Y Channel", + "description": "Flip Detail bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipY" + } + } + ] }, { "name": "detailUV", "displayName": "Detail Layer UV", - "description": "Properties for modifying detail layer UV." + "description": "Properties for modifying detail layer UV.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { "name": "anisotropy", "displayName": "Anisotropic Material Response", - "description": "How much is this material response anisotropic." + "description": "How much is this material response anisotropic.", + "properties": [ + { + "name": "enableAnisotropy", + "displayName": "Enable Anisotropy", + "description": "Enable anisotropic surface response for non uniform reflection along the axis", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableAnisotropy" + } + }, + { + "name": "factor", + "displayName": "Anisotropy Factor", + "description": "Strength factor for the anisotropy: negative = along v, positive = along u", + "type": "Float", + "defaultValue": 0.0, + "min": -0.95, + "max": 0.95, + "connection": { + "type": "ShaderInput", + "name": "m_anisotropicFactor" + } + }, + { + "name": "anisotropyAngle", + "displayName": "Anisotropy Angle", + "description": "Anisotropy direction of major reflection axis: 0 = 0 degrees, 1.0 = 180 degrees", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_anisotropicAngle" + } + } + ] }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] }, { "name": "emissive", "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." + "description": "Properties to add light emission, independent of other lights in the scene.", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ] }, { "name": "subsurfaceScattering", "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects." + "description": "Properties for configuring subsurface scattering effects.", + "properties": [ + { + "name": "enableSubsurfaceScattering", + "displayName": "Subsurface Scattering", + "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableSubsurfaceScattering" + } + }, + { + "name": "subsurfaceScatterFactor", + "displayName": " Factor", + "description": "Strength factor for scaling percentage of subsurface scattering effect applied", + "type": "float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Texture for controlling the strength of subsurface scattering", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Influence Map", + "description": "Whether to use the influence map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, + { + "name": "scatterColor", + "displayName": " Scatter color", + "description": "Color of volume light traveled through", + "type": "Color", + "defaultValue": [ 1.0, 0.27, 0.13 ] + }, + { + "name": "scatterDistance", + "displayName": " Scatter distance", + "description": "How far light traveled inside the volume", + "type": "float", + "defaultValue": 8, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "quality", + "displayName": " Quality", + "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", + "type": "float", + "defaultValue": 0.4, + "min": 0.2, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringQuality" + } + }, + { + "name": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "name": "o_transmission_mode" + } + }, + { + "name": "thickness", + "displayName": " Thickness", + "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "type": "float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0 + }, + { + "name": "thicknessMap", + "displayName": " Thickness Map", + "description": "Texture for controlling per pixel thickness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMap" + } + }, + { + "name": "useThicknessMap", + "displayName": " Use Thickness Map", + "description": "Whether to use the thickness map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMapUvIndex" + } + }, + { + "name": "transmissionTint", + "displayName": " Transmission Tint", + "description": "Color of the volume light traveling through", + "type": "Color", + "defaultValue": [ 1.0, 0.8, 0.6 ] + }, + { + "name": "transmissionPower", + "displayName": " Power", + "description": "How much transmitted light scatter radially ", + "type": "float", + "defaultValue": 6.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionDistortion", + "displayName": " Distortion", + "description": "How much light direction distorted towards surface normal", + "type": "float", + "defaultValue": 0.1, + "min": 0.0, + "max": 1.0 + }, + { + "name": "transmissionAttenuation", + "displayName": " Attenuation", + "description": "How fast transmitted light fade with thickness", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionScale", + "displayName": " Scale", + "description": "Strength of transmission", + "type": "float", + "defaultValue": 3.0, + "min": 0.0, + "softMax": 20.0 + } + ] }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, + "description": "Properties for configuring gloss clear coat", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ] + }, { "name": "parallax", "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." + "description": "Properties for parallax effect produced by a height map.", + "properties": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ] }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." + "description": "Properties for configuring the materials transparency.", + "properties": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ] }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms." + "description": "Properties for configuring UV transforms.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination." + "description": "Properties for configuring the irradiance used in global illumination.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] }, { "name": "general", "displayName": "General Settings", - "description": "General settings." + "description": "General settings.", + "properties": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ] } - ], - "properties": { - "general": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "metallic": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "anisotropy": [ - { - "name": "enableAnisotropy", - "displayName": "Enable Anisotropy", - "description": "Enable anisotropic surface response for non uniform reflection along the axis", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableAnisotropy" - } - }, - { - "name": "factor", - "displayName": "Anisotropy Factor", - "description": "Strength factor for the anisotropy: negative = along v, positive = along u", - "type": "Float", - "defaultValue": 0.0, - "min": -0.95, - "max": 0.95, - "connection": { - "type": "ShaderInput", - "name": "m_anisotropicFactor" - } - }, - { - "name": "anisotropyAngle", - "displayName": "Anisotropy Angle", - "description": "Anisotropy direction of major reflection axis: 0 = 0 degrees, 1.0 = 180 degrees", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_anisotropicAngle" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], - "uv": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], - "subsurfaceScattering": [ - { - "name": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableSubsurfaceScattering" - } - }, - { - "name": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Texture for controlling the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the influence map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "name": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "name": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringQuality" - } - }, - { - "name": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "name": "o_transmission_mode" - } - }, - { - "name": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "name": "thicknessMap", - "displayName": " Thickness Map", - "description": "Texture for controlling per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMap" - } - }, - { - "name": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMapUvIndex" - } - }, - { - "name": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light traveling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "name": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "name": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ], - "detailLayerGroup": [ - { - "name": "enableDetailLayer", - "displayName": "Enable Detail Layer", - "description": "Enable detail layer for fine details and scratches", - "type": "Bool", - "defaultValue": false - }, - { - "name": "blendDetailFactor", - "displayName": "Blend Factor", - "description": "Scales the overall impact of the detail layer.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendFactor" - } - }, - { - "name": "blendDetailMask", - "displayName": "Blend Mask", - "description": "Detailed blend mask for application of the detail maps.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_texture" - } - }, - { - "name": "enableDetailMaskTexture", - "displayName": " Use Texture", - "description": "Enable detail blend mask", - "type": "Bool", - "defaultValue": true - }, - { - "name": "blendDetailMaskUv", - "displayName": " Blend Mask UV", - "description": "Which UV set to use for sampling the detail blend mask", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_uvIndex" - } - }, - { - "name": "textureMapUv", - "displayName": "Detail Map UVs", - "description": "Which UV set to use for detail map sampling", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_detail_allMapsUvIndex" - } - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color", - "description": "Enable detail blending for base color", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorDetailMap", - "displayName": " Texture", - "description": "Detailed Base Color Texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_texture" - } - }, - { - "name": "baseColorDetailBlend", - "displayName": " Blend Factor", - "description": "How much to blend the detail layer into the base color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_factor" - } - }, - { - "name": "enableNormals", - "displayName": "Enable Normal", - "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalDetailStrength", - "displayName": " Factor", - "description": "Strength factor for scaling the Detail Normal", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_factor" - } - }, - { - "name": "normalDetailMap", - "displayName": " Texture", - "description": "Detailed Normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_texture" - } - }, - { - "name": "normalDetailFlipX", - "displayName": " Flip X Channel", - "description": "Flip Detail tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipX" - } - }, - { - "name": "normalDetailFlipY", - "displayName": " Flip Y Channel", - "description": "Flip Detail bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipY" - } - } - ], - "detailUV": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "irradiance": [ - // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] - } + ] }, "shaders": [ { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 0969cc36e8..b462c936e9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -2,970 +2,968 @@ "description": "Material Type tailored for rendering skin, with support for blended wrinkle maps that work with animated vertex blend shapes.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal." + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "detailLayerGroup", "displayName": "Detail Layer", - "description": "Properties for Fine Details Layer." + "description": "Properties for Fine Details Layer.", + "properties": [ + { + "name": "enableDetailLayer", + "displayName": "Enable Detail Layer", + "description": "Enable detail layer for fine details and scratches", + "type": "Bool", + "defaultValue": false + }, + { + "name": "blendDetailFactor", + "displayName": "Blend Factor", + "description": "Scales the overall impact of the detail layer.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendFactor" + } + }, + { + "name": "blendDetailMask", + "displayName": "Blend Mask", + "description": "Detailed blend mask for application of the detail maps.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_texture" + } + }, + { + "name": "enableDetailMaskTexture", + "displayName": " Use Texture", + "description": "Enable detail blend mask", + "type": "Bool", + "defaultValue": true + }, + { + "name": "blendDetailMaskUv", + "displayName": " Blend Mask UV", + "description": "Which UV set to use for sampling the detail blend mask", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_uvIndex" + } + }, + { + "name": "textureMapUv", + "displayName": "Detail Map UVs", + "description": "Which UV set to use for detail map sampling", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_detail_allMapsUvIndex" + } + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color", + "description": "Enable detail blending for base color", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorDetailMap", + "displayName": " Texture", + "description": "Detailed Base Color Texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_texture" + } + }, + { + "name": "baseColorDetailBlend", + "displayName": " Blend Factor", + "description": "How much to blend the detail layer into the base color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_factor" + } + }, + { + "name": "enableNormals", + "displayName": "Enable Normal", + "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalDetailStrength", + "displayName": " Factor", + "description": "Strength factor for scaling the Detail Normal", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_factor" + } + }, + { + "name": "normalDetailMap", + "displayName": " Texture", + "description": "Detailed Normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_texture" + } + }, + { + "name": "normalDetailFlipX", + "displayName": " Flip X Channel", + "description": "Flip Detail tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipX" + } + }, + { + "name": "normalDetailFlipY", + "displayName": " Flip Y Channel", + "description": "Flip Detail bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipY" + } + } + ] }, { "name": "detailUV", "displayName": "Detail Layer UV", - "description": "Properties for modifying detail layer UV." + "description": "Properties for modifying detail layer UV.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] }, { "name": "subsurfaceScattering", "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects." + "description": "Properties for configuring subsurface scattering effects.", + "properties": [ + { + "name": "enableSubsurfaceScattering", + "displayName": "Subsurface Scattering", + "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableSubsurfaceScattering" + } + }, + { + "name": "subsurfaceScatterFactor", + "displayName": " Factor", + "description": "Strength factor for scaling percentage of subsurface scattering effect applied", + "type": "float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Texture for controlling the strength of subsurface scattering", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Influence Map", + "description": "Whether to use the influence map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, + { + "name": "scatterColor", + "displayName": " Scatter color", + "description": "Color of volume light traveled through", + "type": "Color", + "defaultValue": [ 1.0, 0.27, 0.13 ] + }, + { + "name": "scatterDistance", + "displayName": " Scatter distance", + "description": "How far light traveled inside the volume", + "type": "float", + "defaultValue": 8, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "quality", + "displayName": " Quality", + "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", + "type": "float", + "defaultValue": 0.4, + "min": 0.2, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringQuality" + } + }, + { + "name": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "name": "o_transmission_mode" + } + }, + { + "name": "thickness", + "displayName": " Thickness", + "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "type": "float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0 + }, + { + "name": "thicknessMap", + "displayName": " Thickness Map", + "description": "Texture for controlling per pixel thickness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMap" + } + }, + { + "name": "useThicknessMap", + "displayName": " Use Thickness Map", + "description": "Whether to use the thickness map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMapUvIndex" + } + }, + { + "name": "transmissionTint", + "displayName": " Transmission Tint", + "description": "Color of the volume light traveling through", + "type": "Color", + "defaultValue": [ 1.0, 0.8, 0.6 ] + }, + { + "name": "transmissionPower", + "displayName": " Power", + "description": "How much transmitted light scatter radially ", + "type": "float", + "defaultValue": 6.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionDistortion", + "displayName": " Distortion", + "description": "How much light direction distorted towards surface normal", + "type": "float", + "defaultValue": 0.1, + "min": 0.0, + "max": 1.0 + }, + { + "name": "transmissionAttenuation", + "displayName": " Attenuation", + "description": "How fast transmitted light fade with thickness", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionScale", + "displayName": " Scale", + "description": "Strength of transmission", + "type": "float", + "defaultValue": 3.0, + "min": 0.0, + "softMax": 20.0 + } + ] }, { "name": "wrinkleLayers", "displayName": "Wrinkle Layers", - "description": "Properties for wrinkle maps to support morph animation, using vertex color blend weights." + "description": "Properties for wrinkle maps to support morph animation, using vertex color blend weights.", + "properties": [ + { + "name": "enable", + "displayName": "Enable Wrinkle Layers", + "description": "Enable wrinkle layers for morph animations, using vertex color blend weights.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "count", + "displayName": "Number Of Layers", + "description": "The number of wrinkle map layers to use. The blend values come from the 'COLOR0' vertex stream, where R/G/B/A correspond to wrinkle layers 1/2/3/4 respectively.", + "type": "UInt", + "defaultValue": 4, + "min": 1, + "max": 4 + }, + { + "name": "showBlendValues", + "displayName": "Show Blend Values", + "description": "Enable a debug mode that draws the blend values as red, green, blue, and white overlays.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color Maps", + "description": "Enable support for blending the base color according to morph animations.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorMap1", + "displayName": " Base Color 1", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture1" + } + }, + { + "name": "baseColorMap2", + "displayName": " Base Color 2", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture2" + } + }, + { + "name": "baseColorMap3", + "displayName": " Base Color 3", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture3" + } + }, + { + "name": "baseColorMap4", + "displayName": " Base Color 4", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture4" + } + }, + { + "name": "enableNormal", + "displayName": "Enable Normal Maps", + "description": "Enable support for blending the normal maps according to morph animations.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalMap1", + "displayName": " Normals 1", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture1" + } + }, + { + "name": "normalMap2", + "displayName": " Normals 2", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture2" + } + }, + { + "name": "normalMap3", + "displayName": " Normals 3", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture3" + } + }, + { + "name": "normalMap4", + "displayName": " Normals 4", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture4" + } + } + ] }, { "name": "general", "displayName": "General Settings", - "description": "General settings." + "description": "General settings.", + "properties": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + } + ] } - ], - "properties": { - "general": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "subsurfaceScattering": [ - { - "name": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableSubsurfaceScattering" - } - }, - { - "name": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Texture for controlling the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the influence map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "name": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "name": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringQuality" - } - }, - { - "name": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "name": "o_transmission_mode" - } - }, - { - "name": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "name": "thicknessMap", - "displayName": " Thickness Map", - "description": "Texture for controlling per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMap" - } - }, - { - "name": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMapUvIndex" - } - }, - { - "name": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light traveling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "name": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "name": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ], - "wrinkleLayers": [ - { - "name": "enable", - "displayName": "Enable Wrinkle Layers", - "description": "Enable wrinkle layers for morph animations, using vertex color blend weights.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "count", - "displayName": "Number Of Layers", - "description": "The number of wrinkle map layers to use. The blend values come from the 'COLOR0' vertex stream, where R/G/B/A correspond to wrinkle layers 1/2/3/4 respectively.", - "type": "UInt", - "defaultValue": 4, - "min": 1, - "max": 4 - }, - { - "name": "showBlendValues", - "displayName": "Show Blend Values", - "description": "Enable a debug mode that draws the blend values as red, green, blue, and white overlays.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color Maps", - "description": "Enable support for blending the base color according to morph animations.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorMap1", - "displayName": " Base Color 1", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture1" - } - }, - { - "name": "baseColorMap2", - "displayName": " Base Color 2", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture2" - } - }, - { - "name": "baseColorMap3", - "displayName": " Base Color 3", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture3" - } - }, - { - "name": "baseColorMap4", - "displayName": " Base Color 4", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture4" - } - }, - { - "name": "enableNormal", - "displayName": "Enable Normal Maps", - "description": "Enable support for blending the normal maps according to morph animations.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalMap1", - "displayName": " Normals 1", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture1" - } - }, - { - "name": "normalMap2", - "displayName": " Normals 2", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture2" - } - }, - { - "name": "normalMap3", - "displayName": " Normals 3", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture3" - } - }, - { - "name": "normalMap4", - "displayName": " Normals 4", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture4" - } - } - ], - "detailLayerGroup": [ - { - "name": "enableDetailLayer", - "displayName": "Enable Detail Layer", - "description": "Enable detail layer for fine details and scratches", - "type": "Bool", - "defaultValue": false - }, - { - "name": "blendDetailFactor", - "displayName": "Blend Factor", - "description": "Scales the overall impact of the detail layer.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendFactor" - } - }, - { - "name": "blendDetailMask", - "displayName": "Blend Mask", - "description": "Detailed blend mask for application of the detail maps.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_texture" - } - }, - { - "name": "enableDetailMaskTexture", - "displayName": " Use Texture", - "description": "Enable detail blend mask", - "type": "Bool", - "defaultValue": true - }, - { - "name": "blendDetailMaskUv", - "displayName": " Blend Mask UV", - "description": "Which UV set to use for sampling the detail blend mask", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_uvIndex" - } - }, - { - "name": "textureMapUv", - "displayName": "Detail Map UVs", - "description": "Which UV set to use for detail map sampling", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_detail_allMapsUvIndex" - } - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color", - "description": "Enable detail blending for base color", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorDetailMap", - "displayName": " Texture", - "description": "Detailed Base Color Texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_texture" - } - }, - { - "name": "baseColorDetailBlend", - "displayName": " Blend Factor", - "description": "How much to blend the detail layer into the base color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_factor" - } - }, - { - "name": "enableNormals", - "displayName": "Enable Normal", - "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalDetailStrength", - "displayName": " Factor", - "description": "Strength factor for scaling the Detail Normal", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_factor" - } - }, - { - "name": "normalDetailMap", - "displayName": " Texture", - "description": "Detailed Normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_texture" - } - }, - { - "name": "normalDetailFlipX", - "displayName": " Flip X Channel", - "description": "Flip Detail tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipX" - } - }, - { - "name": "normalDetailFlipY", - "displayName": " Flip Y Channel", - "description": "Flip Detail bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipY" - } - } - ], - "detailUV": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] - } + ] }, "shaders": [ { @@ -1095,4 +1093,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index 6eb82b85ae..d6a5dad8cf 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -2,1013 +2,1010 @@ "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not." + "description": "Properties for configuring whether the surface is metallic or not.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal." + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] }, { "name": "emissive", "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." + "description": "Properties to add light emission, independent of other lights in the scene.", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ] }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, + "description": "Properties for configuring gloss clear coat", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ] + }, { "name": "parallax", "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." + "description": "Properties for parallax effect produced by a height map.", + "properties": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ] }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." + "description": "Properties for configuring the materials transparency.", + "properties": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ] }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms." + "description": "Properties for configuring UV transforms.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] }, { // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination." + "description": "Properties for configuring the irradiance used in global illumination.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] }, { "name": "general", "displayName": "General Settings", - "description": "General settings." + "description": "General settings.", + "properties": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ] } - ], - "properties": { - "general": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "metallic": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], - "uv": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], - "irradiance": [ - // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] - } + ] }, "shaders": [ { @@ -1194,4 +1191,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype index 00f11663f7..0d4d24d782 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype @@ -2,176 +2,174 @@ "description": "This is an example of a custom material type using Atom's PBR shading model: procedurally generated brick or tile.", "propertyLayout": { "version": 3, - "groups": [ + "propertySets": [ { "name": "shape", "displayName": "Shape", - "description": "Properties for configuring size, shape, and position of the bricks." + "description": "Properties for configuring size, shape, and position of the bricks.", + "properties": [ + { + "name": "brickWidth", + "displayName": "Brick Width", + "description": "The width of each brick.", + "type": "Float", + "defaultValue": 0.1, + "min": 0.0, + "softMax": 0.2, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "name": "m_brickWidth" + } + }, + { + "name": "brickHeight", + "displayName": "Brick Height", + "description": "The height of each brick.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.2, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "name": "m_brickHeight" + } + }, + { + "name": "brickOffset", + "displayName": "Offset", + "description": "The offset of each stack of bricks as a percentage of brick width.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickOffset" + } + }, + { + "name": "lineWidth", + "displayName": "Line Width", + "description": "The width of the grout lines.", + "type": "Float", + "defaultValue": 0.01, + "min": 0.0, + "softMax": 0.02, + "step": 0.0001, + "connection": { + "type": "ShaderInput", + "name": "m_lineWidth" + } + }, + { + "name": "lineDepth", + "displayName": "Line Depth", + "description": "The depth of the grout lines.", + "type": "Float", + "defaultValue": 0.01, + "min": 0.0, + "softMax": 0.02, + "connection": { + "type": "ShaderInput", + "name": "m_lineDepth" + } + } + ] }, { "name": "appearance", "displayName": "Appearance", - "description": "Properties for configuring the appearance of the bricks and grout lines." + "description": "Properties for configuring the appearance of the bricks and grout lines.", + "properties": [ + { + "name": "noiseTexture", + "type": "Image", + "defaultValue": "TestData/Textures/noise512.png", + "visibility": "Hidden", + "connection": { + "type": "ShaderInput", + "name": "m_noise" + } + }, + { + "name": "brickColor", + "displayName": "Brick Color", + "description": "The color of the bricks.", + "type": "Color", + "defaultValue": [1.0,1.0,1.0], + "connection": { + "type": "ShaderInput", + "name": "m_brickColor" + } + }, + { + "name": "brickColorNoise", + "displayName": "Brick Color Noise", + "description": "Scale the variation of brick color.", + "type": "Float", + "defaultValue": 0.25, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickNoiseFactor" + } + }, + { + "name": "lineColor", + "displayName": "Line Color", + "description": "The color of the grout lines.", + "type": "Color", + "defaultValue": [0.5,0.5,0.5], + "connection": { + "type": "ShaderInput", + "name": "m_lineColor" + } + }, + { + "name": "lineColorNoise", + "displayName": "Line Color Noise", + "description": "Scale the variation of grout line color.", + "type": "Float", + "defaultValue": 0.25, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_lineNoiseFactor" + } + }, + { + "name": "brickColorBleed", + "displayName": "Brick Color Bleed", + "description": "Distance into the grout line that the brick color will continue.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickColorBleed" + } + }, + { + "name": "ao", + "displayName": "Ambient Occlusion", + "description": "The strength of baked ambient occlusion in the grout lines.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_aoFactor" + } + } + ] } - ], - "properties": { - "shape": [ - { - "name": "brickWidth", - "displayName": "Brick Width", - "description": "The width of each brick.", - "type": "Float", - "defaultValue": 0.1, - "min": 0.0, - "softMax": 0.2, - "step": 0.001, - "connection": { - "type": "ShaderInput", - "name": "m_brickWidth" - } - }, - { - "name": "brickHeight", - "displayName": "Brick Height", - "description": "The height of each brick.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.2, - "step": 0.001, - "connection": { - "type": "ShaderInput", - "name": "m_brickHeight" - } - }, - { - "name": "brickOffset", - "displayName": "Offset", - "description": "The offset of each stack of bricks as a percentage of brick width.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickOffset" - } - }, - { - "name": "lineWidth", - "displayName": "Line Width", - "description": "The width of the grout lines.", - "type": "Float", - "defaultValue": 0.01, - "min": 0.0, - "softMax": 0.02, - "step": 0.0001, - "connection": { - "type": "ShaderInput", - "name": "m_lineWidth" - } - }, - { - "name": "lineDepth", - "displayName": "Line Depth", - "description": "The depth of the grout lines.", - "type": "Float", - "defaultValue": 0.01, - "min": 0.0, - "softMax": 0.02, - "connection": { - "type": "ShaderInput", - "name": "m_lineDepth" - } - } - ], - "appearance": [ - { - "name": "noiseTexture", - "type": "Image", - "defaultValue": "TestData/Textures/noise512.png", - "visibility": "Hidden", - "connection": { - "type": "ShaderInput", - "name": "m_noise" - } - }, - { - "name": "brickColor", - "displayName": "Brick Color", - "description": "The color of the bricks.", - "type": "Color", - "defaultValue": [1.0,1.0,1.0], - "connection": { - "type": "ShaderInput", - "name": "m_brickColor" - } - }, - { - "name": "brickColorNoise", - "displayName": "Brick Color Noise", - "description": "Scale the variation of brick color.", - "type": "Float", - "defaultValue": 0.25, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickNoiseFactor" - } - }, - { - "name": "lineColor", - "displayName": "Line Color", - "description": "The color of the grout lines.", - "type": "Color", - "defaultValue": [0.5,0.5,0.5], - "connection": { - "type": "ShaderInput", - "name": "m_lineColor" - } - }, - { - "name": "lineColorNoise", - "displayName": "Line Color Noise", - "description": "Scale the variation of grout line color.", - "type": "Float", - "defaultValue": 0.25, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_lineNoiseFactor" - } - }, - { - "name": "brickColorBleed", - "displayName": "Brick Color Bleed", - "description": "Distance into the grout line that the brick color will continue.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickColorBleed" - } - }, - { - "name": "ao", - "displayName": "Ambient Occlusion", - "description": "The strength of baked ambient occlusion in the grout lines.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_aoFactor" - } - } - ] - } + ] }, "shaders": [ { @@ -187,8 +185,5 @@ { "file": "Shaders/Depth/DepthPass.shader" } - ], - "functors": [ ] -} - +} \ No newline at end of file From b1c746968752a02a621220edf81c902cb3161ebd Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:11:54 -0700 Subject: [PATCH 006/394] Renamed m_groups and m_properties to have "Old" in the name for clarity. Also fixed a potential uninitialized data bug in Conve. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../ConvertEmissiveUnitFunctorSourceData.h | 4 ++-- .../RPI.Edit/Material/MaterialTypeSourceData.h | 4 ++-- .../Material/MaterialTypeSourceData.cpp | 18 +++++++++--------- .../Material/MaterialTypeSourceDataTests.cpp | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h index 23219ce940..091351087f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/ConvertEmissiveUnitFunctorSourceData.h @@ -44,8 +44,8 @@ namespace AZ AZStd::string m_shaderInputName; // The indices of photometric units in the dropdown list - uint32_t m_ev100Index; - uint32_t m_nitIndex; + uint32_t m_ev100Index = 0; + uint32_t m_nitIndex = 1; // Minimum and Maximum value for different photometric units AZ::Vector2 m_ev100MinMax; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 1d918702ff..ec12384286 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -170,11 +170,11 @@ namespace AZ //! [Deprecated] Use m_propertySets instead //! List of groups that will contain the available properties - AZStd::vector m_groups; + AZStd::vector m_groupsOld; //! [Deprecated] Use m_propertySets instead //! Collection of all available user-facing properties - AZStd::map> m_properties; + AZStd::map> m_propertiesOld; AZStd::vector> m_propertySets; }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 816e9f4f8d..bddbf726e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -83,8 +83,8 @@ namespace AZ serializeContext->Class() ->Version(1) ->Field("version", &PropertyLayout::m_version) - ->Field("groups", &PropertyLayout::m_groups) //< Old, preserved for backward compatibility, replaced by propertySets - ->Field("properties", &PropertyLayout::m_properties) //< Old, preserved for backward compatibility, replaced by propertySets + ->Field("groups", &PropertyLayout::m_groupsOld) //< Deprecated, preserved for backward compatibility, replaced by propertySets + ->Field("properties", &PropertyLayout::m_propertiesOld) //< Deprecated, preserved for backward compatibility, replaced by propertySets ->Field("propertySets", &PropertyLayout::m_propertySets) ; @@ -397,8 +397,8 @@ namespace AZ { for (const auto& group : GetOldFormatGroupDefinitionsInDisplayOrder()) { - auto propertyListItr = m_propertyLayout.m_properties.find(group.m_name); - if (propertyListItr != m_propertyLayout.m_properties.end()) + auto propertyListItr = m_propertyLayout.m_propertiesOld.find(group.m_name); + if (propertyListItr != m_propertyLayout.m_propertiesOld.end()) { const auto& propertyList = propertyListItr->second; for (auto& propertyDefinition : propertyList) @@ -421,8 +421,8 @@ namespace AZ } } - m_propertyLayout.m_groups.clear(); - m_propertyLayout.m_properties.clear(); + m_propertyLayout.m_groupsOld.clear(); + m_propertyLayout.m_propertiesOld.clear(); return true; } @@ -451,11 +451,11 @@ namespace AZ AZStd::vector MaterialTypeSourceData::GetOldFormatGroupDefinitionsInDisplayOrder() const { AZStd::vector groupDefinitions; - groupDefinitions.reserve(m_propertyLayout.m_properties.size()); + groupDefinitions.reserve(m_propertyLayout.m_propertiesOld.size()); // Some groups are defined explicitly in the .materialtype file's "groups" section. This is the primary way groups are sorted in the UI. AZStd::unordered_set foundGroups; - for (const auto& groupDefinition : m_propertyLayout.m_groups) + for (const auto& groupDefinition : m_propertyLayout.m_groupsOld) { if (foundGroups.insert(groupDefinition.m_name).second) { @@ -468,7 +468,7 @@ namespace AZ } // Some groups are defined implicitly, in the "properties" section where a group name is used but not explicitly defined in the "groups" section. - for (const auto& propertyListPair : m_propertyLayout.m_properties) + for (const auto& propertyListPair : m_propertyLayout.m_propertiesOld) { const AZStd::string& groupName = propertyListPair.first; if (foundGroups.insert(groupName).second) diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index 00523abbd8..e5394106fd 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -1781,15 +1781,15 @@ namespace UnitTest JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); // Before conversion to the new format, the data is in the old place - EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 2); - EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_groupsOld.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_propertiesOld.size(), 2); EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 0); material.ConvertToNewDataFormat(); // After conversion to the new format, the data is in the new place - EXPECT_EQ(material.GetPropertyLayout().m_groups.size(), 0); - EXPECT_EQ(material.GetPropertyLayout().m_properties.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_groupsOld.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_propertiesOld.size(), 0); EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 2); EXPECT_EQ(material.m_description, "This is a general description about the material"); From 1909d43dcc424c84452a7f8e70f350a0eec996e0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:57:45 -0800 Subject: [PATCH 007/394] initial version ported from an old implementation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 483 ++++++++++++++++++ .../Memory/AllocatorBenchmarks_Linux.cpp | 31 ++ .../Platform/Linux/platform_linux_files.cmake | 1 + .../Tests/Memory/AllocatorBenchmarks_Mac.cpp | 30 ++ .../Platform/Mac/platform_mac_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Windows.cpp | 74 +++ .../Windows/platform_windows_files.cmake | 1 + .../AzCore/Tests/azcoretests_files.cmake | 1 + 8 files changed, 622 insertions(+) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp new file mode 100644 index 0000000000..2bac12fe83 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -0,0 +1,483 @@ +/* + * 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 + * + */ + +#if defined(HAVE_BENCHMARK) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes(); + size_t GetMemorySize(void* memory); + } + + static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + + template + class TestAllocator : public TAllocator + { + public: + TestAllocator() + : TAllocator() + { + } + + static void SetUp() + { + AZ::AllocatorInstance::Create(); + + s_drillerManager = AZ::Debug::DrillerManager::Create(); + s_drillerManager->Register(aznew AZ::Debug::MemoryDriller); + } + + static void TearDown() + { + AZ::Debug::DrillerManager::Destroy(s_drillerManager); + s_drillerManager = nullptr; + + AZ::AllocatorInstance::Destroy(); + } + + typename TAllocator::pointer_type Allocate( + typename TAllocator::size_type byteSize, + typename TAllocator::size_type alignment, + int = 0, + const char* = nullptr, + const char* = nullptr, + int = 0, + unsigned int = 0) override + { + return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); + } + + void DeAllocate( + typename TAllocator::pointer_type ptr, + typename TAllocator::size_type byteSize = 0, + typename TAllocator::size_type = 0) override + { + AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); + } + + typename TAllocator::pointer_type ReAllocate( + typename TAllocator::pointer_type ptr, + typename TAllocator::size_type newSize, + typename TAllocator::size_type newAlignment) override + { + return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); + } + + typename TAllocator::size_type Resize(typename TAllocator::pointer_type ptr, typename TAllocator::size_type newSize) override + { + return AZ::AllocatorInstance::Get().Resize(ptr, newSize); + } + + void GarbageCollect() override + { + AZ::AllocatorInstance::Get().GarbageCollect(); + } + + typename TAllocator::size_type NumAllocatedBytes() const override + { + return AZ::AllocatorInstance::Get().NumAllocatedBytes() + + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); + } + }; +} + +namespace AZ +{ + AZ_TYPE_INFO_TEMPLATE(Benchmark::TestAllocator, "{ACE2D6E5-4EB8-4DD2-AE95-6BDFD0476801}", AZ_TYPE_INFO_CLASS); +} + +namespace Benchmark +{ + class TestRawMallocAllocator {}; + + template <> + class TestAllocator + : public TestRawMallocAllocator + { + public: + struct Descriptor {}; + + TestAllocator() + {} + + static void SetUp() + { + s_numAllocatedBytes = 0; + } + + static void TearDown() + {} + + void* Allocate( + size_t byteSize, + size_t alignment, + int = 0, + const char* = nullptr, + const char* = nullptr, + int = 0, + unsigned int = 0) + { + s_numAllocatedBytes += byteSize; + if (alignment) + { + return AZ_OS_MALLOC(byteSize, alignment); + } + else + { + return AZ_OS_MALLOC(byteSize, 1); + } + } + + static void DeAllocate(void* ptr, size_t = 0) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + + s_numAllocatedBytes += newSize; + if (newAlignment) + { + return AZ_OS_MALLOC(newSize, newAlignment); + } + else + { + return AZ_OS_MALLOC(newSize, 1); + } + } + + static size_t Resize(void* ptr, size_t newSize) + { + AZ_UNUSED(ptr); + AZ_UNUSED(newSize); + + return 0; + } + + static void GarbageCollect() + {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + private: + static size_t s_numAllocatedBytes; + }; + + size_t TestAllocator::s_numAllocatedBytes = 0; + + // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides + class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestMallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + + TestMallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestMallocSchemaAllocator", "") + {} + }; + + class TestHeapSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestHeapSchemaAllocator, "{456E6C30-AA84-488F-BE47-5C1E6AF636B7}"); + + TestHeapSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHeapSchemaAllocator", "") + {} + }; + + class TestHphaSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestHphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); + + TestHphaSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") + {} + }; + + class TestSystemAllocator : public AZ::SystemAllocator + { + public: + AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + {} + }; +} + +namespace AZ +{ + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{1065B446-4873-4B3E-9CB1-069E148D4DF6}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{92CFDF86-02EE-4247-9809-884EE9F7BA18}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{67DA01DF-9232-493A-B11C-6952FEDEB2A9}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{47384CB4-6729-43A9-B0CE-402E3A7AEFB2}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{096423BC-DC36-48D2-8E89-8F1D600F488A}"); +} + +namespace Benchmark +{ + // Allocated bytes reported by the allocator / actually requested bytes + static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; + + // Allocated bytes reported by the process / actually requested bytes + static const char* s_counterProcessMemoryRatio = "Process_MemoryRatio"; + + enum AllocationSize + { + SMALL, + BIG, + MIXED, + COUNT + }; + + static const size_t s_kiloByte = 1024; + static const size_t s_megaByte = s_kiloByte * s_kiloByte; + using AllocationSizeArray = AZStd::array; + static const AZStd::array s_allocationSizes = { + /* SMALL */ AllocationSizeArray{ 2, 16, 20, 59, 100, 128, 160, 250, 300, 512 }, + /* BIG */ AllocationSizeArray{ 513, s_kiloByte, 2 * s_kiloByte, 4 * s_kiloByte, 10 * s_kiloByte, 64 * s_kiloByte, 128 * s_kiloByte, 200 * s_kiloByte, s_megaByte, 2 * s_megaByte }, + /* MIXED */ AllocationSizeArray{ 2, s_kiloByte, 59, 4 * s_kiloByte, 128, 200 * s_kiloByte, 250, s_megaByte, 512, 2 * s_megaByte } + }; + + template + class AllocatorBenchmarkFixture + : public ::benchmark::Fixture + { + protected: + using TestAllocatorType = TestAllocator; + + virtual void internalSetUp(const ::benchmark::State&) + { + TestAllocatorType::SetUp(); + } + + virtual void internalTearDown(const ::benchmark::State&) + { + TestAllocatorType::TearDown(); + } + + public: + void SetUp(const ::benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(::benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const ::benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(::benchmark::State& state) override + { + internalTearDown(state); + } + }; + + template + class AllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + + void internalSetUp(const ::benchmark::State& state) override + { + AllocatorBenchmarkFixture::SetUp(state); + + m_allocations.resize(state.range_x(), nullptr); + } + + void internalTearDown(const ::benchmark::State& state) override + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + AllocatorBenchmarkFixture::TearDown(state); + } + + public: + void Benchmark(benchmark::State& state) + { + TestAllocatorType allocatorType; + + for (auto _ : state) + { + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + + const size_t numberOfAllocations = m_allocations.size(); + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + state.PauseTiming(); + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + + state.ResumeTiming(); + m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + } + + state.PauseTiming(); + state.counters[s_counterAllocatorMemoryRatio] = + benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + benchmark::Counter::kDefaults); + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + m_allocations[allocationIndex] = nullptr; + } + allocatorType.GarbageCollect(); + + state.SetItemsProcessed(numberOfAllocations); + state.ResumeTiming(); + } + } + + private: + AZStd::vector m_allocations; + }; + + template + class DeAllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + + void internalSetUp(const ::benchmark::State& state) override + { + AllocatorBenchmarkFixture::SetUp(state); + + m_allocations.resize(state.range_x(), nullptr); + } + + void internalTearDown(const ::benchmark::State& state) override + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + AllocatorBenchmarkFixture::TearDown(state); + } + public: + void Benchmark(benchmark::State& state) + { + TestAllocatorType allocatorType; + + for (auto _ : state) + { + state.PauseTiming(); + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + + const size_t numberOfAllocations = m_allocations.size(); + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + } + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + state.ResumeTiming(); + allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + state.PauseTiming(); + m_allocations[allocationIndex] = nullptr; + } + + state.counters[s_counterAllocatorMemoryRatio] = + benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + benchmark::Counter::kDefaults); + + state.SetItemsProcessed(numberOfAllocations); + + allocatorType.GarbageCollect(); + + state.ResumeTiming(); + } + } + + private: + AZStd::vector m_allocations; + }; + + static void RunRanges(benchmark::internal::Benchmark* b) + { + for (int i = 0; i < 6; ++i) + { + b->Arg((1 << i) * 1000); + } + } + +#define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ + BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ + BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + +#define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); + +#define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ + namespace TESTNAME \ + { \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + } + + BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + + //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate + //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + +#undef BM_REGISTER_ALLOCATOR +#undef BM_REGISTER_SIZE_FIXTURES +#undef BM_REGISTER_TEMPLATE + +} // Benchmark + +#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp new file mode 100644 index 0000000000..49ecefda49 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -0,0 +1,31 @@ +/* + * 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 Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake index 844b621e05..953dbb7791 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake @@ -9,4 +9,5 @@ set(FILES Tests/UtilsTests_Linux.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Linux.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp new file mode 100644 index 0000000000..374d9f81f7 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -0,0 +1,30 @@ +/* + * 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 Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake index 93d2daf2b8..14e39d47f4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake @@ -9,4 +9,5 @@ set(FILES ../Common/Apple/Tests/UtilsTests_Apple.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Mac.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp new file mode 100644 index 0000000000..9f4efd7a2c --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -0,0 +1,74 @@ +/* + * 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 Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + EmptyWorkingSet(GetCurrentProcess()); + + //PROCESS_MEMORY_COUNTERS_EX pmc; + //GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)); + //return pmc.PrivateUsage; + //return pmc.WorkingSetSize; + + //size_t memoryUsage = 0; + //HANDLE defaultProcessHeap = GetProcessHeap(); + //PROCESS_HEAP_ENTRY heapEntry; + //if (HeapLock(defaultProcessHeap) == FALSE) + //{ + // AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError()); + // return memoryUsage; + //} + + //heapEntry.lpData = NULL; + //while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE) + //{ + // memoryUsage += heapEntry.cbData; + //} + + //DWORD lastError = GetLastError(); + //if (lastError != ERROR_NO_MORE_ITEMS) + //{ + // AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError); + //} + + //if (HeapUnlock(defaultProcessHeap) == FALSE) + //{ + // AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError()); + //} + + //return memoryUsage; + + size_t memoryUsage = 0; + + MEMORY_BASIC_INFORMATION mbi = { 0 }; + unsigned char* pEndRegion = NULL; + while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { + pEndRegion += mbi.RegionSize; + if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { + memoryUsage += mbi.RegionSize; + } + } + return memoryUsage; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake index 0a96dad34e..97b12b28e6 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/WinAPI/Tests/UtilsTests_WinAPI.cpp Tests/IO/Streamer/StorageDriveTests_Windows.cpp + Tests/Memory/AllocatorBenchmarks_Windows.cpp Tests/Memory/OverrunDetectionAllocator_Windows.cpp Tests/Serialization_Windows.cpp ) diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index d39595c45e..6762e07d0a 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -170,6 +170,7 @@ set(FILES Math/Vector3Tests.cpp Math/Vector4PerformanceTests.cpp Math/Vector4Tests.cpp + Memory/AllocatorBenchmarks.cpp Memory/AllocatorManager.cpp Memory/HphaSchema.cpp Memory/HphaSchemaErrorDetection.cpp From 35c1751694ce245b2a033c195a83a094140ec1a0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 18:31:00 -0800 Subject: [PATCH 008/394] simplification of code Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 189 +++++++++--------- 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 2bac12fe83..af87584fc6 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -34,15 +34,15 @@ namespace Benchmark static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + /// + /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. + /// It also creates/destroys the TAllocator type and connects the driller (to reflect what happens at runtime) + /// + /// Allocator type to wrap template - class TestAllocator : public TAllocator + class TestAllocatorWrapper { public: - TestAllocator() - : TAllocator() - { - } - static void SetUp() { AZ::AllocatorInstance::Create(); @@ -59,89 +59,81 @@ namespace Benchmark AZ::AllocatorInstance::Destroy(); } - typename TAllocator::pointer_type Allocate( - typename TAllocator::size_type byteSize, - typename TAllocator::size_type alignment, - int = 0, - const char* = nullptr, - const char* = nullptr, - int = 0, - unsigned int = 0) override + static void* Allocate(size_t byteSize, size_t alignment) { return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); } - void DeAllocate( - typename TAllocator::pointer_type ptr, - typename TAllocator::size_type byteSize = 0, - typename TAllocator::size_type = 0) override + static void DeAllocate(void* ptr, size_t byteSize = 0) { AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); } - typename TAllocator::pointer_type ReAllocate( - typename TAllocator::pointer_type ptr, - typename TAllocator::size_type newSize, - typename TAllocator::size_type newAlignment) override + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) { return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); } - typename TAllocator::size_type Resize(typename TAllocator::pointer_type ptr, typename TAllocator::size_type newSize) override + static size_t Resize(void* ptr, size_t newSize) { return AZ::AllocatorInstance::Get().Resize(ptr, newSize); } - void GarbageCollect() override + static void GarbageCollect() { AZ::AllocatorInstance::Get().GarbageCollect(); } - typename TAllocator::size_type NumAllocatedBytes() const override + static size_t NumAllocatedBytes() { return AZ::AllocatorInstance::Get().NumAllocatedBytes() + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); } }; -} -namespace AZ -{ - AZ_TYPE_INFO_TEMPLATE(Benchmark::TestAllocator, "{ACE2D6E5-4EB8-4DD2-AE95-6BDFD0476801}", AZ_TYPE_INFO_CLASS); -} - -namespace Benchmark -{ - class TestRawMallocAllocator {}; - - template <> - class TestAllocator - : public TestRawMallocAllocator + /// + /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). + /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. + /// + class TestRawMallocAllocator + : public AZ::AllocatorBase + , public AZ::IAllocatorAllocate { public: + AZ_TYPE_INFO(TestMallocSchemaAllocator, "{08EB400A-D723-46C6-808E-D0844C8DE206}"); + struct Descriptor {}; - TestAllocator() - {} - - static void SetUp() + TestRawMallocAllocator() + : AllocatorBase(this, "TestRawMallocAllocator", "") { - s_numAllocatedBytes = 0; + m_numAllocatedBytes = 0; } - static void TearDown() - {} - - void* Allocate( - size_t byteSize, - size_t alignment, - int = 0, - const char* = nullptr, - const char* = nullptr, - int = 0, - unsigned int = 0) + bool Create(const Descriptor&) { - s_numAllocatedBytes += byteSize; + m_numAllocatedBytes = 0; + return true; + } + + // IAllocator + void Destroy() override + { + m_numAllocatedBytes = 0; + } + AZ::AllocatorDebugConfig GetDebugConfig() override + { + return AZ::AllocatorDebugConfig(); + } + AZ::IAllocatorAllocate* GetSchema() override + { + return nullptr; + } + + // IAllocatorAllocate + void* Allocate(size_t byteSize, size_t alignment, int = 0, const char* = 0, const char* = 0, int = 0, unsigned int = 0) override + { + m_numAllocatedBytes += byteSize; if (alignment) { return AZ_OS_MALLOC(byteSize, alignment); @@ -152,18 +144,18 @@ namespace Benchmark } } - static void DeAllocate(void* ptr, size_t = 0) + void DeAllocate(void* ptr, size_t = 0, size_type = 0) override { - s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + m_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); } - static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) override { - s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + m_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); - s_numAllocatedBytes += newSize; + m_numAllocatedBytes += newSize; if (newAlignment) { return AZ_OS_MALLOC(newSize, newAlignment); @@ -174,7 +166,7 @@ namespace Benchmark } } - static size_t Resize(void* ptr, size_t newSize) + size_t Resize(void* ptr, size_t newSize) override { AZ_UNUSED(ptr); AZ_UNUSED(newSize); @@ -182,20 +174,45 @@ namespace Benchmark return 0; } - static void GarbageCollect() - {} - - static size_t NumAllocatedBytes() + size_t AllocationSize(void* ptr) override { - return s_numAllocatedBytes; + return Platform::GetMemorySize(ptr); + } + + void GarbageCollect() override {} + + size_t NumAllocatedBytes() const override + { + return m_numAllocatedBytes; + } + + size_t Capacity() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + + size_t GetMaxAllocationSize() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + + size_t GetMaxContiguousAllocationSize() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + size_t GetUnAllocatedMemory(bool = false) const override + { + return 0; // unused + } + IAllocatorAllocate* GetSubAllocator() override + { + return nullptr; // unused } private: - static size_t s_numAllocatedBytes; + size_t m_numAllocatedBytes; }; - size_t TestAllocator::s_numAllocatedBytes = 0; - // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator { @@ -236,19 +253,7 @@ namespace Benchmark : AZ::SystemAllocator() {} }; -} -namespace AZ -{ - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{1065B446-4873-4B3E-9CB1-069E148D4DF6}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{92CFDF86-02EE-4247-9809-884EE9F7BA18}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{67DA01DF-9232-493A-B11C-6952FEDEB2A9}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{47384CB4-6729-43A9-B0CE-402E3A7AEFB2}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{096423BC-DC36-48D2-8E89-8F1D600F488A}"); -} - -namespace Benchmark -{ // Allocated bytes reported by the allocator / actually requested bytes static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; @@ -277,7 +282,7 @@ namespace Benchmark : public ::benchmark::Fixture { protected: - using TestAllocatorType = TestAllocator; + using TestAllocatorType = TestAllocatorWrapper; virtual void internalSetUp(const ::benchmark::State&) { @@ -333,8 +338,6 @@ namespace Benchmark public: void Benchmark(benchmark::State& state) { - TestAllocatorType allocatorType; - for (auto _ : state) { const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); @@ -347,12 +350,12 @@ namespace Benchmark const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } state.PauseTiming(); state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); @@ -361,10 +364,10 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); m_allocations[allocationIndex] = nullptr; } - allocatorType.GarbageCollect(); + TestAllocatorType::GarbageCollect(); state.SetItemsProcessed(numberOfAllocations); state.ResumeTiming(); @@ -398,8 +401,6 @@ namespace Benchmark public: void Benchmark(benchmark::State& state) { - TestAllocatorType allocatorType; - for (auto _ : state) { state.PauseTiming(); @@ -410,7 +411,7 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -418,20 +419,20 @@ namespace Benchmark const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); state.PauseTiming(); m_allocations[allocationIndex] = nullptr; } state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); - allocatorType.GarbageCollect(); + TestAllocatorType::GarbageCollect(); state.ResumeTiming(); } From 3273b7621d10dc98d54864ef41b59284161f5c0d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 18:37:24 -0800 Subject: [PATCH 009/394] Fixes a recursive loop Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index af87584fc6..f27c92dfb2 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -322,7 +322,7 @@ namespace Benchmark void internalSetUp(const ::benchmark::State& state) override { - AllocatorBenchmarkFixture::SetUp(state); + AllocatorBenchmarkFixture::internalSetUp(state); m_allocations.resize(state.range_x(), nullptr); } @@ -332,7 +332,7 @@ namespace Benchmark m_allocations.clear(); m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::TearDown(state); + AllocatorBenchmarkFixture::internalTearDown(state); } public: @@ -386,7 +386,7 @@ namespace Benchmark void internalSetUp(const ::benchmark::State& state) override { - AllocatorBenchmarkFixture::SetUp(state); + AllocatorBenchmarkFixture::internalSetUp(state); m_allocations.resize(state.range_x(), nullptr); } @@ -396,7 +396,7 @@ namespace Benchmark m_allocations.clear(); m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::TearDown(state); + AllocatorBenchmarkFixture::internalTearDown(state); } public: void Benchmark(benchmark::State& state) From 160235e86f940a63dd7a06ccb12af39622a0eff8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:03:14 -0800 Subject: [PATCH 010/394] Removing commented code of different options for getting memory usage of a process Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Memory/AllocatorBenchmarks_Windows.cpp | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp index 9f4efd7a2c..c8532687e8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -20,41 +20,7 @@ namespace Benchmark { EmptyWorkingSet(GetCurrentProcess()); - //PROCESS_MEMORY_COUNTERS_EX pmc; - //GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)); - //return pmc.PrivateUsage; - //return pmc.WorkingSetSize; - - //size_t memoryUsage = 0; - //HANDLE defaultProcessHeap = GetProcessHeap(); - //PROCESS_HEAP_ENTRY heapEntry; - //if (HeapLock(defaultProcessHeap) == FALSE) - //{ - // AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError()); - // return memoryUsage; - //} - - //heapEntry.lpData = NULL; - //while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE) - //{ - // memoryUsage += heapEntry.cbData; - //} - - //DWORD lastError = GetLastError(); - //if (lastError != ERROR_NO_MORE_ITEMS) - //{ - // AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError); - //} - - //if (HeapUnlock(defaultProcessHeap) == FALSE) - //{ - // AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError()); - //} - - //return memoryUsage; - size_t memoryUsage = 0; - MEMORY_BASIC_INFORMATION mbi = { 0 }; unsigned char* pEndRegion = NULL; while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { From febaebc386225a091dc785e72d6bd99a2b3de196 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 13:51:08 -0800 Subject: [PATCH 011/394] PR comment (NULL->nullptr) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp index c8532687e8..e9571a7e5b 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -22,7 +22,7 @@ namespace Benchmark size_t memoryUsage = 0; MEMORY_BASIC_INFORMATION mbi = { 0 }; - unsigned char* pEndRegion = NULL; + unsigned char* pEndRegion = nullptr; while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { pEndRegion += mbi.RegionSize; if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { From 215cb9b52ffd0ee1f40325421f93d977754ed2ff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 16:06:26 -0800 Subject: [PATCH 012/394] Adds mulit-threaded tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 82 +++++++++++-------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index f27c92dfb2..7cd7e7ce0a 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -284,14 +284,34 @@ namespace Benchmark protected: using TestAllocatorType = TestAllocatorWrapper; - virtual void internalSetUp(const ::benchmark::State&) + virtual void internalSetUp(const ::benchmark::State& state) { - TestAllocatorType::SetUp(); + if (state.thread_index == 0) // Only setup in the first thread + { + TestAllocatorType::SetUp(); + + m_allocations.resize(state.threads); + for (auto& perThreadAllocations : m_allocations) + { + perThreadAllocations.resize(state.range_x(), nullptr); + } + } } - virtual void internalTearDown(const ::benchmark::State&) + virtual void internalTearDown(const ::benchmark::State& state) { - TestAllocatorType::TearDown(); + if (state.thread_index == 0) // Only setup in the first thread + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + TestAllocatorType::TearDown(); + } + } + + AZStd::vector& GetPerThreadAllocations(size_t threadIndex) + { + return m_allocations[threadIndex]; } public: @@ -312,26 +332,25 @@ namespace Benchmark { internalTearDown(state); } + + private: + AZStd::vector> m_allocations; }; template class AllocationBenchmarkFixture : public AllocatorBenchmarkFixture { - using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { AllocatorBenchmarkFixture::internalSetUp(state); - - m_allocations.resize(state.range_x(), nullptr); } void internalTearDown(const ::benchmark::State& state) override { - m_allocations.clear(); - m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::internalTearDown(state); } @@ -340,17 +359,19 @@ namespace Benchmark { for (auto _ : state) { + state.PauseTiming(); const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - const size_t numberOfAllocations = m_allocations.size(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + const size_t numberOfAllocations = perThreadAllocations.size(); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { - state.PauseTiming(); const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + state.PauseTiming(); } state.PauseTiming(); @@ -364,8 +385,8 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); - m_allocations[allocationIndex] = nullptr; + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + perThreadAllocations[allocationIndex] = nullptr; } TestAllocatorType::GarbageCollect(); @@ -373,29 +394,22 @@ namespace Benchmark state.ResumeTiming(); } } - - private: - AZStd::vector m_allocations; }; template class DeAllocationBenchmarkFixture : public AllocatorBenchmarkFixture { - using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { AllocatorBenchmarkFixture::internalSetUp(state); - - m_allocations.resize(state.range_x(), nullptr); } void internalTearDown(const ::benchmark::State& state) override { - m_allocations.clear(); - m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::internalTearDown(state); } public: @@ -404,14 +418,15 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - const size_t numberOfAllocations = m_allocations.size(); + const size_t numberOfAllocations = perThreadAllocations.size(); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -419,9 +434,9 @@ namespace Benchmark const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); state.PauseTiming(); - m_allocations[allocationIndex] = nullptr; + perThreadAllocations[allocationIndex] = nullptr; } state.counters[s_counterAllocatorMemoryRatio] = @@ -437,9 +452,6 @@ namespace Benchmark state.ResumeTiming(); } } - - private: - AZStd::vector m_allocations; }; static void RunRanges(benchmark::internal::Benchmark* b) @@ -450,14 +462,20 @@ namespace Benchmark } } + // Test under and over-subscription of threads vs the amount of CPUs available + static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); + #define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + // We test small/big/mixed allocations in single-threaded environments. For multi-threaded environments, we test mixed since + // the multi threaded fixture will run multiple passes (1, 2, 4, ... until 2*hardware_concurrency) #define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ - BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(1, MaxThreadRange)->Apply(RunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ From f062b563c89e88b1facf32c6660bdca6cfac9057 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 17:30:55 -0800 Subject: [PATCH 013/394] Improving runtime and making the whole duration manageable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 44 +++++++--- .../AzCore/Tests/Memory/HphaSchema.cpp | 88 ------------------- 2 files changed, 31 insertions(+), 101 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 7cd7e7ce0a..c1fdd4ca32 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -364,21 +364,27 @@ namespace Benchmark AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; state.ResumeTiming(); perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); state.PauseTiming(); } - state.PauseTiming(); - state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + // In allocation cases, s_counterAllocatorMemoryRatio is measuring how much over-allocation our allocators + // are doing to keep track of the memory and because of fragmentation/under-use of blocks. A ratio over 1 means + // that we are using more memory than requested. Ideally we would approximate to a ratio of 1. + state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( + static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), + benchmark::Counter::kDefaults); + // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -391,7 +397,6 @@ namespace Benchmark TestAllocatorType::GarbageCollect(); state.SetItemsProcessed(numberOfAllocations); - state.ResumeTiming(); } } }; @@ -422,10 +427,12 @@ namespace Benchmark const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } @@ -439,29 +446,40 @@ namespace Benchmark perThreadAllocations[allocationIndex] = nullptr; } - state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + // In deallocation cases, s_counterAllocatorMemoryRatio is measuring how much "left-over" memory our allocators + // have after deallocations happen. This is memory that is not returned to the operative system. A ratio of 1 means + // that no memory was returned to the OS. A ratio over 1 means that we are holding more memory than requested. A ratio + // lower than 1 means that we have returned some memory. + state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( + static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), + benchmark::Counter::kDefaults); + // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); TestAllocatorType::GarbageCollect(); - - state.ResumeTiming(); } } }; + // For non-threaded ranges, run 100, 400, 1600 amounts static void RunRanges(benchmark::internal::Benchmark* b) { - for (int i = 0; i < 6; ++i) + for (int i = 0; i < 6; i += 2) { - b->Arg((1 << i) * 1000); + b->Arg((1 << i) * 100); } } + // For threaded ranges, run just 200, multi-threaded will already multiply by thread + static void ThreadedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(100); + } + // Test under and over-subscription of threads vs the amount of CPUs available static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); @@ -475,7 +493,7 @@ namespace Benchmark BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ - BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(1, MaxThreadRange)->Apply(RunRanges); + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ diff --git a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp index 85dd79931d..08b84416e6 100644 --- a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp @@ -10,10 +10,6 @@ #include #include -#if defined(HAVE_BENCHMARK) -#include -#endif // HAVE_BENCHMARK - class HphaSchema_TestAllocator : public AZ::SimpleSchemaAllocator { @@ -112,87 +108,3 @@ namespace UnitTest HphaSchemaTestFixture, ::testing::ValuesIn(s_mixedInstancesParameters)); } - - -#if defined(HAVE_BENCHMARK) -namespace Benchmark -{ - class HphaSchemaBenchmarkFixture - : public ::benchmark::Fixture - { - void internalSetUp() - { - AZ::AllocatorInstance::Create(); - } - - void internalTearDown() - { - AZ::AllocatorInstance::Destroy(); - } - - public: - void SetUp(const benchmark::State&) override - { - internalSetUp(); - } - void SetUp(benchmark::State&) override - { - internalSetUp(); - } - void TearDown(const benchmark::State&) override - { - internalTearDown(); - } - void TearDown(benchmark::State&) override - { - internalTearDown(); - } - - static void BM_Allocations(benchmark::State& state, const AllocationSizeArray& allocationArray) - { - AZStd::vector allocations; - while (state.KeepRunning()) - { - state.PauseTiming(); - const size_t allocationIndex = allocations.size(); - const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - - state.ResumeTiming(); - void* allocation = AZ::AllocatorInstance::Get().Allocate(allocationSize, 0); - - state.PauseTiming(); - allocations.emplace_back(allocation); - - state.ResumeTiming(); - } - - const size_t numberOfAllocations = allocations.size(); - state.SetItemsProcessed(numberOfAllocations); - - for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) - { - AZ::AllocatorInstance::Get().DeAllocate(allocations[allocationIndex], allocationArray[allocationIndex % allocationArray.size()]); - } - AZ::AllocatorInstance::Get().GarbageCollect(); - } - }; - - // Small allocations, these are allocations that are going to end up in buckets in the HphaSchema - BENCHMARK_F(HphaSchemaBenchmarkFixture, SmallAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_smallAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, BigAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_bigAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, MixedAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_mixedAllocationSizes); - } - - -} // Benchmark -#endif // HAVE_BENCHMARK From 0f5cb54a38d32abacc29f1bc23d58d6032384bb6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:11:08 -0800 Subject: [PATCH 014/394] Fixes Linux build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 10 +++------- .../Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp | 4 ++-- .../Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 5 +++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index c1fdd4ca32..dfaefd4c0f 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -248,10 +248,6 @@ namespace Benchmark { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); - - TestSystemAllocator() - : AZ::SystemAllocator() - {} }; // Allocated bytes reported by the allocator / actually requested bytes @@ -293,7 +289,7 @@ namespace Benchmark m_allocations.resize(state.threads); for (auto& perThreadAllocations : m_allocations) { - perThreadAllocations.resize(state.range_x(), nullptr); + perThreadAllocations.resize(state.range(0), nullptr); } } } @@ -342,7 +338,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { @@ -406,7 +402,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp index 49ecefda49..636d5519d8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace Benchmark { @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 374d9f81f7..303b7efbb4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,8 @@ #include #include -#include +#include +#include namespace Benchmark { @@ -24,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } From fbd2d60fc1cfc91a49331b304abb797524ae0270 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:15:22 -0800 Subject: [PATCH 015/394] Fixes for mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 303b7efbb4..932252985a 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include namespace Benchmark @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? malloc_usable_size(memory) : 0; + return memory ? malloc_size(memory) : 0; } } } From 72f338a6897ff952ae0bfc564fc19fae072fbb1c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:55:36 -0800 Subject: [PATCH 016/394] Fixes for HeapSchema to get a default block if none is passed Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp | 12 +----------- Code/Framework/AzCore/AzCore/Memory/HeapSchema.h | 14 ++++---------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index aceafa1b28..1f0fc59a97 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -115,6 +115,7 @@ namespace AZ m_ownMemoryBlock[i] = false; } + AZ_Assert(m_desc.m_numMemoryBlocks > 0, "At least one memory block is required"); for (int i = 0; i < m_desc.m_numMemoryBlocks; ++i) { if (m_desc.m_memoryBlocks[i] == nullptr) // Allocate memory block if requested! @@ -131,17 +132,6 @@ namespace AZ m_capacity += m_desc.m_memoryBlocksByteSize[i]; } - - if (m_desc.m_numMemoryBlocks == 0) - { - // Create default memory space if we can to serve for default allocations - m_memSpaces[0] = AZDLMalloc::create_mspace(0, m_desc.m_isMultithreadAlloc); - if (m_memSpaces[0]) - { - AZDLMalloc::mspace_az_set_expandable(m_memSpaces[0], true); - m_capacity = Platform::GetHeapCapacity(); - } - } } HeapSchema::~HeapSchema() diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index f72ae31057..3a7716a127 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -32,17 +32,11 @@ namespace AZ */ struct Descriptor { - Descriptor() - : m_numMemoryBlocks(0) - , m_isMultithreadAlloc(true) - {} - - static const int m_memoryBlockAlignment = 64 * 1024; static const int m_maxNumBlocks = 5; - int m_numMemoryBlocks; ///< Number of memory blocks to use. - void* m_memoryBlocks[m_maxNumBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. - size_t m_memoryBlocksByteSize[m_maxNumBlocks]; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - bool m_isMultithreadAlloc; ///< Set to true to enable multi threading safe allocation. + int m_numMemoryBlocks = 1; ///< Number of memory blocks to use. + void* m_memoryBlocks[m_maxNumBlocks] = {}; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. + size_t m_memoryBlocksByteSize[m_maxNumBlocks] = {4 * 1024}; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. + bool m_isMultithreadAlloc = true; ///< Set to true to enable multi threading safe allocation. }; HeapSchema(const Descriptor& desc); From cf9aab991104d0b59697b4826d25024add70f752 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:34:52 -0800 Subject: [PATCH 017/394] Adds recording functionality (disabled) and a benchmark that can run recordings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 81 +++++ .../Tests/Memory/AllocatorBenchmarks.cpp | 344 ++++++++++++------ 2 files changed, 309 insertions(+), 116 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index e450f12bcf..40ddff0fc3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -12,6 +12,49 @@ using namespace AZ; +#define RECORDING_ENABLED 0 + +#if RECORDING_ENABLED + +struct AllocatorOperation +{ + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE, + REALLOCATE, + RESIZE + }; + OperationType m_operationType : 2; + size_t m_size : 46; + size_t m_alignment : 16; + void* m_ptr; + void* m_newptr; // required for resize +}; +static constexpr size_t s_allocationOperationCount = 5 * 1024; +static AZStd::array s_operations = {}; +static uint64_t s_operationCounter = 0; +static AZStd::mutex s_operationsMutex; + +AllocatorOperation& GetNextAllocatorOperation() +{ + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + FILE* file = nullptr; + fopen_s(&file, "memoryrecordings.bin", "ab"); + if (file) + { + fwrite(&s_operations, sizeof(AllocatorOperation), s_allocationOperationCount, file); + fclose(file); + } + s_operationCounter = 0; + } + return s_operations[s_operationCounter++]; +} + +#endif + AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : IAllocator(allocationSource), m_name(name), @@ -136,6 +179,16 @@ void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignme EBUS_EVENT(AZ::Debug::MemoryDrillerBus, RegisterAllocation, this, ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord); #endif } + +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::ALLOCATE; + op.m_size = byteSize; + op.m_alignment = alignment; + op.m_ptr = ptr; + } +#endif } void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) @@ -148,6 +201,15 @@ void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t align EBUS_EVENT(AZ::Debug::MemoryDrillerBus, UnregisterAllocation, this, ptr, byteSize, alignment, info); #endif } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::DEALLOCATE; + op.m_size = byteSize; + op.m_alignment = alignment; + op.m_ptr = ptr; + } +#endif } void AllocatorBase::ProfileReallocationBegin(void* ptr, size_t newSize) @@ -174,6 +236,16 @@ void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSi EBUS_EVENT(AZ::Debug::MemoryDrillerBus, ReallocateAllocation, this, ptr, newPtr, newSize, newAlignment); #endif } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::REALLOCATE; + op.m_size = newSize; + op.m_alignment = newAlignment; + op.m_ptr = ptr; + op.m_newptr = newPtr; + } +#endif } void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) @@ -187,6 +259,15 @@ void AllocatorBase::ProfileResize(void* ptr, size_t newSize) { EBUS_EVENT(AZ::Debug::MemoryDrillerBus, ResizeAllocation, this, ptr, newSize); } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::RESIZE; + op.m_size = newSize; + op.m_alignment = 0; + op.m_ptr = ptr; + } +#endif } bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index dfaefd4c0f..76c3316009 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -32,7 +32,7 @@ namespace Benchmark size_t GetMemorySize(void* memory); } - static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + //static AZ::Debug::DrillerManager* s_drillerManager = nullptr; /// /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. @@ -47,14 +47,14 @@ namespace Benchmark { AZ::AllocatorInstance::Create(); - s_drillerManager = AZ::Debug::DrillerManager::Create(); - s_drillerManager->Register(aznew AZ::Debug::MemoryDriller); + /*s_drillerManager = AZ::Debug::DrillerManager::Create(); + s_drillerManager->Register(aznew AZ::Debug::MemoryDriller);*/ } static void TearDown() { - AZ::Debug::DrillerManager::Destroy(s_drillerManager); - s_drillerManager = nullptr; + /*AZ::Debug::DrillerManager::Destroy(s_drillerManager); + s_drillerManager = nullptr;*/ AZ::AllocatorInstance::Destroy(); } @@ -89,51 +89,41 @@ namespace Benchmark return AZ::AllocatorInstance::Get().NumAllocatedBytes() + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); } + + static size_t GetSize(void* ptr) + { + return AZ::AllocatorInstance::Get().AllocationSize(ptr); + } }; /// /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. /// - class TestRawMallocAllocator - : public AZ::AllocatorBase - , public AZ::IAllocatorAllocate + class TestRawMallocAllocator {}; + + template<> + class TestAllocatorWrapper { public: - AZ_TYPE_INFO(TestMallocSchemaAllocator, "{08EB400A-D723-46C6-808E-D0844C8DE206}"); - - struct Descriptor {}; - - TestRawMallocAllocator() - : AllocatorBase(this, "TestRawMallocAllocator", "") + TestAllocatorWrapper() { - m_numAllocatedBytes = 0; + s_numAllocatedBytes = 0; } - bool Create(const Descriptor&) + static void SetUp() { - m_numAllocatedBytes = 0; - return true; + s_numAllocatedBytes = 0; } - // IAllocator - void Destroy() override + static void TearDown() { - m_numAllocatedBytes = 0; - } - AZ::AllocatorDebugConfig GetDebugConfig() override - { - return AZ::AllocatorDebugConfig(); - } - AZ::IAllocatorAllocate* GetSchema() override - { - return nullptr; } // IAllocatorAllocate - void* Allocate(size_t byteSize, size_t alignment, int = 0, const char* = 0, const char* = 0, int = 0, unsigned int = 0) override + static void* Allocate(size_t byteSize, size_t alignment) { - m_numAllocatedBytes += byteSize; + s_numAllocatedBytes += byteSize; if (alignment) { return AZ_OS_MALLOC(byteSize, alignment); @@ -144,18 +134,18 @@ namespace Benchmark } } - void DeAllocate(void* ptr, size_t = 0, size_type = 0) override + static void DeAllocate(void* ptr, size_t = 0) { - m_numAllocatedBytes -= Platform::GetMemorySize(ptr); + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); } - void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) override + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) { - m_numAllocatedBytes -= Platform::GetMemorySize(ptr); + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); - m_numAllocatedBytes += newSize; + s_numAllocatedBytes += newSize; if (newAlignment) { return AZ_OS_MALLOC(newSize, newAlignment); @@ -166,7 +156,7 @@ namespace Benchmark } } - size_t Resize(void* ptr, size_t newSize) override + static size_t Resize(void* ptr, size_t newSize) { AZ_UNUSED(ptr); AZ_UNUSED(newSize); @@ -174,45 +164,24 @@ namespace Benchmark return 0; } - size_t AllocationSize(void* ptr) override + static void GarbageCollect() {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + static size_t GetSize(void* ptr) { return Platform::GetMemorySize(ptr); } - void GarbageCollect() override {} - - size_t NumAllocatedBytes() const override - { - return m_numAllocatedBytes; - } - - size_t Capacity() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - - size_t GetMaxAllocationSize() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - - size_t GetMaxContiguousAllocationSize() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - size_t GetUnAllocatedMemory(bool = false) const override - { - return 0; // unused - } - IAllocatorAllocate* GetSubAllocator() override - { - return nullptr; // unused - } - private: - size_t m_numAllocatedBytes; + static size_t s_numAllocatedBytes; }; + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator { @@ -250,11 +219,14 @@ namespace Benchmark AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); }; - // Allocated bytes reported by the allocator / actually requested bytes - static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; + // Allocated bytes reported by the allocator + static const char* s_counterAllocatorMemory = "Allocator_Memory"; - // Allocated bytes reported by the process / actually requested bytes - static const char* s_counterProcessMemoryRatio = "Process_MemoryRatio"; + // Allocated bytes reported by the process + static const char* s_counterProcessMemory = "Process_Memory"; + + // Allocated bytes as counted by the benchmark + static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; enum AllocationSize { @@ -340,16 +312,6 @@ namespace Benchmark using base = AllocatorBenchmarkFixture; using TestAllocatorType = typename base::TestAllocatorType; - void internalSetUp(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalSetUp(state); - } - - void internalTearDown(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalTearDown(state); - } - public: void Benchmark(benchmark::State& state) { @@ -372,16 +334,9 @@ namespace Benchmark state.PauseTiming(); } - // In allocation cases, s_counterAllocatorMemoryRatio is measuring how much over-allocation our allocators - // are doing to keep track of the memory and because of fragmentation/under-use of blocks. A ratio over 1 means - // that we are using more memory than requested. Ideally we would approximate to a ratio of 1. - state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( - static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); - // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory - state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { @@ -404,15 +359,6 @@ namespace Benchmark using base = AllocatorBenchmarkFixture; using TestAllocatorType = typename base::TestAllocatorType; - void internalSetUp(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalSetUp(state); - } - - void internalTearDown(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalTearDown(state); - } public: void Benchmark(benchmark::State& state) { @@ -442,17 +388,9 @@ namespace Benchmark perThreadAllocations[allocationIndex] = nullptr; } - // In deallocation cases, s_counterAllocatorMemoryRatio is measuring how much "left-over" memory our allocators - // have after deallocations happen. This is memory that is not returned to the operative system. A ratio of 1 means - // that no memory was returned to the OS. A ratio over 1 means that we are holding more memory than requested. A ratio - // lower than 1 means that we have returned some memory. - state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( - static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); - // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory - state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); @@ -460,6 +398,175 @@ namespace Benchmark } } }; + + template + class RecordedAllocationBenchmarkFixture : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + struct AllocatorOperation + { + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE, + REALLOCATE, + RESIZE + }; + OperationType m_operationType : 2; + size_t m_size : 46; + size_t m_alignment : 16; + void* m_ptr; + void* m_newptr; // required for resize + }; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::unordered_map pointerRemapping; + AZStd::unordered_map allocationSize; + constexpr size_t allocationOperationCount = 5 * 1024; + AZStd::array m_operations = {}; + + FILE* file = nullptr; + fopen_s(&file, "memoryrecordings.bin", "rb"); + if (!file) + { + return; + } + size_t elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + size_t totalElementsRead = elementsRead; + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + size_t totalAllocationSize = 0; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + { + const AllocatorOperation& operation = m_operations[operationIndex]; + switch (operation.m_operationType) + { + case AllocatorOperation::ALLOCATE: + { + if (operation.m_ptr) + { + const auto it = pointerRemapping.emplace(operation.m_ptr, nullptr); + if (it.second) // otherwise already allocated + { + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + allocationSize[ptr] = operation.m_size; + } + else + { + //AZ_Warning("RecordedAllocationBenchmarkFixture", false, "Allocation on %p was already made", operation.m_ptr); + } + } + break; + } + case AllocatorOperation::DEALLOCATE: + { + if (operation.m_ptr) // some deallocate(nullptr) are recorded + { + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= allocationSize[ptrIt->second]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else + { + // Just to account of the call of deallocate(nullptr); + // totalAllocationSize -= 0; // No real deallocation happened + state.ResumeTiming(); + TestAllocatorType::DeAllocate(operation.m_ptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } + break; + } + case AllocatorOperation::REALLOCATE: + { + void* ptr = nullptr; + if (operation.m_ptr) + { + AZ_Assert(operation.m_newptr, "Need to consider other cases?"); + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for reallocation"); // In case the recording didnt catch something + ptr = ptrIt->second; + pointerRemapping.erase(ptrIt); + } + AZ_Assert(operation.m_newptr != nullptr, "Reallocation failed in the game"); + const auto it = pointerRemapping.emplace(operation.m_newptr, nullptr); + if (it.second) + { + totalAllocationSize -= allocationSize[ptr]; + state.ResumeTiming(); + void* newPtr = TestAllocatorType::ReAllocate(ptr, operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = newPtr; + allocationSize[newPtr] = operation.m_size; + } + else + { + totalAllocationSize -= allocationSize[ptr]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(ptr); + state.PauseTiming(); + } + break; + } + case AllocatorOperation::RESIZE: + { + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for resize"); // In case the recording didnt catch something + totalAllocationSize -= allocationSize[ptrIt->second]; + state.ResumeTiming(); + TestAllocatorType::Resize(ptrIt->second, operation.m_size); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + if (operation.m_size == 0) + { + pointerRemapping.erase(ptrIt); + } + break; + } + } + } + + elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + totalElementsRead += elementsRead; + } + fclose(file); + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(totalElementsRead); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + TestAllocatorType::DeAllocate(pointerMapping.second); + } + pointerRemapping.clear(); + TestAllocatorType::GarbageCollect(); + } + } + }; // For non-threaded ranges, run 100, 400, 1600 amounts static void RunRanges(benchmark::internal::Benchmark* b) @@ -469,6 +576,10 @@ namespace Benchmark b->Arg((1 << i) * 100); } } + static void RecordedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(1); + } // For threaded ranges, run just 200, multi-threaded will already multiply by thread static void ThreadedRunRanges(benchmark::internal::Benchmark* b) @@ -494,16 +605,17 @@ namespace Benchmark #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ { \ - BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ - BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ } BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); - BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating From 4b07665496f060459020f3f6c250807f26d0a80f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:35:39 -0800 Subject: [PATCH 018/394] Removes Heap allocator from being possible to use as a SystemAllocator since it doesnt allow dynamic allocating (only works with pre-allocated blocks) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index 8c84338fd0..9ce681ef2d 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -19,7 +19,6 @@ #define AZCORE_SYSTEM_ALLOCATOR_HPHA 1 #define AZCORE_SYSTEM_ALLOCATOR_MALLOC 2 -#define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) // define the default @@ -30,8 +29,6 @@ #include #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC #include -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - #include #else #error "Invalid allocator selected for SystemAllocator" #endif @@ -46,8 +43,6 @@ static bool g_isSystemSchemaUsed = false; static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static AZStd::aligned_storage::value>::type g_systemSchema; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static AZStd::aligned_storage::value>::type g_systemSchema; #endif ////////////////////////////////////////////////////////////////////////// @@ -121,11 +116,6 @@ SystemAllocator::Create(const Descriptor& desc) heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif if (&AllocatorInstance::Get() == this) // if we are the system allocator { @@ -135,8 +125,6 @@ SystemAllocator::Create(const Descriptor& desc) m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new(&g_systemSchema)HeapSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -150,8 +138,6 @@ SystemAllocator::Create(const Descriptor& desc) m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); #endif if (m_allocator == nullptr) { @@ -188,8 +174,6 @@ SystemAllocator::Destroy() static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static_cast(m_allocator)->~MallocSchema(); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); #endif g_isSystemSchemaUsed = false; } From f96a466212c1acc526e2a1e41e6849fe854e3a1d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 7 Dec 2021 17:58:49 -0800 Subject: [PATCH 019/394] WIP trying to use SystemAllocator instead of raw reads Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 193 ++++++++++++------ Code/Framework/AzCore/CMakeLists.txt | 5 + .../Memory/AllocatorBenchmarkRecordings.bin | 3 + .../Tests/Memory/AllocatorBenchmarks.cpp | 145 ++++--------- 4 files changed, 181 insertions(+), 165 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 7bba1b1d20..32ccd43f9a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -11,47 +11,142 @@ using namespace AZ; -#define RECORDING_ENABLED 0 +#define RECORDING_ENABLED 1 #if RECORDING_ENABLED -struct AllocatorOperation -{ - enum OperationType : unsigned int - { - ALLOCATE, - DEALLOCATE, - REALLOCATE, - RESIZE - }; - OperationType m_operationType : 2; - size_t m_size : 46; - size_t m_alignment : 16; - void* m_ptr; - void* m_newptr; // required for resize -}; -static constexpr size_t s_allocationOperationCount = 5 * 1024; -static AZStd::array s_operations = {}; -static uint64_t s_operationCounter = 0; -static AZStd::mutex s_operationsMutex; +#include +#include +#include +#include -AllocatorOperation& GetNextAllocatorOperation() +namespace { - AZStd::scoped_lock lock(s_operationsMutex); - if (s_operationCounter == s_allocationOperationCount) + class DebugAllocator { - FILE* file = nullptr; - fopen_s(&file, "memoryrecordings.bin", "ab"); - if (file) + public: + typedef void* pointer_type; + typedef AZStd::size_t size_type; + typedef AZStd::ptrdiff_t difference_type; + typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. + + AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) { - fwrite(&s_operations, sizeof(AllocatorOperation), s_allocationOperationCount, file); - fclose(file); + return AZ_OS_MALLOC(byteSize, alignment); } - s_operationCounter = 0; - } - return s_operations[s_operationCounter++]; -} + AZ_FORCE_INLINE size_type resize(pointer_type, size_type) + { + return 0; + } + AZ_FORCE_INLINE void deallocate(pointer_type ptr, size_type, size_type) + { + AZ_OS_FREE(ptr); + } + }; + struct AllocatorOperation + { + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type: 1; + unsigned int m_size : 28; // Can represent up to 256Mb requests + unsigned int m_alignment : 7; // Can represent up to 128 alignment + unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + static AZStd::mutex s_operationsMutex = {}; + + static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; + static size_t s_numberOfAllocationsRecorded = 0; + static constexpr size_t s_allocationOperationCount = 5 * 1024; + static AZStd::array s_operations = {}; + static uint64_t s_operationCounter = 0; + + static unsigned int s_nextRecordId = 1; + using AllocatorOperationByAddress = AZStd::map, DebugAllocator>; + static AllocatorOperationByAddress s_allocatorOperationByAddress; + using AvailableRecordIds = AZStd::vector; + AvailableRecordIds s_availableRecordIds; + + void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) + { + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + AZ::IO::SystemFile file; + file.Open("memoryrecordings.bin", AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND); + if (file.IsOpen()) + { + file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); + file.Close(); + } + s_operationCounter = 0; + } + AllocatorOperation& operation = s_operations[s_operationCounter++]; + operation.m_type = type; + if (type == AllocatorOperation::OperationType::ALLOCATE) + { + if (s_numberOfAllocationsRecorded > s_maxNumberOfAllocationsToRecord) + { + // reached limit of allocations, dont record anymore + --s_operationCounter; + return; + } + ++s_numberOfAllocationsRecorded; + operation.m_size = size; + operation.m_alignment = alignment; + unsigned int recordId = 0; + if (!s_availableRecordIds.empty()) + { + recordId = s_availableRecordIds.back(); + s_availableRecordIds.pop_back(); + } + else + { + recordId = s_nextRecordId; + ++s_nextRecordId; + } + operation.m_recordId = recordId; + auto it = s_allocatorOperationByAddress.emplace(ptr, operation); + if (!it.second) + { + // double alloc or resize, leave the current record and return the id + operation = it.first->second; + s_availableRecordIds.emplace_back(recordId); + } + } + else + { + if (ptr == nullptr) + { + // common scenario, just record the operation + operation.m_size = 0; + operation.m_alignment = 0; + operation.m_recordId = 0; // recordId = 0 will flag this case + } + else + { + auto it = s_allocatorOperationByAddress.find(ptr); + if (it != s_allocatorOperationByAddress.end()) + { + operation.m_size = it->second.m_size; + operation.m_alignment = it->second.m_alignment; + operation.m_recordId = it->second.m_recordId; + s_availableRecordIds.push_back(it->second.m_recordId); + s_allocatorOperationByAddress.erase(it); + } + else + { + // just dont record this operation + --s_operationCounter; + } + } + } + + } +} #endif AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : @@ -188,13 +283,7 @@ void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignme } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::ALLOCATE; - op.m_size = byteSize; - op.m_alignment = alignment; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); #endif } @@ -209,13 +298,7 @@ void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t align } } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::DEALLOCATE; - op.m_size = byteSize; - op.m_alignment = alignment; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); #endif } @@ -232,14 +315,8 @@ void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSi ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::REALLOCATE; - op.m_size = newSize; - op.m_alignment = newAlignment; - op.m_ptr = ptr; - op.m_newptr = newPtr; - } + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); #endif } @@ -259,13 +336,7 @@ void AllocatorBase::ProfileResize(void* ptr, size_t newSize) } } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::RESIZE; - op.m_size = newSize; - op.m_alignment = 0; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); #endif } diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 96ed838ccc..838142f0df 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -146,6 +146,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PROPERTY COMPILE_DEFINITIONS VALUES AZCORETEST_DLL_NAME=\"$\" ) + ly_add_target_files( + TARGETS AzCore.Tests + FILES ${CMAKE_CURRENT_SOURCE_DIR}/Tests/Memory/AllocatorBenchmarkRecordings.bin + OUTPUT_SUBDIRECTORY Tests/AzCore/Memory + ) endif() diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin new file mode 100644 index 0000000000..2b587a2304 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0f148441ce120b303896618cec364b5afb6f8b911b4785ec6358cfe8467cf7a +size 368640 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 76c3316009..f5a728018c 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -9,9 +9,8 @@ #if defined(HAVE_BENCHMARK) #include +#include #include -#include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include @@ -32,11 +32,9 @@ namespace Benchmark size_t GetMemorySize(void* memory); } - //static AZ::Debug::DrillerManager* s_drillerManager = nullptr; - /// /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. - /// It also creates/destroys the TAllocator type and connects the driller (to reflect what happens at runtime) + /// It also creates/destroys the TAllocator type (to reflect what happens at runtime) /// /// Allocator type to wrap template @@ -46,16 +44,10 @@ namespace Benchmark static void SetUp() { AZ::AllocatorInstance::Create(); - - /*s_drillerManager = AZ::Debug::DrillerManager::Create(); - s_drillerManager->Register(aznew AZ::Debug::MemoryDriller);*/ } static void TearDown() { - /*AZ::Debug::DrillerManager::Destroy(s_drillerManager); - s_drillerManager = nullptr;*/ - AZ::AllocatorInstance::Destroy(); } @@ -410,15 +402,12 @@ namespace Benchmark enum OperationType : unsigned int { ALLOCATE, - DEALLOCATE, - REALLOCATE, - RESIZE + DEALLOCATE }; - OperationType m_operationType : 2; - size_t m_size : 46; - size_t m_alignment : 16; - void* m_ptr; - void* m_newptr; // required for resize + OperationType m_type : 1; + unsigned int m_size : 28; // Can represent up to 256Mb requests + unsigned int m_alignment : 7; // Can represent up to 128 alignment + unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; public: @@ -428,18 +417,18 @@ namespace Benchmark { state.PauseTiming(); - AZStd::unordered_map pointerRemapping; - AZStd::unordered_map allocationSize; + AZStd::unordered_map pointerRemapping; constexpr size_t allocationOperationCount = 5 * 1024; AZStd::array m_operations = {}; - FILE* file = nullptr; - fopen_s(&file, "memoryrecordings.bin", "rb"); - if (!file) + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) { return; } - size_t elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + size_t elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); size_t totalElementsRead = elementsRead; const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; @@ -449,107 +438,54 @@ namespace Benchmark for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) { const AllocatorOperation& operation = m_operations[operationIndex]; - switch (operation.m_operationType) + if (operation.m_type == AllocatorOperation::ALLOCATE) { - case AllocatorOperation::ALLOCATE: - { - if (operation.m_ptr) + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated { - const auto it = pointerRemapping.emplace(operation.m_ptr, nullptr); - if (it.second) // otherwise already allocated - { - state.ResumeTiming(); - void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = ptr; - allocationSize[ptr] = operation.m_size; - } - else - { - //AZ_Warning("RecordedAllocationBenchmarkFixture", false, "Allocation on %p was already made", operation.m_ptr); - } + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; } - break; - } - case AllocatorOperation::DEALLOCATE: - { - if (operation.m_ptr) // some deallocate(nullptr) are recorded + else { - const auto ptrIt = pointerRemapping.find(operation.m_ptr); + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); + state.PauseTiming(); + } + } + else // AllocatorOperation::DEALLOCATE: + { + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); if (ptrIt != pointerRemapping.end()) { - totalAllocationSize -= allocationSize[ptrIt->second]; + totalAllocationSize -= operation.m_size; state.ResumeTiming(); TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it state.PauseTiming(); pointerRemapping.erase(ptrIt); } } - else + else // deallocate(nullptr) are recorded { // Just to account of the call of deallocate(nullptr); - // totalAllocationSize -= 0; // No real deallocation happened state.ResumeTiming(); - TestAllocatorType::DeAllocate(operation.m_ptr, /*operation.m_size*/ 0); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); state.PauseTiming(); } - break; - } - case AllocatorOperation::REALLOCATE: - { - void* ptr = nullptr; - if (operation.m_ptr) - { - AZ_Assert(operation.m_newptr, "Need to consider other cases?"); - const auto ptrIt = pointerRemapping.find(operation.m_ptr); - AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for reallocation"); // In case the recording didnt catch something - ptr = ptrIt->second; - pointerRemapping.erase(ptrIt); - } - AZ_Assert(operation.m_newptr != nullptr, "Reallocation failed in the game"); - const auto it = pointerRemapping.emplace(operation.m_newptr, nullptr); - if (it.second) - { - totalAllocationSize -= allocationSize[ptr]; - state.ResumeTiming(); - void* newPtr = TestAllocatorType::ReAllocate(ptr, operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = newPtr; - allocationSize[newPtr] = operation.m_size; - } - else - { - totalAllocationSize -= allocationSize[ptr]; - state.ResumeTiming(); - TestAllocatorType::DeAllocate(ptr); - state.PauseTiming(); - } - break; - } - case AllocatorOperation::RESIZE: - { - const auto ptrIt = pointerRemapping.find(operation.m_ptr); - AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for resize"); // In case the recording didnt catch something - totalAllocationSize -= allocationSize[ptrIt->second]; - state.ResumeTiming(); - TestAllocatorType::Resize(ptrIt->second, operation.m_size); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - if (operation.m_size == 0) - { - pointerRemapping.erase(ptrIt); - } - break; - } } } - elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); totalElementsRead += elementsRead; } - fclose(file); + file.Close(); state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); @@ -579,6 +515,7 @@ namespace Benchmark static void RecordedRunRanges(benchmark::internal::Benchmark* b) { b->Arg(1); + b->Iterations(100); } // For threaded ranges, run just 200, multi-threaded will already multiply by thread From 0d66278ef7c466e6457fc8f5cb99ac020022becd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:44:15 -0800 Subject: [PATCH 020/394] Makes the recorded benchmark more stable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 23 ++- .../Memory/AllocatorBenchmarkRecordings.bin | 4 +- .../Tests/Memory/AllocatorBenchmarks.cpp | 186 +++++++++++------- 3 files changed, 135 insertions(+), 78 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 32ccd43f9a..48994c4eef 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -11,7 +11,7 @@ using namespace AZ; -#define RECORDING_ENABLED 1 +#define RECORDING_ENABLED 0 #if RECORDING_ENABLED @@ -44,18 +44,22 @@ namespace } }; - struct AllocatorOperation + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation { - enum OperationType : unsigned int + enum OperationType : size_t { ALLOCATE, DEALLOCATE }; OperationType m_type: 1; - unsigned int m_size : 28; // Can represent up to 256Mb requests - unsigned int m_alignment : 7; // Can represent up to 128 alignment - unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + static AZStd::mutex s_operationsMutex = {}; static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; @@ -76,7 +80,12 @@ namespace if (s_operationCounter == s_allocationOperationCount) { AZ::IO::SystemFile file; - file.Open("memoryrecordings.bin", AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND); + int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + if (!file.Exists("memoryrecordings.bin")) + { + mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; + } + file.Open("memoryrecordings.bin", mode); if (file.IsOpen()) { file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin index 2b587a2304..ec5de82e83 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0f148441ce120b303896618cec364b5afb6f8b911b4785ec6358cfe8467cf7a -size 368640 +oid sha256:281ba03e79ecba90b313a0b17bdba87c57d76b504b6e38d579b5eabd995902cc +size 245760 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index f5a728018c..aa1c7f21ab 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -390,115 +390,159 @@ namespace Benchmark } } }; - - template - class RecordedAllocationBenchmarkFixture : public AllocatorBenchmarkFixture - { - using base = AllocatorBenchmarkFixture; - using TestAllocatorType = typename base::TestAllocatorType; - struct AllocatorOperation + template + class RecordedAllocationBenchmarkFixture : public ::benchmark::Fixture + { + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp() { - enum OperationType : unsigned int + TestAllocatorType::SetUp(); + } + + void internalTearDown() + { + TestAllocatorType::TearDown(); + } + + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation + { + enum OperationType : size_t { ALLOCATE, DEALLOCATE }; OperationType m_type : 1; - unsigned int m_size : 28; // Can represent up to 256Mb requests - unsigned int m_alignment : 7; // Can represent up to 128 alignment - unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); public: + void SetUp(const ::benchmark::State&) override + { + internalSetUp(); + } + void SetUp(::benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const ::benchmark::State&) override + { + internalTearDown(); + } + void TearDown(::benchmark::State&) override + { + internalTearDown(); + } + void Benchmark(benchmark::State& state) { for (auto _ : state) { state.PauseTiming(); - AZStd::unordered_map pointerRemapping; + AZStd::unordered_map pointerRemapping; constexpr size_t allocationOperationCount = 5 * 1024; AZStd::array m_operations = {}; + [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); - AZ::IO::SystemFile file; - AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); - filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; - if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) - { - return; - } - size_t elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); - size_t totalElementsRead = elementsRead; const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; + size_t itemsProcessed = 0; - while (elementsRead > 0) + for (size_t i = 0; i < 100; ++i) // replay the recording, this way we can keep a smaller recording { - for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) { - const AllocatorOperation& operation = m_operations[operationIndex]; - if (operation.m_type == AllocatorOperation::ALLOCATE) + return; + } + size_t elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) { - const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); - if (it.second) // otherwise already allocated + const AllocatorOperation& operation = m_operations[operationIndex]; + if (operation.m_type == AllocatorOperation::ALLOCATE) { - state.ResumeTiming(); - void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = ptr; - } - else - { - // Doing a resize, dont account for this memory change, this operation is rare and we dont have - // the size of the previous allocation - state.ResumeTiming(); - TestAllocatorType::Resize(it.first->second, operation.m_size); - state.PauseTiming(); - } - } - else // AllocatorOperation::DEALLOCATE: - { - if (operation.m_recordId) - { - const auto ptrIt = pointerRemapping.find(operation.m_recordId); - if (ptrIt != pointerRemapping.end()) + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated { - totalAllocationSize -= operation.m_size; state.ResumeTiming(); - TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + } + else + { + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); state.PauseTiming(); - pointerRemapping.erase(ptrIt); } } - else // deallocate(nullptr) are recorded + else // AllocatorOperation::DEALLOCATE: { - // Just to account of the call of deallocate(nullptr); - state.ResumeTiming(); - TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); - state.PauseTiming(); + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= operation.m_size; + state.ResumeTiming(); + TestAllocatorType::DeAllocate( + ptrIt->second, + /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else // deallocate(nullptr) are recorded + { + // Just to account of the call of deallocate(nullptr); + state.ResumeTiming(); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } } } - } - elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); - totalElementsRead += elementsRead; + elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + } + file.Close(); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + state.ResumeTiming(); + TestAllocatorType::DeAllocate(pointerMapping.second); + state.PauseTiming(); + } + itemsProcessed += pointerRemapping.size(); + pointerRemapping.clear(); } - file.Close(); state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); - state.SetItemsProcessed(totalElementsRead); + state.SetItemsProcessed(itemsProcessed); - // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) - for (const auto& pointerMapping : pointerRemapping) - { - TestAllocatorType::DeAllocate(pointerMapping.second); - } - pointerRemapping.clear(); TestAllocatorType::GarbageCollect(); } } @@ -514,8 +558,7 @@ namespace Benchmark } static void RecordedRunRanges(benchmark::internal::Benchmark* b) { - b->Arg(1); - b->Iterations(100); + b->Iterations(1); } // For threaded ranges, run just 200, multi-threaded will already multiply by thread @@ -547,6 +590,11 @@ namespace Benchmark BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ } + /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow + /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs + /// all the benchmarks and is just used for the the next allocators to report more consistent results. + BM_REGISTER_ALLOCATOR(WarmUpAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); From b96be71c619000a580e964ff51d84c14aa4c2c0f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 8 Dec 2021 19:55:55 -0800 Subject: [PATCH 021/394] More stability changes, improvement on type usage within the benchmark, cleanup of unstable stats Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 93 +++++++------------ 1 file changed, 35 insertions(+), 58 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index aa1c7f21ab..5cf5176308 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,10 +92,10 @@ namespace Benchmark /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. /// - class TestRawMallocAllocator {}; + class RawMallocAllocator {}; template<> - class TestAllocatorWrapper + class TestAllocatorWrapper { public: TestAllocatorWrapper() @@ -113,17 +113,11 @@ namespace Benchmark } // IAllocatorAllocate - static void* Allocate(size_t byteSize, size_t alignment) + static void* Allocate(size_t byteSize, size_t) { s_numAllocatedBytes += byteSize; - if (alignment) - { - return AZ_OS_MALLOC(byteSize, alignment); - } - else - { - return AZ_OS_MALLOC(byteSize, 1); - } + // Don't pass an alignment since we wont be able to get the memory size without also passing the alignment + return AZ_OS_MALLOC(byteSize, 1); } static void DeAllocate(void* ptr, size_t = 0) @@ -132,20 +126,13 @@ namespace Benchmark AZ_OS_FREE(ptr); } - static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + static void* ReAllocate(void* ptr, size_t newSize, size_t) { s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); s_numAllocatedBytes += newSize; - if (newAlignment) - { - return AZ_OS_MALLOC(newSize, newAlignment); - } - else - { - return AZ_OS_MALLOC(newSize, 1); - } + return AZ_OS_MALLOC(newSize, 1); } static size_t Resize(void* ptr, size_t newSize) @@ -172,51 +159,47 @@ namespace Benchmark static size_t s_numAllocatedBytes; }; - size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides - class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator + // Some allocator are not fully declared, those we simply setup from the schema + class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator { public: - AZ_TYPE_INFO(TestMallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + AZ_TYPE_INFO(MallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); - TestMallocSchemaAllocator() - : AZ::SimpleSchemaAllocator("TestMallocSchemaAllocator", "") + MallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("MallocSchemaAllocator", "") {} }; - class TestHeapSchemaAllocator : public AZ::SimpleSchemaAllocator + // We use both this HphaSchemaAllocator and the SystemAllocator configured with Hpha because the SystemAllocator + // has extra things + class HphaSchemaAllocator : public AZ::SimpleSchemaAllocator { public: - AZ_TYPE_INFO(TestHeapSchemaAllocator, "{456E6C30-AA84-488F-BE47-5C1E6AF636B7}"); + AZ_TYPE_INFO(HphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); - TestHeapSchemaAllocator() - : AZ::SimpleSchemaAllocator("TestHeapSchemaAllocator", "") - {} - }; - - class TestHphaSchemaAllocator : public AZ::SimpleSchemaAllocator - { - public: - AZ_TYPE_INFO(TestHphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); - - TestHphaSchemaAllocator() + HphaSchemaAllocator() : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") {} }; + // For the SystemAllocator we inherit so we have a different stack. The SystemAllocator is used globally so we dont want + // to get that data affecting the benchmark class TestSystemAllocator : public AZ::SystemAllocator { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + { + } }; // Allocated bytes reported by the allocator static const char* s_counterAllocatorMemory = "Allocator_Memory"; - // Allocated bytes reported by the process - static const char* s_counterProcessMemory = "Process_Memory"; - // Allocated bytes as counted by the benchmark static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; @@ -310,8 +293,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t numberOfAllocations = perThreadAllocations.size(); size_t totalAllocationSize = 0; @@ -327,7 +309,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -358,7 +339,6 @@ namespace Benchmark { state.PauseTiming(); AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); const size_t numberOfAllocations = perThreadAllocations.size(); size_t totalAllocationSize = 0; @@ -381,7 +361,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); @@ -452,11 +431,10 @@ namespace Benchmark AZStd::array m_operations = {}; [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; size_t itemsProcessed = 0; - for (size_t i = 0; i < 100; ++i) // replay the recording, this way we can keep a smaller recording + for (size_t i = 0; i < 100; ++i) // play the recording multiple times to get a good stable sample, this way we can keep a smaller recording { AZ::IO::SystemFile file; AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); @@ -538,7 +516,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(itemsProcessed); @@ -583,7 +560,7 @@ namespace Benchmark BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ - namespace TESTNAME \ + namespace BM_##TESTNAME \ { \ BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ @@ -593,15 +570,15 @@ namespace Benchmark /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs /// all the benchmarks and is just used for the the next allocators to report more consistent results. - BM_REGISTER_ALLOCATOR(WarmUpAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(WarmUpAllocator, RawMallocAllocator); - BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); - BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); - BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(RawMallocAllocator, RawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, MallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, HphaSchemaAllocator); BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); - + + //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator - //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating #undef BM_REGISTER_ALLOCATOR From 947adc0248d9be1bac2565d1a67d081b0d1677c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 9 Dec 2021 17:13:09 -0800 Subject: [PATCH 022/394] Removal of OverrideShim, AP seems to be crashing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Component/ComponentApplication.cpp | 38 +-- .../AzCore/Component/ComponentApplication.h | 8 +- .../AzCore/AzCore/Compression/Compression.h | 4 +- .../AzCore/AzCore/Compression/compression.cpp | 6 +- .../AzCore/Compression/zstd_compression.cpp | 6 +- .../AzCore/Compression/zstd_compression.h | 5 +- .../AzCore/AzCore/IO/CompressorZStd.h | 2 +- .../AzCore/AzCore/IO/IStreamerTypes.cpp | 2 +- .../AzCore/AzCore/IO/IStreamerTypes.h | 4 +- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 31 +- .../AzCore/AzCore/Memory/AllocatorBase.h | 9 +- .../AzCore/AzCore/Memory/AllocatorManager.cpp | 264 +----------------- .../AzCore/AzCore/Memory/AllocatorManager.h | 21 +- .../AzCore/Memory/AllocatorOverrideShim.cpp | 227 --------------- .../AzCore/Memory/AllocatorOverrideShim.h | 102 ------- .../Memory/BestFitExternalMapAllocator.cpp | 13 +- .../Memory/BestFitExternalMapAllocator.h | 7 +- .../Memory/BestFitExternalMapSchema.cpp | 20 +- .../AzCore/Memory/BestFitExternalMapSchema.h | 25 +- .../AzCore/AzCore/Memory/HeapSchema.cpp | 1 - .../AzCore/AzCore/Memory/HeapSchema.h | 5 +- .../AzCore/AzCore/Memory/HphaSchema.cpp | 2 +- .../AzCore/AzCore/Memory/HphaSchema.h | 5 +- .../AzCore/AzCore/Memory/IAllocator.cpp | 15 +- .../AzCore/AzCore/Memory/IAllocator.h | 65 +---- .../AzCore/AzCore/Memory/MallocSchema.cpp | 31 +- .../AzCore/AzCore/Memory/MallocSchema.h | 20 +- Code/Framework/AzCore/AzCore/Memory/Memory.h | 32 +-- .../AzCore/AzCore/Memory/OSAllocator.cpp | 1 - .../AzCore/AzCore/Memory/OSAllocator.h | 8 +- .../Memory/OverrunDetectionAllocator.cpp | 11 - .../AzCore/Memory/OverrunDetectionAllocator.h | 5 +- .../AzCore/AzCore/Memory/PoolAllocator.h | 2 +- .../AzCore/AzCore/Memory/PoolSchema.cpp | 25 +- .../AzCore/AzCore/Memory/PoolSchema.h | 8 +- .../AzCore/Memory/SimpleSchemaAllocator.h | 25 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 40 ++- .../AzCore/AzCore/Memory/SystemAllocator.h | 24 +- .../AzCore/AzCore/Script/ScriptContext.cpp | 6 +- .../AzCore/AzCore/Script/ScriptContext.h | 2 +- .../AzCore/Serialization/AZStdContainers.inl | 4 +- .../AzCore/Serialization/SerializeContext.cpp | 2 +- .../AzCore/Serialization/SerializeContext.h | 18 +- .../Serialization/std/VariantReflection.inl | 4 +- .../AzCore/AzCore/azcore_files.cmake | 2 - Code/Framework/AzCore/Tests/AZStd/Hashed.cpp | 4 +- Code/Framework/AzCore/Tests/AZStd/Ordered.cpp | 4 +- Code/Framework/AzCore/Tests/Memory.cpp | 199 +++++++------ .../Tests/Memory/AllocatorBenchmarks.cpp | 2 +- .../AzCore/Tests/Memory/AllocatorManager.cpp | 85 +----- .../AzFramework/Archive/Archive.cpp | 2 +- .../AzFramework/Archive/IArchive.h | 2 +- .../AzFramework/Archive/ZipDirCache.cpp | 6 +- .../AzFramework/Archive/ZipDirCache.h | 4 +- .../AzFramework/Archive/ZipDirList.cpp | 2 +- .../AzFramework/Archive/ZipDirList.h | 4 +- .../AzFramework/Archive/ZipDirStructures.cpp | 8 +- Code/LauncherUnified/Launcher.h | 2 +- Code/Legacy/CryCommon/CryLegacyAllocator.h | 28 +- .../RHI/Code/Include/Atom/RHI/DrawPacket.h | 4 +- .../Code/Include/Atom/RHI/DrawPacketBuilder.h | 6 +- .../RHI/Code/Source/RHI/DrawPacketBuilder.cpp | 2 +- 62 files changed, 299 insertions(+), 1222 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp delete mode 100644 Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 693b2f1648..a760061215 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -152,8 +152,6 @@ namespace AZ m_reservedDebug = 0; m_recordingMode = Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE; m_stackRecordLevels = 5; - m_useOverrunDetection = false; - m_useMalloc = false; } bool AppDescriptorConverter(SerializeContext& serialize, SerializeContext::DataElementNode& node) @@ -323,9 +321,6 @@ namespace AZ ->Field("blockSize", &Descriptor::m_memoryBlocksByteSize) ->Field("reservedOS", &Descriptor::m_reservedOS) ->Field("reservedDebug", &Descriptor::m_reservedDebug) - ->Field("useOverrunDetection", &Descriptor::m_useOverrunDetection) - ->Field("useMalloc", &Descriptor::m_useMalloc) - ->Field("allocatorRemappings", &Descriptor::m_allocatorRemappings) ->Field("modules", &Descriptor::m_modules) ; @@ -361,8 +356,6 @@ namespace AZ ->Attribute(Edit::Attributes::Step, &Descriptor::m_pageSize) ->DataElement(Edit::UIHandlers::SpinBox, &Descriptor::m_reservedOS, "OS reserved memory", "System memory reserved for OS (used only when 'Allocate all memory at startup' is true)") ->DataElement(Edit::UIHandlers::SpinBox, &Descriptor::m_reservedDebug, "Memory reserved for debugger", "System memory reserved for Debug allocator, like memory tracking (used only when 'Allocate all memory at startup' is true)") - ->DataElement(Edit::UIHandlers::CheckBox, &Descriptor::m_useOverrunDetection, "Use Overrun Detection", "Use the overrun detection memory manager (only available on some platforms, ignored in Release builds)") - ->DataElement(Edit::UIHandlers::CheckBox, &Descriptor::m_useMalloc, "Use Malloc", "Use malloc for memory allocations (for memory debugging only, ignored in Release builds)") ; } } @@ -879,7 +872,7 @@ namespace AZ AZ::AllocatorInstance::Create(desc); AZ::Debug::Trace::Instance().Init(); - AZ::Debug::AllocationRecords* records = AllocatorInstance::GetAllocator().GetRecords(); + AZ::Debug::AllocationRecords* records = AllocatorInstance::Get().GetRecords(); if (records) { records->SetMode(m_descriptor.m_recordingMode); @@ -891,35 +884,6 @@ namespace AZ m_isSystemAllocatorOwner = true; } - -#ifndef RELEASE - if (m_descriptor.m_useOverrunDetection) - { - OverrunDetectionSchema::Descriptor overrunDesc(false); - s_overrunDetectionSchema = Environment::CreateVariable(AzTypeInfo::Name(), overrunDesc); - OverrunDetectionSchema* schemaPtr = &s_overrunDetectionSchema.Get(); - - AZ::AllocatorManager::Instance().SetOverrideAllocatorSource(schemaPtr); - } - - if (m_descriptor.m_useMalloc) - { - AZ_Printf("Malloc", "WARNING: Malloc override is enabled. Registered allocators will use malloc instead of their normal allocation schemas."); - s_mallocSchema = Environment::CreateVariable(AzTypeInfo::Name()); - MallocSchema* schemaPtr = &s_mallocSchema.Get(); - - AZ::AllocatorManager::Instance().SetOverrideAllocatorSource(schemaPtr); - } -#endif - - AllocatorManager& allocatorManager = AZ::AllocatorManager::Instance(); - - for (const auto& remapping : m_descriptor.m_allocatorRemappings) - { - allocatorManager.AddAllocatorRemapping(remapping.m_from.c_str(), remapping.m_to.c_str()); - } - - allocatorManager.FinalizeConfiguration(); } void ComponentApplication::MergeSettingsToRegistry(SettingsRegistryInterface& registry) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h index d53b8e1a4e..a28c58ac6b 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h @@ -142,10 +142,6 @@ namespace AZ AZ::u64 m_reservedDebug; //!< Reserved memory for Debugging (allocation,etc.). Used only when m_grabAllMemory is set to true. (default: 0) Debug::AllocationRecords::Mode m_recordingMode; //!< When to record stack traces (default: AZ::Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE) AZ::u64 m_stackRecordLevels; //!< If stack recording is enabled, how many stack levels to record. (default: 5) - bool m_useOverrunDetection; //!< True to use the overrun detection memory management scheme. Only available on some platforms; greatly increases memory consumption. - bool m_useMalloc; //!< True to use malloc instead of the internal memory manager. Intended for debugging purposes only. - - AllocatorRemappings m_allocatorRemappings; //!< List of remappings of allocators to perform, so that they can alias each other. ModuleDescriptorList m_modules; //!< Dynamic modules used by the application. //!< These will be loaded on startup. @@ -159,7 +155,7 @@ namespace AZ //! If set, this allocator is used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. //! If it's left nullptr (default), the \ref OSAllocator will be used. - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; //! Callback to create AZ::Modules for the static libraries linked by this application. //! Leave null if the application uses no static AZ::Modules. @@ -372,7 +368,7 @@ namespace AZ bool m_isOSAllocatorOwner{ false }; bool m_ownsConsole{}; void* m_fixedMemoryBlock{ nullptr }; //!< Pointer to the memory block allocator, so we can free it OnDestroy. - IAllocatorAllocate* m_osAllocator{ nullptr }; + IAllocator* m_osAllocator{ nullptr }; EntitySetType m_entities; AZ::SettingsRegistryInterface::NotifyEventHandler m_projectPathChangedHandler; diff --git a/Code/Framework/AzCore/AzCore/Compression/Compression.h b/Code/Framework/AzCore/AzCore/Compression/Compression.h index 855dcf9a6a..105fb9dbe6 100644 --- a/Code/Framework/AzCore/AzCore/Compression/Compression.h +++ b/Code/Framework/AzCore/AzCore/Compression/Compression.h @@ -15,7 +15,7 @@ struct z_stream_s; namespace AZ { class IAllocator; - class IAllocatorAllocate; + class IAllocatorSchema; /** * The most well known and used compression algorithm. It gives the best compression ratios even on level 1, @@ -90,7 +90,7 @@ namespace AZ z_stream_s* m_strDeflate; z_stream_s* m_strInflate; - IAllocatorAllocate* m_workMemoryAllocator; + IAllocatorSchema* m_workMemoryAllocator; }; } diff --git a/Code/Framework/AzCore/AzCore/Compression/compression.cpp b/Code/Framework/AzCore/AzCore/Compression/compression.cpp index 8b6f270b00..b5b775ef5e 100644 --- a/Code/Framework/AzCore/AzCore/Compression/compression.cpp +++ b/Code/Framework/AzCore/AzCore/Compression/compression.cpp @@ -26,7 +26,7 @@ ZLib::ZLib(IAllocator* workMemAllocator) : m_strDeflate(nullptr) , m_strInflate(nullptr) { - m_workMemoryAllocator = workMemAllocator ? workMemAllocator->GetAllocationSource() : nullptr; + m_workMemoryAllocator = workMemAllocator->GetSchema(); if (!m_workMemoryAllocator) { m_workMemoryAllocator = &AllocatorInstance::Get(); @@ -55,7 +55,7 @@ ZLib::~ZLib() //========================================================================= void* ZLib::AllocateMem(void* userData, unsigned int items, unsigned int size) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); return allocator->Allocate(items * size, 4, 0, "ZLib", __FILE__, __LINE__); } @@ -65,7 +65,7 @@ void* ZLib::AllocateMem(void* userData, unsigned int items, unsigned int size) //========================================================================= void ZLib::FreeMem(void* userData, void* address) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); allocator->DeAllocate(address); } diff --git a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp index ecab62d123..95576a275b 100644 --- a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp +++ b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp @@ -16,7 +16,7 @@ using namespace AZ; -ZStd::ZStd(IAllocatorAllocate* workMemAllocator) +ZStd::ZStd(IAllocator* workMemAllocator) { m_workMemoryAllocator = workMemAllocator; if (!m_workMemoryAllocator) @@ -41,13 +41,13 @@ ZStd::~ZStd() void* ZStd::AllocateMem(void* userData, size_t size) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); return allocator->Allocate(size, 4, 0, "ZStandard", __FILE__, __LINE__); } void ZStd::FreeMem(void* userData, void* address) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); allocator->DeAllocate(address); } diff --git a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h index 3fe6677fff..70d8c37831 100644 --- a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h +++ b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h @@ -17,12 +17,11 @@ namespace AZ { class IAllocator; - class IAllocatorAllocate; class ZStd { public: - ZStd(IAllocatorAllocate* workMemAllocator = 0); + ZStd(IAllocator* workMemAllocator = 0); ~ZStd(); enum FlushType @@ -77,7 +76,7 @@ namespace AZ ZSTD_CStream* m_streamCompression; ZSTD_DStream* m_streamDecompression; - IAllocatorAllocate* m_workMemoryAllocator; + IAllocator* m_workMemoryAllocator; ZSTD_inBuffer m_inBuffer; ZSTD_outBuffer m_outBuffer; size_t m_nextBlockSize; diff --git a/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h b/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h index ed6b94fffa..9503f22665 100644 --- a/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h +++ b/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h @@ -48,7 +48,7 @@ namespace AZ public: AZ_CLASS_ALLOCATOR(CompressorZStdData, AZ::SystemAllocator, 0); - CompressorZStdData(IAllocatorAllocate* zstdMemAllocator = 0) + CompressorZStdData(IAllocator* zstdMemAllocator = 0) { m_zstd = zstdMemAllocator; } diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp index 4c8272cfc8..4126d7457d 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp +++ b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp @@ -21,7 +21,7 @@ namespace AZ::IO::IStreamerTypes : m_allocator(AZ::AllocatorInstance::Get()) {} - DefaultRequestMemoryAllocator::DefaultRequestMemoryAllocator(AZ::IAllocatorAllocate& allocator) + DefaultRequestMemoryAllocator::DefaultRequestMemoryAllocator(AZ::IAllocator& allocator) : m_allocator(allocator) {} diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h index 901fc5e594..2c4dc28518 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h +++ b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h @@ -137,7 +137,7 @@ namespace AZ::IO::IStreamerTypes public: //! DefaultRequestMemoryAllocator wraps around the AZ::SystemAllocator by default. DefaultRequestMemoryAllocator(); - explicit DefaultRequestMemoryAllocator(AZ::IAllocatorAllocate& allocator); + explicit DefaultRequestMemoryAllocator(AZ::IAllocator& allocator); ~DefaultRequestMemoryAllocator() override; void LockAllocator() override; @@ -151,7 +151,7 @@ namespace AZ::IO::IStreamerTypes private: AZStd::atomic_int m_lockCounter{ 0 }; AZStd::atomic_int m_allocationCounter{ 0 }; - AZ::IAllocatorAllocate& m_allocator; + AZ::IAllocator& m_allocator; }; // The following alignment functions are put here until they're available in AzCore's math library. diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 48994c4eef..4da9ab384f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -158,10 +158,10 @@ namespace } #endif -AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : - IAllocator(allocationSource), - m_name(name), - m_desc(desc) +AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) + : IAllocator(allocationSchema) + , m_name(name) + , m_desc(desc) { } @@ -180,11 +180,6 @@ const char* AllocatorBase::GetDescription() const return m_desc; } -IAllocatorAllocate* AllocatorBase::GetSchema() -{ - return nullptr; -} - Debug::AllocationRecords* AllocatorBase::GetRecords() { return m_records; @@ -201,11 +196,6 @@ bool AllocatorBase::IsReady() const return m_isReady; } -bool AllocatorBase::CanBeOverridden() const -{ - return m_canBeOverridden; -} - void AllocatorBase::PostCreate() { if (m_registrationEnabled) @@ -266,11 +256,6 @@ bool AllocatorBase::IsProfilingActive() const return m_isProfilingActive; } -void AllocatorBase::DisableOverriding() -{ - m_canBeOverridden = false; -} - void AllocatorBase::DisableRegistration() { m_registrationEnabled = false; @@ -278,12 +263,12 @@ void AllocatorBase::DisableRegistration() void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) { -#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function -#endif // AZ_HAS_VARIADIC_TEMPLATES - if (m_isProfilingActive) { +#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) + ++suppressStackRecord; // one more for the fact the ebus is a function +#endif // AZ_HAS_VARIADIC_TEMPLATES + auto records = GetRecords(); if (records) { diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h index 8f8a17e470..f2521087b3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h @@ -22,7 +22,7 @@ namespace AZ class AllocatorBase : public IAllocator { protected: - AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc); + AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc); ~AllocatorBase(); public: @@ -32,11 +32,9 @@ namespace AZ //--------------------------------------------------------------------- const char* GetName() const override; const char* GetDescription() const override; - IAllocatorAllocate* GetSchema() override; Debug::AllocationRecords* GetRecords() final; void SetRecords(Debug::AllocationRecords* records) final; bool IsReady() const final; - bool CanBeOverridden() const final; void PostCreate() override; void PreDestroy() final; void SetLazilyCreated(bool lazy) final; @@ -68,10 +66,6 @@ namespace AZ return byteSize; } - /// Call to disallow this allocator from being overridden. - /// Only kernel-level allocators where it would be especially problematic for them to be overridden should do this. - void DisableOverriding(); - /// Call to disallow this allocator from being registered with the AllocatorManager. /// Only kernel-level allocators where it would be especially problematic for them to be registered with the AllocatorManager should do this. void DisableRegistration(); @@ -107,7 +101,6 @@ namespace AZ bool m_isLazilyCreated = false; bool m_isProfilingActive = false; bool m_isReady = false; - bool m_canBeOverridden = true; bool m_registrationEnabled = true; }; diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp index 70ac813972..758fa222fe 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp @@ -12,17 +12,12 @@ #include #include -#include #include #include #include #include -#if !defined(RELEASE) && !defined(AZCORE_MEMORY_ENABLE_OVERRIDES) -# define AZCORE_MEMORY_ENABLE_OVERRIDES -#endif - namespace AZ::Internal { struct AMStringHasher @@ -54,18 +49,6 @@ namespace AZ::Internal namespace AZ { -struct AllocatorManager::InternalData -{ - explicit InternalData(const AZStdIAllocator& alloc) - : m_allocatorMap(alloc) - , m_remappings(alloc) - , m_remappingsReverse(alloc) - {} - Internal::AllocatorNameMap m_allocatorMap; - Internal::AllocatorRemappings m_remappings; - Internal::AllocatorRemappings m_remappingsReverse; -}; - static EnvironmentVariable s_allocManager = nullptr; static AllocatorManager* s_allocManagerDebug = nullptr; // For easier viewing in crash dumps @@ -81,16 +64,6 @@ static Internal::PreEnvironmentAttachData& GetPreEnvironmentAttachData() void AllocatorManager::PreRegisterAllocator(IAllocator* allocator) { auto& data = GetPreEnvironmentAttachData(); - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - // All allocators must switch to an OverrideEnabledAllocationSource proxy if they are to support allocator overriding. - if (allocator->CanBeOverridden()) - { - auto shim = Internal::AllocatorOverrideShim::Create(allocator, &data.m_mallocSchema); - allocator->SetAllocationSource(shim); - } -#endif - { AZStd::lock_guard lock(data.m_mutex); AZ_Assert(data.m_unregisteredAllocatorCount < Internal::PreEnvironmentAttachData::MAX_UNREGISTERED_ALLOCATORS, "Too many allocators trying to register before environment attached!"); @@ -175,12 +148,9 @@ AllocatorManager::AllocatorManager() } ) { - m_overrideSource = nullptr; m_numAllocators = 0; m_isAllocatorLeaking = false; - m_configurationFinalized = false; m_defaultTrackingRecordMode = Debug::AllocationRecords::RECORD_NO_RECORDS; - m_data = new (m_mallocSchema->Allocate(sizeof(InternalData), AZStd::alignment_of::value, 0)) InternalData(AZStdIAllocator(m_mallocSchema.get())); } //========================================================================= @@ -210,10 +180,6 @@ AllocatorManager::RegisterAllocator(class IAllocator* alloc) alloc->SetProfilingActive(m_profilingRefcount.load() > 0); m_allocators[m_numAllocators++] = alloc; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - ConfigureAllocatorOverrides(alloc); -#endif } //========================================================================= @@ -232,81 +198,12 @@ AllocatorManager::InternalDestroy() // Do not actually destroy the lazy allocator as it may have work to do during non-deterministic shutdown } - if (m_data) - { - m_data->~InternalData(); - m_mallocSchema->DeAllocate(m_data); - m_data = nullptr; - } - if (!m_isAllocatorLeaking) { AZ_Assert(m_numAllocators == 0, "There are still %d registered allocators!", m_numAllocators); } } -//========================================================================= -// ConfigureAllocatorOverrides -// [10/14/2018] -//========================================================================= -void -AllocatorManager::ConfigureAllocatorOverrides(IAllocator* alloc) -{ - auto record = m_data->m_allocatorMap.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(alloc->GetName(), AZStdIAllocator(m_mallocSchema.get())), AZStd::forward_as_tuple(alloc)); - - // We only need to keep going if the allocator supports overrides. - if (!alloc->CanBeOverridden()) - { - return; - } - - if (!alloc->IsAllocationSourceChanged()) - { - // All allocators must switch to an OverrideEnabledAllocationSource proxy if they are to support allocator overriding. - auto overrideEnabled = Internal::AllocatorOverrideShim::Create(alloc, m_mallocSchema.get()); - alloc->SetAllocationSource(overrideEnabled); - } - - auto itr = m_data->m_remappings.find(record.first->first); - - if (itr != m_data->m_remappings.end()) - { - auto remapTo = m_data->m_allocatorMap.find(itr->second); - - if (remapTo != m_data->m_allocatorMap.end()) - { - static_cast(alloc->GetAllocationSource())->SetOverride(remapTo->second->GetOriginalAllocationSource()); - } - } - - itr = m_data->m_remappingsReverse.find(record.first->first); - - if (itr != m_data->m_remappingsReverse.end()) - { - auto remapFrom = m_data->m_allocatorMap.find(itr->second); - - if (remapFrom != m_data->m_allocatorMap.end()) - { - AZ_Assert(!m_configurationFinalized, "Allocators may only remap to allocators that have been created before configuration finalization"); - static_cast(remapFrom->second->GetAllocationSource())->SetOverride(alloc->GetOriginalAllocationSource()); - } - } - - if (m_overrideSource) - { - static_cast(alloc->GetAllocationSource())->SetOverride(m_overrideSource); - } - - if (m_configurationFinalized) - { - // We can get rid of the intermediary if configuration won't be changing any further. - // (The creation of it at the top of this function was superflous, but it made it easier to set things up going through a single code path.) - auto shim = static_cast(alloc->GetAllocationSource()); - alloc->SetAllocationSource(shim->GetOverride()); - Internal::AllocatorOverrideShim::Destroy(shim); - } -} - //========================================================================= // UnRegisterAllocator // [9/17/2009] @@ -365,7 +262,7 @@ AllocatorManager::GarbageCollect() for (int i = 0; i < m_numAllocators; ++i) { - m_allocators[i]->GetAllocationSource()->GarbageCollect(); + m_allocators[i]->GetSchema()->GarbageCollect(); } } @@ -414,94 +311,6 @@ AllocatorManager::SetTrackingMode(Debug::AllocationRecords::Mode mode) } } -//========================================================================= -// SetOverrideSchema -// [8/17/2018] -//========================================================================= -void -AllocatorManager::SetOverrideAllocatorSource(IAllocatorAllocate* source, bool overrideExistingAllocators) -{ - (void)source; - (void)overrideExistingAllocators; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - AZ_Assert(!m_configurationFinalized, "You cannot set an allocator source after FinalizeConfiguration() has been called."); - m_overrideSource = source; - - if (overrideExistingAllocators) - { - AZStd::lock_guard lock(m_allocatorListMutex); - for (int i = 0; i < m_numAllocators; ++i) - { - if (m_allocators[i]->CanBeOverridden()) - { - auto shim = static_cast(m_allocators[i]->GetAllocationSource()); - shim->SetOverride(source); - } - } - } -#endif -} - -//========================================================================= -// AddAllocatorRemapping -// [8/27/2018] -//========================================================================= -void -AllocatorManager::AddAllocatorRemapping(const char* fromName, const char* toName) -{ - (void)fromName; - (void)toName; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - AZ_Assert(!m_configurationFinalized, "You cannot set an allocator remapping after FinalizeConfiguration() has been called."); - m_data->m_remappings.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(fromName, m_mallocSchema.get()), AZStd::forward_as_tuple(toName, m_mallocSchema.get())); - m_data->m_remappingsReverse.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(toName, m_mallocSchema.get()), AZStd::forward_as_tuple(fromName, m_mallocSchema.get())); -#endif -} - -void -AllocatorManager::FinalizeConfiguration() -{ - if (m_configurationFinalized) - { - return; - } - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - { - AZStd::lock_guard lock(m_allocatorListMutex); - - for (int i = 0; i < m_numAllocators; ++i) - { - if (!m_allocators[i]->CanBeOverridden()) - { - continue; - } - - auto shim = static_cast(m_allocators[i]->GetAllocationSource()); - - if (!shim->IsOverridden()) - { - m_allocators[i]->ResetAllocationSource(); - Internal::AllocatorOverrideShim::Destroy(shim); - } - else if (!shim->HasOrphanedAllocations()) - { - m_allocators[i]->SetAllocationSource(shim->GetOverride()); - Internal::AllocatorOverrideShim::Destroy(shim); - } - else - { - shim->SetFinalizedConfiguration(); - } - } - } -#endif - - m_configurationFinalized = true; -} - void AllocatorManager::EnterProfilingMode() { @@ -545,27 +354,18 @@ AllocatorManager::DumpAllocators() size_t totalConsumedBytes = 0; memset(m_dumpInfo, 0, sizeof(m_dumpInfo)); - void* sourceList[m_maxNumAllocators]; AZ_Printf(TAG, "%d allocators active\n", m_numAllocators); AZ_Printf(TAG, "Index,Name,Used kb,Reserved kb,Consumed kb\n"); for (int i = 0; i < m_numAllocators; i++) { - auto allocator = m_allocators[i]; - auto source = allocator->GetAllocationSource(); + IAllocator* allocator = GetAllocator(i); const char* name = allocator->GetName(); - size_t usedBytes = source->NumAllocatedBytes(); - size_t reservedBytes = source->Capacity(); + size_t usedBytes = allocator->NumAllocatedBytes(); + size_t reservedBytes = allocator->Capacity(); size_t consumedBytes = reservedBytes; - // Very hacky and inefficient check to see if this allocator obtains its memory from another allocator - sourceList[i] = source; - if (AZStd::find(sourceList, sourceList + i, allocator->GetSchema()) != sourceList + i) - { - consumedBytes = 0; - } - totalUsedBytes += usedBytes; totalReservedBytes += reservedBytes; totalConsumedBytes += consumedBytes; @@ -585,61 +385,21 @@ void AllocatorManager::GetAllocatorStats(size_t& allocatedBytes, size_t& capacit AZStd::lock_guard lock(m_allocatorListMutex); const int allocatorCount = GetNumAllocators(); - AZStd::unordered_map existingAllocators; - AZStd::unordered_map sourcesToAllocators; // Build a mapping of original allocator sources to their allocators for (int i = 0; i < allocatorCount; ++i) { IAllocator* allocator = GetAllocator(i); - sourcesToAllocators.emplace(allocator->GetOriginalAllocationSource(), allocator); - } - - for (int i = 0; i < allocatorCount; ++i) - { - IAllocator* allocator = GetAllocator(i); - IAllocatorAllocate* source = allocator->GetAllocationSource(); - IAllocatorAllocate* originalSource = allocator->GetOriginalAllocationSource(); - IAllocatorAllocate* schema = allocator->GetSchema(); - IAllocator* alias = (source != originalSource) ? sourcesToAllocators[source] : nullptr; - - if (schema && !alias) - { - // Check to see if this allocator's source maps to another allocator - // Need to check both the schema and the allocator itself, as either one might be used as the alias depending on how it's implemented - AZStd::array checkAllocators = { { schema, allocator->GetAllocationSource() } }; - - for (IAllocatorAllocate* check : checkAllocators) - { - auto existing = existingAllocators.emplace(check, allocator); - - if (!existing.second) - { - alias = existing.first->second; - // Do not break out of the loop as we need to add to the map for all entries - } - } - } - - static const IAllocator* OS_ALLOCATOR = &AllocatorInstance::GetAllocator(); - size_t sourceAllocatedBytes = source->NumAllocatedBytes(); - size_t sourceCapacityBytes = source->Capacity(); - - if (allocator == OS_ALLOCATOR) - { - // Need to special case the OS allocator because its capacity is a made-up number. Better to just use the allocated amount, it will hopefully be small anyway. - sourceCapacityBytes = sourceAllocatedBytes; - } - + allocatedBytes += allocator->NumAllocatedBytes(); + capacityBytes += allocator->Capacity(); + if (outStats) { - outStats->emplace(outStats->end(), allocator->GetName(), alias ? alias->GetName() : allocator->GetDescription(), sourceAllocatedBytes, sourceCapacityBytes, alias != nullptr); - } - - if (!alias) - { - allocatedBytes += sourceAllocatedBytes; - capacityBytes += sourceCapacityBytes; + outStats->emplace(outStats->end(), + allocator->GetName(), + allocator->GetDescription(), + allocator->NumAllocatedBytes(), + allocator->Capacity()); } } } diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h index 14dec68ad1..0e8be07013 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h @@ -84,17 +84,6 @@ namespace AZ /// Especially for great code and engines... void SetAllocatorLeaking(bool allowLeaking) { m_isAllocatorLeaking = allowLeaking; } - /// Set an override allocator - /// All allocators registered with the AllocatorManager will automatically redirect to this allocator - /// if set. - void SetOverrideAllocatorSource(IAllocatorAllocate* source, bool overrideExistingAllocators = true); - - /// Retrieve the override schema - IAllocatorAllocate* GetOverrideAllocatorSource() const { return m_overrideSource; } - - void AddAllocatorRemapping(const char* fromName, const char* toName); - void FinalizeConfiguration(); - /// Enter or exit profiling mode; calls to Enter must be matched with calls to Exit void EnterProfilingMode(); void ExitProfilingMode(); @@ -113,19 +102,17 @@ namespace AZ struct AllocatorStats { - AllocatorStats(const char* name, const char* aliasOrDescription, size_t allocatedBytes, size_t capacityBytes, bool isAlias) + AllocatorStats(const char* name, const char* aliasOrDescription, size_t allocatedBytes, size_t capacityBytes) : m_name(name) , m_aliasOrDescription(aliasOrDescription) , m_allocatedBytes(allocatedBytes) , m_capacityBytes(capacityBytes) - , m_isAlias(isAlias) {} AZStd::string m_name; AZStd::string m_aliasOrDescription; size_t m_allocatedBytes; size_t m_capacityBytes; - bool m_isAlias; }; void GetAllocatorStats(size_t& usedBytes, size_t& reservedBytes, AZStd::vector* outStats = nullptr); @@ -157,7 +144,6 @@ namespace AZ private: void InternalDestroy(); - void ConfigureAllocatorOverrides(IAllocator* alloc); void DebugBreak(void* address, const Debug::AllocationInfo& info); AZ::MallocSchema* CreateMallocSchema(); @@ -172,14 +158,9 @@ namespace AZ MemoryBreak m_memoryBreak[MaxNumMemoryBreaks]; char m_activeBreaks; AZStd::mutex m_allocatorListMutex; - IAllocatorAllocate* m_overrideSource; DumpInfo m_dumpInfo[m_maxNumAllocators]; - struct InternalData; - - InternalData* m_data; - bool m_configurationFinalized; AZStd::atomic m_profilingRefcount; AZ::Debug::AllocationRecords::Mode m_defaultTrackingRecordMode; diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp deleted file mode 100644 index e4928e83c5..0000000000 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp +++ /dev/null @@ -1,227 +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 - -namespace AZ::Internal -{ - AllocatorOverrideShim* AllocatorOverrideShim::Create(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource) - { - void* memory = shimAllocationSource->Allocate(sizeof(AllocatorOverrideShim), AZStd::alignment_of::value, 0); - auto result = new (memory) AllocatorOverrideShim(owningAllocator, shimAllocationSource); - return result; - } - - void AllocatorOverrideShim::Destroy(AllocatorOverrideShim* source) - { - auto shimAllocationSource = source->m_shimAllocationSource; - source->~AllocatorOverrideShim(); - shimAllocationSource->DeAllocate(source); - } - - AllocatorOverrideShim::AllocatorOverrideShim(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource) - : m_owningAllocator(owningAllocator) - , m_source(owningAllocator->GetOriginalAllocationSource()) - , m_overridingSource(owningAllocator->GetOriginalAllocationSource()) - , m_shimAllocationSource(shimAllocationSource) - , m_records(typename AllocationSet::hasher(), typename AllocationSet::key_eq(), StdAllocationSrc(shimAllocationSource)) - { - } - - void AllocatorOverrideShim::SetOverride(IAllocatorAllocate* source) - { - m_overridingSource = source; - } - - IAllocatorAllocate* AllocatorOverrideShim::GetOverride() const - { - return m_overridingSource; - } - - bool AllocatorOverrideShim::IsOverridden() const - { - return m_source != m_overridingSource; - } - - bool AllocatorOverrideShim::HasOrphanedAllocations() const - { - return !m_records.empty(); - } - - void AllocatorOverrideShim::SetFinalizedConfiguration() - { - m_finalizedConfiguration = true; - } - - typename AllocatorOverrideShim::pointer_type AllocatorOverrideShim::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) - { - pointer_type ptr = m_overridingSource->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord); - - if (!IsOverridden()) - { - lock_type lock(m_mutex); - m_records.insert(ptr); // Record in case we need to orphan this allocation later - } - - return ptr; - } - - void AllocatorOverrideShim::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) - { - IAllocatorAllocate* source = m_overridingSource; - bool destroy = false; - - { - lock_type lock(m_mutex); - - // Check to see if this came from a prior allocation source - if (m_records.erase(ptr) && IsOverridden()) - { - source = m_source; - - if (m_records.empty() && m_finalizedConfiguration) - { - // All orphaned records are gone; we are no longer needed - m_owningAllocator->SetAllocationSource(m_overridingSource); - destroy = true; // Must destroy outside the lock - } - } - } - - source->DeAllocate(ptr, byteSize, alignment); - - if (destroy) - { - Destroy(this); - } - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::Resize(pointer_type ptr, size_type newSize) - { - IAllocatorAllocate* source = m_overridingSource; - - if (IsOverridden()) - { - // Determine who owns the allocation - lock_type lock(m_mutex); - - if (m_records.count(ptr)) - { - source = m_source; - } - } - - size_t result = source->Resize(ptr, newSize); - - return result; - } - - typename AllocatorOverrideShim::pointer_type AllocatorOverrideShim::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) - { - pointer_type newPtr = nullptr; - bool useOverride = true; - bool destroy = false; - - if (IsOverridden()) - { - lock_type lock(m_mutex); - - if (m_records.erase(ptr)) - { - // An old allocation needs to be transferred to the new, overriding allocator. - useOverride = false; // We'll do the reallocation here - size_t oldSize = m_source->AllocationSize(ptr); - - if (newSize) - { - newPtr = m_overridingSource->Allocate(newSize, newAlignment, 0); - memcpy(newPtr, ptr, AZStd::min(newSize, oldSize)); - } - - m_source->DeAllocate(ptr, oldSize); - - if (m_records.empty() && m_finalizedConfiguration) - { - // All orphaned records are gone; we are no longer needed - m_owningAllocator->SetAllocationSource(m_overridingSource); - destroy = true; // Must destroy outside the lock - } - } - } - - if (useOverride) - { - // Default behavior, we weren't deleting an old allocation - newPtr = m_overridingSource->ReAllocate(ptr, newSize, newAlignment); - - if (!IsOverridden()) - { - // Still need to do bookkeeping if we haven't been overridden yet - lock_type lock(m_mutex); - m_records.erase(ptr); - m_records.insert(newPtr); - } - } - - if (destroy) - { - Destroy(this); - } - - return newPtr; - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::AllocationSize(pointer_type ptr) - { - IAllocatorAllocate* source = m_overridingSource; - - if (IsOverridden()) - { - // Determine who owns the allocation - lock_type lock(m_mutex); - - if (m_records.count(ptr)) - { - source = m_source; - } - } - - return source->AllocationSize(ptr); - } - - void AllocatorOverrideShim::GarbageCollect() - { - m_source->GarbageCollect(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::NumAllocatedBytes() const - { - return m_source->NumAllocatedBytes(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::Capacity() const - { - return m_source->Capacity(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::GetMaxAllocationSize() const - { - return m_source->GetMaxAllocationSize(); - } - - auto AllocatorOverrideShim::GetMaxContiguousAllocationSize() const -> size_type - { - return m_source->GetMaxContiguousAllocationSize(); - } - - IAllocatorAllocate* AllocatorOverrideShim::GetSubAllocator() - { - return m_source->GetSubAllocator(); - } - -} // namespace AZ::Internal diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h deleted file mode 100644 index 3b45b9953e..0000000000 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h +++ /dev/null @@ -1,102 +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 -#include - -namespace AZ -{ - class AllocatorManager; - - namespace Internal - { - /** - * A shim schema that solves the problem of overriding lazily-created allocators especially, that perform allocations before the override happens. - * - * Any allocator that *might* be overridden at some point must have this shim installed as its allocation source. This is done automatically by - * the AllocationManager; you generally do not have to interact with this shim directly at all. - * - * The shim will keep track of any allocations that occur, and if the allocator gets overridden it will ensure that prior allocations are - * deallocated with the old schema rather than the new one. - * - * There is some performance cost to this intrusion, however, in most cases it's only temporary: - * * Once the application calls FinalizeConfiguration(), any non-overridden allocators will have their shims destroyed. - * * Any overridden allocators that do not have prior allocations will have their shims destroyed. - * * Any overridden allocator will automatically destroy its shim once the last of the prior allocations has been deallocated. - * - * Note that an allocator that gets overridden but has prior allocations that it never intends to deallocate (such as file-level statics that never - * get changed) will keep its shim indefinitely. This is an unfortunate cost but only affects those allocators if they are being overridden. - */ - class AllocatorOverrideShim - : public IAllocatorAllocate - { - friend AllocatorManager; - - public: - //--------------------------------------------------------------------- - // IAllocator implementation - //--------------------------------------------------------------------- - pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override; - void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; - size_type Resize(pointer_type ptr, size_type newSize) override; - pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; - size_type AllocationSize(pointer_type ptr) override; - void GarbageCollect() override; - size_type NumAllocatedBytes() const override; - size_type Capacity() const override; - size_type GetMaxAllocationSize() const override; - size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; - - private: - /// Creates a shim using a custom memory source - static AllocatorOverrideShim* Create(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource); - static void Destroy(AllocatorOverrideShim* source); - - AllocatorOverrideShim(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource); - - /// Overrides the shim's memory source with a different memory source. - void SetOverride(IAllocatorAllocate* source); - - /// Returns the override source. - IAllocatorAllocate* GetOverride() const; - - /// Returns true if the shim has an override source set on it. - bool IsOverridden() const; - - /// Returns true if there are orphaned allocations from before the shim had its override set. - bool HasOrphanedAllocations() const; - - /// Called by the AllocatorManager to signify that the configuration has been finalized by the application. - void SetFinalizedConfiguration(); - - private: - class StdAllocationSrc : public AZStdIAllocator - { - public: - StdAllocationSrc(IAllocatorAllocate* schema = nullptr) : AZStdIAllocator(schema) - { - } - }; - - typedef AZStd::mutex mutex_type; - typedef AZStd::lock_guard lock_type; - typedef AZStd::unordered_set, AZStd::equal_to, StdAllocationSrc> AllocationSet; - - IAllocator* m_owningAllocator; - IAllocatorAllocate* m_source; - IAllocatorAllocate* m_overridingSource; - IAllocatorAllocate* m_shimAllocationSource; - AllocationSet m_records; - mutex_type m_mutex; - bool m_finalizedConfiguration = false; - }; - } -} diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp index 30b0b78fe5..da960ce3f3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp @@ -20,8 +20,7 @@ using namespace AZ; // [1/28/2011] //========================================================================= BestFitExternalMapAllocator::BestFitExternalMapAllocator() - : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") - , m_schema(nullptr) + : AllocatorBase(nullptr, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") {} //========================================================================= @@ -186,13 +185,3 @@ auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size { return m_schema->GetMaxContiguousAllocationSize(); } - -//========================================================================= -// GetSubAllocator -// [1/28/2011] -//========================================================================= -IAllocatorAllocate* -BestFitExternalMapAllocator::GetSubAllocator() -{ - return m_schema->GetSubAllocator(); -} diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h index 17425625b7..2cad404cd0 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h @@ -20,7 +20,6 @@ namespace AZ */ class BestFitExternalMapAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(BestFitExternalMapAllocator, "{36266C8B-9A2C-4E3E-9812-3DB260868A2B}") @@ -38,7 +37,7 @@ namespace AZ static const int m_memoryBlockAlignment = 16; void* m_memoryBlock; ///< Pointer to memory to allocate from. Can be uncached. unsigned int m_memoryBlockByteSize; ///< Sizes if the memory block. - IAllocatorAllocate* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. + IAllocator* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. bool m_allocationRecords; ///< True if we want to track memory allocations, otherwise false. unsigned char m_stackRecordLevels; ///< If stack recording is enabled, how many stack levels to record. @@ -53,7 +52,7 @@ namespace AZ AllocatorDebugConfig GetDebugConfig() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override; @@ -64,7 +63,6 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; ////////////////////////////////////////////////////////////////////////// protected: @@ -72,7 +70,6 @@ namespace AZ BestFitExternalMapAllocator& operator=(const BestFitExternalMapAllocator&); Descriptor m_desc; - BestFitExternalMapSchema* m_schema; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 715ecd221e..75356e85f3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -30,6 +30,7 @@ BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) //if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there is no point to use this allocator at all // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); + } //========================================================================= @@ -37,7 +38,7 @@ BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) // [1/28/2011] //========================================================================= BestFitExternalMapSchema::pointer_type -BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) +BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char*, const char*, int, unsigned int) { (void)flags; char* address = nullptr; @@ -91,8 +92,7 @@ BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int // DeAllocate // [1/28/2011] //========================================================================= -void -BestFitExternalMapSchema::DeAllocate(pointer_type ptr) +void BestFitExternalMapSchema::DeAllocate(pointer_type ptr, size_type, size_type) { if (ptr == nullptr) { @@ -122,6 +122,20 @@ BestFitExternalMapSchema::AllocationSize(pointer_type ptr) return 0; } +BestFitExternalMapSchema::size_type +BestFitExternalMapSchema::Resize(pointer_type, size_type) +{ + AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + return 0; +} + +BestFitExternalMapSchema::pointer_type +BestFitExternalMapSchema::ReAllocate(pointer_type, size_type, size_type) +{ + AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + return nullptr; +} + //========================================================================= // GetMaxAllocationSize // [1/28/2011] diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index eaab614593..63e9027dd2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -21,7 +21,7 @@ namespace AZ * External map allows us to use this allocator with uncached memory, * because the tracking node is stored outside the main chunk. */ - class BestFitExternalMapSchema + class BestFitExternalMapSchema : public IAllocatorSchema { public: typedef void* pointer_type; @@ -45,26 +45,27 @@ namespace AZ static const int m_memoryBlockAlignment = 16; void* m_memoryBlock; ///< Pointer to memory to allocate from. Can be uncached. unsigned int m_memoryBlockByteSize; ///< Sizes if the memory block. - IAllocatorAllocate* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. + IAllocator* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. }; BestFitExternalMapSchema(const Descriptor& desc); - pointer_type Allocate(size_type byteSize, size_type alignment, int flags); - void DeAllocate(pointer_type ptr); - size_type AllocationSize(pointer_type ptr); + pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; + void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; + size_type Resize(pointer_type ptr, size_type newSize) override; + pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; + size_type AllocationSize(pointer_type ptr) override; - AZ_FORCE_INLINE size_type NumAllocatedBytes() const { return m_used; } - AZ_FORCE_INLINE size_type Capacity() const { return m_desc.m_memoryBlockByteSize; } - size_type GetMaxAllocationSize() const; - size_type GetMaxContiguousAllocationSize() const; - AZ_FORCE_INLINE IAllocatorAllocate* GetSubAllocator() const { return m_desc.m_mapAllocator; } + AZ_FORCE_INLINE size_type NumAllocatedBytes() const override { return m_used; } + AZ_FORCE_INLINE size_type Capacity() const override { return m_desc.m_memoryBlockByteSize; } + size_type GetMaxAllocationSize() const override; + size_type GetMaxContiguousAllocationSize() const override; /** - * Since we don't consolidate chucnks at free time (too expensive) we will do it as we need or when we can't + * Since we don't consolidate chunks at free time (too expensive) we will do it as we need or when we can't * allocate memory. This function is at least O(nlogn) where 'n' are the free chunks. */ - void GarbageCollect(); + void GarbageCollect() override; private: AZ_FORCE_INLINE size_type ChunckSize(pointer_type ptr); diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index 1f0fc59a97..98ca1f87ed 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -107,7 +107,6 @@ namespace AZ m_used = 0; m_desc = desc; - m_subAllocator = nullptr; for (int i = 0; i < Descriptor::m_maxNumBlocks; ++i) { diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index 3a7716a127..ea4a4ebdc6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -17,7 +17,7 @@ namespace AZ * Internally uses use dlmalloc or version of it (nedmalloc, ptmalloc3). */ class HeapSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: typedef void* pointer_type; @@ -52,7 +52,6 @@ namespace AZ size_type Capacity() const override { return m_capacity; } size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override { return m_subAllocator; } void GarbageCollect() override {} private: @@ -62,7 +61,7 @@ namespace AZ Descriptor m_desc; size_type m_capacity; ///< Capacity in bytes. size_type m_used; ///< Number of bytes in use. - IAllocatorAllocate* m_subAllocator; + IAllocatorSchema* m_subAllocator; bool m_ownMemoryBlock[Descriptor::m_maxNumBlocks]; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp index 6e40ccd8cd..6891eb4248 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp @@ -1081,7 +1081,7 @@ namespace AZ { const size_t m_treePageAlignment; const size_t m_poolPageSize; bool m_isPoolAllocations; - IAllocatorAllocate* m_subAllocator; + IAllocatorSchema* m_subAllocator; #if !defined (USE_MUTEX_PER_BUCKET) mutable AZStd::mutex m_mutex; diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h index 5ee0205196..27dbd321d2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h @@ -19,7 +19,7 @@ namespace AZ * Heap allocator schema, based on Dimitar Lazarov "High Performance Heap Allocator". */ class HphaSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: /** @@ -47,7 +47,7 @@ namespace AZ unsigned int m_isPoolAllocations : 1; ///< True to allow allocations from pools, otherwise false. size_t m_fixedMemoryBlockByteSize; ///< Memory block size, if 0 we use the OS memory allocation functions. void* m_fixedMemoryBlock; ///< Can be NULL if so the we will allocate memory from the subAllocator if m_memoryBlocksByteSize is != 0. - IAllocatorAllocate* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). + IAllocatorSchema* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). size_t m_systemChunkSize; ///< Size of chunk to request from the OS when more memory is needed (defaults to m_pageSize) size_t m_capacity; ///< Max size this allocator can grow to }; @@ -68,7 +68,6 @@ namespace AZ size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; size_type GetUnAllocatedMemory(bool isPrint = false) const override; - IAllocatorAllocate* GetSubAllocator() override { return m_desc.m_subAllocator; } /// Return unused memory to the OS (if we don't use fixed block). Don't call this unless you really need free memory, it is slow. void GarbageCollect() override; diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp index 08c567bf84..2d561b45ef 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp @@ -9,23 +9,12 @@ namespace AZ { - IAllocator::IAllocator(IAllocatorAllocate* allocationSource) - : m_allocationSource(allocationSource) - , m_originalAllocationSource(allocationSource) + IAllocator::IAllocator(IAllocatorSchema* schema) + : m_schema(schema) { } IAllocator::~IAllocator() { } - - void IAllocator::SetAllocationSource(IAllocatorAllocate* allocationSource) - { - m_allocationSource = allocationSource; - } - - void IAllocator::ResetAllocationSource() - { - m_allocationSource = m_originalAllocationSource; - } } diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h index 532335e50b..319175f9ee 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h @@ -28,17 +28,16 @@ namespace AZ class AllocatorManager; /** - * Allocator alloc/free basic interface. It is separate because it can be used - * for user provided allocators overrides + * Allocator schema interface */ - class IAllocatorAllocate + class IAllocatorSchema { public: typedef void* pointer_type; typedef size_t size_type; typedef ptrdiff_t difference_type; - virtual ~IAllocatorAllocate() {} + virtual ~IAllocatorSchema() {} virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; virtual void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) = 0; @@ -70,8 +69,6 @@ namespace AZ * that will be reported. */ virtual size_type GetUnAllocatedMemory(bool isPrint = false) const { (void)isPrint; return 0; } - /// Returns a pointer to a sub-allocator or NULL. - virtual IAllocatorAllocate* GetSubAllocator() = 0; }; /** @@ -100,56 +97,19 @@ namespace AZ /** * Interface class for all allocators. */ - class IAllocator + class IAllocator : public IAllocatorSchema { public: - IAllocator(IAllocatorAllocate* allocationSource); + IAllocator(IAllocatorSchema* schema = nullptr); virtual ~IAllocator(); - // @{ Every system allocator is required to provide name this is how + // Every system allocator is required to provide name this is how // it will be registered with the allocator manager. virtual const char* GetName() const = 0; virtual const char* GetDescription() const = 0; - // @} - //--------------------------------------------------------------------- - // Code releating to the allocation source is made concrete within this - // interface as a performance optimization. - //--------------------------------------------------------------------- - - /// Returns the current allocation source, which may be used to perform memory allocations. - AZ_FORCE_INLINE IAllocatorAllocate* GetAllocationSource() const - { - return m_allocationSource; - } - - /// Returns the original allocation source. Generally only used for debugging purposes. - AZ_FORCE_INLINE IAllocatorAllocate* GetOriginalAllocationSource() const - { - return m_originalAllocationSource; - } - - /// Returns true if the allocation source has changed from its original value. - AZ_FORCE_INLINE bool IsAllocationSourceChanged() const - { - return m_allocationSource != m_originalAllocationSource; - } - - /// Sets the allocation source, effectively overriding the allocator. - /// Be very careful doing this, as existing allocations will be deallocated through the new source, - /// typically leading to unwanted effects (such as crashes). - void SetAllocationSource(IAllocatorAllocate* allocationSource); - - /// Restores the allocation source to its original value. - /// Be very careful doing this, as allocations that came from the new source will now be deallocated - /// through the original source, typically leading to unwanted effects (such as crashes). - void ResetAllocationSource(); - - //--------------------------------------------------------------------- - - /// Returns the schema, if the allocator uses one. Returns nullptr if the allocator does not use a schema. - /// This is mainly used when debugging to determine if allocators alias each other under the hood. - virtual IAllocatorAllocate* GetSchema() = 0; + /// Returns the schema + AZ_FORCE_INLINE IAllocatorSchema* GetSchema() const { return m_schema; }; /// Returns the debug configuration for this allocator. virtual AllocatorDebugConfig GetDebugConfig() = 0; @@ -163,11 +123,6 @@ namespace AZ /// Returns true if this allocator is ready to use. virtual bool IsReady() const = 0; - /// Returns true if this allocator can be overridden with a different source. - /// Almost all allocators should return true. There are very few minor exceptions, such as the OS Allocator, that are required for direct - /// interfacing with the kernel and must never be overridden under any circumstances. - virtual bool CanBeOverridden() const = 0; - /// Returns true if the allocator was lazily created. Exposed primarily for testing systems that need to verify the state of allocators. virtual bool IsLazilyCreated() const = 0; @@ -195,9 +150,7 @@ namespace AZ virtual void Destroy() = 0; protected: - // The allocation source is made a direct member of the interface as a performance optimization. - IAllocatorAllocate * m_allocationSource; - IAllocatorAllocate* m_originalAllocationSource; + IAllocatorSchema* m_schema; template friend class AllocatorStorage::StoragePolicyBase; diff --git a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp index 9aa31cd8b6..37fa277fab 100644 --- a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp @@ -22,31 +22,15 @@ namespace AZ::Internal namespace AZ { + static constexpr size_t DEFAULT_ALIGNMENT = sizeof(void*) * 2; // Default malloc alignment + //--------------------------------------------------------------------- // MallocSchema methods //--------------------------------------------------------------------- - MallocSchema::MallocSchema(const Descriptor& desc) + MallocSchema::MallocSchema(const Descriptor&) : m_bytesAllocated(0) { - if (desc.m_useAZMalloc) - { - static const int DEFAULT_ALIGNMENT = sizeof(void*) * 2; // Default malloc alignment - - m_mallocFn = [](size_t byteSize) - { - return AZ_OS_MALLOC(byteSize, DEFAULT_ALIGNMENT); - }; - m_freeFn = [](void* ptr) - { - AZ_OS_FREE(ptr); - }; - } - else - { - m_mallocFn = &malloc; - m_freeFn = &free; - } } MallocSchema::~MallocSchema() @@ -84,7 +68,7 @@ namespace AZ ((alignment > sizeof(double)) ? alignment : 0); // Malloc will align to a minimum boundary for native objects, so we only pad if aligning to a large value - void* data = (*m_mallocFn)(required); + void* data = AZ_OS_MALLOC(required, DEFAULT_ALIGNMENT); void* result = PointerAlignUp(reinterpret_cast(reinterpret_cast(data) + sizeof(Internal::Header)), alignment); Internal::Header* header = PointerAlignDown( (Internal::Header*)(reinterpret_cast(result) - sizeof(Internal::Header)), AZStd::alignment_of::value); @@ -112,7 +96,7 @@ namespace AZ void* freePtr = reinterpret_cast(reinterpret_cast(ptr) - static_cast(header->offset)); m_bytesAllocated -= header->size; - (*m_freeFn)(freePtr); + AZ_OS_FREE(freePtr); } MallocSchema::pointer_type MallocSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) @@ -166,11 +150,6 @@ namespace AZ return AZ_CORE_MAX_ALLOCATOR_SIZE; } - IAllocatorAllocate* MallocSchema::GetSubAllocator() - { - return nullptr; - } - void MallocSchema::GarbageCollect() { } diff --git a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h index 7a8c4a0366..02559fdb57 100644 --- a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h @@ -16,7 +16,7 @@ namespace AZ * Uses malloc internally. Mainly intended for debugging using host operating system features. */ class MallocSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: AZ_TYPE_INFO("MallocSchema", "{2A21D120-A42A-484C-997C-5735DCCA5FE9}"); @@ -25,21 +25,13 @@ namespace AZ typedef size_t size_type; typedef ptrdiff_t difference_type; - struct Descriptor - { - Descriptor(bool useAZMalloc = true) - : m_useAZMalloc(useAZMalloc) - { - } - - bool m_useAZMalloc; - }; + struct Descriptor {}; MallocSchema(const Descriptor& desc = Descriptor()); virtual ~MallocSchema(); //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; @@ -51,15 +43,9 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; void GarbageCollect() override; private: - typedef void* (*MallocFn)(size_t); - typedef void (*FreeFn)(void*); - AZStd::atomic m_bytesAllocated; - MallocFn m_mallocFn; - FreeFn m_freeFn; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2e08ec1b15..2ecba6ebff 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -141,9 +141,9 @@ void* operator new[](std::size_t, const AZ::Internal::AllocatorDummy*); */ #define azfree(...) AZ_MACRO_SPECIALIZE(azfree_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__)) -/// Returns allocation size, based on it's pointer \ref AZ::IAllocatorAllocate::AllocationSize. +/// Returns allocation size, based on it's pointer \ref AZ::IAllocatorSchema::AllocationSize. #define azallocsize(_Ptr, _Allocator) AZ::AllocatorInstance< _Allocator >::Get().AllocationSize(_Ptr) -/// Returns the new expanded size or 0 if NOT supported by the allocator \ref AZ::IAllocatorAllocate::Resize. +/// Returns the new expanded size or 0 if NOT supported by the allocator \ref AZ::IAllocatorSchema::Resize. #define azallocresize(_Ptr, _NewSize, _Allocator) AZ::AllocatorInstance< _Allocator >::Get().Resize(_Ptr, _NewSize) namespace AZ { @@ -734,12 +734,15 @@ namespace AZ public: typedef typename Allocator::Descriptor Descriptor; - AZ_FORCE_INLINE static IAllocatorAllocate& Get() + // Maintained for backwards compatibility, prefer to use Get() instead. + // Get was previously used to get the the schema, however, that bypases what the allocators are doing. + // If the schema is needed, call Get().GetSchema() + AZ_FORCE_INLINE static IAllocator& GetAllocator() { - return *GetAllocator().GetAllocationSource(); + return StoragePolicy::GetAllocator(); } - AZ_FORCE_INLINE static IAllocator& GetAllocator() + AZ_FORCE_INLINE static IAllocator& Get() { return StoragePolicy::GetAllocator(); } @@ -781,7 +784,7 @@ namespace AZ // structure of another allocator template class ChildAllocatorSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: // No descriptor is necessary, as the parent allocator is expected to already @@ -792,7 +795,7 @@ namespace AZ ChildAllocatorSchema(const Descriptor&) {} //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -848,11 +851,6 @@ namespace AZ { return AZ::AllocatorInstance::Get().GetUnAllocatedMemory(isPrint); } - - IAllocatorAllocate* GetSubAllocator() override - { - return AZ::AllocatorInstance::Get().GetSubAllocator(); - } }; /** @@ -873,7 +871,7 @@ namespace AZ { if (AllocatorInstance::IsReady()) { - m_name = AllocatorInstance::GetAllocator().GetName(); + m_name = AllocatorInstance::Get().GetName(); } else { @@ -932,7 +930,7 @@ namespace AZ typedef AZStd::ptrdiff_t difference_type; typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. - AZ_FORCE_INLINE AZStdIAllocator(IAllocatorAllocate* allocator, const char* name = "AZ::AZStdIAllocator") + AZ_FORCE_INLINE AZStdIAllocator(IAllocator* allocator, const char* name = "AZ::AZStdIAllocator") : m_allocator(allocator) , m_name(name) { @@ -965,7 +963,7 @@ namespace AZ AZ_FORCE_INLINE bool operator==(const AZStdIAllocator& rhs) const { return m_allocator == rhs.m_allocator; } AZ_FORCE_INLINE bool operator!=(const AZStdIAllocator& rhs) const { return m_allocator != rhs.m_allocator; } private: - IAllocatorAllocate* m_allocator; + IAllocator* m_allocator; const char* m_name; }; @@ -982,8 +980,8 @@ namespace AZ using size_type = AZStd::size_t; using difference_type = AZStd::ptrdiff_t; using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. - using functor_type = IAllocatorAllocate&(*)(); ///< Function Pointer must return IAllocatorAllocate&. - ///< function pointers do not support covariant return types + using functor_type = IAllocator&(*)(); ///< Function Pointer must return IAllocator&. + ///< function pointers do not support covariant return types constexpr AZStdFunctorAllocator(functor_type allocatorFunctor, const char* name = "AZ::AZStdFunctorAllocator") : m_allocatorFunctor(allocatorFunctor) diff --git a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp index 317df214d6..293cd92354 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp @@ -19,7 +19,6 @@ namespace AZ , m_custom(nullptr) , m_numAllocatedBytes(0) { - DisableOverriding(); } //========================================================================= diff --git a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h index 3a8080483b..0bdf7d9fed 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h @@ -24,7 +24,6 @@ namespace AZ */ class OSAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(OSAllocator, "{9F835EE3-F23C-454E-B4E3-011E2F3C8118}") @@ -39,7 +38,7 @@ namespace AZ { Descriptor() : m_custom(0) {} - IAllocatorAllocate* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. + IAllocatorSchema* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. }; bool Create(const Descriptor& desc); @@ -51,7 +50,7 @@ namespace AZ AllocatorDebugConfig GetDebugConfig() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override { return m_custom ? m_custom->Resize(ptr, newSize) : 0; } @@ -62,13 +61,12 @@ namespace AZ size_type Capacity() const override { return m_custom ? m_custom->Capacity() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited size_type GetMaxAllocationSize() const override { return m_custom ? m_custom->GetMaxAllocationSize() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited size_type GetMaxContiguousAllocationSize() const override { return m_custom ? m_custom->GetMaxContiguousAllocationSize() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited - IAllocatorAllocate* GetSubAllocator() override { return m_custom ? m_custom : NULL; } protected: OSAllocator(const OSAllocator&); OSAllocator& operator=(const OSAllocator&); - IAllocatorAllocate* m_custom; + IAllocatorSchema* m_custom; size_type m_numAllocatedBytes; }; diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp index ed5e0febc2..096fbbac95 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp @@ -233,7 +233,6 @@ namespace AZ size_type Capacity() const; size_type GetMaxAllocationSize() const; size_type GetMaxContiguousAllocationSize() const; - IAllocatorAllocate* GetSubAllocator(); void GarbageCollect(); private: @@ -680,11 +679,6 @@ auto AZ::OverrunDetectionSchemaImpl::GetMaxContiguousAllocationSize() const -> s return 0; } -AZ::IAllocatorAllocate* AZ::OverrunDetectionSchemaImpl::GetSubAllocator() -{ - return nullptr; -} - void AZ::OverrunDetectionSchemaImpl::GarbageCollect() { } @@ -810,11 +804,6 @@ auto AZ::OverrunDetectionSchema::GetMaxContiguousAllocationSize() const -> size_ return m_impl->GetMaxContiguousAllocationSize(); } -AZ::IAllocatorAllocate* AZ::OverrunDetectionSchema::GetSubAllocator() -{ - return m_impl->GetSubAllocator(); -} - void AZ::OverrunDetectionSchema::GarbageCollect() { m_impl->GarbageCollect(); diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h index 9895a5f84f..073b54160b 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h @@ -27,7 +27,7 @@ namespace AZ * the requested memory, plus the trap page). On most platforms this is 8kb (4kb * 2 pages). */ class OverrunDetectionSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: AZ_TYPE_INFO("OverrunDetectionSchema", "{0DF781AC-1615-40AE-81F7-6CA5841E2914}"); @@ -75,7 +75,7 @@ namespace AZ virtual ~OverrunDetectionSchema(); //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; @@ -87,7 +87,6 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; void GarbageCollect() override; private: diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h index a03f7b5b92..f55c6251bf 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h @@ -102,7 +102,7 @@ namespace AZ } ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override { (void)ptr; diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp index 9167864450..60f4f34f1d 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp @@ -163,7 +163,7 @@ namespace AZ } using AllocatorType = PoolAllocation; - IAllocatorAllocate* m_pageAllocator; + IAllocatorSchema* m_pageAllocator; AllocatorType m_allocator; void* m_staticDataBlock; unsigned int m_numStaticPages; @@ -295,7 +295,7 @@ namespace AZ FreePagesType m_freePages; AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. - IAllocatorAllocate* m_pageAllocator; + IAllocatorSchema* m_pageAllocator; void* m_staticDataBlock; size_t m_numStaticPages; size_t m_pageSize; @@ -732,17 +732,6 @@ PoolSchema::Capacity() const return m_impl->m_numStaticPages * m_impl->m_pageSize; } -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -PoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // PollAllocator Implementation @@ -1090,16 +1079,6 @@ ThreadPoolSchema::Capacity() const return m_impl->m_numStaticPages * m_impl->m_pageSize; } -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -ThreadPoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - //========================================================================= // ThreadPoolSchemaImpl diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h index cfc5e3ea07..d9faf976b3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h @@ -22,7 +22,7 @@ namespace AZ * use ThreadPool Schema or do the sync yourself. */ class PoolSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: /** @@ -52,7 +52,7 @@ namespace AZ * this is the minimum number of pages we will have allocated at all times, otherwise the total number of pages supported. */ unsigned int m_numStaticPages; - IAllocatorAllocate* m_pageAllocator; ///< If you provide this interface we will use it for page allocations, otherwise SystemAllocator will be used. + IAllocatorSchema* m_pageAllocator; ///< If you provide this interface we will use it for page allocations, otherwise SystemAllocator will be used. }; PoolSchema(const Descriptor& desc = Descriptor()); @@ -73,7 +73,6 @@ namespace AZ size_type GetMaxContiguousAllocationSize() const override; size_type NumAllocatedBytes() const override; size_type Capacity() const override; - IAllocatorAllocate* GetSubAllocator() override; protected: PoolSchema(const PoolSchema&); @@ -90,7 +89,7 @@ namespace AZ * for each thread. So there will be some memory overhead, especially if you use fixed pool sizes. */ class ThreadPoolSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: // Functions for getting an instance of a ThreadPoolData when using thread local storage @@ -119,7 +118,6 @@ namespace AZ size_type GetMaxContiguousAllocationSize() const override; size_type NumAllocatedBytes() const override; size_type Capacity() const override; - IAllocatorAllocate* GetSubAllocator() override; protected: ThreadPoolSchema(const ThreadPoolSchema&); diff --git a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h index 5fbc890203..76be66786e 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h @@ -22,17 +22,15 @@ namespace AZ template class SimpleSchemaAllocator : public AllocatorBase - , public IAllocatorAllocate { public: using Descriptor = DescriptorType; - using pointer_type = typename IAllocatorAllocate::pointer_type; - using size_type = typename IAllocatorAllocate::size_type; - using difference_type = typename IAllocatorAllocate::difference_type; + using pointer_type = typename Schema::pointer_type; + using size_type = typename Schema::size_type; + using difference_type = typename Schema::difference_type; SimpleSchemaAllocator(const char* name, const char* desc) - : AllocatorBase(this, name, desc) - , m_schema(nullptr) + : AllocatorBase(nullptr, name, desc) { } @@ -65,13 +63,8 @@ namespace AZ return AllocatorDebugConfig(); } - IAllocatorAllocate* GetSchema() override - { - return m_schema; - } - //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -188,14 +181,6 @@ namespace AZ { return m_schema->GetUnAllocatedMemory(isPrint); } - - IAllocatorAllocate* GetSubAllocator() override - { - return m_schema->GetSubAllocator(); - } - - protected: - IAllocatorAllocate* m_schema; private: typename AZStd::aligned_storage::value>::type m_schemaStorage; diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index e56f4f045d..c403df0ed6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -51,9 +51,8 @@ static bool g_isSystemSchemaUsed = false; // [9/2/2009] //========================================================================= SystemAllocator::SystemAllocator() - : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") + : AllocatorBase(nullptr, "SystemAllocator", "Fundamental generic memory allocator") , m_isCustom(false) - , m_allocator(nullptr) , m_ownsOSAllocator(false) { } @@ -93,7 +92,7 @@ SystemAllocator::Create(const Descriptor& desc) if (desc.m_custom) { m_isCustom = true; - m_allocator = desc.m_custom; + m_schema = desc.m_custom; isReady = true; } else @@ -121,9 +120,9 @@ SystemAllocator::Create(const Descriptor& desc) AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); + m_schema = new (&g_systemSchema) HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); + m_schema = new (&g_systemSchema) MallocSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -134,11 +133,11 @@ SystemAllocator::Create(const Descriptor& desc) AZ_Assert(AllocatorInstance::IsReady(), "System allocator must be created before any other allocator! They allocate from it."); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); + m_schema = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); + m_schema = azcreate(MallocSchema, (heapDesc), SystemAllocator); #endif - if (m_allocator == nullptr) + if (m_schema == nullptr) { isReady = false; } @@ -167,18 +166,18 @@ SystemAllocator::Destroy() if (!m_isCustom) { - if ((void*)m_allocator == (void*)&g_systemSchema) + if ((void*)m_schema == (void*)&g_systemSchema) { #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - static_cast(m_allocator)->~HphaSchema(); + static_cast(m_schema)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - static_cast(m_allocator)->~MallocSchema(); + static_cast(m_schema)->~MallocSchema(); #endif g_isSystemSchemaUsed = false; } else { - azdestroy(m_allocator); + azdestroy(m_schema); } } @@ -198,11 +197,6 @@ AllocatorDebugConfig SystemAllocator::GetDebugConfig() .ExcludeFromDebugging(!m_desc.m_allocationRecords); } -IAllocatorAllocate* SystemAllocator::GetSchema() -{ - return m_allocator; -} - //========================================================================= // Allocate // [9/2/2009] @@ -218,14 +212,14 @@ SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, co AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); byteSize = MemorySizeAdjustedUp(byteSize); - SystemAllocator::pointer_type address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + SystemAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); if (address == nullptr) { // Free all memory we can and try again! AllocatorManager::Instance().GarbageCollect(); - address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + address = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); } if (address == nullptr) @@ -251,7 +245,7 @@ SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alig byteSize = MemorySizeAdjustedUp(byteSize); AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - m_allocator->DeAllocate(ptr, byteSize, alignment); + m_schema->DeAllocate(ptr, byteSize, alignment); } //========================================================================= @@ -265,7 +259,7 @@ SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAl AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); + pointer_type newAddress = m_schema->ReAllocate(ptr, newSize, newAlignment); AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); @@ -280,7 +274,7 @@ SystemAllocator::size_type SystemAllocator::Resize(pointer_type ptr, size_type newSize) { newSize = MemorySizeAdjustedUp(newSize); - size_type resizedSize = m_allocator->Resize(ptr, newSize); + size_type resizedSize = m_schema->Resize(ptr, newSize); AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); @@ -294,7 +288,7 @@ SystemAllocator::Resize(pointer_type ptr, size_type newSize) SystemAllocator::size_type SystemAllocator::AllocationSize(pointer_type ptr) { - size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + size_type allocSize = MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); return allocSize; } diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h index c02ada5843..0ea4251b8a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h @@ -26,7 +26,6 @@ namespace AZ */ class SystemAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(SystemAllocator, "{424C94D8-85CF-4E89-8CD6-AB5EC173E875}") @@ -39,7 +38,7 @@ namespace AZ * we will allocate system memory using system calls. You can * provide arenas (spaces) with pre-allocated memory, and use the * flag to specify which arena you want to allocate from. - * You are also allowed to supply IAllocatorAllocate, but if you do + * You are also allowed to supply IAllocatorSchema, but if you do * so you will need to take care of all allocations, we will not use * the default HeapSchema. * \ref HeapSchema::Descriptor @@ -51,7 +50,7 @@ namespace AZ , m_allocationRecords(true) , m_stackRecordLevels(5) {} - IAllocatorAllocate* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. + IAllocatorSchema* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. struct Heap { @@ -73,7 +72,7 @@ namespace AZ int m_numFixedMemoryBlocks; ///< Number of memory blocks to use. void* m_fixedMemoryBlocks[m_maxNumFixedBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. size_t m_fixedMemoryBlocksByteSize[m_maxNumFixedBlocks]; ///< Sizes of different memory blocks (MUST be multiple of m_pageSize), if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - IAllocatorAllocate* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). + IAllocatorSchema* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). size_t m_systemChunkSize; ///< Size of chunk to request from the OS when more memory is needed (defaults to m_pageSize) } m_heap; bool m_allocationRecords; ///< True if we want to track memory allocations, otherwise false. @@ -87,25 +86,23 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // IAllocator AllocatorDebugConfig GetDebugConfig() override; - IAllocatorAllocate* GetSchema() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; size_type Resize(pointer_type ptr, size_type newSize) override; size_type AllocationSize(pointer_type ptr) override; - void GarbageCollect() override { m_allocator->GarbageCollect(); } + void GarbageCollect() override { GetSchema()->GarbageCollect(); } - size_type NumAllocatedBytes() const override { return m_allocator->NumAllocatedBytes(); } - size_type Capacity() const override { return m_allocator->Capacity(); } + size_type NumAllocatedBytes() const override { return GetSchema()->NumAllocatedBytes(); } + size_type Capacity() const override { return GetSchema()->Capacity(); } /// Keep in mind this operation will execute GarbageCollect to make sure it returns, max allocation. This function WILL be slow. - size_type GetMaxAllocationSize() const override { return m_allocator->GetMaxAllocationSize(); } - size_type GetMaxContiguousAllocationSize() const override { return m_allocator->GetMaxContiguousAllocationSize(); } - size_type GetUnAllocatedMemory(bool isPrint = false) const override { return m_allocator->GetUnAllocatedMemory(isPrint); } - IAllocatorAllocate* GetSubAllocator() override { return m_isCustom ? m_allocator : m_allocator->GetSubAllocator(); } + size_type GetMaxAllocationSize() const override { return GetSchema()->GetMaxAllocationSize(); } + size_type GetMaxContiguousAllocationSize() const override { return GetSchema()->GetMaxContiguousAllocationSize(); } + size_type GetUnAllocatedMemory(bool isPrint = false) const override { return GetSchema()->GetUnAllocatedMemory(isPrint); } ////////////////////////////////////////////////////////////////////////// @@ -115,7 +112,6 @@ namespace AZ Descriptor m_desc; bool m_isCustom; - IAllocatorAllocate* m_allocator; bool m_ownsOSAllocator; }; } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 841387f14d..b6f42e79ec 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -1456,7 +1456,7 @@ using namespace AZ; static void* LuaMemoryHook(void* userData, void* ptr, size_t osize, size_t nsize) { (void)osize; - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); if (nsize == 0) { if (ptr) @@ -4274,7 +4274,7 @@ LUA_API const Node* lua_getDummyNode() AZ_CLASS_ALLOCATOR(ScriptContextImpl, AZ::SystemAllocator, 0); ////////////////////////////////////////////////////////////////////////// - ScriptContextImpl(ScriptContext* owner, IAllocatorAllocate* allocator, lua_State* nativeContext) + ScriptContextImpl(ScriptContext* owner, IAllocator* allocator, lua_State* nativeContext) : m_owner(owner) , m_context(nullptr) , m_debug(nullptr) @@ -5827,7 +5827,7 @@ LUA_API const Node* lua_getDummyNode() }; } // namespace AZ - ScriptContext::ScriptContext(ScriptContextId id, IAllocatorAllocate* allocator, lua_State* nativeContext) + ScriptContext::ScriptContext(ScriptContextId id, IAllocator* allocator, lua_State* nativeContext) { m_id = id; m_impl = aznew ScriptContextImpl(this, allocator, nativeContext); diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h index bb63a9368d..8784bf7ca7 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h @@ -822,7 +822,7 @@ namespace AZ CustomFromLua m_fromLua; }; - ScriptContext(ScriptContextId id = ScriptContextIds::DefaultScriptContextId, IAllocatorAllocate* allocator = nullptr, lua_State* nativeContext = nullptr); + ScriptContext(ScriptContextId id = ScriptContextIds::DefaultScriptContextId, IAllocator* allocator = nullptr, lua_State* nativeContext = nullptr); ~ScriptContext(); /// Bind LUA context (VM) a specific behaviorContext diff --git a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl index a633af22da..c1ecd3634a 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl @@ -74,7 +74,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); // Flag the field with the EnumType attribute if we're an enumeration type aliased by RemoveEnum const bool isSpecializedEnum = AZStd::is_enum::value && !AzTypeInfo::Uuid().IsNull(); @@ -650,7 +650,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - m_classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + m_classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); m_classElement.m_attributes.emplace_back(AZ_CRC("KeyType", 0x15bc5303), CreateModuleAttribute(AZStd::move(uuid))); } diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp index ff0ad571f7..227ba3dc75 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp @@ -3245,7 +3245,7 @@ namespace AZ return genericClassInfoFoundIt != m_moduleLocalGenericClassInfos.end() ? genericClassInfoFoundIt->second : nullptr; } - AZ::IAllocatorAllocate& SerializeContext::PerModuleGenericClassInfo::GetAllocator() + AZ::IAllocator& SerializeContext::PerModuleGenericClassInfo::GetAllocator() { return m_moduleOSAllocator; } diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h index bf96bcdb9a..f8daa8c328 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h @@ -574,10 +574,10 @@ namespace AZ GenericClassInfo* m_genericClassInfo = nullptr; ///< Valid when the generic class is set. So you don't search for the actual type in the class register. Edit::ElementData* m_editData{}; ///< Pointer to edit data (generated by EditContext). AZStd::vector m_attributes{ - AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return AZ::AllocatorInstance::Get(); }) + AZStdFunctorAllocator([]() -> IAllocator& { return AZ::AllocatorInstance::Get(); }) }; ///< Attributes attached to ClassElement. Lambda is required here as AZStdFunctorAllocator expects a function pointer - ///< that returns an IAllocatorAllocate& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& - /// which while it inherits from IAllocatorAllocate, does not work as function pointers do not support covariant return types + ///< that returns an IAllocator& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& + /// which while it inherits from IAllocator, does not work as function pointers do not support covariant return types AttributeOwnership m_attributeOwnership = AttributeOwnership::Parent; int m_flags{}; ///< }; @@ -639,12 +639,12 @@ namespace AZ DataPatchUpgradeHandler m_dataPatchUpgrader; ///< Attributes for this class type. Lambda is required here as AZStdFunctorAllocator expects a function pointer - ///< that returns an IAllocatorAllocate& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& - /// which while it inherits from IAllocatorAllocate, does not work as function pointers do not support covariant return types + ///< that returns an IAllocator& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& + /// which while it inherits from IAllocator, does not work as function pointers do not support covariant return types AZStd::vector m_attributes{AZStdFunctorAllocator(&GetSystemAllocator) }; private: - static IAllocatorAllocate& GetSystemAllocator() + static IAllocator& GetSystemAllocator() { return AZ::AllocatorInstance::Get(); } @@ -2483,7 +2483,7 @@ namespace AZ PerModuleGenericClassInfo(); ~PerModuleGenericClassInfo(); - AZ::IAllocatorAllocate& GetAllocator(); + AZ::IAllocator& GetAllocator(); void AddGenericClassInfo(AZ::GenericClassInfo* genericClassInfo); void RemoveGenericClassInfo(const AZ::TypeId& canonicalTypeId); @@ -2546,12 +2546,12 @@ namespace AZ template AttributePtr CreateModuleAttribute(T&& attrValue) { - IAllocatorAllocate& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); + IAllocator& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); void* rawMemory = moduleAllocator.Allocate(sizeof(ContainerType), alignof(ContainerType)); new (rawMemory) ContainerType{ AZStd::forward(attrValue) }; auto attributeDeleter = [](Attribute* attribute) { - IAllocatorAllocate& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); + IAllocator& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); attribute->~Attribute(); moduleAllocator.DeAllocate(attribute); }; diff --git a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl index 06d4f76c80..2712baa859 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl @@ -32,7 +32,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); } template @@ -429,7 +429,7 @@ namespace AZ // the serialize context dll module allocator has to be used to manage the lifetime of the ClassData attributes within a module // If a module which reflects a variant is unloaded, then the dll module allocator will properly unreflect the variant type from the serialize context // for this particular module - AZStdFunctorAllocator dllAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); }); + AZStdFunctorAllocator dllAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); }); m_classData.m_attributes.set_allocator(AZStd::move(dllAllocator)); // Create the ObjectStreamWriteOverrideCB in the current module diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e8001f7215..b8ea9d3f39 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -362,8 +362,6 @@ set(FILES Memory/AllocatorBase.h Memory/AllocatorManager.cpp Memory/AllocatorManager.h - Memory/AllocatorOverrideShim.cpp - Memory/AllocatorOverrideShim.h Memory/AllocatorWrapper.h Memory/AllocatorScope.h Memory/BestFitExternalMapAllocator.cpp diff --git a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp index c982868c4f..dd2597334d 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp @@ -1400,7 +1400,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZStd::equal_to, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorSet(intList, AZStd::hash{}, AZStd::equal_to{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorSet; @@ -1798,7 +1798,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZStd::equal_to, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorMap(intList, AZStd::hash{}, AZStd::equal_to{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorMap; diff --git a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp index 26838eeb63..3f3bc86ed6 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp @@ -1082,7 +1082,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorSet(intList, AZStd::less{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorSet; @@ -1503,7 +1503,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorMap(intList, AZStd::less{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorMap; diff --git a/Code/Framework/AzCore/Tests/Memory.cpp b/Code/Framework/AzCore/Tests/Memory.cpp index 5287167c8b..0e0103d162 100644 --- a/Code/Framework/AzCore/Tests/Memory.cpp +++ b/Code/Framework/AzCore/Tests/Memory.cpp @@ -87,7 +87,7 @@ namespace UnitTest #endif void* addresses[numAllocations] = {nullptr}; - IAllocatorAllocate& sysAlloc = AllocatorInstance::Get(); + IAllocator& sysAllocator = AllocatorInstance::Get(); ////////////////////////////////////////////////////////////////////////// // Allocate @@ -96,19 +96,19 @@ namespace UnitTest { AZStd::size_t size = AZStd::GetMax(rand() % 256, 1); // supply all debug info, so we don't need to record the stack. - addresses[i] = sysAlloc.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); + addresses[i] = sysAllocator.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); memset(addresses[i], 1, size); totalAllocSize += size; } ////////////////////////////////////////////////////////////////////////// - EXPECT_GE(sysAlloc.NumAllocatedBytes(), totalAllocSize); + EXPECT_GE(sysAllocator.NumAllocatedBytes(), totalAllocSize); ////////////////////////////////////////////////////////////////////////// // Deallocate for (int i = numAllocations-1; i >=0; --i) { - sysAlloc.DeAllocate(addresses[i]); + sysAllocator.DeAllocate(addresses[i]); } ////////////////////////////////////////////////////////////////////////// } @@ -122,21 +122,21 @@ namespace UnitTest { AllocatorInstance::Create(); - IAllocatorAllocate& sysAlloc = AllocatorInstance::Get(); + IAllocator& sysAllocator = AllocatorInstance::Get(); for (int i = 0; i < 100; ++i) { - address[i] = sysAlloc.Allocate(1000, 32, 0); + address[i] = sysAllocator.Allocate(1000, 32, 0); EXPECT_NE(nullptr, address[i]); EXPECT_EQ(0, ((size_t)address[i] & 31)); // check alignment - EXPECT_GE(sysAlloc.AllocationSize(address[i]), 1000); // check allocation size + EXPECT_GE(sysAllocator.AllocationSize(address[i]), 1000); // check allocation size } - EXPECT_GE(sysAlloc.NumAllocatedBytes(), 100000); // we requested 100 * 1000 so we should have at least this much allocated + EXPECT_GE(sysAllocator.NumAllocatedBytes(), 100000); // we requested 100 * 1000 so we should have at least this much allocated for (int i = 0; i < 100; ++i) { - sysAlloc.DeAllocate(address[i]); + sysAllocator.DeAllocate(address[i]); } //////////////////////////////////////////////////////////////////////// @@ -168,18 +168,17 @@ namespace UnitTest SystemAllocator::Descriptor descriptor; descriptor.m_stackRecordLevels = 20; AllocatorInstance::Create(descriptor); - IAllocator& sysAllocator = AllocatorInstance::GetAllocator(); - IAllocatorAllocate& sysAlloc = *sysAllocator.GetAllocationSource(); + IAllocator& sysAllocator = AllocatorInstance::Get(); for (int i = 0; i < 100; ++i) { - address[i] = sysAlloc.Allocate(1000, 32, 0); + address[i] = sysAllocator.Allocate(1000, 32, 0); EXPECT_NE(nullptr, address[i]); EXPECT_EQ(0, ((size_t)address[i] & 31)); // check alignment - EXPECT_GE(sysAlloc.AllocationSize(address[i]), 1000); // check allocation size + EXPECT_GE(sysAllocator.AllocationSize(address[i]), 1000); // check allocation size } - EXPECT_TRUE(sysAlloc.NumAllocatedBytes() >= 100000); // we requested 100 * 1000 so we should have at least this much allocated + EXPECT_TRUE(sysAllocator.NumAllocatedBytes() >= 100000); // we requested 100 * 1000 so we should have at least this much allocated // If tracking and recording is enabled, we can verify that the alloc info is valid #if defined(AZ_DEBUG_BUILD) @@ -192,7 +191,7 @@ namespace UnitTest const Debug::AllocationInfo& ai = iter->second; EXPECT_EQ(32, ai.m_alignment); EXPECT_EQ(1000, ai.m_byteSize); - EXPECT_EQ(nullptr, ai.m_fileName); // We did not pass fileName or lineNum to sysAlloc.Allocate() + EXPECT_EQ(nullptr, ai.m_fileName); // We did not pass fileName or lineNum to sysAllocator.Allocate() EXPECT_EQ(0, ai.m_lineNum); // -- " -- # if defined(AZ_PLATFORM_WINDOWS) // if our hardware support stack traces make sure we have them, since we did not provide fileName,lineNum @@ -229,47 +228,47 @@ namespace UnitTest // Free all memory for (int i = 0; i < 100; ++i) { - sysAlloc.DeAllocate(address[i]); + sysAllocator.DeAllocate(address[i]); } - sysAlloc.GarbageCollect(); - EXPECT_LT(sysAlloc.NumAllocatedBytes(), 1024); // We freed everything from a memspace, we should have only a very minor chunk of data + sysAllocator.GarbageCollect(); + EXPECT_LT(sysAllocator.NumAllocatedBytes(), 1024); // We freed everything from a memspace, we should have only a very minor chunk of data ////////////////////////////////////////////////////////////////////////// // realloc test address[0] = nullptr; static const unsigned int checkValue = 0x0badbabe; // create tree (non pool) allocation (we usually pool < 256 bytes) - address[0] = sysAlloc.Allocate(2048, 16); + address[0] = sysAllocator.Allocate(2048, 16); *(unsigned*)(address[0]) = checkValue; // set check value - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); - address[0] = sysAlloc.ReAllocate(address[0], 1024, 16); // test tree big -> tree small + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 1024, 16); // test tree big -> tree small EXPECT_EQ(checkValue, *(unsigned*)address[0]); - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 1024, 16); - address[0] = sysAlloc.ReAllocate(address[0], 4096, 16); // test tree small -> tree big - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 4096, 16); + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 1024, 16); + address[0] = sysAllocator.ReAllocate(address[0], 4096, 16); // test tree small -> tree big + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 4096, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 128, 16); // test tree -> pool, - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 128, 16); + address[0] = sysAllocator.ReAllocate(address[0], 128, 16); // test tree -> pool, + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 128, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 64, 16); // pool big -> pool small - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 64, 16); + address[0] = sysAllocator.ReAllocate(address[0], 64, 16); // pool big -> pool small + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 64, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 64, 16); // pool sanity check - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 64, 16); + address[0] = sysAllocator.ReAllocate(address[0], 64, 16); // pool sanity check + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 64, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 192, 16); // pool small -> pool big - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 192, 16); + address[0] = sysAllocator.ReAllocate(address[0], 192, 16); // pool small -> pool big + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 192, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 2048, 16); // pool -> tree - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 2048, 16); // pool -> tree + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); ; EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 2048, 16); // tree sanity check - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 2048, 16); // tree sanity check + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); ; EXPECT_EQ(checkValue, *(unsigned*)address[0]); - sysAlloc.DeAllocate(address[0], 2048, 16); + sysAllocator.DeAllocate(address[0], 2048, 16); // TODO realloc with different alignment tests ////////////////////////////////////////////////////////////////////////// @@ -340,8 +339,7 @@ namespace UnitTest void run() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& poolAllocator = AllocatorInstance::Get(); // 64 should be the max number of different pool sizes we can allocate. void* address[64]; ////////////////////////////////////////////////////////////////////////// @@ -352,12 +350,12 @@ namespace UnitTest int i = 0; for (int size = 8; size <= 256; ++i, size += 8) { - address[i] = poolAlloc.Allocate(size, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[i]), (AZStd::size_t)size); + address[i] = poolAllocator.Allocate(size, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[i]), (AZStd::size_t)size); memset(address[i], 1, size); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), 4126); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), 4126); if (poolAllocator.GetRecords()) { @@ -369,11 +367,11 @@ namespace UnitTest for (i = 0; address[i] != nullptr; ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -393,13 +391,13 @@ namespace UnitTest memset(address, 0, AZ_ARRAY_SIZE(address)*sizeof(void*)); for (unsigned int j = 0; j < AZ_ARRAY_SIZE(address); ++j) { - address[j] = poolAlloc.Allocate(256, 8, 0, "Pool Alloc", "This File", 123); - EXPECT_GE(poolAlloc.AllocationSize(address[j]), 256); + address[j] = poolAllocator.Allocate(256, 8, 0, "Pool Alloc", "This File", 123); + EXPECT_GE(poolAllocator.AllocationSize(address[j]), 256); memset(address[j], 1, 256); } // AllocatorManager::Instance().ResetMemoryBreak(0); - EXPECT_GE(poolAlloc.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); if (poolAllocator.GetRecords()) { @@ -411,11 +409,11 @@ namespace UnitTest for (unsigned int j = 0; j < AZ_ARRAY_SIZE(address); ++j) { - poolAlloc.DeAllocate(address[j]); + poolAllocator.DeAllocate(address[j]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -541,14 +539,14 @@ namespace UnitTest #endif void* addresses[numAllocations] = {nullptr}; - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); ////////////////////////////////////////////////////////////////////////// // Allocate for (int i = 0; i < numAllocations; ++i) { AZStd::size_t size = AZStd::GetMax(1, ((i + 1) * 2) % 256); - addresses[i] = poolAlloc.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); + addresses[i] = poolAllocator.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); EXPECT_NE(addresses[i], nullptr); memset(addresses[i], 1, size); } @@ -558,7 +556,7 @@ namespace UnitTest // Deallocate for (int i = numAllocations-1; i >=0; --i) { - poolAlloc.DeAllocate(addresses[i]); + poolAllocator.DeAllocate(addresses[i]); } ////////////////////////////////////////////////////////////////////////// } @@ -568,12 +566,12 @@ namespace UnitTest */ void SharedAlloc() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); for (int i = 0; i < m_numSharedAlloc; ++i) { AZStd::size_t minSize = sizeof(AllocClass); AZStd::size_t size = AZStd::GetMax((AZStd::size_t)(rand() % 256), minSize); - AllocClass* ac = reinterpret_cast(poolAlloc.Allocate(size, AZStd::alignment_of::value, 0, "Shared Alloc", __FILE__, __LINE__)); + AllocClass* ac = reinterpret_cast(poolAllocator.Allocate(size, AZStd::alignment_of::value, 0, "Shared Alloc", __FILE__, __LINE__)); AZStd::lock_guard lock(m_mutex); m_sharedAlloc.push_back(*ac); } @@ -584,7 +582,7 @@ namespace UnitTest */ void SharedDeAlloc() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); AllocClass* ac; int isDone = 0; while (isDone!=2) @@ -594,7 +592,7 @@ namespace UnitTest { ac = &m_sharedAlloc.front(); m_sharedAlloc.pop_front(); - poolAlloc.DeAllocate(ac); + poolAllocator.DeAllocate(ac); } if (m_doneSharedAlloc) // once we know we don't add more elements, make one last check and exit. @@ -633,8 +631,7 @@ namespace UnitTest void run() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& poolAllocator = AllocatorInstance::Get(); // 64 should be the max number of different pool sizes we can allocate. void* address[64]; ////////////////////////////////////////////////////////////////////////// @@ -645,12 +642,12 @@ namespace UnitTest int j = 0; for (int size = 8; size <= 256; ++j, size += 8) { - address[j] = poolAlloc.Allocate(size, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[j]), (AZStd::size_t)size); + address[j] = poolAllocator.Allocate(size, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[j]), (AZStd::size_t)size); memset(address[j], 1, size); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), 4126); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), 4126); if (poolAllocator.GetRecords()) { @@ -662,11 +659,11 @@ namespace UnitTest for (int i = 0; address[i] != nullptr; ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -681,12 +678,12 @@ namespace UnitTest memset(address, 0, AZ_ARRAY_SIZE(address)*sizeof(void*)); for (unsigned int i = 0; i < AZ_ARRAY_SIZE(address); ++i) { - address[i] = poolAlloc.Allocate(256, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[i]), 256); + address[i] = poolAllocator.Allocate(256, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[i]), 256); memset(address[i], 1, 256); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); if (poolAllocator.GetRecords()) { @@ -698,11 +695,11 @@ namespace UnitTest for (unsigned int i = 0; i < AZ_ARRAY_SIZE(address); ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -820,7 +817,7 @@ namespace UnitTest desc.m_memoryBlock = azmalloc(desc.m_memoryBlockByteSize, desc.m_memoryBlockAlignment); AllocatorInstance::Create(desc); - IAllocatorAllocate& bfAlloc = AllocatorInstance::Get(); + IAllocator& bfAlloc = AllocatorInstance::Get(); EXPECT_EQ( desc.m_memoryBlockByteSize, bfAlloc.Capacity() ); EXPECT_EQ( 0, bfAlloc.NumAllocatedBytes() ); @@ -882,8 +879,8 @@ namespace UnitTest void run() { - IAllocator& sysAllocator = AllocatorInstance::GetAllocator(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& sysAllocator = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); void* ptr = azmalloc(16*1024, 32, SystemAllocator); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment @@ -1010,27 +1007,27 @@ namespace UnitTest void run() { - IAllocator& sysAlloc = AllocatorInstance::GetAllocator(); - IAllocator& poolAlloc = AllocatorInstance::GetAllocator(); + IAllocator& sysAllocator = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); MyClass* ptr = aznew MyClass(202); /// this should allocate memory from the pool allocator EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(202, ptr->m_data); // check value - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } delete ptr; - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1038,19 +1035,19 @@ namespace UnitTest ptr = azcreate(MyClass, (101), SystemAllocator); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(101, ptr->m_data); // check value - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } azdestroy(ptr, SystemAllocator); - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1059,19 +1056,19 @@ namespace UnitTest ptr = azcreate(MyClass, (505), SystemAllocator, "MyClassNamed"); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(505, ptr->m_data); // check value - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClassNamed"); } azdestroy(ptr); // imply SystemAllocator - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1080,20 +1077,20 @@ namespace UnitTest EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(303, ptr->m_data); // check value - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter != records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } delete ptr; - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr) == records.end()); // our allocation is NOT in the list } } @@ -1140,8 +1137,8 @@ namespace UnitTest return (size_t)1 << (size_t)(MAX_ALIGNMENT_LOG2 * r); } - class DebugSysAlloc - : public AZ::IAllocatorAllocate + class DebugSysAllocSchema + : public AZ::IAllocatorSchema { pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -1176,8 +1173,6 @@ namespace UnitTest size_type GetMaxAllocationSize() const override { return 1 * 1024 * 1024 * 1024; } /// Returns max allocation size of a single contiguous allocation size_type GetMaxContiguousAllocationSize() const override { return 1 * 1024 * 1024 * 1024; } - /// Returns a pointer to a sub-allocator or NULL. - IAllocatorAllocate* GetSubAllocator() override { return NULL; } }; public: void SetUp() override @@ -2565,7 +2560,7 @@ namespace UnitTest printf("\n\t\t\t=======================\n"); printf("\t\t\tSchemas Benchmark Test!\n"); printf("\t\t\t=======================\n"); - DebugSysAlloc da; + DebugSysAllocSchema da; { HphaSchema::Descriptor hphaDesc; hphaDesc.m_fixedMemoryBlockByteSize = AZ_TRAIT_OS_HPHA_MEMORYBLOCKBYTESIZE; diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 5cf5176308..7870749d24 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -112,7 +112,6 @@ namespace Benchmark { } - // IAllocatorAllocate static void* Allocate(size_t byteSize, size_t) { s_numAllocatedBytes += byteSize; @@ -580,6 +579,7 @@ namespace Benchmark //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + // BM_REGISTER_ALLOCATOR(OSAllocator, OSAllocator); // Requires special treatment to initialize since it will be already initialized, maybe creating a different instance? #undef BM_REGISTER_ALLOCATOR #undef BM_REGISTER_SIZE_FIXTURES diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp index dc8ac033c1..bc758c1544 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include @@ -47,9 +46,6 @@ namespace UnitTest void RunTests() { - TestAllocatorShimWithDeallocateAfter(); - TestAllocatorShimRemovedAfterFinalization(); - TestAllocatorShimUsedForRealloc(); TearDownAllocatorManagerTest(); } @@ -64,7 +60,7 @@ namespace UnitTest EXPECT_EQ(m_manager->GetNumAllocators(), 0); AllocatorInstance::Create(); EXPECT_EQ(m_manager->GetNumAllocators(), 2); // SystemAllocator creates the OSAllocator if it doesn't exist - m_systemAllocator = &AllocatorInstance::GetAllocator(); + m_systemAllocator = &AllocatorInstance::Get(); } void TearDownAllocatorManagerTest() @@ -83,85 +79,6 @@ namespace UnitTest m_systemAllocator = nullptr; } - void TestAllocatorShimWithDeallocateAfter() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed. If this fails, check that AZCORE_MEMORY_ENABLE_OVERRIDES is enabled in AllocatorManager.cpp. - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - const int testAllocBytes = TEST_ALLOC_BYTES; - - // Allocate from the shim, which should take from the allocator's original source - void* p = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(p, nullptr); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Add the override schema - m_manager->SetOverrideAllocatorSource(&m_mallocSchema); - - // Allocations should go through malloc schema instead of the allocator's regular schema - void* q = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(q, nullptr); - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), testAllocBytes); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Finalize configuration, no more shims should be created after this point - m_manager->FinalizeConfiguration(); - - // Deallocating the original orphaned allocation from the SystemAllocator should remove the shim - EXPECT_NE(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - m_systemAllocator->GetAllocationSource()->DeAllocate(p); - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - - // Clean up - m_systemAllocator->GetAllocationSource()->DeAllocate(q); - } - - void TestAllocatorShimRemovedAfterFinalization() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - // Finalizing the configuration should remove the shim if it was unused - m_manager->FinalizeConfiguration(); - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - } - - void TestAllocatorShimUsedForRealloc() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - const int testAllocBytes = TEST_ALLOC_BYTES; - - // Allocate from the shim, which should take from the allocator's original source - void* p = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(p, nullptr); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Add the override schema and finalize - m_manager->SetOverrideAllocatorSource(&m_mallocSchema); - m_manager->FinalizeConfiguration(); - - // Shim should still be present - EXPECT_NE(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - - // Reallocation should move allocation from the old source to the new source - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), 0); - void* q = m_systemAllocator->GetAllocationSource()->ReAllocate(p, testAllocBytes * 2, 0); - EXPECT_NE(p, q); - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), testAllocBytes * 2); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), 0); - - // Reallocation should also have removed the shim as it was no longer necessary - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - } - MallocSchema m_mallocSchema; AllocatorManager* m_manager = nullptr; IAllocator* m_systemAllocator = nullptr; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index 04802a8d0e..c2fba5c5a3 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -1975,7 +1975,7 @@ namespace AZ::IO AZ_Error("Archive", false, "OSAllocator is not ready. It cannot be used to allocate a MemoryBlock"); return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { diff --git a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h index d7eaee6e24..0bbc5aaaab 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h @@ -36,7 +36,7 @@ namespace AZ::IO struct MemoryBlockDeleter { void operator()(const AZStd::intrusive_refcount* ptr) const; - AZ::IAllocatorAllocate* m_allocator{}; + AZ::IAllocator* m_allocator{}; }; struct MemoryBlock : AZStd::intrusive_refcount diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp index 13d5b0f723..05c773f056 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp @@ -42,7 +42,7 @@ namespace AZ::IO::ZipDir AZ_Error("Archive", false, "OSAllocator is not ready. It cannot be used to allocate a MemoryBlock"); return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { @@ -142,14 +142,14 @@ namespace AZ::IO::ZipDir { } - Cache::Cache(AZ::IAllocatorAllocate* allocator) + Cache::Cache(AZ::IAllocator* allocator) : m_fileHandle(AZ::IO::InvalidHandle) , m_nFlags(0) , m_lCDROffset(0) , m_encryptedHeaders(ZipFile::HEADERS_NOT_ENCRYPTED) , m_allocator{ allocator } { - AZ_Assert(allocator, "IAllocatorAllocate object is required in order to allocated memory for the ZipDir Cache operations"); + AZ_Assert(allocator, "IAllocator object is required in order to allocated memory for the ZipDir Cache operations"); } void Cache::Close() diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h index ae1e3dfa9c..c8b19ebf33 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h @@ -40,7 +40,7 @@ namespace AZ::IO::ZipDir inline static constexpr int compressedBlockHeaderSizeInBytes = 4; //number of bytes we need in front of the compressed block to indicate which compressor was used Cache(); - explicit Cache(AZ::IAllocatorAllocate* allocator); + explicit Cache(AZ::IAllocator* allocator); ~Cache() { @@ -133,7 +133,7 @@ namespace AZ::IO::ZipDir friend class FileEntryTransactionAdd; FileEntryTree m_treeDir; AZ::IO::HandleType m_fileHandle; - AZ::IAllocatorAllocate* m_allocator; + AZ::IAllocator* m_allocator; AZ::IO::Path m_strFilePath; // String Pool for persistently storing paths as long as they reside in the cache diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp index ab9c356d7f..9ad58443a0 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp @@ -39,7 +39,7 @@ namespace AZ::IO::ZipDir { } - auto FileDataRecord::New(const FileRecord& rThat, AZ::IAllocatorAllocate* allocator) -> AZStd::intrusive_ptr + auto FileDataRecord::New(const FileRecord& rThat, AZ::IAllocator* allocator) -> AZStd::intrusive_ptr { auto fileDataRecordAlloc = reinterpret_cast(allocator->Allocate( sizeof(FileDataRecord) + rThat.pFileEntryBase->desc.lSizeCompressed, diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h index 1183dbf384..2a4df44f2d 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h @@ -28,7 +28,7 @@ namespace AZ::IO::ZipDir { void operator()(const AZStd::intrusive_refcount* ptr) const; - AZ::IAllocatorAllocate* m_allocator{}; + AZ::IAllocator* m_allocator{}; }; struct FileDataRecord : public FileRecord @@ -36,7 +36,7 @@ namespace AZ::IO::ZipDir { FileDataRecord(); - static auto New(const FileRecord& rThat, AZ::IAllocatorAllocate* allocator) ->AZStd::intrusive_ptr; + static auto New(const FileRecord& rThat, AZ::IAllocator* allocator) ->AZStd::intrusive_ptr; void* GetData() {return this + 1; } }; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp index cea517decd..1ac0906c94 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp @@ -25,13 +25,13 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal { static void* ZlibAlloc(void* userData, uint32_t item, uint32_t size) { - auto allocator = reinterpret_cast(userData); + auto allocator = reinterpret_cast(userData); return allocator->Allocate(item * size, alignof(uint8_t), 0, "ZLibAlloc"); } static void ZlibFree(void* userData, void* ptr) { - auto allocator = reinterpret_cast(userData); + auto allocator = reinterpret_cast(userData); allocator->DeAllocate(ptr); } @@ -296,7 +296,7 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { @@ -451,7 +451,7 @@ namespace AZ::IO::ZipDir if (GetDiskFreeSpaceA(drive.c_str(),nullptr, &bytesPerSector, nullptr, nullptr)) { m_nSectorSize = bytesPerSector; - AZ::IAllocatorAllocate& allocator = AZ::AllocatorInstance::Get(); + AZ::IAllocator& allocator = AZ::AllocatorInstance::Get(); if (m_pReadTarget) { allocator.DeAllocate(m_pReadTarget); diff --git a/Code/LauncherUnified/Launcher.h b/Code/LauncherUnified/Launcher.h index 7c4c09c19f..eb1cf6479e 100644 --- a/Code/LauncherUnified/Launcher.h +++ b/Code/LauncherUnified/Launcher.h @@ -62,7 +62,7 @@ namespace O3DELauncher ResourceLimitUpdater m_updateResourceLimits = nullptr; //!< callback for updating system resources, if necessary OnPostApplicationStart m_onPostAppStart = nullptr; //!< callback notifying the platform specific entry point that AzGameFramework::GameApplication::Start has been called - AZ::IAllocatorAllocate* m_allocator = nullptr; //!< Used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. If null, OSAllocator will be used + AZ::IAllocator* m_allocator = nullptr; //!< Used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. If null, OSAllocator will be used const char* m_appResourcesPath = "."; //!< Path to the device specific assets, default is equivalent to blank path in ParseEngineConfig const char* m_appWriteStoragePath = nullptr; //!< Path to writeable storage if different than assets path, used to override userPath and logPath diff --git a/Code/Legacy/CryCommon/CryLegacyAllocator.h b/Code/Legacy/CryCommon/CryLegacyAllocator.h index b0e1e29657..e96c2a9347 100644 --- a/Code/Legacy/CryCommon/CryLegacyAllocator.h +++ b/Code/Legacy/CryCommon/CryLegacyAllocator.h @@ -23,19 +23,9 @@ inline void* CryModuleMallocImpl(size_t size, const char* file, const int line) #define CryModuleFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__) #define CryModuleMemalignFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__) -inline void CryModuleFreeImpl(void* ptr, const char* file, const int line) +inline void CryModuleFreeImpl(void* ptr, const char*, const int) { - - AZ::IAllocator& allocator = AZ::AllocatorInstance::GetAllocator(); - - if (allocator.IsAllocationSourceChanged()) - { - allocator.GetAllocationSource()->DeAllocate(ptr); - } - else - { - static_cast(allocator).DeAllocate(ptr, file, line); - } + AZ::AllocatorInstance::Get().DeAllocate(ptr, 0, 0); } #define CryModuleMemalign(size, alignment) CryModuleMemalignImpl(size, alignment, __FILE__, __LINE__) @@ -79,17 +69,5 @@ inline void* CryModuleReallocAlignImpl(void* prev, size_t size, size_t alignment } #endif - AZ::IAllocator& allocator = AZ::AllocatorInstance::GetAllocator(); - void *ptr; - - if (allocator.IsAllocationSourceChanged()) - { - ptr = allocator.GetAllocationSource()->ReAllocate(prev, size, 0); - } - else - { - ptr = static_cast(allocator).ReAllocate(prev, size, 0, file, line); - } - - return ptr; + return AZ::AllocatorInstance::Get().ReAllocate(prev, size, 0); } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h index d66a3ea1bb..7995002a39 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h @@ -13,7 +13,7 @@ namespace AZ { - class IAllocatorAllocate; + class IAllocator; namespace RHI { @@ -66,7 +66,7 @@ namespace AZ DrawPacket() = default; // The allocator used to release the memory when Release() is called. - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; // The bit-mask of all active filter tags. DrawListMask m_drawListMask = 0; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h index 021125312b..30e013d486 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h @@ -14,7 +14,7 @@ namespace AZ { - class IAllocatorAllocate; + class IAllocator; namespace RHI { @@ -50,7 +50,7 @@ namespace AZ // NOTE: This is configurable; just used to control the amount of memory held by the builder. static const size_t DrawItemCountMax = 16; - void Begin(IAllocatorAllocate* allocator); + void Begin(IAllocator* allocator); void SetDrawArguments(const DrawArguments& drawArguments); @@ -77,7 +77,7 @@ namespace AZ private: void ClearData(); - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; DrawArguments m_drawArguments; DrawListMask m_drawListMask = 0; DrawFilterMask m_drawFilterMask = DrawFilterMaskDefaultValue; diff --git a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp index ebda9732df..ec9dd1a14f 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp @@ -18,7 +18,7 @@ namespace AZ { namespace RHI { - void DrawPacketBuilder::Begin(IAllocatorAllocate* allocator) + void DrawPacketBuilder::Begin(IAllocator* allocator) { m_allocator = allocator ? allocator : &AllocatorInstance::Get(); } From 8511f61fd3d6fdea6b1bc5e587313d022eb48ee8 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Mon, 13 Dec 2021 12:08:00 -0800 Subject: [PATCH 023/394] duplicating standardPBR files for BasePBR Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Types/BasePBR.materialtype | 1202 +++++++++++++++++ .../Materials/Types/BasePBR_Common.azsli | 95 ++ .../Materials/Types/BasePBR_ForwardPass.azsl | 362 +++++ .../Types/BasePBR_ForwardPass.shader | 54 + .../BasePBR_ForwardPass.shadervariantlist | 29 + .../Types/BasePBR_LowEndForward.azsl | 13 + .../Types/BasePBR_LowEndForward.shader | 59 + .../Materials/Types/BasePBR_ShaderEnable.lua | 82 ++ .../atom_feature_common_asset_files.cmake | 10 + 9 files changed, 1906 insertions(+) create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype new file mode 100644 index 0000000000..f324394309 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype @@ -0,0 +1,1202 @@ +{ + "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", + "version": 4, + "versionUpdates": [ + { + "toVersion": 4, + "actions": [ + {"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"} + ] + } + ], + "propertyLayout": { + "groups": [ + { + "name": "baseColor", + "displayName": "Base Color", + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + }, + { + "name": "metallic", + "displayName": "Metallic", + "description": "Properties for configuring whether the surface is metallic or not." + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Properties for configuring how rough the surface appears." + }, + { + "name": "specularF0", + "displayName": "Specular Reflectance f0", + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." + }, + { + "name": "normal", + "displayName": "Normal", + "description": "Properties related to configuring surface normal." + }, + { + "name": "occlusion", + "displayName": "Occlusion", + "description": "Properties for baked textures that represent geometric occlusion of light." + }, + { + "name": "emissive", + "displayName": "Emissive", + "description": "Properties to add light emission, independent of other lights in the scene." + }, + { + "name": "clearCoat", + "displayName": "Clear Coat", + "description": "Properties for configuring gloss clear coat" + }, + { + "name": "parallax", + "displayName": "Displacement", + "description": "Properties for parallax effect produced by a height map." + }, + { + "name": "opacity", + "displayName": "Opacity", + "description": "Properties for configuring the materials transparency." + }, + { + "name": "uv", + "displayName": "UVs", + "description": "Properties for configuring UV transforms." + }, + { + // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader + "name": "irradiance", + "displayName": "Irradiance", + "description": "Properties for configuring the irradiance used in global illumination." + }, + { + "name": "general", + "displayName": "General Settings", + "description": "General settings." + } + ], + "properties": { + "general": [ + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ], + "baseColor": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ], + "metallic": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ], + "roughness": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ], + "specularF0": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ], + "clearCoat": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ], + "normal": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ], + "opacity": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ], + "uv": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ], + "occlusion": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ], + "emissive": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ], + "parallax": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ], + "irradiance": [ + // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] + } + }, + "shaders": [ + { + "file": "./StandardPBR_ForwardPass.shader", + "tag": "ForwardPass" + }, + { + "file": "./StandardPBR_ForwardPass_EDS.shader", + "tag": "ForwardPass_EDS" + }, + { + "file": "./StandardPBR_LowEndForward.shader", + "tag": "LowEndForward" + }, + { + "file": "./StandardPBR_LowEndForward_EDS.shader", + "tag": "LowEndForward_EDS" + }, + { + "file": "Shaders/Shadow/Shadowmap.shader", + "tag": "Shadowmap" + }, + { + "file": "./StandardPBR_Shadowmap_WithPS.shader", + "tag": "Shadowmap_WithPS" + }, + { + "file": "Shaders/Depth/DepthPass.shader", + "tag": "DepthPass" + }, + { + "file": "./StandardPBR_DepthPass_WithPS.shader", + "tag": "DepthPass_WithPS" + }, + { + "file": "Shaders/MotionVector/MeshMotionVector.shader", + "tag": "MeshMotionVector" + }, + // Used by the light culling system to produce accurate depth bounds for this object when it uses blended transparency + { + "file": "Shaders/Depth/DepthPassTransparentMin.shader", + "tag": "DepthPassTransparentMin" + }, + { + "file": "Shaders/Depth/DepthPassTransparentMax.shader", + "tag": "DepthPassTransparentMax" + } + ], + "functors": [ + { + // Maps 2D scale, offset, and rotate properties into a float3x3 transform matrix. + "type": "Transform2D", + "args": { + "transformOrder": [ "Rotate", "Translate", "Scale" ], + "centerProperty": "uv.center", + "scaleProperty": "uv.scale", + "scaleXProperty": "uv.tileU", + "scaleYProperty": "uv.tileV", + "translateXProperty": "uv.offsetU", + "translateYProperty": "uv.offsetV", + "rotateDegreesProperty": "uv.rotateDegrees", + "float3x3ShaderInput": "m_uvMatrix", + "float3x3InverseShaderInput": "m_uvMatrixInverse" + } + }, + { + // Convert emissive unit. + "type": "ConvertEmissiveUnit", + "args": { + "intensityProperty": "emissive.intensity", + "lightUnitProperty": "emissive.unit", + "shaderInput": "m_emissiveIntensity", + "ev100Index": 0, + "nitIndex" : 1, + "ev100MinMax": [-10, 20], + "nitMinMax": [0.001, 100000.0] + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "baseColor.textureMap", + "useTextureProperty": "baseColor.useTexture", + "dependentProperties": ["baseColor.textureMapUv", "baseColor.textureBlendMode"], + "shaderOption": "o_baseColor_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "specularF0.textureMap", + "useTextureProperty": "specularF0.useTexture", + "dependentProperties": ["specularF0.textureMapUv"], + "shaderOption": "o_specularF0_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "normal.textureMap", + "useTextureProperty": "normal.useTexture", + "dependentProperties": ["normal.textureMapUv", "normal.factor", "normal.flipX", "normal.flipY"], + "shaderOption": "o_normal_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "occlusion.diffuseTextureMap", + "useTextureProperty": "occlusion.diffuseUseTexture", + "dependentProperties": ["occlusion.diffuseTextureMapUv", "occlusion.diffuseFactor"], + "shaderOption": "o_diffuseOcclusion_useTexture" + } + }, + { + "type": "UseTexture", + "args": { + "textureProperty": "occlusion.specularTextureMap", + "useTextureProperty": "occlusion.specularUseTexture", + "dependentProperties": ["occlusion.specularTextureMapUv", "occlusion.specularFactor"], + "shaderOption": "o_specularOcclusion_useTexture" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ClearCoatState.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ClearCoatEnableFeature.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_EmissiveState.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ParallaxState.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_Roughness.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_Metallic.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_HandleOpacityDoubleSided.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_HandleOpacityMode.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ShaderEnable.lua" + } + } + ], + "uvNameMap": { + "UV0": "Tiled", + "UV1": "Unwrapped" + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli new file mode 100644 index 0000000000..0aebc11f1d --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli @@ -0,0 +1,95 @@ +/* + * 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 +#include +#include +#include + +#include "MaterialInputs/BaseColorInput.azsli" +#include "MaterialInputs/RoughnessInput.azsli" +#include "MaterialInputs/MetallicInput.azsli" +#include "MaterialInputs/SpecularInput.azsli" +#include "MaterialInputs/NormalInput.azsli" +#include "MaterialInputs/ClearCoatInput.azsli" +#include "MaterialInputs/OcclusionInput.azsli" +#include "MaterialInputs/EmissiveInput.azsli" +#include "MaterialInputs/ParallaxInput.azsli" +#include "MaterialInputs/UvSetCount.azsli" + +ShaderResourceGroup MaterialSrg : SRG_PerMaterial +{ + // Auto-generate material SRG fields for common inputs + COMMON_SRG_INPUTS_BASE_COLOR() + COMMON_SRG_INPUTS_ROUGHNESS() + COMMON_SRG_INPUTS_METALLIC() + COMMON_SRG_INPUTS_SPECULAR_F0() + COMMON_SRG_INPUTS_NORMAL() + COMMON_SRG_INPUTS_CLEAR_COAT() + COMMON_SRG_INPUTS_OCCLUSION() + COMMON_SRG_INPUTS_EMISSIVE() + COMMON_SRG_INPUTS_PARALLAX() + + uint m_parallaxUvIndex; + + float3x3 m_uvMatrix; + float4 m_pad1; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. + float3x3 m_uvMatrixInverse; + float4 m_pad2; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. + + float m_opacityFactor; + float m_opacityAffectsSpecularFactor; + Texture2D m_opacityMap; + uint m_opacityMapUvIndex; + + Sampler m_sampler + { + AddressU = Wrap; + AddressV = Wrap; + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Linear; + MaxAnisotropy = 16; + }; + + Texture2D m_brdfMap; + + Sampler m_samplerBrdf + { + AddressU = Clamp; + AddressV = Clamp; + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Linear; + }; +} + +// Callback function for ParallaxMapping.azsli +DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) +{ + return SampleDepthFromHeightmap(MaterialSrg::m_heightmap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); +} + + +COMMON_OPTIONS_PARALLAX() + +bool ShouldHandleParallax() +{ + // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scattering is enabled. + return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useHeightmap; +} + +bool ShouldHandleParallaxInDepthShaders() +{ + // The depth pass shaders need to calculate parallax when the result could affect the depth buffer, or when + // parallax could affect texel clipping. + return ShouldHandleParallax() && (o_parallax_enablePixelDepthOffset || o_opacity_mode == OpacityMode::Cutout); +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl new file mode 100644 index 0000000000..1d5e4ad9e3 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -0,0 +1,362 @@ +/* + * 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 "Atom/Features/ShaderQualityOptions.azsli" + +#include "StandardPBR_Common.azsli" + +// SRGs +#include +#include + +// Pass Output +#include + +// Utility +#include +#include + +// Custom Surface & Lighting +#include + +// Decals +#include + + +// ---------- Material Parameters ---------- + +COMMON_OPTIONS_BASE_COLOR() +COMMON_OPTIONS_ROUGHNESS() +COMMON_OPTIONS_METALLIC() +COMMON_OPTIONS_SPECULAR_F0() +COMMON_OPTIONS_NORMAL() +COMMON_OPTIONS_CLEAR_COAT() +COMMON_OPTIONS_OCCLUSION() +COMMON_OPTIONS_EMISSIVE() +// Note COMMON_OPTIONS_PARALLAX is in StandardPBR_Common.azsli because it's needed by all StandardPBR shaders. + +// Alpha +#include "MaterialInputs/AlphaInput.azsli" + +// ---------- Vertex Shader ---------- + +struct VSInput +{ + // Base fields (required by the template azsli file)... + float3 m_position : POSITION; + float3 m_normal : NORMAL; + float4 m_tangent : TANGENT; + float3 m_bitangent : BITANGENT; + + // Extended fields (only referenced in this azsl file)... + float2 m_uv0 : UV0; + float2 m_uv1 : UV1; +}; + +struct VSOutput +{ + // Base fields (required by the template azsli file)... + // "centroid" is needed for SV_Depth to compile + linear centroid float4 m_position : SV_Position; + float3 m_normal: NORMAL; + float3 m_tangent : TANGENT; + float3 m_bitangent : BITANGENT; + float3 m_worldPosition : UV0; + float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV3; + + // Extended fields (only referenced in this azsl file)... + float2 m_uv[UvSetCount] : UV1; +}; + +#include + +VSOutput StandardPbr_ForwardPassVS(VSInput IN) +{ + VSOutput OUT; + + float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz; + + // By design, only UV0 is allowed to apply transforms. + OUT.m_uv[0] = mul(MaterialSrg::m_uvMatrix, float3(IN.m_uv0, 1.0)).xy; + OUT.m_uv[1] = IN.m_uv1; + + // Shadow coords will be calculated in the pixel shader in this case + bool skipShadowCoords = ShouldHandleParallax() && o_parallax_enablePixelDepthOffset; + + VertexHelper(IN, OUT, worldPosition, skipShadowCoords); + + return OUT; +} + + +// ---------- Pixel Shader ---------- + +PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float depthNDC) +{ + const float3 vertexNormal = normalize(IN.m_normal); + + // ------- Tangents & Bitangets ------- + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + + if (ShouldHandleParallax() || o_normal_useTexture || (o_clearCoat_enabled && o_clearCoat_normal_useTexture)) + { + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); + } + + // ------- Depth & Parallax ------- + + depthNDC = IN.m_position.z; + + bool displacementIsClipped = false; + + if(ShouldHandleParallax()) + { + + float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); + float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, + ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, + IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, depthNDC, IN.m_position.w, displacementIsClipped); + + // Adjust directional light shadow coordinates for parallax correction + if(o_parallax_enablePixelDepthOffset) + { + const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; + if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) + { + DirectionalLightShadow::GetShadowCoords(shadowIndex, IN.m_worldPosition, vertexNormal, IN.m_shadowCoords); + } + } + } + + Surface surface; + surface.position = IN.m_worldPosition.xyz; + + // ------- Alpha & Clip ------- + + float2 baseColorUv = IN.m_uv[MaterialSrg::m_baseColorMapUvIndex]; + float2 opacityUv = IN.m_uv[MaterialSrg::m_opacityMapUvIndex]; + float alpha = GetAlphaInputAndClip(MaterialSrg::m_baseColorMap, MaterialSrg::m_opacityMap, baseColorUv, opacityUv, MaterialSrg::m_sampler, MaterialSrg::m_opacityFactor, o_opacity_source); + + // ------- Normal ------- + + float2 normalUv = IN.m_uv[MaterialSrg::m_normalMapUvIndex]; + float3x3 uvMatrix = MaterialSrg::m_normalMapUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); // By design, only UV0 is allowed to apply transforms. + surface.vertexNormal = vertexNormal; + surface.normal = GetNormalInputWS(MaterialSrg::m_normalMap, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, isFrontFace, IN.m_normal, + tangents[MaterialSrg::m_normalMapUvIndex], bitangents[MaterialSrg::m_normalMapUvIndex], uvMatrix, o_normal_useTexture, MaterialSrg::m_normalFactor); + + // ------- Base Color ------- + + float3 sampledColor = GetBaseColorInput(MaterialSrg::m_baseColorMap, MaterialSrg::m_sampler, baseColorUv, MaterialSrg::m_baseColor.rgb, o_baseColor_useTexture); + float3 baseColor = BlendBaseColor(sampledColor, MaterialSrg::m_baseColor.rgb, MaterialSrg::m_baseColorFactor, o_baseColorTextureBlendMode, o_baseColor_useTexture); + + if(o_parallax_highlightClipping && displacementIsClipped) + { + ApplyParallaxClippingHighlight(baseColor); + } + + // ------- Metallic ------- + + float2 metallicUv = IN.m_uv[MaterialSrg::m_metallicMapUvIndex]; + float metallic = GetMetallicInput(MaterialSrg::m_metallicMap, MaterialSrg::m_sampler, metallicUv, MaterialSrg::m_metallicFactor, o_metallic_useTexture); + + // ------- Specular ------- + + float2 specularUv = IN.m_uv[MaterialSrg::m_specularF0MapUvIndex]; + float specularF0Factor = GetSpecularInput(MaterialSrg::m_specularF0Map, MaterialSrg::m_sampler, specularUv, MaterialSrg::m_specularF0Factor, o_specularF0_useTexture); + + surface.SetAlbedoAndSpecularF0(baseColor, specularF0Factor, metallic); + + // ------- Roughness ------- + + float2 roughnessUv = IN.m_uv[MaterialSrg::m_roughnessMapUvIndex]; + surface.roughnessLinear = GetRoughnessInput(MaterialSrg::m_roughnessMap, MaterialSrg::m_sampler, roughnessUv, MaterialSrg::m_roughnessFactor, + MaterialSrg::m_roughnessLowerBound, MaterialSrg::m_roughnessUpperBound, o_roughness_useTexture); + surface.CalculateRoughnessA(); + + // ------- Lighting Data ------- + + LightingData lightingData; + + // Light iterator + lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); + lightingData.Init(surface.position, surface.normal, surface.roughnessLinear); + + // Directional light shadow coordinates + lightingData.shadowCoords = IN.m_shadowCoords; + + // ------- Emissive ------- + + float2 emissiveUv = IN.m_uv[MaterialSrg::m_emissiveMapUvIndex]; + lightingData.emissiveLighting = GetEmissiveInput(MaterialSrg::m_emissiveMap, MaterialSrg::m_sampler, emissiveUv, MaterialSrg::m_emissiveIntensity, MaterialSrg::m_emissiveColor.rgb, o_emissiveEnabled, o_emissive_useTexture); + + // ------- Occlusion ------- + + lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); + lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); + + // ------- Clearcoat ------- + + // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags + if(o_clearCoat_feature_enabled) + { + if(o_clearCoat_enabled) + { + float3x3 uvMatrix = MaterialSrg::m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); + GetClearCoatInputs(MaterialSrg::m_clearCoatInfluenceMap, IN.m_uv[MaterialSrg::m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_clearCoatFactor, o_clearCoat_factor_useTexture, + MaterialSrg::m_clearCoatRoughnessMap, IN.m_uv[MaterialSrg::m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_clearCoatRoughness, o_clearCoat_roughness_useTexture, + MaterialSrg::m_clearCoatNormalMap, IN.m_uv[MaterialSrg::m_clearCoatNormalMapUvIndex], IN.m_normal, o_clearCoat_normal_useTexture, MaterialSrg::m_clearCoatNormalStrength, + uvMatrix, tangents[MaterialSrg::m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_clearCoatNormalMapUvIndex], + MaterialSrg::m_sampler, isFrontFace, + surface.clearCoat.factor, surface.clearCoat.roughness, surface.clearCoat.normal); + } + + // manipulate base layer f0 if clear coat is enabled + // modify base layer's normal incidence reflectance + // for the derivation of the following equation please refer to: + // https://google.github.io/filament/Filament.md.html#materialsystem/clearcoatmodel/baselayermodification + float3 f0 = (1.0 - 5.0 * sqrt(surface.specularF0)) / (5.0 - sqrt(surface.specularF0)); + surface.specularF0 = lerp(surface.specularF0, f0 * f0, surface.clearCoat.factor); + } + + // Diffuse and Specular response (used in IBL calculations) + lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); + lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; + + if(o_clearCoat_feature_enabled) + { + // Clear coat layer has fixed IOR = 1.5 and transparent => F0 = (1.5 - 1)^2 / (1.5 + 1)^2 = 0.04 + lightingData.diffuseResponse *= 1.0 - (FresnelSchlickWithRoughness(lightingData.NdotV, float3(0.04, 0.04, 0.04), surface.clearCoat.roughness) * surface.clearCoat.factor); + } + + // ------- Multiscatter ------- + + lightingData.CalculateMultiscatterCompensation(surface.specularF0, o_specularF0_enableMultiScatterCompensation); + + // ------- Lighting Calculation ------- + + // Apply Decals + ApplyDecals(lightingData.tileIterator, surface); + + // Apply Direct Lighting + ApplyDirectLighting(surface, lightingData); + + // Apply Image Based Lighting (IBL) + ApplyIBL(surface, lightingData); + + // Finalize Lighting + lightingData.FinalizeLighting(); + + PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); + + // ------- Opacity ------- + + if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) + { + // Increase opacity at grazing angles for surfaces with a low m_opacityAffectsSpecularFactor. + // For m_opacityAffectsSpecularFactor values close to 0, that indicates a transparent surface + // like glass, so it becomes less transparent at grazing angles. For m_opacityAffectsSpecularFactor + // values close to 1.0, that indicates the absence of a surface entirely, so this effect should + // not apply. + float fresnelAlpha = FresnelSchlickWithRoughness(lightingData.NdotV, alpha, surface.roughnessLinear).x; + alpha = lerp(fresnelAlpha, alpha, MaterialSrg::m_opacityAffectsSpecularFactor); + } + + if (o_opacity_mode == OpacityMode::Blended) + { + // [GFX_TODO ATOM-13187] PbrLighting shouldn't be writing directly to render targets. It's confusing when + // specular is being added to diffuse just because we're calling render target 0 "diffuse". + + // For blended mode, we do (dest * alpha) + (source * 1.0). This allows the specular + // to be added on top of the diffuse, but then the diffuse must be pre-multiplied. + // It's done this way because surface transparency doesn't really change specular response (eg, glass). + + lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse + + // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. + float3 specular = lightingOutput.m_specularColor.rgb; + specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); + lightingOutput.m_diffuseColor.rgb += specular; + + lightingOutput.m_diffuseColor.w = alpha; + } + else if (o_opacity_mode == OpacityMode::TintedTransparent) + { + // See OpacityMode::Blended above for the basic method. TintedTransparent adds onto the above concept by supporting + // colored alpha. This is currently a very basic calculation that uses the baseColor as a multiplier with strength + // determined by the alpha. We'll modify this later to be more physically accurate and allow surface depth, + // absorption, and interior color to be specified. + // + // The technique uses dual source blending to allow two separate sources to be part of the blending equation + // even though ultimately only a single render target is being written to. m_diffuseColor is render target 0 and + // m_specularColor render target 1, and the blend mode is (dest * source1color) + (source * 1.0). + // + // This means that m_specularColor.rgb (source 1) is multiplied against the destination, then + // m_diffuseColor.rgb (source) is added to that, and the final result is stored in render target 0. + + lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse + + // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. + float3 specular = lightingOutput.m_specularColor.rgb; + specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); + lightingOutput.m_diffuseColor.rgb += specular; + + lightingOutput.m_specularColor.rgb = baseColor * (1.0 - alpha); + } + else + { + lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering + } + + return lightingOutput; +} + +ForwardPassOutputWithDepth StandardPbr_ForwardPassPS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) +{ + ForwardPassOutputWithDepth OUT; + float depth; + + PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); + +#ifdef UNIFIED_FORWARD_OUTPUT + OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; + OUT.m_color.a = lightingOutput.m_diffuseColor.a; + OUT.m_depth = depth; +#else + OUT.m_diffuseColor = lightingOutput.m_diffuseColor; + OUT.m_specularColor = lightingOutput.m_specularColor; + OUT.m_specularF0 = lightingOutput.m_specularF0; + OUT.m_albedo = lightingOutput.m_albedo; + OUT.m_normal = lightingOutput.m_normal; + OUT.m_depth = depth; +#endif + return OUT; +} + +[earlydepthstencil] +ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) +{ + ForwardPassOutput OUT; + float depth; + + PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); + +#ifdef UNIFIED_FORWARD_OUTPUT + OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; + OUT.m_color.a = lightingOutput.m_diffuseColor.a; +#else + OUT.m_diffuseColor = lightingOutput.m_diffuseColor; + OUT.m_specularColor = lightingOutput.m_specularColor; + OUT.m_specularF0 = lightingOutput.m_specularF0; + OUT.m_albedo = lightingOutput.m_albedo; + OUT.m_normal = lightingOutput.m_normal; +#endif + return OUT; +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader new file mode 100644 index 0000000000..d8df49f4b0 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader @@ -0,0 +1,54 @@ +{ + "Source" : "./StandardPBR_ForwardPass.azsl", + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : true, + "CompareFunc" : "GreaterEqual" + }, + "Stencil" : + { + "Enable" : true, + "ReadMask" : "0x00", + "WriteMask" : "0xFF", + "FrontFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + }, + "BackFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + } + } + }, + + + "CompilerHints" : { + "DisableOptimizations" : false + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "StandardPbr_ForwardPassVS", + "type": "Vertex" + }, + { + "name": "StandardPbr_ForwardPassPS", + "type": "Fragment" + } + ] + }, + + "DrawList" : "forward" +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist new file mode 100644 index 0000000000..39f101aca9 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist @@ -0,0 +1,29 @@ +{ + "Shader" : "StandardPBR_ForwardPass.shader", + "Variants": [ + { + "StableId": 1, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::None" + } + }, + { + "StableId": 2, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::Pcf" + } + }, + { + "StableId": 3, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::Esm" + } + }, + { + "StableId": 4, + "Options": { + "o_directional_shadow_filtering_method": "ShadowFilterMethod::EsmPcf" + } + } + ] +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl new file mode 100644 index 0000000000..02e9e93ba2 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl @@ -0,0 +1,13 @@ +/* + * 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 + * + */ + +// NOTE: This file is a temporary workaround until .shader files can #define macros for their .azsl files + +#define QUALITY_LOW_END 1 + +#include "StandardPBR_ForwardPass.azsl" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader new file mode 100644 index 0000000000..44139608ca --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader @@ -0,0 +1,59 @@ +{ + // Note: "LowEnd" shaders are for supporting the low end pipeline + // These shaders can be safely added to materials without incurring additional runtime draw + // items as draw items for shaders are only created if the scene has a pass with a matching + // DrawListTag. If your pipeline doesn't have a "lowEndForward" DrawListTag, no draw items + // for this shader will be created. + + "Source" : "./StandardPBR_LowEndForward.azsl", + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : true, + "CompareFunc" : "GreaterEqual" + }, + "Stencil" : + { + "Enable" : true, + "ReadMask" : "0x00", + "WriteMask" : "0xFF", + "FrontFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + }, + "BackFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + } + } + }, + + "CompilerHints" : { + "DisableOptimizations" : false + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "StandardPbr_ForwardPassVS", + "type": "Vertex" + }, + { + "name": "StandardPbr_ForwardPassPS", + "type": "Fragment" + } + ] + }, + + "DrawList" : "lowEndForward" +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua new file mode 100644 index 0000000000..7e19641c6b --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua @@ -0,0 +1,82 @@ +-------------------------------------------------------------------------------------- +-- +-- 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 +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +function GetMaterialPropertyDependencies() + return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"} +end + +OpacityMode_Opaque = 0 +OpacityMode_Cutout = 1 +OpacityMode_Blended = 2 +OpacityMode_TintedTransparent = 3 + +function TryGetShaderByTag(context, shaderTag) + if context:HasShaderWithTag(shaderTag) then + return context:GetShaderByTag(shaderTag) + else + return nil + end +end + +function TrySetShaderEnabled(shader, enabled) + if shader then + shader:SetEnabled(enabled) + end +end + +function Process(context) + local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode") + local displacementMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") + local useDisplacementMap = context:GetMaterialPropertyValue_bool("parallax.useTexture") + local parallaxEnabled = displacementMap ~= nil and useDisplacementMap + local parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo") + + local depthPass = context:GetShaderByTag("DepthPass") + local shadowMap = context:GetShaderByTag("Shadowmap") + local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") + + local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS") + local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS") + local forwardPass = context:GetShaderByTag("ForwardPass") + + -- Use TryGetShaderByTag because these shaders only exist in StandardPBR but this script is also used for EnhancedPBR + local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") + local lowEndForward = TryGetShaderByTag(context, "LowEndForward") + + if parallaxEnabled and parallaxPdoEnabled then + depthPass:SetEnabled(false) + shadowMap:SetEnabled(false) + forwardPassEDS:SetEnabled(false) + + depthPassWithPS:SetEnabled(true) + shadowMapWithPS:SetEnabled(true) + forwardPass:SetEnabled(true) + + TrySetShaderEnabled(lowEndForwardEDS, false) + TrySetShaderEnabled(lowEndForward, true) + else + depthPass:SetEnabled(opacityMode == OpacityMode_Opaque) + shadowMap:SetEnabled(opacityMode == OpacityMode_Opaque) + forwardPassEDS:SetEnabled((opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + + depthPassWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) + shadowMapWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) + forwardPass:SetEnabled(opacityMode == OpacityMode_Cutout) + + -- Only enable lowEndForwardEDS in Opaque mode, Transparent mode will be handled by forwardPassEDS. The transparent pass uses the "transparent" draw tag + -- for both standard and low end pipelines, so this keeps both shaders from rendering to the transparent draw list. + TrySetShaderEnabled(lowEndForwardEDS, opacityMode == OpacityMode_Opaque) + TrySetShaderEnabled(lowEndForward, opacityMode == OpacityMode_Cutout) + end + + context:GetShaderByTag("DepthPassTransparentMin"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + context:GetShaderByTag("DepthPassTransparentMax"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) +end diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index c4d198fef9..f595202218 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -10,6 +10,13 @@ set(FILES Materials/Special/ShadowCatcher.azsl Materials/Special/ShadowCatcher.materialtype Materials/Special/ShadowCatcher.shader + Materials/Types/BasePBR.materialtype + Materials/Types/BasePBR_Common.azsli + Materials/Types/BasePBR_ForwardPass.azsl + Materials/Types/BasePBR_ForwardPass.shader + Materials/Types/BasePBR_LowEndForward.azsl + Materials/Types/BasePBR_LowEndForward.shader + Materials/Types/BasePBR_ShaderEnable.lua Materials/Types/EnhancedPBR.materialtype Materials/Types/EnhancedPBR_Common.azsli Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl @@ -53,6 +60,7 @@ set(FILES Materials/Types/StandardPBR_LowEndForward.azsl Materials/Types/StandardPBR_LowEndForward.shader Materials/Types/StandardPBR_LowEndForward_EDS.shader + Materials/Types/StandardPBR_Metallic.lua Materials/Types/StandardPBR_ParallaxState.lua Materials/Types/StandardPBR_Roughness.lua Materials/Types/StandardPBR_ShaderEnable.lua @@ -129,6 +137,7 @@ set(FILES Passes/DownsampleMipChain.pass Passes/EnvironmentCubeMapDepthMSAA.pass Passes/EnvironmentCubeMapForwardMSAA.pass + Passes/EnvironmentCubeMapForwardSubsurfaceMSAA.pass Passes/EnvironmentCubeMapPipeline.pass Passes/EnvironmentCubeMapSkyBox.pass Passes/EsmShadowmaps.pass @@ -303,6 +312,7 @@ set(FILES ShaderLib/Atom/Features/ScreenSpace/ScreenSpaceUtil.azsli ShaderLib/Atom/Features/Shadow/BicubicPcfFilters.azsli ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli + ShaderLib/Atom/Features/Shadow/ESM.azsli ShaderLib/Atom/Features/Shadow/NormalOffsetShadows.azsli ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli ShaderLib/Atom/Features/Shadow/ReceiverPlaneDepthBias.azsli From 8fa99c47dbd573cd192065bd7682b92ebf90daa4 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Mon, 13 Dec 2021 12:51:34 -0800 Subject: [PATCH 024/394] Work in progress, current shader compilation error Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Presets/PBR/metal_gold.material | 2 +- .../Presets/PBR/metal_gold_matte.material | 2 +- .../Presets/PBR/metal_gold_polished.material | 2 +- .../Materials/Types/BasePBR.materialtype | 593 +----------------- .../Materials/Types/BasePBR_Common.azsli | 36 -- .../Materials/Types/BasePBR_ForwardPass.azsl | 192 +----- .../Types/BasePBR_ForwardPass.shader | 7 +- .../BasePBR_ForwardPass.shadervariantlist | 2 +- .../Types/BasePBR_LowEndForward.azsl | 2 +- .../Types/BasePBR_LowEndForward.shader | 6 +- .../Materials/Types/BasePBR_ShaderEnable.lua | 52 +- .../Atom/Features/LightCulling/NVLC.azsli | 4 +- 12 files changed, 40 insertions(+), 860 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material index 2638e76a74..f0fd265726 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material @@ -1,6 +1,6 @@ { "description": "", - "materialType": "Materials\\Types\\StandardPBR.materialtype", + "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material index fd21141048..53ba190084 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material @@ -1,6 +1,6 @@ { "description": "", - "materialType": "Materials\\Types\\StandardPBR.materialtype", + "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material index 5861c7b533..d200bddbc5 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material @@ -1,6 +1,6 @@ { "description": "", - "materialType": "Materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/Temp/BasePBR.materialtype", "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype index f324394309..d4c79a05ef 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype @@ -1,14 +1,6 @@ { - "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", - "version": 4, - "versionUpdates": [ - { - "toVersion": 4, - "actions": [ - {"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"} - ] - } - ], + "description": "Material Type with properties used to define Base PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", + "version": 0, "propertyLayout": { "groups": [ { @@ -36,38 +28,13 @@ "displayName": "Normal", "description": "Properties related to configuring surface normal." }, - { - "name": "occlusion", - "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." - }, - { - "name": "emissive", - "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." - }, - { - "name": "clearCoat", - "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, - { - "name": "parallax", - "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." - }, - { - "name": "opacity", - "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." - }, { "name": "uv", "displayName": "UVs", "description": "Properties for configuring UV transforms." }, { - // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader + // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the BasePBR shader "name": "irradiance", "displayName": "Irradiance", "description": "Properties for configuring the irradiance used in global illumination." @@ -403,141 +370,6 @@ } } ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], "normal": [ { "name": "textureMap", @@ -604,80 +436,6 @@ } } ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], "uv": [ { "name": "center", @@ -740,263 +498,6 @@ "step": 0.1 } ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], "irradiance": [ // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader { @@ -1020,50 +521,25 @@ }, "shaders": [ { - "file": "./StandardPBR_ForwardPass.shader", - "tag": "ForwardPass" - }, - { - "file": "./StandardPBR_ForwardPass_EDS.shader", + "file": "./BasePBR_ForwardPass.shader", "tag": "ForwardPass_EDS" }, { - "file": "./StandardPBR_LowEndForward.shader", - "tag": "LowEndForward" - }, - { - "file": "./StandardPBR_LowEndForward_EDS.shader", + "file": "./BasePBR_LowEndForward.shader", "tag": "LowEndForward_EDS" }, { "file": "Shaders/Shadow/Shadowmap.shader", "tag": "Shadowmap" }, - { - "file": "./StandardPBR_Shadowmap_WithPS.shader", - "tag": "Shadowmap_WithPS" - }, { "file": "Shaders/Depth/DepthPass.shader", "tag": "DepthPass" }, - { - "file": "./StandardPBR_DepthPass_WithPS.shader", - "tag": "DepthPass_WithPS" - }, { "file": "Shaders/MotionVector/MeshMotionVector.shader", "tag": "MeshMotionVector" - }, - // Used by the light culling system to produce accurate depth bounds for this object when it uses blended transparency - { - "file": "Shaders/Depth/DepthPassTransparentMin.shader", - "tag": "DepthPassTransparentMin" - }, - { - "file": "Shaders/Depth/DepthPassTransparentMax.shader", - "tag": "DepthPassTransparentMax" - } + } ], "functors": [ { @@ -1082,19 +558,6 @@ "float3x3InverseShaderInput": "m_uvMatrixInverse" } }, - { - // Convert emissive unit. - "type": "ConvertEmissiveUnit", - "args": { - "intensityProperty": "emissive.intensity", - "lightUnitProperty": "emissive.unit", - "shaderInput": "m_emissiveIntensity", - "ev100Index": 0, - "nitIndex" : 1, - "ev100MinMax": [-10, 20], - "nitMinMax": [0.001, 100000.0] - } - }, { "type": "UseTexture", "args": { @@ -1122,48 +585,6 @@ "shaderOption": "o_normal_useTexture" } }, - { - "type": "UseTexture", - "args": { - "textureProperty": "occlusion.diffuseTextureMap", - "useTextureProperty": "occlusion.diffuseUseTexture", - "dependentProperties": ["occlusion.diffuseTextureMapUv", "occlusion.diffuseFactor"], - "shaderOption": "o_diffuseOcclusion_useTexture" - } - }, - { - "type": "UseTexture", - "args": { - "textureProperty": "occlusion.specularTextureMap", - "useTextureProperty": "occlusion.specularUseTexture", - "dependentProperties": ["occlusion.specularTextureMapUv", "occlusion.specularFactor"], - "shaderOption": "o_specularOcclusion_useTexture" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_ClearCoatState.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_ClearCoatEnableFeature.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_EmissiveState.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_ParallaxState.lua" - } - }, { "type": "Lua", "args": { @@ -1191,7 +612,7 @@ { "type": "Lua", "args": { - "file": "StandardPBR_ShaderEnable.lua" + "file": "BasePBR_ShaderEnable.lua" } } ], diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli index 0aebc11f1d..dbec7458fc 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_Common.azsli @@ -19,10 +19,6 @@ #include "MaterialInputs/MetallicInput.azsli" #include "MaterialInputs/SpecularInput.azsli" #include "MaterialInputs/NormalInput.azsli" -#include "MaterialInputs/ClearCoatInput.azsli" -#include "MaterialInputs/OcclusionInput.azsli" -#include "MaterialInputs/EmissiveInput.azsli" -#include "MaterialInputs/ParallaxInput.azsli" #include "MaterialInputs/UvSetCount.azsli" ShaderResourceGroup MaterialSrg : SRG_PerMaterial @@ -33,23 +29,13 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial COMMON_SRG_INPUTS_METALLIC() COMMON_SRG_INPUTS_SPECULAR_F0() COMMON_SRG_INPUTS_NORMAL() - COMMON_SRG_INPUTS_CLEAR_COAT() - COMMON_SRG_INPUTS_OCCLUSION() - COMMON_SRG_INPUTS_EMISSIVE() - COMMON_SRG_INPUTS_PARALLAX() - uint m_parallaxUvIndex; float3x3 m_uvMatrix; float4 m_pad1; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. float3x3 m_uvMatrixInverse; float4 m_pad2; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. - float m_opacityFactor; - float m_opacityAffectsSpecularFactor; - Texture2D m_opacityMap; - uint m_opacityMapUvIndex; - Sampler m_sampler { AddressU = Wrap; @@ -71,25 +57,3 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial MipFilter = Linear; }; } - -// Callback function for ParallaxMapping.azsli -DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) -{ - return SampleDepthFromHeightmap(MaterialSrg::m_heightmap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); -} - - -COMMON_OPTIONS_PARALLAX() - -bool ShouldHandleParallax() -{ - // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scattering is enabled. - return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useHeightmap; -} - -bool ShouldHandleParallaxInDepthShaders() -{ - // The depth pass shaders need to calculate parallax when the result could affect the depth buffer, or when - // parallax could affect texel clipping. - return ShouldHandleParallax() && (o_parallax_enablePixelDepthOffset || o_opacity_mode == OpacityMode::Cutout); -} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 1d5e4ad9e3..1a4b386ef1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -8,7 +8,7 @@ #include "Atom/Features/ShaderQualityOptions.azsli" -#include "StandardPBR_Common.azsli" +#include "BasePBR_Common.azsli" // SRGs #include @@ -19,7 +19,6 @@ // Utility #include -#include // Custom Surface & Lighting #include @@ -35,13 +34,6 @@ COMMON_OPTIONS_ROUGHNESS() COMMON_OPTIONS_METALLIC() COMMON_OPTIONS_SPECULAR_F0() COMMON_OPTIONS_NORMAL() -COMMON_OPTIONS_CLEAR_COAT() -COMMON_OPTIONS_OCCLUSION() -COMMON_OPTIONS_EMISSIVE() -// Note COMMON_OPTIONS_PARALLAX is in StandardPBR_Common.azsli because it's needed by all StandardPBR shaders. - -// Alpha -#include "MaterialInputs/AlphaInput.azsli" // ---------- Vertex Shader ---------- @@ -75,9 +67,9 @@ struct VSOutput #include -VSOutput StandardPbr_ForwardPassVS(VSInput IN) +VSOutput BasePbr_ForwardPassVS(VSInput IN) { - VSOutput OUT; + VSOutput OUT = (VSOutput)0; float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz; @@ -85,8 +77,8 @@ VSOutput StandardPbr_ForwardPassVS(VSInput IN) OUT.m_uv[0] = mul(MaterialSrg::m_uvMatrix, float3(IN.m_uv0, 1.0)).xy; OUT.m_uv[1] = IN.m_uv1; - // Shadow coords will be calculated in the pixel shader in this case - bool skipShadowCoords = ShouldHandleParallax() && o_parallax_enablePixelDepthOffset; + // No parallax in BaseBPR, so do shadow coordinate calculations in vertex shader + bool skipShadowCoords = false; VertexHelper(IN, OUT, worldPosition, skipShadowCoords); @@ -96,7 +88,7 @@ VSOutput StandardPbr_ForwardPassVS(VSInput IN) // ---------- Pixel Shader ---------- -PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float depthNDC) +PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) { const float3 vertexNormal = normalize(IN.m_normal); @@ -104,46 +96,14 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; - if (ShouldHandleParallax() || o_normal_useTexture || (o_clearCoat_enabled && o_clearCoat_normal_useTexture)) + if (o_normal_useTexture) { PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } - - // ------- Depth & Parallax ------- - - depthNDC = IN.m_position.z; - bool displacementIsClipped = false; - - if(ShouldHandleParallax()) - { - - float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); - float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, - ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, - IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, depthNDC, IN.m_position.w, displacementIsClipped); - - // Adjust directional light shadow coordinates for parallax correction - if(o_parallax_enablePixelDepthOffset) - { - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - { - DirectionalLightShadow::GetShadowCoords(shadowIndex, IN.m_worldPosition, vertexNormal, IN.m_shadowCoords); - } - } - } - - Surface surface; + Surface surface = (Surface)0; surface.position = IN.m_worldPosition.xyz; - // ------- Alpha & Clip ------- - - float2 baseColorUv = IN.m_uv[MaterialSrg::m_baseColorMapUvIndex]; - float2 opacityUv = IN.m_uv[MaterialSrg::m_opacityMapUvIndex]; - float alpha = GetAlphaInputAndClip(MaterialSrg::m_baseColorMap, MaterialSrg::m_opacityMap, baseColorUv, opacityUv, MaterialSrg::m_sampler, MaterialSrg::m_opacityFactor, o_opacity_source); - // ------- Normal ------- float2 normalUv = IN.m_uv[MaterialSrg::m_normalMapUvIndex]; @@ -154,14 +114,10 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // ------- Base Color ------- + float2 baseColorUv = IN.m_uv[MaterialSrg::m_baseColorMapUvIndex]; float3 sampledColor = GetBaseColorInput(MaterialSrg::m_baseColorMap, MaterialSrg::m_sampler, baseColorUv, MaterialSrg::m_baseColor.rgb, o_baseColor_useTexture); float3 baseColor = BlendBaseColor(sampledColor, MaterialSrg::m_baseColor.rgb, MaterialSrg::m_baseColorFactor, o_baseColorTextureBlendMode, o_baseColor_useTexture); - if(o_parallax_highlightClipping && displacementIsClipped) - { - ApplyParallaxClippingHighlight(baseColor); - } - // ------- Metallic ------- float2 metallicUv = IN.m_uv[MaterialSrg::m_metallicMapUvIndex]; @@ -183,7 +139,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // ------- Lighting Data ------- - LightingData lightingData; + LightingData lightingData = (LightingData)0; // Light iterator lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); @@ -191,51 +147,11 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Directional light shadow coordinates lightingData.shadowCoords = IN.m_shadowCoords; - - // ------- Emissive ------- - - float2 emissiveUv = IN.m_uv[MaterialSrg::m_emissiveMapUvIndex]; - lightingData.emissiveLighting = GetEmissiveInput(MaterialSrg::m_emissiveMap, MaterialSrg::m_sampler, emissiveUv, MaterialSrg::m_emissiveIntensity, MaterialSrg::m_emissiveColor.rgb, o_emissiveEnabled, o_emissive_useTexture); - - // ------- Occlusion ------- - - lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); - lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); - - // ------- Clearcoat ------- - - // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags - if(o_clearCoat_feature_enabled) - { - if(o_clearCoat_enabled) - { - float3x3 uvMatrix = MaterialSrg::m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); - GetClearCoatInputs(MaterialSrg::m_clearCoatInfluenceMap, IN.m_uv[MaterialSrg::m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_clearCoatFactor, o_clearCoat_factor_useTexture, - MaterialSrg::m_clearCoatRoughnessMap, IN.m_uv[MaterialSrg::m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_clearCoatRoughness, o_clearCoat_roughness_useTexture, - MaterialSrg::m_clearCoatNormalMap, IN.m_uv[MaterialSrg::m_clearCoatNormalMapUvIndex], IN.m_normal, o_clearCoat_normal_useTexture, MaterialSrg::m_clearCoatNormalStrength, - uvMatrix, tangents[MaterialSrg::m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_clearCoatNormalMapUvIndex], - MaterialSrg::m_sampler, isFrontFace, - surface.clearCoat.factor, surface.clearCoat.roughness, surface.clearCoat.normal); - } - - // manipulate base layer f0 if clear coat is enabled - // modify base layer's normal incidence reflectance - // for the derivation of the following equation please refer to: - // https://google.github.io/filament/Filament.md.html#materialsystem/clearcoatmodel/baselayermodification - float3 f0 = (1.0 - 5.0 * sqrt(surface.specularF0)) / (5.0 - sqrt(surface.specularF0)); - surface.specularF0 = lerp(surface.specularF0, f0 * f0, surface.clearCoat.factor); - } // Diffuse and Specular response (used in IBL calculations) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; - if(o_clearCoat_feature_enabled) - { - // Clear coat layer has fixed IOR = 1.5 and transparent => F0 = (1.5 - 1)^2 / (1.5 + 1)^2 = 0.04 - lightingData.diffuseResponse *= 1.0 - (FresnelSchlickWithRoughness(lightingData.NdotV, float3(0.04, 0.04, 0.04), surface.clearCoat.roughness) * surface.clearCoat.factor); - } - // ------- Multiscatter ------- lightingData.CalculateMultiscatterCompensation(surface.specularF0, o_specularF0_enableMultiScatterCompensation); @@ -254,99 +170,21 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Finalize Lighting lightingData.FinalizeLighting(); + float alpha = 1.0f; PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); - // ------- Opacity ------- - - if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) - { - // Increase opacity at grazing angles for surfaces with a low m_opacityAffectsSpecularFactor. - // For m_opacityAffectsSpecularFactor values close to 0, that indicates a transparent surface - // like glass, so it becomes less transparent at grazing angles. For m_opacityAffectsSpecularFactor - // values close to 1.0, that indicates the absence of a surface entirely, so this effect should - // not apply. - float fresnelAlpha = FresnelSchlickWithRoughness(lightingData.NdotV, alpha, surface.roughnessLinear).x; - alpha = lerp(fresnelAlpha, alpha, MaterialSrg::m_opacityAffectsSpecularFactor); - } - - if (o_opacity_mode == OpacityMode::Blended) - { - // [GFX_TODO ATOM-13187] PbrLighting shouldn't be writing directly to render targets. It's confusing when - // specular is being added to diffuse just because we're calling render target 0 "diffuse". - - // For blended mode, we do (dest * alpha) + (source * 1.0). This allows the specular - // to be added on top of the diffuse, but then the diffuse must be pre-multiplied. - // It's done this way because surface transparency doesn't really change specular response (eg, glass). - - lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse - - // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. - float3 specular = lightingOutput.m_specularColor.rgb; - specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); - lightingOutput.m_diffuseColor.rgb += specular; - - lightingOutput.m_diffuseColor.w = alpha; - } - else if (o_opacity_mode == OpacityMode::TintedTransparent) - { - // See OpacityMode::Blended above for the basic method. TintedTransparent adds onto the above concept by supporting - // colored alpha. This is currently a very basic calculation that uses the baseColor as a multiplier with strength - // determined by the alpha. We'll modify this later to be more physically accurate and allow surface depth, - // absorption, and interior color to be specified. - // - // The technique uses dual source blending to allow two separate sources to be part of the blending equation - // even though ultimately only a single render target is being written to. m_diffuseColor is render target 0 and - // m_specularColor render target 1, and the blend mode is (dest * source1color) + (source * 1.0). - // - // This means that m_specularColor.rgb (source 1) is multiplied against the destination, then - // m_diffuseColor.rgb (source) is added to that, and the final result is stored in render target 0. - - lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse - - // Add specular. m_opacityAffectsSpecularFactor controls how much the alpha masks out specular contribution. - float3 specular = lightingOutput.m_specularColor.rgb; - specular = lerp(specular, specular * lightingOutput.m_diffuseColor.w, MaterialSrg::m_opacityAffectsSpecularFactor); - lightingOutput.m_diffuseColor.rgb += specular; - - lightingOutput.m_specularColor.rgb = baseColor * (1.0 - alpha); - } - else - { - lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering - } + lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering return lightingOutput; } -ForwardPassOutputWithDepth StandardPbr_ForwardPassPS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) -{ - ForwardPassOutputWithDepth OUT; - float depth; - - PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); - -#ifdef UNIFIED_FORWARD_OUTPUT - OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; - OUT.m_color.a = lightingOutput.m_diffuseColor.a; - OUT.m_depth = depth; -#else - OUT.m_diffuseColor = lightingOutput.m_diffuseColor; - OUT.m_specularColor = lightingOutput.m_specularColor; - OUT.m_specularF0 = lightingOutput.m_specularF0; - OUT.m_albedo = lightingOutput.m_albedo; - OUT.m_normal = lightingOutput.m_normal; - OUT.m_depth = depth; -#endif - return OUT; -} [earlydepthstencil] -ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) +ForwardPassOutput BasePbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) { ForwardPassOutput OUT; - float depth; - - PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); + PbrLightingOutput lightingOutput = (PbrLightingOutput)0; + lightingOutput = ForwardPassPS_Common(IN, isFrontFace); #ifdef UNIFIED_FORWARD_OUTPUT OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader index d8df49f4b0..377c0eae95 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shader @@ -1,5 +1,5 @@ { - "Source" : "./StandardPBR_ForwardPass.azsl", + "Source" : "./BasePBR_ForwardPass.azsl", "DepthStencilState" : { @@ -30,7 +30,6 @@ } }, - "CompilerHints" : { "DisableOptimizations" : false }, @@ -40,11 +39,11 @@ "EntryPoints": [ { - "name": "StandardPbr_ForwardPassVS", + "name": "BasePbr_ForwardPassVS", "type": "Vertex" }, { - "name": "StandardPbr_ForwardPassPS", + "name": "BasePbr_ForwardPassPS_EDS", "type": "Fragment" } ] diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist index 39f101aca9..c817c793bd 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.shadervariantlist @@ -1,5 +1,5 @@ { - "Shader" : "StandardPBR_ForwardPass.shader", + "Shader" : "BasePBR_ForwardPass.shader", "Variants": [ { "StableId": 1, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl index 02e9e93ba2..d380045d88 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.azsl @@ -10,4 +10,4 @@ #define QUALITY_LOW_END 1 -#include "StandardPBR_ForwardPass.azsl" +#include "BasePBR_ForwardPass.azsl" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader index 44139608ca..005b001063 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_LowEndForward.shader @@ -5,7 +5,7 @@ // DrawListTag. If your pipeline doesn't have a "lowEndForward" DrawListTag, no draw items // for this shader will be created. - "Source" : "./StandardPBR_LowEndForward.azsl", + "Source" : "./BasePBR_LowEndForward.azsl", "DepthStencilState" : { @@ -45,11 +45,11 @@ "EntryPoints": [ { - "name": "StandardPbr_ForwardPassVS", + "name": "BasePbr_ForwardPassVS", "type": "Vertex" }, { - "name": "StandardPbr_ForwardPassPS", + "name": "BasePbr_ForwardPassPS_EDS", "type": "Fragment" } ] diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua index 7e19641c6b..4a5fba58e8 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua @@ -9,15 +9,6 @@ -- ---------------------------------------------------------------------------------------------------- -function GetMaterialPropertyDependencies() - return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"} -end - -OpacityMode_Opaque = 0 -OpacityMode_Cutout = 1 -OpacityMode_Blended = 2 -OpacityMode_TintedTransparent = 3 - function TryGetShaderByTag(context, shaderTag) if context:HasShaderWithTag(shaderTag) then return context:GetShaderByTag(shaderTag) @@ -33,50 +24,17 @@ function TrySetShaderEnabled(shader, enabled) end function Process(context) - local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode") - local displacementMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") - local useDisplacementMap = context:GetMaterialPropertyValue_bool("parallax.useTexture") - local parallaxEnabled = displacementMap ~= nil and useDisplacementMap - local parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo") local depthPass = context:GetShaderByTag("DepthPass") local shadowMap = context:GetShaderByTag("Shadowmap") local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") - local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS") - local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS") - local forwardPass = context:GetShaderByTag("ForwardPass") - - -- Use TryGetShaderByTag because these shaders only exist in StandardPBR but this script is also used for EnhancedPBR + -- Use TryGetShaderByTag because these shaders only exist in BasePBR but this script is also used for EnhancedPBR local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") - local lowEndForward = TryGetShaderByTag(context, "LowEndForward") - - if parallaxEnabled and parallaxPdoEnabled then - depthPass:SetEnabled(false) - shadowMap:SetEnabled(false) - forwardPassEDS:SetEnabled(false) - - depthPassWithPS:SetEnabled(true) - shadowMapWithPS:SetEnabled(true) - forwardPass:SetEnabled(true) - TrySetShaderEnabled(lowEndForwardEDS, false) - TrySetShaderEnabled(lowEndForward, true) - else - depthPass:SetEnabled(opacityMode == OpacityMode_Opaque) - shadowMap:SetEnabled(opacityMode == OpacityMode_Opaque) - forwardPassEDS:SetEnabled((opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) - - depthPassWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) - shadowMapWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) - forwardPass:SetEnabled(opacityMode == OpacityMode_Cutout) + depthPass:SetEnabled(true); + shadowMap:SetEnabled(true); + forwardPassEDS:SetEnabled(true); - -- Only enable lowEndForwardEDS in Opaque mode, Transparent mode will be handled by forwardPassEDS. The transparent pass uses the "transparent" draw tag - -- for both standard and low end pipelines, so this keeps both shaders from rendering to the transparent draw list. - TrySetShaderEnabled(lowEndForwardEDS, opacityMode == OpacityMode_Opaque) - TrySetShaderEnabled(lowEndForward, opacityMode == OpacityMode_Cutout) - end - - context:GetShaderByTag("DepthPassTransparentMin"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) - context:GetShaderByTag("DepthPassTransparentMax"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + TrySetShaderEnabled(lowEndForwardEDS, true) end diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli index 60d5bf38f2..e9558b39ff 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli @@ -72,7 +72,7 @@ struct TileLightData bool Light_IsInsideBin(uint package, uint bin) { - return (package & (1 << bin)) != 0; + return (package & (1u << bin)) != 0; } uint PackLightIndexWithBinMask(uint ind, uint bins) @@ -127,7 +127,7 @@ uint NVLC_GetBin(const float viewZ, const TileLightData data) const float zFarCoordSystemAdjusted = data.zFar * RH_COORD_SYSTEM_REVERSE; float f = saturate( (abs(viewZCoordSystemAdjusted) - zNearCoordSystemAdjusted) / (zFarCoordSystemAdjusted - zNearCoordSystemAdjusted) ); - float bin = min(f, 0.999999) * float(1 << data.logMaxBins); + float bin = min(f, 0.999999) * float(1u << data.logMaxBins); return uint(bin); } From fbd7b67e1126aeca6a21bd2eb52370a995d9d069 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:57:23 -0800 Subject: [PATCH 025/394] added some explicit use of float3 Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Assets/Materials/Types/BasePBR_ForwardPass.azsl | 2 +- .../Atom/Features/PBR/Lighting/LightingData.azsli | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 1a4b386ef1..8c8c9a589d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -150,7 +150,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) // Diffuse and Specular response (used in IBL calculations) lightingData.specularResponse = FresnelSchlickWithRoughness(lightingData.NdotV, surface.specularF0, surface.roughnessLinear); - lightingData.diffuseResponse = 1.0 - lightingData.specularResponse; + lightingData.diffuseResponse = float3(1.0, 1.0, 1.0) - lightingData.specularResponse; // ------- Multiscatter ------- diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 878bed02d4..dbc348e54a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -56,10 +56,10 @@ class LightingData void LightingData::Init(float3 positionWS, float3 normal, float roughnessLinear) { - diffuseLighting = 0; - specularLighting = 0; - translucentBackLighting = 0; - multiScatterCompensation = 1.0f; + diffuseLighting = float3(0.0, 0.0, 0.0); + specularLighting = float3(0.0, 0.0, 0.0); + translucentBackLighting = float3(0.0, 0.0, 0.0); + multiScatterCompensation = float3(1.0f, 1.0f, 1.0f); emissiveLighting = float3(0.0f, 0.0f, 0.0f); diffuseAmbientOcclusion = 1.0f; specularOcclusion = 1.0f; From a436ea7f9bccd98083318da91b7f877aed117589 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 15 Dec 2021 22:30:37 -0800 Subject: [PATCH 026/394] BasePbr working Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Presets/PBR/metal_gold.material | 4 +- .../Presets/PBR/metal_gold_matte.material | 4 +- .../Presets/PBR/metal_gold_polished.material | 4 +- .../Materials/Types/BasePBR.materialtype | 18 --------- .../Materials/Types/BasePBR_ForwardPass.azsl | 13 +++--- .../Materials/Types/BasePBR_ShaderEnable.lua | 40 ------------------- .../Types/StandardPBR_ForwardPass.shader | 1 - 7 files changed, 13 insertions(+), 71 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material index f0fd265726..04aaccada4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material @@ -1,8 +1,8 @@ { "description": "", - "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", + "materialType": "Materials\\Types\\BasePBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "propertyLayoutVersion": 0, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material index 53ba190084..80ddede2ec 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material @@ -1,8 +1,8 @@ { "description": "", - "materialType": "Materials\\Types\\Temp\\BasePBR.materialtype", + "materialType": "Materials\\Types\\BasePBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "propertyLayoutVersion": 0, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material index d200bddbc5..b9f34f4717 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material @@ -1,8 +1,8 @@ { "description": "", - "materialType": "Materials/Types/Temp/BasePBR.materialtype", + "materialType": "Materials/Types/BasePBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "propertyLayoutVersion": 0, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype index d4c79a05ef..5765537120 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR.materialtype @@ -596,24 +596,6 @@ "args": { "file": "StandardPBR_Metallic.lua" } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_HandleOpacityDoubleSided.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_HandleOpacityMode.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "BasePBR_ShaderEnable.lua" - } } ], "uvNameMap": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 8c8c9a589d..30a8666183 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -69,7 +69,7 @@ struct VSOutput VSOutput BasePbr_ForwardPassVS(VSInput IN) { - VSOutput OUT = (VSOutput)0; + VSOutput OUT; float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz; @@ -101,7 +101,8 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } - Surface surface = (Surface)0; + Surface surface; + surface.clearCoat.InitializeToZero(); surface.position = IN.m_worldPosition.xyz; // ------- Normal ------- @@ -139,7 +140,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) // ------- Lighting Data ------- - LightingData lightingData = (LightingData)0; + LightingData lightingData; // Light iterator lightingData.tileIterator.Init(IN.m_position, PassSrg::m_lightListRemapped, PassSrg::m_tileLightData); @@ -173,7 +174,8 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) float alpha = 1.0f; PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); - lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering + // Disable subsurface scattering + lightingOutput.m_diffuseColor.w = -1; return lightingOutput; } @@ -183,8 +185,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) ForwardPassOutput BasePbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) { ForwardPassOutput OUT; - PbrLightingOutput lightingOutput = (PbrLightingOutput)0; - lightingOutput = ForwardPassPS_Common(IN, isFrontFace); + PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace); #ifdef UNIFIED_FORWARD_OUTPUT OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua deleted file mode 100644 index 4a5fba58e8..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ShaderEnable.lua +++ /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 --- --- --- ----------------------------------------------------------------------------------------------------- - -function TryGetShaderByTag(context, shaderTag) - if context:HasShaderWithTag(shaderTag) then - return context:GetShaderByTag(shaderTag) - else - return nil - end -end - -function TrySetShaderEnabled(shader, enabled) - if shader then - shader:SetEnabled(enabled) - end -end - -function Process(context) - - local depthPass = context:GetShaderByTag("DepthPass") - local shadowMap = context:GetShaderByTag("Shadowmap") - local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") - - -- Use TryGetShaderByTag because these shaders only exist in BasePBR but this script is also used for EnhancedPBR - local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") - - depthPass:SetEnabled(true); - shadowMap:SetEnabled(true); - forwardPassEDS:SetEnabled(true); - - TrySetShaderEnabled(lowEndForwardEDS, true) -end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader index d8df49f4b0..7c7a19efc9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader @@ -30,7 +30,6 @@ } }, - "CompilerHints" : { "DisableOptimizations" : false }, From a839a8f761869cac43faba90e42e89628ac1e34d Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 01:13:12 -0800 Subject: [PATCH 027/394] added defines in the shaders to turn off clear coat, transmission and area light types. Allows for thiner surface data and more control over features when authoring bespoke material shaders Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Materials/Types/BasePBR_ForwardPass.azsl | 3 +- .../StandardMultilayerPBR_ForwardPass.azsl | 3 +- .../Atom/Features/PBR/BackLighting.azsli | 7 +- .../Features/PBR/Lighting/BaseLighting.azsli | 83 +++++++++++++++++++ .../Features/PBR/Lighting/LightingData.azsli | 2 + .../PBR/Lighting/StandardLighting.azsli | 2 + .../Atom/Features/PBR/LightingOptions.azsli | 54 +++++++++++- .../Features/PBR/Lights/CapsuleLight.azsli | 7 ++ .../PBR/Lights/DirectionalLight.azsli | 4 + .../Atom/Features/PBR/Lights/DiskLight.azsli | 8 ++ .../Atom/Features/PBR/Lights/Ibl.azsli | 2 + .../PBR/Lights/LightTypesCommon.azsli | 3 - .../Atom/Features/PBR/Lights/Ltc.azsli | 4 + .../Atom/Features/PBR/Lights/PointLight.azsli | 8 ++ .../Features/PBR/Lights/PolygonLight.azsli | 2 + .../Atom/Features/PBR/Lights/QuadLight.azsli | 8 +- .../PBR/Surfaces/ClearCoatSurfaceData.azsli | 4 + .../PBR/Surfaces/StandardSurface.azsli | 7 +- .../Surfaces/TransmissionSurfaceData.azsli | 4 + .../Atom/Features/ShaderQualityOptions.azsli | 17 +++- .../Types/AutoBrick_ForwardPass.azsl | 5 +- .../Types/MinimalPBR_ForwardPass.azsl | 5 +- 22 files changed, 222 insertions(+), 20 deletions(-) create mode 100644 Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index 30a8666183..be0fcd7250 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -21,7 +21,7 @@ #include // Custom Surface & Lighting -#include +#include // Decals #include @@ -102,7 +102,6 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) } Surface surface; - surface.clearCoat.InitializeToZero(); surface.position = IN.m_worldPosition.xyz; // ------- Normal ------- diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl index 8f58c6dd33..bef07f0a00 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl @@ -428,7 +428,6 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float Surface surface; surface.position = IN.m_worldPosition; - surface.transmission.InitializeToZero(); // ------- Combine Normals --------- @@ -523,7 +522,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(0); + lightingData.FinalizeLighting(); const float alpha = 1.0; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli index dfd5522f5c..d33780641d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/BackLighting.azsli @@ -36,6 +36,9 @@ float ThinObjectFalloff(const float3 surfaceNormal, const float3 dirToLight) float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight, float shadowRatio) { float3 result = float3(0.0, 0.0, 0.0); + +#if ENABLE_TRANSMISSION + float thickness = 0.0; float4 transmissionParams = surface.transmission.transmissionParams; @@ -71,7 +74,9 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI break; } - + +#endif + return result; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli new file mode 100644 index 0000000000..8bd645498c --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli @@ -0,0 +1,83 @@ +/* + * 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 + +#define ENABLE_CLEAR_COAT 0 +#define ENABLE_TRANSMISSION 0 +#define ENABLE_AREA_LIGHT_VALIDATION 0 + +// Include options first +#include + +// Then include custom surface and lighting data types +#include +#include + +#include +#include + +// Then define the Diffuse and Specular lighting functions +float3 GetDiffuseLighting(Surface surface, LightingData lightingData, float3 lightIntensity, float3 dirToLight) +{ + float3 diffuse = DiffuseLambertian(surface.albedo, surface.normal, dirToLight, lightingData.diffuseResponse); + diffuse *= lightIntensity; + return diffuse; +} + +float3 GetSpecularLighting(Surface surface, LightingData lightingData, const float3 lightIntensity, const float3 dirToLight) +{ + float3 specular = SpecularGGX(lightingData.dirToCamera, dirToLight, surface.normal, surface.specularF0, lightingData.NdotV, surface.roughnessA2, lightingData.multiScatterCompensation); + specular *= lightIntensity; + return specular; +} + + +// Then include everything else +#include +#include + + +struct PbrLightingOutput +{ + float4 m_diffuseColor; + float4 m_specularColor; + float4 m_albedo; + float4 m_specularF0; + float4 m_normal; +}; + + +PbrLightingOutput GetPbrLightingOutput(Surface surface, LightingData lightingData, float alpha) +{ + PbrLightingOutput lightingOutput; + + lightingOutput.m_diffuseColor = float4(lightingData.diffuseLighting, alpha); + lightingOutput.m_specularColor = float4(lightingData.specularLighting, 1.0); + + // albedo, specularF0, roughness, and normals for later passes (specular IBL, Diffuse GI, SSR, AO, etc) + lightingOutput.m_specularF0 = float4(surface.specularF0, surface.roughnessLinear); + lightingOutput.m_albedo.rgb = surface.albedo * lightingData.diffuseResponse * lightingData.diffuseAmbientOcclusion; + lightingOutput.m_albedo.a = lightingData.specularOcclusion; + lightingOutput.m_normal.rgb = EncodeNormalSignedOctahedron(surface.normal); + lightingOutput.m_normal.a = o_specularF0_enableMultiScatterCompensation ? 1.0f : 0.0f; + + return lightingOutput; +} + +PbrLightingOutput DebugOutput(float3 color) +{ + PbrLightingOutput output = (PbrLightingOutput)0; + + float3 defaultNormal = float3(0.0f, 0.0f, 1.0f); + + output.m_diffuseColor = float4(color.rgb, 1.0f); + output.m_normal.rgb = EncodeNormalSignedOctahedron(defaultNormal); + + return output; +} diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index dbc348e54a..721c9e13cc 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -88,8 +88,10 @@ void LightingData::FinalizeLighting(float3 transmissionTint) FinalizeLighting(); // Transmitted light +#if ENABLE_TRANSMISSION if(o_transmission_mode != TransmissionMode::None) { diffuseLighting += translucentBackLighting * transmissionTint; } +#endif } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli index 773c86ff0f..ad3c9715d4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/StandardLighting.azsli @@ -8,6 +8,8 @@ #pragma once +#define ENABLE_TRANSMISSION 0 + // Include options first #include diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli index f807acc374..35d9bced0d 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli @@ -8,6 +8,50 @@ #pragma once +// --- Light Defines --- + +#ifndef ENABLE_AREA_LIGHT_VALIDATION +#define ENABLE_AREA_LIGHT_VALIDATION 1 +#endif + +#ifndef ENABLE_AREA_LIGHTS +#define ENABLE_AREA_LIGHTS 1 +#endif + +#ifndef ENABLE_SPHERE_LIGHTS +#define ENABLE_SPHERE_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_DISK_LIGHTS +#define ENABLE_DISK_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_CAPSULE_LIGHTS +#define ENABLE_CAPSULE_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_QUAD_LIGHTS +#define ENABLE_QUAD_LIGHTS ENABLE_AREA_LIGHTS +#endif + +#ifndef ENABLE_POLYGON_LTC_LIGHTS +#define ENABLE_POLYGON_LTC_LIGHTS ENABLE_AREA_LIGHTS +#endif + + +// --- Material defines --- + +#ifndef ENABLE_CLEAR_COAT +#define ENABLE_CLEAR_COAT 1 +#endif + +#ifndef ENABLE_TRANSMISSION +#define ENABLE_TRANSMISSION 1 +#endif + + +// --- Shader Options --- + option bool o_specularF0_enableMultiScatterCompensation = true; option bool o_enableShadows = true; option bool o_enableDirectionalLights = true; @@ -15,8 +59,14 @@ option bool o_enablePunctualLights = true; option bool o_enableAreaLights = true; option bool o_enableIBL = true; option bool o_enableSubsurfaceScattering = false; -option bool o_clearCoat_feature_enabled = false; -option enum class TransmissionMode {None, ThickObject, ThinObject} o_transmission_mode; option bool o_meshUseForwardPassIBLSpecular = false; option bool o_materialUseForwardPassIBLSpecular = false; +option bool o_area_light_validation = false; +#if ENABLE_CLEAR_COAT +option bool o_clearCoat_feature_enabled = false; +#endif + +#if ENABLE_TRANSMISSION +option enum class TransmissionMode {None, ThickObject, ThinObject} o_transmission_mode; +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli index e6b18df9b5..733ea2dbea 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/CapsuleLight.azsli @@ -224,14 +224,21 @@ void ApplyCapsuleLights(Surface surface, inout LightingData lightingData) uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); +#if ENABLE_CAPSULE_LIGHTS + ViewSrg::CapsuleLight light = ViewSrg::m_capsuleLights[currLightIndex]; + + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidateCapsuleLight(light, surface, lightingData); } else + #endif { ApplyCapsuleLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index 1eee53a24f..7cf10f13a3 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -27,10 +27,12 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) surface.vertexNormal, debugInfo); +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shadowCoords); } +#endif } // Add the lighting contribution for each directional light @@ -56,10 +58,12 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) currentLitRatio = (index == shadowIndex) ? litRatio : 1.; currentBackShadowRatio = 1.0 - currentLitRatio; +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { currentBackShadowRatio = (index == shadowIndex) ? backShadowRatio : 0.; } +#endif } lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, light.m_rgbIntensityLux, dirToLight) * currentLitRatio; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 63f671f021..79b377c568 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -90,12 +90,14 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // Use backShadowRatio to carry thickness from shadow map for thick mode backShadowRatio = 1.0 - litRatio; +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = ProjectedShadow::GetThickness( light.m_shadowIndex, surface.position); } +#endif } if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra @@ -209,15 +211,21 @@ void ApplyDiskLights(Surface surface, inout LightingData lightingData) uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); +#if ENABLE_DISK_LIGHTS + ViewSrg::DiskLight light = ViewSrg::m_diskLights[currLightIndex]; + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidateDiskLight(light, surface, lightingData); } else + #endif { ApplyDiskLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli index abc2d3d3bd..e813993794 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli @@ -98,6 +98,7 @@ void ApplyIBL(Surface surface, inout LightingData lightingData) float3 iblSpecular = GetIblSpecular(surface.position, surface.normal, surface.specularF0, surface.roughnessLinear, lightingData.dirToCamera, lightingData.brdf); iblSpecular *= lightingData.multiScatterCompensation; +#if ENABLE_CLEAR_COAT if (o_clearCoat_feature_enabled && surface.clearCoat.factor > 0.0f) { float clearCoatNdotV = saturate(dot(surface.clearCoat.normal, lightingData.dirToCamera)); @@ -115,6 +116,7 @@ void ApplyIBL(Surface surface, inout LightingData lightingData) float3 clearCoatResponse = FresnelSchlickWithRoughness(clearCoatNdotV, clearCoatSpecularF0, surface.clearCoat.roughness) * surface.clearCoat.factor; iblSpecular = iblSpecular * (1.0 - clearCoatResponse) * (1.0 - clearCoatResponse) + clearCoatIblSpecular; } +#endif float exposure = ObjectSrg::m_reflectionProbeData.m_useReflectionProbe ? pow(2.0, ObjectSrg::m_reflectionProbeData.m_exposure) : globalIblExposure; lightingData.specularLighting += (iblSpecular * exposure); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli index f0169e29b8..16adbba280 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/LightTypesCommon.azsli @@ -13,9 +13,6 @@ #include #include -option bool o_area_light_validation = false; - - //! Adjust the intensity of specular light based on the radius of the light source and roughness of the surface to approximate energy conservation. float GetIntensityAdjustedByRadiusAndRoughness(float roughnessA, float radius, float distance2) { diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli index 531eb6e885..0f542870a8 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ltc.azsli @@ -403,6 +403,7 @@ void LtcQuadEvaluate( float2 schlick = ltcAmpMatrix.Sample(PassSrg::LinearSampler, ltcCoords).xy; float3 specularRgb = specular * (schlick.x * surface.specularF0 + (1.0 - surface.specularF0) * schlick.y); +#if ENABLE_CLEAR_COAT if(o_clearCoat_feature_enabled) { int vertexCountCc = LtcQuadTransformAndClip(surface.clearCoat.normal, lightingData.dirToCamera, p, polygon); @@ -422,6 +423,7 @@ void LtcQuadEvaluate( specularRgb = (specularRgb * (1.0 - F)) + (clearCoatSpecular * F); } } +#endif diffuseOut = diffuse; specularOut = specularRgb; @@ -620,6 +622,7 @@ void LtcPolygonEvaluate( float2 schlick = ltcAmpMatrix.Sample(PassSrg::LinearSampler, ltcCoords).xy; float3 specularRgb = specular * ((schlick.x * surface.specularF0) + (1.0 - surface.specularF0) * schlick.y); +#if ENABLE_CLEAR_COAT if(o_clearCoat_feature_enabled) { // Rotate ltc matrix @@ -660,6 +663,7 @@ void LtcPolygonEvaluate( specularRgb = (specularRgb * (1.0 - F)) + (specularCc * F); } } +#endif diffuseOut = diffuse; specularRgbOut = specularRgb; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli index 92f4065931..883d86af48 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli @@ -99,12 +99,14 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD // Use backShadowRatio to carry thickness from shadow map for thick mode backShadowRatio = 1.0 - litRatio; +#if ENABLE_TRANSMISSION if (o_transmission_mode == TransmissionMode::ThickObject) { backShadowRatio = ProjectedShadow::GetThickness( shadowIndex, surface.position); } +#endif } // Diffuse contribution @@ -177,15 +179,21 @@ void ApplyPointLights(Surface surface, inout LightingData lightingData) uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); +#if ENABLE_SPHERE_LIGHTS + ViewSrg::PointLight light = ViewSrg::m_pointLights[currLightIndex]; + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidatePointLight(light, surface, lightingData); } else + #endif { ApplyPointLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli index 07fe6d4f00..e4e25e351b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli @@ -68,10 +68,12 @@ void ApplyPoylgonLight(ViewSrg::PolygonLight light, Surface surface, inout Light void ApplyPolygonLights(Surface surface, inout LightingData lightingData) { +#if ENABLE_POLYGON_LTC_LIGHTS for (uint currLightIndex = 0; currLightIndex < ViewSrg::m_polygonLightCount; ++currLightIndex) { ViewSrg::PolygonLight light = ViewSrg::m_polygonLights[currLightIndex]; ApplyPoylgonLight(light, surface, lightingData); } +#endif } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli index 63515339d8..a705e663c2 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli @@ -245,16 +245,22 @@ void ApplyQuadLights(Surface surface, inout LightingData lightingData) { uint currLightIndex = lightingData.tileIterator.GetValue(); lightingData.tileIterator.LoadAdvance(); - + +#if ENABLE_QUAD_LIGHTS + ViewSrg::QuadLight light = ViewSrg::m_quadLights[currLightIndex]; + #if ENABLE_AREA_LIGHT_VALIDATION if (o_area_light_validation) { ValidateQuadLight(light, surface, lightingData); } else + #endif { ApplyQuadLight(light, surface, lightingData); } + +#endif } } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli index ff8d4c0a25..6e30f55af4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/ClearCoatSurfaceData.azsli @@ -8,6 +8,8 @@ #pragma once +#if ENABLE_CLEAR_COAT + class ClearCoatSurfaceData { float factor; //!< clear coat strength factor @@ -23,3 +25,5 @@ void ClearCoatSurfaceData::InitializeToZero() roughness = 0.0f; normal = float3(0.0f, 0.0f, 0.0f); } + +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli index 084943bf38..ab43717919 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli @@ -15,8 +15,14 @@ class Surface { + +#if ENABLE_CLEAR_COAT ClearCoatSurfaceData clearCoat; +#endif + +#if ENABLE_TRANSMISSION TransmissionSurfaceData transmission; // This is not actually used for Standard PBR, but must be present for common lighting code to compile +#endif // ------- BasePbrSurfaceData ------- @@ -37,7 +43,6 @@ class Surface //! Sets albedo and specularF0 using metallic workflow void SetAlbedoAndSpecularF0(float3 baseColor, float specularF0Factor, float metallic); - }; // Specular Anti-Aliasing technique from this paper: diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli index 9b575de3ec..dda62d85e5 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/TransmissionSurfaceData.azsli @@ -8,6 +8,8 @@ #pragma once +#if ENABLE_TRANSMISSION + class TransmissionSurfaceData { float3 tint; @@ -23,3 +25,5 @@ void TransmissionSurfaceData::InitializeToZero() thickness = 0.0f; transmissionParams = float4(0.0f, 0.0f, 0.0f, 0.0f); } + +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli index 32cd30b97e..430e095bf4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli @@ -13,10 +13,23 @@ #ifdef QUALITY_LOW_END // Unifies the forward output into a single lighting buffer instead of splitting it into a GBuffer + #ifndef UNIFIED_FORWARD_OUTPUT #define UNIFIED_FORWARD_OUTPUT 1 - + #endif + // Forces IBL lighting to be executed in the forward pass instead of subsequent refleciton passes + #ifndef FORCE_IBL_IN_FORWARD_PASS #define FORCE_IBL_IN_FORWARD_PASS 1 + #endif + + // Forces removal of area light validation code + #ifndef ENABLE_AREA_LIGHT_VALIDATION + #define ENABLE_AREA_LIGHT_VALIDATION 0 + #endif + + // Uncomment to disable all area light calcuation + // #ifndef ENABLE_AREA_LIGHTS + // #define ENABLE_AREA_LIGHTS 0 + // #endif #endif - diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl index 2dbba46d8b..585c6283c2 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl @@ -179,9 +179,8 @@ ForwardPassOutput AutoBrick_ForwardPassPS(VSOutput IN) const float specularF0Factor = 0.5f; surface.SetAlbedoAndSpecularF0(baseColor, specularF0Factor, metallic); - // Clear Coat, Transmission + // Clear Coat surface.clearCoat.InitializeToZero(); - surface.transmission.InitializeToZero(); // ------- LightingData ------- @@ -213,7 +212,7 @@ ForwardPassOutput AutoBrick_ForwardPassPS(VSOutput IN) ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(surface.transmission.tint); + lightingData.FinalizeLighting(); PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl index 2f6f038e4b..b544a26366 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl @@ -71,9 +71,8 @@ ForwardPassOutput MinimalPBR_MainPassPS(VSOutput IN) const float specularF0Factor = 0.5f; surface.SetAlbedoAndSpecularF0(MinimalPBRSrg::m_baseColor, specularF0Factor, MinimalPBRSrg::m_metallic); - // Clear Coat, Transmission + // Clear Coat surface.clearCoat.InitializeToZero(); - surface.transmission.InitializeToZero(); // ------- LightingData ------- @@ -104,7 +103,7 @@ ForwardPassOutput MinimalPBR_MainPassPS(VSOutput IN) ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(surface.transmission.tint); + lightingData.FinalizeLighting(); PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); From 31714810cc8cc48a4afe370e9390736aa7a8c1d5 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:06:09 -0800 Subject: [PATCH 028/394] updating asset cmake file Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Feature/Common/Assets/atom_feature_common_asset_files.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index f595202218..2849cf9415 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -16,7 +16,6 @@ set(FILES Materials/Types/BasePBR_ForwardPass.shader Materials/Types/BasePBR_LowEndForward.azsl Materials/Types/BasePBR_LowEndForward.shader - Materials/Types/BasePBR_ShaderEnable.lua Materials/Types/EnhancedPBR.materialtype Materials/Types/EnhancedPBR_Common.azsli Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl @@ -264,6 +263,7 @@ set(FILES ShaderLib/Atom/Features/PBR/Hammersley.azsli ShaderLib/Atom/Features/PBR/LightingOptions.azsli ShaderLib/Atom/Features/PBR/LightingUtils.azsli + ShaderLib/Atom/Features/PBR/Lighting/BaseLighting.azsli ShaderLib/Atom/Features/PBR/Lighting/DualSpecularLighting.azsli ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli From d108fe4804071e1f22612e897021d6653f6bea53 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 16 Dec 2021 18:31:19 -0800 Subject: [PATCH 029/394] Addresses PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 345 +++++++++--------- .../AzCore/Memory/BestFitExternalMapSchema.h | 2 +- .../AzCore/AzCore/Memory/IAllocator.h | 4 +- Code/Framework/AzCore/AzCore/Memory/Memory.h | 2 +- .../Tests/Memory/AllocatorBenchmarks.cpp | 4 +- 5 files changed, 181 insertions(+), 176 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 4da9ab384f..e877739e29 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -9,11 +9,10 @@ #include #include -using namespace AZ; +// Only used to create recordings of memory operations to use for memory benchmarks +#define O3DE_RECORDING_ENABLED 0 -#define RECORDING_ENABLED 0 - -#if RECORDING_ENABLED +#if O3DE_RECORDING_ENABLED #include #include @@ -25,10 +24,10 @@ namespace class DebugAllocator { public: - typedef void* pointer_type; - typedef AZStd::size_t size_type; - typedef AZStd::ptrdiff_t difference_type; - typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. + using pointer_type = void*; + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) { @@ -64,7 +63,7 @@ namespace static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; static size_t s_numberOfAllocationsRecorded = 0; - static constexpr size_t s_allocationOperationCount = 5 * 1024; + static constexpr size_t s_allocationOperationCount = 8 * 1024; static AZStd::array s_operations = {}; static uint64_t s_operationCounter = 0; @@ -76,11 +75,12 @@ namespace void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) { - AZStd::scoped_lock lock(s_operationsMutex); + AZStd::scoped_lock lock(s_operationsMutex); if (s_operationCounter == s_allocationOperationCount) { AZ::IO::SystemFile file; int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + // memoryrecordings.bin is being output to the current working directory if (!file.Exists("memoryrecordings.bin")) { mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; @@ -158,188 +158,195 @@ namespace } #endif -AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) - : IAllocator(allocationSchema) - , m_name(name) - , m_desc(desc) +namespace AZ { -} - -AllocatorBase::~AllocatorBase() -{ - AZ_Assert(!m_isReady, "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", m_name, m_desc); -} - -const char* AllocatorBase::GetName() const -{ - return m_name; -} - -const char* AllocatorBase::GetDescription() const -{ - return m_desc; -} - -Debug::AllocationRecords* AllocatorBase::GetRecords() -{ - return m_records; -} - -void AllocatorBase::SetRecords(Debug::AllocationRecords* records) -{ - m_records = records; - m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; -} - -bool AllocatorBase::IsReady() const -{ - return m_isReady; -} - -void AllocatorBase::PostCreate() -{ - if (m_registrationEnabled) + AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) + : IAllocator(allocationSchema) + , m_name(name) + , m_desc(desc) { - if (AZ::Environment::IsReady()) + } + + AllocatorBase::~AllocatorBase() + { + AZ_Assert( + !m_isReady, + "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use " + "AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", + m_name, m_desc); + } + + const char* AllocatorBase::GetName() const + { + return m_name; + } + + const char* AllocatorBase::GetDescription() const + { + return m_desc; + } + + Debug::AllocationRecords* AllocatorBase::GetRecords() + { + return m_records; + } + + void AllocatorBase::SetRecords(Debug::AllocationRecords* records) + { + m_records = records; + m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; + } + + bool AllocatorBase::IsReady() const + { + return m_isReady; + } + + void AllocatorBase::PostCreate() + { + if (m_registrationEnabled) { - AllocatorManager::Instance().RegisterAllocator(this); + if (AZ::Environment::IsReady()) + { + AllocatorManager::Instance().RegisterAllocator(this); + } + else + { + AllocatorManager::PreRegisterAllocator(this); + } } - else + + const auto debugConfig = GetDebugConfig(); + if (!debugConfig.m_excludeFromDebugging) { - AllocatorManager::PreRegisterAllocator(this); + SetRecords(aznew Debug::AllocationRecords( + (unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, + GetName())); } + + m_isReady = true; } - const auto debugConfig = GetDebugConfig(); - if (!debugConfig.m_excludeFromDebugging) + void AllocatorBase::PreDestroy() { - SetRecords(aznew Debug::AllocationRecords((unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, GetName())); - } - - m_isReady = true; -} - -void AllocatorBase::PreDestroy() -{ - Debug::AllocationRecords* allocatorRecords = GetRecords(); - if(allocatorRecords) - { - delete allocatorRecords; - SetRecords(nullptr); - } - - if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) - { - AllocatorManager::Instance().UnRegisterAllocator(this); - } - - m_isReady = false; -} - -void AllocatorBase::SetLazilyCreated(bool lazy) -{ - m_isLazilyCreated = lazy; -} - -bool AllocatorBase::IsLazilyCreated() const -{ - return m_isLazilyCreated; -} - -void AllocatorBase::SetProfilingActive(bool active) -{ - m_isProfilingActive = active; -} - -bool AllocatorBase::IsProfilingActive() const -{ - return m_isProfilingActive; -} - -void AllocatorBase::DisableRegistration() -{ - m_registrationEnabled = false; -} - -void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) -{ - if (m_isProfilingActive) - { -#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function -#endif // AZ_HAS_VARIADIC_TEMPLATES - - auto records = GetRecords(); - if (records) + Debug::AllocationRecords* allocatorRecords = GetRecords(); + if (allocatorRecords) { - records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + delete allocatorRecords; + SetRecords(nullptr); } + + if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + { + AllocatorManager::Instance().UnRegisterAllocator(this); + } + + m_isReady = false; } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); + void AllocatorBase::SetLazilyCreated(bool lazy) + { + m_isLazilyCreated = lazy; + } + + bool AllocatorBase::IsLazilyCreated() const + { + return m_isLazilyCreated; + } + + void AllocatorBase::SetProfilingActive(bool active) + { + m_isProfilingActive = active; + } + + bool AllocatorBase::IsProfilingActive() const + { + return m_isProfilingActive; + } + + void AllocatorBase::DisableRegistration() + { + m_registrationEnabled = false; + } + + void AllocatorBase::ProfileAllocation( + void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) + { + if (m_isProfilingActive) + { + auto records = GetRecords(); + if (records) + { + records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + } + } + +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); #endif -} + } -void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->UnregisterAllocation(ptr, byteSize, alignment, info); + auto records = GetRecords(); + if (records) + { + records->UnregisterAllocation(ptr, byteSize, alignment, info); + } } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); #endif -} - -void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) -{ -} - -void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - if (m_isProfilingActive) - { - Debug::AllocationInfo info; - ProfileDeallocation(ptr, 0, 0, &info); - ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); -#endif -} -void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); -} - -void AllocatorBase::ProfileResize(void* ptr, size_t newSize) -{ - if (newSize && m_isProfilingActive) + void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) { - auto records = GetRecords(); - if (records) + } + + void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + if (m_isProfilingActive) { - records->ResizeAllocation(ptr, newSize); + Debug::AllocationInfo info; + ProfileDeallocation(ptr, 0, 0, &info); + ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); #endif -} - -bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) -{ - if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) - { - AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); - return true; } - return false; -} + + void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); + } + + void AllocatorBase::ProfileResize(void* ptr, size_t newSize) + { + if (newSize && m_isProfilingActive) + { + auto records = GetRecords(); + if (records) + { + records->ResizeAllocation(ptr, newSize); + } + } +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#endif + } + + bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) + { + if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + { + AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); + return true; + } + return false; + } + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index 63e9027dd2..21ce34eb80 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -50,7 +50,7 @@ namespace AZ BestFitExternalMapSchema(const Descriptor& desc); - pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; + pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override; pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h index 319175f9ee..4612b27249 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h @@ -37,9 +37,9 @@ namespace AZ typedef size_t size_type; typedef ptrdiff_t difference_type; - virtual ~IAllocatorSchema() {} + virtual ~IAllocatorSchema() = default; - virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; + virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; virtual void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) = 0; /// Resize an allocated memory block. Returns the new adjusted size (as close as possible or equal to the requested one) or 0 (if you don't support resize at all). virtual size_type Resize(pointer_type ptr, size_type newSize) = 0; diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2ecba6ebff..c87c9cd303 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -735,7 +735,7 @@ namespace AZ typedef typename Allocator::Descriptor Descriptor; // Maintained for backwards compatibility, prefer to use Get() instead. - // Get was previously used to get the the schema, however, that bypases what the allocators are doing. + // Get was previously used to get the the schema, however, that bypasses what the allocators are doing. // If the schema is needed, call Get().GetSchema() AZ_FORCE_INLINE static IAllocator& GetAllocator() { diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 7870749d24..0599038006 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -155,11 +155,9 @@ namespace Benchmark } private: - static size_t s_numAllocatedBytes; + inline static size_t s_numAllocatedBytes = 0; }; - size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - // Some allocator are not fully declared, those we simply setup from the schema class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator { From af6af93dffe2764ccf5160436e64931775cc18ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:23:32 -0800 Subject: [PATCH 030/394] Fixes Linux builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp | 4 ++-- Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 9561d1019c..5029e6349f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -133,13 +133,13 @@ namespace AZ BestFitExternalMapSchema::size_type BestFitExternalMapSchema::Resize(pointer_type, size_type) { - AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + AZ_Assert(false, "%s unsupported", AZ_FUNCTION_SIGNATURE); return 0; } BestFitExternalMapSchema::pointer_type BestFitExternalMapSchema::ReAllocate(pointer_type, size_type, size_type) { - AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + AZ_Assert(false, "%s unsupported", AZ_FUNCTION_SIGNATURE); return nullptr; } diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 0599038006..e027b03a49 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include From 8510bdbfa756100b98a0db6f6f726c03e067f5dc Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 7 Jan 2022 14:27:43 -0600 Subject: [PATCH 031/394] (Draft) WIP adding pixel retrieval API to StreamingImageAsset Signed-off-by: Chris Galvan --- .../Code/Source/Processing/Utils.cpp | 4 + .../RPI.Reflect/Image/StreamingImageAsset.h | 4 + .../RPI.Reflect/Image/StreamingImageAsset.cpp | 129 ++++++++++++++++++ Gems/GradientSignal/Code/CMakeLists.txt | 1 + .../Components/ImageGradientComponent.h | 4 + .../Code/Include/GradientSignal/ImageAsset.h | 3 +- .../GradientSignal/Code/Source/ImageAsset.cpp | 28 ++-- 7 files changed, 157 insertions(+), 16 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 20e1b18e77..44539ad33c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -242,6 +242,10 @@ namespace ImageProcessingAtom } } + // Should we actually put the GetSubImagePixelValue API in this Utils file instead, since it already has + // some conversion logic, and has the helper method for retrieving an entire image (LoadImageFromImageAsset) + // whereas this is a helper for retrieving a specific pixel from the image? + IImageObjectPtr LoadImageFromImageAsset(const AZ::Data::Asset& imageAsset) { if (!imageAsset.IsReady()) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 73af8370cb..1db2a63b1c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -85,6 +85,10 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); + //! Get image pixel value for specified mip and slice + template + T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 59f359e474..f1d9b1782b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -13,6 +13,95 @@ namespace AZ { + namespace Internal + { + template + float RetrieveFloatValue(const AZ::u8* mem, size_t index) + { + AZ_Assert(false, "Unsupported pixel format"); + } + + template + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + AZ_Assert(false, "Unsupported pixel format"); + } + + template <> + float RetrieveFloatValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0.0f; + } + + template <> + AZ::u32 RetrieveUintValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0; + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + // 16 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem / static_cast(std::numeric_limits::max()); + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + // 32 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem / static_cast(std::numeric_limits::max()); + } + + template <> + float RetrieveFloatValue(const AZ::u8* mem, size_t index) + { + // 32 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem; + } + + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R32_FLOAT: + return RetrieveFloatValue(mem, index); + default: + return RetrieveFloatValue(mem, index); + } + } + + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R8_UNORM: + return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R16_UNORM: + return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R32_UINT: + return RetrieveUintValue(mem, index); + default: + return RetrieveUintValue(mem, index); + } + } + } + namespace RPI { const char* StreamingImageAsset::DisplayName = "StreamingImage"; @@ -124,5 +213,45 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } + + template<> + float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + size_t index = (y * width) + x; + + return Internal::RetrieveFloatValue(imageData.data(), index, imageDescriptor.m_format); + } + + return 0.0f; + } + + template<> + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + size_t index = (y * width) + x; + + return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); + } + + return 0; + } } } diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 657a88db47..fda04ceb82 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -21,6 +21,7 @@ ly_add_target( AZ::AzCore AZ::AtomCore AZ::AzFramework + Gem::Atom_RPI.Public Gem::SurfaceData Gem::ImageProcessingAtom.Headers Gem::LmbrCentral diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 8214436f83..bbb22a061d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -10,6 +10,9 @@ #include #include + +#include + #include #include #include @@ -33,6 +36,7 @@ namespace GradientSignal AZ_RTTI(ImageGradientConfig, "{1BDB5DA4-A4A8-452B-BE6D-6BD451D4E7CD}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_imageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; + AZ::Data::Asset m_streamingImageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; float m_tilingX = 1.0f; float m_tilingY = 1.0f; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index 4ffab0b4b4..811d74082d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -61,6 +62,6 @@ namespace GradientSignal } }; - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 7e73dc32d6..afa233e5cb 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -20,6 +20,7 @@ namespace { + // Could (should) move these RetrieveValue helper methods over to where our new API lives template float RetrieveValue(const AZ::u8* mem, size_t index) { @@ -151,17 +152,17 @@ namespace GradientSignal return true; } - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { if (imageAsset.IsReady()) { - const auto& image = imageAsset.Get(); - AZStd::size_t imageSize = image->m_imageWidth * image->m_imageHeight * - static_cast(image->m_bytesPerPixel); + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + auto height = imageDescriptor.m_size.m_height; - if (image->m_imageWidth > 0 && - image->m_imageHeight > 0 && - image->m_imageData.size() == imageSize) + if (width > 0 + && height > 0 + ) { // When "rasterizing" from uvs, a range of 0-1 has slightly different meanings depending on the sampler state. // For repeating states (Unbounded/None, Repeat), a uv value of 1 should wrap around back to our 0th pixel. @@ -184,8 +185,8 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), - (image->m_imageHeight * tilingY), + const AZ::Vector3 tiledDimensions((width * tilingX), + (height * tilingY), 0.0f); // Convert from uv space back to pixel space @@ -194,13 +195,10 @@ namespace GradientSignal // UVs outside the 0-1 range are treated as infinitely tiling, so that we behave the same as the // other gradient generators. As mentioned above, if clamping is desired, we expect it to be applied // outside of this function. - size_t x = static_cast(pixelLookup.GetX()) % image->m_imageWidth; - size_t y = static_cast(pixelLookup.GetY()) % image->m_imageHeight; + uint32_t x = static_cast(pixelLookup.GetX()) % width; + uint32_t y = static_cast(pixelLookup.GetY()) % height; - // Flip the y because images are stored in reverse of our world axes - size_t index = ((image->m_imageHeight - 1) - y) * image->m_imageWidth + x; - - return RetrieveValue(image->m_imageData.data(), index, image->m_imageFormat); + return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); } } From 708eabe5de5205dbfb4fa016c40f6cc7e7f23d12 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:32:03 -0600 Subject: [PATCH 032/394] Removed comment question Signed-off-by: Chris Galvan --- .../ImageProcessingAtom/Code/Source/Processing/Utils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 44539ad33c..20e1b18e77 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -242,10 +242,6 @@ namespace ImageProcessingAtom } } - // Should we actually put the GetSubImagePixelValue API in this Utils file instead, since it already has - // some conversion logic, and has the helper method for retrieving an entire image (LoadImageFromImageAsset) - // whereas this is a helper for retrieving a specific pixel from the image? - IImageObjectPtr LoadImageFromImageAsset(const AZ::Data::Asset& imageAsset) { if (!imageAsset.IsReady()) From 16bad281aeeda76b8d097c486f0154767fe5f635 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:40:59 -0600 Subject: [PATCH 033/394] Changed GetSubImagePixelValue parameter order so x,y are first Signed-off-by: Chris Galvan --- .../Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 2 +- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 4 ++-- Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 1db2a63b1c..bdb68601a9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -87,7 +87,7 @@ namespace AZ //! Get image pixel value for specified mip and slice template - T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index f1d9b1782b..37f0e04116 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -215,7 +215,7 @@ namespace AZ } template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -235,7 +235,7 @@ namespace AZ } template<> - AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index afa233e5cb..e88a574768 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -198,7 +198,7 @@ namespace GradientSignal uint32_t x = static_cast(pixelLookup.GetX()) % width; uint32_t y = static_cast(pixelLookup.GetY()) % height; - return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); + return imageAsset->GetSubImagePixelValue(x, y); } } From 010e8a5df1a1c10f42de01f25d071a68cdcdb381 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:28:52 -0600 Subject: [PATCH 034/394] Reverted changes to image gradient asset (will put in separate PR) Signed-off-by: Chris Galvan --- Gems/GradientSignal/Code/CMakeLists.txt | 1 - .../Components/ImageGradientComponent.h | 3 -- .../Code/Include/GradientSignal/ImageAsset.h | 3 +- .../GradientSignal/Code/Source/ImageAsset.cpp | 28 ++++++++++--------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 08d6c82926..d4cf666630 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -21,7 +21,6 @@ ly_add_target( AZ::AzCore AZ::AtomCore AZ::AzFramework - Gem::Atom_RPI.Public Gem::SurfaceData Gem::ImageProcessingAtom.Headers Gem::LmbrCentral diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index bbb22a061d..85aa33137b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -11,8 +11,6 @@ #include #include -#include - #include #include #include @@ -36,7 +34,6 @@ namespace GradientSignal AZ_RTTI(ImageGradientConfig, "{1BDB5DA4-A4A8-452B-BE6D-6BD451D4E7CD}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_imageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; - AZ::Data::Asset m_streamingImageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; float m_tilingX = 1.0f; float m_tilingY = 1.0f; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index 811d74082d..4ffab0b4b4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -12,7 +12,6 @@ #include #include #include -#include namespace AZ { @@ -62,6 +61,6 @@ namespace GradientSignal } }; - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index e88a574768..95d32fced1 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -20,7 +20,6 @@ namespace { - // Could (should) move these RetrieveValue helper methods over to where our new API lives template float RetrieveValue(const AZ::u8* mem, size_t index) { @@ -152,17 +151,17 @@ namespace GradientSignal return true; } - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { if (imageAsset.IsReady()) { - const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - auto height = imageDescriptor.m_size.m_height; + const auto& image = imageAsset.Get(); + AZStd::size_t imageSize = image->m_imageWidth * image->m_imageHeight * + static_cast(image->m_bytesPerPixel); - if (width > 0 - && height > 0 - ) + if (image->m_imageWidth > 0 && + image->m_imageHeight > 0 && + image->m_imageData.size() == imageSize) { // When "rasterizing" from uvs, a range of 0-1 has slightly different meanings depending on the sampler state. // For repeating states (Unbounded/None, Repeat), a uv value of 1 should wrap around back to our 0th pixel. @@ -185,8 +184,8 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((width * tilingX), - (height * tilingY), + const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), + (image->m_imageHeight * tilingY), 0.0f); // Convert from uv space back to pixel space @@ -195,10 +194,13 @@ namespace GradientSignal // UVs outside the 0-1 range are treated as infinitely tiling, so that we behave the same as the // other gradient generators. As mentioned above, if clamping is desired, we expect it to be applied // outside of this function. - uint32_t x = static_cast(pixelLookup.GetX()) % width; - uint32_t y = static_cast(pixelLookup.GetY()) % height; + size_t x = static_cast(pixelLookup.GetX()) % image->m_imageWidth; + size_t y = static_cast(pixelLookup.GetY()) % image->m_imageHeight; - return imageAsset->GetSubImagePixelValue(x, y); + // Flip the y because images are stored in reverse of our world axes + size_t index = ((image->m_imageHeight - 1) - y) * image->m_imageWidth + x; + + return RetrieveValue(image->m_imageData.data(), index, image->m_imageFormat); } } From 830c55dd7c3e0597bbba2479143ef44b45508b9a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:30:48 -0600 Subject: [PATCH 035/394] Reverted two other small changes I missed Signed-off-by: Chris Galvan --- .../Include/GradientSignal/Components/ImageGradientComponent.h | 1 - Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 85aa33137b..8214436f83 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -10,7 +10,6 @@ #include #include - #include #include #include diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 95d32fced1..7e73dc32d6 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -184,7 +184,7 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), + const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), (image->m_imageHeight * tilingY), 0.0f); From 1ed81ae973df283765def13b6f86cdbf5ec6ee52 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 10:27:19 -0600 Subject: [PATCH 036/394] Added API for retrieving region of streaming image asset pixel values Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 5 +- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 50 +++++++++++++++---- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index bdb68601a9..e934ac8bcf 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -85,10 +85,13 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); - //! Get image pixel value for specified mip and slice + //! Get single image pixel value for specified mip and slice template T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Retrieve a region of image pixel values (float) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 37f0e04116..e005fb7f9e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -18,13 +18,19 @@ namespace AZ template float RetrieveFloatValue(const AZ::u8* mem, size_t index) { - AZ_Assert(false, "Unsupported pixel format"); + static_assert(false, "Unsupported pixel format"); } template AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) { - AZ_Assert(false, "Unsupported pixel format"); + static_assert(false, "Unsupported pixel format"); + } + + template + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) + { + static_assert(false, "Unsupported pixel format"); } template <> @@ -217,18 +223,14 @@ namespace AZ template<> float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; + AZStd::vector values; + auto position = AZStd::make_pair(x, y); - auto imageData = GetSubImageData(mip, slice); + GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); - if (!imageData.empty()) + if (values.size() == 1) { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - size_t index = (y * width) + x; - - return Internal::RetrieveFloatValue(imageData.data(), index, imageDescriptor.m_format); + return values[0]; } return 0.0f; @@ -253,5 +255,31 @@ namespace AZ return 0; } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } } } From 2048d8c05c7e34d6ad5823640ab29ed4a5498449 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 11:38:16 -0600 Subject: [PATCH 037/394] Added region-based APIs for uint and int Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 9 ++ .../RPI.Reflect/Image/StreamingImageAsset.cpp | 125 ++++++++++++++---- 2 files changed, 109 insertions(+), 25 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index e934ac8bcf..f4dc891ff2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -92,6 +92,12 @@ namespace AZ //! Retrieve a region of image pixel values (float) for specified mip and slice void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Retrieve a region of image pixel values (uint) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + + //! Retrieve a region of image pixel values (int) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; @@ -134,6 +140,9 @@ namespace AZ uint32_t m_totalImageDataSize = 0; StreamingImageFlags m_flags = StreamingImageFlags::None; + + template + T GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); }; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e005fb7f9e..e21dd1f2c5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -45,6 +45,12 @@ namespace AZ return 0; } + template <> + AZ::s32 RetrieveIntValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0; + } + template <> AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) { @@ -56,19 +62,27 @@ namespace AZ { // 16 bits per channel auto actualMem = reinterpret_cast(mem); - actualMem += index; - return *actualMem / static_cast(std::numeric_limits::max()); + return actualMem[index] / static_cast(std::numeric_limits::max()); } template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) + { + // 16 bits per channel + auto actualMem = reinterpret_cast(mem); + + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + + template <> + float RetrieveFloatValue(const AZ::u8* mem, size_t index) { // 32 bits per channel - auto actualMem = reinterpret_cast(mem); + auto actualMem = reinterpret_cast(mem); actualMem += index; - return *actualMem / static_cast(std::numeric_limits::max()); + return *actualMem; } template <> @@ -85,6 +99,8 @@ namespace AZ { switch (format) { + case AZ::RHI::Format::R32_UINT: + return RetrieveFloatValue(mem, index); case AZ::RHI::Format::R32_FLOAT: return RetrieveFloatValue(mem, index); default: @@ -100,12 +116,21 @@ namespace AZ return RetrieveUintValue(mem, index); case AZ::RHI::Format::R16_UNORM: return RetrieveUintValue(mem, index); - case AZ::RHI::Format::R32_UINT: - return RetrieveUintValue(mem, index); default: return RetrieveUintValue(mem, index); } } + + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R16_SINT: + return RetrieveIntValue(mem, index); + default: + return RetrieveIntValue(mem, index); + } + } } namespace RPI @@ -220,10 +245,10 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } - template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + template + T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::vector values; + AZStd::vector values; auto position = AZStd::make_pair(x, y); GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); @@ -233,27 +258,25 @@ namespace AZ return values[0]; } - return 0.0f; + return aznumeric_cast(0); + } + + template<> + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } template<> AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); + } - auto imageData = GetSubImageData(mip, slice); - - if (!imageData.empty()) - { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - size_t index = (y * width) + x; - - return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); - } - - return 0; + template<> + AZ::s32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) @@ -281,5 +304,57 @@ namespace AZ } } } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } } } From 56837f48d9c75e3f5e0a8b3e7fa560b0e71287f7 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:29:00 +0000 Subject: [PATCH 038/394] Remove error state when user attempts to save empty script event. Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Code/Include/ScriptEvents/ScriptEventDefinition.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp index e6c40cf789..3a6a411611 100644 --- a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp +++ b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp @@ -131,10 +131,7 @@ namespace ScriptEvents return AZ::Failure(AZStd::string::format("%s, invalid name specified, event name must only have alpha numeric characters, may not start with a number and may not have white space", name.c_str())); } - if (m_methods.empty()) - { - return AZ::Failure(AZStd::string::format("Script Events (%s) must provide at least one event otherwise they are unusable, be sure to add an event before saving.", name.c_str())); - } + AZ_Warning("Script Events", !m_methods.empty(), AZStd::string::format("Script Events (%s) must provide at least one event, otherwise they are unusable.", name.c_str()).c_str()); // Validate each method AZStd::string methodName; From 798f6ea5bbda00574531de8fce30b277cb42c727 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 15:41:37 -0600 Subject: [PATCH 039/394] Added support for additional formats Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 109 ++++++++---------- 1 file changed, 51 insertions(+), 58 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e21dd1f2c5..4e664ad3e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -51,58 +51,29 @@ namespace AZ return 0; } - template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - // 16 bits per channel - auto actualMem = reinterpret_cast(mem); - - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) - { - // 16 bits per channel - auto actualMem = reinterpret_cast(mem); - - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - // 32 bits per channel - auto actualMem = reinterpret_cast(mem); - actualMem += index; - - return *actualMem; - } - - template <> - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - // 32 bits per channel - auto actualMem = reinterpret_cast(mem); - actualMem += index; - - return *actualMem; - } - float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) { switch (format) { - case AZ::RHI::Format::R32_UINT: - return RetrieveFloatValue(mem, index); + case AZ::RHI::Format::R8_UNORM: + case AZ::RHI::Format::R8_SNORM: + case AZ::RHI::Format::A8_UNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::D16_UNORM: + case AZ::RHI::Format::R16_UNORM: + case AZ::RHI::Format::R16_SNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: - return RetrieveFloatValue(mem, index); + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveFloatValue(mem, index); } @@ -112,10 +83,20 @@ namespace AZ { switch (format) { - case AZ::RHI::Format::R8_UNORM: - return RetrieveUintValue(mem, index); - case AZ::RHI::Format::R16_UNORM: - return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R8_UINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveUintValue(mem, index); } @@ -125,8 +106,20 @@ namespace AZ { switch (format) { + case AZ::RHI::Format::R8_SINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } case AZ::RHI::Format::R16_SINT: - return RetrieveIntValue(mem, index); + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_SINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveIntValue(mem, index); } @@ -292,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; @@ -318,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; @@ -344,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; From 948d72e079eba67ca2b12e21e987ab2a373eab92 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 16:22:25 -0600 Subject: [PATCH 040/394] Fixed logic error for iterating through the image data by region Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 4e664ad3e2..d9aa2f1c23 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -285,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -311,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -337,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; From c2b1cd1be2152718c5e1b7ae74f9b887232a4cd0 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 19 Jan 2022 09:56:54 -0600 Subject: [PATCH 041/394] Fixed bug when retrieving single pixel value Signed-off-by: Chris Galvan --- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index d9aa2f1c23..80fabc9230 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -242,6 +242,8 @@ namespace AZ T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { AZStd::vector values; + values.resize(1); + auto position = AZStd::make_pair(x, y); GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); From b6b8b464d0e2ad9f5edb4b568fe5ff2c1f5f7689 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 19 Jan 2022 16:53:59 -0600 Subject: [PATCH 042/394] Use AZStd::array instead of AZStd::vector when retrieving a single pixel Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 80fabc9230..3d810c4c8f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -241,19 +241,12 @@ namespace AZ template T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::vector values; - values.resize(1); + AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); - if (values.size() == 1) - { - return values[0]; - } - - return aznumeric_cast(0); + return values[0]; } template<> From 0bd2083c48335127bc27ac34af2e1741f72a1efd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 10:35:22 -0600 Subject: [PATCH 043/394] Replaced array_view usage with span Signed-off-by: Chris Galvan --- .../Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 7 ++++--- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index f4dc891ff2..93d0392e38 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -90,13 +91,13 @@ namespace AZ T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (float) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (uint) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (int) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 3d810c4c8f..099f9c3df9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -244,7 +244,8 @@ namespace AZ AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); + AZStd::span valueSpan(values.begin(), values.size()); + GetSubImagePixelValues(position, position, valueSpan, componentIndex, mip, slice); return values[0]; } @@ -267,7 +268,7 @@ namespace AZ return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -293,7 +294,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -319,7 +320,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; From cdcf8defd03dbabbbd2d9538ed81eae068faf08a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 13:53:51 -0600 Subject: [PATCH 044/394] Added special case support for R8_SNORM, R16_SNORM, and R16_FLOAT Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 103 +++++++++++++++++- 1 file changed, 100 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 099f9c3df9..aaf232d4f0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -15,6 +15,84 @@ namespace AZ { namespace Internal { + // The original implementation was from cryhalf's CryConvertFloatToHalf and CryConvertHalfToFloat function + // Will be replaced with centralized half float API + struct SHalf + { + explicit SHalf(float floatValue) + { + AZ::u32 Result; + + AZ::u32 intValue = ((AZ::u32*)(&floatValue))[0]; + AZ::u32 Sign = (intValue & 0x80000000U) >> 16U; + intValue = intValue & 0x7FFFFFFFU; + + if (intValue > 0x47FFEFFFU) + { + // The number is too large to be represented as a half. Saturate to infinity. + Result = 0x7FFFU; + } + else + { + if (intValue < 0x38800000U) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + AZ::u32 Shift = 113U - (intValue >> 23U); + intValue = (0x800000U | (intValue & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized half. + intValue += 0xC8000000U; + } + + Result = ((intValue + 0x0FFFU + ((intValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; + } + h = static_cast(Result | Sign); + } + + operator float() const + { + AZ::u32 Mantissa; + AZ::u32 Exponent; + AZ::u32 Result; + + Mantissa = h & 0x03FF; + + if ((h & 0x7C00) != 0) // The value is normalized + { + Exponent = ((h >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result = ((h & 0x8000) << 16) | // Sign + ((Exponent + 112) << 23) | // Exponent + (Mantissa << 13); // Mantissa + + return *(float*)&Result; + } + + private: + AZ::u16 h; + }; + template float RetrieveFloatValue(const AZ::u8* mem, size_t index) { @@ -51,23 +129,42 @@ namespace AZ return 0; } + float ScaleValue(float value, float origMin, float origMax, float scaledMin, float scaledMax) + { + return ((value - origMin) / (origMax - origMin)) * (scaledMax - scaledMin) + scaledMin; + } + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) { switch (format) { case AZ::RHI::Format::R8_UNORM: - case AZ::RHI::Format::R8_SNORM: case AZ::RHI::Format::A8_UNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } - case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::R8_SNORM: + { + // Scale the value from AZ::s8 min/max to -1 to 1 + auto actualMem = reinterpret_cast(mem); + return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: - case AZ::RHI::Format::R16_SNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } + case AZ::RHI::Format::R16_SNORM: + { + // Scale the value from AZ::s16 min/max to -1 to 1 + auto actualMem = reinterpret_cast(mem); + return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + } + case AZ::RHI::Format::R16_FLOAT: + { + auto actualMem = reinterpret_cast(mem); + return SHalf(actualMem[index]); + } case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: { From 4a7e00f12534e2f4cbc2a5fc119d9166c4a06c3c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 20 Jan 2022 14:02:57 -0800 Subject: [PATCH 045/394] Removes call to DisableOverride which was removed with the OverrideShim Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index d1d3c1745d..ec0a5fb267 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -51,7 +51,6 @@ namespace AZ::Dom ValueAllocator() : Base("DomValueAllocator", "Allocator for AZ::Dom::Value") { - DisableOverriding(); } }; From c090ad6a5697f1ee58b08f744825d4d2d2fbb796 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 16:10:42 -0600 Subject: [PATCH 046/394] Account for the pixel size when computing the image data index Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index aaf232d4f0..e2268dbdd8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -376,13 +376,14 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width) + x; + size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); auto& outValue = const_cast(outValues[outValuesIndex++]); outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -402,13 +403,14 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width) + x; + size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); auto& outValue = const_cast(outValues[outValuesIndex++]); outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -428,13 +430,14 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width) + x; + size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); auto& outValue = const_cast(outValues[outValuesIndex++]); outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); From 6be0543fc16b9c5c019aac9bb256cd8ea7772f67 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:02:26 -0800 Subject: [PATCH 047/394] Adds script to brute-force detect unused files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 102 +++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 scripts/cleanup/unusued_compilation.py diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py new file mode 100644 index 0000000000..25fa4ca3ce --- /dev/null +++ b/scripts/cleanup/unusued_compilation.py @@ -0,0 +1,102 @@ +# +# 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 argparse +import os +import shutil +import sys +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../build')) +import ci_build + +EXTENSIONS_OF_INTEREST = ('.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl') +EXCLUSIONS = ('AZ_DECLARE_MODULE_CLASS') + +def create_filelist(path): + filelist = set() + for input_file in path: + if os.path.isdir(input_file): + for dp, dn, filenames in os.walk(input_file): + if 'build\\windows_vs2019' in dp: + continue + for f in filenames: + extension = os.path.splitext(f)[1] + extension_lower = extension.lower() + if extension_lower in EXTENSIONS_OF_INTEREST: + filelist.add(os.path.join(dp, f)) + else: + extension = os.path.splitext(input_file)[1] + extension_lower = extension.lower() + if extension_lower in EXTENSIONS_OF_INTEREST: + filelist.add(os.path.join(os.getcwd(), input_file)) + else: + print(f'Error, file {input_file} does not have an extension of interest') + sys.exit(1) + return filelist + +def is_excluded(file): + normalized_file = os.path.normpath(file) + if '\\Platform\\' in normalized_file and not '\\Windows\\' in normalized_file: + return True + return False + +def filter_from_processed(filelist, filter_file_path): + if not os.path.exists(filter_file_path): + return # nothing to filter + + with open(filter_file_path, 'r') as filter_file: + try: + processed_files = [s.strip() for s in filter_file.readlines()] + except UnicodeDecodeError as err: + print('Error reading file {}, err: {}'.format(filter_file_path, err)) + sys.exit(1) + filelist -= set(processed_files) + filelist = [f for f in filelist if not is_excluded(f)] + +def cleanup_unused_compilation(path): + # 1. Create a list of all h/cpp files (consider multiple extensions) + filelist = create_filelist(path) + # 2. Remove files from "processed" list. This is needed because the process is a bruteforce approach and + # can take a while. If something is found in the middle, we want to be able to continue instead of + # starting over. Removing the "unusued_compilation_processed.txt" will start over. + filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') + filter_from_processed(filelist, filter_file_path) + # 3. For each file + total_files = len(filelist) + current_files = 1 + for file in filelist: + print(f"[{current_files}/{total_files}] Trying {file}") + # b. create backup + shutil.copy(file, file + '.bak') + # c. set the file contents as empty + with open(file, 'w') as source_file: + source_file.write('') + # d. build + ret = ci_build.build('build_config.json', 'Windows', 'profile_vs2019') + # e.1 if build succeeds, leave the file empty (leave backup) + # e.2 if build fails, restore backup + if ret != 0: + shutil.copy(file + '.bak', file) + print(f"\t[FAILED] restoring") + else: + print(f"\t[SUCCEED]") + # f. delete backup + os.remove(file + '.bak') + # add file to processed-list + with open(filter_file_path, 'a') as filter_file: + filter_file.write(file) + filter_file.write('\n') + current_files += 1 + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='This script finds C++ files that do not affect compilation (and therefore can be potentially removed)', + formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('file_or_dir', type=str, nargs='+', default=os.getcwd(), + help='list of files or directories to search within for files to consider') + args = parser.parse_args() + ret = cleanup_unused_compilation(args.file_or_dir) + sys.exit(ret) From 7c77f211846762d1312f4f100e3324ca7d021692 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 15:45:57 -0800 Subject: [PATCH 048/394] =?UTF-8?q?=EF=BB=BFremoves=20BaseLibrary/Item/Man?= =?UTF-8?q?ager=20unused=20code=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ErrorRecorder.h | 2 +- Code/Editor/IEditor.h | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Code/Editor/ErrorRecorder.h b/Code/Editor/ErrorRecorder.h index beacc3f0e5..9a0bad7d91 100644 --- a/Code/Editor/ErrorRecorder.h +++ b/Code/Editor/ErrorRecorder.h @@ -14,7 +14,7 @@ #define CRYINCLUDE_EDITOR_CORE_ERRORRECORDER_H #pragma once -#include "Include/EditorCoreAPI.h" +#include ////////////////////////////////////////////////////////////////////////// //! Automatic class to record and display error. diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index 90f1b63f55..df7d8d8dd3 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -326,12 +326,7 @@ enum MouseCallbackFlags //! Types of database items enum EDataBaseItemType { - EDB_TYPE_MATERIAL, - EDB_TYPE_PARTICLE, - EDB_TYPE_MUSIC, - EDB_TYPE_EAXPRESET, - EDB_TYPE_SOUNDMOOD, - EDB_TYPE_FLARE + EDB_TYPE_UNUSED }; enum EEditorPathName From 412cf851a01d6aa50ea694c6bbb6806cbe3ac109 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:02:28 -0800 Subject: [PATCH 049/394] =?UTF-8?q?=EF=BB=BFRemoves=20DataBaseItem/Library?= =?UTF-8?q?/Manager=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditor.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index df7d8d8dd3..fa20481192 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -323,12 +323,6 @@ enum MouseCallbackFlags MK_CALLBACK_FLAGS = 0x100 }; -//! Types of database items -enum EDataBaseItemType -{ - EDB_TYPE_UNUSED -}; - enum EEditorPathName { EDITOR_PATH_OBJECTS, From b3bd293390f59e282ea1a1f4ab6771982a032866 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:41:46 -0800 Subject: [PATCH 050/394] =?UTF-8?q?=EF=BB=BFRemoves=20ConfigGroup=20from?= =?UTF-8?q?=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ConfigGroup.cpp | 195 ----------------------------- Code/Editor/ConfigGroup.h | 113 ----------------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 310 deletions(-) delete mode 100644 Code/Editor/ConfigGroup.cpp delete mode 100644 Code/Editor/ConfigGroup.h diff --git a/Code/Editor/ConfigGroup.cpp b/Code/Editor/ConfigGroup.cpp deleted file mode 100644 index 42236e43dd..0000000000 --- a/Code/Editor/ConfigGroup.cpp +++ /dev/null @@ -1,195 +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 "EditorDefs.h" - -#include "ConfigGroup.h" - -namespace Config -{ - CConfigGroup::CConfigGroup() - { - } - - CConfigGroup::~CConfigGroup() - { - for (IConfigVar* var : m_vars) - { - delete var; - } - } - - void CConfigGroup::AddVar(IConfigVar* var) - { - m_vars.push_back(var); - } - - AZ::u32 CConfigGroup::GetVarCount() - { - return aznumeric_cast(m_vars.size()); - } - - IConfigVar* CConfigGroup::GetVar(const char* szName) - { - for (IConfigVar* var : m_vars) - { - if (0 == _stricmp(szName, var->GetName().c_str())) - { - return var; - } - } - - return nullptr; - } - - const IConfigVar* CConfigGroup::GetVar(const char* szName) const - { - for (const IConfigVar* var : m_vars) - { - if (0 == _stricmp(szName, var->GetName().c_str())) - { - return var; - } - - } - - return nullptr; - } - - IConfigVar* CConfigGroup::GetVar(AZ::u32 index) - { - if (index < m_vars.size()) - { - return m_vars[index]; - } - - return nullptr; - } - - const IConfigVar* CConfigGroup::GetVar(AZ::u32 index) const - { - if (index < m_vars.size()) - { - return m_vars[index]; - } - - return nullptr; - } - - void CConfigGroup::SaveToXML(XmlNodeRef node) - { - // save only values that don't have default values - for (const IConfigVar* var : m_vars) - { - if (var->IsFlagSet(IConfigVar::eFlag_DoNotSave) || var->IsDefault()) - { - continue; - } - - const char* szName = var->GetName().c_str(); - - switch (var->GetType()) - { - case IConfigVar::eType_BOOL: - { - bool currentValue = false; - var->Get(¤tValue); - node->setAttr(szName, currentValue); - break; - } - - case IConfigVar::eType_INT: - { - int currentValue = 0; - var->Get(¤tValue); - node->setAttr(szName, currentValue); - break; - } - - case IConfigVar::eType_FLOAT: - { - float currentValue = 0; - var->Get(¤tValue); - node->setAttr(szName, currentValue); - break; - } - - case IConfigVar::eType_STRING: - { - AZStd::string currentValue; - var->Get(¤tValue); - node->setAttr(szName, currentValue.c_str()); - break; - } - } - } - } - - void CConfigGroup::LoadFromXML(XmlNodeRef node) - { - // load values that are save-able - for (IConfigVar* var : m_vars) - { - if (var->IsFlagSet(IConfigVar::eFlag_DoNotSave)) - { - continue; - } - const char* szName = var->GetName().c_str(); - - switch (var->GetType()) - { - case IConfigVar::eType_BOOL: - { - bool currentValue = false; - var->GetDefault(¤tValue); - if (node->getAttr(szName, currentValue)) - { - var->Set(¤tValue); - } - break; - } - - case IConfigVar::eType_INT: - { - int currentValue = 0; - var->GetDefault(¤tValue); - if (node->getAttr(szName, currentValue)) - { - var->Set(¤tValue); - } - break; - } - - case IConfigVar::eType_FLOAT: - { - float currentValue = 0; - var->GetDefault(¤tValue); - if (node->getAttr(szName, currentValue)) - { - var->Set(¤tValue); - } - break; - } - - case IConfigVar::eType_STRING: - { - AZStd::string currentValue; - var->GetDefault(¤tValue); - QString readValue(currentValue.c_str()); - if (node->getAttr(szName, readValue)) - { - currentValue = readValue.toUtf8().data(); - var->Set(¤tValue); - } - break; - } - } - } - } -} diff --git a/Code/Editor/ConfigGroup.h b/Code/Editor/ConfigGroup.h deleted file mode 100644 index 004725e32c..0000000000 --- a/Code/Editor/ConfigGroup.h +++ /dev/null @@ -1,113 +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 -#include - -struct ICVar; -class XmlNodeRef; - -namespace Config -{ - // Abstract configurable variable - struct IConfigVar - { - public: - enum EType - { - eType_BOOL, - eType_INT, - eType_FLOAT, - eType_STRING, - }; - - enum EFlags - { - eFlag_NoUI = 1 << 0, - eFlag_NoCVar = 1 << 1, - eFlag_DoNotSave = 1 << 2, - }; - - IConfigVar(const char* szName, const char* szDescription, EType varType, AZ::u8 flags) - : m_name(szName) - , m_description(szDescription) - , m_type(varType) - , m_flags(flags) - , m_ptr(nullptr) - {}; - - virtual ~IConfigVar() = default; - - AZ_FORCE_INLINE EType GetType() const - { - return m_type; - } - - AZ_FORCE_INLINE const AZStd::string& GetName() const - { - return m_name; - } - - AZ_FORCE_INLINE const AZStd::string& GetDescription() const - { - return m_description; - } - - AZ_FORCE_INLINE bool IsFlagSet(EFlags flag) const - { - return 0 != (m_flags & flag); - } - - virtual void Get(void* outPtr) const = 0; - virtual void Set(const void* ptr) = 0; - virtual bool IsDefault() const = 0; - virtual void GetDefault(void* outPtr) const = 0; - virtual void Reset() = 0; - - static constexpr EType TranslateType(const bool&) { return eType_BOOL; } - static constexpr EType TranslateType(const int&) { return eType_INT; } - static constexpr EType TranslateType(const float&) { return eType_FLOAT; } - static constexpr EType TranslateType(const AZStd::string&) { return eType_STRING; } - - protected: - EType m_type; - AZ::u8 m_flags; - AZStd::string m_name; - AZStd::string m_description; - void* m_ptr; - ICVar* m_pCVar; - }; - - // Group of configuration variables with optional mapping to CVars - class CConfigGroup - { - private: - using TConfigVariables = AZStd::vector ; - TConfigVariables m_vars; - - using TConsoleVariables = AZStd::vector; - TConsoleVariables m_consoleVars; - - public: - CConfigGroup(); - virtual ~CConfigGroup(); - - void AddVar(IConfigVar* var); - AZ::u32 GetVarCount(); - IConfigVar* GetVar(const char* szName); - IConfigVar* GetVar(AZ::u32 index); - const IConfigVar* GetVar(const char* szName) const; - const IConfigVar* GetVar(AZ::u32 index) const; - - void SaveToXML(XmlNodeRef node); - void LoadFromXML(XmlNodeRef node); - }; -}; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 5d45bbd853..698fa65e9c 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -631,8 +631,6 @@ set(FILES TrackView/TrackViewSequence.h TrackView/TrackViewNodeFactories.h TrackView/TrackViewEventNode.h - ConfigGroup.cpp - ConfigGroup.h Util/AffineParts.h Util/AutoLogTime.cpp Util/AutoLogTime.h From 51ecbbca818eebbdbbdb94c66dee46eb3c2a45c9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:50:49 -0800 Subject: [PATCH 051/394] =?UTF-8?q?=EF=BB=BFRemoves=20ResizeResolutionDial?= =?UTF-8?q?og=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ResizeResolutionDialog.cpp | 119 ------------------------- Code/Editor/ResizeResolutionDialog.h | 46 ---------- Code/Editor/ResizeResolutionDialog.ui | 58 ------------ Code/Editor/editor_lib_files.cmake | 3 - 4 files changed, 226 deletions(-) delete mode 100644 Code/Editor/ResizeResolutionDialog.cpp delete mode 100644 Code/Editor/ResizeResolutionDialog.h delete mode 100644 Code/Editor/ResizeResolutionDialog.ui diff --git a/Code/Editor/ResizeResolutionDialog.cpp b/Code/Editor/ResizeResolutionDialog.cpp deleted file mode 100644 index f2a03fb1b2..0000000000 --- a/Code/Editor/ResizeResolutionDialog.cpp +++ /dev/null @@ -1,119 +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 "EditorDefs.h" - -#include "ResizeResolutionDialog.h" - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -class ResizeResolutionModel - : public QAbstractListModel -{ -public: - ResizeResolutionModel(QObject* parent = nullptr); - - int rowCount(const QModelIndex& parent = {}) const override; - int columnCount(const QModelIndex& parent = {}) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - - int SizeRow(uint32 dwSize) const; - -private: - static const int kNumSizes = 6; -}; - -ResizeResolutionModel::ResizeResolutionModel(QObject* parent) - : QAbstractListModel(parent) -{ -} - -int ResizeResolutionModel::rowCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : kNumSizes; -} - -int ResizeResolutionModel::columnCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : 1; -} - -QVariant ResizeResolutionModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid() || index.column() > 0 || index.row() >= kNumSizes) - { - return {}; - } - - const int size = 64 * (1 << index.row()); - - switch (role) - { - case Qt::DisplayRole: - return QStringLiteral("%1x%2").arg(size).arg(size); - - case Qt::UserRole: - return size; - } - - return {}; -} - -int ResizeResolutionModel::SizeRow(uint32 dwSize) const -{ - // not a power of 2? - if (dwSize & (dwSize - 1)) - { - return 0; - } - - int row = 0; - - for (auto i = dwSize / 64; i > 1; i >>= 1) - { - ++row; - } - - return row; -} - -///////////////////////////////////////////////////////////////////////////// -// CResizeResolutionDialog dialog - - -CResizeResolutionDialog::CResizeResolutionDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_model(new ResizeResolutionModel(this)) - , ui(new Ui::CResizeResolutionDialog) -{ - ui->setupUi(this); - - ui->m_resolution->setModel(m_model); - - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); -} - -CResizeResolutionDialog::~CResizeResolutionDialog() -{ -} - -///////////////////////////////////////////////////////////////////////////// -void CResizeResolutionDialog::SetSize(uint32 dwSize) -{ - ui->m_resolution->setCurrentIndex(m_model->SizeRow(dwSize)); -} - -///////////////////////////////////////////////////////////////////////////// -uint32 CResizeResolutionDialog::GetSize() -{ - return ui->m_resolution->itemData(ui->m_resolution->currentIndex()).toInt(); -} diff --git a/Code/Editor/ResizeResolutionDialog.h b/Code/Editor/ResizeResolutionDialog.h deleted file mode 100644 index 123075688f..0000000000 --- a/Code/Editor/ResizeResolutionDialog.h +++ /dev/null @@ -1,46 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H -#define CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H - -#pragma once -// ResizeResolutionDialog.h : header file -// - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui { - class CResizeResolutionDialog; -} - -class ResizeResolutionModel; - -///////////////////////////////////////////////////////////////////////////// -// CResizeResolutionDialog dialog - -class CResizeResolutionDialog - : public QDialog -{ - // Construction -public: - CResizeResolutionDialog(QWidget* pParent = nullptr); // standard constructor - ~CResizeResolutionDialog(); - - void SetSize(uint32 dwSize); - uint32 GetSize(); - -private: - ResizeResolutionModel* m_model; - QScopedPointer ui; -}; - -#endif // CRYINCLUDE_EDITOR_RESIZERESOLUTIONDIALOG_H diff --git a/Code/Editor/ResizeResolutionDialog.ui b/Code/Editor/ResizeResolutionDialog.ui deleted file mode 100644 index c958e6acaf..0000000000 --- a/Code/Editor/ResizeResolutionDialog.ui +++ /dev/null @@ -1,58 +0,0 @@ - - - CResizeResolutionDialog - - - - 0 - 0 - 250 - 96 - - - - - - - - - - 0 - 0 - - - - Select resolution: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 698fa65e9c..36a45905bd 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -392,9 +392,6 @@ set(FILES QuickAccessBar.cpp QuickAccessBar.h QuickAccessBar.ui - ResizeResolutionDialog.cpp - ResizeResolutionDialog.h - ResizeResolutionDialog.ui SelectLightAnimationDialog.cpp SelectLightAnimationDialog.h SelectSequenceDialog.cpp From 37a1b8d8202d5a5d2623813f64bb112ceeaa55e0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:59:22 -0800 Subject: [PATCH 052/394] Removes AssetBrowserWindow unused files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzAssetBrowser/AssetBrowserWindow.cpp | 73 ------------------- .../AzAssetBrowser/AssetBrowserWindow.h | 57 --------------- 2 files changed, 130 deletions(-) delete mode 100644 Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp delete mode 100644 Code/Editor/AzAssetBrowser/AssetBrowserWindow.h diff --git a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp b/Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp deleted file mode 100644 index 1a45d1e391..0000000000 --- a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.cpp +++ /dev/null @@ -1,73 +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 "AzAssetBrowserWindow.h" -#include "AzAssetBrowser/ui_AssetBrowserWindow.h" - -#include -#include -#include -#include -#include - -const char* ASSET_BROWSER_PREVIEW_NAME = "Asset Browser (PREVIEW)"; - -AzAssetBrowserWindow::AzAssetBrowserWindow(const QString& name, QWidget* parent) - : QDialog(parent) - , m_ui(new Ui::AssetBrowserWindowClass()) - , m_assetDatabaseSortFilterProxyModel(new AssetBrowser::UI::SortFilterProxyModel(parent)) - , m_name(name) - , m_assetBrowser(new AssetBrowser::UI::AssetTreeView(name, this)) - { - EBUS_EVENT_RESULT(m_assetBrowserModel, AssetBrowser::AssetCache::AssetCacheRequestsBus, GetAssetBrowserModel); - AZ_Assert(m_assetBrowserModel, "Failed to get filebrowser model"); - m_assetDatabaseSortFilterProxyModel->setSourceModel(m_assetBrowserModel); - - m_ui->setupUi(this); - - connect(m_ui->searchCriteriaWidget, - &AzToolsFramework::SearchCriteriaWidget::SearchCriteriaChanged, - m_assetDatabaseSortFilterProxyModel.data(), - &AssetBrowser::UI::SortFilterProxyModel::OnSearchCriteriaChanged); - - connect(m_assetBrowser, &QTreeView::customContextMenuRequested, this, &AzAssetBrowserWindow::OnContextMenu); - } - - AzAssetBrowserWindow::~AzAssetBrowserWindow() - { - m_assetBrowser->SaveState(); - } - - ////////////////////////////////////////////////////////////////////////// - const AZ::Uuid& AzAssetBrowserWindow::GetClassID() - { - return AZ::AzTypeInfo::Uuid(); - } - - void AzAssetBrowserWindow::OnContextMenu(const QPoint& point) - { - (void)point; - //get the selected entries - QModelIndexList sourceIndexes; - for (const auto& index : m_assetBrowser->selectedIndexes()) - { - sourceIndexes.push_back(m_assetDatabaseSortFilterProxyModel->mapToSource(index)); - } - AZStd::vector entries; - m_assetBrowserModel->SourceIndexesToAssetDatabaseEntries(sourceIndexes, entries); - - if (entries.empty() || entries.size() > 1) - { - return; - } - auto entry = entries.front(); - - EBUS_EVENT(AssetBrowser::AssetBrowserRequestBus::Bus, OnItemContextMenu, this, entry); - } - -#include - diff --git a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.h b/Code/Editor/AzAssetBrowser/AssetBrowserWindow.h deleted file mode 100644 index a16cc4b494..0000000000 --- a/Code/Editor/AzAssetBrowser/AssetBrowserWindow.h +++ /dev/null @@ -1,57 +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 - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#endif - -namespace Ui -{ - class AssetBrowserWindowClass; -} - -namespace AssetBrowser -{ - namespace UI - { - class AssetTreeView; - class SortFilterProxyModel; - class AssetBrowserModel; - } -} - -class AzAssetBrowserWindow - : public QDialog -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(AzAssetBrowserWindow, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(AzAssetBrowserWindow, "{20238D23-2670-44BC-9110-A51374C18B5A}"); - - explicit AzAssetBrowserWindow(const QString& name = "default", QWidget* parent = nullptr); - virtual ~AzAssetBrowserWindow(); - - static const AZ::Uuid& GetClassID(); - -protected Q_SLOTS: - void OnContextMenu(const QPoint& point); - -private: - QScopedPointer m_ui; - QScopedPointer m_assetDatabaseModel; - QScopedPointer m_assetDatabaseSortFilterProxyModel; - QString m_name; - AssetBrowser::UI::AssetTreeView* m_assetBrowser; - AssetBrowser::UI::AssetBrowserModel* m_assetBrowserModel; -}; - -extern const char* ASSET_BROWSER_PREVIEW_NAME; From b3c2a716adc6c9f325def37b1469d627d899e228 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:19:53 -0800 Subject: [PATCH 053/394] Removes PropertyAnimationCtrl from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../PropertyAnimationCtrl.cpp | 131 ------------------ .../PropertyAnimationCtrl.h | 78 ----------- 2 files changed, 209 deletions(-) delete mode 100644 Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp delete mode 100644 Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp deleted file mode 100644 index 4fb18e438c..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.cpp +++ /dev/null @@ -1,131 +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 "EditorDefs.h" - -#include "PropertyAnimationCtrl.h" - -// Qt -#include -#include -#include - -// Editor -#include "Util/UIEnumerations.h" -#include "IResourceSelectorHost.h" - -AnimationPropertyCtrl::AnimationPropertyCtrl(QWidget *pParent) - : QWidget(pParent) -{ - m_animationLabel = new QLabel; - - m_pApplyButton = new QToolButton; - m_pApplyButton->setIcon(QIcon(":/reflectedPropertyCtrl/img/apply.png")); - - m_pApplyButton->setFocusPolicy(Qt::StrongFocus); - - QHBoxLayout *pLayout = new QHBoxLayout(this); - pLayout->setContentsMargins(0, 0, 0, 0); - pLayout->addWidget(m_animationLabel, 1); - pLayout->addWidget(m_pApplyButton); - - connect(m_pApplyButton, &QAbstractButton::clicked, this, &AnimationPropertyCtrl::OnApplyClicked); -}; - -AnimationPropertyCtrl::~AnimationPropertyCtrl() -{ -} - - -void AnimationPropertyCtrl::SetValue(const CReflectedVarAnimation &animation) -{ - m_animation = animation; - m_animationLabel->setText(animation.m_animation.c_str()); -} - -CReflectedVarAnimation AnimationPropertyCtrl::value() const -{ - return m_animation; -} - -void AnimationPropertyCtrl::OnApplyClicked() -{ - QStringList cSelectedAnimations; - int nTotalAnimations(0); - int nCurrentAnimation(0); - - QString combinedString = GetIEditor()->GetResourceSelectorHost()->GetGlobalSelection("animation"); - SplitString(combinedString, cSelectedAnimations, ','); - - nTotalAnimations = cSelectedAnimations.size(); - for (nCurrentAnimation = 0; nCurrentAnimation < nTotalAnimations; ++nCurrentAnimation) - { - QString& rstrCurrentAnimAction = cSelectedAnimations[nCurrentAnimation]; - if (!rstrCurrentAnimAction.isEmpty()) - { - m_animation.m_animation = rstrCurrentAnimAction.toUtf8().data(); - m_animationLabel->setText(m_animation.m_animation.c_str()); - emit ValueChanged(m_animation); - } - } -} - -QWidget* AnimationPropertyCtrl::GetFirstInTabOrder() -{ - return m_pApplyButton; -} -QWidget* AnimationPropertyCtrl::GetLastInTabOrder() -{ - return m_pApplyButton; -} - -void AnimationPropertyCtrl::UpdateTabOrder() -{ - setTabOrder(m_pApplyButton, m_pApplyButton); -} - - -QWidget* AnimationPropertyWidgetHandler::CreateGUI(QWidget *pParent) -{ - AnimationPropertyCtrl* newCtrl = aznew AnimationPropertyCtrl(pParent); - connect(newCtrl, &AnimationPropertyCtrl::ValueChanged, newCtrl, [newCtrl]() - { - EBUS_EVENT(AzToolsFramework::PropertyEditorGUIMessages::Bus, RequestWrite, newCtrl); - }); - return newCtrl; -} - - -void AnimationPropertyWidgetHandler::ConsumeAttribute(AnimationPropertyCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) -{ - Q_UNUSED(GUI); - Q_UNUSED(attrib); - Q_UNUSED(attrValue); - Q_UNUSED(debugName); -} - -void AnimationPropertyWidgetHandler::WriteGUIValuesIntoProperty(size_t index, AnimationPropertyCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) -{ - Q_UNUSED(index); - Q_UNUSED(node); - CReflectedVarAnimation val = GUI->value(); - instance = static_cast(val); -} - -bool AnimationPropertyWidgetHandler::ReadValuesIntoGUI(size_t index, AnimationPropertyCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) -{ - Q_UNUSED(index); - Q_UNUSED(node); - CReflectedVarAnimation val = instance; - GUI->SetValue(val); - return false; -} - - -#include - diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h b/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h deleted file mode 100644 index 6f3e5b44f3..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyAnimationCtrl.h +++ /dev/null @@ -1,78 +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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTILS_PROPERTYANIMATIONCTRL_H -#define CRYINCLUDE_EDITOR_UTILS_PROPERTYANIMATIONCTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include "ReflectedVar.h" -#include -#include -#endif - -class QToolButton; -class QLabel; -class QHBoxLayout; - -class AnimationPropertyCtrl - : public QWidget -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(AnimationPropertyCtrl, AZ::SystemAllocator, 0); - - AnimationPropertyCtrl(QWidget* pParent = nullptr); - virtual ~AnimationPropertyCtrl(); - - CReflectedVarAnimation value() const; - - QWidget* GetFirstInTabOrder(); - QWidget* GetLastInTabOrder(); - void UpdateTabOrder(); - -signals: - void ValueChanged(CReflectedVarAnimation value); - -public slots: - void SetValue(const CReflectedVarAnimation& animation); - -protected slots: - void OnApplyClicked(); - -private: - QToolButton* m_pApplyButton; - QLabel* m_animationLabel; - - CReflectedVarAnimation m_animation; -}; - -class AnimationPropertyWidgetHandler - : QObject - , public AzToolsFramework::PropertyHandler < CReflectedVarAnimation, AnimationPropertyCtrl > -{ -public: - AZ_CLASS_ALLOCATOR(AnimationPropertyWidgetHandler, AZ::SystemAllocator, 0); - - virtual AZ::u32 GetHandlerName(void) const override { return AZ_CRC("Animation", 0x8d5284dc); } - virtual bool IsDefaultHandler() const override { return true; } - virtual QWidget* GetFirstInTabOrder(AnimationPropertyCtrl* widget) override { return widget->GetFirstInTabOrder(); } - virtual QWidget* GetLastInTabOrder(AnimationPropertyCtrl* widget) override { return widget->GetLastInTabOrder(); } - virtual void UpdateWidgetInternalTabbing(AnimationPropertyCtrl* widget) override { widget->UpdateTabOrder(); } - - virtual QWidget* CreateGUI(QWidget* pParent) override; - virtual void ConsumeAttribute(AnimationPropertyCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; - virtual void WriteGUIValuesIntoProperty(size_t index, AnimationPropertyCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - virtual bool ReadValuesIntoGUI(size_t index, AnimationPropertyCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override; -}; - - -#endif // CRYINCLUDE_EDITOR_UTILS_PROPERTYANIMATIONCTRL_H From f4ae72ab347441d6a667d71f016c92d15265964e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:39:52 -0800 Subject: [PATCH 054/394] Removes InformationPanel from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/ComponentPalette/InformationPanel.cpp | 12 ------------ .../UI/ComponentPalette/InformationPanel.h | 11 ----------- .../componententityeditorplugin_files.cmake | 2 -- 3 files changed, 25 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp deleted file mode 100644 index dd6a53f3ac..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.cpp +++ /dev/null @@ -1,12 +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 "InformationPanel.h" - -// TODO: LMBR-28174 - diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h deleted file mode 100644 index 13be58cccf..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/InformationPanel.h +++ /dev/null @@ -1,11 +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 - -// TODO: LMBR-28174 diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index c663926618..1cb4e25304 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -31,8 +31,6 @@ set(FILES UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h UI/ComponentPalette/FilteredComponentList.cpp - UI/ComponentPalette/InformationPanel.h - UI/ComponentPalette/InformationPanel.cpp UI/Outliner/OutlinerDisplayOptionsMenu.h UI/Outliner/OutlinerDisplayOptionsMenu.cpp UI/Outliner/OutlinerTreeView.hxx From 0d88b9d892038c2c6d9593c716cdc91e4054db40 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:45:13 -0800 Subject: [PATCH 055/394] Removes DeepFilterProxyModel from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EditorCommon/DeepFilterProxyModel.cpp | 172 ------------------ .../EditorCommon/DeepFilterProxyModel.h | 48 ----- .../EditorCommon/editorcommon_files.cmake | 2 - 3 files changed, 222 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h diff --git a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp b/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp deleted file mode 100644 index d4bcabdfbe..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.cpp +++ /dev/null @@ -1,172 +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 "DeepFilterProxyModel.h" -#include - -DeepFilterProxyModel::DeepFilterProxyModel(QObject* parent) - : QSortFilterProxyModel(parent) -{ -} - -void DeepFilterProxyModel::setFilterString(const QString& filter) -{ - m_filter = filter; - m_filterParts = m_filter.split(' ', Qt::SkipEmptyParts); - m_acceptCache.clear(); -} - -void DeepFilterProxyModel::invalidate() -{ - QSortFilterProxyModel::invalidate(); - m_acceptCache.clear(); -} - -QVariant DeepFilterProxyModel::data(const QModelIndex& index, int role) const -{ - if (role == Qt::ForegroundRole) - { - QModelIndex sourceIndex = mapToSource(index); - if (matchFilter(sourceIndex.row(), sourceIndex.parent())) - { - return QSortFilterProxyModel::data(index, role); - } - else - { - return QPalette().color(QPalette::Disabled, QPalette::Text); - } - } - else - { - return QSortFilterProxyModel::data(index, role); - } -} - - -void DeepFilterProxyModel::setFilterWildcard(const QString& pattern) -{ - m_acceptCache.clear(); - QSortFilterProxyModel::setFilterWildcard(pattern); -} - -bool DeepFilterProxyModel::matchFilter(int sourceRow, const QModelIndex& sourceParent) const -{ - int columnCount = sourceModel()->columnCount(sourceParent); - for (int i = 0; i < m_filterParts.size(); ++i) - { - bool atLeastOneContains = false; - for (int j = 0; j < columnCount; ++j) - { - QModelIndex index = sourceModel()->index(sourceRow, j, sourceParent); - QVariant data = sourceModel()->data(index, Qt::DisplayRole); - QString str(data.toString()); - if (str.isEmpty()) - { - if (m_filterParts.empty()) - { - atLeastOneContains = true; - } - } - else if (str.contains(m_filterParts[i], Qt::CaseInsensitive)) - { - atLeastOneContains = true; - } - } - if (!atLeastOneContains) - { - return false; - } - } - return true; -} - -bool DeepFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const -{ - if (matchFilter(sourceRow, sourceParent)) - { - return true; - } - - if (hasAcceptedChildrenCached(sourceRow, sourceParent)) - { - return true; - } - - return false; -} - -bool DeepFilterProxyModel::hasAcceptedChildrenCached(int sourceRow, const QModelIndex& sourceParent) const -{ - std::pair indexId = std::make_pair(sourceParent, sourceRow); - TAcceptCache::iterator it = m_acceptCache.find(indexId); - if (it == m_acceptCache.end()) - { - bool result = hasAcceptedChildren(sourceRow, sourceParent); - m_acceptCache[indexId] = result; - return result; - } - else - { - return it->second; - } -} - -bool DeepFilterProxyModel::hasAcceptedChildren(int sourceRow, const QModelIndex& sourceParent) const -{ - QModelIndex item = sourceModel()->index(sourceRow, 0, sourceParent); - if (!item.isValid()) - { - return false; - } - - int childCount = item.model()->rowCount(item); - if (childCount == 0) - { - return false; - } - - for (int i = 0; i < childCount; ++i) - { - if (filterAcceptsRow(i, item)) - { - return true; - } - } - - return false; -} - -QModelIndex DeepFilterProxyModel::findFirstMatchingIndex(const QModelIndex& root) -{ - int rowCount = this->rowCount(root); - for (int i = 0; i < rowCount; ++i) - { - QModelIndex index = this->index(i, 0, root); - if (!index.isValid()) - { - continue; - } - QModelIndex sourceIndex = mapToSource(index); - if (!sourceIndex.isValid()) - { - continue; - } - if (matchFilter(sourceIndex.row(), sourceIndex.parent())) - { - return index; - } - - QModelIndex child = findFirstMatchingIndex(index); - if (child.isValid()) - { - return child; - } - } - return QModelIndex(); -} diff --git a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h b/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h deleted file mode 100644 index c7373ef18c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DeepFilterProxyModel.h +++ /dev/null @@ -1,48 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITORCOMMON_DEEPFILTERPROXYMODEL_H -#define CRYINCLUDE_EDITORCOMMON_DEEPFILTERPROXYMODEL_H -#pragma once - -#include -#include -#include -#include "EditorCommonAPI.h" - -class EDITOR_COMMON_API DeepFilterProxyModel - : public QSortFilterProxyModel -{ -public: - DeepFilterProxyModel(QObject* parent); - - void setFilterString(const QString& filter); - void invalidate(); - - QVariant data(const QModelIndex& index, int role) const override; - - void setFilterWildcard(const QString& pattern); - - bool matchFilter(int source_row, const QModelIndex& source_parent) const; - bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; - bool hasAcceptedChildrenCached(int source_row, const QModelIndex& source_parent) const; - bool hasAcceptedChildren(int source_row, const QModelIndex& source_parent) const; - - QModelIndex findFirstMatchingIndex(const QModelIndex& root); - -private: - QString m_filter; - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - QStringList m_filterParts; - typedef std::map, bool> TAcceptCache; - mutable TAcceptCache m_acceptCache; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -#endif // CRYINCLUDE_EDITORCOMMON_DEEPFILTERPROXYMODEL_H diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 1c6efbdf2c..d07ab71acf 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -19,8 +19,6 @@ set(FILES SaveUtilities/AsyncSaveRunner.cpp AxisHelper.cpp DisplayContext.cpp - DeepFilterProxyModel.cpp - DeepFilterProxyModel.h Resource.h DrawingPrimitives/Ruler.cpp DrawingPrimitives/Ruler.h From 2f6d416df420db11a254e7416a27cb3182ae6501 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:49:02 -0800 Subject: [PATCH 056/394] Removes QtViewPane.cpp which is not being compiled Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/EditorCommon/QtViewPane.cpp | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/QtViewPane.cpp diff --git a/Code/Editor/Plugins/EditorCommon/QtViewPane.cpp b/Code/Editor/Plugins/EditorCommon/QtViewPane.cpp deleted file mode 100644 index 3deef7e503..0000000000 --- a/Code/Editor/Plugins/EditorCommon/QtViewPane.cpp +++ /dev/null @@ -1,39 +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 "platform.h" - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS -#include -#include - -#include "QtViewPane.h" - -#include "Include/IViewPane.h" -#include "Util/RefCountBase.h" -#include "QtWinMigrate/qwinwidget.h" - -#include -#include -#include -#include -#include - -#include "QtUtil.h" - -// ugly dependencies: -#include "Functor.h" -class CXmlArchive; -#include -#include "Util/PathUtil.h" -// ^^^ - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- - From e791655cc4db41a7d391147730082af4c46be0bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:58:49 -0800 Subject: [PATCH 057/394] Removes DrawingPrimitives from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EditorCommon/DrawingPrimitives/Ruler.cpp | 192 ------------------ .../EditorCommon/DrawingPrimitives/Ruler.h | 52 ----- .../DrawingPrimitives/TimeSlider.cpp | 48 ----- .../DrawingPrimitives/TimeSlider.h | 31 --- .../EditorCommon/editorcommon_files.cmake | 4 - 5 files changed, 327 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp deleted file mode 100644 index 1f0bd9ad88..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.cpp +++ /dev/null @@ -1,192 +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 "Ruler.h" - -#include -#include -#include -#include - -namespace DrawingPrimitives -{ - enum - { - RULER_MIN_PIXELS_PER_TICK = 3, - }; - - std::vector CalculateTicks(uint size, Range visibleRange, Range rulerRange, int* pRulerPrecision, Range* pScreenRulerRange) - { - std::vector ticks; - - if (size == 0) - { - if (pRulerPrecision) - { - *pRulerPrecision = 0; - } - - return ticks; - } - - const float pixelsPerUnit = visibleRange.Length() > 0.0f ? (float)size / visibleRange.Length() : 1.0f; - - const float startTime = rulerRange.start; - const float endTime = rulerRange.end; - const float totalDuration = endTime - startTime; - - const float ticksMinPower = log10f(RULER_MIN_PIXELS_PER_TICK); - const float ticksPowerDelta = ticksMinPower - log10f(pixelsPerUnit); - - const int digitsAfterPoint = AZStd::max(-int(ceil(ticksPowerDelta)) - 1, 0); - if (pRulerPrecision) - { - *pRulerPrecision = digitsAfterPoint; - } - - const float scaleStep = powf(10.0f, ceil(ticksPowerDelta)); - const float scaleStepPixels = scaleStep * pixelsPerUnit; - const int numMarkers = int(totalDuration / scaleStep) + 1; - - const float startTimeRound = int(startTime / scaleStep) * scaleStep; - const int startOffsetMod = int(startTime / scaleStep) % 10; - const int scaleOffsetPixels = aznumeric_cast((startTime - startTimeRound) * pixelsPerUnit); - - const int startX = aznumeric_cast((rulerRange.start - visibleRange.start) * pixelsPerUnit); - const int endX = aznumeric_cast(startX + (numMarkers - 1) * scaleStepPixels - scaleOffsetPixels); - - if (pScreenRulerRange) - { - *pScreenRulerRange = Range(aznumeric_cast(startX), aznumeric_cast(endX)); - } - - const int startLoop = std::max((int)((scaleOffsetPixels - startX) / scaleStepPixels) - 1, 0); - const int endLoop = std::min((int)((size + scaleOffsetPixels - startX) / scaleStepPixels) + 1, numMarkers); - - for (int i = startLoop; i < endLoop; ++i) - { - STick tick; - - const int x = aznumeric_cast(startX + i * scaleStepPixels - scaleOffsetPixels); - const float value = startTimeRound + i * scaleStep; - - tick.m_bTenth = (startOffsetMod + i) % 10 != 0; - tick.m_position = x; - tick.m_value = value; - - ticks.push_back(tick); - } - - return ticks; - } - - QColor Interpolate(const QColor& a, const QColor& b, float k) - { - float mk = 1.0f - k; - return QColor(aznumeric_cast(a.red() * mk + b.red() * k), - aznumeric_cast(a.green() * mk + b.green() * k), - aznumeric_cast(a.blue() * mk + b.blue() * k), - aznumeric_cast(a.alpha() * mk + b.alpha() * k)); - } - - void DrawTicks(const std::vector& ticks, QPainter& painter, const QPalette& palette, const STickOptions& options) - { - QColor midDark = DrawingPrimitives::Interpolate(palette.color(QPalette::Dark), palette.color(QPalette::Button), 0.5f); - painter.setPen(QPen(midDark)); - - const int height = options.m_rect.height(); - const int top = options.m_rect.top(); - - for (const STick& tick : ticks) - { - const int x = tick.m_position + options.m_rect.left(); - - if (tick.m_bTenth) - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight / 2), QPoint(x, top + height)); - } - else - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight), QPoint(x, top + height)); - } - } - } - - void DrawTicks(QPainter& painter, const QPalette& palette, const SRulerOptions& options) - { - const std::vector ticks = CalculateTicks(options.m_rect.width(), options.m_visibleRange, options.m_rulerRange, nullptr, nullptr); - DrawTicks(ticks, painter, palette, options); - } - - void DrawRuler(QPainter& painter, const QPalette& palette, const SRulerOptions& options, int* pRulerPrecision) - { - int rulerPrecision; - Range screenRulerRange; - const std::vector ticks = CalculateTicks(options.m_rect.width(), options.m_visibleRange, options.m_rulerRange, &rulerPrecision, &screenRulerRange); - - if (pRulerPrecision) - { - *pRulerPrecision = rulerPrecision; - } - - if (options.m_shadowSize > 0) - { - QRect shadowRect = QRect(options.m_rect.left(), options.m_rect.height(), options.m_rect.width(), options.m_shadowSize); - QLinearGradient upperGradient(shadowRect.left(), shadowRect.top(), shadowRect.left(), shadowRect.bottom()); - upperGradient.setColorAt(0.0f, QColor(0, 0, 0, 128)); - upperGradient.setColorAt(1.0f, QColor(0, 0, 0, 0)); - QBrush upperBrush(upperGradient); - painter.fillRect(shadowRect, upperBrush); - } - - painter.fillRect(options.m_rect, DrawingPrimitives::Interpolate(palette.color(QPalette::Button), palette.color(QPalette::Midlight), 0.25f)); - if (options.m_drawBackgroundCallback) - { - options.m_drawBackgroundCallback(); - } - - QColor midDark = DrawingPrimitives::Interpolate(palette.color(QPalette::Dark), palette.color(QPalette::Button), 0.5f); - painter.setPen(QPen(midDark)); - - QFont font; - font.setPixelSize(10); - painter.setFont(font); - - - char format[16] = ""; - azsprintf(format, "%%.%df", rulerPrecision); - - const int height = options.m_rect.height(); - const int top = options.m_rect.top(); - - QString str; - for (const STick& tick : ticks) - { - const int x = tick.m_position + options.m_rect.left(); - const float value = tick.m_value; - - if (tick.m_bTenth) - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight / 2), QPoint(x, top + height)); - } - else - { - painter.drawLine(QPoint(x, top + height - options.m_markHeight), QPoint(x, top + height)); - painter.setPen(palette.color(QPalette::Disabled, QPalette::Text)); - str.asprintf(format, value); - painter.drawText(QPoint(x + 2, top + height - options.m_markHeight + 1), str); - painter.setPen(midDark); - } - } - - painter.setPen(QPen(palette.color(QPalette::Dark))); - painter.drawLine(QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.start), 0), QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.start), options.m_rect.top() + height)); - painter.drawLine(QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.end), 0), QPoint(aznumeric_cast(options.m_rect.left() + screenRulerRange.end), options.m_rect.top() + height)); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h deleted file mode 100644 index fd8bc62ff7..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/Ruler.h +++ /dev/null @@ -1,52 +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 "Range.h" - -#include -#include -#include - -class QPainter; -class QPalette; - -namespace DrawingPrimitives -{ - struct SRulerOptions; - typedef std::function TDrawCallback; - - struct SRulerOptions - { - QRect m_rect; - Range m_visibleRange; - Range m_rulerRange; - int m_textXOffset; - int m_textYOffset; - int m_markHeight; - int m_shadowSize; - - TDrawCallback m_drawBackgroundCallback; - }; - - struct STick - { - bool m_bTenth; - int m_position; - float m_value; - }; - - typedef SRulerOptions STickOptions; - - std::vector CalculateTicks(uint size, Range visibleRange, Range rulerRange, int* pRulerPrecision, Range* pScreenRulerRange); - void DrawTicks(const std::vector& ticks, QPainter& painter, const QPalette& palette, const STickOptions& options); - void DrawTicks(QPainter& painter, const QPalette& palette, const STickOptions& options); - void DrawRuler(QPainter& painter, const QPalette& palette, const SRulerOptions& options, int* pRulerPrecision); -} diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp deleted file mode 100644 index 291723ff6b..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.cpp +++ /dev/null @@ -1,48 +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 "TimeSlider.h" - -#include -#include - -#include - -namespace DrawingPrimitives -{ - void DrawTimeSlider(QPainter& painter, const QPalette& palette, const STimeSliderOptions& options) - { - QString text = QString::number(options.m_time, 'f', options.m_precision + 1); - - QFontMetrics fm(painter.font()); - const int textWidth = fm.horizontalAdvance(text) + fm.height(); - const int markerHeight = fm.height(); - - const int thumbX = options.m_position; - const bool fits = thumbX + textWidth < options.m_rect.right(); - - const QRect timeRect(fits ? thumbX : thumbX - textWidth, 3, textWidth, fm.height()); - painter.fillRect(timeRect.adjusted(fits ? 0 : -1, 0, fits ? 1 : 0, 0), options.m_bHasFocus ? palette.highlight() : palette.shadow()); - painter.setPen(palette.color(QPalette::HighlightedText)); - painter.drawText(timeRect.adjusted(fits ? 0 : aznumeric_cast(markerHeight * 0.2f), -1, fits ? aznumeric_cast(-markerHeight * 0.2f) : 0, 0), text, QTextOption(fits ? Qt::AlignRight : Qt::AlignLeft)); - - painter.setPen(palette.color(QPalette::Text)); - painter.drawLine(QPointF(thumbX, 0), QPointF(thumbX, options.m_rect.height())); - QPointF points[3] = - { - QPointF(thumbX, markerHeight), - QPointF(thumbX - markerHeight * 0.66f, 0), - QPointF(thumbX + markerHeight * 0.66f, 0) - }; - - painter.setBrush(palette.base()); - painter.setPen(palette.color(QPalette::Text)); - painter.drawPolygon(points, 3); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h b/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.h deleted file mode 100644 index 4553b106e2..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DrawingPrimitives/TimeSlider.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 "Range.h" - -#include - -class QPainter; -class QPalette; - -namespace DrawingPrimitives -{ - struct STimeSliderOptions - { - QRect m_rect; - int m_precision; - int m_position; - float m_time; - bool m_bHasFocus; - }; - - void DrawTimeSlider(QPainter& painter, const QPalette& palette, const STimeSliderOptions& options); -} diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index d07ab71acf..7a380bc6ea 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -20,10 +20,6 @@ set(FILES AxisHelper.cpp DisplayContext.cpp Resource.h - DrawingPrimitives/Ruler.cpp - DrawingPrimitives/Ruler.h - DrawingPrimitives/TimeSlider.cpp - DrawingPrimitives/TimeSlider.h WinWidget/WinWidget.h WinWidget/WinWidgetManager.h WinWidget/WinWidgetManager.cpp From bc8bdd1db4eb73500195ca379e110d22ebdf9c42 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:06:08 -0800 Subject: [PATCH 058/394] Removes resource and rc file from FFMPEGPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/FFMPEGPlugin/FFMPEGPlugin.rc | 61 ------------------- .../FFMPEGPlugin/ffmpegplugin_files.cmake | 1 - Code/Editor/Plugins/FFMPEGPlugin/resource.h | 22 ------- 3 files changed, 84 deletions(-) delete mode 100644 Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc delete mode 100644 Code/Editor/Plugins/FFMPEGPlugin/resource.h diff --git a/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc b/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc deleted file mode 100644 index 404387a244..0000000000 --- a/Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin.rc +++ /dev/null @@ -1,61 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake b/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake index 779fc816f4..6d63e3a8f8 100644 --- a/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake +++ b/Code/Editor/Plugins/FFMPEGPlugin/ffmpegplugin_files.cmake @@ -7,7 +7,6 @@ # set(FILES - FFMPEGPlugin.rc main.cpp FFMPEGPlugin.cpp FFMPEGPlugin.h diff --git a/Code/Editor/Plugins/FFMPEGPlugin/resource.h b/Code/Editor/Plugins/FFMPEGPlugin/resource.h deleted file mode 100644 index dcf269a2b4..0000000000 --- a/Code/Editor/Plugins/FFMPEGPlugin/resource.h +++ /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 - * - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by FFMPEGPlugin.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From 43b35add368232529b86d1331e34f58e315e4684 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:08:06 -0800 Subject: [PATCH 059/394] Removes ImagePainter and some Terrain leftovers from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ImagePainter.cpp | 350 ------------------ Code/Editor/Util/ImagePainter.h | 76 ---- Code/Editor/editor_lib_terrain_files.cmake | 84 ----- .../editor_lib_test_terrain_files.cmake | 17 - 4 files changed, 527 deletions(-) delete mode 100644 Code/Editor/Util/ImagePainter.cpp delete mode 100644 Code/Editor/Util/ImagePainter.h delete mode 100644 Code/Editor/editor_lib_terrain_files.cmake delete mode 100644 Code/Editor/editor_lib_test_terrain_files.cmake diff --git a/Code/Editor/Util/ImagePainter.cpp b/Code/Editor/Util/ImagePainter.cpp deleted file mode 100644 index 37cf5d000c..0000000000 --- a/Code/Editor/Util/ImagePainter.cpp +++ /dev/null @@ -1,350 +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 "EditorDefs.h" - -#include "ImagePainter.h" - -// Editor -#include "Terrain/Heightmap.h" -#include "Terrain/Layer.h" - -SEditorPaintBrush::SEditorPaintBrush(CHeightmap& rHeightmap, CLayer& rLayer, - const bool bMaskByLayerSettings, const uint32 dwLayerIdMask, const bool bFlood) - : bBlended(true) - , m_rHeightmap(rHeightmap) - , m_rLayer(rLayer) - , m_cFilterColor(1, 1, 1) - , m_dwLayerIdMask(dwLayerIdMask) - , m_bFlood(bFlood) -{ - if (bMaskByLayerSettings) - { - m_fMinAltitude = m_rLayer.GetLayerStart(); - m_fMaxAltitude = m_rLayer.GetLayerEnd(); - m_fMinSlope = tan(m_rLayer.GetLayerMinSlopeAngle() / 90.1f * g_PI / 2.0f); // 0..90 -> 0..~1/0 - m_fMaxSlope = tan(m_rLayer.GetLayerMaxSlopeAngle() / 90.1f * g_PI / 2.0f); // 0..90 -> 0..~1/0 - } - else - { - m_fMinAltitude = -FLT_MAX; - m_fMaxAltitude = FLT_MAX; - m_fMinSlope = 0; - m_fMaxSlope = FLT_MAX; - } -} - -float SEditorPaintBrush::GetMask(const float fX, const float fY) const -{ - // Our expectation is that fX and fY are values of [0, 1) (i.e. includes 0, excludes 1). - // We're mapping this back to an int range where the width & height are generally powers of 2. So for example, we're mapping to 0 - 1023. - // To preserve maximum precision in our floats, and for ease of understanding, we're going to expect that our floats actually represent - // the 0 - 1024 range (i.e. 1 is 1024, not 1023), so that way each increment of a float is 1/1024 instead of 1/1023. This means that a value - // of 1 that's passed in is off the right edge of our range and technically invalid, so we'll just clamp if that happens. - int iX = AZStd::clamp(static_cast(fX * m_rHeightmap.GetWidth()), static_cast(0), static_cast(m_rHeightmap.GetWidth() - 1)); - int iY = AZStd::clamp(static_cast(fY * m_rHeightmap.GetHeight()), static_cast(0), static_cast(m_rHeightmap.GetHeight() - 1)); - - float fAltitude = m_rHeightmap.GetZInterpolated(fX * m_rHeightmap.GetWidth(), fY * m_rHeightmap.GetHeight()); - - // Check if altitude is within brush min/max altitude - if (fAltitude < m_fMinAltitude || fAltitude > m_fMaxAltitude) - { - return 0; - } - - float fSlope = m_rHeightmap.GetAccurateSlope(fX * m_rHeightmap.GetWidth(), fY * m_rHeightmap.GetHeight()); - - // Check if slope is within brush min/max slope - if (fSlope < m_fMinSlope || fSlope > m_fMaxSlope) - { - return 0; - } - - // Soft slope test - // float fSlopeAplha = 1.f; - // fSlopeAplha *= CLAMP((m_fMaxSlope-fSlope)*4 + 0.25f,0,1); - // fSlopeAplha *= CLAMP((fSlope-m_fMinSlope)*4 + 0.25f,0,1); - - if (m_dwLayerIdMask != 0xffffffff) - { - LayerWeight weight = m_rHeightmap.GetLayerWeightAt(iX, iY); - - if ((weight.PrimaryId() & CLayer::e_undefined) != m_dwLayerIdMask) - { - return 0; - } - } - - return 1; -} - - -////////////////////////////////////////////////////////////////////////// -void CImagePainter::PaintBrush(const float fpx, const float fpy, TImage& image, const SEditorPaintBrush& brush) -{ - float fX = fpx * image.GetWidth(), fY = fpy * image.GetHeight(); - - // By using 1/width and 1/height as our scale, this means we're expecting to generate values of [0, 1). - // i.e. we're expecting to generate 0/width to (width-1)/width, and 0/height to (height-1)/height. - // This aligns with the expectations of how GetMask() will use these values. - const float fScaleX = 1.0f / image.GetWidth(); - const float fScaleY = 1.0f / image.GetHeight(); - - //////////////////////////////////////////////////////////////////////// - // Draw an attenuated spot on the map - //////////////////////////////////////////////////////////////////////// - float fMaxDist, fAttenuation, fYSquared; - float fHardness = brush.hardness; - - unsigned int pos; - - LayerWeight* sourceData = image.GetData(); - - // Calculate the maximum distance - fMaxDist = brush.fRadius * image.GetWidth(); - - assert(image.GetWidth() == image.GetHeight()); - - int width = image.GetWidth(); - int height = image.GetHeight(); - - int iMinX = (int)floor(fX - fMaxDist), iMinY = (int)floor(fY - fMaxDist); - int iMaxX = (int)ceil(fX + fMaxDist), iMaxY = (int)ceil(fY + fMaxDist); - - for (int iPosY = iMinY; iPosY <= iMaxY; iPosY++) - { - // Skip invalid locations - if (iPosY < 0 || iPosY > height - 1) - { - continue; - } - - float fy = (float)iPosY - fY; - - // Precalculate - fYSquared = (float)(fy * fy); - - for (int iPosX = iMinX; iPosX <= iMaxX; iPosX++) - { - float fx = (float)iPosX - fX; - - // Skip invalid locations - if (iPosX < 0 || iPosX > width - 1) - { - continue; - } - - // Only circle. - float dist = sqrtf(fYSquared + fx * fx); - if (!brush.m_bFlood && dist > fMaxDist) - { - continue; - } - - float fMask = brush.GetMask(iPosX * fScaleX, iPosY * fScaleY); - - if (fMask < 0.5f) - { - continue; - } - - - // Calculate the array index - pos = iPosX + iPosY * width; - - // Calculate attenuation factor - fAttenuation = brush.m_bFlood ? 1.0f : 1.0f - __min(1.0f, dist / fMaxDist); - - float h = static_cast(sourceData[pos].GetWeight(brush.color) / 255.0f); - float dh = 1.0f - h; - float fh = clamp_tpl((fAttenuation) * dh * fHardness + h, 0.0f, 1.0f); - - // A non-zero distance between our weight sample and the center point of the brush - // can cause fAttenuation to be ~0.999, so if h (the current weight) is 254, any - // value less than 1 * dh will give us a value between 254 and 255. - // As we convert from 0-1 back to 0-255 number ranges, it's important to round - // instead of truncating so that we don't have to have an exact distance of 0 - // to reach a value of 255. - uint8 weight = static_cast(clamp_tpl(round(fh * 255.0f), 0.0f, 255.0f)); - - sourceData[pos].SetWeight(brush.color, weight); - } - } -} - - -void CImagePainter::PaintBrushWithPattern(const float fpx, const float fpy, CImageEx& outImageBGR, - const uint32 dwOffsetX, const uint32 dwOffsetY, const float fScaleX, const float fScaleY, - const SEditorPaintBrush& brush, const CImageEx& imgPattern) -{ - float fX = fpx * fScaleX, fY = fpy * fScaleY; - - //////////////////////////////////////////////////////////////////////// - // Draw an attenuated spot on the map - //////////////////////////////////////////////////////////////////////// - float fMaxDist, fAttenuation, fYSquared; - float fHardness = brush.hardness; - - unsigned int pos; - - uint32* srcBGR = outImageBGR.GetData(); - uint32* pat = imgPattern.GetData(); - - int value = brush.color; - - // Calculate the maximum distance - fMaxDist = brush.fRadius; - - int width = outImageBGR.GetWidth(); - int height = outImageBGR.GetHeight(); - - int patwidth = imgPattern.GetWidth(); - int patheight = imgPattern.GetHeight(); - - int iMinX = (int)floor(fX - fMaxDist), iMinY = (int)floor(fY - fMaxDist); - int iMaxX = (int)ceil(fX + fMaxDist), iMaxY = (int)ceil(fY + fMaxDist); - - bool bSRGB = imgPattern.GetSRGB(); - - for (int iPosY = iMinY; iPosY < iMaxY; iPosY++) - { - // Skip invalid locations - if (iPosY - dwOffsetY < 0 || iPosY - dwOffsetY > height - 1) - { - continue; - } - - float fy = (float)iPosY - fY; - - // Precalculate - fYSquared = (float)(fy * fy); - - int32 iPatY = ((uint32)iPosY) % patheight; - assert(iPatY >= 0 && iPatY < patheight); - - for (int iPosX = iMinX; iPosX < iMaxX; iPosX++) - { - float fx = (float)iPosX - fX; - - // Skip invalid locations - if (iPosX - dwOffsetX < 0 || iPosX - dwOffsetX > width - 1) - { - continue; - } - - // Only circle. - float dist = sqrtf(fYSquared + fx * fx); - - if (!brush.m_bFlood && dist > fMaxDist) - { - continue; - } - - // Calculate the array index - pos = (iPosX - dwOffsetX) + (iPosY - dwOffsetY) * width; - - // Calculate attenuation factor - fAttenuation = brush.m_bFlood ? 1.0f : 1.0f - __min(1.0f, dist / fMaxDist); - assert(fAttenuation >= 0.0f && fAttenuation <= 1.0f); - - // Note that GetMask expects a range of [0, 1), so it's correct to divide by - // fScaleX and fScaleY instead of (fScaleX-1) and (fScaleY-1). - float fMask = brush.GetMask(iPosX / fScaleX, iPosY / fScaleY); - - uint32 cDstPixBGR = srcBGR[pos]; - - int32 iPatX = ((uint32)iPosX) % patwidth; - assert(iPatX >= 0 && iPatX < patwidth); - - uint32 cSrcPix = pat[iPatX + iPatY * patwidth]; - - float s = fAttenuation * fHardness * fMask; - assert(s >= 0.0f && s <= 1.0f); - if (fcmp(s, 0)) - { - // If the blend would be entirely biased to the pixel in outImage then don't modify anything - // (The logic below is susceptible to floating point inaccuracy and would change the pixel - // even though it is not supposed to) - continue; - } - - const float fRecip255 = 1.0f / 255.0f; - - // Convert Src to Linear Space (Src is pattern texture, can be in linear or gamma space) - ColorF cSrc = ColorF(GetRValue(cSrcPix), GetGValue(cSrcPix), GetBValue(cSrcPix)) * fRecip255; - if (bSRGB) - { - cSrc.srgb2rgb(); - } - - ColorF cMtl = brush.m_cFilterColor; - cMtl.srgb2rgb(); - - cSrc *= cMtl; - cSrc.clamp(0.0f, 1.0f); - - // Convert Dst to Linear Space ( Dst is always in gamma space ), and load from BGR -> RGB - ColorF cDst = ColorF(GetBValue(cDstPixBGR), GetGValue(cDstPixBGR), GetRValue(cDstPixBGR)) * fRecip255; - cDst.srgb2rgb(); - - // Linear space blend - ColorF cOut = cSrc * s + cDst * (1.0f - s); - - // Convert final result to gamma space and put back in [0..255] range - cOut.rgb2srgb(); - cOut *= 255.0f; - - // Save the blended result as BGR - // It's important to round as we go from float back to int. If we just truncate, - // we'll end up with consistently darker colors. - srcBGR[pos] = RGB(round(cOut.b), round(cOut.g), round(cOut.r)); - } - } -} - - -void CImagePainter::FillWithPattern(CImageEx& outImage, const uint32 dwOffsetX, const uint32 dwOffsetY, - const CImageEx& imgPattern) -{ - unsigned int pos; - - uint32* src = outImage.GetData(); - uint32* pat = imgPattern.GetData(); - - int width = outImage.GetWidth(); - int height = outImage.GetHeight(); - - int patwidth = imgPattern.GetWidth(); - int patheight = imgPattern.GetHeight(); - - if (patheight == 0 || patwidth == 0) - { - return; - } - - for (int iPosY = 0; iPosY < height; iPosY++) - { - int32 iPatY = ((uint32)iPosY + dwOffsetY) % patheight; - assert(iPatY >= 0 && iPatY < patheight); - - for (int iPosX = 0; iPosX < width; iPosX++) - { - // Calculate the array index - pos = iPosX + iPosY * width; - - int32 iPatX = ((uint32)iPosX + dwOffsetX) % patwidth; - assert(iPatX >= 0 && iPatX < patwidth); - - uint32 cSrc = pat[iPatX + iPatY * patwidth]; - - src[pos] = cSrc; - } - } -} - diff --git a/Code/Editor/Util/ImagePainter.h b/Code/Editor/Util/ImagePainter.h deleted file mode 100644 index 81d1450f06..0000000000 --- a/Code/Editor/Util/ImagePainter.h +++ /dev/null @@ -1,76 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UTIL_IMAGEPAINTER_H -#define CRYINCLUDE_EDITOR_UTIL_IMAGEPAINTER_H -#pragma once - -#include "Util/Image.h" - -struct LayerWeight; - -// Brush structure used for painting. -struct SANDBOX_API SEditorPaintBrush -{ - // constructor - SEditorPaintBrush(class CHeightmap& rHeightmap, class CLayer& rLayer, - const bool bMaskByLayerSettings, const uint32 dwLayerIdMask, const bool bFlood); - - CHeightmap& m_rHeightmap; // for mask support - unsigned char color; // Painting color - float fRadius; // outer radius (0..1 for the whole terrain size) - float hardness; // 0-1 hardness of brush - bool bBlended; // true=shades of the value are stores, false=the value is either stored or not - bool m_bFlood; // true=fills square area without attenuation, false=fills circle area with attenuation - uint32 m_dwLayerIdMask;// reference Value for the mask, 0xffffffff if not used - CLayer& m_rLayer; // layer we paint with - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - ColorF m_cFilterColor; // (1,1,1) if not used, multiplied with brightness - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - // Arguments: - // fX - 0..1 in the whole terrain - // fY - 0..1 in the whole terrain - // Return: - // 0=paint there 0% .. 1=paint there 100% - float GetMask(const float fX, const float fY) const; - -protected: // -------------------------------------------------------------------------- - - float m_fMinSlope; // in m per m - float m_fMaxSlope; // in m per me - float m_fMinAltitude; // in m - float m_fMaxAltitude; // in m -}; - -// Contains image painting functions. -class CImagePainter -{ -public: - - // Paint spot on image at position px,py with specified paint brush parameters (to a layer) - // Arguments: - // fpx - 0..1 in the whole terrain (used for the mask) - // fpy - 0..1 in the whole terrain (used for the mask) - SANDBOX_API void PaintBrush(const float fpx, const float fpy, TImage& image, const SEditorPaintBrush& brush); - - // Paint spot with pattern (to an RGB image) - // real spot is drawn to (fpx-dwOffsetX,fpy-dwOffsetY) - to get the pattern working we need this info split up like this - // Arguments: - // fpx - 0..1 in the whole terrain (used for the mask) - // fpy - 0..1 in the whole terrain (used for the mask) - void PaintBrushWithPattern(const float fpx, const float fpy, CImageEx& outImage, const uint32 dwOffsetX, const uint32 dwOffsetY, - const float fScaleX, const float fScaleY, const SEditorPaintBrush& brush, const CImageEx& imgPattern); - - // - void FillWithPattern(CImageEx& outImage, const uint32 dwOffsetX, const uint32 dwOffsetY, const CImageEx& imgPattern); -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_IMAGEPAINTER_H diff --git a/Code/Editor/editor_lib_terrain_files.cmake b/Code/Editor/editor_lib_terrain_files.cmake deleted file mode 100644 index 09b521ad39..0000000000 --- a/Code/Editor/editor_lib_terrain_files.cmake +++ /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 -# -# - -set(FILES - TerrainPainterPanel.cpp - TerrainPainterPanel.h - TerrainPainterPanel.ui - NewTerrainDialog.cpp - NewTerrainDialog.h - NewTerrainDialog.ui - TerrainTextureExport.cpp - TerrainTextureExport.h - TerrainTextureExport.ui - Terrain/Clouds.cpp - Terrain/GenerationParam.cpp - Terrain/GenerationParam.ui - Terrain/Heightmap.cpp - Terrain/Layer.cpp - Terrain/Noise.cpp - Terrain/PythonTerrainFuncs.cpp - Terrain/PythonTerrainLayerFuncs.cpp - Terrain/RGBLayer.cpp - Terrain/SurfaceType.cpp - Terrain/TerrainConverter.cpp - Terrain/TerrainGrid.cpp - Terrain/TerrainLayerTexGen.cpp - Terrain/TerrainLightGen.cpp - Terrain/TerrainManager.cpp - Terrain/TerrainTexGen.cpp - Terrain/TextureCompression.cpp - Terrain/MacroTextureExporter.cpp - Terrain/Clouds.h - Terrain/GenerationParam.h - Terrain/Heightmap.h - Terrain/Layer.h - Terrain/LayerWeight.h - Terrain/Noise.h - Terrain/RGBLayer.h - Terrain/SurfaceType.h - Terrain/TerrainConverter.h - Terrain/TerrainGrid.h - Terrain/TerrainLayerTexGen.h - Terrain/TerrainLightGen.h - Terrain/TerrainManager.h - Terrain/TerrainTexGen.h - Terrain/LayerWeight.cpp - Terrain/TextureCompression.h - Terrain/MacroTextureExporter.h - TerrainDialog.cpp - TerrainDialog.h - TerrainDialog.ui - TerrainTexture.cpp - TerrainTexture.h - TerrainTexture.ui - Terrain/SkyAccessibility/HeightmapAccessibility.h - Terrain/SkyAccessibility/HorizonTracker.h - TerrainHolePanel.cpp - TerrainHoleTool.cpp - TerrainHolePanel.h - TerrainHolePanel.ui - TerrainHoleTool.h - TerrainMiniMapTool.cpp - TerrainMiniMapTool.h - TerrainMiniMapPanel.ui - TerrainModifyPanel.cpp - TerrainModifyPanel.h - TerrainModifyPanel.ui - TerrainModifyTool.cpp - TerrainModifyTool.h - TerrainMoveTool.cpp - TerrainMoveToolPanel.cpp - TerrainMoveTool.h - TerrainMoveToolPanel.h - TerrainMoveToolPanel.ui - TerrainTexturePainter.cpp - TerrainTexturePainter.h - Util/ImagePainter.cpp - Util/ImagePainter.h -) diff --git a/Code/Editor/editor_lib_test_terrain_files.cmake b/Code/Editor/editor_lib_test_terrain_files.cmake deleted file mode 100644 index e0f4c99cdb..0000000000 --- a/Code/Editor/editor_lib_test_terrain_files.cmake +++ /dev/null @@ -1,17 +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 -# -# - -set(FILES - Lib/Tests/test_TerrainModifyPythonBindings.cpp - Lib/Tests/test_TerrainPythonBindings.cpp - Lib/Tests/test_TerrainLayerPythonBindings.cpp - Lib/Tests/test_TerrainPainterPythonBindings.cpp - Lib/Tests/test_TerrainHoleToolPythonBindings.cpp - Lib/Tests/test_TerrainTexturePythonBindings.cpp - Terrain/Tests/test_Terrain.cpp -) From 6b7b8c45a776b2774dc3bcd070dfd470d93e394a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:26:15 -0800 Subject: [PATCH 060/394] Removes UIEnumerations from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/UIEnumerations.cpp | 75 ----------------------------- Code/Editor/Util/UIEnumerations.h | 37 -------------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 114 deletions(-) delete mode 100644 Code/Editor/Util/UIEnumerations.cpp delete mode 100644 Code/Editor/Util/UIEnumerations.h diff --git a/Code/Editor/Util/UIEnumerations.cpp b/Code/Editor/Util/UIEnumerations.cpp deleted file mode 100644 index 2666a49f8e..0000000000 --- a/Code/Editor/Util/UIEnumerations.cpp +++ /dev/null @@ -1,75 +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 - * - */ - - -// Description : This file implements the container for the assotiaon of -// enumeration name to enumeration values - - -#include "EditorDefs.h" - -#include "UIEnumerations.h" - -////////////////////////////////////////////////////////////////////////// -CUIEnumerations& CUIEnumerations::GetUIEnumerationsInstance() -{ - static CUIEnumerations oGeneralProxy; - return oGeneralProxy; -} - -////////////////////////////////////////////////////////////////////////// -CUIEnumerations::TDValuesContainer& CUIEnumerations::GetStandardNameContainer() -{ - static TDValuesContainer cValuesContainer; - static bool boInit(false); - - if (!boInit) - { - boInit = true; - - XmlNodeRef oRootNode; - XmlNodeRef oEnumaration; - XmlNodeRef oEnumerationItem; - - int nNumberOfEnumarations(0); - int nCurrentEnumaration(0); - - int nNumberOfEnumerationItems(0); - int nCurrentEnumarationItem(0); - - oRootNode = GetISystem()->GetXmlUtils()->LoadXmlFromFile("Editor\\PropertyEnumerations.xml"); - nNumberOfEnumarations = oRootNode ? oRootNode->getChildCount() : 0; - - for (nCurrentEnumaration = 0; nCurrentEnumaration < nNumberOfEnumarations; ++nCurrentEnumaration) - { - TDValues cValues; - oEnumaration = oRootNode->getChild(nCurrentEnumaration); - - nNumberOfEnumerationItems = oEnumaration->getChildCount(); - for (nCurrentEnumarationItem = 0; nCurrentEnumarationItem < nNumberOfEnumerationItems; ++nCurrentEnumarationItem) - { - oEnumerationItem = oEnumaration->getChild(nCurrentEnumarationItem); - - const char* szKey(nullptr); - const char* szValue(nullptr); - oEnumerationItem->getAttributeByIndex(0, &szKey, &szValue); - - cValues.push_back(szValue); - } - - const char* szKey(nullptr); - const char* szValue(nullptr); - oEnumaration->getAttributeByIndex(0, &szKey, &szValue); - - cValuesContainer.insert(TDValuesContainer::value_type(szValue, cValues)); - } - } - - return cValuesContainer; -} -////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/Util/UIEnumerations.h b/Code/Editor/Util/UIEnumerations.h deleted file mode 100644 index f23ebf9604..0000000000 --- a/Code/Editor/Util/UIEnumerations.h +++ /dev/null @@ -1,37 +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 - * - */ - - -// Description : This file declares the container for the assotiaon of -// enumeration name to enumeration values - - -#ifndef CRYINCLUDE_EDITOR_UTIL_UIENUMERATIONS_H -#define CRYINCLUDE_EDITOR_UTIL_UIENUMERATIONS_H -#pragma once - - -class CUIEnumerations -{ -public: - // For XML standard values. - typedef QStringList TDValues; - typedef std::map TDValuesContainer; -protected: -private: - -public: - static CUIEnumerations& GetUIEnumerationsInstance(); - - TDValuesContainer& GetStandardNameContainer(); -protected: -private: -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_UIENUMERATIONS_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 36a45905bd..758143ac8d 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -708,8 +708,6 @@ set(FILES Util/ImageTIF.cpp Util/ImageTIF.h Util/Math.h - Util/UIEnumerations.cpp - Util/UIEnumerations.h WelcomeScreen/WelcomeScreenDialog.h WelcomeScreen/WelcomeScreenDialog.cpp WelcomeScreen/WelcomeScreenDialog.ui From 0374215c00f63ca30fb033e707aa4cfec3659b48 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:21:35 -0800 Subject: [PATCH 061/394] Removes some old BuildInfo files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/BuildInfo.h | 11 ---------- Code/Framework/GridMate/GridMate/BuildInfo.h | 11 ---------- Code/Framework/GridMate/GridMate/GridMate.cpp | 1 - Code/Framework/GridMate/GridMate/Version.h | 20 ------------------- .../GridMate/GridMate/gridmate_files.cmake | 2 -- 5 files changed, 45 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/BuildInfo.h delete mode 100644 Code/Framework/GridMate/GridMate/BuildInfo.h delete mode 100644 Code/Framework/GridMate/GridMate/Version.h diff --git a/Code/Framework/AzCore/AzCore/BuildInfo.h b/Code/Framework/AzCore/AzCore/BuildInfo.h deleted file mode 100644 index 7032b4b190..0000000000 --- a/Code/Framework/AzCore/AzCore/BuildInfo.h +++ /dev/null @@ -1,11 +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 - * - */ -#define AZCORE_BUILD_NUMBER 368 -#define AZCORE_BUILD_DATE "Thu 10/10/2013" -#define AZCORE_BUILD_TIME "19:42:16.96" -#define AZCORE_SOURCE_CHANGELIST 2992189 diff --git a/Code/Framework/GridMate/GridMate/BuildInfo.h b/Code/Framework/GridMate/GridMate/BuildInfo.h deleted file mode 100644 index 5abeab249f..0000000000 --- a/Code/Framework/GridMate/GridMate/BuildInfo.h +++ /dev/null @@ -1,11 +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 - * - */ -#define GM_BUILD_NUMBER 263 -#define GM_BUILD_DATE "Fri 10/11/2013" -#define GM_BUILD_TIME "11:42:40.81" -#define GM_SOURCE_CHANGELIST 2992328 diff --git a/Code/Framework/GridMate/GridMate/GridMate.cpp b/Code/Framework/GridMate/GridMate/GridMate.cpp index 22b4fd7af6..009aef7e83 100644 --- a/Code/Framework/GridMate/GridMate/GridMate.cpp +++ b/Code/Framework/GridMate/GridMate/GridMate.cpp @@ -13,7 +13,6 @@ #include #include #include -#include AZ_DEFINE_BUDGET(GridMate); diff --git a/Code/Framework/GridMate/GridMate/Version.h b/Code/Framework/GridMate/GridMate/Version.h deleted file mode 100644 index 0bebf6e1c1..0000000000 --- a/Code/Framework/GridMate/GridMate/Version.h +++ /dev/null @@ -1,20 +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 - * - */ -#ifndef GRIDMATE_VERSION_H -#define GRIDMATE_VERSION_H 1 - -// buildversion.h is updated automatically when we release an SDK. -// It contians the folling defines (with example numbers) -// #define GM_BUILD_NUMBER 18 -// #define GM_BUILD_DATE "Tue 06/09/2009" -// #define GM_BUILD_TIME "14:10:34.72" -#include - -#define GM_BUILD_VERSION 001 // Hundreds is a major version, tens in a minor. For instance 155 is 1.55. - -#endif // GRIDMATE_VERSION_H diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 99dc4257f6..7fac75a442 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -7,7 +7,6 @@ # set(FILES - BuildInfo.h EBus.h Docs.h GridMate.cpp @@ -17,7 +16,6 @@ set(FILES MathUtils.h Memory.h Types.h - Version.h Carrier/Carrier.cpp Carrier/Carrier.h Carrier/Compressor.h From 1de0e574f7f3629142964696539d0e59a2f3d3be Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 9 Nov 2021 19:12:18 -0800 Subject: [PATCH 062/394] Removes LegacyJobExecutor from AzCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Jobs/LegacyJobExecutor.h | 197 ------------------ .../AzCore/AzCore/azcore_files.cmake | 1 - 2 files changed, 198 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h diff --git a/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h b/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h deleted file mode 100644 index 8018cf409f..0000000000 --- a/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h +++ /dev/null @@ -1,197 +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 - * - */ -#ifndef AZCORE_JOBS_JOBEXECUTOR_H -#define AZCORE_JOBS_JOBEXECUTOR_H - -#pragma once - -#include -#include -#include -#include - -namespace AZ -{ - /** - * Helper for porting legacy jobs that allows Starting and Waiting for multiple jobs asynchronously - */ - class LegacyJobExecutor final - { - public: - LegacyJobExecutor() = default; - - LegacyJobExecutor(const LegacyJobExecutor&) = delete; - - ~LegacyJobExecutor() - { - WaitForCompletion(); - } - - template - inline void StartJob(const Function& processFunction, JobContext* context = nullptr) - { - Job * job = aznew JobFunctionExecutorHelper(processFunction, *this, context); - StartJobInternal(job); - } - - // SetPostJob - This API exists to support backwards compatibility and is not a recommended pattern to be copied. - // Instead, create AZ::Jobs with appropriate dependencies on each other - template - inline void SetPostJob(LegacyJobExecutor& postJobExecutor, const Function& processFunction, JobContext* context = nullptr) - { - AZStd::unique_ptr postJob(aznew JobFunctionExecutorHelper(processFunction, postJobExecutor, context)); // Allocate outside the lock - { - LockGuard lockGuard(m_conditionLock); - - AZ_Assert(!m_postJob, "Post already set"); - AZ_Assert(!m_running, "LegacyJobExecutor::SetPostJob() must be called before starting any jobs"); - m_postJob = std::move(postJob); - // Note: m_jobCount is not incremented until we push the post job - } - } - - inline void ClearPostJob() - { - LockGuard lockGuard(m_conditionLock); - m_postJob.reset(); - } - - inline void Reset() - { - AZ_Assert(!IsRunning(), "LegacyJobExecutor::Reset() called while jobs in flight"); - } - - inline void WaitForCompletion() - { - AZStd::unique_lock uniqueLock(m_conditionLock); - - while (m_running) - { - AZ_PROFILE_FUNCTION(AzCore); - m_completionCondition.wait(uniqueLock, [this] { return !this->m_running; }); - } - } - - // Push a logical fence that will cause WaitForCompletion to wait until PopCompletionFence is called and all jobs are complete. Analogue to the legacy API SJobState::SetStarted() - // Note: this does NOT fence execution of jobs in relation to each other - inline void PushCompletionFence() - { - IncJobCount(); - } - - // Pop a logical completion fence. Analogue to the legacy API SJobState::SetStopped() - inline void PopCompletionFence() - { - JobCompleteUpdate(); - } - - // Are there presently jobs in-flight (queued or running)? - inline bool IsRunning() - { - return m_running; - } - - private: - void JobCompleteUpdate() - { - AZ_Assert(m_jobCount, "Invalid LegacyJobExecutor::m_jobCount."); - if (--m_jobCount == 0) // note: m_jobCount is atomic, so only the last completing job will take the count to zero - { - JobExecutorHelper* postJob = nullptr; - { - // All state transitions to and from running must be serialized through the condition lock - LockGuard lockGuard(m_conditionLock); - - // Test count again as another job may have started before we got the lock - if (!m_jobCount) - { - m_running = false; - postJob = m_postJob.release(); - m_completionCondition.notify_all(); - } - } - - // outside the lock (this pointer is no longer valid)... - if (postJob) - { - postJob->StartOnExecutor(); - } - } - } - - void StartJobInternal(Job * job) - { - IncJobCount(); - job->Start(); - } - - void IncJobCount() - { - if (m_jobCount++ == 0) - { - // All state transitions to and from running must be serialized through the condition lock (Even though m_running is atomic) - LockGuard lockGuard(m_conditionLock); - m_running = true; - } - } - - class JobExecutorHelper - { - public: - virtual ~JobExecutorHelper() = default; - virtual void StartOnExecutor() = 0; - }; - - /** - * Private Job type that notifies the owning LegacyJobExecutor of completion - */ - template - class JobFunctionExecutorHelper : public JobFunction, public JobExecutorHelper - { - using Base = JobFunction; - public: - AZ_CLASS_ALLOCATOR(JobFunctionExecutorHelper, ThreadPoolAllocator, 0) - - JobFunctionExecutorHelper(typename JobFunction::FunctionCRef processFunction, LegacyJobExecutor& executor, JobContext* context) - : JobFunction(processFunction, true /* isAutoDelete */, context) - , m_executor(executor) - { - } - - void StartOnExecutor() override - { - m_executor.StartJobInternal(this); - } - - void Process() override - { - Base::Process(); - - m_executor.JobCompleteUpdate(); - } - - private: - LegacyJobExecutor& m_executor; - }; - - template - friend class JobFunctionExecutorHelper; // For JobCompleteUpdate, StartJobInternal - - using Lock = AZStd::mutex; - using LockGuard = AZStd::lock_guard; - - AZStd::condition_variable m_completionCondition; - Lock m_conditionLock; - AZStd::unique_ptr m_postJob; - - AZStd::atomic_uint m_jobCount{0}; - AZStd::atomic_bool m_running{false}; - }; -} - -#endif diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index 8b8a3b377a..7e3f501d6f 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -238,7 +238,6 @@ set(FILES Jobs/JobManagerComponent.cpp Jobs/JobManagerComponent.h Jobs/JobManagerDesc.h - Jobs/LegacyJobExecutor.h Jobs/MultipleDependentJob.h Jobs/task_group.h Math/Aabb.cpp From 495d40fa2016024b389d663f446b073e53eda690 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 09:00:29 -0800 Subject: [PATCH 063/394] Removes unused ModuleStoragePolicy from Memory.h/cpp in AzCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Framework/AzCore/AzCore/Memory/Memory.cpp | 14 --- Code/Framework/AzCore/AzCore/Memory/Memory.h | 94 ------------------- 2 files changed, 108 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.cpp b/Code/Framework/AzCore/AzCore/Memory/Memory.cpp index 6ec66f9e3d..6393e3138f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.cpp @@ -7,22 +7,8 @@ */ #include -#include #include -#include -#include - -AZ::AllocatorStorage::LazyAllocatorRef::~LazyAllocatorRef() -{ - m_destructor(*m_allocator); -} - -void AZ::AllocatorStorage::LazyAllocatorRef::Init(size_t size, size_t alignment, CreationFn creationFn, DestructionFn destructionFn) -{ - m_allocator = AZ::AllocatorManager::CreateLazyAllocator(size, alignment, creationFn); - m_destructor = destructionFn; -} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // New overloads diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2e08ec1b15..2e568a6cfb 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -521,19 +521,6 @@ namespace AZ { namespace AllocatorStorage { - /// A private structure to create heap-storage for an allocator that won't expire until other static module members are destructed. - struct LazyAllocatorRef - { - using CreationFn = IAllocator*(*)(void*); - using DestructionFn = void(*)(IAllocator&); - - ~LazyAllocatorRef(); - void Init(size_t size, size_t alignment, CreationFn creationFn, DestructionFn destructionFn); - - IAllocator* m_allocator = nullptr; - DestructionFn m_destructor = nullptr; - }; - /** * A base class for all storage policies. This exists to provide access to private IAllocator methods via template friends. */ @@ -640,87 +627,6 @@ namespace AZ template EnvironmentVariable EnvironmentStoragePolicy::s_allocator; - - /** - * ModuleStoragePolicy stores the allocator in a static variable that is local to the module using it. - * This forces separate instances of the allocator to exist in each module, and permits lazy instantiation. - * We only tolerate this for some special allocators, primarily to maintain backwards compatibility with CryEngine, - * since it still allocates outside of code in the data section. - * - * It has two ways of storing its allocator: either on the heap, which is the preferred way, since it guarantees - * the memory for the allocator won't be deallocated (such as in a DLL) before anyone that's using it. If disabled - * the allocator is stored in a static variable, which should only be used where this isn't a problem a shut-down - * time, such as on a console. - */ - template - struct ModuleStoragePolicyBase; - - template - struct ModuleStoragePolicyBase: public StoragePolicyBase - { - protected: - // Use a static instance to store the allocator. This is not recommended when the order of shut-down with the module matters, as the allocator could have its memory destroyed - // before the users of it are destroyed. The primary use case for this is allocators that need to support the CRT, as they cannot allocate from the heap. - static Allocator& GetModuleAllocatorInstance() - { - static Allocator* s_allocator = nullptr; - static typename AZStd::aligned_storage::value>::type s_storage; - - if (!s_allocator) - { - s_allocator = new (&s_storage) Allocator; - StoragePolicyBase::Create(*s_allocator, typename Allocator::Descriptor(), true); - } - - return *s_allocator; - } - }; - - template - struct ModuleStoragePolicyBase : public StoragePolicyBase - { - protected: - // Store-on-heap implementation uses the LazyAllocatorRef to create and destroy an allocator using heap-space so there isn't a problem with destruction order within the module. - static Allocator& GetModuleAllocatorInstance() - { - static LazyAllocatorRef s_allocator; - - if (!s_allocator.m_allocator) - { - s_allocator.Init(sizeof(Allocator), AZStd::alignment_of::value, [](void* mem) -> IAllocator* { return new (mem) Allocator; }, &StoragePolicyBase::Destroy); - StoragePolicyBase::Create(*static_cast(s_allocator.m_allocator), typename Allocator::Descriptor(), true); - } - - return *static_cast(s_allocator.m_allocator); - } - }; - - template - class ModuleStoragePolicy : public ModuleStoragePolicyBase - { - public: - using Base = ModuleStoragePolicyBase; - - static IAllocator& GetAllocator() - { - return Base::GetModuleAllocatorInstance(); - } - - static void Create(const typename Allocator::Descriptor& desc = typename Allocator::Descriptor()) - { - StoragePolicyBase::Create(Base::GetModuleAllocatorInstance(), desc, true); - } - - static void Destroy() - { - StoragePolicyBase::Destroy(Base::GetModuleAllocatorInstance()); - } - - static bool IsReady() - { - return Base::GetModuleAllocatorInstance().IsReady(); - } - }; } namespace Internal From db68078639a36fd677fd44a7edea85982d2742c5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 13:25:47 -0800 Subject: [PATCH 064/394] Removes TimeDataStatisticsManager from AzCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Statistics/TimeDataStatisticsManager.cpp | 49 ------------------ .../Statistics/TimeDataStatisticsManager.h | 51 ------------------- 2 files changed, 100 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp delete mode 100644 Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h diff --git a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp b/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp deleted file mode 100644 index 0e9b36a8b6..0000000000 --- a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.cpp +++ /dev/null @@ -1,49 +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 "TimeDataStatisticsManager.h" - -namespace AZ -{ - namespace Statistics - { - void TimeDataStatisticsManager::PushTimeDataSample(const char * registerName, const AZ::Debug::ProfilerRegister::TimeData& timeData) - { - const AZStd::string statName(registerName); - NamedRunningStatistic* statistic = GetStatistic(statName); - if (!statistic) - { - const AZStd::string units("us"); - AddStatistic(statName, statName, units, false); - AZ::Debug::ProfilerRegister::TimeData zeroTimeData; - memset(&zeroTimeData, 0, sizeof(AZ::Debug::ProfilerRegister::TimeData)); - m_previousTimeData[statName] = zeroTimeData; - statistic = GetStatistic(statName); - AZ_Assert(statistic != nullptr, "Fatal error adding a new statistic object"); - } - - const AZ::u64 accumulatedTime = timeData.m_time; - const AZ::s64 totalNumCalls = timeData.m_calls; - const AZ::u64 previousAccumulatedTime = m_previousTimeData[statName].m_time; - const AZ::s64 previousTotalNumCalls = m_previousTimeData[statName].m_calls; - const AZ::u64 deltaTime = accumulatedTime - previousAccumulatedTime; - const AZ::s64 deltaCalls = totalNumCalls - previousTotalNumCalls; - - if (deltaCalls == 0) - { - //This is the same old data. Let's skip it - return; - } - - double newSample = static_cast(deltaTime) / deltaCalls; - - statistic->PushSample(newSample); - m_previousTimeData[statName] = timeData; - } - } //namespace Statistics -} //namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h b/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h deleted file mode 100644 index c9adc4de2f..0000000000 --- a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h +++ /dev/null @@ -1,51 +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 -{ - namespace Statistics - { - /** - * @brief Specialization useful for data generated with AZ::Debug::FrameProfileComponent - * - * Timer based data collection using AZ_PROFILE_TIMER(...), available in - * AzCore/Debug/Profiler.h can be collected when using AZ::Debug::FrameProfilerComponent - * and AZ::Debug::FrameProfilerBus. The method PushTimeDataSample(...) is a convenience - * to convert those Timer registers into a RunningStatistic. - * - * - */ - class TimeDataStatisticsManager : public StatisticsManager<> - { - public: - TimeDataStatisticsManager() = default; - virtual ~TimeDataStatisticsManager() = default; - - /** - * @brief Adds one sample data to a specific running stat by name. - * - * This method is specialized to work with ProfilerRegister::TimeData that can be intercepted - * during AZ::Debug::FrameProfilerBus::OnFrameProfilerData(). - * For each @param registerName a new RunningStat object is created if it doesn't exist. - * - * Adds the TimeData as one sample for its RunningStatistic. - */ - void PushTimeDataSample(const char * registerName, const AZ::Debug::ProfilerRegister::TimeData& timeData); - - protected: - ///We store here the previous value from the previous timer frame data. - ///This is necessary because AZ_PROFILER_TIMER is cumulative - ///and we need the time spent for each call. - AZStd::unordered_map m_previousTimeData; - }; - } //namespace Statistics -} //namespace AZ From f2ec19b5e7bf7898b63df1cc1f5d2c0d879711c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:08:21 -0800 Subject: [PATCH 065/394] Remove MockComponentApplication reimplementation from Blast.Editor tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Blast/Code/CMakeLists.txt | 1 + .../Editor/EditorBlastChunksAssetHandlerTest.cpp | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Gems/Blast/Code/CMakeLists.txt b/Gems/Blast/Code/CMakeLists.txt index 7f478054b8..a01c0d621a 100644 --- a/Gems/Blast/Code/CMakeLists.txt +++ b/Gems/Blast/Code/CMakeLists.txt @@ -162,6 +162,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::Qt::Test AZ::AzTestShared AZ::AzTest + AZ::AzCoreTestCommon AZ::AzToolsFrameworkTestCommon Gem::Blast.Editor.Static ) diff --git a/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp b/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp index 80a0587b1b..bb5d6160a7 100644 --- a/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp +++ b/Gems/Blast/Code/Tests/Editor/EditorBlastChunksAssetHandlerTest.cpp @@ -16,18 +16,6 @@ namespace UnitTest { - MockComponentApplication::MockComponentApplication() - { - AZ::ComponentApplicationBus::Handler::BusConnect(); - AZ::Interface::Register(this); - } - - MockComponentApplication::~MockComponentApplication() - { - AZ::Interface::Unregister(this); - AZ::ComponentApplicationBus::Handler::BusDisconnect(); - } - class MockAssetCatalogRequestBusHandler final : public AZ::Data::AssetCatalogRequestBus::Handler { From 8cf499b6573ade44a24d77128df66917b497ac29 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:23:32 -0800 Subject: [PATCH 066/394] Remove CfgFileAsset from AzFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzFramework/Asset/CfgFileAsset.h | 24 ------------------- .../AzFramework/azframework_files.cmake | 1 - 2 files changed, 25 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h diff --git a/Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h b/Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h deleted file mode 100644 index 2aadf9ae6c..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Asset/CfgFileAsset.h +++ /dev/null @@ -1,24 +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 AzFramework -{ - class CfgFileAsset - { - public: - AZ_TYPE_INFO(CfgFileAsset, "{117A80A5-206B-4D85-9445-33B446D94C35}") - static const char* GetFileFilter() - { - return "*.cfg"; - } - }; -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 73608d6a85..87108040b2 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -59,7 +59,6 @@ set(FILES Asset/AssetSeedList.h Asset/AssetSystemComponent.cpp Asset/AssetSystemComponent.h - Asset/CfgFileAsset.h Asset/GenericAssetHandler.h Asset/AssetBundleManifest.cpp Asset/AssetBundleManifest.h From 1846077f71f7b183178bb921d3516dd253949add Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:47:12 -0800 Subject: [PATCH 067/394] =?UTF-8?q?=EF=BB=BFunused=20DebugCameraBus=20ebus?= =?UTF-8?q?=20from=20AzFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzFramework/Debug/DebugCameraBus.h | 68 ------------------- .../AzFramework/azframework_files.cmake | 2 - 2 files changed, 70 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h b/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h index 0f8ee60efd..e69de29bb2 100644 --- a/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h +++ b/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h @@ -1,68 +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 - -namespace AZ -{ - class Transform; - class Matrix3x3; - class Vector3; -} - -namespace AzFramework -{ - //! The debug camera allows the user control over the view through mouse + keyboard and/or - //! controller while the game still uses the view camera for everything else. This can for - //! instance be used to debug occlusion culling as all occlusion calculates will be done - //! from the view camera, so the debug camera makes it possible to check if hidden objects - //! are correctly culled. - //! This class can be useful to validate a hypothetical camera-based look-ahead asset streaming system. - //! The developer can update the camera location using this EBus, without requiring to move the viewport camera. - class DebugCameraInterface - : public AZ::EBusTraits - { - public: - enum class Mode - { - FreeFloating, //< Controls move the debug camera through the world. - Fixed, //< The debug camera stays in the position it was navigated to and control is handed back to the game. - Disabled, //< Debug camera is disabled. - - Unknown - }; - - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - //! Sets the debug camera in free floating, fixed or disabled mode. - virtual void SetMode(Mode mode) = 0; - //! Returns the current mode the debug camera is in. - virtual Mode GetMode() const = 0; - - //! Retrieves the world position of the debug camera. This is the same position that can be retrieved - //! from GetTransform. - virtual void GetPosition(AZ::Vector3& result) const = 0; - //! Retrieves the view orientation of the debub camera. This is the same orientation that can be retrieved - //! from GetTransform. - virtual void GetView(AZ::Matrix3x3& result) const = 0; - //! Get the world transform for the debug camera. - virtual void GetTransform(AZ::Transform& result) const = 0; - }; - using DebugCameraBus = AZ::EBus; - - //! The debug camera sends out notifications about some changes. This interface provides access to these. - class DebugCameraEventsInterface - : public AZ::EBusTraits - { - public: - //! Called when the debug camera moves, usually due to user interaction. - virtual void DebugCameraMoved(const AZ::Transform& world) {} - }; - using DebugCameraEventsBus = AZ::EBus; -} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 87108040b2..9af049a7c1 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -77,8 +77,6 @@ set(FILES Asset/Benchmark/BenchmarkSettingsAsset.h CommandLine/CommandLine.h CommandLine/CommandRegistrationBus.h - Debug/DebugCameraBus.h - feature_options.cmake Viewport/ViewportBus.h Viewport/ViewportBus.cpp Viewport/ViewportColors.h From 02c0521a201ee4ec592982249ab16d196741afc8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:48:42 -0800 Subject: [PATCH 068/394] Removes PrefabEntityOwnershipService from AzFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ------------ .../Entity/PrefabEntityOwnershipService.h | 20 ------------------- .../AzFramework/azframework_files.cmake | 2 -- 3 files changed, 35 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp deleted file mode 100644 index 9b2c432332..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp +++ /dev/null @@ -1,13 +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 - -namespace AzFramework -{ -} diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h deleted file mode 100644 index ac24af880a..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h +++ /dev/null @@ -1,20 +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 - -namespace AzFramework -{ - class PrefabEntityOwnershipService - : public EntityOwnershipService - { - - }; -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9af049a7c1..511439ab10 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,8 +120,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h - Entity/PrefabEntityOwnershipService.h - Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 53272d82c9622fa59ff4bef9c5b03ba08c3baae0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:47:13 -0800 Subject: [PATCH 069/394] Revert "Removes PrefabEntityOwnershipService from AzFramework" This reverts commit e2d2cb07a0a1431f8fcdd20ee07ff2788ed603c0. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ++++++++++++ .../Entity/PrefabEntityOwnershipService.h | 20 +++++++++++++++++++ .../AzFramework/azframework_files.cmake | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp new file mode 100644 index 0000000000..9b2c432332 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp @@ -0,0 +1,13 @@ +/* + * 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 + +namespace AzFramework +{ +} diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h new file mode 100644 index 0000000000..ac24af880a --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h @@ -0,0 +1,20 @@ +/* + * 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 + +namespace AzFramework +{ + class PrefabEntityOwnershipService + : public EntityOwnershipService + { + + }; +} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 511439ab10..9af049a7c1 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,6 +120,8 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h + Entity/PrefabEntityOwnershipService.h + Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 507a305f67a86f344d2c174bf0e6acf186369067 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 12:25:29 -0800 Subject: [PATCH 070/394] Cleanup before merge Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/Tests/Jobs.cpp | 98 ------------------- .../Entity/PrefabEntityOwnershipService.cpp | 13 --- .../AzFramework/azframework_files.cmake | 1 - scripts/cleanup/unusued_compilation.py | 25 +++-- 4 files changed, 17 insertions(+), 120 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp diff --git a/Code/Framework/AzCore/Tests/Jobs.cpp b/Code/Framework/AzCore/Tests/Jobs.cpp index 041f4970d1..20c960535d 100644 --- a/Code/Framework/AzCore/Tests/Jobs.cpp +++ b/Code/Framework/AzCore/Tests/Jobs.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -1398,103 +1397,6 @@ namespace UnitTest run(); } - using JobLegacyJobExecutorIsRunning = DefaultJobManagerSetupFixture; - TEST_F(JobLegacyJobExecutorIsRunning, Test) - { - // Note: Legacy JobExecutor exists as an adapter to Legacy CryEngine jobs. - // When writing new jobs instead favor direct use of the AZ::Job type family - AZ::LegacyJobExecutor jobExecutor; - EXPECT_FALSE(jobExecutor.IsRunning()); - - // Completion fences and IsRunning() - { - jobExecutor.PushCompletionFence(); - EXPECT_TRUE(jobExecutor.IsRunning()); - jobExecutor.PopCompletionFence(); - EXPECT_FALSE(jobExecutor.IsRunning()); - } - - AZStd::atomic_bool jobExecuted{ false }; - AZStd::binary_semaphore jobSemaphore; - - jobExecutor.StartJob([&jobSemaphore, &jobExecuted] - { - // Wait until the test thread releases - jobExecuted = true; - jobSemaphore.acquire(); - } - ); - EXPECT_TRUE(jobExecutor.IsRunning()); - - // Allow the job to complete - jobSemaphore.release(); - - // Wait for completion - jobExecutor.WaitForCompletion(); - EXPECT_FALSE(jobExecutor.IsRunning()); - EXPECT_TRUE(jobExecuted); - } - - using JobLegacyJobExecutorWaitForCompletion = DefaultJobManagerSetupFixture; - TEST_F(JobLegacyJobExecutorWaitForCompletion, Test) - { - // Note: Legacy JobExecutor exists as an adapter to Legacy CryEngine jobs. - // When writing new jobs instead favor direct use of the AZ::Job type family - AZ::LegacyJobExecutor jobExecutor; - - // Semaphores used to park job threads until released - const AZ::u32 numParkJobs = AZ::JobContext::GetGlobalContext()->GetJobManager().GetNumWorkerThreads(); - AZStd::vector jobSemaphores(numParkJobs); - - // Data destination for workers - const AZ::u32 workJobCount = numParkJobs * 2; - AZStd::vector jobData(workJobCount, 0); - - // Touch completion multiple times as a test of correctly transitioning in and out of the all jobs completed state - AZ::u32 NumCompletionCycles = 5; - for (AZ::u32 completionItrIdx = 0; completionItrIdx < NumCompletionCycles; ++completionItrIdx) - { - // Intentionally park every job thread - for (auto& jobSemaphore : jobSemaphores) - { - jobExecutor.StartJob([&jobSemaphore] - { - jobSemaphore.acquire(); - } - ); - } - EXPECT_TRUE(jobExecutor.IsRunning()); - - // Kick off verifiable "work" jobs - for (AZ::u32 i = 0; i < workJobCount; ++i) - { - jobExecutor.StartJob([i, &jobData] - { - jobData[i] = i + 1; - } - ); - } - EXPECT_TRUE(jobExecutor.IsRunning()); - - // Now released our parked job threads - for (auto& jobSemaphore : jobSemaphores) - { - jobSemaphore.release(); - } - - // And wait for all jobs to finish - jobExecutor.WaitForCompletion(); - EXPECT_FALSE(jobExecutor.IsRunning()); - - // Verify our workers ran and clear data - for (size_t i = 0; i < workJobCount; ++i) - { - EXPECT_EQ(jobData[i], i + 1); - jobData[i] = 0; - } - } - } - class JobCompletionCompleteNotScheduled : public DefaultJobManagerSetupFixture { diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp deleted file mode 100644 index 9b2c432332..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp +++ /dev/null @@ -1,13 +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 - -namespace AzFramework -{ -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9af049a7c1..9693d75b06 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -121,7 +121,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h Entity/PrefabEntityOwnershipService.h - Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 25fa4ca3ce..0d188aaa6f 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -14,7 +14,12 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../bui import ci_build EXTENSIONS_OF_INTEREST = ('.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl') -EXCLUSIONS = ('AZ_DECLARE_MODULE_CLASS') +EXCLUSIONS = ( + 'AZ_DECLARE_MODULE_CLASS(', + 'REGISTER_QT_CLASS_DESC(', + 'TEST(', + 'TEST_F(' +) def create_filelist(path): filelist = set() @@ -42,6 +47,13 @@ def is_excluded(file): normalized_file = os.path.normpath(file) if '\\Platform\\' in normalized_file and not '\\Windows\\' in normalized_file: return True + if '\\Template\\' in normalized_file: + return True + with open(file, 'r') as file: + contents = file.readlines() + for exclusion_term in EXCLUSIONS: + if exclusion_term in contents: + return True return False def filter_from_processed(filelist, filter_file_path): @@ -49,11 +61,7 @@ def filter_from_processed(filelist, filter_file_path): return # nothing to filter with open(filter_file_path, 'r') as filter_file: - try: - processed_files = [s.strip() for s in filter_file.readlines()] - except UnicodeDecodeError as err: - print('Error reading file {}, err: {}'.format(filter_file_path, err)) - sys.exit(1) + processed_files = [s.strip() for s in filter_file.readlines()] filelist -= set(processed_files) filelist = [f for f in filelist if not is_excluded(f)] @@ -65,10 +73,11 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filter_from_processed(filelist, filter_file_path) + sorted_filelist = sorted(filelist) # 3. For each file - total_files = len(filelist) + total_files = len(sorted_filelist) current_files = 1 - for file in filelist: + for file in sorted_filelist: print(f"[{current_files}/{total_files}] Trying {file}") # b. create backup shutil.copy(file, file + '.bak') From 7c301ef762897fc82edd43783f23eec186a02cb0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:25:14 -0800 Subject: [PATCH 071/394] cleanup script updates Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 42 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 0d188aaa6f..715ba1f6fa 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -7,6 +7,7 @@ # import argparse +import fnmatch import os import shutil import sys @@ -20,6 +21,17 @@ EXCLUSIONS = ( 'TEST(', 'TEST_F(' ) +PATH_EXCLUSIONS = ( + '*\\Platform\\Android\\*', + '*\\Platform\\Common\\*', + '*\\Platform\\iOS\\*', + '*\\Platform\\Linux\\*', + '*\\Platform\\Mac\\*', + 'Templates\\*', + 'python\\*', + 'build\\*', + 'install\\*' +) def create_filelist(path): filelist = set() @@ -32,38 +44,37 @@ def create_filelist(path): extension = os.path.splitext(f)[1] extension_lower = extension.lower() if extension_lower in EXTENSIONS_OF_INTEREST: - filelist.add(os.path.join(dp, f)) + normalized_file = os.path.normpath(os.path.join(dp, f)) + filelist.add(normalized_file) else: extension = os.path.splitext(input_file)[1] extension_lower = extension.lower() if extension_lower in EXTENSIONS_OF_INTEREST: - filelist.add(os.path.join(os.getcwd(), input_file)) + normalized_file = os.path.normpath(os.path.join(os.getcwd(), input_file)) + filelist.add(normalized_file) else: print(f'Error, file {input_file} does not have an extension of interest') sys.exit(1) return filelist def is_excluded(file): - normalized_file = os.path.normpath(file) - if '\\Platform\\' in normalized_file and not '\\Windows\\' in normalized_file: - return True - if '\\Template\\' in normalized_file: - return True + for path_exclusion in PATH_EXCLUSIONS: + if fnmatch.fnmatch(file, path_exclusion): + return True with open(file, 'r') as file: - contents = file.readlines() + contents = file.read() for exclusion_term in EXCLUSIONS: if exclusion_term in contents: return True return False def filter_from_processed(filelist, filter_file_path): - if not os.path.exists(filter_file_path): - return # nothing to filter - - with open(filter_file_path, 'r') as filter_file: - processed_files = [s.strip() for s in filter_file.readlines()] - filelist -= set(processed_files) filelist = [f for f in filelist if not is_excluded(f)] + if os.path.exists(filter_file_path): + with open(filter_file_path, 'r') as filter_file: + processed_files = [s.strip() for s in filter_file.readlines()] + filelist -= set(processed_files) + return filelist def cleanup_unused_compilation(path): # 1. Create a list of all h/cpp files (consider multiple extensions) @@ -72,8 +83,7 @@ def cleanup_unused_compilation(path): # can take a while. If something is found in the middle, we want to be able to continue instead of # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') - filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist) + filelist = filter_from_processed(filelist, filter_file_path) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 5f55815fca0d03bd006bf852abee33878b698970 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:03:29 -0800 Subject: [PATCH 072/394] more filters/using reverse on this node Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 715ba1f6fa..a162683460 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -19,7 +19,8 @@ EXCLUSIONS = ( 'AZ_DECLARE_MODULE_CLASS(', 'REGISTER_QT_CLASS_DESC(', 'TEST(', - 'TEST_F(' + 'TEST_F(', + 'INSTANTIATE_TEST_CASE_P(' ) PATH_EXCLUSIONS = ( '*\\Platform\\Android\\*', @@ -84,6 +85,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) + sorted_filelist = sorted(filelist, reverse=True) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 6876cfda30ffeac9af894315da5367c4f0ca9336 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:02:07 -0800 Subject: [PATCH 073/394] =?UTF-8?q?=EF=BB=BFMore=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index a162683460..f209d5325b 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -20,7 +20,8 @@ EXCLUSIONS = ( 'REGISTER_QT_CLASS_DESC(', 'TEST(', 'TEST_F(', - 'INSTANTIATE_TEST_CASE_P(' + 'INSTANTIATE_TEST_CASE_P(', + 'AZ_UNIT_TEST_HOOK(' ) PATH_EXCLUSIONS = ( '*\\Platform\\Android\\*', @@ -85,7 +86,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist, reverse=True) + sorted_filelist = sorted(filelist) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From bbec1b52421d7c379e791148f961a53f48fd7d73 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 15 Nov 2021 09:34:00 -0800 Subject: [PATCH 074/394] more exclusions for unused_compilation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index f209d5325b..69ff6bc3cf 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -21,7 +21,10 @@ EXCLUSIONS = ( 'TEST(', 'TEST_F(', 'INSTANTIATE_TEST_CASE_P(', - 'AZ_UNIT_TEST_HOOK(' + 'AZ_UNIT_TEST_HOOK(', + 'IMPLEMENT_TEST_EXECUTABLE_MAIN(', + 'DllMain(', + 'CreatePluginInstance(' ) PATH_EXCLUSIONS = ( '*\\Platform\\Android\\*', @@ -32,7 +35,8 @@ PATH_EXCLUSIONS = ( 'Templates\\*', 'python\\*', 'build\\*', - 'install\\*' + 'install\\*', + 'Code\\Framework\\AzCore\\AzCore\\Android\\*' ) def create_filelist(path): From 2de27a6d08fc25126a2fd67beedc87175f234734 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 15 Nov 2021 14:04:05 -0800 Subject: [PATCH 075/394] some more exclussions Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 69ff6bc3cf..1f1a9894c7 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -21,6 +21,7 @@ EXCLUSIONS = ( 'TEST(', 'TEST_F(', 'INSTANTIATE_TEST_CASE_P(', + 'INSTANTIATE_TYPED_TEST_CASE_P(', 'AZ_UNIT_TEST_HOOK(', 'IMPLEMENT_TEST_EXECUTABLE_MAIN(', 'DllMain(', @@ -75,7 +76,7 @@ def is_excluded(file): return False def filter_from_processed(filelist, filter_file_path): - filelist = [f for f in filelist if not is_excluded(f)] + filelist = set([f for f in filelist if not is_excluded(f)]) if os.path.exists(filter_file_path): with open(filter_file_path, 'r') as filter_file: processed_files = [s.strip() for s in filter_file.readlines()] From 8e1a3bc0731a23023eb308035d5c0fa80e05bc5d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:52:52 -0800 Subject: [PATCH 076/394] Removes CVarMenu from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CVarMenu.cpp | 186 ----------------------------- Code/Editor/CVarMenu.h | 65 ---------- Code/Editor/MainWindow.cpp | 1 - Code/Editor/MainWindow.h | 1 - Code/Editor/editor_lib_files.cmake | 2 - 5 files changed, 255 deletions(-) delete mode 100644 Code/Editor/CVarMenu.cpp delete mode 100644 Code/Editor/CVarMenu.h diff --git a/Code/Editor/CVarMenu.cpp b/Code/Editor/CVarMenu.cpp deleted file mode 100644 index 6449be9b3c..0000000000 --- a/Code/Editor/CVarMenu.cpp +++ /dev/null @@ -1,186 +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 "EditorDefs.h" - -#include "CVarMenu.h" - -CVarMenu::CVarMenu(QWidget* parent) - : QMenu(parent) -{ -} - -void CVarMenu::AddCVarToggleItem(CVarToggle cVarToggle) -{ - // Add CVar toggle action - QAction* action = addAction(cVarToggle.m_displayName); - connect(action, &QAction::triggered, [this, cVarToggle](bool checked) - { - // Update the CVar's value based on the action's new checked state - ICVar* cVar = gEnv->pConsole->GetCVar(cVarToggle.m_cVarName.toUtf8().data()); - if (cVar) - { - SetCVar(cVar, checked ? cVarToggle.m_onValue : cVarToggle.m_offValue); - } - }); - action->setCheckable(true); - - // Initialize the action's checked state based on the associated CVar's value - ICVar* cVar = gEnv->pConsole->GetCVar(cVarToggle.m_cVarName.toUtf8().data()); - bool checked = (cVar && cVar->GetFVal() == cVarToggle.m_onValue); - action->setChecked(checked); -} - -void CVarMenu::AddCVarValuesItem(QString cVarName, - QString displayName, - CVarDisplayNameValuePairs availableCVarValues, - float offValue) -{ - // Add a submenu offering multiple values for one CVar - QMenu* menu = addMenu(displayName); - QActionGroup* group = new QActionGroup(menu); - group->setExclusive(true); - - ICVar* cVar = gEnv->pConsole->GetCVar(cVarName.toUtf8().data()); - float cVarValue = cVar ? cVar->GetFVal() : 0.0f; - for (const auto& availableCVarValue : availableCVarValues) - { - QAction* action = menu->addAction(availableCVarValue.first); - action->setCheckable(true); - group->addAction(action); - - float availableOnValue = availableCVarValue.second; - connect(action, &QAction::triggered, [this, action, cVarName, availableOnValue, offValue](bool checked) - { - ICVar* cVar = gEnv->pConsole->GetCVar(cVarName.toUtf8().data()); - if (cVar) - { - if (!checked) - { - SetCVar(cVar, offValue); - } - else - { - // Toggle the CVar and update the action's checked state to - // allow none of the items to be checked in the exclusive group. - // Otherwise we could have just used the action's currently checked - // state and updated the CVar's value only - bool cVarOn = (cVar->GetFVal() == availableOnValue); - checked = !cVarOn; - SetCVar(cVar, checked ? availableOnValue : offValue); - action->setChecked(checked); - } - } - }); - - // Initialize the action's checked state based on the CVar's current value - bool checked = (cVarValue == availableOnValue); - action->setChecked(checked); - } -} - -void CVarMenu::AddUniqueCVarsItem(QString displayName, - AZStd::vector availableCVars) -{ - // Add a submenu of actions offering values for unique CVars - QMenu* menu = addMenu(displayName); - QActionGroup* group = new QActionGroup(menu); - group->setExclusive(true); - - for (const CVarToggle& availableCVar : availableCVars) - { - QAction* action = menu->addAction(availableCVar.m_displayName); - action->setCheckable(true); - group->addAction(action); - - connect(action, &QAction::triggered, [this, action, availableCVar, availableCVars](bool checked) - { - ICVar* cVar = gEnv->pConsole->GetCVar(availableCVar.m_cVarName.toUtf8().data()); - if (cVar) - { - if (!checked) - { - SetCVar(cVar, availableCVar.m_offValue); - } - else - { - // Toggle the CVar and update the action's checked state to - // allow none of the items to be checked in the exclusive group. - // Otherwise we could have just used the action's currently checked - // state and updated the CVar's value only - bool cVarOn = (cVar->GetFVal() == availableCVar.m_onValue); - bool cVarChecked = !cVarOn; - SetCVar(cVar, cVarChecked ? availableCVar.m_onValue : availableCVar.m_offValue); - action->setChecked(cVarChecked); - if (cVarChecked) - { - // Set the rest of the CVars in the group to their off values - SetCVarsToOffValue(availableCVars, availableCVar); - } - } - } - }); - - // Initialize the action's checked state based on its associated CVar's current value - ICVar* cVar = gEnv->pConsole->GetCVar(availableCVar.m_cVarName.toUtf8().data()); - bool cVarChecked = (cVar && cVar->GetFVal() == availableCVar.m_onValue); - action->setChecked(cVarChecked); - if (cVarChecked) - { - // Set the rest of the CVars in the group to their off values - SetCVarsToOffValue(availableCVars, availableCVar); - } - } -} - -void CVarMenu::AddResetCVarsItem() -{ - QAction* action = addAction(tr("Reset to Default")); - connect(action, &QAction::triggered, this, [this]() - { - for (auto it : m_originalCVarValues) - { - ICVar* cVar = gEnv->pConsole->GetCVar(it.first.c_str()); - if (cVar) - { - cVar->Set(it.second); - } - } - }); -} - -void CVarMenu::SetCVarsToOffValue(const AZStd::vector& cVarToggles, const CVarToggle& excludeCVarToggle) -{ - // Set all but the specified CVars to their off values - for (const CVarToggle& cVarToggle : cVarToggles) - { - if (cVarToggle.m_cVarName != excludeCVarToggle.m_cVarName - || cVarToggle.m_onValue != excludeCVarToggle.m_onValue) - { - ICVar* cVar = gEnv->pConsole->GetCVar(cVarToggle.m_cVarName.toUtf8().data()); - if (cVar) - { - SetCVar(cVar, cVarToggle.m_offValue); - } - } - } -} - -void CVarMenu::SetCVar(ICVar* cVar, float newValue) -{ - float oldValue = cVar->GetFVal(); - cVar->Set(newValue); - - // Store original value for CVar if not already in the list - m_originalCVarValues.emplace(AZStd::string(cVar->GetName()), oldValue); -} - -void CVarMenu::AddSeparator() -{ - addSeparator(); -} diff --git a/Code/Editor/CVarMenu.h b/Code/Editor/CVarMenu.h deleted file mode 100644 index 5195bd99d7..0000000000 --- a/Code/Editor/CVarMenu.h +++ /dev/null @@ -1,65 +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 - -#include -#include -#include -#include - -struct ICVar; - -class CVarMenu - : public QMenu -{ - Q_OBJECT -public: - // CVar that can be toggled on and off - struct CVarToggle - { - QString m_cVarName; - QString m_displayName; - float m_onValue; - float m_offValue; - }; - - // List of a CVar's available values and their descriptions - using CVarDisplayNameValuePairs = AZStd::vector>; - - CVarMenu(QWidget* parent = nullptr); - - // Add an action that turns a CVar on/off - void AddCVarToggleItem(CVarToggle cVarToggle); - - // Add a submenu of actions for a CVar that offers multiple values for exclusive selection - void AddCVarValuesItem(QString cVarName, - QString displayName, - CVarDisplayNameValuePairs availableCVarValues, - float offValue); - - // Add a submenu of actions for exclusively turning unique CVars on/off - void AddUniqueCVarsItem(QString displayName, - AZStd::vector availableCVars); - - // Add an action to reset all CVars to their original values before they - // were modified by this menu - void AddResetCVarsItem(); - - void AddSeparator(); - -private: - void SetCVarsToOffValue(const AZStd::vector& cVarToggles, const CVarToggle& excludeCVarToggle); - void SetCVar(ICVar* cVar, float newValue); - - // Original CVar values before they were modified by this menu - AZStd::unordered_map m_originalCVarValues; -}; diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index bbebac96a3..dca6de4fc3 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -77,7 +77,6 @@ AZ_POP_DISABLE_WARNING #include "ToolbarManager.h" #include "Core/QtEditorApplication.h" #include "UndoDropDown.h" -#include "CVarMenu.h" #include "EditorViewportSettings.h" #include "KeyboardCustomizationSettings.h" diff --git a/Code/Editor/MainWindow.h b/Code/Editor/MainWindow.h index 1e375b08f2..5adf9a8036 100644 --- a/Code/Editor/MainWindow.h +++ b/Code/Editor/MainWindow.h @@ -49,7 +49,6 @@ class ToolbarCustomizationDialog; class QWidgetAction; class ActionManager; class ShortcutDispatcher; -class CVarMenu; namespace AzQtComponents { diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 758143ac8d..270c5293a7 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -249,8 +249,6 @@ set(FILES CryEditPy.cpp CryEdit.cpp CryEdit.h - CVarMenu.cpp - CVarMenu.h EditorToolsApplication.cpp EditorToolsApplication.h EditorToolsApplicationAPI.h From 328a5ddbd300876899c9f5a0a28a9d9714c55102 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:54:24 -0800 Subject: [PATCH 077/394] duplicated bus that is in AzToolsFramework, this one is not used Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorPreferencesBus.h | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Code/Editor/EditorPreferencesBus.h diff --git a/Code/Editor/EditorPreferencesBus.h b/Code/Editor/EditorPreferencesBus.h deleted file mode 100644 index d6c9e3ed55..0000000000 --- a/Code/Editor/EditorPreferencesBus.h +++ /dev/null @@ -1,24 +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 - -//! Allows handlers to be notified when settings are changed to refresh accordingly -class EditorPreferencesNotifications - : public AZ::EBusTraits -{ -public: - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - //! Notifies about changes in the Editor Preferences - virtual void OnEditorPreferencesChanged() {} -}; -using EditorPreferencesNotificationBus = AZ::EBus; From 9107af5af7a3bff45b8379e5dfc8c60b857c919b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:59:10 -0800 Subject: [PATCH 078/394] Removes IObservable/Observable from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IObservable.h | 20 ------ Code/Editor/Util/IObservable.h | 20 ------ Code/Editor/Util/Observable.h | 103 ----------------------------- Code/Editor/editor_lib_files.cmake | 3 - 4 files changed, 146 deletions(-) delete mode 100644 Code/Editor/IObservable.h delete mode 100644 Code/Editor/Util/IObservable.h delete mode 100644 Code/Editor/Util/Observable.h diff --git a/Code/Editor/IObservable.h b/Code/Editor/IObservable.h deleted file mode 100644 index 9de78a7bc1..0000000000 --- a/Code/Editor/IObservable.h +++ /dev/null @@ -1,20 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_IOBSERVABLE_H -#define CRYINCLUDE_EDITOR_IOBSERVABLE_H -#pragma once - -//! Observable macro to be used in pure interfaces -#define DEFINE_OBSERVABLE_PURE_METHODS(observerClassName) \ - virtual bool RegisterObserver(observerClassName * pObserver) = 0; \ - virtual bool UnregisterObserver(observerClassName * pObserver) = 0; \ - virtual void UnregisterAllObservers() = 0; - -#endif // CRYINCLUDE_EDITOR_IOBSERVABLE_H diff --git a/Code/Editor/Util/IObservable.h b/Code/Editor/Util/IObservable.h deleted file mode 100644 index 5fa7201c80..0000000000 --- a/Code/Editor/Util/IObservable.h +++ /dev/null @@ -1,20 +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 - * - */ - - -// Description : Handy macro when working with observers in interfaces - - -#ifndef CRYINCLUDE_EDITOR_UTIL_IOBSERVABLE_H -#define CRYINCLUDE_EDITOR_UTIL_IOBSERVABLE_H -#pragma once -#define DEFINE_OBSERVABLE_PURE_METHODS(observerClassName) \ - virtual bool RegisterObserver(observerClassName * pObserver) = 0; \ - virtual bool UnregisterObserver(observerClassName * pObserver) = 0; \ - virtual void UnregisterAllObservers() = 0; -#endif // CRYINCLUDE_EDITOR_UTIL_IOBSERVABLE_H diff --git a/Code/Editor/Util/Observable.h b/Code/Editor/Util/Observable.h deleted file mode 100644 index e42fc2c94a..0000000000 --- a/Code/Editor/Util/Observable.h +++ /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 - * - */ - - -// Description : This file declares templates to be used when a class can -// have a list of observers to feed - - -#ifndef CRYINCLUDE_EDITOR_UTIL_OBSERVABLE_H -#define CRYINCLUDE_EDITOR_UTIL_OBSERVABLE_H -#pragma once - -#include - -//! Observable template class, holds a list of observers which can be called at once using the helper defines -template -class CObservable -{ -public: - // Description: - // Register a new observer for the class, will check if not already added - // Return: - // true - if the observer was successfully added to the list - // false - if the observer is already in the list - bool RegisterObserver(T* pObserver) - { - if (m_observers.end() != std::find(m_observers.begin(), m_observers.end(), pObserver)) - { - return false; - } - - m_observers.push_back(pObserver); - - return true; - } - - // Description: - // Unregister an observer from the list - // Return: - // true - if the observer was successfuly removed - // false - if the observer is not in the list - bool UnregisterObserver(T* pObserver) - { - typename std::vector::iterator iter; - - if (m_observers.end() == (iter = std::find(m_observers.begin(), m_observers.end(), pObserver))) - { - return false; - } - - m_observers.erase(iter); - - return true; - } - - // Description: - // Uregister all the observers - void UnregisterAllObservers() - { - m_observers.clear(); - } - -protected: - std::vector m_observers; -}; - -// -// Helper defines to ease the process of calling the methods of all observers in the list -// - -// Description: -// Call the method of the observers, this must be used inside the subject class -// Example: CALL_OBSERVERS_METHOD(OnStuffHappened(120, "NO!")) -#define CALL_OBSERVERS_METHOD(methodCall) \ - { for (size_t iObs = 0, iObsCount = m_observers.size(); iObs < iObsCount; ++iObs) { m_observers[iObs]->methodCall; } \ - } - -// Description: -// Call the method of the observers, this can be used outside the subject class -// Example: CALL_OBSERVERS_METHOD_OF(pSomeObservableSubject, OnStuffHappened(120, "NO!")) -#define CALL_OBSERVERS_METHOD_OF(pObservable, methodCall) \ - { for (size_t iObs = 0, iObsCount = pObservable->m_observers.size(); iObs < iObsCount; ++iObs) { pObservable->m_observers[iObs]->methodCall; } \ - } - -// Description: -// Call the method of the observers, this can be called using a custom vector of observers -// Example: CALL_SPECIFIED_OBSERVERS_LIST_METHOD(vMyPreciousSpecialObservers, OnStuffHappened(120, "NO!")) -#define CALL_SPECIFIED_OBSERVERS_LIST_METHOD(vObservers, methodCall) \ - { for (size_t iObs = 0, iObsCount = vObservers.size(); iObs < iObsCount; ++iObs) { vObservers[iObs]->methodCall; } \ - } - -// Description: -// Implement the observable methods when the user class is inheriting from a virtual interface using the observable methods -#define IMPLEMENT_OBSERVABLE_METHODS(observerClassName) \ - virtual bool RegisterObserver(observerClassName * pObserver) { return CObservable::RegisterObserver(pObserver); }; \ - virtual bool UnregisterObserver(observerClassName * pObserver) { return CObservable::UnregisterObserver(pObserver); }; \ - virtual void UnregisterAllObservers() { CObservable::UnregisterAllObservers(); }; -#endif // CRYINCLUDE_EDITOR_UTIL_OBSERVABLE_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 270c5293a7..bcff55f40f 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -438,7 +438,6 @@ set(FILES FBXExporterDialog.h FileTypeUtils.h GridUtils.h - IObservable.h IPostRenderer.h ToolBox.h TrackViewNewSequenceDialog.h @@ -647,11 +646,9 @@ set(FILES Util/GeometryUtil.cpp Util/GuidUtil.cpp Util/GuidUtil.h - Util/IObservable.h Util/Mailer.h Util/NamedData.cpp Util/NamedData.h - Util/Observable.h Util/PakFile.cpp Util/PakFile.h Util/PredefinedAspectRatios.cpp From 06331dae37049067461e69bc5136ec2fb693450f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 12:04:41 -0800 Subject: [PATCH 079/394] =?UTF-8?q?=EF=BB=BFRemoves=20Report=20from=20Code?= =?UTF-8?q?/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Report.h | 183 ----------------------------- Code/Editor/editor_lib_files.cmake | 1 - 2 files changed, 184 deletions(-) delete mode 100644 Code/Editor/Report.h diff --git a/Code/Editor/Report.h b/Code/Editor/Report.h deleted file mode 100644 index 1dbf3788cd..0000000000 --- a/Code/Editor/Report.h +++ /dev/null @@ -1,183 +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 - * - */ - - -// Description : Generic report class, which contains arbitrary report entries. - -#ifndef CRYINCLUDE_EDITOR_REPORT_H -#define CRYINCLUDE_EDITOR_REPORT_H -#pragma once - - -class IReportField -{ -public: - virtual ~IReportField() {} - - virtual const char* GetDescription() const = 0; - virtual const char* GetText() const = 0; -}; - -template -class CReportField - : public IReportField -{ -public: - typedef T Object; - typedef G TextGetter; - - CReportField(Object& object, const char* description, TextGetter& getter); - virtual const char* GetDescription() const; - virtual const char* GetText() const; - -private: - TextGetter m_getter; - string m_text; - string m_description; -}; - -class IReportRecord -{ -public: - virtual ~IReportRecord() {} - virtual int GetFieldCount() const = 0; - virtual const char* GetFieldDescription(int fieldIndex) const = 0; - virtual const char* GetFieldText(int fieldIndex) const = 0; -}; - -template -class CReportRecord - : public IReportRecord -{ -public: - typedef T Object; - - CReportRecord(Object& object); - virtual ~CReportRecord(); - virtual int GetFieldCount() const; - virtual const char* GetFieldDescription(int fieldIndex) const; - virtual const char* GetFieldText(int fieldIndex) const; - template - CReportField* AddField(const char* description, G& getter); - -private: - Object m_object; - typedef std::vector FieldContainer; - FieldContainer m_fields; -}; - -class CReport -{ -public: - ~CReport(); - template - CReportRecord* AddRecord(T& object); - int GetRecordCount() const; - IReportRecord* GetRecord(int recordIndex); - void Clear(); - -private: - typedef std::vector RecordContainer; - RecordContainer m_records; -}; - -template -inline CReportField::CReportField(Object& object, const char* description, TextGetter& getter) - : m_getter(getter) - , m_description(description) -{ - m_text = m_getter(object); -} - -template -inline const char* CReportField::GetDescription() const -{ - return m_description.c_str(); -} - -template -inline const char* CReportField::GetText() const -{ - return m_text.c_str(); -} - -template -inline CReportRecord::CReportRecord(Object& object) - : m_object(object) -{ -} - -template -inline CReportRecord::~CReportRecord() -{ - for (FieldContainer::iterator it = m_fields.begin(); it != m_fields.end(); ++it) - { - delete (*it); - } -} - -template -inline int CReportRecord::GetFieldCount() const -{ - return m_fields.size(); -} - -template -inline const char* CReportRecord::GetFieldDescription(int fieldIndex) const -{ - return m_fields[fieldIndex]->GetDescription(); -} - -template -inline const char* CReportRecord::GetFieldText(int fieldIndex) const -{ - return m_fields[fieldIndex]->GetText(); -} - -template -template -inline CReportField* CReportRecord::AddField(const char* description, G& getter) -{ - CReportField* field = new CReportField(m_object, description, getter); - m_fields.push_back(field); - return field; -} - -inline CReport::~CReport() -{ - Clear(); -} - -template -inline CReportRecord* CReport::AddRecord(T& object) -{ - CReportRecord* record = new CReportRecord(object); - m_records.push_back(record); - return record; -} - -inline int CReport::GetRecordCount() const -{ - return m_records.size(); -} - -inline IReportRecord* CReport::GetRecord(int recordIndex) -{ - return m_records[recordIndex]; -} - -inline void CReport::Clear() -{ - for (RecordContainer::iterator it = m_records.begin(); it != m_records.end(); ++it) - { - delete (*it); - } - m_records.clear(); -} - -#endif // CRYINCLUDE_EDITOR_REPORT_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index bcff55f40f..4545bb5b44 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -546,7 +546,6 @@ set(FILES LevelInfo.h ProcessInfo.cpp ProcessInfo.h - Report.h TrackView/AtomOutputFrameCapture.cpp TrackView/AtomOutputFrameCapture.h TrackView/TrackViewDialog.qrc From d44d01c6a57e5d32c4efe11dbfbf6f99e58a7fff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 15:01:31 -0800 Subject: [PATCH 080/394] Removes CommandManagerBus from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Commands/CommandManagerBus.h | 30 ------------------------ 1 file changed, 30 deletions(-) delete mode 100644 Code/Editor/Commands/CommandManagerBus.h diff --git a/Code/Editor/Commands/CommandManagerBus.h b/Code/Editor/Commands/CommandManagerBus.h deleted file mode 100644 index a5edceaee8..0000000000 --- a/Code/Editor/Commands/CommandManagerBus.h +++ /dev/null @@ -1,30 +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 - -class CommandManagerRequests : public AZ::EBusTraits -{ -public: - - struct CommandDetails - { - AZStd::string m_name; - AZStd::vector m_arguments; - }; - - virtual AZStd::vector GetCommands() const = 0; - virtual void ExecuteCommand(const AZStd::string& commandLine) {} - - virtual void GetCommandDetails(AZStd::string commandName, CommandDetails& outArguments) const = 0; - -}; - -using CommandManagerRequestBus = AZ::EBus; From 28c40764e6e843e957071edb5806b22ec43c66bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:26:36 -0800 Subject: [PATCH 081/394] Remove SubObjSelection from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Objects/BaseObject.h | 1 - Code/Editor/Objects/SubObjSelection.cpp | 62 ----------------- Code/Editor/Objects/SubObjSelection.h | 91 ------------------------- Code/Editor/editor_lib_files.cmake | 2 - 4 files changed, 156 deletions(-) delete mode 100644 Code/Editor/Objects/SubObjSelection.cpp delete mode 100644 Code/Editor/Objects/SubObjSelection.h diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h index fea248c7f7..666d9f3e1d 100644 --- a/Code/Editor/Objects/BaseObject.h +++ b/Code/Editor/Objects/BaseObject.h @@ -31,7 +31,6 @@ class CUndoBaseObject; class CObjectManager; class CGizmo; class CObjectArchive; -struct SSubObjSelectionModifyContext; struct SRayHitInfo; class CPopupMenuItem; class QMenu; diff --git a/Code/Editor/Objects/SubObjSelection.cpp b/Code/Editor/Objects/SubObjSelection.cpp deleted file mode 100644 index 3a67b8dfb7..0000000000 --- a/Code/Editor/Objects/SubObjSelection.cpp +++ /dev/null @@ -1,62 +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 "EditorDefs.h" - -#include "SubObjSelection.h" - -SSubObjSelOptions g_SubObjSelOptions; - -/* - -////////////////////////////////////////////////////////////////////////// -bool CSubObjSelContext::IsEmpty() const -{ - if (GetCount() == 0) - return false; - for (int i = 0; i < GetCount(); i++) - { - CSubObjectSelection *pSel = GetSelection(i); - if (!pSel->IsEmpty()) - return true; - } - return false; -} - -////////////////////////////////////////////////////////////////////////// -void CSubObjSelContext::ModifySelection( SSubObjSelectionModifyContext &modCtx ) -{ - for (int n = 0; n < GetCount(); n++) - { - CSubObjectSelection *pSel = GetSelection(n); - if (pSel->IsEmpty()) - continue; - modCtx.pSubObjSelection = pSel; - pSel->pGeometry->SubObjSelectionModify( modCtx ); - } - if (modCtx.type == SO_MODIFY_MOVE) - { - OnSelectionChange(); - } -} - -////////////////////////////////////////////////////////////////////////// -void CSubObjSelContext::AcceptModifySelection() -{ - for (int n = 0; n < GetCount(); n++) - { - CSubObjectSelection *pSel = GetSelection(n); - if (pSel->IsEmpty()) - continue; - if (pSel->pGeometry) - pSel->pGeometry->Update(); - } -} - -*/ diff --git a/Code/Editor/Objects/SubObjSelection.h b/Code/Editor/Objects/SubObjSelection.h deleted file mode 100644 index 9e07bdc203..0000000000 --- a/Code/Editor/Objects/SubObjSelection.h +++ /dev/null @@ -1,91 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_OBJECTS_SUBOBJSELECTION_H -#define CRYINCLUDE_EDITOR_OBJECTS_SUBOBJSELECTION_H -#pragma once - -////////////////////////////////////////////////////////////////////////// -// Sub Object element type. -////////////////////////////////////////////////////////////////////////// -enum ESubObjElementType -{ - SO_ELEM_NONE = 0, - SO_ELEM_VERTEX, - SO_ELEM_EDGE, - SO_ELEM_FACE, - SO_ELEM_POLYGON, - SO_ELEM_UV, -}; - -////////////////////////////////////////////////////////////////////////// -enum ESubObjDisplayType -{ - SO_DISPLAY_WIREFRAME, - SO_DISPLAY_FLAT, - SO_DISPLAY_GEOMETRY, -}; - -////////////////////////////////////////////////////////////////////////// -// Options for sub-object selection. -////////////////////////////////////////////////////////////////////////// -struct SSubObjSelOptions -{ - bool bSelectByVertex; - bool bIgnoreBackfacing; - int nMatID; - - bool bSoftSelection; - float fSoftSelFalloff; - - // Display options. - bool bDisplayBackfacing; - bool bDisplayNormals; - float fNormalsLength; - ESubObjDisplayType displayType; - - SSubObjSelOptions() - { - bSelectByVertex = false; - bIgnoreBackfacing = false; - bSoftSelection = false; - nMatID = 0; - fSoftSelFalloff = 1; - - bDisplayBackfacing = true; - bDisplayNormals = false; - displayType = SO_DISPLAY_FLAT; - fNormalsLength = 0.4f; - } -}; - -extern SSubObjSelOptions g_SubObjSelOptions; - - -////////////////////////////////////////////////////////////////////////// -enum ESubObjSelectionModifyType -{ - SO_MODIFY_UNSELECT, - SO_MODIFY_MOVE, - SO_MODIFY_ROTATE, - SO_MODIFY_SCALE, -}; - -////////////////////////////////////////////////////////////////////////// -// This structure is passed when user is dragging sub object selection. -////////////////////////////////////////////////////////////////////////// -struct SSubObjSelectionModifyContext -{ - CViewport* view; - ESubObjSelectionModifyType type; - Vec3 vValue; - Matrix34 worldRefFrame; -}; - -#endif // CRYINCLUDE_EDITOR_OBJECTS_SUBOBJSELECTION_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 4545bb5b44..aa52b18b45 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -452,8 +452,6 @@ set(FILES Objects/DisplayContextShared.inl Objects/SelectionGroup.cpp Objects/SelectionGroup.h - Objects/SubObjSelection.cpp - Objects/SubObjSelection.h Objects/ObjectLoader.cpp Objects/ObjectLoader.h Objects/ObjectManager.cpp From 580027f75e919b3e45347f3f895c994d501af77a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:36:59 -0800 Subject: [PATCH 082/394] Removes ComponentPaletteWindow from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ComponentEntityEditorPlugin.cpp | 1 - .../ComponentPaletteWindow.cpp | 116 ------------------ .../ComponentPalette/ComponentPaletteWindow.h | 59 --------- .../componententityeditorplugin_files.cmake | 2 - 4 files changed, 178 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp index 50b315b9c3..9022341309 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp @@ -14,7 +14,6 @@ #include "UI/QComponentEntityEditorOutlinerWindow.h" #include "UI/QComponentLevelEntityEditorMainWindow.h" #include "UI/ComponentPalette/ComponentPaletteSettings.h" -#include "UI/ComponentPalette/ComponentPaletteWindow.h" #include #include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp deleted file mode 100644 index 1791301654..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.cpp +++ /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 - * - */ - -#include "ComponentPaletteWindow.h" -#include "ComponentDataModel.h" -#include "FavoriteComponentList.h" -#include "FilteredComponentList.h" -#include "CategoriesList.h" - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -ComponentPaletteWindow::ComponentPaletteWindow(QWidget* parent) - : QMainWindow(parent) -{ - Init(); -} - -void ComponentPaletteWindow::Init() -{ - layout()->setSizeConstraint(QLayout::SetMinimumSize); - - QVBoxLayout* layout = new QVBoxLayout(); - layout->setSizeConstraint(QLayout::SetMinimumSize); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - - QHBoxLayout* gridLayout = new QHBoxLayout(nullptr); - gridLayout->setSizeConstraint(QLayout::SetMaximumSize); - gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->setSpacing(0); - - m_filterWidget = new AzToolsFramework::SearchCriteriaWidget(this); - - QStringList tags; - tags << tr("name"); - m_filterWidget->SetAcceptedTags(tags, tags[0]); - layout->addLayout(gridLayout, 1); - - // Left Panel - QVBoxLayout* leftPaneLayout = new QVBoxLayout(this); - - // Favorites - leftPaneLayout->addWidget(new QLabel(tr("Favorites"))); - leftPaneLayout->addWidget(new QLabel(tr("Drag components here to add favorites."))); - FavoritesList* favorites = new FavoritesList(); - favorites->Init(); - leftPaneLayout->addWidget(favorites); - - // Categories - m_categoryListWidget = new ComponentCategoryList(); - m_categoryListWidget->Init(); - leftPaneLayout->addWidget(m_categoryListWidget); - gridLayout->addLayout(leftPaneLayout); - - // Right Panel - QVBoxLayout* rightPanelLayout = new QVBoxLayout(this); - gridLayout->addLayout(rightPanelLayout); - - // Component list - m_componentListWidget = new FilteredComponentList(this); - m_componentListWidget->Init(); - - rightPanelLayout->addWidget(new QLabel(tr("Components"))); - rightPanelLayout->addWidget(m_filterWidget, 0, Qt::AlignTop); - rightPanelLayout->addWidget(m_componentListWidget); - - // The main window - QWidget* window = new QWidget(); - window->setLayout(layout); - setCentralWidget(window); - - connect(m_categoryListWidget, &ComponentCategoryList::OnCategoryChange, m_componentListWidget, &FilteredComponentList::SetCategory); - connect(m_filterWidget, &AzToolsFramework::SearchCriteriaWidget::SearchCriteriaChanged, m_componentListWidget, &FilteredComponentList::SearchCriteriaChanged); - -} - -void ComponentPaletteWindow::keyPressEvent(QKeyEvent* event) -{ - if (event->modifiers().testFlag(Qt::ControlModifier) && event->key() == Qt::Key_F) - { - m_filterWidget->SelectTextEntryBox(); - } - else - { - QMainWindow::keyPressEvent(event); - } -} - -void ComponentPaletteWindow::RegisterViewClass() -{ - using namespace AzToolsFramework; - - ViewPaneOptions options; - options.canHaveMultipleInstances = true; - RegisterViewPane("Component Palette", LyViewPane::CategoryOther, options); -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h deleted file mode 100644 index f662f69342..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentPaletteWindow.h +++ /dev/null @@ -1,59 +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 - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -namespace AzToolsFramework -{ - class SearchCriteriaWidget; -} - -class ComponentCategoryList; -class FilteredComponentList; -class ComponentDataModel; - -//! ComponentPaletteWindow -//! Provides a window with controls related to the Component Entity system. It provides an intuitive and organized -//! set of controls to display, sort, filter components. It provides mechanisms for creating entities by dragging -//! and dropping components into the viewport as well as from context menus. -class ComponentPaletteWindow - : public QMainWindow -{ - Q_OBJECT - -public: - - explicit ComponentPaletteWindow(QWidget* parent = 0); - - void Init(); - - static const GUID& GetClassID() - { - // {4236998F-1138-466D-9DF5-6533BFA1DFCA} - static const GUID guid = - { - 0x4236998F, 0x1138, 0x466D, { 0x9D, 0xF5, 0x65, 0x33, 0xBF, 0xA1, 0xDF, 0xCA } - }; - return guid; - } - - static void RegisterViewClass(); - -protected: - ComponentCategoryList* m_categoryListWidget; - FilteredComponentList* m_componentListWidget; - AzToolsFramework::SearchCriteriaWidget* m_filterWidget; - - void keyPressEvent(QKeyEvent* event) override; -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index 1cb4e25304..a03c25e8f0 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/ComponentPaletteWindow.h - UI/ComponentPalette/ComponentPaletteWindow.cpp UI/ComponentPalette/FavoriteComponentList.h UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h From 8ac886c2189ca4d55bcba5b7bca3b77eed52d1be Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 17:25:11 -0800 Subject: [PATCH 083/394] Removes FavoriteComponentList from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FavoriteComponentList.cpp | 392 ------------------ .../ComponentPalette/FavoriteComponentList.h | 117 ------ .../componententityeditorplugin_files.cmake | 2 - 3 files changed, 511 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp deleted file mode 100644 index 41eed6f93f..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.cpp +++ /dev/null @@ -1,392 +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 "FavoriteComponentList.h" -#include -#include -#include - -#include -#include - -#include -#include - -// FavoritesList -////////////////////////////////////////////////////////////////////////// - -FavoritesList::FavoritesList(QWidget* parent /*= nullptr*/) - : FilteredComponentList(parent) -{ -} - -FavoritesList::~FavoritesList() -{ - FavoriteComponentListRequestBus::Handler::BusDisconnect(); -} - -void FavoritesList::Init() -{ - FavoriteComponentListRequestBus::Handler::BusConnect(); - - FavoritesDataModel* favoritesDataModel = new FavoritesDataModel(this); - - setModel(favoritesDataModel); - - horizontalHeader()->setSectionResizeMode(ComponentDataModel::ColumnIndex::Name, QHeaderView::Stretch); - - setShowGrid(false); - - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); - setStyleSheet("QTableView { selection-background-color: rgba(255,255,255,0.2); }"); - setGridStyle(Qt::PenStyle::NoPen); - verticalHeader()->hide(); - horizontalHeader()->hide(); - setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows); - setShowGrid(false); - setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); - setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - - setColumnWidth(ComponentDataModel::ColumnIndex::Icon, 32); - hideColumn(ComponentDataModel::ColumnIndex::Category); - - setDragDropMode(QAbstractItemView::DragDrop); - setAcceptDrops(true); - - horizontalHeader()->setSectionResizeMode(ComponentDataModel::ColumnIndex::Icon, QHeaderView::ResizeToContents); - setColumnWidth(ComponentDataModel::ColumnIndex::Icon, 32); - - horizontalHeader()->setSectionResizeMode(ComponentDataModel::ColumnIndex::Category, QHeaderView::Stretch); - setColumnWidth(ComponentDataModel::ColumnIndex::Category, 90); - - // Context menu - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, &QWidget::customContextMenuRequested, this, &FavoritesList::ShowContextMenu); -} - -void FavoritesList::ShowContextMenu(const QPoint& pos) -{ - // Only show if a level is loaded - if (!GetIEditor() || GetIEditor()->IsInGameMode()) - { - return; - } - - if ( model()->rowCount() == 0) - { - return; - } - - QMenu contextMenu(tr("Context menu"), this); - - QAction actionNewEntity(tr("Make entity with selected favorites"), this); - QAction actionAddToSelection(this); - if (GetIEditor()->GetDocument()->IsDocumentReady()) - { - QObject::connect(&actionNewEntity, &QAction::triggered, this, [&] { ContextMenu_NewEntity(); }); - contextMenu.addAction(&actionNewEntity); - - AzToolsFramework::EntityIdList selectedEntities; - EBUS_EVENT_RESULT(selectedEntities, AzToolsFramework::ToolsApplicationRequests::Bus, GetSelectedEntities); - - if (!selectedEntities.empty()) - { - QString addToSelection = selectedEntities.size() > 1 ? tr("Add to selected entities") : tr("Add to selected entity"); - actionAddToSelection.setText(addToSelection); - - QObject::connect(&actionAddToSelection, &QAction::triggered, this, [&] { ContextMenu_AddToSelectedEntities(); }); - contextMenu.addAction(&actionAddToSelection); - } - - contextMenu.addSeparator(); - } - - QAction action(tr("Remove"), this); - QObject::connect(&action, &QAction::triggered, this, [&] { ContextMenu_RemoveSelectedFavorites(); }); - contextMenu.addAction(&action); - - contextMenu.exec(mapToGlobal(pos)); -} - -void FavoritesList::ContextMenu_RemoveSelectedFavorites() -{ - FavoritesDataModel* dataModel = qobject_cast(model()); - if (!selectedIndexes().empty()) - { - dataModel->Remove(selectedIndexes()); - } -} - -void FavoritesList::rowsInserted([[maybe_unused]] const QModelIndex& parent, [[maybe_unused]] int start, [[maybe_unused]] int end) -{ - resizeRowToContents(0); -} - -void FavoritesList::AddFavorites(const AZStd::vector& classDataContainer) -{ - for (const AZ::SerializeContext::ClassData* classData : classDataContainer) - { - if (classData) - { - FavoritesDataModel* dataModel = qobject_cast(model()); - dataModel->AddFavorite(classData); - } - } -} - -void FavoritesList::dragEnterEvent(QDragEnterEvent* event) -{ - if (event->mimeData()->hasFormat(AzToolsFramework::ComponentTypeMimeData::GetMimeType())) - { - event->acceptProposedAction(); - } -} - -void FavoritesList::dragMoveEvent(QDragMoveEvent* event) -{ - if (event->source() == this) - { - event->ignore(); - } - else - { - event->accept(); - } -} - -// FavoritesDataModel -////////////////////////////////////////////////////////////////////////// - -int FavoritesDataModel::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return m_favorites.size(); -} - -int FavoritesDataModel::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return ColumnIndex::Count; -} - -void FavoritesDataModel::SaveState() -{ - AZStd::vector favorites; - for (const AZ::SerializeContext::ClassData* classData : m_favorites) - { - favorites.push_back(classData->m_typeId); - } - m_settings->SetFavorites(AZStd::move(favorites)); - - - // Write the settings to file... - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Serialize Context is null!"); - - char settingsPath[AZ_MAX_PATH_LEN] = { 0 }; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(ComponentPaletteSettings::GetSettingsFile(), settingsPath, AZ_MAX_PATH_LEN); - - bool result = m_provider.Save(settingsPath, serializeContext); - (void)result; - AZ_Warning("ComponentPaletteSettings", result, "Failed to Save the Component Palette Settings!"); -} - -void FavoritesDataModel::LoadState() -{ - // It is necessary to Load the settings file *before* you call UserSettings::CreateFind! - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Serialize Context is null!"); - - char settingsPath[AZ_MAX_PATH_LEN] = { 0 }; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(ComponentPaletteSettings::GetSettingsFile(), settingsPath, AZ_MAX_PATH_LEN); - - bool result = m_provider.Load(settingsPath, serializeContext); - (void)result; - - - // Create (if no file was found) or find the settings, this will populate the m_settings->m_favorites list. - m_settings = AZ::UserSettings::CreateFind(AZ_CRC("ComponentPaletteSettings", 0x481d355b), m_providerId); - - // Add favorites to the data model from loaded settings - for (const AZ::Uuid& favorite : m_settings->m_favorites) - { - const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(favorite); - if (classData) - { - AddFavorite(classData, false); - } - } -} - -void FavoritesDataModel::Remove(const QModelIndexList& indices) -{ - beginResetModel(); - - auto newFavorites = m_favorites; - - // swap here - for (auto index : indices) - { - // we're only dealing with columns and they're the only thing with class data anyways - if (index.column() == 0) - { - QVariant classDataVariant = index.data(ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - newFavorites.removeAll(classData); - - AZ_TracePrintf("Debug", "Removing: %s\n", classData->m_editData->m_name); - } - } - } - - m_favorites.swap(newFavorites); - - endResetModel(); - - SaveState(); -} - -QModelIndex FavoritesDataModel::index(int row, int column, const QModelIndex &parent) const -{ - if (!hasIndex(row, column, parent)) - { - return QModelIndex(); - } - - if (row >= rowCount(parent) || column >= columnCount(parent)) - { - return QModelIndex(); - } - - return createIndex(row, column, (void*)(m_favorites[row])); -} - -QVariant FavoritesDataModel::data(const QModelIndex &index, int role /*= Qt::DisplayRole*/) const -{ - if (!index.isValid()) - { - return QVariant(); - } - - const AZ::SerializeContext::ClassData* classData = m_favorites[index.row()]; - if (!classData) - { - return QVariant(); - } - - switch (role) - { - case Qt::DisplayRole: - { - if (index.column() == ComponentDataModel::ColumnIndex::Name) - { - if (m_favorites.empty()) - { - return QVariant(tr("You have 0 favorites.\nDrag some components here.")); - } - - return QVariant(classData->m_editData->m_name); - } - } - break; - - case Qt::DecorationRole: - { - if (index.column() == ColumnIndex::Icon) - { - const AZ::SerializeContext::ClassData* iconClassData = m_favorites[index.row()]; - auto iconIterator = m_componentIcons.find(iconClassData->m_typeId); - if (iconIterator != m_componentIcons.end()) - { - return iconIterator->second; - } - - return QVariant(); - } - } - break; - - case ClassDataRole: - if (index.column() == 0) // Only get data for one column - { - return QVariant::fromValue(reinterpret_cast(const_cast(classData))); - } - break; - - default: - break; - } - - return ComponentDataModel::data(index, role); - -} - -void FavoritesDataModel::SetSavedStateKey([[maybe_unused]] AZ::u32 key) -{ -} - -FavoritesDataModel::FavoritesDataModel(QWidget* parent /*= nullptr*/) - : ComponentDataModel(parent) - , m_providerId(AZ_CRC("ComponentPaletteSettingsProviderId")) -{ - m_provider.Activate(m_providerId); - LoadState(); -} - -FavoritesDataModel::~FavoritesDataModel() -{ - m_provider.Deactivate(); -} - -void FavoritesDataModel::AddFavorite(const AZ::SerializeContext::ClassData* classData, bool updateSettings) -{ - beginResetModel(); - - if (m_favorites.indexOf(classData) < 0) - { - m_favorites.push_back(classData); - } - - endResetModel(); - - if (updateSettings) - { - SaveState(); - } -} - -bool FavoritesDataModel::dropMimeData(const QMimeData *data, Qt::DropAction action, [[maybe_unused]] int row, [[maybe_unused]] int column, [[maybe_unused]] const QModelIndex &parent) -{ - if (action == Qt::IgnoreAction) - { - return true; - } - - if (data && data->hasFormat(AzToolsFramework::ComponentTypeMimeData::GetMimeType())) - { - AzToolsFramework::ComponentTypeMimeData::ClassDataContainer classDataContainer; - AzToolsFramework::ComponentTypeMimeData::Get(data, classDataContainer); - - for (const AZ::SerializeContext::ClassData* classData : classDataContainer) - { - if (classData) - { - AddFavorite(classData); - } - } - - return true; - } - - return false; -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h deleted file mode 100644 index 2bd2d83e04..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FavoriteComponentList.h +++ /dev/null @@ -1,117 +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 - -#if !defined(Q_MOC_RUN) -#include "ComponentDataModel.h" -#include "FilteredComponentList.h" -#include "ComponentPaletteSettings.h" - -#include -#include -#include -#include -#endif - -//! FavoriteComponentListRequest -//! Bus that provides a way for external features to record favorites -class FavoriteComponentListRequest : public AZ::EBusTraits -{ -public: - virtual void AddFavorites(const AZStd::vector&) = 0; -}; - -using FavoriteComponentListRequestBus = AZ::EBus; - - -//! FavoritesDataModel -//! Stores the list of component class data to display in the favorites control, offers persistence through user settings. -class FavoritesDataModel - : public ComponentDataModel -{ - Q_OBJECT - -public: - - AZ_CLASS_ALLOCATOR(FavoritesDataModel, AZ::SystemAllocator, 0); - - FavoritesDataModel(QWidget* parent = nullptr); - ~FavoritesDataModel() override; - - //! Add a favorite component - //! \param classData The ClassData information for the component to store as favorite - //! \param updateSettings Optional parameter used to determine if the persistent settings need to be updated. - void AddFavorite(const AZ::SerializeContext::ClassData* classData, bool updateSettings = true); - - //! Remove all the specified items from the table - //! \param indices List of indices to remove from favorites - void Remove(const QModelIndexList& indices); - - //! Save the list of favorite components to user settings - void SaveState(); - - //! Load the list of favorite components from user settings - void LoadState(); - -protected: - - void SetSavedStateKey(AZ::u32 key); - - // Qt handlers - QModelIndex index(int row, int column, const QModelIndex &parent) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; - - // List of component class data - QList m_favorites; - - // The Palette settings and provider information for saving out the Favorites list - AZStd::intrusive_ptr m_settings; - AZ::UserSettingsProvider m_provider; - AZ::u32 m_providerId; -}; - - -//! FavoritesList -//! User customized list of favorite components, provides persistence. -class FavoritesList - : public FilteredComponentList - , FavoriteComponentListRequestBus::Handler -{ - Q_OBJECT - -public: - - explicit FavoritesList(QWidget* parent = nullptr); - ~FavoritesList() override; - - void Init() override; - -protected: - - ////////////////////////////////////////////////////////////////////////// - // FavoriteComponentListRequestBus - void AddFavorites(const AZStd::vector& classDataContainer) override; - ////////////////////////////////////////////////////////////////////////// - - void rowsInserted(const QModelIndex& parent, int start, int end) override; - - // Context menu handlers - void ShowContextMenu(const QPoint&); - void ContextMenu_RemoveSelectedFavorites(); - - // Validate data being dragged in - void dragEnterEvent(QDragEnterEvent * event) override; - void dragMoveEvent(QDragMoveEvent* event) override; - - //! Handler used when dropping PaletteItems into the Viewport. - static void DragDropHandler(CViewport* viewport, int ptx, int pty, void* custom); -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index a03c25e8f0..1aaa5abf4d 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/FavoriteComponentList.h - UI/ComponentPalette/FavoriteComponentList.cpp UI/ComponentPalette/FilteredComponentList.h UI/ComponentPalette/FilteredComponentList.cpp UI/Outliner/OutlinerDisplayOptionsMenu.h From cd7c069fbbbdf5089435751b578a19d051a5a4dd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 16 Nov 2021 17:30:33 -0800 Subject: [PATCH 084/394] Removes FilteredComponentList from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FilteredComponentList.cpp | 264 ------------------ .../ComponentPalette/FilteredComponentList.h | 68 ----- .../componententityeditorplugin_files.cmake | 2 - 3 files changed, 334 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp deleted file mode 100644 index 2431653e36..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.cpp +++ /dev/null @@ -1,264 +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 "ComponentDataModel.h" -#include "FavoriteComponentList.h" -#include "FilteredComponentList.h" - -#include "CryCommon/MathConversion.h" -#include "Editor/IEditor.h" -#include "Editor/ViewManager.h" -#include - -#include - -#include - -void FilteredComponentList::Init() -{ - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setDragDropMode(QAbstractItemView::DragDropMode::DragOnly); - setDragEnabled(true); - - setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); - setStyleSheet("QTreeWidget { selection-background-color: rgba(255,255,255,0.2); }"); - setGridStyle(Qt::PenStyle::NoPen); - verticalHeader()->hide(); - horizontalHeader()->hide(); - setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows); - setAcceptDrops(false); - - m_componentDataModel = new ComponentDataModel(this); - ComponentDataProxyModel* componentDataProxyModel = new ComponentDataProxyModel(this); - componentDataProxyModel->setSourceModel(m_componentDataModel); - setModel(componentDataProxyModel); - - QHeaderView* horizontalHeaderView = horizontalHeader(); - horizontalHeaderView->setSectionResizeMode(ComponentDataModel::ColumnIndex::Icon, QHeaderView::ResizeToContents); - horizontalHeaderView->setSectionResizeMode(ComponentDataModel::ColumnIndex::Name, QHeaderView::Stretch); - - setColumnWidth(ComponentDataModel::ColumnIndex::Icon, 32); - setShowGrid(false); - - setColumnWidth(ComponentDataModel::ColumnIndex::Name, 90); - setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); - - sortByColumn(ComponentDataModel::ColumnIndex::Name, Qt::AscendingOrder); - hideColumn(ComponentDataModel::ColumnIndex::Category); - - connect(model(), &QAbstractItemModel::rowsInserted, this, &FilteredComponentList::rowsInserted); - connect(model(), &QAbstractItemModel::rowsRemoved, this, &FilteredComponentList::rowsAboutToBeRemoved); - - connect(model(), SIGNAL(modelReset()), SLOT(modelReset())); - - - // Context menu - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, &QWidget::customContextMenuRequested, this, &FilteredComponentList::ShowContextMenu); -} - -void FilteredComponentList::ContextMenu_NewEntity() -{ - AZ::EntityId entityId; - - auto proxyDataModel = qobject_cast(model()); - if (proxyDataModel) - { - entityId = proxyDataModel->NewEntityFromSelection(selectedIndexes()); - } - else - { - auto dataModel = qobject_cast(model()); - if (dataModel) - { - entityId = dataModel->NewEntityFromSelection(selectedIndexes()); - } - } -} - - -void FilteredComponentList::ContextMenu_AddToFavorites() -{ - AZStd::vector componentsToAdd; - for (auto index : selectedIndexes()) - { - QVariant classDataVariant = index.data(ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - auto classData = reinterpret_cast(classDataVariant.value()); - componentsToAdd.push_back(classData); - } - } - - if (!componentsToAdd.empty()) - { - EBUS_EVENT(FavoriteComponentListRequestBus, AddFavorites, componentsToAdd); - } -} - -void FilteredComponentList::ContextMenu_AddToSelectedEntities() -{ - ComponentDataUtilities::AddComponentsToSelectedEntities(selectedIndexes(), model()); -} - -void FilteredComponentList::ShowContextMenu(const QPoint& pos) -{ - QMenu contextMenu(tr("Context menu"), this); - - QAction actionNewEntity(tr("Create new entity with selected components"), this); - if (GetIEditor()->GetDocument()->IsDocumentReady()) - { - QObject::connect(&actionNewEntity, &QAction::triggered, this, [this] { ContextMenu_NewEntity(); }); - contextMenu.addAction(&actionNewEntity); - } - - QAction actionAddFavorite(tr("Add to favorites"), this); - QObject::connect(&actionAddFavorite, &QAction::triggered, this, [this] { ContextMenu_AddToFavorites(); }); - contextMenu.addAction(&actionAddFavorite); - - QAction actionAddToSelection(this); - if (GetIEditor()->GetDocument()->IsDocumentReady()) - { - AzToolsFramework::EntityIdList selectedEntities; - EBUS_EVENT_RESULT(selectedEntities, AzToolsFramework::ToolsApplicationRequests::Bus, GetSelectedEntities); - - if (!selectedEntities.empty()) - { - QString addToSelection = selectedEntities.size() > 1 ? tr("Add to selected entities") : tr("Add to selected entity"); - - actionAddToSelection.setText(addToSelection); - QObject::connect(&actionAddToSelection, &QAction::triggered, this, [this] { ContextMenu_AddToSelectedEntities(); }); - contextMenu.addAction(&actionAddToSelection); - } - } - // TODO: Requires information panel implementation LMBR-28174 - //QAction actionHelp(tr("Help"), this); - //QObject::connect(&actionHelp, &QAction::triggered, this, [&] {}); - //contextMenu.addAction(&actionHelp); - - contextMenu.exec(mapToGlobal(pos)); -} - -void FilteredComponentList::modelReset() -{ - // Ensure that the category column is hidden - hideColumn(ComponentDataModel::ColumnIndex::Category); -} - -FilteredComponentList::FilteredComponentList(QWidget* parent /*= nullptr*/) - : QTableView(parent) -{ -} - -FilteredComponentList::~FilteredComponentList() -{ -} - -void FilteredComponentList::SearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator) -{ - setUpdatesEnabled(false); - - auto dataModel = qobject_cast(model()); - if (dataModel) - { - // Go through the list of items and show/hide as needed due to filter. - QString filter; - for (const auto& criteria : criteriaList) - { - QString tag, text; - AzToolsFramework::SearchCriteriaButton::SplitTagAndText(criteria, tag, text); - AppendFilter(filter, text, filterOperator); - } - - dataModel->setFilterRegExp(QRegExp(filter, Qt::CaseSensitivity::CaseInsensitive)); - } - - setUpdatesEnabled(true); -} - -void FilteredComponentList::SetCategory(const char* category) -{ - auto dataModel = qobject_cast(model()); - if (dataModel) - { - if (!category || category[0] == 0 || azstricmp(category, "All") == 0) - { - dataModel->ClearSelectedCategory(); - } - else - { - dataModel->SetSelectedCategory(category); - } - } - - // Note: this ensures the category column remains hidden - hideColumn(ComponentDataModel::ColumnIndex::Category); -} - -void FilteredComponentList::BuildFilter(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator) -{ - ClearFilterRegExp(); - - for (const auto& criteria : criteriaList) - { - QString tag, text; - AzToolsFramework::SearchCriteriaButton::SplitTagAndText(criteria, tag, text); - if (tag.isEmpty()) - { - tag = "null"; - } - - QString filter = m_filtersRegExp[tag.toStdString().c_str()].pattern(); - - AppendFilter(filter, text, filterOperator); - - SetFilterRegExp(tag.toStdString().c_str(), QRegExp(filter, Qt::CaseInsensitive)); - } -} - -void FilteredComponentList::AppendFilter(QString& filter, const QString& text, AzToolsFramework::FilterOperatorType filterOperator) -{ - if (filterOperator == AzToolsFramework::FilterOperatorType::Or) - { - if (filter.isEmpty()) - { - filter = text; - } - else - { - filter += "|" + text; - } - } - else if (filterOperator == AzToolsFramework::FilterOperatorType::And) - { - //using lookaheads to produce an "and" effect. - filter += "(?=.*" + text + ")"; - } -} - -void FilteredComponentList::SetFilterRegExp(const AZStd::string& filterType, const QRegExp& regExp) -{ - m_filtersRegExp[filterType] = regExp; -} - -void FilteredComponentList::ClearFilterRegExp(const AZStd::string& filterType /*= AZStd::string()*/) -{ - if (filterType.empty()) - { - for (auto& it : m_filtersRegExp) - { - it.second = QRegExp(); - } - } - else - { - m_filtersRegExp[filterType] = QRegExp(); - } -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h deleted file mode 100644 index 113128fbcc..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/FilteredComponentList.h +++ /dev/null @@ -1,68 +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 - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#include -#include -#include "ComponentDataModel.h" -#endif - -namespace AZ -{ - class SerializeContext; - class ClassData; -} - -class ComponentDataModel; - -//! FilteredComponentList -//! Provides a list of components that can be filtered according to search criteria provided and/or from -//! a category selection control. -class FilteredComponentList - : public QTableView -{ - Q_OBJECT - -public: - - explicit FilteredComponentList(QWidget* parent = nullptr); - - ~FilteredComponentList() override; - - virtual void Init(); - - void SearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator); - - void SetCategory(const char* category); - -protected: - - // Filtering support - void BuildFilter(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator); - void AppendFilter(QString& filter, const QString& text, AzToolsFramework::FilterOperatorType filterOperator); - void SetFilterRegExp(const AZStd::string& filterType, const QRegExp& regExp); - void ClearFilterRegExp(const AZStd::string& filterType = AZStd::string()); - - // Context menu handlers - void ShowContextMenu(const QPoint&); - void ContextMenu_NewEntity(); - void ContextMenu_AddToFavorites(); - void ContextMenu_AddToSelectedEntities(); - - void modelReset(); - - AzToolsFramework::FilterByCategoryMap m_filtersRegExp; - ComponentDataModel* m_componentDataModel; - -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index 1aaa5abf4d..b5a8b00855 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -25,8 +25,6 @@ set(FILES UI/ComponentPalette/ComponentDataModel.h UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h - UI/ComponentPalette/FilteredComponentList.h - UI/ComponentPalette/FilteredComponentList.cpp UI/Outliner/OutlinerDisplayOptionsMenu.h UI/Outliner/OutlinerDisplayOptionsMenu.cpp UI/Outliner/OutlinerTreeView.hxx From 43679d398f60681e3d8006df7795a5cb20df2aa1 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 17 Nov 2021 13:44:58 -0800 Subject: [PATCH 085/394] Remove AxisHelper from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Plugins/EditorCommon/AxisHelper.cpp | 10 ---------- .../Plugins/EditorCommon/editorcommon_files.cmake | 1 - 2 files changed, 11 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/AxisHelper.cpp diff --git a/Code/Editor/Plugins/EditorCommon/AxisHelper.cpp b/Code/Editor/Plugins/EditorCommon/AxisHelper.cpp deleted file mode 100644 index dab7511779..0000000000 --- a/Code/Editor/Plugins/EditorCommon/AxisHelper.cpp +++ /dev/null @@ -1,10 +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 "../../Editor/RenderHelpers/AxisHelperShared.inl" diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 7a380bc6ea..511418efc7 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -17,7 +17,6 @@ set(FILES DockTitleBarWidget.h SaveUtilities/AsyncSaveRunner.h SaveUtilities/AsyncSaveRunner.cpp - AxisHelper.cpp DisplayContext.cpp Resource.h WinWidget/WinWidget.h From fb3a4321ed2c440fe631f7e623273754c7de0b07 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 17 Nov 2021 13:45:54 -0800 Subject: [PATCH 086/394] Remove Cry_LegacyPhysUtils from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EditorCommon/Cry_LegacyPhysUtils.h | 700 ------------------ 1 file changed, 700 deletions(-) diff --git a/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h b/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h index b3735fa4b6..e69de29bb2 100644 --- a/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h +++ b/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h @@ -1,700 +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 - * - */ - -// Copied utils functions from CryPhysics that are used by non-physics systems -// This functions will be eventually removed, DO *NOT* use these functions -// TO-DO: Re-implement users using new code -// LY-109806 - -#pragma once - -#include "Cry_Math.h" - -namespace LegacyCryPhysicsUtils -{ - namespace polynomial_tpl_IMPL - { - template - class polynomial_tpl - { - public: - explicit polynomial_tpl() { denom = (ftype)1; }; - explicit polynomial_tpl(ftype op) { zero(); data[degree] = op; } - AZ_FORCE_INLINE polynomial_tpl& zero() - { - for (int i = 0; i <= degree; i++) - { - data[i] = 0; - } - denom = (ftype)1; - return *this; - } - polynomial_tpl(const polynomial_tpl& src) { *this = src; } - polynomial_tpl& operator=(const polynomial_tpl& src) - { - denom = src.denom; - for (int i = 0; i <= degree; i++) - { - data[i] = src.data[i]; - } - return *this; - } - template - AZ_FORCE_INLINE polynomial_tpl& operator=(const polynomial_tpl& src) - { - int i; - denom = src.denom; - for (i = 0; i <= min(degree, degree1); i++) - { - data[i] = src.data[i]; - } - for (; i < degree; i++) - { - data[i] = 0; - } - return *this; - } - AZ_FORCE_INLINE polynomial_tpl& set(ftype* pdata) - { - for (int i = 0; i <= degree; i++) - { - data[degree - i] = pdata[i]; - } - return *this; - } - - AZ_FORCE_INLINE ftype& operator[](int idx) { return data[idx]; } - - void calc_deriviative(polynomial_tpl& deriv, int curdegree = degree) const; - - AZ_FORCE_INLINE polynomial_tpl& fixsign() - { - ftype sg = sgnnz(denom); - denom *= sg; - for (int i = 0; i <= degree; i++) - { - data[i] *= sg; - } - return *this; - } - - int findroots(ftype start, ftype end, ftype* proots, int nIters = 20, int curdegree = degree, bool noDegreeCheck = false) const; - int nroots(ftype start, ftype end) const; - - AZ_FORCE_INLINE ftype eval(ftype x) const - { - ftype res = 0; - for (int i = degree; i >= 0; i--) - { - res = res * x + data[i]; - } - return res; - } - AZ_FORCE_INLINE ftype eval(ftype x, int subdegree) const - { - ftype res = data[subdegree]; - for (int i = subdegree - 1; i >= 0; i--) - { - res = res * x + data[i]; - } - return res; - } - - AZ_FORCE_INLINE polynomial_tpl& operator+=(ftype op) { data[0] += op * denom; return *this; } - AZ_FORCE_INLINE polynomial_tpl& operator-=(ftype op) { data[0] -= op * denom; return *this; } - AZ_FORCE_INLINE polynomial_tpl operator*(ftype op) const - { - polynomial_tpl res; - res.denom = denom; - for (int i = 0; i <= degree; i++) - { - res.data[i] = data[i] * op; - } - return res; - } - AZ_FORCE_INLINE polynomial_tpl& operator*=(ftype op) - { - for (int i = 0; i <= degree; i++) - { - data[i] *= op; - } - return *this; - } - AZ_FORCE_INLINE polynomial_tpl operator/(ftype op) const - { - polynomial_tpl res = *this; - res.denom = denom * op; - return res; - } - AZ_FORCE_INLINE polynomial_tpl& operator/=(ftype op) { denom *= op; return *this; } - - AZ_FORCE_INLINE polynomial_tpl sqr() const { return *this * *this; } - - ftype denom; - ftype data[degree + 1]; - }; - - template - struct tagPolyE - { - inline static ftype polye() { return (ftype)1E-10; } - }; - - template<> - inline float tagPolyE::polye() { return 1e-6f; } - - template - inline ftype polye() { return tagPolyE::polye(); } - - // Don't use this macro; use AZStd::max instead. This is only here to make the template const arguments below readable - // and because Visual Studio 2013 doesn't have a const_expr version of std::max - #define deprecated_degmax(degree1, degree2) (((degree1) > (degree2)) ? (degree1) : (degree2)) - - template - AZ_FORCE_INLINE polynomial_tpl operator+(const polynomial_tpl& pn, ftype op) - { - polynomial_tpl res = pn; - res.data[0] += op * res.denom; - return res; - } - template - AZ_FORCE_INLINE polynomial_tpl operator-(const polynomial_tpl& pn, ftype op) - { - polynomial_tpl res = pn; - res.data[0] -= op * res.denom; - return res; - } - - template - AZ_FORCE_INLINE polynomial_tpl operator+(ftype op, const polynomial_tpl& pn) - { - polynomial_tpl res = pn; - res.data[0] += op * res.denom; - return res; - } - template - AZ_FORCE_INLINE polynomial_tpl operator-(ftype op, const polynomial_tpl& pn) - { - polynomial_tpl res = pn; - res.data[0] -= op * res.denom; - for (int i = 0; i <= degree; i++) - { - res.data[i] = -res.data[i]; - } - return res; - } - template - polynomial_tpl AZ_FORCE_INLINE psqr(const polynomial_tpl& op) { return op * op; } - - template - AZ_FORCE_INLINE polynomial_tpl operator+(const polynomial_tpl& op1, const polynomial_tpl& op2) - { - polynomial_tpl res; - int i; - for (i = 0; i <= min(degree1, degree2); i++) - { - res.data[i] = op1.data[i] * op2.denom + op2.data[i] * op1.denom; - } - for (; i <= degree1; i++) - { - res.data[i] = op1.data[i] * op2.denom; - } - for (; i <= degree2; i++) - { - res.data[i] = op2.data[i] * op1.denom; - } - res.denom = op1.denom * op2.denom; - return res; - } - template - AZ_FORCE_INLINE polynomial_tpl operator-(const polynomial_tpl& op1, const polynomial_tpl& op2) - { - polynomial_tpl res; - int i; - for (i = 0; i <= min(degree1, degree2); i++) - { - res.data[i] = op1.data[i] * op2.denom - op2.data[i] * op1.denom; - } - for (; i <= degree1; i++) - { - res.data[i] = op1.data[i] * op2.denom; - } - for (; i <= degree2; i++) - { - res.data[i] = op2.data[i] * op1.denom; - } - res.denom = op1.denom * op2.denom; - return res; - } - - template - AZ_FORCE_INLINE polynomial_tpl& operator+=(polynomial_tpl& op1, const polynomial_tpl& op2) - { - for (int i = 0; i < min(degree1, degree2); i++) - { - op1.data[i] = op1.data[i] * op2.denom + op2.data[i] * op1.denom; - } - op1.denom *= op2.denom; - return op1; - } - template - AZ_FORCE_INLINE polynomial_tpl& operator-=(polynomial_tpl& op1, const polynomial_tpl& op2) - { - for (int i = 0; i < min(degree1, degree2); i++) - { - op1.data[i] = op1.data[i] * op2.denom - op2.data[i] * op1.denom; - } - op1.denom *= op2.denom; - return op1; - } - - template - AZ_FORCE_INLINE polynomial_tpl operator*(const polynomial_tpl& op1, const polynomial_tpl& op2) - { - polynomial_tpl res; - res.zero(); - int j; - switch (degree1) - { - case 8: - for (j = 0; j <= degree2; j++) - { - res.data[8 + j] += op1.data[8] * op2.data[j]; - } - case 7: - for (j = 0; j <= degree2; j++) - { - res.data[7 + j] += op1.data[7] * op2.data[j]; - } - case 6: - for (j = 0; j <= degree2; j++) - { - res.data[6 + j] += op1.data[6] * op2.data[j]; - } - case 5: - for (j = 0; j <= degree2; j++) - { - res.data[5 + j] += op1.data[5] * op2.data[j]; - } - case 4: - for (j = 0; j <= degree2; j++) - { - res.data[4 + j] += op1.data[4] * op2.data[j]; - } - case 3: - for (j = 0; j <= degree2; j++) - { - res.data[3 + j] += op1.data[3] * op2.data[j]; - } - case 2: - for (j = 0; j <= degree2; j++) - { - res.data[2 + j] += op1.data[2] * op2.data[j]; - } - case 1: - for (j = 0; j <= degree2; j++) - { - res.data[1 + j] += op1.data[1] * op2.data[j]; - } - case 0: - for (j = 0; j <= degree2; j++) - { - res.data[0 + j] += op1.data[0] * op2.data[j]; - } - } - res.denom = op1.denom * op2.denom; - return res; - } - - - template - AZ_FORCE_INLINE void polynomial_divide(const polynomial_tpl& num, const polynomial_tpl& den, polynomial_tpl& quot, - polynomial_tpl& rem, int degree1, int degree2) - { - int i, j, k, l; - ftype maxel; - for (i = 0; i <= degree1; i++) - { - rem.data[i] = num.data[i]; - } - for (i = 0; i <= degree1 - degree2; i++) - { - quot.data[i] = 0; - } - for (i = 1, maxel = fabs_tpl(num.data[0]); i <= degree1; i++) - { - maxel = max(maxel, num.data[i]); - } - for (maxel *= polye(); degree1 >= 0 && fabs_tpl(num.data[degree1]) < maxel; degree1--) - { - ; - } - for (i = 1, maxel = fabs_tpl(den.data[0]); i <= degree2; i++) - { - maxel = max(maxel, den.data[i]); - } - for (maxel *= polye(); degree2 >= 0 && fabs_tpl(den.data[degree2]) < maxel; degree2--) - { - ; - } - rem.denom = num.denom; - quot.denom = (ftype)1; - if (degree1 < 0 || degree2 < 0) - { - return; - } - - for (k = degree1 - degree2, l = degree1; l >= degree2; l--, k--) - { - quot.data[k] = rem.data[l] * den.denom; - quot.denom *= den.data[degree2]; - for (i = degree1 - degree2; i > k; i--) - { - quot.data[i] *= den.data[degree2]; - } - for (i = degree2 - 1, j = l - 1; i >= 0; i--, j--) - { - rem.data[j] = rem.data[j] * den.data[degree2] - den.data[i] * rem.data[l]; - } - for (; j >= 0; j--) - { - rem.data[j] *= den.data[degree2]; - } - rem.denom *= den.data[degree2]; - } - } - - template - AZ_FORCE_INLINE polynomial_tpl operator/(const polynomial_tpl& num, const polynomial_tpl& den) - { - polynomial_tpl quot; - polynomial_tpl rem; - polynomial_divide((polynomial_tpl&)num, (polynomial_tpl&)den, (polynomial_tpl&)quot, - (polynomial_tpl&)rem, degree1, degree2); - return quot; - } - template - AZ_FORCE_INLINE polynomial_tpl operator%(const polynomial_tpl& num, const polynomial_tpl& den) - { - polynomial_tpl quot; - polynomial_tpl rem; - polynomial_divide((polynomial_tpl&)num, (polynomial_tpl&)den, (polynomial_tpl&)quot, - (polynomial_tpl&)rem, degree1, degree2); - return (polynomial_tpl&)rem; - } - - template - AZ_FORCE_INLINE void polynomial_tpl::calc_deriviative(polynomial_tpl& deriv, int curdegree) const - { - for (int i = 0; i < curdegree; i++) - { - deriv.data[i] = data[i + 1] * (i + 1); - } - deriv.denom = denom; - } - - template - to_t* convert_type(from_t* input) - { - typedef union - { - to_t* to; - from_t* from; - } convert_union; - convert_union u; - u.from = input; - return u.to; - } - - template - AZ_FORCE_INLINE int polynomial_tpl::nroots(ftype start, ftype end) const - { - polynomial_tpl f[degree + 1]; - int i, j, sg_a, sg_b; - ftype val, prevval; - - calc_deriviative(f[0]); - polynomial_divide(*convert_type >(this), *convert_type< polynomial_tpl >(&f[0]), *convert_type >(&f[degree]), - *convert_type >(&f[1]), degree, degree - 1); - f[1].denom = -f[1].denom; - for (i = 2; i < degree; i++) - { - polynomial_divide(*convert_type >(&f[i - 2]), *convert_type >(&f[i - 1]), *convert_type >(&f[degree]), - *convert_type >(&f[i]), degree + 1 - i, degree - i); - f[i].denom = -f[i].denom; - if (fabs_tpl(f[i].denom) > (ftype)1E10) - { - for (j = 0; j <= degree - 1 - i; j++) - { - f[i].data[j] *= (ftype)1E-10; - } - f[i].denom *= (ftype)1E-10; - } - } - - prevval = eval(start) * denom; - for (i = sg_a = 0; i < degree; i++, prevval = val) - { - val = f[i].eval(start, degree - 1 - i) * f[i].denom; - sg_a += isneg(val * prevval); - } - - prevval = eval(end) * denom; - for (i = sg_b = 0; i < degree; i++, prevval = val) - { - val = f[i].eval(end, degree - 1 - i) * f[i].denom; - sg_b += isneg(val * prevval); - } - - return fabs_tpl(sg_a - sg_b); - } - - template - AZ_FORCE_INLINE ftype cubert_tpl(ftype x) { return fabs_tpl(x) > (ftype)1E-20 ? exp_tpl(log_tpl(fabs_tpl(x)) * (ftype)(1.0 / 3)) * sgnnz(x) : x; } - template - AZ_FORCE_INLINE ftype pow_tpl(ftype x, ftype pow) { return fabs_tpl(x) > (ftype)1E-20 ? exp_tpl(log_tpl(fabs_tpl(x)) * pow) * sgnnz(x) : x; } - template - AZ_FORCE_INLINE void swap(ftype* ptr, int i, int j) { ftype t = ptr[i]; ptr[i] = ptr[j]; ptr[j] = t; } - - template - int polynomial_tpl::findroots(ftype start, ftype end, ftype* proots, [[maybe_unused]] int nIters, int degree, bool noDegreeCheck) const - { - AZ_UNUSED(nIters); - int i, j, nRoots = 0; - ftype maxel; - if (!noDegreeCheck) - { - for (i = 1, maxel = fabs_tpl(data[0]); i <= degree; i++) - { - maxel = max(maxel, data[i]); - } - for (maxel *= polye(); degree > 0 && fabs_tpl(data[degree]) <= maxel; degree--) - { - ; - } - } - - if constexpr (maxdegree >= 1) - { - if (degree == 1) - { - proots[0] = data[0] / data[1]; - nRoots = 1; - } - } - - if constexpr (maxdegree >= 2) - { - if (degree == 2) - { - ftype a, b, c, d, bound[2], sg; - - a = data[2]; - b = data[1]; - c = data[0]; - d = aznumeric_cast(sgnnz(a)); - a *= d; - b *= d; - c *= d; - d = b * b - a * c * 4; - bound[0] = start * a * 2 + b; - bound[1] = end * a * 2 + b; - sg = aznumeric_cast((sgnnz(bound[0] * bound[1]) + 1) >> 1); - bound[0] *= bound[0]; - bound[1] *= bound[1]; - bound[isneg(fabs_tpl(bound[1]) - fabs_tpl(bound[0]))] *= sg; - - if (isnonneg(d) & inrange(d, bound[0], bound[1])) - { - d = sqrt_tpl(d); - a = (ftype)0.5 / a; - proots[nRoots] = (-b - d) * a; - nRoots += inrange(proots[nRoots], start, end); - proots[nRoots] = (-b + d) * a; - nRoots += inrange(proots[nRoots], start, end); - } - } - } - - if constexpr (maxdegree >= 3) - { - if (degree == 3) - { - ftype t, a, b, c, a3, p, q, Q, Qr, Ar, Ai, phi; - - t = (ftype)1.0 / data[3]; - a = data[2] * t; - b = data[1] * t; - c = data[0] * t; - a3 = a * (ftype)(1.0 / 3); - p = b - a * a3; - q = (a3 * b - c) * (ftype)0.5 - cube(a3); - Q = cube(p * (ftype)(1.0 / 3)) + q * q; - Qr = sqrt_tpl(fabs_tpl(Q)); - - if (Q > 0) - { - proots[0] = cubert_tpl(q + Qr) + cubert_tpl(q - Qr) - a3; - nRoots = 1; - } - else - { - phi = atan2_tpl(Qr, q) * (ftype)(1.0 / 3); - t = pow_tpl(Qr * Qr + q * q, (ftype)(1.0 / 6)); - Ar = t * cos_tpl(phi); - Ai = t * sin_tpl(phi); - proots[0] = 2 * Ar - a3; - proots[1] = aznumeric_cast(-Ar + Ai * sqrt3 - a3); - proots[2] = aznumeric_cast(-Ar - Ai * sqrt3 - a3); - i = idxmax3(proots); - swap(proots, i, 2); - i = isneg(proots[0] - proots[1]); - swap(proots, i, 1); - nRoots = 3; - } - } - } - - if constexpr (maxdegree >= 4) - { - if (degree == 4) - { - ftype t, a3, a2, a1, a0, y, R, D, E, subroots[3]; - const ftype e = (ftype)1E-9; - - t = (ftype)1.0 / data[4]; - a3 = data[3] * t; - a2 = data[2] * t; - a1 = data[1] * t; - a0 = data[0] * t; - polynomial_tpl p3aux; - ftype kp3aux[] = { 1, -a2, a1 * a3 - 4 * a0, 4 * a2 * a0 - a1 * a1 - a3 * a3 * a0 }; - p3aux.set(kp3aux); - if (!p3aux.findroots((ftype)-1E20, (ftype)1E20, subroots)) - { - return 0; - } - R = a3 * a3 * (ftype)0.25 - a2 + (y = subroots[0]); - - if (R > -e) - { - if (R < e) - { - D = E = a3 * a3 * (ftype)(3.0 / 4) - 2 * a2; - t = y * y - 4 * a0; - if (t < -e) - { - return 0; - } - t = 2 * sqrt_tpl(max((ftype)0, t)); - } - else - { - R = sqrt_tpl(max((ftype)0, R)); - D = E = a3 * a3 * (ftype)(3.0 / 4) - R * R - 2 * a2; - t = (4 * a3 * a2 - 8 * a1 - a3 * a3 * a3) / R * (ftype)0.25; - } - if (D + t > -e) - { - D = sqrt_tpl(max((ftype)0, D + t)); - proots[nRoots++] = a3 * (ftype)-0.25 + (R - D) * (ftype)0.5; - proots[nRoots++] = a3 * (ftype)-0.25 + (R + D) * (ftype)0.5; - } - if (E - t > -e) - { - E = sqrt_tpl(max((ftype)0, E - t)); - proots[nRoots++] = a3 * (ftype)-0.25 - (R + E) * (ftype)0.5; - proots[nRoots++] = a3 * (ftype)-0.25 - (R - E) * (ftype)0.5; - } - if (nRoots == 4) - { - i = idxmax3(proots); - if (proots[3] < proots[i]) - { - swap(proots, i, 3); - } - i = idxmax3(proots); - swap(proots, i, 2); - i = isneg(proots[0] - proots[1]); - swap(proots, i, 1); - } - } - } - } - - if constexpr (maxdegree > 4) - { - if (degree > 4) - { - ftype roots[maxdegree + 1], prevroot, val, prevval[2], curval, bound[2], middle; - polynomial_tpl deriv; - int nExtremes, iter, iBound; - calc_deriviative(deriv); - - // find a subset of deriviative extremes between start and end - for (nExtremes = deriv.findroots(start, end, roots + 1, nIters, degree - 1) + 1; nExtremes > 1 && roots[nExtremes - 1] > end; nExtremes--) - { - ; - } - for (i = 1; i < nExtremes && roots[i] < start; i++) - { - ; - } - roots[i - 1] = start; - PREFAST_ASSUME(nExtremes < maxdegree + 1); - roots[nExtremes++] = end; - - for (prevroot = start, prevval[0] = eval(start, degree), nRoots = 0; i < nExtremes; prevval[0] = val, prevroot = roots[i++]) - { - val = eval(roots[i], degree); - if (val * prevval[0] < 0) - { - // we have exactly one root between prevroot and roots[i] - bound[0] = prevroot; - bound[1] = roots[i]; - iter = 0; - do - { - middle = (bound[0] + bound[1]) * (ftype)0.5; - curval = eval(middle, degree); - iBound = isneg(prevval[0] * curval); - bound[iBound] = middle; - prevval[iBound] = curval; - } while (++iter < nIters); - proots[nRoots++] = middle; - } - } - } - } - - for (i = 0; i < nRoots && proots[i] < start; i++) - { - ; - } - for (; nRoots > i&& proots[nRoots - 1] > end; nRoots--) - { - ; - } - for (j = i; j < nRoots; j++) - { - proots[j - i] = proots[j]; - } - - return nRoots - i; - } - } // namespace polynomial_tpl_IMPL - template - using polynomial_tpl = polynomial_tpl_IMPL::polynomial_tpl; - - typedef polynomial_tpl P3; - typedef polynomial_tpl P2; - typedef polynomial_tpl P1; - typedef polynomial_tpl P3f; - typedef polynomial_tpl P2f; - typedef polynomial_tpl P1f; -} // namespace LegacyCryPhysicsUtils From 28adecf8b37557a5d2e0e40654e2519899b43ed5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 17 Nov 2021 19:22:19 -0800 Subject: [PATCH 087/394] Removes DisplayContext.cpp and Cry_Legacy_PhysUtils.h from Code/Editor/Plugins/EditorCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h | 0 Code/Editor/Plugins/EditorCommon/DisplayContext.cpp | 9 --------- .../Editor/Plugins/EditorCommon/editorcommon_files.cmake | 1 - 3 files changed, 10 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h delete mode 100644 Code/Editor/Plugins/EditorCommon/DisplayContext.cpp diff --git a/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h b/Code/Editor/Plugins/EditorCommon/Cry_LegacyPhysUtils.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Code/Editor/Plugins/EditorCommon/DisplayContext.cpp b/Code/Editor/Plugins/EditorCommon/DisplayContext.cpp deleted file mode 100644 index f0a82ba13c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/DisplayContext.cpp +++ /dev/null @@ -1,9 +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 "../../Editor/Objects/DisplayContextShared.inl" diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 511418efc7..a198bb0b4d 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -17,7 +17,6 @@ set(FILES DockTitleBarWidget.h SaveUtilities/AsyncSaveRunner.h SaveUtilities/AsyncSaveRunner.cpp - DisplayContext.cpp Resource.h WinWidget/WinWidget.h WinWidget/WinWidgetManager.h From 3f5b17b7925780a8ce6fa25593b96918ee6420e7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 13:59:43 -0800 Subject: [PATCH 088/394] =?UTF-8?q?=EF=BB=BFRemoves=20WinWidget=20from=20C?= =?UTF-8?q?ode/Editor/Plugins/EditorCommon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditor.h | 9 --- Code/Editor/IEditorImpl.cpp | 19 ----- Code/Editor/IEditorImpl.h | 9 --- Code/Editor/Lib/Tests/IEditorMock.h | 2 - Code/Editor/Plugins/EditorCommon/Resource.h | 26 ------- .../EditorCommon/WinWidget/WinWidget.h | 59 ---------------- .../WinWidget/WinWidgetManager.cpp | 70 ------------------- .../EditorCommon/WinWidget/WinWidgetManager.h | 41 ----------- .../EditorCommon/editorcommon_files.cmake | 4 -- 9 files changed, 239 deletions(-) delete mode 100644 Code/Editor/Plugins/EditorCommon/Resource.h delete mode 100644 Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h delete mode 100644 Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp delete mode 100644 Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index fa20481192..0ba24ac46a 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -66,11 +66,6 @@ struct SEditorSettings; class CGameExporter; class IAWSResourceManager; -namespace WinWidget -{ - class WinWidgetManager; -} - struct ISystem; struct IRenderer; struct AABB; @@ -586,10 +581,6 @@ struct IEditor virtual bool SetViewFocus(const char* sViewClassName) = 0; virtual void CloseView(const GUID& classId) = 0; // close ALL panels related to classId, used when unloading plugins. - // We want to open a view object but not wrap it in a view pane) - virtual QWidget* OpenWinWidget(WinWidgetId openId) = 0; - virtual WinWidget::WinWidgetManager* GetWinWidgetManager() const = 0; - //! Opens standard color selection dialog. //! Initialized with the color specified in color parameter. //! Returns true if selection is made and false if selection is canceled. diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 38006c6fca..fc18e1f4c3 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -75,9 +75,6 @@ AZ_POP_DISABLE_WARNING #include "Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.h" #include "Editor/AssetEditor/AssetEditorRequestsHandler.h" -// EditorCommon -#include - // AWSNativeSDK #include @@ -177,8 +174,6 @@ CEditorImpl::CEditorImpl() DetectVersion(); RegisterTools(); - m_winWidgetManager.reset(new WinWidget::WinWidgetManager); - m_pAssetDatabaseLocationListener = nullptr; m_pAssetBrowserRequestHandler = nullptr; m_assetEditorRequestsHandler = nullptr; @@ -847,20 +842,6 @@ const QtViewPane* CEditorImpl::OpenView(QString sViewClassName, bool reuseOpened return QtViewPaneManager::instance()->OpenPane(sViewClassName, openMode); } -QWidget* CEditorImpl::OpenWinWidget(WinWidgetId openId) -{ - if (m_winWidgetManager) - { - return m_winWidgetManager->OpenWinWidget(openId); - } - return nullptr; -} - -WinWidget::WinWidgetManager* CEditorImpl::GetWinWidgetManager() const -{ - return m_winWidgetManager.get(); -} - QWidget* CEditorImpl::FindView(QString viewClassName) { return QtViewPaneManager::instance()->GetView(viewClassName); diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 7867912941..f53b1b84d5 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -53,11 +53,6 @@ namespace Editor class EditorQtApplication; } -namespace WinWidget -{ - class WinWidgetManager; -} - namespace AssetDatabase { class AssetDatabaseLocationListener; @@ -221,9 +216,6 @@ public: bool CloseView(const char* sViewClassName) override; bool SetViewFocus(const char* sViewClassName) override; - QWidget* OpenWinWidget(WinWidgetId openId) override; - WinWidget::WinWidgetManager* GetWinWidgetManager() const override; - // close ALL panels related to classId, used when unloading plugins. void CloseView(const GUID& classId) override; bool SelectColor(QColor &color, QWidget *parent = 0) override; @@ -370,7 +362,6 @@ protected: QString m_levelNameBuffer; IAWSResourceManager* m_awsResourceManager; - std::unique_ptr m_winWidgetManager; //! True if the editor is in material edit mode. Fast preview of materials. //! In this mode only very limited functionality is available. diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index aaee34c2c6..b2f7e2627f 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -128,8 +128,6 @@ public: MOCK_METHOD1(CloseView, bool(const char* )); MOCK_METHOD1(SetViewFocus, bool(const char* )); MOCK_METHOD1(CloseView, void(const GUID& )); - MOCK_METHOD1(OpenWinWidget, QWidget* (WinWidgetId )); - MOCK_CONST_METHOD0(GetWinWidgetManager, WinWidget::WinWidgetManager* ()); MOCK_METHOD2(SelectColor, bool(QColor &, QWidget *)); MOCK_METHOD0(GetUndoManager, class CUndoManager* ()); MOCK_METHOD0(BeginUndo, void()); diff --git a/Code/Editor/Plugins/EditorCommon/Resource.h b/Code/Editor/Plugins/EditorCommon/Resource.h deleted file mode 100644 index d1acef6314..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Resource.h +++ /dev/null @@ -1,26 +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 - * - */ - - - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by EditorCommon.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS - -#define _APS_NEXT_RESOURCE_VALUE 1000 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 1000 -#define _APS_NEXT_COMMAND_VALUE 32771 -#endif -#endif diff --git a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h b/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h deleted file mode 100644 index 06e84c1405..0000000000 --- a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidget.h +++ /dev/null @@ -1,59 +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 "EditorCommonAPI.h" -#include "IEditor.h" - - -#include -#include -#include - -namespace WinWidget -{ - template - bool RegisterWinWidget() - { - static QWidget* winWidget {nullptr}; // Must declare outside of lambda - - WinWidget::WinWidgetManager::WinWidgetCreateCall createCall = []() -> QWidget* - { - if (!winWidget) - { - winWidget = new QWidget(GetIEditor()->GetEditorMainWindow()); - } - - // Ensure only one instance of each window type exists - QList existingWidgets = winWidget->findChildren(); - if (existingWidgets.size() > 0) // Note that the list should contain 0 or 1 entries - { - if (existingWidgets.first()->isVisible()) - { - return nullptr; // TWidget type already in use - continue using it and don't create another - } - delete existingWidgets.first(); // Closed TWidget - remove - } - - TWidget* createWidget = new TWidget(winWidget); - - createWidget->Display(); - return winWidget; - }; - - return GetIEditor()->GetWinWidgetManager()->RegisterWinWidget(TWidget::GetWWId(), createCall); - } - - template - void UnregisterWinWidget() - { - GetIEditor()->GetWinWidgetManager()->UnregisterWinWidget(TWidget::GetWWId()); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp b/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp deleted file mode 100644 index 3ffa1b1b99..0000000000 --- a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.cpp +++ /dev/null @@ -1,70 +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 - -namespace WinWidget -{ - WinWidgetManager::WinWidgetManager() - : m_createCalls(size_t(WinWidgetId::NUM_WIN_WIDGET_IDS) + 1) - { - } - - size_t WinWidgetManager::GetIndexForId(WinWidgetId thisId) const - { - size_t thisIndex = static_cast(thisId); - if (thisIndex >= m_createCalls.size()) - { - return 0; - } - return thisIndex; - } - - WinWidgetManager::WinWidgetCreateCall WinWidgetManager::GetCreateCall(WinWidgetId thisId) const - { - size_t thisIndex = GetIndexForId(thisId); - if (!thisIndex) - { - return nullptr; - } - return m_createCalls[thisIndex]; - } - - bool WinWidgetManager::RegisterWinWidget(WinWidgetId thisId, WinWidgetCreateCall createCall) - { - size_t thisIndex = GetIndexForId(thisId); - if (m_createCalls[thisIndex] != nullptr) - { - return false; - } - m_createCalls[thisIndex] = createCall; - return true; - } - - bool WinWidgetManager::UnregisterWinWidget(WinWidgetId thisId) - { - size_t thisIndex = GetIndexForId(thisId); - if (m_createCalls[thisIndex] == nullptr) - { - return false; - } - m_createCalls[thisIndex] = nullptr; - return true; - } - - - QWidget* WinWidgetManager::OpenWinWidget(WinWidgetId createId) const - { - WinWidgetManager::WinWidgetCreateCall createCall = GetCreateCall(createId); - if (!createCall) - { - return nullptr; - } - return createCall(); - } -} diff --git a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h b/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h deleted file mode 100644 index 968f3ea6d2..0000000000 --- a/Code/Editor/Plugins/EditorCommon/WinWidget/WinWidgetManager.h +++ /dev/null @@ -1,41 +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 "EditorCommonAPI.h" - -#include -#include - -class QWidget; - -namespace WinWidget -{ - class EDITOR_COMMON_API WinWidgetManager - { - public: - using WinWidgetCreateCall = std::function; - - WinWidgetManager(); - ~WinWidgetManager() {} - - bool RegisterWinWidget(WinWidgetId thisId, WinWidgetCreateCall createCall); - bool UnregisterWinWidget(WinWidgetId thisId); - - QWidget* OpenWinWidget(WinWidgetId) const; - private: - WinWidgetCreateCall GetCreateCall(WinWidgetId thisId) const; - size_t GetIndexForId(WinWidgetId thisId) const; - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - std::vector m_createCalls; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - }; -} diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index a198bb0b4d..031d8765ff 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -17,8 +17,4 @@ set(FILES DockTitleBarWidget.h SaveUtilities/AsyncSaveRunner.h SaveUtilities/AsyncSaveRunner.cpp - Resource.h - WinWidget/WinWidget.h - WinWidget/WinWidgetManager.h - WinWidget/WinWidgetManager.cpp ) From ac4ce8983bf6d406ef26274737931ba7db0ca14e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:11:33 -0800 Subject: [PATCH 089/394] Removes unused resource files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Launcher/editor_launcher.rc | 2 - Code/Editor/Launcher/resource.h | 9 --- .../ComponentEntityEditorPlugin.mf | 3 - .../Plugins/EditorCommon/EditorCommon.rc | Bin 2326 -> 0 bytes .../EditorCommon/Icons/CurveEditor/auto.png | 3 - .../EditorCommon/Icons/CurveEditor/break.png | 3 - .../Icons/CurveEditor/fit_horizontal.png | 3 - .../Icons/CurveEditor/fit_vertical.png | 3 - .../Icons/CurveEditor/linear_in.png | 3 - .../Icons/CurveEditor/linear_out.png | 3 - .../Icons/CurveEditor/step_in.png | 3 - .../Icons/CurveEditor/step_out.png | 3 - .../EditorCommon/Icons/CurveEditor/unify.png | 3 - .../Icons/CurveEditor/zero_in.png | 3 - .../Icons/CurveEditor/zero_out.png | 3 - .../EditorCommon/editorcommon_files.cmake | 1 - .../Plugins/PerforcePlugin/PerforcePlugin.qrc | 4 - .../Plugins/PerforcePlugin/PerforcePlugin.rc | 71 ------------------ .../PerforcePlugin/perforceplugin_files.cmake | 2 - Code/Editor/Plugins/PerforcePlugin/resource.h | 23 ------ 20 files changed, 148 deletions(-) delete mode 100644 Code/Editor/Launcher/editor_launcher.rc delete mode 100644 Code/Editor/Launcher/resource.h delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf delete mode 100644 Code/Editor/Plugins/EditorCommon/EditorCommon.rc delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png delete mode 100644 Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png delete mode 100644 Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc delete mode 100644 Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc delete mode 100644 Code/Editor/Plugins/PerforcePlugin/resource.h diff --git a/Code/Editor/Launcher/editor_launcher.rc b/Code/Editor/Launcher/editor_launcher.rc deleted file mode 100644 index 26dad7a3da..0000000000 --- a/Code/Editor/Launcher/editor_launcher.rc +++ /dev/null @@ -1,2 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "..\\res\\lyeditor.ico" - diff --git a/Code/Editor/Launcher/resource.h b/Code/Editor/Launcher/resource.h deleted file mode 100644 index 1be83bd298..0000000000 --- a/Code/Editor/Launcher/resource.h +++ /dev/null @@ -1,9 +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 - * - */ - -#define IDI_ICON1 2 diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf b/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf deleted file mode 100644 index 997209477a..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.mf +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Code/Editor/Plugins/EditorCommon/EditorCommon.rc b/Code/Editor/Plugins/EditorCommon/EditorCommon.rc deleted file mode 100644 index 77deebb598990e925cf97758d98877e71ec79872..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2326 zcmd6p%Wm306o${5r?8w&t5)2aO_n7#77Br=5TmXTL_`8MB~VS*=s3R0z3 z)_6Q~?*F;K?_VV;Ng%f}lcB6+A#2t|Hr%D$t>sAuGUs$HA9wXMDjn%Vi$SU*4QUf;pS>k@zJu4t z=Wz6bq1WMWqQU3c$?8`H#LC;Hxar*;Hro<`>$P-`Nbk!zYju;C1g~$&OGj?dXrrm) zdxI#BbJ|*&m@1hd*T;)kYIu?u-}WW*x_#~oaGite_^4!AeiC~Vy7FdNozVk|fwR-b zf3=`{AMCrldnOAJcRg-DN!63+%2)8yT1?TR{1Fz^#!hR8cxupm&MLh3*tlV-?iMmN zG$qEK&5UNJhPF1DQCvej*qDyX=+HX;&xxc#EEB3p`^jbdkft3iudytbpmN2!#8%nU zvXj{N%hBAPlKmzTDHb9AF65E9Fu=EGVjFN8bFcksso6G?Z%l~|+}aa?`O^0T+yQYf zO{M~Hk2uF@o0{pM)H`Gr@*R#L68Y$zPj2^pbGSuF<|ml#$h?n_c&%OfCr@HiOE!uC z3^pb+Gxld>ZAF~#pFb(AUoN7MPA-xyyDDcyuhpUxeZ{Ub-_MQJAA+=YhmFYQ(jrmh ze$I1xG)-(xjV0By1QGqkn37@5*{&XZN+9pZ>U+>rsee~1?X9=^i>7F~+R>A%=)Z}U zt?3axp*8L2CZr#<546Mb`8hoozV^fQbxLK$coyZR&D*m-vr@2Hy&`w+wDNnmizb~Z bYjUCgO!7Tz=ewO|_J2W@4k;h-)B5`YCMh&c diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png deleted file mode 100644 index 4009c4110c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/auto.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e60156229cc8677e0294d297486f04bd78867ef4e0922b35444c8b45f78584d -size 1090 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png deleted file mode 100644 index 75399a536a..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/break.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd29a16a1d1d9a363e4b154d51910c2cba2787fbbe1360cfd107b393053d2e49 -size 1226 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png deleted file mode 100644 index fee50a459c..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_horizontal.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:244005cde119238bbfc2815f36a343c6135c3233d0b72a5c97a6080604568e8f -size 1160 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png deleted file mode 100644 index 9a067e6980..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/fit_vertical.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33176a8ea6b0798adf1114fdbea4b0f5c708f40c3d48a047b1cb0fa6ebcbbded -size 1181 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png deleted file mode 100644 index 1ba6d72859..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_in.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c122557745cc377768491ce59c5b5b17e54671aa59f7f87101766aa61758959e -size 939 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png deleted file mode 100644 index 58694e0c4f..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/linear_out.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c2a360a56a37bfae2bea16b495f5b6ee482caa28d0949e8eadea48fdaae654f -size 845 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png deleted file mode 100644 index d1a2238790..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_in.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eb0f43228bdb5246ea3bfde0726f07e0df0468279610ba4c801b21e264b33123 -size 765 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png deleted file mode 100644 index 910db1aeb3..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/step_out.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:97a2e879222323bc70787efbe2cbc1c47bbabb7b10df8465857e600a9084abb2 -size 795 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png deleted file mode 100644 index 5a8a5105d7..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/unify.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58e8476b7bec1ed8eddfde3d5228f58fcfba11329318f5dfef3d98eb99f3a897 -size 1113 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png deleted file mode 100644 index d43d881d45..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_in.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a7847e8b7f3dd76395d893888916e4bd97ddf3f678d37d19836da04c2923791e -size 871 diff --git a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png b/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png deleted file mode 100644 index f287d1c7af..0000000000 --- a/Code/Editor/Plugins/EditorCommon/Icons/CurveEditor/zero_out.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:470266956c6911690299f29539c400122ae707f88d9b6ba3516faf196a8fd571 -size 877 diff --git a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake index 031d8765ff..1ae1f51632 100644 --- a/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake +++ b/Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake @@ -9,7 +9,6 @@ set(FILES EditorCommon.h EditorCommon.cpp - EditorCommon.rc EditorCommonAPI.h ActionOutput.h ActionOutput.cpp diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc b/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc deleted file mode 100644 index d378e6b5e4..0000000000 --- a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.qrc +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc b/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc deleted file mode 100644 index 26e4bbda6b..0000000000 --- a/Code/Editor/Plugins/PerforcePlugin/PerforcePlugin.rc +++ /dev/null @@ -1,71 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_P4 ICON "res\\p4.ico" -IDI_P4_ERROR ICON "res\\p4_error.ico" -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake b/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake index 7932c01015..5302a9f718 100644 --- a/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake +++ b/Code/Editor/Plugins/PerforcePlugin/perforceplugin_files.cmake @@ -13,8 +13,6 @@ set(FILES PasswordDlg.h PerforcePlugin.cpp PerforcePlugin.h - PerforcePlugin.qrc PerforceSourceControl.cpp PerforceSourceControl.h - resource.h ) diff --git a/Code/Editor/Plugins/PerforcePlugin/resource.h b/Code/Editor/Plugins/PerforcePlugin/resource.h deleted file mode 100644 index bb41c2b1bd..0000000000 --- a/Code/Editor/Plugins/PerforcePlugin/resource.h +++ /dev/null @@ -1,23 +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 - * - */ - - -#define IDI_P4 104 -#define IDI_P4_ERROR 106 -#define IDC_ERROR 1004 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 107 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1010 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From 0d94e5cb0def09dfcd7e707e060ab12ba36c9d83 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:21:32 -0800 Subject: [PATCH 090/394] Removes bitarray.h from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorDefs.h | 1 - Code/Editor/Util/bitarray.h | 335 ----------------------------- Code/Editor/editor_lib_files.cmake | 1 - 3 files changed, 337 deletions(-) delete mode 100644 Code/Editor/Util/bitarray.h diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index 97c03b2b45..3abc3eb53c 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -123,7 +123,6 @@ #include "Util/XmlTemplate.h" // Utility classes. -#include "Util/bitarray.h" #include "Util/RefCountBase.h" #include "Util/TRefCountBase.h" #include "Util/MemoryBlock.h" diff --git a/Code/Editor/Util/bitarray.h b/Code/Editor/Util/bitarray.h deleted file mode 100644 index 5a887b02d5..0000000000 --- a/Code/Editor/Util/bitarray.h +++ /dev/null @@ -1,335 +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 - * - */ - - -// Description : Array of m_bits. - - -#ifndef CRYINCLUDE_EDITOR_UTIL_BITARRAY_H -#define CRYINCLUDE_EDITOR_UTIL_BITARRAY_H -#pragma once - - -////////////////////////////////////////////////////////////////////////// -// -// CBitArray is similar to std::vector but faster to clear. -// -////////////////////////////////////////////////////////////////////////// -class CBitArray -{ -public: - struct BitReference - { - uint32* p; - uint32 mask; - BitReference(uint32* __x, uint32 __y) - : p(__x) - , mask(__y) {} - - - public: - BitReference() - : p(0) - , mask(0) {} - - operator bool() const { - return !(!(*p & mask)); - } - BitReference& operator=(bool __x) - { - if (__x) - { - * p |= mask; - } - else - { - * p &= ~mask; - } - return *this; - } - BitReference& operator=(const BitReference& __x) { return *this = bool(__x); } - bool operator==(const BitReference& __x) const { return bool(*this) == bool(__x); } - bool operator<(const BitReference& __x) const { return !bool(*this) && bool(__x); } - BitReference& operator |= (bool __x) - { - if (__x) - { - * p |= mask; - } - return *this; - } - BitReference& operator &= (bool __x) - { - if (!__x) - { - * p &= ~mask; - } - return *this; - } - void flip() {* p ^= mask; } - }; - - CBitArray() { m_base = nullptr; m_bits = nullptr; m_size = 0; m_numBits = 0; }; - CBitArray(int numBits) { resize(numBits); }; - ~CBitArray() - { - if (m_base) - { - free(m_base); - } - }; - - void resize(int c) - { - m_numBits = c; - int newSize = ((c + 63) & (~63)) >> 5; - if (newSize > m_size) - { - Alloc(newSize); - } - } - int size() const { return m_numBits; }; - bool empty() const { return m_numBits == 0; }; - - ////////////////////////////////////////////////////////////////////////// - void set() - { - memset(m_bits, 0xFFFFFFFF, m_size * sizeof(uint32)); // Set all bits. - } - ////////////////////////////////////////////////////////////////////////// - void set(int numBits) - { - int num = (numBits >> 3) + 1; - if (num > (m_size * sizeof(uint32))) - { - num = m_size * sizeof(uint32); - } - memset(m_bits, 0xFFFFFFFF, num); // Reset num bits. - } - - ////////////////////////////////////////////////////////////////////////// - void clear() - { - memset(m_bits, 0, m_size * sizeof(uint32)); // Reset all bits. - } - - ////////////////////////////////////////////////////////////////////////// - void clear(int numBits) - { - int num = (numBits >> 3) + 1; - if (num > (m_size * sizeof(uint32))) - { - num = m_size * sizeof(uint32); - } - memset(m_bits, 0, num); // Reset num bits. - } - - ////////////////////////////////////////////////////////////////////////// - // Check if all bits are 0. - bool is_zero() const - { - for (int i = 0; i < m_size; i++) - { - if (m_bits[i] != 0) - { - return false; - } - } - return true; - } - - // Count number of set bits. - int count_bits() const - { - int c = 0; - for (int i = 0; i < m_size; i++) - { - uint32 v = m_bits[i]; - for (int j = 0; j < 32; j++) - { - if (v & (1 << (j & 0x1F))) - { - c++; // if bit set increase bit count. - } - } - } - return c; - } - - BitReference operator[](int pos) { return BitReference(&m_bits[index(pos)], shift(pos)); } - const BitReference operator[](int pos) const { return BitReference(&m_bits[index(pos)], shift(pos)); } - - ////////////////////////////////////////////////////////////////////////// - void swap(CBitArray& bitarr) - { - std::swap(m_base, bitarr.m_base); - std::swap(m_bits, bitarr.m_bits); - std::swap(m_size, bitarr.m_size); - } - - CBitArray& operator =(const CBitArray& b) - { - if (m_size != b.m_size) - { - Alloc(b.m_size); - } - memcpy(m_bits, b.m_bits, m_size * sizeof(uint32)); - return *this; - } - - bool checkByte(int pos) const { return reinterpret_cast(m_bits)[pos] != 0; }; - - ////////////////////////////////////////////////////////////////////////// - // Compresses this bit array into the specified one. - // Uses run length encoding compression. - void compress(CBitArray& b) const - { - int i, countz, compsize, bsize; - char* out; - char* in; - - bsize = m_size * 4; - compsize = 0; - in = (char*)m_bits; - for (i = 0; i < bsize; i++) - { - compsize++; - if (in[i] == 0) - { - countz = 1; - while (++i < bsize) - { - if (in[i] == 0 && countz != 255) - { - countz++; - } - else - { - break; - } - } - i--; - compsize++; - } - } - b.resize((compsize + 1) << 3); - out = (char*)b.m_bits; - in = (char*)m_bits; - *out++ = static_cast(bsize); - for (i = 0; i < bsize; i++) - { - *out++ = in[i]; - if (in[i] == 0) - { - countz = 1; - while (++i < bsize) - { - if (in[i] == 0 && countz != 255) - { - countz++; - } - else - { - break; - } - } - i--; - *out++ = static_cast(countz); - } - } - } - - ////////////////////////////////////////////////////////////////////////// - // Decompress specified bit array in to this one. - // Uses run length encoding compression. - void decompress(CBitArray& b) - { - int raw, decompressed, c; - char* out, * in; - - in = (char*)m_bits; - out = (char*)b.m_bits; - decompressed = 0; - raw = *in++; - while (decompressed < raw) - { - if (*in != 0) - { - *out++ = *in++; - decompressed++; - } - else - { - in++; - c = *in++; - decompressed += c; - while (c) - { - *out++ = 0; - c--; - } - ; - } - } - m_numBits = decompressed; - } - - void CopyFromMem(const char* src, int size) - { - Alloc(size); - memcpy(m_bits, src, size); - } - int CopyToMem(char* trg) - { - memcpy(trg, m_bits, m_size); - return m_size; - } - -private: - void* m_base; - uint32* m_bits; - int m_size; - int m_numBits; - - void Alloc(int s) - { - if (m_base) - { - free(m_base); - } - m_size = s; - m_base = (char*)malloc(m_size * sizeof(uint32) + 32); - m_bits = (uint32*)(((UINT_PTR)m_base + 31) & (~31)); // align by 32. - memset(m_bits, 0, m_size * sizeof(uint32)); // Reset all bits. - } - uint32 shift(int pos) const - { - return (1 << (pos & 0x1F)); - } - uint32 index(int pos) const - { - return pos >> 5; - } - - friend int concatBitarray(CBitArray& b1, CBitArray& b2, CBitArray& test, CBitArray& res); -}; - -inline int concatBitarray(CBitArray& b1, CBitArray& b2, CBitArray& test, CBitArray& res) -{ - unsigned int b, any; - any = 0; - for (int i = 0; i < b1.size(); i++) - { - b = b1.m_bits[i] & b2.m_bits[i]; - any |= (b & (~test.m_bits[i])); // test if any different from test(i) bit set. - res.m_bits[i] = b; - } - return any; -} - -#endif // CRYINCLUDE_EDITOR_UTIL_BITARRAY_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index aa52b18b45..3bdd85beee 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -660,7 +660,6 @@ set(FILES Util/XmlArchive.h Util/XmlTemplate.cpp Util/XmlTemplate.h - Util/bitarray.h Util/fastlib.h Util/smartptr.h WaitProgress.cpp From 63aaa0cba452770aa1962dec967dc08170c00149 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:37:25 -0800 Subject: [PATCH 091/394] Removes DynamicArray2D from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/DynamicArray2D.cpp | 150 ---------------------------- Code/Editor/Util/DynamicArray2D.h | 37 ------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 189 deletions(-) delete mode 100644 Code/Editor/Util/DynamicArray2D.cpp delete mode 100644 Code/Editor/Util/DynamicArray2D.h diff --git a/Code/Editor/Util/DynamicArray2D.cpp b/Code/Editor/Util/DynamicArray2D.cpp deleted file mode 100644 index 3f09c557de..0000000000 --- a/Code/Editor/Util/DynamicArray2D.cpp +++ /dev/null @@ -1,150 +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 "EditorDefs.h" - -#include "DynamicArray2D.h" - -// Editor -#include "Util/fastlib.h" - -////////////////////////////////////////////////////////////////////// -// Construction / destruction -////////////////////////////////////////////////////////////////////// - -CDynamicArray2D::CDynamicArray2D(unsigned int iDimension1, unsigned int iDimension2) -{ - //////////////////////////////////////////////////////////////////////// - // Declare a 2D array on the free store - //////////////////////////////////////////////////////////////////////// - - unsigned int i; - - // Save the position of the array dimensions - m_Dimension1 = iDimension1; - m_Dimension2 = iDimension2; - - // First dimension - m_Array = new float* [m_Dimension1]; - assert(m_Array); - - // Second dimension - for (i = 0; i < m_Dimension1; ++i) - { - m_Array[i] = new float[m_Dimension2]; - - // Init all fields with 0 - memset(&m_Array[i][0], 0, m_Dimension2 * sizeof(float)); - } -} - -CDynamicArray2D::~CDynamicArray2D() -{ - //////////////////////////////////////////////////////////////////////// - // Remove the 2D array and all its sub arrays from the free store - //////////////////////////////////////////////////////////////////////// - - unsigned int i; - - for (i = 0; i < m_Dimension1; ++i) - { - delete [] m_Array[i]; - } - - delete [] m_Array; - m_Array = nullptr; -} - - -void CDynamicArray2D::ScaleImage(CDynamicArray2D* pDestination) -{ - //////////////////////////////////////////////////////////////////////// - // Scale an image stored (in an array class) to a new size - //////////////////////////////////////////////////////////////////////// - - unsigned int i, j, iOldWidth; - int iXSrcFl, iXSrcCe, iYSrcFl, iYSrcCe; - float fXSrc, fYSrc; - float fHeight[4]; - float fHeightWeight[4]; - float fHeightBottom; - float fHeightTop; - - assert(pDestination); - assert(pDestination->m_Dimension1 > 1); - - // Width has to be zero based, not a count - iOldWidth = m_Dimension1 - 1; - - // Loop trough each field of the new image and interpolate the value - // from the source heightmap - for (i = 0; i < pDestination->m_Dimension1; i++) - { - // Calculate the average source array position - fXSrc = i / (float) pDestination->m_Dimension1 * iOldWidth; - assert(fXSrc >= 0.0f && fXSrc <= iOldWidth); - - // Precalculate floor and ceiling values. Use fast asm integer floor and - // fast asm float / integer conversion - iXSrcFl = ifloor(fXSrc); - iXSrcCe = FloatToIntRet((float) ceil(fXSrc)); - - // Distribution between left and right height values - fHeightWeight[0] = (float) iXSrcCe - fXSrc; - fHeightWeight[1] = fXSrc - (float) iXSrcFl; - - // Avoid error when floor() and ceil() return the same value - if (fHeightWeight[0] == 0.0f && fHeightWeight[1] == 0.0f) - { - fHeightWeight[0] = 0.5f; - fHeightWeight[1] = 0.5f; - } - - for (j = 0; j < pDestination->m_Dimension1; j++) - { - // Calculate the average source array position - fYSrc = j / (float) pDestination->m_Dimension1 * iOldWidth; - assert(fYSrc >= 0.0f && fYSrc <= iOldWidth); - - // Precalculate floor and ceiling values. Use fast asm integer floor and - // fast asm float / integer conversion - iYSrcFl = ifloor(fYSrc); - iYSrcCe = FloatToIntRet((float) ceil(fYSrc)); - - // Get the four nearest height values - fHeight[0] = m_Array[iXSrcFl][iYSrcFl]; - fHeight[1] = m_Array[iXSrcCe][iYSrcFl]; - fHeight[2] = m_Array[iXSrcFl][iYSrcCe]; - fHeight[3] = m_Array[iXSrcCe][iYSrcCe]; - - // Calculate how much weight each height value has - - // Distribution between top and bottom height values - fHeightWeight[2] = (float) iYSrcCe - fYSrc; - fHeightWeight[3] = fYSrc - (float) iYSrcFl; - - // Avoid error when floor() and ceil() return the same value - if (fHeightWeight[2] == 0.0f && fHeightWeight[3] == 0.0f) - { - fHeightWeight[2] = 0.5f; - fHeightWeight[3] = 0.5f; - } - - // Interpolate between the four nearest height values - - // Get the height for the given X position trough interpolation between - // the left and the right height - fHeightBottom = (fHeight[0] * fHeightWeight[0] + fHeight[1] * fHeightWeight[1]); - fHeightTop = (fHeight[2] * fHeightWeight[0] + fHeight[3] * fHeightWeight[1]); - - // Set the new value in the destination heightmap - pDestination->m_Array[i][j] = fHeightBottom * fHeightWeight[2] + fHeightTop * fHeightWeight[3]; - } - } -} diff --git a/Code/Editor/Util/DynamicArray2D.h b/Code/Editor/Util/DynamicArray2D.h deleted file mode 100644 index 20d26d2d87..0000000000 --- a/Code/Editor/Util/DynamicArray2D.h +++ /dev/null @@ -1,37 +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 - * - */ - - -// Description : Interface of the class CDynamicArray. - - -#ifndef CRYINCLUDE_EDITOR_UTIL_DYNAMICARRAY2D_H -#define CRYINCLUDE_EDITOR_UTIL_DYNAMICARRAY2D_H -#pragma once - - -class CDynamicArray2D -{ -public: - // constructor - CDynamicArray2D(unsigned int iDimension1, unsigned int iDimension2); - // destructor - virtual ~CDynamicArray2D(); - // - void ScaleImage(CDynamicArray2D* pDestination); - - - float** m_Array; // - -private: - - unsigned int m_Dimension1; // - unsigned int m_Dimension2; // -}; - -#endif // CRYINCLUDE_EDITOR_UTIL_DYNAMICARRAY2D_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 3bdd85beee..82cfe545b6 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -628,8 +628,6 @@ set(FILES Util/AutoDirectoryRestoreFileDialog.h Util/AutoDirectoryRestoreFileDialog.cpp Util/CryMemFile.h - Util/DynamicArray2D.cpp - Util/DynamicArray2D.h Util/EditorAutoLevelLoadTest.cpp Util/EditorAutoLevelLoadTest.h Util/EditorUtils.cpp From 821c352e6a83234b9feb8c280fc666bcb836967b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:17:39 -0800 Subject: [PATCH 092/394] Removes GdiUtil and cleanups GuidUtil from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Plugin.h | 39 ------- Code/Editor/Util/GdiUtil.cpp | 179 ----------------------------- Code/Editor/Util/GdiUtil.h | 54 --------- Code/Editor/Util/GuidUtil.cpp | 35 +++++- Code/Editor/Util/GuidUtil.h | 41 ------- Code/Editor/editor_lib_files.cmake | 2 - 6 files changed, 29 insertions(+), 321 deletions(-) delete mode 100644 Code/Editor/Util/GdiUtil.cpp delete mode 100644 Code/Editor/Util/GdiUtil.h diff --git a/Code/Editor/Plugin.h b/Code/Editor/Plugin.h index 5fa45ac140..dd2637f0e9 100644 --- a/Code/Editor/Plugin.h +++ b/Code/Editor/Plugin.h @@ -15,45 +15,6 @@ #include "Util/GuidUtil.h" #include -//! Derive from this class to decrease the amount of work for creating a new class description -//! Provides standard reference counter implementation for IUnknown -class CRefCountClassDesc - : public IClassDesc -{ -public: - virtual ~CRefCountClassDesc() { } - HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] const IID& riid, [[maybe_unused]] void** ppvObj) - { - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - ++m_nRefCount; - return m_nRefCount; - } - - ULONG STDMETHODCALLTYPE Release() - { - int refs = m_nRefCount; - - if (--m_nRefCount <= 0) - { - delete this; - } - - return refs; - } - -private: - int m_nRefCount; -}; - - -// Use this for debugging unregistration problems. -//#define DEBUG_CLASS_NAME_REGISTRATION - - //! Class factory is a common repository of all registered plugin classes, //! Classes here can found by their class ID or all classes of given system class retrieved class CRYEDIT_API CClassFactory diff --git a/Code/Editor/Util/GdiUtil.cpp b/Code/Editor/Util/GdiUtil.cpp deleted file mode 100644 index 72e5e28605..0000000000 --- a/Code/Editor/Util/GdiUtil.cpp +++ /dev/null @@ -1,179 +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 "EditorDefs.h" - -#include "GdiUtil.h" - -// Qt -#include -#include - -QColor ScaleColor(const QColor& c, float aScale) -{ - QColor aColor = c; - if (!aColor.isValid()) - { - // help out scaling, by starting at very low black - aColor = QColor(1, 1, 1); - } - - const float r = static_cast(aColor.red()) * aScale; - const float g = static_cast(aColor.green()) * aScale; - const float b = static_cast(aColor.blue()) * aScale; - - return QColor(AZStd::clamp(static_cast(r), 0, 255), AZStd::clamp(static_cast(g), 0, 255), AZStd::clamp(static_cast(b), 0, 255)); -} - -CAlphaBitmap::CAlphaBitmap() -{ - m_width = m_height = 0; -} - -CAlphaBitmap::~CAlphaBitmap() -{ - Free(); -} - -bool CAlphaBitmap::Create(void* pData, UINT aWidth, UINT aHeight, bool bVerticalFlip, bool bPremultiplyAlpha) -{ - if (!aWidth || !aHeight) - { - return false; - } - - m_bmp = QImage(aWidth, aHeight, QImage::Format_RGBA8888); - if (m_bmp.isNull()) - { - return false; - } - - std::vector vBuffer; - - if (pData) - { - // copy over the raw 32bpp data - bVerticalFlip = !bVerticalFlip; // in Qt, the flip is not required. Still, keep the API behaving the same - if (bVerticalFlip) - { - UINT nBufLen = aWidth * aHeight; - vBuffer.resize(nBufLen); - - if (IsBadReadPtr(pData, nBufLen * 4)) - { - //TODO: remove after testing alot the browser, it doesnt happen anymore - QMessageBox::critical(QApplication::activeWindow(), QString(), QObject::tr("Bad image data ptr!")); - Free(); - return false; - } - - assert(!vBuffer.empty()); - - if (vBuffer.empty()) - { - Free(); - return false; - } - - UINT scanlineSize = aWidth * 4; - - for (UINT i = 0, iCount = aHeight; i < iCount; ++i) - { - // top scanline position - UINT* pTopScanPos = (UINT*)&vBuffer[0] + i * aWidth; - // bottom scanline position - UINT* pBottomScanPos = (UINT*)pData + (aHeight - i - 1) * aWidth; - - // save a scanline from top - memcpy(pTopScanPos, pBottomScanPos, scanlineSize); - } - - pData = &vBuffer[0]; - } - - // premultiply alpha, AlphaBlend GDI expects it - if (bPremultiplyAlpha) - { - for (UINT y = 0; y < aHeight; ++y) - { - BYTE* pPixel = (BYTE*) pData + aWidth * 4 * y; - - for (UINT x = 0; x < aWidth; ++x) - { - pPixel[0] = ((int)pPixel[0] * pPixel[3] + 127) >> 8; - pPixel[1] = ((int)pPixel[1] * pPixel[3] + 127) >> 8; - pPixel[2] = ((int)pPixel[2] * pPixel[3] + 127) >> 8; - pPixel += 4; - } - } - } - - memcpy(m_bmp.bits(), pData, aWidth * aHeight * 4); - - if (m_bmp.isNull()) - { - return false; - } - } - else - { - m_bmp.fill(Qt::transparent); - } - - // we dont need this screen DC anymore - m_width = aWidth; - m_height = aHeight; - - return true; -} - -QImage& CAlphaBitmap::GetBitmap() -{ - return m_bmp; -} - -void CAlphaBitmap::Free() -{ - -} - -UINT CAlphaBitmap::GetWidth() -{ - return m_width; -} - -UINT CAlphaBitmap::GetHeight() -{ - return m_height; -} - -void CheckerboardFillRect(QPainter* pGraphics, const QRect& rRect, int checkDiameter, const QColor& aColor1, const QColor& aColor2) -{ - pGraphics->save(); - pGraphics->setClipRect(rRect); - // Create a checkerboard background for easier readability - pGraphics->fillRect(rRect, aColor1); - QBrush lightBrush(aColor2); - - // QRect bottom/right methods are short one unit for legacy reasons. Compute bottomr/right of the rectange ourselves to get the full size. - const int rectRight = rRect.x() + rRect.width(); - const int rectBottom = rRect.y() + rRect.height(); - - for (int i = rRect.left(); i < rectRight; i += checkDiameter) - { - for (int j = rRect.top(); j < rectBottom; j += checkDiameter) - { - if ((i / checkDiameter) % 2 ^ (j / checkDiameter) % 2) - { - pGraphics->fillRect(QRect(i, j, checkDiameter, checkDiameter), lightBrush); - } - } - } - pGraphics->restore(); -} diff --git a/Code/Editor/Util/GdiUtil.h b/Code/Editor/Util/GdiUtil.h deleted file mode 100644 index f38cbc0c0e..0000000000 --- a/Code/Editor/Util/GdiUtil.h +++ /dev/null @@ -1,54 +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 - * - */ - - -// Description : Utilitarian classes for double buffer GDI rendering and 32bit bitmaps - - -#ifndef CRYINCLUDE_EDITOR_UTIL_GDIUTIL_H -#define CRYINCLUDE_EDITOR_UTIL_GDIUTIL_H -#pragma once - -QColor ScaleColor(const QColor& coor, float aScale); - -//! This class loads alpha-channel bitmaps and holds a DC for use with AlphaBlend function -class CRYEDIT_API CAlphaBitmap -{ -public: - - CAlphaBitmap(); - ~CAlphaBitmap(); - - //! creates the bitmap from raw 32bpp data - //! \param pData the 32bpp raw image data, RGBA, can be nullptr and it would create just an empty bitmap - //! \param aWidth the bitmap width - //! \param aHeight the bitmap height - bool Create(void* pData, UINT aWidth, UINT aHeight, bool bVerticalFlip = false, bool bPremultiplyAlpha = false); - //! \return the actual bitmap - QImage& GetBitmap(); - //! free the bitmap and DC - void Free(); - //! \return bitmap width - UINT GetWidth(); - //! \return bitmap height - UINT GetHeight(); - -protected: - - QImage m_bmp; - UINT m_width, m_height; -}; - -//! Fill a rectangle with a checkerboard pattern. -//! \param pGraphics The Graphics object used for drawing -//! \param rRect The rectangle to be filled -//! \param checkDiameter the diameter of the check squares -//! \param aColor1 the color that starts in the top left corner check square -//! \param aColor2 the second color used for check squares -void CheckerboardFillRect(QPainter* pGraphics, const QRect& rRect, int checkDiameter, const QColor& aColor1, const QColor& aColor2); -#endif // CRYINCLUDE_EDITOR_UTIL_GDIUTIL_H diff --git a/Code/Editor/Util/GuidUtil.cpp b/Code/Editor/Util/GuidUtil.cpp index 5f81eac88e..e8ea6fd3f8 100644 --- a/Code/Editor/Util/GuidUtil.cpp +++ b/Code/Editor/Util/GuidUtil.cpp @@ -6,12 +6,35 @@ * */ - -#include "EditorDefs.h" - #include "GuidUtil.h" +const char* GuidUtil::ToString(REFGUID guid) +{ + static char guidString[64]; + sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); + return guidString; +} + ////////////////////////////////////////////////////////////////////////// -const GUID GuidUtil::NullGuid = { - 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } -}; +GUID GuidUtil::FromString(const char* guidString) +{ + GUID guid; + unsigned int d[8]; + memset(&d, 0, sizeof(guid)); + guid.Data1 = 0; + guid.Data2 = 0; + guid.Data3 = 0; + azsscanf(guidString, "{%8" GUID_FORMAT_DATA1 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", + &guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]); + guid.Data4[0] = static_cast(d[0]); + guid.Data4[1] = static_cast(d[1]); + guid.Data4[2] = static_cast(d[2]); + guid.Data4[3] = static_cast(d[3]); + guid.Data4[4] = static_cast(d[4]); + guid.Data4[5] = static_cast(d[5]); + guid.Data4[6] = static_cast(d[6]); + guid.Data4[7] = static_cast(d[7]); + + return guid; +} diff --git a/Code/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index de2bad8759..f42021ae2a 100644 --- a/Code/Editor/Util/GuidUtil.h +++ b/Code/Editor/Util/GuidUtil.h @@ -23,9 +23,6 @@ struct GuidUtil static const char* ToString(REFGUID guid); //! Convert from guid string in valid format to GUID class. static GUID FromString(const char* guidString); - static bool IsEmpty(REFGUID guid); - - static const GUID NullGuid; }; /** Used to compare GUID keys. @@ -38,42 +35,4 @@ struct guid_less_predicate } }; -////////////////////////////////////////////////////////////////////////// -inline bool GuidUtil::IsEmpty(REFGUID guid) -{ - return guid == NullGuid; -} - -////////////////////////////////////////////////////////////////////////// -inline const char* GuidUtil::ToString(REFGUID guid) -{ - static char guidString[64]; - sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], - guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - return guidString; -} - -////////////////////////////////////////////////////////////////////////// -inline GUID GuidUtil::FromString(const char* guidString) -{ - GUID guid; - unsigned int d[8]; - memset(&d, 0, sizeof(guid)); - guid.Data1 = 0; - guid.Data2 = 0; - guid.Data3 = 0; - azsscanf(guidString, "{%8" GUID_FORMAT_DATA1 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", - &guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]); - guid.Data4[0] = static_cast(d[0]); - guid.Data4[1] = static_cast(d[1]); - guid.Data4[2] = static_cast(d[2]); - guid.Data4[3] = static_cast(d[3]); - guid.Data4[4] = static_cast(d[4]); - guid.Data4[5] = static_cast(d[5]); - guid.Data4[6] = static_cast(d[6]); - guid.Data4[7] = static_cast(d[7]); - - return guid; -} - #endif // CRYINCLUDE_EDITOR_UTIL_GUIDUTIL_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 82cfe545b6..8064d56184 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -636,8 +636,6 @@ set(FILES Util/FileEnum.h Util/FileUtil.cpp Util/FileUtil.h - Util/GdiUtil.cpp - Util/GdiUtil.h Util/GeometryUtil.cpp Util/GuidUtil.cpp Util/GuidUtil.h From 796780af11c1c39aade6bb0cefe54f18148d4e5e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:23:44 -0800 Subject: [PATCH 093/394] Removes ImageASC from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ImageASC.cpp | 190 ----------------------------- Code/Editor/Util/ImageASC.h | 23 ---- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 215 deletions(-) delete mode 100644 Code/Editor/Util/ImageASC.cpp delete mode 100644 Code/Editor/Util/ImageASC.h diff --git a/Code/Editor/Util/ImageASC.cpp b/Code/Editor/Util/ImageASC.cpp deleted file mode 100644 index 1c4a8acf73..0000000000 --- a/Code/Editor/Util/ImageASC.cpp +++ /dev/null @@ -1,190 +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 "EditorDefs.h" - -#include "ImageASC.h" - -// Editor -#include "Util/Image.h" - -//--------------------------------------------------------------------------- - -bool CImageASC::Save(const QString& fileName, const CFloatImage& image) -{ - // There are two types of ARCGrid file formats - binary (ADF) and ASCII (ASC). - // See here: https://en.wikipedia.org/wiki/Esri_grid - - uint32 width = image.GetWidth(); - uint32 height = image.GetHeight(); - float* pixels = image.GetData(); - - AZStd::string fileHeader = AZStd::string::format( - // Number of columns and rows in the data - "ncols %d\n" - "nrows %d\n" - - // The coordinates of the bottom-left corner. - // These numbers represent coordinates on a globe, so this choice of values is arbitrary. - "xllcorner 0.0\n" - "yllcorner 0.0\n" - - // The size of each grid square. - // The problem is that cellsize represents the size of a square on a grid being projected onto a globe. - // This number can be used to convert size to degrees, based on where on the globe it appears. - // We don't have a real-world location associated with our data, so this size choice is arbitrary. - "cellsize 0.0003\n" - - // The value used for missing data. Since we shouldn't have any missing data, we'll choose a value that can't appear below. - "nodata_value -1\n" - , width, height); - - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "wt"); - if (!file) - { - return false; - } - - // First print the file header - fprintf(file, "%s", fileHeader.c_str()); - - // Then print all the pixels. - for (uint32 y = 0; y < height; y++) - { - for (uint32 x = 0; x < width; x++) - { - fprintf(file, "%.7f ", pixels[x + y * width]); - } - fprintf(file, "\n"); - } - - fclose(file); - return true; -} - -//--------------------------------------------------------------------------- - -bool CImageASC::Load(const QString& fileName, CFloatImage& image) -{ - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "rt"); - if (!file) - { - return false; - } - - const char seps[] = " \r\n\t"; - char* token; - - int32 width = 0; - int32 height = 0; - float nodataValue = 0.0f; - - bool validData = true; - - // Read the file into memory - - fseek(file, 0, SEEK_END); - int fileSize = ftell(file); - fseek(file, 0, SEEK_SET); - - char* str = new char[fileSize]; - fread(str, fileSize, 1, file); - - // Break all of the values in the file apart into tokens. - - [[maybe_unused]] char* nextToken = nullptr; - token = azstrtok(str, 0, seps, &nextToken); - - // ncols = grid width - validData = validData && (azstricmp(token, "ncols") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - width = atoi(token); - - // nrows = grid height - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "nrows") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - height = atoi(token); - - // xllcorner = leftmost coordinate. (Skip, we don't care about it) - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "xllcorner") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - - // yllcorner = bottommost coordinate. (Skip, we don't care about it) - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "yllcorner") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - - // cellsize = size of each grid cell. (Skip, we don't care about it) - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "cellsize") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - - // nodata_value = the value used for missing data. We'll replace these with 0 height. - token = azstrtok(nullptr, 0, seps, &nextToken); - validData = validData && (azstricmp(token, "nodata_value") == 0); - token = azstrtok(nullptr, 0, seps, &nextToken); - nodataValue = static_cast(atof(token)); - - if (!validData) - { - // Bad file. not supported asc. - delete[]str; - fclose(file); - return false; - } - - image.Allocate(width, height); - - // Read in the pixel data - - float* p = image.GetData(); - int size = width * height; - int i = 0; - float pixelValue; - float maxPixel = 0.0f; - while (token != nullptr && i < size) - { - token = azstrtok(nullptr, 0, seps, &nextToken); - if (token != nullptr) - { - // Negative heights aren't supported, clamp to 0. - pixelValue = max(0.0f, static_cast(atof(token))); - - // If this is a location we specifically don't have data for, set it to 0. - if (pixelValue == nodataValue) - { - pixelValue = 0.0f; - } - - *p++ = pixelValue; - maxPixel = max(maxPixel, pixelValue); - i++; - } - } - - if (maxPixel > 0.0f) - { - // Scale our range down to 0 - 1 - float* pp = image.GetData(); - for (i = 0; i < size; i++) - { - pp[i] = clamp_tpl(pp[i] / maxPixel, 0.0f, 1.0f); - } - } - - delete[]str; - - fclose(file); - - return true; -} - diff --git a/Code/Editor/Util/ImageASC.h b/Code/Editor/Util/ImageASC.h deleted file mode 100644 index 4570145dcf..0000000000 --- a/Code/Editor/Util/ImageASC.h +++ /dev/null @@ -1,23 +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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTIL_IMAGEASC_H -#define CRYINCLUDE_EDITOR_UTIL_IMAGEASC_H -#pragma once - -#include "Util/Image.h" - -class SANDBOX_API CImageASC -{ -public: - bool Load(const QString& fileName, CFloatImage& outImage); - bool Save(const QString& fileName, const CFloatImage& image); -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_IMAGEASC_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 8064d56184..66d1a544db 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -686,8 +686,6 @@ set(FILES Util/FileChangeMonitor.h Util/ImageUtil.cpp Util/ImageUtil.h - Util/ImageASC.cpp - Util/ImageASC.h Util/ImageBT.cpp Util/ImageBT.h Util/ImageGif.cpp From 53f7594ab62a0b3d4366f6f3f44b8b1325132d28 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:31:31 -0800 Subject: [PATCH 094/394] Removes ImageBT from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ImageBT.cpp | 207 ----------------------------- Code/Editor/Util/ImageBT.h | 23 ---- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 232 deletions(-) delete mode 100644 Code/Editor/Util/ImageBT.cpp delete mode 100644 Code/Editor/Util/ImageBT.h diff --git a/Code/Editor/Util/ImageBT.cpp b/Code/Editor/Util/ImageBT.cpp deleted file mode 100644 index eb54213cf1..0000000000 --- a/Code/Editor/Util/ImageBT.cpp +++ /dev/null @@ -1,207 +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 "EditorDefs.h" - -#include "ImageBT.h" - -//--------------------------------------------------------------------------- -// Load and save the VTP Binary Terrain (BT) format, documented here: -// http://vterrain.org/Implementation/Formats/BT.html - -// This structure represents a binary layout in the file. To direct load & save it, we need to remove all structure memory padding -#pragma pack(push,1) -struct BtHeader -{ - char headerTag[7]; // Should be "binterr" - char headerTagVersion[3]; // Should be "1.3" - int32 columns; // # of columns in the heightfield - int32 rows; // # of rows in the heightfield - int16 bytesPerPoint; // bytes per height value, either 2 for signed ints or 4 for floats - int16 isFloatingPointData; // 1 if height values are floats, 0 for 16-bit signed ints - int16 horizUnits; // 0 if degrees, 1 if meters, 2 if international feet, 3 if US survey feet - int16 utmZone; // UTM projection zone 1 to 60 or -1 to -60 (see https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system ) - int16 datum; // Datum value (6001 to 6094), see http://www.epsg.org/ - double leftExtent; // left coordinate projection of the file - double rightExtent; // right coordinate projection of the file - double bottomExtent; // bottom coordinate projection of the file - double topExtent; // top coordinate projection of the file - int16 externalProjection; // 1 if projection is in an external .prj file, 0 if it's contained in the header - float scale; // vertical units in meters. 0.0 should be treated as 1.0 - char unused[190]; -}; -#pragma pack(pop) - -bool CImageBT::Save(const QString& fileName, const CFloatImage& image) -{ - int width = image.GetWidth(); - int height = image.GetHeight(); - - float *pixels = image.GetData(); - - // Create a header with reasonable default values. - BtHeader header = - { - {'b', 'i', 'n', 't', 'e', 'r', 'r'}, - {'1', '.', '3' }, - width, - height, - sizeof(float), // we'll use floats to make sure we can capture the full potential range of heightfield values - 1, // use floats - 1, // units are meters - 0, // no UTM projection zone - 6326, // WGS84 Datum value. Recommended by VTP as the default if you don't care about Datum values. - 0.0, // set the left extent to 0? - double(width), // set the right extent to the width? (assumes 1 m per pixel) - double(height), // set the bottom extent to the height? (assumes 1 m per pixel) - 0.0, // set the top extent to 0? - 0, // no external prj file - 1.0f - }; - - memset(header.unused, 0, sizeof(header.unused)); - - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "wb"); - if (!file) - { - return false; - } - - fwrite(&header, sizeof(header), 1, file); - for (int32 y = 0; y < height; y++) - { - for (int32 x = 0; x < width; x++) - { - float heightmapValue = pixels[(y * width) + x]; - fwrite(&heightmapValue, sizeof(float), 1, file); - } - } - - fclose(file); - return true; -} - -//--------------------------------------------------------------------------- - -bool CImageBT::Load(const QString& fileName, CFloatImage& image) -{ - FILE* file = nullptr; - azfopen(&file, fileName.toUtf8().data(), "rb"); - if (!file) - { - return false; - } - - // Get the file size - - fseek(file, 0, SEEK_END); - int fileSize = ftell(file); - fseek(file, 0, SEEK_SET); - - // Our file needs to be at least as big as the BT file header. - if (fileSize < sizeof(BtHeader)) - { - return false; - } - - // Get the BT header data - BtHeader header; - memset(&header, 0, sizeof(BtHeader)); // C4701 potentially uninitialized local variable 'header' used - bool validData = true; - validData = validData && (fread(&header, sizeof(BtHeader), 1, file) != 0); - - // Do some quick error-checking on the header to make sure it meets our expectations - - // Does the header have the right header tag? (binterr1.0 - binterr1.3) - validData = validData && (memcmp(header.headerTag, "binterr", sizeof(header.headerTag)) == 0); - validData = validData && (header.headerTagVersion[0] == '1') && (header.headerTagVersion[1] == '.') && (header.headerTagVersion[2] >= '0') && (header.headerTagVersion[2] <= '3'); - - // Will the grid fit into a reasonable image size? - validData = validData && (header.columns >= 0) && (header.columns < 65536); - validData = validData && (header.rows >= 0) && (header.rows < 65536); - - // Do we either have 32-bit floats or 16-bit ints? - validData = validData && (((header.isFloatingPointData == 1) && (header.bytesPerPoint == 4)) || ((header.isFloatingPointData == 0) && (header.bytesPerPoint == 2))); - - // Is the remaining data exactly the size needed to fill our image? - validData = validData && ((fileSize - sizeof(BtHeader)) == (header.columns * header.rows * header.bytesPerPoint)); - - if (!validData) - { - fclose(file); - return false; - } - - if (header.scale == 0.0f) - { - header.scale = 1.0f; - } - - // The BT format defines the data as stored in column-first order, from bottom to top. - // However, some BT files store the data in row-first order, from top to bottom. - // There isn't anything that clearly specifies which type of file it is. If you load it the wrong way, - // the data will look like a bunch of wavy stripes. - // The only difference I've found in test files is datum values above 8000, which appears to be an invalid value for datum - // (it should be 6001-6904 according to the BT definition) - const int invalidDatumValueDenotingColumnFirstData = 8000; - bool isColumnFirstData = (header.datum >= invalidDatumValueDenotingColumnFirstData) ? true : false; - float height = 0.0f; - int imageWidth, imageHeight; - - if (isColumnFirstData) - { - imageWidth = header.rows; - imageHeight = header.columns; - } - else - { - imageWidth = header.columns; - imageHeight = header.rows; - } - - - image.Allocate(imageWidth, imageHeight); - float* p = image.GetData(); - float maxPixel = 0.0f; - - // Read in the pixel data - for (int32 y = 0; y < imageHeight; y++) - { - for (int32 x = 0; x < imageWidth; x++) - { - if (header.isFloatingPointData) - { - fread(&height, sizeof(float), 1, file); - } - else - { - int16 intHeight = 0; - fread(&intHeight, sizeof(int16), 1, file); - height = static_cast(intHeight); - } - // Scale based on what our header defines, and clamp the values to positive range, negatives not supported - p[(y * imageWidth) + x] = max((height * header.scale), 0.0f); - maxPixel = max(maxPixel, p[(y * imageWidth) + x]); - } - } - - // Scale our range down to 0 - 1 - if (maxPixel > 0.0f) - { - p = image.GetData(); - for (int32 i = 0; i < (imageWidth * imageHeight); i++) - { - p[i] = clamp_tpl(p[i] / maxPixel, 0.0f, 1.0f); - } - } - - fclose(file); - return true; -} - diff --git a/Code/Editor/Util/ImageBT.h b/Code/Editor/Util/ImageBT.h deleted file mode 100644 index dc7061527a..0000000000 --- a/Code/Editor/Util/ImageBT.h +++ /dev/null @@ -1,23 +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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTIL_IMAGEBT_H -#define CRYINCLUDE_EDITOR_UTIL_IMAGEBT_H -#pragma once - -#include "Util/Image.h" - -class SANDBOX_API CImageBT -{ -public: - bool Load(const QString& fileName, CFloatImage& outImage); - bool Save(const QString& fileName, const CFloatImage& image); -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_IMAGEBT_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 66d1a544db..171a9527d4 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -686,8 +686,6 @@ set(FILES Util/FileChangeMonitor.h Util/ImageUtil.cpp Util/ImageUtil.h - Util/ImageBT.cpp - Util/ImageBT.h Util/ImageGif.cpp Util/ImageGif.h Util/ImageTIF.cpp From 46cc160d8ce768026518828956f202232ebb4a95 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:03:08 -0800 Subject: [PATCH 095/394] Removes smartptr and TRefCountBase from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorDefs.h | 1 - Code/Editor/Util/TRefCountBase.h | 56 ------------------- Code/Editor/Util/smartptr.h | 29 ---------- Code/Editor/editor_lib_files.cmake | 2 - .../Animation/UiAnimViewSequenceManager.h | 2 - 5 files changed, 90 deletions(-) delete mode 100644 Code/Editor/Util/TRefCountBase.h delete mode 100644 Code/Editor/Util/smartptr.h diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index 3abc3eb53c..5dd653679b 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -124,7 +124,6 @@ // Utility classes. #include "Util/RefCountBase.h" -#include "Util/TRefCountBase.h" #include "Util/MemoryBlock.h" #include "Util/PathUtil.h" diff --git a/Code/Editor/Util/TRefCountBase.h b/Code/Editor/Util/TRefCountBase.h deleted file mode 100644 index aeedda9d16..0000000000 --- a/Code/Editor/Util/TRefCountBase.h +++ /dev/null @@ -1,56 +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 - * - */ - - -// Description : Reference counted base object. - - -#ifndef CRYINCLUDE_EDITOR_UTIL_TREFCOUNTBASE_H -#define CRYINCLUDE_EDITOR_UTIL_TREFCOUNTBASE_H -#pragma once - -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -////////////////////////////////////////////////////////////////////////// -//! Derive from this class to get reference counting for your class. -////////////////////////////////////////////////////////////////////////// -template -class CRYEDIT_API TRefCountBase - : public ParentClass -{ -AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - TRefCountBase() { m_nRefCount = 0; }; - - //! Add new refrence to this object. - unsigned long AddRef() - { - m_nRefCount++; - return m_nRefCount; - }; - - //! Release refrence to this object. - //! when reference count reaches zero, object is deleted. - unsigned long Release() - { - int refs = --m_nRefCount; - if (m_nRefCount <= 0) - { - delete this; - } - return refs; - } - -protected: - virtual ~TRefCountBase() {}; - -private: - int m_nRefCount; -}; - - -#endif // CRYINCLUDE_EDITOR_UTIL_TREFCOUNTBASE_H diff --git a/Code/Editor/Util/smartptr.h b/Code/Editor/Util/smartptr.h deleted file mode 100644 index d9e656ef24..0000000000 --- a/Code/Editor/Util/smartptr.h +++ /dev/null @@ -1,29 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UTIL_SMARTPTR_H -#define CRYINCLUDE_EDITOR_UTIL_SMARTPTR_H -#pragma once - -#include - -#define TSmartPtr _smart_ptr - -/** Use this to define smart pointers of classes. - For example: - class CNode : public CRefCountBase {}; - SMARTPTRTypeYPEDEF( CNode ); - { - CNodePtr node; // Smart pointer. - } -*/ - -#define SMARTPTR_TYPEDEF(Class) typedef TSmartPtr Class##Ptr - -#endif // CRYINCLUDE_EDITOR_UTIL_SMARTPTR_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 171a9527d4..28950c9fa9 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -648,7 +648,6 @@ set(FILES Util/PredefinedAspectRatios.h Util/StringHelpers.cpp Util/StringHelpers.h - Util/TRefCountBase.h Util/Triangulate.cpp Util/Triangulate.h Util/Util.h @@ -657,7 +656,6 @@ set(FILES Util/XmlTemplate.cpp Util/XmlTemplate.h Util/fastlib.h - Util/smartptr.h WaitProgress.cpp WaitProgress.h Util/FileUtil_impl.h diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h index 1fe9d96f85..6844a8272b 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.h @@ -9,8 +9,6 @@ #pragma once -#include "Util/smartptr.h" - #include "UiAnimViewSequence.h" #include #include "UiEditorAnimationBus.h" From 3d1b30dedaaf3587f8b6d8a12d33db7d448fa866 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:09:56 -0800 Subject: [PATCH 096/394] Removes Triangulate from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/Triangulate.cpp | 69 ------------------------------ Code/Editor/Util/Triangulate.h | 26 ----------- Code/Editor/editor_lib_files.cmake | 2 - 3 files changed, 97 deletions(-) delete mode 100644 Code/Editor/Util/Triangulate.cpp delete mode 100644 Code/Editor/Util/Triangulate.h diff --git a/Code/Editor/Util/Triangulate.cpp b/Code/Editor/Util/Triangulate.cpp deleted file mode 100644 index c8160a375a..0000000000 --- a/Code/Editor/Util/Triangulate.cpp +++ /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 - * - */ - - -#include "EditorDefs.h" - -#include "Triangulate.h" - -// this file is essentially a wrapper for a portion of the MIT-licenced -// ConvexDecomposition library by John W. Ratcliff mailto:jratcliffscarab@gmail.com. -// it contains no code from that library, it just provides it with the required types, then includes the -// portion we need. - -static const float TRIANGULATION_EPSILON = 0.0000000001f; - -#define MEMALLOC_MALLOC malloc -#define MEMALLOC_FREE free - -namespace TriInternal -{ - class TVec; - typedef double NxF64; - typedef float NxF32; - typedef unsigned char NxU8; - typedef unsigned int NxU32; - typedef int NxI32; - typedef unsigned int TU32; - - typedef std::vector< TVec > TVecVector; - typedef std::vector< NxU32 > TU32Vector; - #include "Contrib/NvFloatMath.inl" -} - -#undef MEMALLOC_MALLOC -#undef MEMALLOC_FREE - -namespace Triangulator -{ - // given the contour of a triangle, triangulate it, and return the result - // as a set of triangles - // return false if you fail to triangulate it. - bool Triangulate(const VectorOfVectors& contour, VectorOfVectors& result) - { - TriInternal::CTriangulator tri; - for (auto pt : contour) - { - tri.addPoint(pt.x, pt.y, pt.z); - } - TriInternal::NxU32 tricount = 0; - TriInternal::NxU32* indices = tri.triangulate(tricount, TRIANGULATION_EPSILON); - if (!indices) - { - return false; - } - - for (TriInternal::NxU32 currentIdx = 0; currentIdx < tricount * 3; ++currentIdx) - { - TriInternal::NxU32 indexValue = *indices++; - result.push_back(contour[indexValue]); - } - - return result.size() > 2; - } -} diff --git a/Code/Editor/Util/Triangulate.h b/Code/Editor/Util/Triangulate.h deleted file mode 100644 index dad3a14de1..0000000000 --- a/Code/Editor/Util/Triangulate.h +++ /dev/null @@ -1,26 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UTIL_TRIANGULATE_H -#define CRYINCLUDE_EDITOR_UTIL_TRIANGULATE_H -#pragma once - -#include -#include "Cry_Vector3.h" - -// you pass in a vector of vec3 (the contour of a shape) and it outputs a vector of vec3 (being the triangles) - -namespace Triangulator -{ - typedef std::vector< Vec3 > VectorOfVectors; - bool Triangulate(const VectorOfVectors& contour, VectorOfVectors& result); -}; - - -#endif diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 28950c9fa9..d1c903eb72 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -648,8 +648,6 @@ set(FILES Util/PredefinedAspectRatios.h Util/StringHelpers.cpp Util/StringHelpers.h - Util/Triangulate.cpp - Util/Triangulate.h Util/Util.h Util/XmlArchive.cpp Util/XmlArchive.h From cc796476548f24597c78d182a090294bc8a3613a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:33:19 -0800 Subject: [PATCH 097/394] Removes WinWidgetId from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditor.h | 2 -- Code/Editor/WinWidgetId.h | 20 -------------------- Code/Editor/editor_core_files.cmake | 1 - 3 files changed, 23 deletions(-) delete mode 100644 Code/Editor/WinWidgetId.h diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index 0ba24ac46a..52f8c1ac6f 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -19,8 +19,6 @@ #include "Util/UndoUtil.h" #include -#include - #include #include diff --git a/Code/Editor/WinWidgetId.h b/Code/Editor/WinWidgetId.h deleted file mode 100644 index dc8daa43c6..0000000000 --- a/Code/Editor/WinWidgetId.h +++ /dev/null @@ -1,20 +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 - -enum class WinWidgetId -{ - NONE = 0, - ACTIVE_DEPLOYMENT, - PROFILE_SELECTOR, - ADD_PROFILE, - INITIALIZE_PROJECT, - // ALL VALIDS ABOVE HERE - NUM_WIN_WIDGET_IDS -}; diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 1f0a5a3618..60fe18ec65 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -64,7 +64,6 @@ set(FILES Undo/IUndoObject.h Undo/Undo.h Undo/UndoVariableChange.h - WinWidgetId.h QtUI/ColorButton.cpp QtUI/ColorButton.h QtUtil.h From fba00b0b2beb675ce9df71828b739257108defa1 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:43:37 -0800 Subject: [PATCH 098/394] Removes ComponentPalette/CategoriesList and ComponentPalette/ComponentDataModel from Code/Editor/Plugins/ComponentEntityEditorPlugin Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/ComponentPalette/CategoriesList.cpp | 97 ---- .../UI/ComponentPalette/CategoriesList.h | 39 -- .../ComponentPalette/ComponentDataModel.cpp | 547 ------------------ .../UI/ComponentPalette/ComponentDataModel.h | 128 ---- .../componententityeditorplugin_files.cmake | 4 - Code/Editor/Util/Contrib/NvFloatMath.inl | 455 --------------- 6 files changed, 1270 deletions(-) delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp delete mode 100644 Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h delete mode 100644 Code/Editor/Util/Contrib/NvFloatMath.inl diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp deleted file mode 100644 index cd157fe838..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.cpp +++ /dev/null @@ -1,97 +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 "CategoriesList.h" - -ComponentCategoryList::ComponentCategoryList(QWidget* parent /*= nullptr*/) - : QTreeWidget(parent) -{ -} - -void ComponentCategoryList::Init() -{ - setColumnCount(1); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - setDragDropMode(QAbstractItemView::DragDropMode::DragOnly); - setDragEnabled(true); - setSelectionMode(QAbstractItemView::ExtendedSelection); - setAllColumnsShowFocus(true); - setStyleSheet("QTreeWidget { selection-background-color: rgba(255,255,255,0.2); }"); - - QStringList headers; - headers << tr("Categories"); - setHeaderLabels(headers); - - const QString parentCategoryIconPath = QString("Icons/PropertyEditor/Browse_on.png"); - const QString categoryIconPath = QString("Icons/PropertyEditor/Browse.png"); - - QTreeWidgetItem* allCategory = new QTreeWidgetItem(this); - allCategory->setText(0, "All"); - allCategory->setIcon(0, QIcon(categoryIconPath)); - - // Need this briefly to collect the list of available categories. - ComponentDataModel dataModel(this); - for (const auto& cat : dataModel.GetCategories()) - { - QString categoryString = QString(cat.c_str()); - QStringList categories = categoryString.split('/', Qt::SkipEmptyParts); - - QTreeWidgetItem* parent = nullptr; - QTreeWidgetItem* categoryWidget = nullptr; - - for (const auto& categoryName : categories) - { - if (parent) - { - categoryWidget = new QTreeWidgetItem(parent); - categoryWidget->setIcon(0, QIcon(categoryIconPath)); - - // Store the full category path in a user role because we'll need it to locate the actual category - categoryWidget->setData(0, Qt::UserRole, QVariant::fromValue(categoryString)); - } - else - { - auto existingCategory = findItems(categoryName, Qt::MatchExactly); - if (existingCategory.empty()) - { - categoryWidget = new QTreeWidgetItem(this); - categoryWidget->setIcon(0, QIcon(parentCategoryIconPath)); - } - else - { - categoryWidget = static_cast(existingCategory.first()); - categoryWidget->setIcon(0, QIcon(parentCategoryIconPath)); - } - } - - parent = categoryWidget; - - categoryWidget->setText(0, categoryName); - } - } - - expandAll(); - - connect(this, &QTreeWidget::itemClicked, this, &ComponentCategoryList::OnItemClicked); -} - -void ComponentCategoryList::OnItemClicked(QTreeWidgetItem* item, int /*column*/) -{ - QVariant userData = item->data(0, Qt::UserRole); - if (userData.isValid()) - { - // Send in the full category path, not just the child category name - emit OnCategoryChange(userData.value().toStdString().c_str()); - } - else - { - emit OnCategoryChange(item->text(0).toStdString().c_str()); - } -} - -#include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h deleted file mode 100644 index 76a955ea76..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/CategoriesList.h +++ /dev/null @@ -1,39 +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 - -#if !defined(Q_MOC_RUN) -#include "ComponentDataModel.h" -#include -#endif - -//! ComponentCategoryList -//! Provides a list of all reflected categories that users can select for quick -//! filtering the filtered component list. -class ComponentCategoryList : public QTreeWidget -{ - Q_OBJECT - -public: - - AZ_CLASS_ALLOCATOR(ComponentCategoryList, AZ::SystemAllocator, 0); - - explicit ComponentCategoryList(QWidget* parent = nullptr); - - void Init(); - -Q_SIGNALS: - void OnCategoryChange(const char* category); - -protected: - - // Will emit OnCategoryChange signal - void OnItemClicked(QTreeWidgetItem* item, int column); - -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp deleted file mode 100644 index dcae6abfeb..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.cpp +++ /dev/null @@ -1,547 +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 "ComponentDataModel.h" - -#include "Include/IObjectManager.h" -#include "Objects/SelectionGroup.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -namespace -{ - // This is a helper function that given an object that derives from QAbstractItemModel, - // it will request the model's "ClassDataRole" class data for an entry and use that - // information to create a new entity with the selected components. - AZ::EntityId CreateEntityFromSelection(const QModelIndexList& selection, QAbstractItemModel* model) - { - AZ::Vector3 position = AZ::Vector3::CreateZero(); - CViewport *view = GetIEditor()->GetViewManager()->GetGameViewport(); - int width, height; - view->GetDimensions(&width, &height); - position = LYVec3ToAZVec3(view->ViewToWorld(QPoint(width / 2, height / 2))); - - AZ::EntityId newEntityId; - EBUS_EVENT_RESULT(newEntityId, AzToolsFramework::EditorRequests::Bus, CreateNewEntityAtPosition, position, AZ::EntityId()); - if (newEntityId.IsValid()) - { - // Add all the selected components. - AZ::ComponentTypeList componentsToAdd; - for (auto index : selection) - { - // We only need to consider the first column, it's important that the data() function that - // returns ComponentDataModel::ClassDataRole also does so for the first column. - if (index.column() != 0) - { - continue; - } - - QVariant classDataVariant = model->data(index, ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - componentsToAdd.push_back(classData->m_typeId); - } - } - - AzToolsFramework::EntityCompositionRequestBus::Broadcast(&AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, AzToolsFramework::EntityIdList{ newEntityId }, componentsToAdd); - - return newEntityId; - } - - return AZ::EntityId(); - } -} - -namespace ComponentDataUtilities -{ - // This is a helper function to add the specified components to the selected entities, it relies on the provided - // QAbstractItemModel to determine the appropriate ClassData to use to create the components (given that some widgets - // may provide proxy models that alter the order). - void AddComponentsToSelectedEntities(const QModelIndexList& selectedComponents, QAbstractItemModel* model) - { - AzToolsFramework::EntityIdList selectedEntities; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - if (selectedEntities.empty()) - { - return; - } - - // Add all the selected components. - AZ::ComponentTypeList componentsToAdd; - for (auto index : selectedComponents) - { - // We only need to consider the first column, it's important that the data() function that - // returns ComponentDataModel::ClassDataRole also does so for the first column. - if (index.column() != 0) - { - continue; - } - - QVariant classDataVariant = model->data(index, ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - componentsToAdd.push_back(classData->m_typeId); - } - } - - AzToolsFramework::EntityCompositionRequestBus::Broadcast(&AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, selectedEntities, componentsToAdd); - } -} - - -// ComponentDataModel -////////////////////////////////////////////////////////////////////////// - -ComponentDataModel::ComponentDataModel(QObject* parent) - : QAbstractTableModel(parent) -{ - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - - serializeContext->EnumerateDerived([this](const AZ::SerializeContext::ClassData* classData, const AZ::Uuid&) -> bool - { - bool allowed = false; - bool hidden = false; - AZStd::string category = "Miscellaneous"; - - if (classData->m_editData) - { - for (const AZ::Edit::ElementData& element : classData->m_editData->m_elements) - { - if (element.m_elementId == AZ::Edit::ClassElements::EditorData) - { - AZStd::string iconPath; - AzToolsFramework::EditorRequestBus::BroadcastResult(iconPath, &AzToolsFramework::EditorRequests::GetComponentTypeEditorIcon, classData->m_typeId); - if (!iconPath.empty()) - { - m_componentIcons[classData->m_typeId] = QIcon(iconPath.c_str()); - } - - for (const AZ::Edit::AttributePair& attribPair : element.m_attributes) - { - if (attribPair.first == AZ::Edit::Attributes::AppearsInAddComponentMenu) - { - if (auto data = azdynamic_cast*>(attribPair.second)) - { - if (data->Get(nullptr) == AZ_CRC("Game")) - { - allowed = true; - } - } - } - else if (attribPair.first == AZ::Edit::Attributes::AddableByUser) - { - // skip this component if user is not allowed to add it directly - if (auto data = azdynamic_cast*>(attribPair.second)) - { - if (!data->Get(nullptr)) - { - hidden = true; - } - } - } - else if (attribPair.first == AZ::Edit::Attributes::Category) - { - if (auto data = azdynamic_cast*>(attribPair.second)) - { - category = data->Get(nullptr); - } - } - } - - break; - } - } - } - - if (allowed && !hidden) - { - m_componentList.push_back(classData); - m_componentMap[category].push_back(classData); - m_categories.insert(category); - } - - return true; - }); - - // we'd like viewport events - AzQtComponents::DragAndDropEventsBus::Handler::BusConnect(AzQtComponents::DragAndDropContexts::EditorViewport); -} - -ComponentDataModel::~ComponentDataModel() -{ - AzQtComponents::DragAndDropEventsBus::Handler::BusDisconnect(); -} - -Qt::ItemFlags ComponentDataModel::flags([[maybe_unused]] const QModelIndex &index) const -{ - return Qt::ItemFlags( - Qt::ItemIsEnabled | - Qt::ItemIsDragEnabled | - Qt::ItemIsDropEnabled | - Qt::ItemIsSelectable); -} - -const AZ::SerializeContext::ClassData* ComponentDataModel::GetClassData(const QModelIndex& index) const -{ - int row = index.row(); - if (row < 0 || row >= m_componentList.size()) - { - return nullptr; - } - - return m_componentList[row]; -} - -const char* ComponentDataModel::GetCategory(const AZ::SerializeContext::ClassData* classData) -{ - if (classData) - { - if (auto editorDataElement = classData->m_editData->FindElementData(AZ::Edit::ClassElements::EditorData)) - { - if (auto categoryAttribute = editorDataElement->FindAttribute(AZ::Edit::Attributes::Category)) - { - if (auto categoryData = azdynamic_cast*>(categoryAttribute)) - { - const char* result = categoryData->Get(nullptr); - if (result) - { - return result; - } - } - } - } - } - - return ""; -} - - -QModelIndex ComponentDataModel::index(int row, int column, const QModelIndex &parent /*= QModelIndex()*/) const -{ - if (row >= rowCount(parent) || column >= columnCount(parent)) - { - return QModelIndex(); - } - - return createIndex(row, column, (void*)(m_componentList[row])); -} - -QModelIndex ComponentDataModel::parent([[maybe_unused]] const QModelIndex &child) const -{ - return QModelIndex(); -} - -int ComponentDataModel::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return static_cast(m_componentList.size()); -} - -int ComponentDataModel::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const -{ - return ColumnIndex::Count; -} - -QVariant ComponentDataModel::data(const QModelIndex &index, int role /*= Qt::DisplayRole*/) const -{ - if (index.isValid()) - { - const AZ::SerializeContext::ClassData* classData = m_componentList[index.row()]; - if (!classData) - { - return QVariant(); - } - - switch (role) - { - case ClassDataRole: - if (index.column() == 0) // Only get data for one column - { - return QVariant::fromValue(reinterpret_cast(const_cast(classData))); - } - break; - - case Qt::DisplayRole: - { - if (index.column() == ColumnIndex::Name) - { - return QVariant(classData->m_editData->m_name); - } - else - if (index.column() == ColumnIndex::Category) - { - if (auto editorDataElement = classData->m_editData->FindElementData(AZ::Edit::ClassElements::EditorData)) - { - if (auto categoryAttribute = editorDataElement->FindAttribute(AZ::Edit::Attributes::Category)) - { - if (auto categoryData = azdynamic_cast*>(categoryAttribute)) - { - return QVariant(categoryData->Get(nullptr)); - } - } - } - } - - } - break; - - case Qt::ToolTipRole: - { - return QVariant(classData->m_editData->m_description); - } - - case Qt::DecorationRole: - { - if (index.column() == ColumnIndex::Icon) - { - auto iconIterator = m_componentIcons.find(classData->m_typeId); - if (iconIterator != m_componentIcons.end()) - { - return iconIterator->second; - } - } - } - break; - - default: - break; - } - } - - return QVariant(); -} - -QMimeData* ComponentDataModel::mimeData(const QModelIndexList& indices) const -{ - QModelIndexList list; - - // Filter out columns we are not interested in. - for (const QModelIndex& index : indices) - { - if (index.column() == 0) - { - list.push_back(index); - } - } - - AZStd::vector sortedList; - for (QModelIndex index : list) - { - QVariant classDataVariant = index.data(ComponentDataModel::ClassDataRole); - if (classDataVariant.isValid()) - { - const AZ::SerializeContext::ClassData* classData = reinterpret_cast(classDataVariant.value()); - sortedList.push_back(classData); - } - } - - QMimeData* mimeData = nullptr; - if (!sortedList.empty()) - { - mimeData = AzToolsFramework::ComponentTypeMimeData::Create(sortedList).release(); - } - - return mimeData; -} - -bool ComponentDataModel::CanAcceptDragAndDropEvent(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) const -{ - using namespace AzToolsFramework; - using namespace AzQtComponents; - - // if a listener with a higher priority already claimed this event, do not touch it. - if ((!event) || (event->isAccepted()) || (!event->mimeData())) - { - return false; - } - - ViewportDragContext* contextVP = azrtti_cast(&context); - if (!contextVP) - { - // not a viewport event. This is for some other GUI such as the main window itself. - return false; - } - - AZStd::vector componentClassDataList; - return AzToolsFramework::ComponentTypeMimeData::Get(event->mimeData(), componentClassDataList); -} - -void ComponentDataModel::DragEnter(QDragEnterEvent* event, AzQtComponents::DragAndDropContextBase& context) -{ - if (CanAcceptDragAndDropEvent(event, context)) - { - event->setDropAction(Qt::CopyAction); - event->setAccepted(true); - // opportunities to show special highlights, or ghosted entities or previews here. - } -} - -void ComponentDataModel::DragMove(QDragMoveEvent* event, AzQtComponents::DragAndDropContextBase& context) -{ - if (CanAcceptDragAndDropEvent(event, context)) - { - event->setDropAction(Qt::CopyAction); - event->setAccepted(true); - // opportunities to update special highlights, or ghosted entities or previews here. - } -} - -void ComponentDataModel::DragLeave(QDragLeaveEvent* /*event*/) -{ - // opportunities to remove ghosted entities or previews here. -} - -void ComponentDataModel::Drop(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) -{ - using namespace AzToolsFramework; - using namespace AzQtComponents; - - // ALWAYS CHECK - you are not the only one connected to this bus, and someone else may have already - // handled the event or accepted the drop - it might not contain types relevant to you. - // you still get informed about the drop event in case you did some stuff in your gui and need to clean it up. - if (!CanAcceptDragAndDropEvent(event, context)) - { - return; - } - - // note that the above call already checks all the pointers such as event, or whether context is a VP context, mimetype, etc - ViewportDragContext* contextVP = azrtti_cast(&context); - - // we don't get given this action by Qt unless we already returned accepted from one of the other ones (such as drag move of drag enter) - event->setDropAction(Qt::CopyAction); - event->setAccepted(true); - - AzToolsFramework::ScopedUndoBatch undo("Create entity from components"); - const AZStd::string name = AZStd::string::format("Entity%d", GetIEditor()->GetObjectManager()->GetObjectCount()); - - AZ::Entity* newEntity = aznew AZ::Entity(name.c_str()); - if (newEntity) - { - AzToolsFramework::EditorEntityContextRequestBus::Broadcast(&AzToolsFramework::EditorEntityContextRequests::AddRequiredComponents, *newEntity); - auto* transformComponent = newEntity->FindComponent(); - if (transformComponent) - { - transformComponent->SetWorldTM(AZ::Transform::CreateTranslation(contextVP->m_hitLocation)); - } - - // Add the entity to the editor context, which activates it and creates the sandbox object. - AzToolsFramework::EditorEntityContextRequestBus::Broadcast(&AzToolsFramework::EditorEntityContextRequests::AddEditorEntity, newEntity); - - // Prepare undo command last so it captures the final state of the entity. - AzToolsFramework::EntityCreateCommand* command = aznew AzToolsFramework::EntityCreateCommand(static_cast(newEntity->GetId())); - command->Capture(newEntity); - command->SetParent(undo.GetUndoBatch()); - - // Only need to add components to the new entity - AzToolsFramework::EntityIdList entities = { newEntity->GetId() }; - - AZStd::vector componentClassDataList; - AzToolsFramework::ComponentTypeMimeData::Get(event->mimeData(), componentClassDataList); - - AZ::ComponentTypeList componentsToAdd; - for (auto classData : componentClassDataList) - { - if (!classData) - { - continue; - } - - componentsToAdd.push_back(classData->m_typeId); - } - - AzToolsFramework::EntityCompositionRequests::AddComponentsOutcome addedComponentsResult = AZ::Failure(AZStd::string("Failed to call AddComponentsToEntities on EntityCompositionRequestBus")); - AzToolsFramework::EntityCompositionRequestBus::BroadcastResult(addedComponentsResult, &AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, entities, componentsToAdd); - - ToolsApplicationRequests::Bus::Broadcast(&ToolsApplicationRequests::AddDirtyEntity, newEntity->GetId()); - AzToolsFramework::ToolsApplicationRequestBus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::SetSelectedEntities, entities); - } -} - -AZ::EntityId ComponentDataProxyModel::NewEntityFromSelection(const QModelIndexList& selection) -{ - return CreateEntityFromSelection(selection, this); -} - -AZ::EntityId ComponentDataModel::NewEntityFromSelection(const QModelIndexList& selection) -{ - return CreateEntityFromSelection(selection, this); -} - -bool ComponentDataProxyModel::filterAcceptsRow(int sourceRow, [[maybe_unused]] const QModelIndex &sourceParent) const -{ - if (m_selectedCategory.empty() && !filterRegExp().isValid()) - return true; - - ComponentDataModel* dataModel = static_cast(sourceModel()); - if (sourceRow < 0 || sourceRow >= dataModel->GetComponents().size()) - { - return false; - } - - const AZ::SerializeContext::ClassData* classData = dataModel->GetComponents()[sourceRow]; - if (!classData) - { - return false; - } - - // Get Category - if (!m_selectedCategory.empty()) - { - AZStd::string currentCateogry = ComponentDataModel::GetCategory(classData); - - if (AzFramework::StringFunc::Find(currentCateogry.c_str(), m_selectedCategory.c_str())) - { - return false; - } - } - - if (filterRegExp().isValid()) - { - QString componentName = QString::fromUtf8(classData->m_editData->m_name); - return componentName.contains(filterRegExp()); - } - - return true; -} - -void ComponentDataProxyModel::SetSelectedCategory(const AZStd::string& category) -{ - m_selectedCategory = category; - invalidate(); -} - -void ComponentDataProxyModel::ClearSelectedCategory() -{ - m_selectedCategory.clear(); - invalidate(); -} - -#include "UI/ComponentPalette/moc_ComponentDataModel.cpp" diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h deleted file mode 100644 index 2c9cd27a5f..0000000000 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/ComponentPalette/ComponentDataModel.h +++ /dev/null @@ -1,128 +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 - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#include - -#include -#include -#include - -#include -#endif - -namespace ComponentDataUtilities -{ - // Given a list of selected components, use the provided model to get the components to add to any selected entities. - void AddComponentsToSelectedEntities(const QModelIndexList& selectedComponents, QAbstractItemModel* model); -} - -class CViewport; - -//! ComponentDataModel -//! Holds the data required to display components in a table, this includes component name, categories, icons. -class ComponentDataModel - : public QAbstractTableModel - , protected AzQtComponents::DragAndDropEventsBus::Handler // its okay if more than one of these is installed, the first one gets it. -{ - Q_OBJECT - -public: - AZ_CLASS_ALLOCATOR(ComponentDataModel, AZ::SystemAllocator, 0); - - using ComponentClassList = AZStd::vector; - using ComponentCategorySet = AZStd::set; - using ComponentClassMap = AZStd::unordered_map>; - using ComponentIconMap = AZStd::unordered_map; - - enum ColumnIndex - { - Icon, - Category, - Name, - Count - }; - - enum CustomRoles - { - ClassDataRole = Qt::UserRole + 1 - }; - - ComponentDataModel(QObject* parent = nullptr); - ~ComponentDataModel() override; - - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &child) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - Qt::ItemFlags flags(const QModelIndex &index) const override; - - QMimeData* mimeData(const QModelIndexList& indexes) const override; - - const AZ::SerializeContext::ClassData* GetClassData(const QModelIndex&) const; - - AZ::EntityId NewEntityFromSelection(const QModelIndexList& selection); - - static const char* GetCategory(const AZ::SerializeContext::ClassData* classData); - - ComponentClassList& GetComponents() { return m_componentList; } - ComponentCategorySet& GetCategories() { return m_categories; } - -protected: - ////////////////////////////////////////////////////////////////////////// - // AzQtComponents::DragAndDropEventsBus::Handler - ////////////////////////////////////////////////////////////////////////// - void DragEnter(QDragEnterEvent* event, AzQtComponents::DragAndDropContextBase& context) override; - void DragMove(QDragMoveEvent* event, AzQtComponents::DragAndDropContextBase& context) override; - void DragLeave(QDragLeaveEvent* event) override; - void Drop(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) override; - bool CanAcceptDragAndDropEvent(QDropEvent* event, AzQtComponents::DragAndDropContextBase& context) const; - - ComponentClassList m_componentList; - ComponentClassMap m_componentMap; - ComponentIconMap m_componentIcons; - ComponentCategorySet m_categories; -}; - -//! ComponentDataProxyModel -//! FilterProxy for the ComponentDataModel is used along with the search criteria to filter the -//! list of components based on tags and/or selected category. -class ComponentDataProxyModel : public QSortFilterProxyModel -{ - Q_OBJECT - -public: - AZ_CLASS_ALLOCATOR(ComponentDataProxyModel, AZ::SystemAllocator, 0); - - ComponentDataProxyModel(QObject* parent = nullptr) - : QSortFilterProxyModel(parent) - {} - - // Creates a new entity and adds the selected components to it. - // It is specialized here to ensure it uses the correct indices according to the sorted data. - AZ::EntityId NewEntityFromSelection(const QModelIndexList& selection); - - // Filters rows according to the specifed tags and/or selected category - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; - - // Set the category to filter by. - void SetSelectedCategory(const AZStd::string& category); - void ClearSelectedCategory(); - -protected: - - AZStd::string m_selectedCategory; -}; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake index b5a8b00855..28f96de862 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/componententityeditorplugin_files.cmake @@ -20,10 +20,6 @@ set(FILES UI/QComponentEntityEditorOutlinerWindow.cpp UI/AssetCatalogModel.h UI/AssetCatalogModel.cpp - UI/ComponentPalette/CategoriesList.h - UI/ComponentPalette/CategoriesList.cpp - UI/ComponentPalette/ComponentDataModel.h - UI/ComponentPalette/ComponentDataModel.cpp UI/ComponentPalette/ComponentPaletteSettings.h UI/Outliner/OutlinerDisplayOptionsMenu.h UI/Outliner/OutlinerDisplayOptionsMenu.cpp diff --git a/Code/Editor/Util/Contrib/NvFloatMath.inl b/Code/Editor/Util/Contrib/NvFloatMath.inl deleted file mode 100644 index 6bd3b9f7c5..0000000000 --- a/Code/Editor/Util/Contrib/NvFloatMath.inl +++ /dev/null @@ -1,455 +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 - * - */ -/* BEGIN CONTENTS OF README.TXT ------------------------------------- -The ConvexDecomposition library was written by John W. Ratcliff mailto:jratcliffscarab@gmail.com - -What is Convex Decomposition? - -Convex Decomposition is when you take an arbitrarily complex triangle mesh and sub-divide it into -a collection of discrete compound pieces (each represented as a convex hull) to approximate -the original shape of the objet. - -This is required since few physics engines can treat aribtrary triangle mesh objects as dynamic -objects. Even those engines which can handle this use case incurr a huge performance and memory -penalty to do so. - -By breaking a complex triangle mesh up into a discrete number of convex components you can greatly -improve performance for dynamic simulations. - --------------------------------------------------------------------------------- - -This code is released under the MIT license. - -The code is functional but could use the following improvements: - -(1) The convex hull generator, originally written by Stan Melax, could use some major code cleanup. - -(2) The code to remove T-junctions appears to have a bug in it. This code was working fine before, -but I haven't had time to debug why it stopped working. - -(3) Island generation once the mesh has been split is currently disabled due to the fact that the -Remove Tjunctions functionality has a bug in it. - -(4) The code to perform a raycast against a triangle mesh does not currently use any acceleration -data structures. - -(5) When a split is performed, the surface that got split is not 'capped'. This causes a problem -if you use a high recursion depth on your convex decomposition. It will cause the object to -be modelled as if it had a hollow interior. A lot of work was done to solve this problem, but -it hasn't been integrated into this code drop yet. - - -*/// ---------- END CONTENTS OF README.TXT ---------------------------- - - -// a set of routines that let you do common 3d math -// operations without any vector, matrix, or quaternion -// classes or templates. -// -// a vector (or point) is a 'NxF32 *' to 3 floating point numbers. -// a matrix is a 'NxF32 *' to an array of 16 floating point numbers representing a 4x4 transformation matrix compatible with D3D or OGL -// a quaternion is a 'NxF32 *' to 4 floats representing a quaternion x,y,z,w -// -// -/*! -** -** Copyright (c) 2009 by John W. Ratcliff mailto:jratcliffscarab@gmail.com -** -** Portions of this source has been released with the PhysXViewer application, as well as -** Rocket, CreateDynamics, ODF, and as a number of sample code snippets. -** -** If you find this code useful or you are feeling particularily generous I would -** ask that you please go to http://www.amillionpixels.us and make a donation -** to Troy DeMolay. -** -** DeMolay is a youth group for young men between the ages of 12 and 21. -** It teaches strong moral principles, as well as leadership skills and -** public speaking. The donations page uses the 'pay for pixels' paradigm -** where, in this case, a pixel is only a single penny. Donations can be -** made for as small as $4 or as high as a $100 block. Each person who donates -** will get a link to their own site as well as acknowledgement on the -** donations blog located here http://www.amillionpixels.blogspot.com/ -** -** If you wish to contact me you can use the following methods: -** -** Skype ID: jratcliff63367 -** Yahoo: jratcliff63367 -** AOL: jratcliff1961 -** email: jratcliffscarab@gmail.com -** -** -** The MIT license: -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and associated documentation files (the "Software"), to deal -** in the Software without restriction, including without limitation the rights -** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -** copies of the Software, and to permit persons to whom the Software is furnished -** to do so, subject to the following conditions: -** -** The above copyright notice and this permission notice shall be included in all -** copies or substantial portions of the Software. - -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -** WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -class TVec -{ -public: - TVec(NxF64 _x, NxF64 _y, NxF64 _z) { x = _x; y = _y; z = _z; }; - TVec(void) { }; - - NxF64 x; - NxF64 y; - NxF64 z; -}; - - -class CTriangulator -{ -public: - /// Default constructor - CTriangulator(); - - /// Default destructor - virtual ~CTriangulator(); - - /// Returns the given point in the triangulator array - inline TVec get(const TU32 id) { return mPoints[id]; } - - virtual void reset(void) - { - mInputPoints.clear(); - mPoints.clear(); - mIndices.clear(); - } - - virtual void addPoint(NxF64 x, NxF64 y, NxF64 z) - { - TVec v(x, y, z); - // update bounding box... - if (mInputPoints.empty()) - { - mMin = v; - mMax = v; - } - else - { - if (x < mMin.x) - { - mMin.x = x; - } - if (y < mMin.y) - { - mMin.y = y; - } - if (z < mMin.z) - { - mMin.z = z; - } - - if (x > mMax.x) - { - mMax.x = x; - } - if (y > mMax.y) - { - mMax.y = y; - } - if (z > mMax.z) - { - mMax.z = z; - } - } - mInputPoints.push_back(v); - } - - // Triangulation happens in 2d. We could inverse transform the polygon around the normal direction, or we just use the two most signficant axes - // Here we find the two longest axes and use them to triangulate. Inverse transforming them would introduce more doubleing point error and isn't worth it. - virtual NxU32* triangulate(NxU32& tcount, NxF64 epsilon) - { - NxU32* ret = 0; - tcount = 0; - mEpsilon = epsilon; - - if (!mInputPoints.empty()) - { - mPoints.clear(); - - NxF64 dx = mMax.x - mMin.x; // locate the first, second and third longest edges and store them in i1, i2, i3 - NxF64 dy = mMax.y - mMin.y; - NxF64 dz = mMax.z - mMin.z; - - NxU32 i1, i2, i3; - - if (dx > dy && dx > dz) - { - i1 = 0; - if (dy > dz) - { - i2 = 1; - i3 = 2; - } - else - { - i2 = 2; - i3 = 1; - } - } - else if (dy > dx && dy > dz) - { - i1 = 1; - if (dx > dz) - { - i2 = 0; - i3 = 2; - } - else - { - i2 = 2; - i3 = 0; - } - } - else - { - i1 = 2; - if (dx > dy) - { - i2 = 0; - i3 = 1; - } - else - { - i2 = 1; - i3 = 0; - } - } - - NxU32 pcount = (NxU32)mInputPoints.size(); - const NxF64* points = &mInputPoints[0].x; - for (NxU32 i = 0; i < pcount; i++) - { - TVec v(points[i1], points[i2], points[i3]); - mPoints.push_back(v); - points += 3; - } - - mIndices.clear(); - triangulate(mIndices); - tcount = (NxU32)mIndices.size() / 3; - if (tcount) - { - ret = &mIndices[0]; - } - } - return ret; - } - - virtual const NxF64* getPoint(NxU32 index) - { - return &mInputPoints[index].x; - } - - -private: - NxF64 mEpsilon; - TVec mMin; - TVec mMax; - TVecVector mInputPoints; - TVecVector mPoints; - TU32Vector mIndices; - - /// Tests if a point is inside the given triangle - bool _insideTriangle(const TVec& A, const TVec& B, const TVec& C, const TVec& P); - - /// Returns the area of the contour - NxF64 _area(); - - bool _snip(NxI32 u, NxI32 v, NxI32 w, NxI32 n, NxI32* V); - - /// Processes the triangulation - void _process(TU32Vector& indices); - /// Triangulates the contour - void triangulate(TU32Vector& indices); -}; - -/// Default constructor -CTriangulator::CTriangulator(void) -{ -} - -/// Default destructor -CTriangulator::~CTriangulator() -{ -} - -/// Triangulates the contour -void CTriangulator::triangulate(TU32Vector& indices) -{ - _process(indices); -} - -/// Processes the triangulation -void CTriangulator::_process(TU32Vector& indices) -{ - const NxI32 n = (const NxI32)mPoints.size(); - if (n < 3) - { - return; - } - NxI32* V = (NxI32*)MEMALLOC_MALLOC(sizeof(NxI32) * n); - - bool flipped = false; - - if (0.0f < _area()) - { - for (NxI32 v = 0; v < n; v++) - { - V[v] = v; - } - } - else - { - flipped = true; - for (NxI32 v = 0; v < n; v++) - { - V[v] = (n - 1) - v; - } - } - - NxI32 nv = n; - NxI32 count = 2 * nv; - for (NxI32 m = 0, v = nv - 1; nv > 2; ) - { - if (0 >= (count--)) - { - return; - } - - NxI32 u = v; - if (nv <= u) - { - u = 0; - } - v = u + 1; - if (nv <= v) - { - v = 0; - } - NxI32 w = v + 1; - if (nv <= w) - { - w = 0; - } - - if (_snip(u, v, w, nv, V)) - { - NxI32 a, b, c, s, t; - a = V[u]; - b = V[v]; - c = V[w]; - if (flipped) - { - indices.push_back(a); - indices.push_back(b); - indices.push_back(c); - } - else - { - indices.push_back(c); - indices.push_back(b); - indices.push_back(a); - } - m++; - for (s = v, t = v + 1; t < nv; s++, t++) - { - V[s] = V[t]; - } - nv--; - count = 2 * nv; - } - } - - MEMALLOC_FREE(V); -} - -/// Returns the area of the contour -NxF64 CTriangulator::_area() -{ - NxI32 n = (NxU32)mPoints.size(); - NxF64 A = 0.0f; - for (NxI32 p = n - 1, q = 0; q < n; p = q++) - { - const TVec& pval = mPoints[p]; - const TVec& qval = mPoints[q]; - A += pval.x * qval.y - qval.x * pval.y; - } - A *= 0.5f; - return A; -} - -bool CTriangulator::_snip(NxI32 u, NxI32 v, NxI32 w, NxI32 n, NxI32* V) -{ - NxI32 p; - - const TVec& A = mPoints[V[u]]; - const TVec& B = mPoints[V[v]]; - const TVec& C = mPoints[V[w]]; - - if (mEpsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x)))) - { - return false; - } - - for (p = 0; p < n; p++) - { - if ((p == u) || (p == v) || (p == w)) - { - continue; - } - const TVec& P = mPoints[V[p]]; - if (_insideTriangle(A, B, C, P)) - { - return false; - } - } - return true; -} - -/// Tests if a point is inside the given triangle -bool CTriangulator::_insideTriangle(const TVec& A, const TVec& B, const TVec& C, const TVec& P) -{ - NxF64 ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; - NxF64 cCROSSap, bCROSScp, aCROSSbp; - - ax = C.x - B.x; - ay = C.y - B.y; - bx = A.x - C.x; - by = A.y - C.y; - cx = B.x - A.x; - cy = B.y - A.y; - apx = P.x - A.x; - apy = P.y - A.y; - bpx = P.x - B.x; - bpy = P.y - B.y; - cpx = P.x - C.x; - cpy = P.y - C.y; - - aCROSSbp = ax * bpy - ay * bpx; - cCROSSap = cx * apy - cy * apx; - bCROSScp = bx * cpy - by * cpx; - - return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); -} - From 03543a9e8eb6047b8fbf912d933759ade5887300 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:52:26 -0800 Subject: [PATCH 099/394] Removes ColorUtils from Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ColorUtils.h | 22 ---------------------- Code/Editor/editor_core_files.cmake | 1 - 2 files changed, 23 deletions(-) delete mode 100644 Code/Editor/Util/ColorUtils.h diff --git a/Code/Editor/Util/ColorUtils.h b/Code/Editor/Util/ColorUtils.h deleted file mode 100644 index 9993238e10..0000000000 --- a/Code/Editor/Util/ColorUtils.h +++ /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 - * - */ - - -// Description : Utility classes used by Editor. - - -#pragma once - -#include - -class QColor; - -QColor ColorLinearToGamma(ColorF col); -ColorF ColorGammaToLinear(const QColor& col); -QColor ColorToQColor(uint32 color); - diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 60fe18ec65..7cb40927a4 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -58,7 +58,6 @@ set(FILES Util/ImageHistogram.h Util/Image.h Util/ColorUtils.cpp - Util/ColorUtils.h Undo/Undo.cpp Undo/IUndoManagerListener.h Undo/IUndoObject.h From c00d3105c6eb31588edd787c91ff2910566d4657 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 19 Nov 2021 19:00:25 -0800 Subject: [PATCH 100/394] =?UTF-8?q?=EF=BB=BFRemoves=20some=20CryAssert=20m?= =?UTF-8?q?ethods=20that=20are=20not=20being=20used=20because=20we=20redir?= =?UTF-8?q?ected=20it=20all=20to=20AZ=5FAssert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/EditorDefs.h | 15 - Code/Editor/StartupTraceHandler.cpp | 16 - Code/Editor/Util/ColorUtils.cpp | 3 - Code/Editor/Util/MemoryBlock.cpp | 7 +- Code/Legacy/CryCommon/CryAssert.h | 90 +--- Code/Legacy/CryCommon/CryAssert_Android.h | 101 ---- Code/Legacy/CryCommon/CryAssert_Linux.h | 132 ----- Code/Legacy/CryCommon/CryAssert_Mac.h | 107 ---- Code/Legacy/CryCommon/CryAssert_iOS.h | 99 ---- Code/Legacy/CryCommon/CryAssert_impl.h | 468 ------------------ Code/Legacy/CryCommon/ISystem.h | 8 - Code/Legacy/CryCommon/WinBase.cpp | 10 - Code/Legacy/CryCommon/crycommon_files.cmake | 5 - Code/Legacy/CryCommon/platform.h | 6 - Code/Legacy/CryCommon/platform_impl.cpp | 6 - Code/Legacy/CrySystem/AZCoreLogSink.h | 53 -- Code/Legacy/CrySystem/System.cpp | 5 +- Code/Legacy/CrySystem/System.h | 7 - Gems/Maestro/Code/Source/Cinematics/Movie.cpp | 2 +- 19 files changed, 10 insertions(+), 1130 deletions(-) delete mode 100644 Code/Legacy/CryCommon/CryAssert_Android.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_Linux.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_Mac.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_iOS.h delete mode 100644 Code/Legacy/CryCommon/CryAssert_impl.h diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h index 5dd653679b..e86f007604 100644 --- a/Code/Editor/EditorDefs.h +++ b/Code/Editor/EditorDefs.h @@ -166,18 +166,3 @@ #ifdef LoadCursor #undef LoadCursor #endif - - -#ifdef _DEBUG -#if !defined(AZ_PLATFORM_LINUX) -#ifdef assert -#undef assert -#if defined(USE_AZ_ASSERT) -#define assert(condition) AZ_Assert(condition, "") -#else -#define assert CRY_ASSERT -#endif -#endif // !defined(AZ_PLATFORM_LINUX) -#endif -#endif - diff --git a/Code/Editor/StartupTraceHandler.cpp b/Code/Editor/StartupTraceHandler.cpp index 498bf10e31..407b030e9a 100644 --- a/Code/Editor/StartupTraceHandler.cpp +++ b/Code/Editor/StartupTraceHandler.cpp @@ -37,26 +37,10 @@ namespace SandboxEditor bool StartupTraceHandler::OnPreAssert(const char* fileName, int line, const char* func, const char* message) { - // Asserts are more fatal than errors, and need to be displayed right away. - // After the assert occurs, nothing else may be functional enough to collect and display messages. - - // Only use Cry message boxes if we aren't using native dialog boxes -#ifndef USE_AZ_ASSERT - if (message == nullptr || message[0] == 0) - { - AZStd::string emptyText = AZStd::string::format("Assertion failed in %s %s:%i", func, fileName, line); - OnMessage(emptyText.c_str(), nullptr, MessageDisplayBehavior::AlwaysShow); - } - else - { - OnMessage(message, nullptr, MessageDisplayBehavior::AlwaysShow); - } -#else AZ_UNUSED(fileName); AZ_UNUSED(line); AZ_UNUSED(func); AZ_UNUSED(message); -#endif // !USE_AZ_ASSERT // Return false so other listeners can handle this. The StartupTraceHandler won't report messages // will probably crash before that occurs, because this is an assert. diff --git a/Code/Editor/Util/ColorUtils.cpp b/Code/Editor/Util/ColorUtils.cpp index 02e3c9b615..3ca715e021 100644 --- a/Code/Editor/Util/ColorUtils.cpp +++ b/Code/Editor/Util/ColorUtils.cpp @@ -6,9 +6,6 @@ * */ - -#include "ColorUtils.h" - // Qt #include diff --git a/Code/Editor/Util/MemoryBlock.cpp b/Code/Editor/Util/MemoryBlock.cpp index b7ae017113..6b57557f6f 100644 --- a/Code/Editor/Util/MemoryBlock.cpp +++ b/Code/Editor/Util/MemoryBlock.cpp @@ -169,13 +169,12 @@ void CMemoryBlock::Uncompress(CMemoryBlock& toBlock) const assert(this != &toBlock); toBlock.Allocate(m_uncompressedSize); toBlock.m_uncompressedSize = 0; - unsigned long destSize = m_uncompressedSize; #if !defined(NDEBUG) - int result = -#endif - uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); + unsigned long destSize = m_uncompressedSize; + int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); assert(result == Z_OK); assert(destSize == static_cast(m_uncompressedSize)); +#endif } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CryCommon/CryAssert.h b/Code/Legacy/CryCommon/CryAssert.h index 1494654d87..c401dacb00 100644 --- a/Code/Legacy/CryCommon/CryAssert.h +++ b/Code/Legacy/CryCommon/CryAssert.h @@ -13,92 +13,12 @@ #include -//----------------------------------------------------------------------------------------------------- -// Just undef this if you want to use the standard assert function -//----------------------------------------------------------------------------------------------------- - -// if AZ_ENABLE_TRACING is enabled, then calls to AZ_Assert(...) will flow in. This is the case -// even in Profile mode - thus if you want to manage what happens, USE_CRY_ASSERT also needs to be enabled in those cases. -// if USE_CRY_ASSERT is not enabled, but AZ_ENABLE_TRACING is enabled, then the default behavior for assets will occur instead -// which is to throw the DEBUG BREAK exception / signal, which tends to end with application shutdown. -#if defined(AZ_ENABLE_TRACE_ASSERTS) -#define USE_AZ_ASSERT -#endif - -#if !defined (USE_AZ_ASSERT) && defined(AZ_ENABLE_TRACING) -#undef USE_CRY_ASSERT -#define USE_CRY_ASSERT -#endif - -// you can undefine this. It will cause the assert message box to appear anywhere that USE_CRY_ASSERT is enabled -// instead of it only appearing in debug. -// if this is DEFINED then only in debug builds will you see the message box. In other builds, CRY_ASSERTS become CryWarning instead of -// instead (showing no message box, only a warning). -#define CRY_ASSERT_DIALOG_ONLY_IN_DEBUG - -#if defined(FORCE_STANDARD_ASSERT) || defined(USE_AZ_ASSERT) -#undef USE_CRY_ASSERT -#undef CRY_ASSERT_DIALOG_ONLY_IN_DEBUG -#endif - // Using AZ_Assert for all assert kinds (assert =, CRY_ASSERT, AZ_Assert). // see Trace::Assert for implementation -#if defined(USE_AZ_ASSERT) - #undef assert - #if !defined(NDEBUG) - #define assert(condition) AZ_Assert(condition, "%s", #condition) - #else - #define assert(condition) - #endif -#endif //defined(USE_AZ_ASSERT) +#undef assert +#define assert(condition) AZ_Assert(condition, "%s", #condition) -//----------------------------------------------------------------------------------------------------- -// Use like this: -// CRY_ASSERT(expression); -// CRY_ASSERT_MESSAGE(expression,"Useful message"); -// CRY_ASSERT_TRACE(expression,("This should never happen because parameter n%d named %s is %f",iParameter,szParam,fValue)); -//----------------------------------------------------------------------------------------------------- +#define CRY_ASSERT(condition) AZ_Assert(condition, "%s", #condition) +#define CRY_ASSERT_MESSAGE(condition, message) AZ_Assert(condition, message) +#define CRY_ASSERT_TRACE(condition, parenthese_message) AZ_Assert(condition, parenthese_message) -#if defined(AZ_RESTRICTED_PLATFORM) - #include AZ_RESTRICTED_FILE(CryAssert_h) -#endif -#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED) - #undef AZ_RESTRICTED_SECTION_IMPLEMENTED -#elif defined(WIN32) || defined(APPLE) || defined(LINUX) - #define CRYASSERT_H_TRAIT_USE_CRY_ASSERT_MESSAGE 1 -#endif - -#if defined(USE_CRY_ASSERT) && CRYASSERT_H_TRAIT_USE_CRY_ASSERT_MESSAGE -void CryAssertTrace(const char*, ...); -bool CryAssert(const char*, const char*, unsigned int, bool*); - - #define CRY_ASSERT(condition) CRY_ASSERT_MESSAGE(condition, NULL) - - #define CRY_ASSERT_MESSAGE(condition, message) CRY_ASSERT_TRACE(condition, (message)) - - #define CRY_ASSERT_TRACE(condition, parenthese_message) \ - do \ - { \ - static bool s_bIgnoreAssert = false; \ - if (!s_bIgnoreAssert && !(condition)) \ - { \ - CryAssertTrace parenthese_message; \ - if (CryAssert(#condition, __FILE__, __LINE__, &s_bIgnoreAssert)) \ - { \ - AZ::Debug::Trace::Break(); \ - } \ - } \ - } while (0) - - #undef assert - #define assert CRY_ASSERT -#elif !defined(CRY_ASSERT) -#ifndef USE_AZ_ASSERT - #include -#endif //USE_AZ_ASSERT - #define CRY_ASSERT(condition) assert(condition) - #define CRY_ASSERT_MESSAGE(condition, message) assert(condition) - #define CRY_ASSERT_TRACE(condition, parenthese_message) assert(condition) -#endif - -//----------------------------------------------------------------------------------------------------- diff --git a/Code/Legacy/CryCommon/CryAssert_Android.h b/Code/Legacy/CryCommon/CryAssert_Android.h deleted file mode 100644 index e6c285dc9d..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_Android.h +++ /dev/null @@ -1,101 +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 - * - */ - - -// Description : Assert dialog box for android - - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_ANDROID_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_ANDROID_H -#pragma once - -#if defined(USE_CRY_ASSERT) && defined(ANDROID) - -#include - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return true; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - AZ::NativeUI::AssertAction result; - EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage); - - switch (result) - { - case AZ::NativeUI::AssertAction::IGNORE_ASSERT: - return false; - case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS: - gEnv->bNoAssertDialog = true; - gEnv->bIgnoreAllAsserts = true; - return false; - case AZ::NativeUI::AssertAction::BREAK: - return true; - default: - break; - } - - return true; - } - else - { - return false; - } -} - -#endif -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_ANDROID_H diff --git a/Code/Legacy/CryCommon/CryAssert_Linux.h b/Code/Legacy/CryCommon/CryAssert_Linux.h deleted file mode 100644 index 112c60a80c..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_Linux.h +++ /dev/null @@ -1,132 +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 - * - */ - - - -// Description : -// Assert dialog box for LINUX. The linux assert dialog is based on a -// small ncurses application which writes the choice to a file. This -// was chosen since there is no default UI system on Linux. X11 wasn't -// used due to the possibility of the system running another display -// protocol (e.g.: WayLand, Mir) - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_LINUX_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_LINUX_H -#pragma once - -#if defined(USE_CRY_ASSERT) && defined(LINUX) && !defined(ANDROID) - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if (gEnv->pLog) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - static const int max_len = 4096; - static char gs_command_str[4096]; - static AZStd::recursive_mutex lock; - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - size_t file_len = strlen(szFile); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - AZStd::scoped_lock lk(lock); - snprintf(gs_command_str, max_len, "xterm -geometry 100x20 -n 'Assert Dialog [Linux Launcher]' -T 'Assert Dialog [Linux Launcher]' -e 'BinLinux/assert_term \"%s\" \"%s\" %d \"%s\"; echo \"$?\" > .assert_return'", - szCondition, (file_len > 60) ? szFile + (file_len - 61) : szFile, line, gs_szMessage); - int ret = system(gs_command_str); - if (ret != 0) - { - CryLogAlways(" Terminal failed to execute"); - return false; - } - - FILE* assert_file = fopen(".assert_return", "r"); - if (!assert_file) - { - CryLogAlways(" Couldn't open assert file"); - return false; - } - int result = -1; - fscanf(assert_file, "%d", &result); - fclose(assert_file); - - switch (result) - { - case 0: - break; - case 1: - *pIgnore = true; - break; - case 2: - gEnv->bIgnoreAllAsserts = true; - break; - case 3: - return true; - break; - case 4: - raise(SIGABRT); - exit(-1); - break; - default: - CryLogAlways(" Unknown result in assert file: %d", result); - return false; - } - } - - - return false; -} - -#endif - -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_LINUX_H diff --git a/Code/Legacy/CryCommon/CryAssert_Mac.h b/Code/Legacy/CryCommon/CryAssert_Mac.h deleted file mode 100644 index f0a893630e..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_Mac.h +++ /dev/null @@ -1,107 +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 - * - */ - - -// Description : Assert dialog box for Mac OS X - - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H -#pragma once - -#if defined(USE_CRY_ASSERT) && defined(MAC) -#include - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - static const int max_len = 4096; - static char gs_command_str[4096]; - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - size_t file_len = strlen(szFile); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - AZ::NativeUI::AssertAction result; - EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage); - - switch(result) - { - case AZ::NativeUI::AssertAction::IGNORE_ASSERT: - return false; - case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS: - gEnv->bNoAssertDialog = true; - gEnv->bIgnoreAllAsserts = true; - return false; - case AZ::NativeUI::AssertAction::BREAK: - return true; - default: - break; - } - - // For asserts on the Mac always trigger a debug break. Annoying but at least it does not kill the thread like assert() does. - __asm__("int $3"); - } - - - return false; -} - - -#endif - -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H diff --git a/Code/Legacy/CryCommon/CryAssert_iOS.h b/Code/Legacy/CryCommon/CryAssert_iOS.h deleted file mode 100644 index e7f07eba9b..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_iOS.h +++ /dev/null @@ -1,99 +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 - * - */ - - -// Description : Assert dialog box for Mac OS X - - -#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_IOS_H -#define CRYINCLUDE_CRYCOMMON_CRYASSERT_IOS_H -#pragma once - -#if defined(USE_CRY_ASSERT) && (defined(IOS) - -#include - -static char gs_szMessage[MAX_PATH]; - -void CryAssertTrace(const char* szFormat, ...) -{ - if (gEnv == 0) - { - return; - } - - if (!gEnv->bIgnoreAllAsserts) - { - if (szFormat == NULL) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, szFormat); - vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args); - va_end(args); - } - } -} - -bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition); - } - } - - if (pIgnore) - { - // avoid showing the same one repeatedly. - *pIgnore = true; - } - return false; -#endif - - gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line); - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - printf("!!ASSERT!!\n\tCondition: %s\n\tMessage : %s\n\tFile : %s\n\tLine : %d", szCondition, gs_szMessage, szFile, line); - - AZ::NativeUI::AssertAction result; - EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage); - - switch(result) - { - case AZ::NativeUI::AssertAction::IGNORE_ASSERT: - return false; - case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS: - gEnv->bNoAssertDialog = true; - gEnv->bIgnoreAllAsserts = true; - return false; - case AZ::NativeUI::AssertAction::BREAK: - return true; - default: - break; - } - } - return false; -} - -#endif - -#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_IOS_H diff --git a/Code/Legacy/CryCommon/CryAssert_impl.h b/Code/Legacy/CryCommon/CryAssert_impl.h deleted file mode 100644 index 27c4024d42..0000000000 --- a/Code/Legacy/CryCommon/CryAssert_impl.h +++ /dev/null @@ -1,468 +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 - * - */ - - -// Description : Assert dialog box - -#pragma once - -#if defined(AZ_RESTRICTED_PLATFORM) -#undef AZ_RESTRICTED_SECTION -#define CRYASSERT_IMPL_H_SECTION_1 1 -#define CRYASSERT_IMPL_H_SECTION_2 2 -#endif - -#if defined(USE_CRY_ASSERT) -#if defined(AZ_RESTRICTED_PLATFORM) - #define AZ_RESTRICTED_SECTION CRYASSERT_IMPL_H_SECTION_1 - #include AZ_RESTRICTED_FILE(CryAssert_impl_h) -#endif - -#if defined(APPLE) -#if defined(MAC) -#include "CryAssert_Mac.h" -#else -#include "CryAssert_iOS.h" -#endif -#endif - -#if defined(LINUX) -#if defined(ANDROID) -#include "CryAssert_Android.h" -#else -#include "CryAssert_Linux.h" -#endif -#endif - -#if defined(AZ_RESTRICTED_PLATFORM) - #define AZ_RESTRICTED_SECTION CRYASSERT_IMPL_H_SECTION_2 - #include AZ_RESTRICTED_FILE(CryAssert_impl_h) -#elif defined(WIN32) - -//----------------------------------------------------------------------------------------------------- - -#include - -#include - -//----------------------------------------------------------------------------------------------------- - -#define IDD_DIALOG_ASSERT 101 -#define IDC_CRYASSERT_EDIT_LINE 1000 -#define IDC_CRYASSERT_EDIT_FILE 1001 -#define IDC_CRYASSERT_EDIT_CONDITION 1002 -#define IDC_CRYASSERT_BUTTON_CONTINUE 1003 -#define IDC_CRYASSERT_EDIT_REASON 1004 -#define IDC_CRYASSERT_BUTTON_IGNORE 1005 -#define IDC_CRYASSERT_BUTTON_STOP 1007 -#define IDC_CRYASSERT_BUTTON_BREAK 1008 -#define IDC_CRYASSERT_BUTTON_IGNORE_ALL 1009 - -#define IDC_CRYASSERT_STATIC_TEXT 0 - -#define DLG_TITLE L"Assertion Failed" -#define DLG_FONT L"MS Sans Serif" -#define DLG_ITEM_TEXT_0 L"Continue" -#define DLG_ITEM_TEXT_1 L"Stop" -#define DLG_ITEM_TEXT_2 L"Info" -#define DLG_ITEM_TEXT_3 L"" -#define DLG_ITEM_TEXT_4 L"Line" -#define DLG_ITEM_TEXT_5 L"" -#define DLG_ITEM_TEXT_6 L"File" -#define DLG_ITEM_TEXT_7 L"Condition" -#define DLG_ITEM_TEXT_8 L"" -#define DLG_ITEM_TEXT_9 L"failed" -#define DLG_ITEM_TEXT_10 L"" -#define DLG_ITEM_TEXT_11 L"Reason" -#define DLG_ITEM_TEXT_12 L"Ignore" - -#define DLG_ITEM_TEXT_14 L"Break" -#define DLG_ITEM_TEXT_15 L"Ignore All" - -#define DLG_NB_ITEM 15 - - -template -struct SDlgItem -{ - // If use my struct instead of DLGTEMPLATE, or else (for some strange reason) it is not DWORD aligned !! - DWORD style; - DWORD dwExtendedStyle; - short x; - short y; - short cx; - short cy; - WORD id; - WORD ch; - WORD c; - WCHAR t[iTitleSize]; - WORD dummy; -}; -#define SDLGITEM(TEXT, V) SDlgItem V; - -struct SDlgData -{ - DLGTEMPLATE dlt; - WORD _menu; - WORD _class; - WCHAR _title[sizeof(DLG_TITLE) / 2]; - WORD pointSize; - WCHAR _font[sizeof(DLG_FONT) / 2]; - - SDLGITEM(DLG_ITEM_TEXT_0, i0); - SDLGITEM(DLG_ITEM_TEXT_12, i12); - SDLGITEM(DLG_ITEM_TEXT_15, i15); - SDLGITEM(DLG_ITEM_TEXT_14, i14); - SDLGITEM(DLG_ITEM_TEXT_1, i1); - SDLGITEM(DLG_ITEM_TEXT_2, i2); - SDLGITEM(DLG_ITEM_TEXT_3, i3); - SDLGITEM(DLG_ITEM_TEXT_4, i4); - SDLGITEM(DLG_ITEM_TEXT_5, i5); - SDLGITEM(DLG_ITEM_TEXT_6, i6); - SDLGITEM(DLG_ITEM_TEXT_7, i7); - SDLGITEM(DLG_ITEM_TEXT_8, i8); - SDLGITEM(DLG_ITEM_TEXT_9, i9); - SDLGITEM(DLG_ITEM_TEXT_10, i10); - SDLGITEM(DLG_ITEM_TEXT_11, i11); -}; - -//----------------------------------------------------------------------------------------------------- - -static SDlgData g_dialogRC = -{ - {DS_SETFOREGROUND | DS_MODALFRAME | DS_3DLOOK | DS_SETFONT | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE, 0, DLG_NB_ITEM, 0, 0, 330, 134}, 0, 0, DLG_TITLE, 8, DLG_FONT, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 12, 113, 50, 14, IDC_CRYASSERT_BUTTON_CONTINUE, 0xFFFF, 0x0080, DLG_ITEM_TEXT_0, 0}, - {BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 66, 113, 50, 14, IDC_CRYASSERT_BUTTON_IGNORE, 0xFFFF, 0x0080, DLG_ITEM_TEXT_12, 0}, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 120, 113, 50, 14, IDC_CRYASSERT_BUTTON_IGNORE_ALL, 0xFFFF, 0x0080, DLG_ITEM_TEXT_15, 0}, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 214, 113, 50, 14, IDC_CRYASSERT_BUTTON_BREAK, 0xFFFF, 0x0080, DLG_ITEM_TEXT_14, 0}, - {BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 268, 113, 50, 14, IDC_CRYASSERT_BUTTON_STOP, 0xFFFF, 0x0080, DLG_ITEM_TEXT_1, 0}, - {BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 0, 7, 7, 316, 100, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0080, DLG_ITEM_TEXT_2, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 48, 25, 13, IDC_CRYASSERT_EDIT_LINE, 0xFFFF, 0x0081, DLG_ITEM_TEXT_3, 0}, - {WS_CHILD | WS_VISIBLE, 0, 14, 50, 14, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_4, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 32, 240, 13, IDC_CRYASSERT_EDIT_FILE, 0xFFFF, 0x0081, DLG_ITEM_TEXT_5, 0}, - {WS_CHILD | WS_VISIBLE, 0, 14, 34, 12, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_6, 0}, - {WS_CHILD | WS_VISIBLE, 0, 13, 18, 30, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_7, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 16, 240, 13, IDC_CRYASSERT_EDIT_CONDITION, 0xFFFF, 0x0081, DLG_ITEM_TEXT_8, 0}, - {WS_CHILD | WS_VISIBLE, 0, 298, 19, 18, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_9, 0}, - {ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_CHILD | WS_VISIBLE, 0, 50, 67, 240, 13, IDC_CRYASSERT_EDIT_REASON, 0xFFFF, 0x0081, DLG_ITEM_TEXT_10, 0}, - {WS_CHILD | WS_VISIBLE, 0, 15, 69, 26, 8, IDC_CRYASSERT_STATIC_TEXT, 0xFFFF, 0x0082, DLG_ITEM_TEXT_11, 0}, -}; - -//----------------------------------------------------------------------------------------------------- - -struct SCryAssertInfo -{ - const char* pszCondition; - const char* pszFile; - const char* pszMessage; - - unsigned int uiLine; - - enum - { - BUTTON_CONTINUE, - BUTTON_IGNORE, - BUTTON_IGNORE_ALL, - BUTTON_BREAK, - BUTTON_STOP, - BUTTON_REPORT_AS_BUG, - } btnChosen; - - unsigned int uiX; - unsigned int uiY; -}; - -//----------------------------------------------------------------------------------------------------- - -static INT_PTR CALLBACK DlgProc(HWND _hDlg, UINT _uiMsg, WPARAM _wParam, LPARAM _lParam) -{ - static SCryAssertInfo* pAssertInfo = NULL; - - const UINT WM_USER_SHOWFILE_MESSAGE = (WM_USER + 0x4000); - - switch (_uiMsg) - { - case WM_INITDIALOG: - { - pAssertInfo = (SCryAssertInfo*) _lParam; - - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_CONDITION), pAssertInfo->pszCondition); - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_FILE), pAssertInfo->pszFile); - - // Want to move the cursor on the file text, so that the end of the file is the first thing visible, - // instead of the beginning, which will be the user's depot, and the same for pretty much every file. - // Have to do this delayed, because if it's done in WM_INITDIALOG, it doesn't work. - // PostMessage will add this to the end of the message queue. - PostMessage(_hDlg, WM_USER_SHOWFILE_MESSAGE, 0, 0); - - char szLine[MAX_PATH]; - sprintf_s(szLine, "%d", pAssertInfo->uiLine); - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_LINE), szLine); - - if (pAssertInfo->pszMessage && pAssertInfo->pszMessage[0] != '\0') - { - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_REASON), pAssertInfo->pszMessage); - } - else - { - SetWindowText(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_REASON), "No Reason"); - } - - SetWindowPos(_hDlg, HWND_TOPMOST, pAssertInfo->uiX, pAssertInfo->uiY, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE); - - break; - } - - case WM_USER_SHOWFILE_MESSAGE: - { - // Still have to delay sending this message, or it won't work for some reason. - // Windows does a whole bunch of stuff behind the scenes. Using PostMessage here seems to work better. - PostMessage(GetDlgItem(_hDlg, IDC_CRYASSERT_EDIT_FILE), EM_SETSEL, strlen(pAssertInfo->pszFile), -1); - break; - } - - case WM_COMMAND: - { - switch (LOWORD(_wParam)) - { - case IDCANCEL: - case IDC_CRYASSERT_BUTTON_CONTINUE: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_CONTINUE; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_IGNORE: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_IGNORE; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_IGNORE_ALL: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_IGNORE_ALL; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_BREAK: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_BREAK; - EndDialog(_hDlg, 0); - break; - } - case IDC_CRYASSERT_BUTTON_STOP: - { - pAssertInfo->btnChosen = SCryAssertInfo::BUTTON_STOP; - EndDialog(_hDlg, 1); - break; - } - default: - break; - } - ; - break; - } - - case WM_DESTROY: - { - if (pAssertInfo) - { - RECT rcWindowBounds; - GetWindowRect(_hDlg, &rcWindowBounds); - pAssertInfo->uiX = rcWindowBounds.left; - pAssertInfo->uiY = rcWindowBounds.top; - } - break; - } - - default: - return FALSE; - } - ; - - return TRUE; -} - -//----------------------------------------------------------------------------------------------------- - -static char gs_szMessage[MAX_PATH]; - -//----------------------------------------------------------------------------------------------------- - -void CryAssertTrace(const char* _pszFormat, ...) -{ - if (gEnv == 0) - { - return; - } - if (!gEnv->bIgnoreAllAsserts) - { - if (NULL == _pszFormat) - { - gs_szMessage[0] = '\0'; - } - else - { - va_list args; - va_start(args, _pszFormat); - vsnprintf_s(gs_szMessage, sizeof(gs_szMessage), _TRUNCATE, _pszFormat, args); - va_end(args); - } - } -} - -//----------------------------------------------------------------------------------------------------- - -static const char* gs_strRegSubKey = "Software\\O3DE\\AssertWindow"; -static const char* gs_strRegXValue = "AssertInfoX"; -static const char* gs_strRegYValue = "AssertInfoY"; - -//----------------------------------------------------------------------------------------------------- - -void RegistryReadUInt32(const char* _strSubKey, const char* _strRegName, unsigned int* _puiValue, unsigned int _uiDefault) -{ - HKEY hKey; - RegCreateKeyEx(HKEY_CURRENT_USER, _strSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL); - - DWORD dwType; - DWORD dwLength = sizeof(DWORD); - - if (ERROR_SUCCESS != RegQueryValueEx(hKey, _strRegName, 0, &dwType, (BYTE*) _puiValue, &dwLength)) - { - *_puiValue = _uiDefault; - } - - RegCloseKey(hKey); -} - -//----------------------------------------------------------------------------------------------------- - -void RegistryWriteUInt32(const char* _strSubKey, const char* _strRegName, unsigned int _uiValue) -{ - HKEY hKey; - RegCreateKeyEx(HKEY_CURRENT_USER, _strSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL); - RegSetValueEx (hKey, _strRegName, 0, REG_DWORD, (BYTE*) &_uiValue, sizeof(DWORD)); - RegCloseKey (hKey); -} - -//----------------------------------------------------------------------------------------------------- - -class CCursorShowerWithStack -{ -public: - void StoreCurrentAndShow() - { - m_numberOfShows = 1; - - while (ShowCursor(TRUE) < 0) - { - ++m_numberOfShows; - } - } - - void RevertToPrevious() - { - while (m_numberOfShows > 0) - { - ShowCursor(FALSE); - --m_numberOfShows; - } - } - -private: - int m_numberOfShows; -}; - -bool CryAssert(const char* _pszCondition, const char* _pszFile, unsigned int _uiLine, bool* _pbIgnore) -{ - if (!gEnv) - { - return false; - } - -#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD) - // we are in a non-debug build, so we should turn this into a warning instead. - if ((gEnv) && (gEnv->pLog)) - { - if (!gEnv->bIgnoreAllAsserts) - { - gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", _pszFile, _uiLine, _pszCondition); - } - } - - if (_pbIgnore) - { - // avoid showing the same one repeatedly. - *_pbIgnore = true; - } - return false; -#endif - - if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts) - { - SCryAssertInfo assertInfo; - - assertInfo.pszCondition = _pszCondition; - assertInfo.pszFile = _pszFile; - assertInfo.pszMessage = gs_szMessage; - assertInfo.uiLine = _uiLine; - assertInfo.btnChosen = SCryAssertInfo::BUTTON_CONTINUE; - - gEnv->pSystem->SetAssertVisible(true); - RegistryReadUInt32(gs_strRegSubKey, gs_strRegXValue, &assertInfo.uiX, 10); - RegistryReadUInt32(gs_strRegSubKey, gs_strRegYValue, &assertInfo.uiY, 10); - - CCursorShowerWithStack cursorShowerWithStack; - cursorShowerWithStack.StoreCurrentAndShow(); - - DialogBoxIndirectParam(GetModuleHandle(NULL), (DLGTEMPLATE*) &g_dialogRC, GetDesktopWindow(), DlgProc, (LPARAM) &assertInfo); - - cursorShowerWithStack.RevertToPrevious(); - - RegistryWriteUInt32(gs_strRegSubKey, gs_strRegXValue, assertInfo.uiX); - RegistryWriteUInt32(gs_strRegSubKey, gs_strRegYValue, assertInfo.uiY); - gEnv->pSystem->SetAssertVisible(false); - - switch (assertInfo.btnChosen) - { - case SCryAssertInfo::BUTTON_IGNORE: - *_pbIgnore = true; - break; - case SCryAssertInfo::BUTTON_IGNORE_ALL: - gEnv->bIgnoreAllAsserts = true; - break; - case SCryAssertInfo::BUTTON_BREAK: - return true; - case SCryAssertInfo::BUTTON_STOP: - raise(SIGABRT); - exit(-1); - case SCryAssertInfo::BUTTON_REPORT_AS_BUG: - if (gEnv && gEnv->pSystem) - { - const char* pszSafeMessage = (assertInfo.pszMessage && assertInfo.pszMessage[0]) ? assertInfo.pszMessage : ""; - gEnv->pSystem->ReportBug("Assert: %s - %s", assertInfo.pszCondition, pszSafeMessage); - } - break; - } - } - - if (gEnv && gEnv->pSystem) - { - // this also can cause fatal / shutdown behavior: - gEnv->pSystem->OnAssert(_pszCondition, gs_szMessage, _pszFile, _uiLine); - } - - return false; -} - -//----------------------------------------------------------------------------------------------------- - -#endif -#endif - -//----------------------------------------------------------------------------------------------------- diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index 6fdc8b52fe..50f7fccfcb 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -1295,15 +1295,7 @@ namespace Detail #endif -#if defined(USE_CRY_ASSERT) -static void AssertConsoleExists(void) -{ - CRY_ASSERT(gEnv->pConsole != NULL); -} -#define ASSERT_CONSOLE_EXISTS AssertConsoleExists() -#else #define ASSERT_CONSOLE_EXISTS 0 -#endif // defined(USE_CRY_ASSERT) // the following macros allow the help text to be easily stripped out diff --git a/Code/Legacy/CryCommon/WinBase.cpp b/Code/Legacy/CryCommon/WinBase.cpp index 3445637d28..771cde324e 100644 --- a/Code/Legacy/CryCommon/WinBase.cpp +++ b/Code/Legacy/CryCommon/WinBase.cpp @@ -712,16 +712,6 @@ DWORD Sleep(DWORD dwMilliseconds) #endif } -////////////////////////////////////////////////////////////////////////// -DWORD SleepEx(DWORD dwMilliseconds, BOOL /*bAlertable*/) -{ - //TODO: implement - // CRY_ASSERT_MESSAGE(0, "SleepEx not implemented yet"); - printf("SleepEx not properly implemented yet\n"); - Sleep(dwMilliseconds); - return 0; -} - #if defined(LINUX) || defined(APPLE) BOOL GetComputerName(LPSTR lpBuffer, LPDWORD lpnSize) { diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index a4d87c207a..e1117b6f52 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -85,11 +85,6 @@ set(FILES MathConversion.h AndroidSpecific.h AppleSpecific.h - CryAssert_Android.h - CryAssert_impl.h - CryAssert_iOS.h - CryAssert_Linux.h - CryAssert_Mac.h Linux32Specific.h Linux64Specific.h Linux_Win32Wrapper.h diff --git a/Code/Legacy/CryCommon/platform.h b/Code/Legacy/CryCommon/platform.h index d67c0b902c..d2251c7091 100644 --- a/Code/Legacy/CryCommon/platform.h +++ b/Code/Legacy/CryCommon/platform.h @@ -238,12 +238,6 @@ ILINE DestinationType alias_cast(SourceType pPtr) // Assert dialog box macros #include "CryAssert.h" -// Replace standard assert calls by our custom one -// Works only ifdef USE_CRY_ASSERT && _DEBUG && WIN32 -#ifndef assert -#define assert CRY_ASSERT -#endif - ////////////////////////////////////////////////////////////////////////// // Platform dependent functions that emulate Win32 API. // Mostly used only for debugging! diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index 64aa7ce1ca..8cbc58ad95 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -157,10 +157,6 @@ void __stl_debug_message(const char* format_str, ...) #include #endif -#if defined(APPLE) || defined(LINUX) -#include "CryAssert_impl.h" -#endif - #if defined(AZ_RESTRICTED_PLATFORM) #define AZ_RESTRICTED_SECTION PLATFORM_IMPL_H_SECTION_CRY_SYSTEM_FUNCTIONS #include AZ_RESTRICTED_FILE(platform_impl_h) @@ -168,8 +164,6 @@ void __stl_debug_message(const char* format_str, ...) #if defined (_WIN32) -#include "CryAssert_impl.h" - ////////////////////////////////////////////////////////////////////////// void CrySleep(unsigned int dwMilliseconds) { diff --git a/Code/Legacy/CrySystem/AZCoreLogSink.h b/Code/Legacy/CrySystem/AZCoreLogSink.h index 9d732b3dd4..6146de7560 100644 --- a/Code/Legacy/CrySystem/AZCoreLogSink.h +++ b/Code/Legacy/CrySystem/AZCoreLogSink.h @@ -77,64 +77,11 @@ public: bool OnPreAssert(const char* fileName, int line, const char* func, const char* message) override { -#if defined(USE_CRY_ASSERT) && AZ_LEGACY_CRYSYSTEM_TRAIT_DO_PREASSERT - AZ::Crc32 crc; - crc.Add(&line, sizeof(line)); - if (fileName) - { - crc.Add(fileName, strlen(fileName)); - } - - bool* ignore = nullptr; - auto foundIter = m_ignoredAsserts->find(crc); - if (foundIter == m_ignoredAsserts->end()) - { - ignore = &((*m_ignoredAsserts)[crc]); - *ignore = false; - } - else - { - ignore = &((*m_ignoredAsserts)[crc]); - } - - if (!(*ignore)) - { - using namespace AZ::Debug; - - Trace::Output(nullptr, "\n==================================================================\n"); - AZ::OSString outputMsg = AZ::OSString::format("Trace::Assert\n %s(%d): '%s'\n%s\n", fileName, line, func, message); - Trace::Output(nullptr, outputMsg.c_str()); - - // Suppress 3 in stack depth - this function, the bus broadcast that got us here, and Trace::Assert - Trace::Output(nullptr, "------------------------------------------------\n"); - Trace::PrintCallstack(nullptr, 3); - Trace::Output(nullptr, "\n==================================================================\n"); - - AZ::EnvironmentVariable inEditorBatchMode = AZ::Environment::FindVariable("InEditorBatchMode"); - if (!inEditorBatchMode.IsConstructed() || !inEditorBatchMode.Get()) - { - // Note - CryAssertTrace doesn't actually print any info to logging - // it just stores the message internally for the message box in CryAssert to use - CryAssertTrace("%s", message); - if (CryAssert("Assertion failed", fileName, line, ignore) || Trace::IsDebuggerPresent()) - { - Trace::Break(); - } - } - } - else - { - CryLogAlways("%s", message); - } - - return m_suppressSystemOutput; -#else AZ_UNUSED(fileName); AZ_UNUSED(line); AZ_UNUSED(func); AZ_UNUSED(message); return false; // allow AZCore to do its default behavior. This usually results in an application shutdown. -#endif } bool OnPreError(const char* window, const char* fileName, int line, const char* func, const char* message) override diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 7cf066f72e..47a9cbd5ef 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -1280,10 +1280,7 @@ void CSystem::RegisterWindowMessageHandler(IWindowMessageHandler* pHandler) void CSystem::UnregisterWindowMessageHandler(IWindowMessageHandler* pHandler) { #if AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER -#if !defined(NDEBUG) - bool bRemoved = -#endif - stl::find_and_erase(m_windowMessageHandlers, pHandler); + [[maybe_unused]] bool bRemoved = stl::find_and_erase(m_windowMessageHandlers, pHandler); assert(pHandler && bRemoved && "This IWindowMessageHandler was not registered"); #else CRY_ASSERT(false && "This platform does not support window message handlers"); diff --git a/Code/Legacy/CrySystem/System.h b/Code/Legacy/CrySystem/System.h index 664f5385fa..9b76e94eb4 100644 --- a/Code/Legacy/CrySystem/System.h +++ b/Code/Legacy/CrySystem/System.h @@ -53,11 +53,6 @@ class CWatchdogThread; #define AZ_LEGACY_CRYSYSTEM_TRAIT_ALLOW_CREATE_BACKUP_LOG_FILE 1 #endif -////////////////////////////////////////////////////////////////////////// -#if defined(WIN32) || defined(APPLE) || defined(LINUX) -#define AZ_LEGACY_CRYSYSTEM_TRAIT_DO_PREASSERT 1 -#endif - #if defined(LINUX) || defined(APPLE) #define AZ_LEGACY_CRYSYSTEM_TRAIT_FORWARD_EXCEPTION_POINTERS 1 #endif @@ -72,9 +67,7 @@ class CWatchdogThread; #define AZ_LEGACY_CRYSYSTEM_TRAIT_DEBUGCALLSTACK_APPEND_MODULENAME 1 #endif -#if 1 #define AZ_LEGACY_CRYSYSTEM_TRAIT_USE_EXCLUDEUPDATE_ON_CONSOLE 0 -#endif #if defined(WIN32) #define AZ_LEGACY_CRYSYSTEM_TRAIT_USE_MESSAGE_HANDLER 1 #endif diff --git a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp index 51be8a4c24..800b95a2e4 100644 --- a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp @@ -1554,8 +1554,8 @@ void CMovieSystem::ControlCapture() { #if !defined(NDEBUG) bool bBothStartAndEnd = m_bStartCapture && m_bEndCapture; -#endif assert(!bBothStartAndEnd); +#endif bool bAllCVarsReady = m_cvar_capture_frame_once && m_cvar_capture_folder && m_cvar_capture_frames; From e7683fa0f899699bc254ac3be30a6c4d75f5be4a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 8 Nov 2021 15:45:57 -0800 Subject: [PATCH 101/394] =?UTF-8?q?=EF=BB=BFremoves=20BaseLibrary/Item/Man?= =?UTF-8?q?ager=20unused=20code=20from=20Code/Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ErrorReport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 98d230e383..2ede92a8fe 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,7 +17,7 @@ // forward declarations. class CParticleItem; -#include +#include "BaseLibraryItem.h" #include #include "Objects/BaseObject.h" From 4ec420e62aac234f14f557d9a2fee08e6792608c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:48:42 -0800 Subject: [PATCH 102/394] =?UTF-8?q?=EF=BB=BFRemoves=20PrefabEntityOwnershi?= =?UTF-8?q?pService=20from=20AzFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.h | 20 ------------------- .../AzFramework/azframework_files.cmake | 1 - 2 files changed, 21 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h deleted file mode 100644 index ac24af880a..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h +++ /dev/null @@ -1,20 +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 - -namespace AzFramework -{ - class PrefabEntityOwnershipService - : public EntityOwnershipService - { - - }; -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9693d75b06..511439ab10 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,7 +120,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h - Entity/PrefabEntityOwnershipService.h Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 1d93290a1c3df1a2060f5b4beadcb90a0761410c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:47:13 -0800 Subject: [PATCH 103/394] Revert "Removes PrefabEntityOwnershipService from AzFramework" This reverts commit e2d2cb07a0a1431f8fcdd20ee07ff2788ed603c0. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ++++++++++++ .../Entity/PrefabEntityOwnershipService.h | 20 +++++++++++++++++++ .../AzFramework/azframework_files.cmake | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp create mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp new file mode 100644 index 0000000000..9b2c432332 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp @@ -0,0 +1,13 @@ +/* + * 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 + +namespace AzFramework +{ +} diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h new file mode 100644 index 0000000000..ac24af880a --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.h @@ -0,0 +1,20 @@ +/* + * 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 + +namespace AzFramework +{ + class PrefabEntityOwnershipService + : public EntityOwnershipService + { + + }; +} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 511439ab10..9af049a7c1 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -120,6 +120,8 @@ set(FILES Entity/SliceGameEntityOwnershipService.h Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h + Entity/PrefabEntityOwnershipService.h + Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h From 4cc54941c71976f5c388311243ec5bab81141e18 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 12:25:29 -0800 Subject: [PATCH 104/394] =?UTF-8?q?=EF=BB=BFCleanup=20before=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Entity/PrefabEntityOwnershipService.cpp | 13 ------------- .../AzFramework/AzFramework/azframework_files.cmake | 1 - scripts/cleanup/unusued_compilation.py | 2 ++ 3 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp diff --git a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp deleted file mode 100644 index 9b2c432332..0000000000 --- a/Code/Framework/AzFramework/AzFramework/Entity/PrefabEntityOwnershipService.cpp +++ /dev/null @@ -1,13 +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 - -namespace AzFramework -{ -} diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 9af049a7c1..9693d75b06 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -121,7 +121,6 @@ set(FILES Entity/SliceGameEntityOwnershipService.cpp Entity/SliceGameEntityOwnershipServiceBus.h Entity/PrefabEntityOwnershipService.h - Entity/PrefabEntityOwnershipService.cpp Components/ComponentAdapter.h Components/ComponentAdapter.inl Components/ComponentAdapterHelpers.h diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 1f1a9894c7..65f4626a8c 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -68,6 +68,8 @@ def is_excluded(file): for path_exclusion in PATH_EXCLUSIONS: if fnmatch.fnmatch(file, path_exclusion): return True + if '\\Template\\' in normalized_file: + return True with open(file, 'r') as file: contents = file.read() for exclusion_term in EXCLUSIONS: From f0b86ab1df5d4f6c47631c194c7c625290cbdd94 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:25:14 -0800 Subject: [PATCH 105/394] =?UTF-8?q?=EF=BB=BFcleanup=20script=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 65f4626a8c..ee46d98b91 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -68,8 +68,6 @@ def is_excluded(file): for path_exclusion in PATH_EXCLUSIONS: if fnmatch.fnmatch(file, path_exclusion): return True - if '\\Template\\' in normalized_file: - return True with open(file, 'r') as file: contents = file.read() for exclusion_term in EXCLUSIONS: @@ -78,7 +76,7 @@ def is_excluded(file): return False def filter_from_processed(filelist, filter_file_path): - filelist = set([f for f in filelist if not is_excluded(f)]) + filelist = [f for f in filelist if not is_excluded(f)] if os.path.exists(filter_file_path): with open(filter_file_path, 'r') as filter_file: processed_files = [s.strip() for s in filter_file.readlines()] @@ -93,7 +91,6 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 893f50355f9350917cc18a195e73f1e593573233 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:25:14 -0800 Subject: [PATCH 106/394] cleanup script updates Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index ee46d98b91..29a5a69648 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -39,6 +39,17 @@ PATH_EXCLUSIONS = ( 'install\\*', 'Code\\Framework\\AzCore\\AzCore\\Android\\*' ) +PATH_EXCLUSIONS = ( + '*\\Platform\\Android\\*', + '*\\Platform\\Common\\*', + '*\\Platform\\iOS\\*', + '*\\Platform\\Linux\\*', + '*\\Platform\\Mac\\*', + 'Templates\\*', + 'python\\*', + 'build\\*', + 'install\\*' +) def create_filelist(path): filelist = set() From 7ee0a0454ec6decb97f614f71b78272103a4bb4a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:03:29 -0800 Subject: [PATCH 107/394] =?UTF-8?q?=EF=BB=BFmore=20filters/using=20reverse?= =?UTF-8?q?=20on=20this=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 29a5a69648..aa582d59ab 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -39,17 +39,7 @@ PATH_EXCLUSIONS = ( 'install\\*', 'Code\\Framework\\AzCore\\AzCore\\Android\\*' ) -PATH_EXCLUSIONS = ( - '*\\Platform\\Android\\*', - '*\\Platform\\Common\\*', - '*\\Platform\\iOS\\*', - '*\\Platform\\Linux\\*', - '*\\Platform\\Mac\\*', - 'Templates\\*', - 'python\\*', - 'build\\*', - 'install\\*' -) + def create_filelist(path): filelist = set() @@ -102,6 +92,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) + sorted_filelist = sorted(filelist, reverse=True) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From b4cbffed068198ac5b574428779b06277caa98a3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 12 Nov 2021 19:02:07 -0800 Subject: [PATCH 108/394] =?UTF-8?q?=EF=BB=BFMore=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index aa582d59ab..6ad1e2da4d 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -92,7 +92,7 @@ def cleanup_unused_compilation(path): # starting over. Removing the "unusued_compilation_processed.txt" will start over. filter_file_path = os.path.join(os.getcwd(), 'unusued_compilation_processed.txt') filelist = filter_from_processed(filelist, filter_file_path) - sorted_filelist = sorted(filelist, reverse=True) + sorted_filelist = sorted(filelist) # 3. For each file total_files = len(sorted_filelist) current_files = 1 From 4ca4bb3618487ec8e5fb260d3f59d327b1488bb6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 15 Nov 2021 14:04:05 -0800 Subject: [PATCH 109/394] some more exclussions Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 6ad1e2da4d..4515a663af 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -77,7 +77,7 @@ def is_excluded(file): return False def filter_from_processed(filelist, filter_file_path): - filelist = [f for f in filelist if not is_excluded(f)] + filelist = set([f for f in filelist if not is_excluded(f)]) if os.path.exists(filter_file_path): with open(filter_file_path, 'r') as filter_file: processed_files = [s.strip() for s in filter_file.readlines()] From 61948fdc995ec1d651ebc60b132e09acd3580a2b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:21:33 -0800 Subject: [PATCH 110/394] Removes TitleBarPage from AzQtComponents/Gallery Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Gallery/ComponentDemoWidget.cpp | 2 - .../AzQtComponents/Gallery/TitleBarPage.cpp | 74 -------- .../AzQtComponents/Gallery/TitleBarPage.h | 29 ---- .../AzQtComponents/Gallery/TitleBarPage.ui | 162 ------------------ .../azqtcomponents_gallery_files.cmake | 3 - 5 files changed, 270 deletions(-) delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h delete mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp index 485803f9ae..fb775dfb88 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp @@ -37,7 +37,6 @@ #include "SvgLabelPage.h" #include "TableViewPage.h" #include "TabWidgetPage.h" -#include "TitleBarPage.h" #include "ToggleSwitchPage.h" #include "ToolBarPage.h" #include "TreeViewPage.h" @@ -101,7 +100,6 @@ ComponentDemoWidget::ComponentDemoWidget(QWidget* parent) // Pages hidden in 1.25 release - unused components, still need work before being made public, or not interesting for external devs //sortedPages.insert("AssetBrowserFolder", new AssetBrowserFolderPage(this)); - //sortedPages.insert("Titlebar", new TitleBarPage(this)); for (const auto& title : sortedPages.keys()) { diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp deleted file mode 100644 index 58ca3c101b..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp +++ /dev/null @@ -1,74 +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 "TitleBarPage.h" -#include - -TitleBarPage::TitleBarPage(QWidget* parent) - : QWidget(parent) - , ui(new Ui::TitleBarPage) -{ - using namespace AzQtComponents; - - ui->setupUi(this); - - ui->activeSimpleTitleBar->setDrawSimple(true); - ui->activeSimpleButtonsTitleBar->setDrawSimple(true); - ui->inactiveSimpleTitleBar->setDrawSimple(true); - ui->inactiveSimpleButtonsTitleBar->setDrawSimple(true); - - ui->activeTearTitleBar->setTearEnabled(true); - ui->activeTearButtonsTitleBar->setTearEnabled(true); - ui->inactiveTearTitleBar->setTearEnabled(true); - ui->inactiveTearButtonsTitleBar->setTearEnabled(true); - - ui->inactiveTitleBar->setForceInactive(true); - ui->inactiveButtonsTitleBar->setForceInactive(true); - ui->inactiveSimpleTitleBar->setForceInactive(true); - ui->inactiveSimpleButtonsTitleBar->setForceInactive(true); - ui->inactiveTearTitleBar->setForceInactive(true); - ui->inactiveTearButtonsTitleBar->setForceInactive(true); - - ui->activeButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->activeSimpleButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->activeTearButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->inactiveButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->inactiveSimpleButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - ui->inactiveTearButtonsTitleBar->setButtons( - { DockBarButton::DividerButton, DockBarButton::MinimizeButton, - DockBarButton::DividerButton, DockBarButton::MaximizeButton, - DockBarButton::DividerButton, DockBarButton::CloseButton}); - - QString exampleText = R"( -
-    
- )"; - - ui->exampleText->setHtml(exampleText); -} - -TitleBarPage::~TitleBarPage() -{ -} - -#include "Gallery/moc_TitleBarPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h deleted file mode 100644 index 3cc5a2741c..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.h +++ /dev/null @@ -1,29 +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 - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace Ui { - class TitleBarPage; -} - -class TitleBarPage : public QWidget -{ - Q_OBJECT - -public: - explicit TitleBarPage(QWidget* parent = nullptr); - ~TitleBarPage() override; - -private: - QScopedPointer ui; -}; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui deleted file mode 100644 index 00fb8cd7f3..0000000000 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.ui +++ /dev/null @@ -1,162 +0,0 @@ - - - TitleBarPage - - - - 0 - 0 - 827 - 716 - - - - - 0 - 0 - - - - - - - false - - - true - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Normal - - - Qt::AlignCenter - - - - - - - Simple - - - Qt::AlignCenter - - - - - - - Tear - - - Qt::AlignCenter - - - - - - - Active - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Inactive - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - AzQtComponents::TitleBar - QWidget -
AzQtComponents/Components/Titlebar.h
- 1 -
-
- - -
diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake index 05eee70f06..c309e60e29 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake +++ b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake @@ -106,9 +106,6 @@ set(FILES Gallery/TabWidgetPage.ui Gallery/TabWidgetPage.cpp Gallery/TabWidgetPage.h - Gallery/TitleBarPage.ui - Gallery/TitleBarPage.cpp - Gallery/TitleBarPage.h Gallery/ToggleSwitchPage.ui Gallery/ToggleSwitchPage.cpp Gallery/ToggleSwitchPage.h From 8a2cfedf3468b0aadb8c06094f0491020679178d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:51:05 -0800 Subject: [PATCH 111/394] =?UTF-8?q?=EF=BB=BFRemoves=20IProcess=20from=20Cr?= =?UTF-8?q?yCommon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/IProcess.h | 35 ------------------- Code/Legacy/CryCommon/ISystem.h | 1 - Code/Legacy/CryCommon/crycommon_files.cmake | 1 - Code/Legacy/CrySystem/CrySystem_precompiled.h | 1 - Code/Legacy/CrySystem/System.cpp | 4 --- Code/Legacy/CrySystem/SystemInit.cpp | 1 - 6 files changed, 43 deletions(-) delete mode 100644 Code/Legacy/CryCommon/IProcess.h diff --git a/Code/Legacy/CryCommon/IProcess.h b/Code/Legacy/CryCommon/IProcess.h deleted file mode 100644 index 098c0d80c9..0000000000 --- a/Code/Legacy/CryCommon/IProcess.h +++ /dev/null @@ -1,35 +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 - * - */ - - -// Description : Process common interface - - -#ifndef CRYINCLUDE_CRYCOMMON_IPROCESS_H -#define CRYINCLUDE_CRYCOMMON_IPROCESS_H -#pragma once - - -// forward declaration -struct SRenderingPassInfo; -//////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////// -struct IProcess -{ - // - virtual ~IProcess(){} - virtual bool Init() = 0; - virtual void Update() = 0; - virtual void RenderWorld(int nRenderFlags, const SRenderingPassInfo& passInfo, const char* szDebugName) = 0; - virtual void ShutDown() = 0; - virtual void SetFlags(int flags) = 0; - virtual int GetFlags(void) = 0; - // -}; - -#endif // CRYINCLUDE_CRYCOMMON_IPROCESS_H diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index 50f7fccfcb..e0d84ae689 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -46,7 +46,6 @@ namespace AZ::IO struct IConsole; struct IRemoteConsole; struct IRenderer; -struct IProcess; struct ICryFont; struct IMovieSystem; namespace Audio diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index e1117b6f52..412be4c746 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -22,7 +22,6 @@ set(FILES IMaterial.h IMiniLog.h IMovieSystem.h - IProcess.h IRenderAuxGeom.h IRenderer.h ISerialize.h diff --git a/Code/Legacy/CrySystem/CrySystem_precompiled.h b/Code/Legacy/CrySystem/CrySystem_precompiled.h index 41090ff321..ba212f2972 100644 --- a/Code/Legacy/CrySystem/CrySystem_precompiled.h +++ b/Code/Legacy/CrySystem/CrySystem_precompiled.h @@ -104,7 +104,6 @@ struct ITimer; struct IFFont; struct ICVar; struct IConsole; -struct IProcess; namespace AZ::IO { struct IArchive; diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 47a9cbd5ef..a5cee3a6b6 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -116,7 +116,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) #include #include #include -#include #include @@ -462,9 +461,6 @@ bool CSystem::IsQuitting() const bool wasExitMainLoopRequested = false; AzFramework::ApplicationRequests::Bus::BroadcastResult(wasExitMainLoopRequested, &AzFramework::ApplicationRequests::WasExitMainLoopRequested); return wasExitMainLoopRequested; -} - -////////////////////////////////////////////////////////////////////////// ISystem* CSystem::GetCrySystem() { return this; diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index f3f9442322..19d94ba6ec 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -75,7 +75,6 @@ #include #include #include -#include #include #include "XConsole.h" From 9bc498775c9fe6966430a8a798eeef2b1ca1e5e2 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:57:33 -0800 Subject: [PATCH 112/394] Removes Synchronization from CryCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/Synchronization.h | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Synchronization.h diff --git a/Code/Legacy/CryCommon/Synchronization.h b/Code/Legacy/CryCommon/Synchronization.h deleted file mode 100644 index ddd020ffde..0000000000 --- a/Code/Legacy/CryCommon/Synchronization.h +++ /dev/null @@ -1,25 +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 - - -//--------------------------------------------------------------------------- -// Synchronization policies, for classes (e.g. containers, allocators) that may -// or may not be multithread-safe. -// -// Policies should be used as a template argument to such classes, -// and these class implementations should then utilise the policy, as a base-class or member. -// -//--------------------------------------------------------------------------- - -#include - -namespace stl -{ -}; From 1cc1681ff00520d64a4ff8829e3cabd04c91b5f4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 13:59:42 -0800 Subject: [PATCH 113/394] Removes Win32Specific.h from CryCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/Win32specific.h | 111 -------------------------- 1 file changed, 111 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Win32specific.h diff --git a/Code/Legacy/CryCommon/Win32specific.h b/Code/Legacy/CryCommon/Win32specific.h deleted file mode 100644 index 4fa116166b..0000000000 --- a/Code/Legacy/CryCommon/Win32specific.h +++ /dev/null @@ -1,111 +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 - * - */ - - -// Description : Specific to Win32 declarations, inline functions etc. - - -#ifndef CRYINCLUDE_CRYCOMMON_WIN32SPECIFIC_H -#define CRYINCLUDE_CRYCOMMON_WIN32SPECIFIC_H -#pragma once - - -#define _CPU_X86 -#define _CPU_SSE -#ifdef _DEBUG -#define ILINE _inline -#else -#define ILINE __forceinline -#endif - -#define DEPRECATED __declspec(deprecated) - -#ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x501 -#endif - -////////////////////////////////////////////////////////////////////////// -// Standard includes. -////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include -#include -#include -#include -////////////////////////////////////////////////////////////////////////// - -// Special intrinsics -#include // moved here to prevent assert from being redefined when included elsewhere - - -////////////////////////////////////////////////////////////////////////// -// Define platform independent types. -////////////////////////////////////////////////////////////////////////// -#include "BaseTypes.h" - -typedef unsigned char BYTE; -typedef unsigned int threadID; -typedef unsigned long DWORD; -typedef double real; // biggest float-type on this machine -typedef long LONG; - -#if defined(_WIN64) -typedef __int64 INT_PTR, * PINT_PTR; -typedef unsigned __int64 UINT_PTR, * PUINT_PTR; - -typedef __int64 LONG_PTR, * PLONG_PTR; -typedef unsigned __int64 ULONG_PTR, * PULONG_PTR; - -typedef ULONG_PTR DWORD_PTR, * PDWORD_PTR; -#else -typedef __w64 int INT_PTR, * PINT_PTR; -typedef __w64 unsigned int UINT_PTR, * PUINT_PTR; - -typedef __w64 long LONG_PTR, * PLONG_PTR; -typedef __w64 unsigned long ULONG_PTR, * PULONG_PTR; - -typedef ULONG_PTR DWORD_PTR, * PDWORD_PTR; -#endif - -typedef void* THREAD_HANDLE; -typedef void* EVENT_HANDLE; - -////////////////////////////////////////////////////////////////////////// -// Multi platform Hi resolution ticks function, should only be used for profiling. -////////////////////////////////////////////////////////////////////////// - - -int64 CryGetTicks(); -int64 CryGetTicksPerSec(); - -#ifndef SAFE_DELETE -#define SAFE_DELETE(p) { if (p) { delete (p); (p) = NULL; } \ -} -#endif - -#ifndef SAFE_DELETE_ARRAY -#define SAFE_DELETE_ARRAY(p) { if (p) { delete [] (p); (p) = NULL; } \ -} -#endif - -#ifndef SAFE_RELEASE -#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = NULL; } \ -} -#endif - -#ifndef FILE_ATTRIBUTE_NORMAL - #define FILE_ATTRIBUTE_NORMAL 0x00000080 -#endif - -#define TARGET_DEFAULT_ALIGN (0x4U) - - -#endif // CRYINCLUDE_CRYCOMMON_WIN32SPECIFIC_H From f6a72f80534982eb96ec40ce91145170a674aa74 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:26:13 -0800 Subject: [PATCH 114/394] Removes Win32Specific.h from CryCommon cmake file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/crycommon_files.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index 412be4c746..384dd98ecc 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -92,7 +92,6 @@ set(FILES MacSpecific.h platform.h platform_impl.cpp - Win32specific.h Win64specific.h LyShine/UiAssetTypes.h LyShine/Bus/UiCursorBus.h From 0af1adbf2fe55ac6e173e9a7b819d36bb3a25879 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:34:45 -0800 Subject: [PATCH 115/394] Removes newoverride.inl from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/newoverride.inl | 165 ------------------ 1 file changed, 165 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl deleted file mode 100644 index 39cfa6aaa0..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/newoverride.inl +++ /dev/null @@ -1,165 +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 - * - */ -// overrides all new and delete and forwards them to the AZ allocator system -// for tracking purposes. - -#include -#include -#include -#include - -void* operator new(std::size_t size, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator aznew", 0, 0); -} -void* operator new[](std::size_t size, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator aznew[]", 0, 0); -} -void* operator new(std::size_t size, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, name ? name : "global operator aznew", fileName, lineNum); -} -void* operator new[](std::size_t size, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, name ? name : "global operator aznew[]", fileName, lineNum); -} - -void* operator new(std::size_t size) -{ - if (size == 0) - { - size = 1; - } - - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return malloc(size); - } - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator new", 0, 0); -} - -//----------------------------------- -void* operator new[](std::size_t size) -//----------------------------------- -{ - if (size == 0) - { - size = 1; - } - - if (!AZ::AllocatorInstance::IsReady()) - { - AZ_Warning("MEMORY", false, "Memory is being allocated at static startup!"); - return _aligned_malloc(size, AZCORE_GLOBAL_NEW_ALIGNMENT); - } - - return AZ::AllocatorInstance::Get().Allocate(size, AZCORE_GLOBAL_NEW_ALIGNMENT, 0, "global operator new[]", 0, 0); -} - -//----------------------------------- -void* operator new(std::size_t size, std::nothrow_t const&) -//----------------------------------- -{ - return operator new(size); -} - -//----------------------------------- -void* operator new[](std::size_t size, std::nothrow_t const&) -//----------------------------------- -{ - return operator new[](size); -} - -// these deletes have to be created to match the new() -// and will only happen during exception handling when allocation fails. -void operator delete(void* ptr, const AZ::Internal::AllocatorDummy*) -{ - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete[](void* ptr, const AZ::Internal::AllocatorDummy*) -{ - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete(void* ptr, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - (void)fileName; - (void)lineNum; - (void)name; - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete[](void* ptr, const char* fileName, int lineNum, const char* name, const AZ::Internal::AllocatorDummy*) -{ - (void)fileName; - (void)lineNum; - (void)name; - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -void operator delete(void* ptr) -{ - if (ptr == 0) - { - return; - } - - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - -//----------------------------------- -void operator delete[](void* ptr) -//----------------------------------- -{ - if (ptr == 0) - { - return; - } - AZ::AllocatorInstance::Get().DeAllocate(ptr); -} - From 223fe64d2568a1883547052f764a2249b26e0e32 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:37:40 -0800 Subject: [PATCH 116/394] =?UTF-8?q?=EF=BB=BFRemoves=20EditorVegetationRequ?= =?UTF-8?q?estsBus=20from=20AzToolsFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../API/EditorVegetationRequestsBus.h | 43 ------------------- .../aztoolsframework_files.cmake | 1 - 2 files changed, 44 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h deleted file mode 100644 index 7bfc891476..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorVegetationRequestsBus.h +++ /dev/null @@ -1,43 +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 -#include - -class CVegetationMap; -struct CVegetationInstance; - -namespace AzToolsFramework -{ - namespace EditorVegetation - { - /** - * Bus used to talk to VegetationMap across the application - */ - class EditorVegetationRequests - : public AZ::EBusTraits - { - public: - using Bus = AZ::EBus; - - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - typedef CVegetationMap* BusIdType; - - virtual ~EditorVegetationRequests() {} - - virtual AZStd::vector GetObjectInstances(const AZ::Vector2& min, const AZ::Vector2& max) = 0; - virtual void DeleteObjectInstance(CVegetationInstance* instance) = 0; - }; - - using EditorVegetationRequestsBus = AZ::EBus; - } -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 0d7bf05211..746fb6a445 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -38,7 +38,6 @@ set(FILES API/EditorLevelNotificationBus.h API/ViewportEditorModeTrackerNotificationBus.h API/ViewportEditorModeTrackerNotificationBus.cpp - API/EditorVegetationRequestsBus.h API/EditorPythonConsoleBus.h API/EditorPythonRunnerRequestsBus.h API/EditorPythonScriptNotificationsBus.h From 3c0fa8cb5cd987171e5f9ace8b39272d3ad04495 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:00:29 -0800 Subject: [PATCH 117/394] Removes NullArchiveComponent from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Archive/NullArchiveComponent.cpp | 86 ------------------- .../Archive/NullArchiveComponent.h | 62 ------------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 150 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp deleted file mode 100644 index 972e9d588f..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.cpp +++ /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 - * - */ - -#include "NullArchiveComponent.h" - -#include -#include - -namespace AzToolsFramework -{ - - void NullArchiveComponent::Activate() - { - ArchiveCommandsBus::Handler::BusConnect(); - } - - void NullArchiveComponent::Deactivate() - { - ArchiveCommandsBus::Handler::BusDisconnect(); - } - - std::future DefaultFuture() - { - std::promise p; - p.set_value(false); - return p.get_future(); - } - - std::future NullArchiveComponent::CreateArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*dirToArchive*/) - { - return DefaultFuture(); - } - - std::future NullArchiveComponent::ExtractArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*destinationPath*/) - { - return DefaultFuture(); - } - - std::future NullArchiveComponent::ExtractFile( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*fileInArchive*/, - const AZStd::string& /*destinationPath*/) - { - return DefaultFuture(); - } - - bool NullArchiveComponent::ListFilesInArchive(const AZStd::string& /*archivePath*/, AZStd::vector& /*outFileEntries*/) - { - return false; - } - - std::future NullArchiveComponent::AddFileToArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*fileToAdd*/, - const AZStd::string& /*pathInArchive*/) - { - return DefaultFuture(); - } - - std::future NullArchiveComponent::AddFilesToArchive( - const AZStd::string& /*archivePath*/, - const AZStd::string& /*workingDirectory*/, - const AZStd::string& /*listFilePath*/) - { - return DefaultFuture(); - } - - void NullArchiveComponent::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ; - } - } -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h deleted file mode 100644 index 9ce33d0c85..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Archive/NullArchiveComponent.h +++ /dev/null @@ -1,62 +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 AzToolsFramework -{ - class NullArchiveComponent - : public AZ::Component - , private ArchiveCommandsBus::Handler - { - public: - AZ_COMPONENT(NullArchiveComponent, "{D665B6B1-5FF4-4203-B19F-BBDB82587129}") - - NullArchiveComponent() = default; - ~NullArchiveComponent() override = default; - - ////////////////////////////////////////////////////////////////////////// - // AZ::Component overrides - void Activate() override; - void Deactivate() override; - ////////////////////////////////////////////////////////////////////////// - private: - static void Reflect(AZ::ReflectContext* context); - - ////////////////////////////////////////////////////////////////////////// - // ArchiveCommandsBus::Handler overrides - [[nodiscard]] std::future CreateArchive( - const AZStd::string& archivePath, - const AZStd::string& dirToArchive) override; - - [[nodiscard]] std::future ExtractArchive( - const AZStd::string& archivePath, - const AZStd::string& destinationPath) override; - - [[nodiscard]] std::future ExtractFile( - const AZStd::string& archivePath, - const AZStd::string& fileInArchive, - const AZStd::string& destinationPath) override; - - bool ListFilesInArchive(const AZStd::string& archivePath, AZStd::vector& outFileEntries) override; - - [[nodiscard]] std::future AddFileToArchive( - const AZStd::string& archivePath, - const AZStd::string& workingDirectory, - const AZStd::string& fileToAdd) override; - - [[nodiscard]] std::future AddFilesToArchive( - const AZStd::string& archivePath, - const AZStd::string& workingDirectory, - const AZStd::string& listFilePath) override; - ////////////////////////////////////////////////////////////////////////// - }; -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 746fb6a445..497c64a638 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -642,8 +642,6 @@ set(FILES AssetBrowser/Previewer/PreviewerFrame.h Archive/ArchiveComponent.h Archive/ArchiveComponent.cpp - Archive/NullArchiveComponent.h - Archive/NullArchiveComponent.cpp Archive/ArchiveAPI.h UI/PropertyEditor/Model/AssetCompleterModel.h UI/PropertyEditor/Model/AssetCompleterModel.cpp From 7029135daa0174f451af172b5d17a1d0b9e80447 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:07:20 -0800 Subject: [PATCH 118/394] Removes AssetBrowserBus.inl from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AssetBrowser/AssetBrowserBus.inl | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl deleted file mode 100644 index 0e56a1fdeb..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.inl +++ /dev/null @@ -1,41 +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 -#include - -#include - -class QImage; - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - class AssetBrowserModel; - - //! Sends requests to output preview image for texture assets. Used for internal only! - class AssetBrowserTexturePreviewRequests - : public AZ::EBusTraits - { - public: - - // Only a single handler is allowed - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - //! Request to get a preview image for texture product - //@return whether the output image is valid or not - virtual bool GetProductTexturePreview(const char* /*fullProductFileName*/, QImage& /*previewImage*/, AZStd::string& /*productInfo*/, AZStd::string& /*productAlphaInfo*/) { return false; } - }; - - using AssetBrowserTexturePreviewRequestsBus = AZ::EBus; - } // namespace AssetBrowser -} // namespace AzToolsFramework From 30f7f711113f7d14708579322d7dbbde945962e4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:08:08 -0800 Subject: [PATCH 119/394] Remves AssetBrowserBus.inl from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/AssetBrowser/AssetBrowserBus.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h index 54fd142e76..7f0eb18fe3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserBus.h @@ -286,5 +286,3 @@ namespace AzToolsFramework } // namespace AssetBrowser } // namespace AzToolsFramework - -#include From c62c63295ff4cc889235e13ffe2b372d9b08260b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:10:39 -0800 Subject: [PATCH 120/394] Removes SortFilterProxyModel from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AssetBrowser/SortFilterProxyModel.cpp | 186 ------------------ 1 file changed, 186 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp deleted file mode 100644 index d41bfe6e3b..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/SortFilterProxyModel.cpp +++ /dev/null @@ -1,186 +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 "SortFilterProxyModel.hxx" - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - ////////////////////////////////////////////////////////////////////////// - //SortFilterProxyModel - SortFilterProxyModel::SortFilterProxyModel(QObject* parent) - : QSortFilterProxyModel(parent) - , m_assetMatchFiltersOperator(AzToolsFramework::FilterOperatorType::And) - { - //uncomment any column you want to see in the view - m_showColumn.insert(AssetBrowserEntry::Column::Name); - //m_showColumn.insert( Entry::Column_SourceID ); - //m_showColumn.insert( Entry::Column_FingerprintValue ); - //m_showColumn.insert( Entry::Colbumn_Guid ); - //m_showColumn.insert( Entry::Column_ScanFolderID ); - //m_showColumn.insert( Entry::Column_ProductID ); - //m_showColumn.insert( Entry::Column_JobID ); - //m_showColumn.insert( Entry::Column_JobKey ); - //m_showColumn.insert( Entry::Column_SubID ); - //m_showColumn.insert( Entry::Column_AssetType ); - //m_showColumn.insert( Entry::Column_Platform ); - //m_showColumn.insert( Entry::Column_ClassID ); - } - - void SortFilterProxyModel::OnSearchCriteriaChanged(QStringList& criteriaList, AzToolsFramework::FilterOperatorType filterOperator) - { - removeAllAssetMatchFilters(); - setAssetMatchFilterOperator(filterOperator); - - for (QString criteria : criteriaList) - { - auto parts = criteria.split(": ", QString::SkipEmptyParts); - addAssetMatchFilter(parts.last().toUtf8().constData()); - } - } - - void SortFilterProxyModel::addAssetTypeFilter(AZ::Data::AssetType assetType) - { - m_assetTypeFilters.push_back(assetType); - invalidateFilter(); - } - - void SortFilterProxyModel::addAssetPathFilter(const char* assetPathFilter) - { - m_assetPathFilters.push_back(assetPathFilter); - invalidateFilter(); - } - - void SortFilterProxyModel::removeAllAssetPathFilters() - { - m_assetPathFilters.clear(); - invalidateFilter(); - } - - void SortFilterProxyModel::setAssetMatchSubDirFilter(bool val) - { - m_includeSubdir = val; - invalidateFilter(); - } - - void SortFilterProxyModel::removeAllAssetMatchFilters() - { - m_assetMatchFilters.clear(); - invalidateFilter(); - } - - void SortFilterProxyModel::addAssetMatchFilter(const char* assetMatchFilter) - { - m_assetMatchFilters.push_back(assetMatchFilter); - invalidateFilter(); - } - - void SortFilterProxyModel::setAssetMatchFilterOperator(AzToolsFramework::FilterOperatorType type) - { - m_assetMatchFiltersOperator = type; - invalidateFilter(); - } - - bool SortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const - { - //get the source idx, if invalid early out - QModelIndex idx = sourceModel()->index(source_row, 0, source_parent); - if (!idx.isValid()) - { - return false; - } - - //the entry is the internal pointer of the index - auto entry = static_cast(idx.internalPointer()); - - if (!entry->isValid()) - { - return false; - } - - //////////////////////////////////////////////////////////////////////// - //we only want to see assets that have at least one child product that has a valid assetType - if (entry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Source) - { - //we have a asset with at least one valid child product assetType - //we only want to see assets that have at least one child product that matches the assetType filter - if (!m_assetTypeFilters.empty()) - { - for (int i = 0; i < entry->GetChildCount(); ++i) - { - auto product = static_cast(entry->GetChild(i)); - if (product->isValid()) - { - if (AZStd::find(m_assetTypeFilters.begin(), m_assetTypeFilters.end(), product->GetAssetType()) == m_assetTypeFilters.end()) - { - return false; - } - } - } - } - } - - ////////////////////////////////////////////////////////////////////////// - //we only want to see assets that match all the match filters - if (!m_assetMatchFilters.empty()) - { - if (m_assetMatchFiltersOperator == AzToolsFramework::FilterOperatorType::And) - { - for (const auto& item : m_assetMatchFilters) - { - if (!entry->Match(item.c_str())) - { - return false; - } - } - } - else if (m_assetMatchFiltersOperator == AzToolsFramework::FilterOperatorType::Or) - { - for (const auto& item : m_assetMatchFilters) - { - if (entry->Match(item.c_str())) - { - return true; - } - } - return false; - } - } - //////////////////////////////////////////////////////////////////////// - - return true; - } - - bool SortFilterProxyModel::filterAcceptsColumn(int source_column, const QModelIndex& source_parent) const - { - (void)source_parent; - - //if the column is in the set we want to show it - return m_showColumn.find(static_cast(source_column)) != m_showColumn.end(); - } - - bool SortFilterProxyModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const - { - if (source_left.column() == source_right.column()) - { - QVariant leftData = sourceModel()->data(source_left); - QVariant rightData = sourceModel()->data(source_right); - if ((leftData.type() == QVariant::String) && - (rightData.type() == QVariant::String)) - { - QString leftString = leftData.toString(); - QString rightString = rightData.toString(); - return QString::compare(leftString, rightString, Qt::CaseInsensitive) > 0; - } - } - return QSortFilterProxyModel::lessThan(source_left, source_right); - } - } // namespace AssetBrowser -} // namespace AzToolsFramework// namespace AssetBrowser - -#include From 7f327324788db9e1ff2d7ca470907744605644cf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:47:46 -0800 Subject: [PATCH 121/394] Removes AnimValue from CryCommon/Maestro/Types Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CryCommon/Maestro/Types/AnimValue.h | 39 ------------------- Code/Legacy/CryCommon/crycommon_files.cmake | 1 - 2 files changed, 40 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Maestro/Types/AnimValue.h diff --git a/Code/Legacy/CryCommon/Maestro/Types/AnimValue.h b/Code/Legacy/CryCommon/Maestro/Types/AnimValue.h deleted file mode 100644 index 77748a6ced..0000000000 --- a/Code/Legacy/CryCommon/Maestro/Types/AnimValue.h +++ /dev/null @@ -1,39 +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 - * - */ - - -#ifndef CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H -#define CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H -#pragma once - -//! Values that animation track can hold. -// Do not change values! they are serialized -// -// Attention: This should only be expanded if you add a completely new value type that tracks can control! -// If you just want to control a new parameter of an entity etc. extend EParamType -// -// Note: If the param type of a track is known and valid these can be derived from the node. -// These are serialized in case the parameter got invalid (for example for material nodes) -// -enum class AnimValue -{ - Float = 0, - Vector = 1, - Quat = 2, - Bool = 3, - Select = 5, - Vector4 = 15, - DiscreteFloat = 16, - RGB = 20, - CharacterAnim = 21, - - Unknown = static_cast(0xFFFFFFFF) -}; - - -#endif CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index 384dd98ecc..7b2dc84807 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -102,7 +102,6 @@ set(FILES Maestro/Bus/SequenceAgentComponentBus.h Maestro/Types/AnimNodeType.h Maestro/Types/AnimParamType.h - Maestro/Types/AnimValue.h Maestro/Types/AnimValueType.h Maestro/Types/AssetBlendKey.h Maestro/Types/AssetBlends.h From 56802a3cfa81b182dabaf3f789b17c809f8b4db0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:40:33 -0800 Subject: [PATCH 122/394] removes LegacyCommand from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/Commands/LegacyCommand.h | 47 ------------------- .../aztoolsframework_files.cmake | 1 - 2 files changed, 48 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h deleted file mode 100644 index ca82b74265..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/LegacyCommand.h +++ /dev/null @@ -1,47 +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 -#include -#include -#include -#include - -namespace AzToolsFramework -{ - /** - * AzToolsFramework URSequencePoint wrapper around legacy IUndoObject - * Allows using IUndoObject with AzToolsFramework undo system - */ - template - class LegacyCommand - : public AzToolsFramework::UndoSystem::URSequencePoint - { - public: - AZ_RTTI(LegacyCommand, "{9ED33CB6-04D0-4924-A121-D8C27DC09066}", AzToolsFramework::UndoSystem::URSequencePoint); - AZ_CLASS_ALLOCATOR(LegacyCommand, AZ::SystemAllocator, 0); - - explicit LegacyCommand(const AZStd::string& friendlyName, AZStd::unique_ptr&& legacyUndo) - : AzToolsFramework::UndoSystem::URSequencePoint(friendlyName) - { - m_legacyUndo = AZStd::move(legacyUndo); - } - virtual ~LegacyCommand() = default; - - void Undo() override { m_legacyUndo->Undo(); } - void Redo() override { m_legacyUndo->Redo(); } - - bool Changed() const override { return true; } - - protected: - AZStd::unique_ptr m_legacyUndo; - }; -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 497c64a638..e0ab8d5b73 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -487,7 +487,6 @@ set(FILES Commands/EntityTransformCommand.h Commands/PreemptiveUndoCache.cpp Commands/PreemptiveUndoCache.h - Commands/LegacyCommand.h Commands/BaseSliceCommand.cpp Commands/BaseSliceCommand.h Commands/SliceDetachEntityCommand.cpp From 6a7553b6823451c8582cf31e07fab3123c9f6fbc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:44:20 -0800 Subject: [PATCH 123/394] Removes AssetBrowserProductThumbnail.cpp that is unused and duplicated by Code\Framework\AzToolsFramework\AzToolsFramework\AssetBrowser\Thumbnails\ProductThumbnail.cpp Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AssetBrowserProductThumbnail.cpp | 124 ------------------ 1 file changed, 124 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp deleted file mode 100644 index 8f042d2648..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/AssetBrowserProductThumbnail.cpp +++ /dev/null @@ -1,124 +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 -#include -#include - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - ////////////////////////////////////////////////////////////////////////// - // ProductThumbnailKey - ////////////////////////////////////////////////////////////////////////// - ProductThumbnailKey::ProductThumbnailKey(const AZ::Data::AssetId& assetId) - : ThumbnailKey() - , m_assetId(assetId) - { - AZ::Data::AssetInfo info; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(info, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, m_assetId); - m_assetType = info.m_assetType; - } - - const AZ::Data::AssetId& ProductThumbnailKey::GetAssetId() const { return m_assetId; } - - const AZ::Data::AssetType& ProductThumbnailKey::GetAssetType() const { return m_assetType; } - - size_t ProductThumbnailKey::GetHash() const - { - return m_assetType.GetHash(); - } - - bool ProductThumbnailKey::Equals(const ThumbnailKey* other) const - { - if (!ThumbnailKey::Equals(other)) - { - return false; - } - // products displayed in Asset Browser have icons based on asset type, so multiple different products with same asset type will have same thumbnail - return m_assetId == azrtti_cast(other)->GetAssetId(); - } - - ////////////////////////////////////////////////////////////////////////// - // ProductThumbnail - ////////////////////////////////////////////////////////////////////////// - static const char* DEFAULT_PRODUCT_ICON_PATH = "Editor/Icons/AssetBrowser/DefaultProduct_16.svg"; - - ProductThumbnail::ProductThumbnail(Thumbnailer::SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) - {} - - void ProductThumbnail::LoadThread() - { - auto productKey = azrtti_cast(m_key.data()); - AZ_Assert(productKey, "Incorrect key type, excpected ProductThumbnailKey"); - - QString iconPath; - AZ::AssetTypeInfoBus::EventResult(iconPath, productKey->GetAssetType(), &AZ::AssetTypeInfo::GetBrowserIcon); - if (!iconPath.isEmpty()) - { - // is it an embedded resource or absolute path? - bool isUsablePath = (iconPath.startsWith(":") || (!AzFramework::StringFunc::Path::IsRelative(iconPath.toUtf8().constData()))); - - if (!isUsablePath) - { - // getting here means it needs resolution. Can we find the real path of the file? This also searches in gems for sources. - bool foundIt = false; - AZStd::string watchFolder; - AZ::Data::AssetInfo assetInfo; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(foundIt, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, iconPath.toUtf8().constData(), assetInfo, watchFolder); - - if (foundIt) - { - // the absolute path is join(watchfolder, relativepath); // since its relative to the watch folder. - AZStd::string finalPath; - AzFramework::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), finalPath); - iconPath = QString::fromUtf8(finalPath.c_str()); - } - } - } - else - { - // no pixmap specified - use default. - iconPath = QString::fromUtf8(DEFAULT_PRODUCT_ICON_PATH); - } - - m_icon = QIcon(iconPath); - - if (m_icon.isNull()) - { - m_state = State::Failed; - } - } - - ////////////////////////////////////////////////////////////////////////// - // ProductThumbnailCache - ////////////////////////////////////////////////////////////////////////// - ProductThumbnailCache::ProductThumbnailCache() - : ThumbnailCache() {} - - ProductThumbnailCache::~ProductThumbnailCache() = default; - - const char* ProductThumbnailCache::GetProviderName() const - { - return ProviderName; - } - - bool ProductThumbnailCache::IsSupportedThumbnail(Thumbnailer::SharedThumbnailKey key) const - { - return azrtti_istypeof(key.data()); - } - - } // namespace AssetBrowser -} // namespace AzToolsFramework - -#include "AssetBrowser/Thumbnails/moc_AssetBrowserProductThumbnail.cpp" From 3d1560e5585bfdc2685be9e01f3a52169693e0b3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:51:56 -0800 Subject: [PATCH 124/394] removes Commands/EntityTransformCommand from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Commands/EntityTransformCommand.cpp | 88 ------------------- .../Commands/EntityTransformCommand.h | 66 -------------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 156 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp deleted file mode 100644 index 72719a1bf3..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.cpp +++ /dev/null @@ -1,88 +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 - * - */ - -#if 0 - -#include "EntityTransformCommand.h" -#include -#include -#include - -namespace AzToolsFramework -{ - TransformCommand::TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EntityList& captureEntities) - : UndoSystem::URSequencePoint(friendlyName) - , m_contextId(contextId) - { - for (auto it = captureEntities.begin(); it != captureEntities.end(); ++it) - { - SRT current; - EBUS_EVENT_ID_RESULT(current, *it, TransformComponentMessages::Bus, GetLocalSRT); - m_priorTransforms[*it] = current; - m_nextTransforms[*it] = current; - } - - m_undoCacheInterface = AZ::Interface::Get(); - AZ_Assert(m_undoCacheInterface, "Could not get UndoCacheInterface on TransformCommand construction."); - } - - void TransformCommand::Post() - { - // add to undo stack - UndoSystem::UndoStack* undoStack = NULL; - EBUS_EVENT_ID_RESULT(undoStack, m_contextId, SelectionMessages::Bus, GetUndoStack); - - if (undoStack) - { - undoStack->Post(this); - } - - for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it) - { - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::Undo() - { - for (auto it = m_priorTransforms.begin(); it != m_priorTransforms.end(); ++it) - { - EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second); - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::Redo() - { - for (auto it = m_nextTransforms.begin(); it != m_nextTransforms.end(); ++it) - { - EBUS_EVENT_ID(it->first, TransformComponentMessages::Bus, SetLocalSRT, it->second); - m_undoCacheInterface->UpdateCache(it->first); - } - } - - void TransformCommand::CaptureNewTransform(const AZ::EntityId entityId) - { - AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "You can't add new transforms during an operation"); - AZ_Assert(m_nextTransforms.find(entityId) != m_nextTransforms.end(), "You can't add new transforms during an operation"); - - SRT current; - EBUS_EVENT_ID_RESULT(current, entityId, TransformComponentMessages::Bus, GetLocalSRT); - m_nextTransforms[entityId] = current; - } - - void TransformCommand::RevertToPriorTransform(const AZ::EntityId entityId) - { - AZ_Assert(m_priorTransforms.find(entityId) != m_priorTransforms.end(), "No such entity!"); - - m_nextTransforms[entityId] = m_priorTransforms[entityId]; - EBUS_EVENT_ID(entityId, TransformComponentMessages::Bus, SetLocalSRT, m_priorTransforms[entityId]); - } -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h deleted file mode 100644 index 7448b2cac5..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityTransformCommand.h +++ /dev/null @@ -1,66 +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 - * - */ -#ifndef TRANSFORM_COMMAND_H -#define TRANSFORM_COMMAND_H - -#if 0 - -#include -#include -#include -#include -#include -#include - -#pragma once - -namespace AzToolsFramework -{ - namespace UndoSystem - { - class UndoCacheInterface; - } - - typedef AZStd::vector EntityList; - - // transform command specializes undo to just care about the transform of an entity instead of the entire thing, for performance. - class TransformCommand - : public UndoSystem::URSequencePoint - { - public: - AZ_CLASS_ALLOCATOR(TransformCommand, AZ::SystemAllocator, 0); - AZ_RTTI(TransformCommand); - - TransformCommand(const AZ::u64& contextId, const AZStd::string& friendlyName, const EditorFramework::EntityList& captureEntities); - virtual ~TransformCommand() {} - - // the default will work for selections with out an undo stack(maybe move the undo stack here too - void CaptureNewTransform(const AZ::EntityId entityId); - void RevertToPriorTransform(const AZ::EntityId entityID); - - virtual void Undo(); - virtual void Redo(); - - virtual void Post(); - - protected: - AZ::u64 m_contextId; - - typedef AZStd::unordered_map CapturedTransforms; - - CapturedTransforms m_priorTransforms; - CapturedTransforms m_nextTransforms; - - private: - UndoCacheInterface* m_undoCacheInterface; - }; -} - -#endif // disabled - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index e0ab8d5b73..dc2ceabfcc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -483,8 +483,6 @@ set(FILES Commands/EntityStateCommand.h Commands/SelectionCommand.cpp Commands/SelectionCommand.h - Commands/EntityTransformCommand.cpp - Commands/EntityTransformCommand.h Commands/PreemptiveUndoCache.cpp Commands/PreemptiveUndoCache.h Commands/BaseSliceCommand.cpp From bb129c3cd140cb850eb62b82fd9a7033c309357b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:56:44 -0800 Subject: [PATCH 125/394] Removes TraceContextBufferedFormatter from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Debug/TraceContextBufferedFormatter.cpp | 149 ------------------ .../Debug/TraceContextBufferedFormatter.h | 66 -------- .../Debug/TraceContextBufferedFormatter.inl | 19 --- .../aztoolsframework_files.cmake | 3 - 4 files changed, 237 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp deleted file mode 100644 index 305d4a8b1e..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.cpp +++ /dev/null @@ -1,149 +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 - -#ifdef AZ_ENABLE_TRACE_CONTEXT - -#include -#include -#include - -#include - -#endif // AZ_ENABLE_TRACE_CONTEXT - -namespace AzToolsFramework -{ - namespace Debug - { - -#ifdef AZ_ENABLE_TRACE_CONTEXT - - int TraceContextBufferedFormatter::Print(char* buffer, size_t bufferSize, const TraceContextStackInterface& stack, bool printUuids, size_t startIndex) - { - if (bufferSize == 0) - { - return -1; - } - - // Make sure there's always a terminator, even if nothing has been written. - buffer[0] = 0; - - size_t stackSize = stack.GetStackCount(); - for (size_t i = startIndex; i < stackSize; ++i) - { - int written = 0; - switch (stack.GetType(i)) - { - case TraceContextStackInterface::ContentType::StringType: - written = azsnprintf(buffer, bufferSize, "%s=%s\n", stack.GetKey(i), stack.GetStringValue(i)); - break; - case TraceContextStackInterface::ContentType::BoolType: - written = azsnprintf(buffer, bufferSize, "%s=%c\n", stack.GetKey(i), (stack.GetBoolValue(i) ? '1' : '0')); - break; - case TraceContextStackInterface::ContentType::IntType: - written = azsnprintf(buffer, bufferSize, "%s=%" PRIi64 "\n", stack.GetKey(i), stack.GetIntValue(i)); - break; - case TraceContextStackInterface::ContentType::UintType: - written = azsnprintf(buffer, bufferSize, "%s=%" PRIu64 "\n", stack.GetKey(i), stack.GetUIntValue(i)); - break; - case TraceContextStackInterface::ContentType::FloatType: - written = azsnprintf(buffer, bufferSize, "%s=%f\n", stack.GetKey(i), stack.GetFloatValue(i)); - break; - case TraceContextStackInterface::ContentType::DoubleType: - written = azsnprintf(buffer, bufferSize, "%s=%f\n", stack.GetKey(i), stack.GetDoubleValue(i)); - break; - case TraceContextStackInterface::ContentType::UuidType: - if (printUuids) - { - written = azsnprintf(buffer, bufferSize, "%s=", stack.GetKey(i)); - if (written > 0) - { - int uuidWritten = PrintUuid(buffer + written, bufferSize - written, stack.GetUuidValue(i)); - written = (uuidWritten < 0 ? -1 : (written + uuidWritten)); - } - break; - } - else - { - continue; - } - case TraceContextStackInterface::ContentType::Undefined: - written = azsnprintf(buffer, bufferSize, "\n"); - break; - default: - written = azsnprintf(buffer, bufferSize, "\n"); - break; - } - - // If successful azsnprintf will return the number of characters that were - // written, so move the buffer forward and reduce the available space. - // Otherwise see if there's anything written that needs to be recovered - // or to simply move to the next entry upon re-entry. - if (written > 0) - { - buffer += written; - bufferSize -= written; - } - else - { - // If the startIndex is the same as the current index, this is the first - // entry to be written. It means this is the largest the buffer will - // ever get, so leave whatever has been written in place. Do however - // add a newline. - if (startIndex == i) - { - if (bufferSize >= 2) - { - buffer[bufferSize - 2] = '\n'; - buffer[bufferSize - 1] = 0; - } - return aznumeric_caster(i + 1); - } - else - { - if (bufferSize > 0) - { - // Remove whatever part has been written as it's not complete. - *buffer = 0; - } - } - return aznumeric_caster(i); - } - } - return -1; - } - - int TraceContextBufferedFormatter::PrintUuid(char* buffer, size_t bufferSize, const AZ::Uuid& uuid) - { - int written = uuid.ToString(buffer, aznumeric_caster(bufferSize), false); - if (written > 0) - { - if (bufferSize > written) - { - buffer[written - 1] = '\n'; - buffer[written] = 0; - return written + 1; - } - } - return -1; - } - -#else // AZ_ENABLE_TRACE_CONTEXT - - int TraceContextBufferedFormatter::Print(char* /*buffer*/, size_t /*bufferSize*/, - const TraceContextStackInterface& /*stack*/, bool /*printUuids*/, size_t /*startIndex*/) - { - return -1; - } - -#endif // AZ_ENABLE_TRACE_CONTEXT - } // Debug -} // AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h deleted file mode 100644 index 7de1ccfadb..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.h +++ /dev/null @@ -1,66 +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 - -namespace AZ -{ - struct Uuid; -} - -namespace AzToolsFramework -{ - namespace Debug - { - class TraceContextStackInterface; - - // TraceContexBufferedFormatter takes a trace context stack and prints it to the given buffer. - // It's aimed to be used with small to micro sized character buffers. (At least 50-100 - // characters is advised.) If the entire context couldn't be written to the buffer, Build - // can be called repeatedly with the returned index to continue printing the buffer. If a - // single context entry doesn't fit in the buffer, TraceContexBufferedFormatter will attempt - // to write as much data as can be fitted in the buffer. - // - // Typical usage looks like: - // TraceContextSingleStackHandler stackHandler; - // ... - // TraceContexBufferedFormatter buffered; - // char buffer[64]; - // int index = 0; - // do - // { - // index = buffered.Build(buffer, stackHandler.GetStack(), true, index); - // Print(buffer); - // } while (index >= 0); - // - // Example output: - // String=text - // Integer=42 - // Float=3.141500 - // Uuid=E2C7EEFA-B1CA-465F-A4BC-30514F76B7B5 - - class TraceContextBufferedFormatter - { - public: - // Prints the trace context to the given buffer, tags. - // If printUuids is true, the uuid of objects and tags is printed as well. - // Use startIndex to continue from a specific entry. - // Returns the index of the next entry to be written or -1 if no entries are left. - static int Print(char* buffer, size_t bufferSize, const TraceContextStackInterface& stack, bool printUuids, size_t startIndex = 0); - - template - static inline int Print(char(&buffer)[size], const TraceContextStackInterface& stack, bool printUuids, size_t startIndex = 0); - - private: - static int PrintUuid(char* buffer, size_t bufferSize, const AZ::Uuid& uuid); - }; - } // Debug -} // AzToolsFramework - -#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl deleted file mode 100644 index 8b4ebcbd48..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Debug/TraceContextBufferedFormatter.inl +++ /dev/null @@ -1,19 +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 - * - */ - -namespace AzToolsFramework -{ - namespace Debug - { - template - inline int TraceContextBufferedFormatter::Print(char(&buffer)[size], const TraceContextStackInterface& stack, bool printUuids, size_t startIndex) - { - return Print(buffer, size, stack, printUuids, startIndex); - } - } // Debug -} // AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index dc2ceabfcc..b96eccad18 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -105,9 +105,6 @@ set(FILES Debug/TraceContextSingleStackHandler.cpp Debug/TraceContextMultiStackHandler.h Debug/TraceContextMultiStackHandler.cpp - Debug/TraceContextBufferedFormatter.cpp - Debug/TraceContextBufferedFormatter.inl - Debug/TraceContextBufferedFormatter.h Debug/TraceContextLogFormatter.cpp Debug/TraceContextLogFormatter.h Component/EditorComponentAPIBus.h From c13ceea767aeb5e72e35cd62e6fdabfc96c7a064 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:12:16 -0800 Subject: [PATCH 126/394] Some fixes for Windows non-unity builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/ColorUtils.cpp | 1 + Code/Editor/Util/GuidUtil.h | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Code/Editor/Util/ColorUtils.cpp b/Code/Editor/Util/ColorUtils.cpp index 3ca715e021..eaaea8a2ef 100644 --- a/Code/Editor/Util/ColorUtils.cpp +++ b/Code/Editor/Util/ColorUtils.cpp @@ -8,6 +8,7 @@ // Qt #include +#include ////////////////////////////////////////////////////////////////////////// QColor ColorLinearToGamma(ColorF col) diff --git a/Code/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index f42021ae2a..762b556f44 100644 --- a/Code/Editor/Util/GuidUtil.h +++ b/Code/Editor/Util/GuidUtil.h @@ -14,7 +14,12 @@ #define CRYINCLUDE_EDITOR_UTIL_GUIDUTIL_H #pragma once -#include "AzCore/Math/Uuid.h" +#include + +#ifndef _REFGUID_DEFINED +#define _REFGUID_DEFINED +typedef const GUID& REFGUID; +#endif struct GuidUtil { From b3ba73db3bd562f30e7e7e11b77ac16d2243c956 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:12:46 -0800 Subject: [PATCH 127/394] Removing unneded include form multiple files Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Plugins/EditorAssetImporter/AssetImporterDocument.cpp | 1 - .../AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp | 1 - .../AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp | 2 +- .../UI/PropertyEditor/ThumbnailPropertyCtrl.cpp | 2 +- Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp | 1 - .../SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp | 1 - Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp | 1 - .../Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp | 1 - .../Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp | 1 - .../Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp | 1 - .../Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp | 1 - .../Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp | 1 - .../EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl | 1 - .../Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp | 1 - .../Components/TangentGenerator/TangentGenerateComponent.cpp | 2 -- 15 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp index 105a5b4954..4c65affd83 100644 --- a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp +++ b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp index 2e8e4ef639..37d0c62206 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp index 3aac294fe6..ef78543ea4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GrowTextEdit.cpp @@ -6,7 +6,7 @@ * */ -#include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: 'QRawFont::d': class 'QExplicitlySharedDataPointer' needs to have dll-interface to be used by clients of class 'QRawFont' // 4800: 'QTextEngine *const ': forcing value to bool 'true' or 'false' (performance warning) #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp index 0bbb898196..ec817f4ae1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ThumbnailPropertyCtrl.cpp @@ -6,7 +6,7 @@ * */ -#include +#include // 4251: 'QRawFont::d': class 'QExplicitlySharedDataPointer' needs to have dll-interface to be used by clients of class // 'QRawFont' 4800: 'QTextEngine *const ': forcing value to bool 'true' or 'false' (performance warning) diff --git a/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp b/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp index c98fa63916..c3b4ac2889 100644 --- a/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp +++ b/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp index 6046bfa620..5fd4dcd387 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp b/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp index 0a9fc06286..9aa9f8d1b6 100644 --- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp +++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/HeaderHandler.cpp @@ -7,7 +7,6 @@ */ #include -#include #include namespace AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp index da77df898b..2adab92d0d 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp @@ -12,7 +12,6 @@ #include #include -#include #include diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp index 911981142b..ae1088e662 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index 35a903dac0..07b48a78f1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp index e4ae782782..265b003090 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/RCExt/Actor/MorphTargetExporter.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp index f6a11e3004..70abe37817 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MorphTargetRuleBehavior.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl index 511bab83d1..6aca774f62 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Rules/ExternalToolRule.inl @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp index be916c8e3a..7c1e45e5ac 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/LODTreeSelectionHandler.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp index fdf58f2502..144638a351 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/TangentGenerator/TangentGenerateComponent.cpp @@ -27,8 +27,6 @@ #include #include -#include - #include #include From 8eebbd53a427e0744de4409c7094d10890be3afd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:03:35 -0800 Subject: [PATCH 128/394] Removes IAudioSystemMock from CryCommon Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Legacy/CryCommon/Mocks/IAudioSystemMock.h | 59 ------------------- .../CryCommon/crycommon_testing_files.cmake | 1 - .../Code/Tests/AudioSystemTest.cpp | 1 - 3 files changed, 61 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h diff --git a/Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h b/Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h deleted file mode 100644 index e93be4813f..0000000000 --- a/Code/Legacy/CryCommon/Mocks/IAudioSystemMock.h +++ /dev/null @@ -1,59 +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 - -namespace Audio -{ - struct AudioProxyMock - : public IAudioProxy - { - MOCK_METHOD2(Initialize, void(const char* const sObjectName, bool bInitAsync /* = true */)); - MOCK_METHOD0(Release, void()); - MOCK_METHOD0(Reset, void()); - MOCK_METHOD1(StopTrigger, void(TAudioControlID nTriggerID)); - MOCK_METHOD2(SetSwitchState, void(TAudioControlID nSwitchID, TAudioSwitchStateID nStateID)); - MOCK_METHOD2(SetRtpcValue, void(TAudioControlID nRtpcID, float fValue)); - MOCK_METHOD1(SetObstructionCalcType, void(EAudioObjectObstructionCalcType eObstructionType)); - MOCK_METHOD1(SetPosition, void(const SATLWorldPosition& rPosition)); - MOCK_METHOD1(SetPosition, void(const AZ::Vector3& rPosition)); - MOCK_METHOD2(SetEnvironmentAmount, void(TAudioEnvironmentID nEnvironmentID, float fAmount)); - MOCK_METHOD0(SetCurrentEnvironments, void()); - MOCK_CONST_METHOD0(GetAudioObjectID, TAudioObjectID()); - }; - - struct AudioSystemMock - : public IAudioSystem - { - MOCK_METHOD0(Initialize, bool()); - MOCK_METHOD0(Release, void()); - MOCK_METHOD1(PushRequest, void(const SAudioRequest& rAudioRequestData)); - MOCK_METHOD4(AddRequestListener, void(AudioRequestCallbackType func, void* pObjectToListenTo, EAudioRequestType requestType /* = eART_AUDIO_ALL_REQUESTS */, TATLEnumFlagsType specificRequestMask /* = ALL_AUDIO_REQUEST_SPECIFIC_TYPE_FLAGS */)); - MOCK_METHOD2(RemoveRequestListener, void(AudioRequestCallbackType func, void* pObjectToListenTo)); - MOCK_METHOD0(ExternalUpdate, void()); - MOCK_CONST_METHOD1(GetAudioTriggerID, TAudioControlID(const char* sAudioTriggerName)); - MOCK_CONST_METHOD1(GetAudioRtpcID, TAudioControlID(const char* sAudioRtpcName)); - MOCK_CONST_METHOD1(GetAudioSwitchID, TAudioControlID(const char* sAudioSwitchName)); - MOCK_CONST_METHOD2(GetAudioSwitchStateID, TAudioSwitchStateID(const TAudioControlID nSwitchID, const char* sAudioStateName)); - MOCK_CONST_METHOD1(GetAudioPreloadRequestID, TAudioPreloadRequestID(const char* sAudioPreloadRequestName)); - MOCK_CONST_METHOD1(GetAudioEnvironmentID, TAudioEnvironmentID(const char* sAudioEnvironmentName)); - MOCK_METHOD1(ReserveAudioListenerID, bool(TAudioObjectID& rAudioListenerID)); - MOCK_METHOD1(ReleaseAudioListenerID, bool(TAudioObjectID nAudioObjectID)); - MOCK_METHOD1(OnCVarChanged, void(ICVar* const pCVar)); - MOCK_METHOD1(GetInfo, void(SAudioSystemInfo& rAudioSystemInfo)); - MOCK_CONST_METHOD0(GetControlsPath, const char*()); - MOCK_METHOD0(UpdateControlsPath, void()); - MOCK_METHOD0(GetFreeAudioProxy, IAudioProxy*()); - MOCK_METHOD1(FreeAudioProxy, void(IAudioProxy* pIAudioProxy)); - MOCK_CONST_METHOD2(GetAudioControlName, const char*(EAudioControlType eAudioEntityType, TATLIDType nAudioEntityID)); - MOCK_CONST_METHOD2(GetAudioSwitchStateName, const char*(TAudioControlID switchID, TAudioSwitchStateID stateID)); - }; - -} // namespace Audio diff --git a/Code/Legacy/CryCommon/crycommon_testing_files.cmake b/Code/Legacy/CryCommon/crycommon_testing_files.cmake index 42deecd576..de7a764330 100644 --- a/Code/Legacy/CryCommon/crycommon_testing_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_testing_files.cmake @@ -7,7 +7,6 @@ # set(FILES - Mocks/IAudioSystemMock.h Mocks/IConsoleMock.h Mocks/ICryPakMock.h Mocks/ILogMock.h diff --git a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp index 14e9f74fd2..1f03eec419 100644 --- a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp +++ b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include From 4d2e4f437a6a1be91540e312609781c3c1988791 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:27:23 -0800 Subject: [PATCH 129/394] Removes ILogMock from CryCommon/Mocks Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Lib/Tests/test_EditorPythonBindings.cpp | 1 - Code/Legacy/CryCommon/Mocks/ILogMock.h | 57 ------------------- .../CryCommon/crycommon_testing_files.cmake | 1 - 3 files changed, 59 deletions(-) delete mode 100644 Code/Legacy/CryCommon/Mocks/ILogMock.h diff --git a/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp b/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp index 49b65f7ffc..0c5e221d21 100644 --- a/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp +++ b/Code/Editor/Lib/Tests/test_EditorPythonBindings.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "IEditorMock.h" diff --git a/Code/Legacy/CryCommon/Mocks/ILogMock.h b/Code/Legacy/CryCommon/Mocks/ILogMock.h deleted file mode 100644 index ac2ba7f32c..0000000000 --- a/Code/Legacy/CryCommon/Mocks/ILogMock.h +++ /dev/null @@ -1,57 +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 - -class LogMock - : public ILog -{ -public: - MOCK_METHOD3(LogV, - void(ELogType nType, const char* szFormat, va_list args)); - MOCK_METHOD4(LogV, - void(ELogType nType, int flags, const char* szFormat, va_list args)); - MOCK_METHOD0(Release, - void()); - MOCK_METHOD2(SetFileName, - bool(const char* fileNameOrFullPath, bool doBackups)); - MOCK_METHOD0(GetFileName, - const char*()); - MOCK_METHOD0(GetBackupFileName, - const char*()); - - virtual void Log([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogWarning([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogError([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogAlways([[maybe_unused]] const char* szCommand, ...) override {} - virtual void LogPlus([[maybe_unused]] const char* command, ...) override {} - virtual void LogToFile([[maybe_unused]] const char* command, ...) override {} - virtual void LogToFilePlus([[maybe_unused]] const char* command, ...) override {} - virtual void LogToConsole([[maybe_unused]] const char* command, ...) override {} - virtual void LogToConsolePlus([[maybe_unused]] const char* command, ...) override {} - virtual void UpdateLoadingScreen([[maybe_unused]] const char* command, ...) override {} - - MOCK_METHOD1(SetVerbosity, - void(int verbosity)); - MOCK_METHOD0(GetVerbosityLevel, - int()); - MOCK_METHOD1(AddCallback, - void(ILogCallback * pCallback)); - MOCK_METHOD1(RemoveCallback, - void(ILogCallback * pCallback)); - MOCK_METHOD0(Update, - void()); - MOCK_METHOD0(GetModuleFilter, - const char*()); - MOCK_METHOD1(Indent, - void(class CLogIndenter * indenter)); - MOCK_METHOD1(Unindent, - void(class CLogIndenter * indenter)); - MOCK_METHOD0(FlushAndClose, - void()); -}; diff --git a/Code/Legacy/CryCommon/crycommon_testing_files.cmake b/Code/Legacy/CryCommon/crycommon_testing_files.cmake index de7a764330..5131e162f6 100644 --- a/Code/Legacy/CryCommon/crycommon_testing_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_testing_files.cmake @@ -9,7 +9,6 @@ set(FILES Mocks/IConsoleMock.h Mocks/ICryPakMock.h - Mocks/ILogMock.h Mocks/ISystemMock.h Mocks/ICVarMock.h ) From ef97c2d3b8327cc4391ebccfc738d367b37ab718 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:46:22 -0800 Subject: [PATCH 130/394] Removes XMLBinaryWriter from CrySystem Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp | 284 ------------------ Code/Legacy/CrySystem/XML/XMLBinaryWriter.h | 53 ---- Code/Legacy/CrySystem/XML/XmlUtils.cpp | 1 - .../XML/crysystem_xmlbinary_files.cmake | 2 - 4 files changed, 340 deletions(-) delete mode 100644 Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp delete mode 100644 Code/Legacy/CrySystem/XML/XMLBinaryWriter.h diff --git a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp b/Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp deleted file mode 100644 index 63bf4adef2..0000000000 --- a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.cpp +++ /dev/null @@ -1,284 +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 "XMLBinaryWriter.h" -#include "CryEndian.h" -#include // memcpy() - -////////////////////////////////////////////////////////////////////////// -XMLBinary::CXMLBinaryWriter::CXMLBinaryWriter() -{ - m_nStringDataSize = 0; -} - -static void align(size_t& nPosition, const size_t nAlignment) -{ - const size_t nPadSize = ((nPosition + (nAlignment - 1)) & ~(nAlignment - 1)) - nPosition; - nPosition += nPadSize; -} - -static void alignWrite(XMLBinary::IDataWriter* const pFile, size_t& nPosition, const size_t nAlignment) -{ - size_t nPadSize = ((nPosition + (nAlignment - 1)) & ~(nAlignment - 1)) - nPosition; - - if (nPadSize > 0) - { - nPosition += nPadSize; - - static const char zeroes[32] = { 0 }; - - while (nPadSize > 0) - { - const size_t n = (nPadSize <= sizeof(zeroes)) ? nPadSize : sizeof(zeroes); - nPadSize -= n; - pFile->Write(zeroes, n); - } - } -} - -static void write(XMLBinary::IDataWriter* const pFile, size_t& nPosition, const void* const pData, const size_t nDataSize) -{ - pFile->Write(pData, nDataSize); - nPosition += nDataSize; -} - -////////////////////////////////////////////////////////////////////////// -bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - error = ""; - - // Scan the node tree, building a flat node list, attribute list and string table. - m_nStringDataSize = 0; - - if (!CompileTables(node, pFilter, error)) - { - return false; - } - - static const uint nMaxNodeCount = (NodeIndex) ~0; - if (m_nodes.size() > nMaxNodeCount) - { - error = AZStd::string::format("XMLBinary: Too many nodes: %zu (max is %i)", m_nodes.size(), nMaxNodeCount); - return false; - } - - // Initialize the file header. - size_t nTheoreticalPosition = 0; - static const size_t nAlignment = sizeof(uint32); - - BinaryFileHeader header; - static const char signature[] = "CryXmlB"; - static_assert(sizeof(signature) == sizeof(header.szSignature)); - memcpy(header.szSignature, signature, sizeof(header.szSignature)); - nTheoreticalPosition += sizeof(header); - align(nTheoreticalPosition, nAlignment); - - header.nNodeTablePosition = static_cast(nTheoreticalPosition); - header.nNodeCount = int(m_nodes.size()); - nTheoreticalPosition += header.nNodeCount * sizeof(Node); - align(nTheoreticalPosition, nAlignment); - - header.nChildTablePosition = static_cast(nTheoreticalPosition); - header.nChildCount = int(m_childs.size()); - nTheoreticalPosition += header.nChildCount * sizeof(NodeIndex); - align(nTheoreticalPosition, nAlignment); - - header.nAttributeTablePosition = static_cast(nTheoreticalPosition); - header.nAttributeCount = int(m_attributes.size()); - nTheoreticalPosition += header.nAttributeCount * sizeof(Attribute); - align(nTheoreticalPosition, nAlignment); - - header.nStringDataPosition = static_cast(nTheoreticalPosition); - header.nStringDataSize = m_nStringDataSize; - nTheoreticalPosition += header.nStringDataSize; - - header.nXMLSize = static_cast(nTheoreticalPosition); - - // Write file - { - nTheoreticalPosition = 0; - - // Write out the file header. - write(pFile, nTheoreticalPosition, &header, sizeof(header)); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - - // Write out the node table. - if (!m_nodes.empty()) - { - write(pFile, nTheoreticalPosition, &m_nodes[0], sizeof(m_nodes[0]) * m_nodes.size()); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - } - - // Write out the children table. - if (!m_childs.empty()) - { - write(pFile, nTheoreticalPosition, &m_childs[0], sizeof(m_childs[0]) * m_childs.size()); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - } - - // Write out the attribute table. - if (!m_attributes.empty()) - { - write(pFile, nTheoreticalPosition, &m_attributes[0], sizeof(m_attributes[0]) * m_attributes.size()); - alignWrite(pFile, nTheoreticalPosition, nAlignment); - } - - // Write out the data of all the m_strings. - for (size_t nString = 0; nString < m_strings.size(); ++nString) - { - pFile->Write(m_strings[nString].c_str(), m_strings[nString].size() + 1); - } - } - - return true; -} - -bool XMLBinary::CXMLBinaryWriter::CompileTables(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - bool ok = CompileTablesForNode(node, -1, pFilter, error); - ok = ok && CompileChildTable(node, pFilter, error); - return ok; -} - -////////////////////////////////////////////////////////////////////////// -bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nParentIndex, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - // Add the tag to the string table. - int nTagStringOffset = AddString(node->getTag()); - - // Add the content string to the string table. - int nContentStringOffset = AddString(node->getContent()); - - // Add all the attributes to the attributes table. - const char* szKey; - const char* szValue; - const int nFirstAttributeIndex = int(m_attributes.size()); - for (int i = 0, attrCount = node->getNumAttributes(); i < attrCount; ++i) - { - if (node->getAttributeByIndex(i, &szKey, &szValue) && - (!pFilter || pFilter->IsAccepted(IFilter::eType_AttributeName, szKey))) - { - // Add the key and the value to the string table. - Attribute attribute; - attribute.nKeyStringOffset = AddString(szKey); - attribute.nValueStringOffset = AddString(szValue); - - // Add the attribute to the attribute table. - m_attributes.push_back(attribute); - } - } - const int nAttributeCount = int(m_attributes.size()) - nFirstAttributeIndex; - - static const int nMaxAttributeCount = (uint16) ~0; - if (nAttributeCount > nMaxAttributeCount) - { - error = AZStd::string::format("XMLBinary: Too many attributes in a node: %d (max is %i)", nAttributeCount, nMaxAttributeCount); - return false; - } - - // Add ourselves to the node list. - const int nIndex = int(m_nodes.size()); - { - Node nd; - memset(&nd, 0, sizeof(nd)); - nd.nTagStringOffset = nTagStringOffset; - nd.nContentStringOffset = nContentStringOffset; - nd.nParentIndex = nParentIndex; - nd.nFirstAttributeIndex = nFirstAttributeIndex; - nd.nAttributeCount = static_cast(nAttributeCount); - - m_nodes.push_back(nd); - } - - m_nodesMap.insert(NodesMap::value_type(node, nIndex)); - - // Recurse to the child nodes. - int nChildCount = 0; - static const int nMaxChildCount = (uint16) ~0; - for (int nChild = 0, numChilds = node->getChildCount(); nChild < numChilds; ++nChild) - { - XmlNodeRef childNode = node->getChild(nChild); - if (!pFilter || pFilter->IsAccepted(IFilter::eType_ElementName, childNode->getTag())) - { - if (++nChildCount > nMaxChildCount) - { - error = AZStd::string::format("XMLBinary: Too many children in node '%s': %d (max is %i)", childNode->getTag(), nChildCount, nMaxChildCount); - return false; - } - if (!CompileTablesForNode(childNode, nIndex, pFilter, error)) - { - return false; - } - } - } - - m_nodes[nIndex].nChildCount = static_cast(nChildCount); - - return true; -} - -////////////////////////////////////////////////////////////////////////// -bool XMLBinary::CXMLBinaryWriter::CompileChildTable(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error) -{ - const int nIndex = m_nodesMap.find(node)->second; // Assume node always exist in map. - const int nFirstChildIndex = (int)m_childs.size(); - - Node& nd = m_nodes[nIndex]; - nd.nFirstChildIndex = nFirstChildIndex; - - int nChildCount = 0; - for (int nChild = 0, numChilds = node->getChildCount(); nChild < numChilds; ++nChild) - { - XmlNodeRef childNode = node->getChild(nChild); - if (!pFilter || pFilter->IsAccepted(IFilter::eType_ElementName, childNode->getTag())) - { - ++nChildCount; - const int nChildIndex = m_nodesMap.find(childNode)->second; // Assume node always exist in map. - m_childs.push_back(nChildIndex); - } - } - if (nChildCount != nd.nChildCount) - { - error = AZStd::string::format("XMLBinary: Internal error in CompileChildTable()"); - return false; - } - - // Recurse to the child nodes. - for (int nChild = 0, numChilds = node->getChildCount(); nChild < numChilds; ++nChild) - { - XmlNodeRef childNode = node->getChild(nChild); - if (!pFilter || pFilter->IsAccepted(IFilter::eType_ElementName, childNode->getTag())) - { - if (!CompileChildTable(childNode, pFilter, error)) - { - return false; - } - } - } - - return true; -} - -////////////////////////////////////////////////////////////////////////// -int XMLBinary::CXMLBinaryWriter::AddString(const XmlString& sString) -{ - // If we have such string already, then we will re-use its data. - StringMap::const_iterator itStringEntry = m_stringMap.find(sString); - if (itStringEntry == m_stringMap.end()) - { - // We don't have such string yet, so we should add it to the tables. - m_strings.push_back(sString); - itStringEntry = m_stringMap.insert(StringMap::value_type(sString, m_nStringDataSize)).first; - m_nStringDataSize += static_cast(sString.length() + 1); - } - - // Return offset of the string in the string data buffer. - return (*itStringEntry).second; -} diff --git a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.h b/Code/Legacy/CrySystem/XML/XMLBinaryWriter.h deleted file mode 100644 index 4b0d19fe26..0000000000 --- a/Code/Legacy/CrySystem/XML/XMLBinaryWriter.h +++ /dev/null @@ -1,53 +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 - * - */ - - -#ifndef CRYINCLUDE_CRYSYSTEM_XML_XMLBINARYWRITER_H -#define CRYINCLUDE_CRYSYSTEM_XML_XMLBINARYWRITER_H -#pragma once - - -#include "IXml.h" -#include "XMLBinaryHeaders.h" -#include -#include - -class IXMLDataSink; - -namespace XMLBinary -{ - class CXMLBinaryWriter - { - public: - CXMLBinaryWriter(); - bool WriteNode(IDataWriter* pFile, XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string & error); - - private: - bool CompileTables(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error); - - bool CompileTablesForNode(XmlNodeRef node, int nParentIndex, XMLBinary::IFilter* pFilter, AZStd::string& error); - bool CompileChildTable(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error); - int AddString(const XmlString& sString); - - private: - // tables. - typedef std::map NodesMap; - typedef std::map StringMap; - - std::vector m_nodes; - NodesMap m_nodesMap; - std::vector m_attributes; - std::vector m_childs; - std::vector m_strings; - StringMap m_stringMap; - - uint m_nStringDataSize; - }; -} - -#endif // CRYINCLUDE_CRYSYSTEM_XML_XMLBINARYWRITER_H diff --git a/Code/Legacy/CrySystem/XML/XmlUtils.cpp b/Code/Legacy/CrySystem/XML/XmlUtils.cpp index 26d6f2336b..1eae548dfd 100644 --- a/Code/Legacy/CrySystem/XML/XmlUtils.cpp +++ b/Code/Legacy/CrySystem/XML/XmlUtils.cpp @@ -16,7 +16,6 @@ #include "SerializeXMLReader.h" #include "SerializeXMLWriter.h" -#include "XMLBinaryWriter.h" #include "XMLBinaryReader.h" #include diff --git a/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake b/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake index 14931fdec1..72d83b5344 100644 --- a/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake +++ b/Code/Legacy/CrySystem/XML/crysystem_xmlbinary_files.cmake @@ -11,6 +11,4 @@ set(FILES XMLBinaryNode.h XMLBinaryReader.cpp XMLBinaryReader.h - XMLBinaryWriter.cpp - XMLBinaryWriter.h ) From fc30667795ed8bd6f1108abb5d9c89d0ec07438e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:04:03 -0800 Subject: [PATCH 131/394] Removes ThumbnailDelegate from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Thumbnails/ThumbnailDelegate.h | 48 ------------------- .../Thumbnails/ThumbnailWidget.h | 2 +- 2 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h deleted file mode 100644 index d21b6d7699..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailDelegate.h +++ /dev/null @@ -1,48 +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 - -class QWidget; -class QPainter; -class QStyleOptionViewItem; -class QAbstractItemModel; -class QModelIndex; - -namespace AzToolsFramework -{ - namespace Thumbnailer - { - //! Thumbnail delegate can be used as within item views to draw thumbnails - class ThumbnailDelegate - : public QStyledItemDelegate - { - Q_OBJECT - public: - explicit ThumbnailDelegate(QWidget* parent = nullptr); - ~ThumbnailDelegate() override; - - ////////////////////////////////////////////////////////////////////////// - // QStyledItemDelegate - ////////////////////////////////////////////////////////////////////////// - void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; - QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override; - void setEditorData(QWidget* editor, const QModelIndex& index) const override; - void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; - //! Set location where thumbnails are searched - void SetThumbnailContext(const char* thumbnailContext); - - private: - AZStd::string m_thumbnailContext; - }; - } // namespace Thumbnailer -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h index 0674726155..6dab575af5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailWidget.h @@ -22,7 +22,7 @@ namespace AzToolsFramework { namespace Thumbnailer { - //! A widget used to display thumbnail. To display thumbnails within item views, use ThumbnailDelegate + //! A widget used to display thumbnail class ThumbnailWidget : public QWidget { From 9aa2cbeabac2f28011420ec2c5c685bc5f3a8c58 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:44:18 -0800 Subject: [PATCH 132/394] Removes EditorOutlinerComponent from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ToolsComponents/EditorOutlinerComponent.h | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h deleted file mode 100644 index 196f0931e0..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorOutlinerComponent.h +++ /dev/null @@ -1,7 +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 - * - */ From f8f9b79f7c0c01903fee2304b252f34ecfb31fdd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:45:59 -0800 Subject: [PATCH 133/394] Removes ToolFileUtils_generic.cpp from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ToolsFileUtils/ToolsFileUtils_generic.cpp | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp deleted file mode 100644 index 8357a265ba..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp +++ /dev/null @@ -1,47 +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 "ToolsFileUtils.h" -#include -#include - -#include - -namespace AzToolsFramework -{ - namespace ToolsFileUtils - { - bool SetModificationTime(const char* const filename, AZ::u64 modificationTime) - { - struct stat statResult; - if (stat(filename, &statResult) != 0) - { - return false; - } - - struct utimbuf puttime; - puttime.modtime = modificationTime; - puttime.actime = static_cast(statResult.st_ctime); - - if (utime(filename, &puttime) == 0) - { - return true; - } - - return false; - } - - bool GetFreeDiskSpace(const QString& path, qint64& outFreeDiskSpace) - { - QStorageInfo storageInfo(path); - outFreeDiskSpace = storageInfo.bytesFree(); - - return outFreeDiskSpace >= 0; - } - } -} From 643bc70c1e1c5fa13a1f53f250d716230b294817 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:52:12 -0800 Subject: [PATCH 134/394] Remove ComponentPaletteModelFilter from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ComponentPaletteModelFilter.cpp | 53 ------------------- .../ComponentPaletteModelFilter.hxx | 29 ---------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 84 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp deleted file mode 100644 index abc66d1a66..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.cpp +++ /dev/null @@ -1,53 +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 "ComponentPaletteModelFilter.hxx" -#include - -namespace AzToolsFramework -{ - - ComponentPaletteModelFilter::ComponentPaletteModelFilter(QObject* parent) - : QSortFilterProxyModel(parent) - { - } - - bool ComponentPaletteModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const - { - const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); - if (!index.isValid()) - { - return false; - } - - if (!filterRegExp().isValid()) - { - return true; - } - - auto componentClass = reinterpret_cast(sourceModel()->data(index, Qt::ItemDataRole::UserRole + 1).toULongLong()); - if (componentClass) - { - const QString componentName = sourceModel()->data(index, Qt::DisplayRole).toString(); - return componentName.contains(filterRegExp()); - } - - const int childRowCount = sourceModel()->rowCount(index); - for (int childRow = 0; childRow < childRowCount; ++childRow) - { - if (filterAcceptsRow(childRow, index)) - { - return true; - } - } - - return false; - } -} - -#include "UI/ComponentPalette/moc_ComponentPaletteModelFilter.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx deleted file mode 100644 index 19a6c72fe9..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteModelFilter.hxx +++ /dev/null @@ -1,29 +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 - -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace AzToolsFramework -{ - class ComponentPaletteModelFilter : public QSortFilterProxyModel - { - Q_OBJECT - - public: - ComponentPaletteModelFilter(QObject* parent = nullptr); - - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; - - protected: - QRegExp m_filterRegExp; - }; -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index b96eccad18..b28a62a27f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -356,8 +356,6 @@ set(FILES UI/ComponentPalette/ComponentPaletteWidget.cpp UI/ComponentPalette/ComponentPaletteModel.hxx UI/ComponentPalette/ComponentPaletteModel.cpp - UI/ComponentPalette/ComponentPaletteModelFilter.hxx - UI/ComponentPalette/ComponentPaletteModelFilter.cpp UI/ComponentPalette/ComponentPaletteUtil.hxx UI/ComponentPalette/ComponentPaletteUtil.cpp UI/Layer/NameConflictWarning.hxx From e2091f245130b61caa4170cce0c4a51f7deeaf2e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 12:15:20 -0800 Subject: [PATCH 135/394] Removes UIFrameworkAPI.cpp from AzToolsFramework Removes aztoolsframework_win_files.cmake (aztoolsframework_windows_files.cmake is the actual used one) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/LegacyFramework/UIFrameworkAPI.cpp | 67 ------------------- .../aztoolsframework_win_files.cmake | 34 ---------- .../aztoolsframework_windows_files.cmake | 1 - 3 files changed, 102 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp deleted file mode 100644 index e4192b6a90..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/UIFrameworkAPI.cpp +++ /dev/null @@ -1,67 +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 "UIFrameworkAPI.h" -#include -#include - -#ifdef Q_OS_WIN -# include -#endif - -#include - -#include -#include - -namespace AzToolsFramework -{ - namespace - { - // an aggregator utility which essentially provides the operation of returning the last result of an ebus event - // which returned something which returns a non-false value (like for example if its a pointer, then the last non-null value) - template - struct EBusLastNonNullResult - { - T value; - EBusLastNonNullResult() { value = NULL; } - AZ_FORCE_INLINE void operator=(const T& rhs) - { - if (rhs) - { - value = rhs; - } - } - AZ_FORCE_INLINE T& operator->() { return value; } - }; - - template - struct EBusAnyTrueResult - { - T value; - AZ_FORCE_INLINE void operator=(const T& rhs) { value = rhs || value; } - AZ_FORCE_INLINE T& operator->() { return value; } - }; - } - - bool GetOverwritePromptResult(QWidget* pParentWidget, const char* assetNameToOvewrite) - { - OverwritePromptDialog dlg(pParentWidget); - if (assetNameToOvewrite) - { - dlg.UpdateLabel(QString::fromUtf8(assetNameToOvewrite)); - } - - if (!dlg.exec() == QDialog::Accepted) - { - return false; - } - - return dlg.m_result; - } -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake deleted file mode 100644 index 5f3ff425fa..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_win_files.cmake +++ /dev/null @@ -1,34 +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 -# -# - -set(FILES - UI/LegacyFramework/MainWindowSavedState.h - UI/LegacyFramework/MainWindowSavedState.cpp - UI/LegacyFramework/UIFramework.hxx - UI/LegacyFramework/UIFramework.cpp - UI/LegacyFramework/UIFrameworkAPI.h - UI/LegacyFramework/UIFrameworkAPI.cpp - UI/LegacyFramework/UIFrameworkPreferences.cpp - UI/LegacyFramework/Resources/sharedResources.qrc - UI/LegacyFramework/Core/EditorContextBus.h - UI/LegacyFramework/Core/EditorFrameworkAPI.h - UI/LegacyFramework/Core/EditorFrameworkAPI.cpp - UI/LegacyFramework/Core/EditorFrameworkApplication.h - UI/LegacyFramework/Core/EditorFrameworkApplication.cpp - UI/LegacyFramework/Core/IPCComponent.h - UI/LegacyFramework/Core/IPCComponent.cpp - UI/LegacyFramework/CustomMenus/CustomMenusAPI.h - UI/LegacyFramework/CustomMenus/CustomMenusComponent.cpp - UI/UICore/OverwritePromptDialog.hxx - UI/UICore/OverwritePromptDialog.cpp - UI/UICore/OverwritePromptDialog.ui - UI/UICore/SaveChangesDialog.hxx - UI/UICore/SaveChangesDialog.cpp - UI/UICore/SaveChangesDialog.ui - ToolsFileUtils/ToolsFileUtils_win.cpp -) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake index 5f3ff425fa..67b93a5100 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_windows_files.cmake @@ -12,7 +12,6 @@ set(FILES UI/LegacyFramework/UIFramework.hxx UI/LegacyFramework/UIFramework.cpp UI/LegacyFramework/UIFrameworkAPI.h - UI/LegacyFramework/UIFrameworkAPI.cpp UI/LegacyFramework/UIFrameworkPreferences.cpp UI/LegacyFramework/Resources/sharedResources.qrc UI/LegacyFramework/Core/EditorContextBus.h From 234ff3dca26b20fc7d297cdc45aa51240ebc0447 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:06:37 -0800 Subject: [PATCH 136/394] Removes DHQSlider from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/PropertyEditor/DHQSlider.cpp | 56 ------------------- .../UI/PropertyEditor/DHQSlider.hxx | 42 -------------- .../PropertyDoubleSliderCtrl.cpp | 1 - .../PropertyEditor/PropertyIntSliderCtrl.cpp | 1 - .../aztoolsframework_files.cmake | 2 - 5 files changed, 102 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp deleted file mode 100644 index 76cc168a69..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.cpp +++ /dev/null @@ -1,56 +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 "DHQSlider.hxx" -#include "PropertyQTConstants.h" -#include -AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option") // 4244: conversion from 'int' to 'float', possible loss of data - // 4251: 'QInputEvent::modState': class 'QFlags' needs to have dll-interface to be used by clients of class 'QInputEvent' -#include -AZ_POP_DISABLE_WARNING - -namespace AzToolsFramework -{ - void DHQSlider::wheelEvent(QWheelEvent* e) - { - if (hasFocus()) - { - QSlider::wheelEvent(e); - } - else - { - e->ignore(); - } - } - - void InitializeSliderPropertyWidgets(QSlider* slider, QAbstractSpinBox* spinbox) - { - if (slider == nullptr || spinbox == nullptr) - { - return; - } - - // A 2:1 ratio between spinbox and slider gives the slider more room, - // but leaves some space for the spin box to expand. - const int spinBoxStretch = 1; - const int sliderStretch = 2; - - QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(spinBoxStretch); - spinbox->setSizePolicy(sizePolicy); - spinbox->setMinimumWidth(PropertyQTConstant_MinimumWidth); - spinbox->setFixedHeight(PropertyQTConstant_DefaultHeight); - spinbox->setFocusPolicy(Qt::StrongFocus); - - sizePolicy.setHorizontalStretch(sliderStretch); - slider->setSizePolicy(sizePolicy); - slider->setMinimumWidth(PropertyQTConstant_MinimumWidth); - slider->setFixedHeight(PropertyQTConstant_DefaultHeight); - slider->setFocusPolicy(Qt::StrongFocus); - slider->setFocusProxy(spinbox); - } -} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx deleted file mode 100644 index 01aeed0300..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/DHQSlider.hxx +++ /dev/null @@ -1,42 +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 - * - */ - -#ifndef AZ_Q_SLIDER_HXX -#define AZ_Q_SLIDER_HXX - -#include -#include -#include - - -#pragma once - -class QAbstractSpinBox; - -namespace AzToolsFramework -{ - class DHQSlider - : public QSlider - { - public: - AZ_CLASS_ALLOCATOR(DHQSlider, AZ::SystemAllocator, 0); - - explicit DHQSlider(QWidget* parent = 0) - : QSlider(parent) {} - - DHQSlider(Qt::Orientation orientation, QWidget* parent = 0) - : QSlider(orientation, parent) {} - - void wheelEvent(QWheelEvent* e); - }; - - // Share widget initialization code between double and int based slider properties. - void InitializeSliderPropertyWidgets(QSlider*, QAbstractSpinBox*); -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp index 64ba3b604b..cac6b6867b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp @@ -7,7 +7,6 @@ */ #include #include "PropertyDoubleSliderCtrl.hxx" -#include "DHQSlider.hxx" #include "PropertyQTConstants.h" AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp index 5fa767d060..7d544cd4f0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntSliderCtrl.cpp @@ -6,7 +6,6 @@ * */ #include "PropertyIntSliderCtrl.hxx" -#include "DHQSlider.hxx" #include "PropertyQTConstants.h" #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index b28a62a27f..460c47aa81 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -368,8 +368,6 @@ set(FILES UI/PropertyEditor/QtWidgetLimits.h UI/PropertyEditor/DHQComboBox.hxx UI/PropertyEditor/DHQComboBox.cpp - UI/PropertyEditor/DHQSlider.hxx - UI/PropertyEditor/DHQSlider.cpp UI/PropertyEditor/EntityIdQLabel.hxx UI/PropertyEditor/EntityIdQLabel.cpp UI/PropertyEditor/EntityIdQLineEdit.h From 6b457567c7c691009cd90bb376698df1a3a6ced9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:23:17 -0800 Subject: [PATCH 137/394] Removes PropertyEditor_UITypes.h from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../PropertyEditor/PropertyEditor_UITypes.h | 346 ------------------ .../aztoolsframework_files.cmake | 1 - 2 files changed, 347 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h deleted file mode 100644 index 2d6d4239ef..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditor_UITypes.h +++ /dev/null @@ -1,346 +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 - * - */ -#ifndef PROPERTYEDITOR_UITYPES_H -#define PROPERTYEDITOR_UITYPES_H - -#include -#include -#include "PropertyEditor/EditorClassReflectionTest.h" - -#pragma once - -namespace AzToolsFramework -{ - namespace PropertySystem - { - typedef AZStd::function < void(const AZStd::string& FieldName, AZStd::vector& dEnumNames) > - EnumNamesCallback; - - class EditorUIInfo_Enum - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Enum, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Enum, AZ::SystemAllocator, 0); - - EnumNamesCallback m_enumNamesCallBack; - - EditorUIInfo_Enum(EnumNamesCallback enumNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_enumNamesCallBack(enumNamesCallBack) - { - } - }; - - class EditorUIInfo_EnumComboBox - : public EditorUIInfo_Enum - { - public: - AZ_RTTI(EditorUIInfo_EnumComboBox, EditorUIInfo_Enum); - AZ_CLASS_ALLOCATOR(EditorUIInfo_EnumComboBox, AZ::SystemAllocator, 0); - - EditorUIInfo_EnumComboBox(EnumNamesCallback enumNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo_Enum(enumNamesCallBack, inFlags) - { - } - }; - - typedef AZStd::function < void(const AZStd::string& FieldName, AZStd::vector& dEnumNames) > - ChoiceNamesCallback; - - class EditorUIInfo_Choice - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Choice, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Choice, AZ::SystemAllocator, 0); - - ChoiceNamesCallback m_choiceNamesCallBack; - - EditorUIInfo_Choice(ChoiceNamesCallback choiceNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_choiceNamesCallBack(choiceNamesCallBack) - { - } - }; - - class EditorUIInfo_ChoiceComboBox - : public EditorUIInfo_Choice - { - public: - AZ_RTTI(EditorUIInfo_ChoiceComboBox, EditorUIInfo_Choice); - AZ_CLASS_ALLOCATOR(EditorUIInfo_ChoiceComboBox, AZ::SystemAllocator, 0); - - EditorUIInfo_ChoiceComboBox(ChoiceNamesCallback choiceNamesCallBack, AZ::u32 inFlags = 0) - : EditorUIInfo_Choice(choiceNamesCallBack, inFlags) - { - } - }; - - class EditorUIInfo_Bool - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Bool, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Bool, AZ::SystemAllocator, 0); - - EditorUIInfo_Bool(AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - { - } - }; - - class EditorUIInfo_BoolComboBox - : public EditorUIInfo_Bool - { - public: - AZ_RTTI(EditorUIInfo_BoolComboBox, EditorUIInfo_Bool); - AZ_CLASS_ALLOCATOR(EditorUIInfo_BoolComboBox, AZ::SystemAllocator, 0); - - EditorUIInfo_BoolComboBox(AZ::u32 inFlags = 0) - : EditorUIInfo_Bool(inFlags) - { - } - }; - - class EditorUIInfo_BoolDialogBox - : public EditorUIInfo_Bool - { - public: - AZ_RTTI(EditorUIInfo_BoolDialogBox, EditorUIInfo_Bool); - AZ_CLASS_ALLOCATOR(EditorUIInfo_BoolDialogBox, AZ::SystemAllocator, 0); - - EditorUIInfo_BoolDialogBox(AZ::u32 inFlags = 0) - : EditorUIInfo_Bool(inFlags) - { - } - }; - - - class EditorUIInfo_Int - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Int, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Int, AZ::SystemAllocator, 0); - - int m_minVal; - int m_maxVal; - - EditorUIInfo_Int(int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_minVal(minVal) - , m_maxVal(maxVal) - { - } - }; - - class EditorUIInfo_IntSpinBox - : public EditorUIInfo_Int - { - public: - AZ_RTTI(EditorUIInfo_IntSpinBox, EditorUIInfo_Int); - AZ_CLASS_ALLOCATOR(EditorUIInfo_IntSpinBox, AZ::SystemAllocator, 0); - - EditorUIInfo_IntSpinBox(int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Int(minVal, maxVal, inFlags) - { - } - }; - - class EditorUIInfo_IntSlider - : public EditorUIInfo_Int - { - public: - AZ_RTTI(EditorUIInfo_IntSlider, EditorUIInfo_Int); - AZ_CLASS_ALLOCATOR(EditorUIInfo_IntSlider, AZ::SystemAllocator, 0); - - int m_step; - - EditorUIInfo_IntSlider(int step = 1, int minVal = INT_MIN, int maxVal = INT_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Int(minVal, maxVal, inFlags) - , m_step(step) - { - } - }; - - class EditorUIInfo_Float - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Float, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Float, AZ::SystemAllocator, 0); - - float m_minVal; - float m_maxVal; - - EditorUIInfo_Float(float minVal = std::numeric_limits::min(), float maxVal = std::numeric_limits::max(), AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_minVal(minVal) - , m_maxVal(maxVal) - { - } - }; - - class EditorUIInfo_FloatSpinBox - : public EditorUIInfo_Float - { - public: - AZ_RTTI(EditorUIInfo_FloatSpinBox, EditorUIInfo_Float); - AZ_CLASS_ALLOCATOR(EditorUIInfo_FloatSpinBox, AZ::SystemAllocator, 0); - - EditorUIInfo_FloatSpinBox(float minVal = std::numeric_limits::min(), float maxVal = std::numeric_limits::max(), AZ::u32 inFlags = 0) - : EditorUIInfo_Float(minVal, maxVal, inFlags) - { - } - }; - - class EditorUIInfo_FloatSlider - : public EditorUIInfo_Float - { - public: - AZ_RTTI(EditorUIInfo_FloatSlider, EditorUIInfo_Float); - AZ_CLASS_ALLOCATOR(EditorUIInfo_FloatSlider, AZ::SystemAllocator, 0); - - float m_step; - - EditorUIInfo_FloatSlider(float step = 1.f, float minVal = std::numeric_limits::min(), float maxVal = std::numeric_limits::max(), AZ::u32 inFlags = 0) - : EditorUIInfo_Float(minVal, maxVal, inFlags) - , m_step(step) - { - } - }; - - class EditorUIInfo_Double - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Double, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Double, AZ::SystemAllocator, 0); - - double m_minVal; - double m_maxVal; - - EditorUIInfo_Double(double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_minVal(minVal) - , m_maxVal(maxVal) - { - } - }; - - class EditorUIInfo_DoubleSpinBox - : public EditorUIInfo_Double - { - public: - AZ_RTTI(EditorUIInfo_DoubleSpinBox, EditorUIInfo_Double); - AZ_CLASS_ALLOCATOR(EditorUIInfo_DoubleSpinBox, AZ::SystemAllocator, 0); - - EditorUIInfo_DoubleSpinBox(double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Double(minVal, maxVal, inFlags) - { - } - }; - - class EditorUIInfo_DoubleSlider - : public EditorUIInfo_Double - { - public: - AZ_RTTI(EditorUIInfo_DoubleSlider, EditorUIInfo_Double); - AZ_CLASS_ALLOCATOR(EditorUIInfo_DoubleSlider, AZ::SystemAllocator, 0); - - double m_step; - - EditorUIInfo_DoubleSlider(double step = 1.0, double minVal = DBL_MIN, double maxVal = DBL_MAX, AZ::u32 inFlags = 0) - : EditorUIInfo_Double(minVal, maxVal, inFlags) - , m_step(step) - { - } - }; - - class EditorUIInfo_String - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_String, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_String, AZ::SystemAllocator, 0); - - int m_maxChars; - - EditorUIInfo_String(int maxchars = -1, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_maxChars(maxchars) - { - } - }; - - class EditorUIInfo_StringLineEdit - : public EditorUIInfo_String - { - public: - AZ_RTTI(EditorUIInfo_StringLineEdit, EditorUIInfo_String); - AZ_CLASS_ALLOCATOR(EditorUIInfo_StringLineEdit, AZ::SystemAllocator, 0); - - EditorUIInfo_StringLineEdit(int maxchars = -1, AZ::u32 inFlags = 0) - : EditorUIInfo_String(maxchars, inFlags) - { - } - }; - - typedef AZStd::function DropListInfoCallback; - - class EditorUIInfo_DropdownList - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_DropdownList, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_DropdownList, AZ::SystemAllocator, 0); - EditorUIInfo_DropdownList(DropListInfoCallback info, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - { - } - }; - - // this function, if you supply it, will be called by the UI and other system to determine whether or not to show - // your property at all. This allows you to make properties which only show up when certain other properties are set. - typedef AZStd::function < bool(const AZStd::string& /*property name*/, void* /* propertyOwner */, const EditorDataContext::ToolsComponentInfo* /* component info */) > - GroupDisplayBooleanFunction; - - // a group is special in that it has children and uses a function to determine what to write for the group and whether to show the group - class EditorUIInfo_Group - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Group, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Group, AZ::SystemAllocator, 0); - EditorUIInfo_Group(GroupDisplayBooleanFunction displayBoolFn = 0, AZ::u32 inFlags = 0) - : EditorUIInfo(inFlags) - , m_displayBoolFn(displayBoolFn) - { - } - GroupDisplayBooleanFunction m_displayBoolFn; - }; - - class EditorUIInfo_Class - : public EditorUIInfo - { - public: - AZ_RTTI(EditorUIInfo_Class, EditorUIInfo); - AZ_CLASS_ALLOCATOR(EditorUIInfo_Class, AZ::SystemAllocator, 0); - - AZ::Uuid m_classID; - - EditorUIInfo_Class(const AZ::Uuid& classID = AZ::Uuid::CreateNull()) - : m_classID(classID) - { - } - }; - } -} // namespace AzToolsFramework - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 460c47aa81..b0226b04af 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -398,7 +398,6 @@ set(FILES UI/PropertyEditor/PropertyDoubleSliderCtrl.cpp UI/PropertyEditor/PropertyDoubleSpinCtrl.hxx UI/PropertyEditor/PropertyDoubleSpinCtrl.cpp - UI/PropertyEditor/PropertyEditor_UITypes.h UI/PropertyEditor/PropertyEditorAPI.h UI/PropertyEditor/PropertyEditorApi.cpp UI/PropertyEditor/PropertyEditorAPI_Internals.h From acfd0d72aab0a89f169f492fbc3fff22dc378ddf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:37:21 -0800 Subject: [PATCH 138/394] =?UTF-8?q?=EF=BB=BFRemoves=20AZAutoSizingScrollAr?= =?UTF-8?q?ea=20from=20AzToolsFramework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/UICore/AZAutoSizingScrollArea.cpp | 55 ------------------- .../UI/UICore/AZAutoSizingScrollArea.hxx | 41 -------------- .../aztoolsframework_files.cmake | 2 - 3 files changed, 98 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp deleted file mode 100644 index c8a3b28173..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.cpp +++ /dev/null @@ -1,55 +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 "AZAutoSizingScrollArea.hxx" - -#include - -namespace AzToolsFramework -{ - - AZAutoSizingScrollArea::AZAutoSizingScrollArea(QWidget* parent) - : QScrollArea(parent) - { - } - - // this code was copied from the regular implementation of the same function in QScrollArea, but converted - // the private calls to public calls and removed the cache. - QSize AZAutoSizingScrollArea::sizeHint() const - { - int initialSize = 2 * frameWidth(); - QSize sizeHint(initialSize, initialSize); - - if (widget()) - { - sizeHint += this->widgetResizable() ? widget()->sizeHint() : widget()->size(); - } - else - { - // If we don't have a widget, we want to reserve some space visually for ourselves. - int fontHeight = fontMetrics().height(); - sizeHint += QSize(2 * fontHeight, 2 * fontHeight); - } - - if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn) - { - sizeHint.setWidth(sizeHint.width() + verticalScrollBar()->sizeHint().width()); - } - - if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn) - { - sizeHint.setHeight(sizeHint.height() + horizontalScrollBar()->sizeHint().height()); - } - - return sizeHint; - } - -} - -#include "UI/UICore/moc_AZAutoSizingScrollArea.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx deleted file mode 100644 index e5e5ef59ac..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/AZAutoSizingScrollArea.hxx +++ /dev/null @@ -1,41 +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 - * - */ - -#ifndef AZAUTOSIZINGSCROLLAREA_HXX -#define AZAUTOSIZINGSCROLLAREA_HXX - -#if !defined(Q_MOC_RUN) -#include -#include - -#pragma once - -#include -#endif - -namespace AzToolsFramework -{ - // This fixes a bug in QScrollArea which makes it so that you can dynamically add and remove elements from inside it, and the scroll - // area will take up as much room as it needs to, to prevent the need for scroll bars. Scroll bars will still appear if there is not enough - // room, but the view will scale up to eat all available room before that happens. - - // QScrollArea was supposed to do this, but it appears to cache the size of its embedded widget on startup, and never clears that cache. - class AZAutoSizingScrollArea - : public QScrollArea - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(AZAutoSizingScrollArea, AZ::SystemAllocator, 0); - - explicit AZAutoSizingScrollArea(QWidget* parent = 0); - - QSize sizeHint() const; - }; -} - -#endif diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index b0226b04af..24963d24c0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -444,8 +444,6 @@ set(FILES UI/Slice/SliceRelationshipWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.cpp - UI/UICore/AZAutoSizingScrollArea.hxx - UI/UICore/AZAutoSizingScrollArea.cpp UI/UICore/ColorPickerDelegate.hxx UI/UICore/ColorPickerDelegate.cpp UI/UICore/ClickableLabel.hxx From 87c5c76ae8feef148d8601b8688b8d2e6d6e960d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:46:25 -0800 Subject: [PATCH 139/394] Removes ColorPickerDelegate from AzToolsFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UI/PropertyEditor/PropertyColorCtrl.cpp | 2 - .../UI/UICore/ColorPickerDelegate.cpp | 75 ------------------- .../UI/UICore/ColorPickerDelegate.hxx | 41 ---------- .../aztoolsframework_files.cmake | 2 - 4 files changed, 120 deletions(-) delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp delete mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp index 13c5c8bfac..3562c8ff11 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp @@ -19,8 +19,6 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") AZ_POP_DISABLE_WARNING #include -#include "../UICore/ColorPickerDelegate.hxx" - namespace AzToolsFramework { PropertyColorCtrl::PropertyColorCtrl(QWidget* pParent) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp deleted file mode 100644 index ca5e89f6f1..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.cpp +++ /dev/null @@ -1,75 +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 "ColorPickerDelegate.hxx" - -#include -#include - -namespace AzToolsFramework -{ - ColorPickerDelegate::ColorPickerDelegate(QObject* pParent) - : QStyledItemDelegate(pParent) - { - } - - QWidget* ColorPickerDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const - { - (void)index; - (void)option; - AzQtComponents::ColorPicker* ptrDialog = new AzQtComponents::ColorPicker(AzQtComponents::ColorPicker::Configuration::RGB, - tr("Select Color"), parent); - ptrDialog->setWindowFlags(Qt::Tool); - return ptrDialog; - } - - void ColorPickerDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const - { - AzQtComponents::ColorPicker* colorEditor = qobject_cast(editor); - - if (!editor) - { - return; - } - - QVariant colorResult = index.data(COLOR_PICKER_ROLE); - if (colorResult == QVariant()) - { - return; - } - - const QColor pickedColor = qvariant_cast(colorResult); - colorEditor->setCurrentColor(AzQtComponents::fromQColor(pickedColor)); - } - - void ColorPickerDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const - { - AzQtComponents::ColorPicker* colorEditor = qobject_cast(editor); - - if (!editor) - { - return; - } - - const QVariant colorVariant = AzQtComponents::toQColor(colorEditor->currentColor()); - model->setData(index, colorVariant, COLOR_PICKER_ROLE); - } - - void ColorPickerDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const - { - (void)index; - QRect pickerpos = option.rect; - - pickerpos.setTopLeft(editor->parentWidget()->mapToGlobal(pickerpos.topLeft())); - pickerpos.adjust(64, 0, 0, 0); - editor->setGeometry(pickerpos); - } - -} // namespace AzToolsFramework - -#include "UI/UICore/moc_ColorPickerDelegate.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx deleted file mode 100644 index 7bb5cd25e2..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ColorPickerDelegate.hxx +++ /dev/null @@ -1,41 +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 - * - */ - -#ifndef COLOR_PICKER_DELEGATE_HXX -#define COLOR_PICKER_DELEGATE_HXX - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -#pragma once - -namespace AzToolsFramework -{ - /** - * A delegate which handles the double clicking to pop open a color picker dialog, as long as the role is COLOR_PICKER_ROLE. - * To use it, just add a setData() and a data() function to your model which returns a QColor (or accepts one) whenever the COLOR_PICKER_ROLE is queried. - **/ - class ColorPickerDelegate - : public QStyledItemDelegate - { - Q_OBJECT; - public: - static const int COLOR_PICKER_ROLE = Qt::UserRole + 1; - - AZ_CLASS_ALLOCATOR(ColorPickerDelegate, AZ::SystemAllocator, 0); - ColorPickerDelegate(QObject* pParent); - virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - virtual void setEditorData(QWidget* editor, const QModelIndex& index) const; - virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - virtual void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; - }; -} // namespace AzToolsFramework - -#endif //COLOR_PICKER_DELEGATE_HXX diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 24963d24c0..a21885f058 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -444,8 +444,6 @@ set(FILES UI/Slice/SliceRelationshipWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.hxx UI/UICore/AspectRatioAwarePixmapWidget.cpp - UI/UICore/ColorPickerDelegate.hxx - UI/UICore/ColorPickerDelegate.cpp UI/UICore/ClickableLabel.hxx UI/UICore/ClickableLabel.cpp UI/UICore/IconButton.hxx From ac221223a5e9829342ea9fd7aa92171325a75001 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:46:46 -0800 Subject: [PATCH 140/394] Adds missing header from previous commit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp index 3562c8ff11..fd6580225f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp @@ -18,6 +18,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING #include +#include namespace AzToolsFramework { From 7ea2b34e917b95bff8fe44c5cbe9282acee56876 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 16:29:46 -0800 Subject: [PATCH 141/394] Removes Cripter.h from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/GridMate/Carrier/Carrier.cpp | 1 - .../GridMate/GridMate/Carrier/Cripter.h | 25 ------------------- .../GridMate/GridMate/gridmate_files.cmake | 1 - 3 files changed, 27 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Carrier/Cripter.h diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp index 2724bee1a7..a4f6f286a8 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include #include diff --git a/Code/Framework/GridMate/GridMate/Carrier/Cripter.h b/Code/Framework/GridMate/GridMate/Carrier/Cripter.h deleted file mode 100644 index 07fae7f026..0000000000 --- a/Code/Framework/GridMate/GridMate/Carrier/Cripter.h +++ /dev/null @@ -1,25 +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 - * - */ -#ifndef GM_CRIPTER_INTERFACE_H -#define GM_CRIPTER_INTERFACE_H - -#include - -namespace GridMate -{ - /** - * Traffic control interface - */ - class Cripter - { - public: - }; -} - -#endif // GM_CRIPTER_INTERFACE_H - diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 7fac75a442..5fb565b5ae 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -19,7 +19,6 @@ set(FILES Carrier/Carrier.cpp Carrier/Carrier.h Carrier/Compressor.h - Carrier/Cripter.h Carrier/DefaultHandshake.cpp Carrier/DefaultHandshake.h Carrier/DefaultSimulator.cpp From a55773f9c37f7320b2e973dee564ad9b4f914746 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 18:39:26 -0800 Subject: [PATCH 142/394] Removes some unused files from gridmate (Containers/set and slist) also Doc.h Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/GridMate/Containers/set.h | 23 -------------- .../GridMate/GridMate/Containers/slist.h | 20 ------------ Code/Framework/GridMate/GridMate/Docs.h | 31 ------------------- .../GridMate/GridMate/gridmate_files.cmake | 2 -- 4 files changed, 76 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Containers/set.h delete mode 100644 Code/Framework/GridMate/GridMate/Containers/slist.h delete mode 100644 Code/Framework/GridMate/GridMate/Docs.h diff --git a/Code/Framework/GridMate/GridMate/Containers/set.h b/Code/Framework/GridMate/GridMate/Containers/set.h deleted file mode 100644 index d7edec8a46..0000000000 --- a/Code/Framework/GridMate/GridMate/Containers/set.h +++ /dev/null @@ -1,23 +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 - * - */ -#ifndef GM_CONTAINERS_SET_H -#define GM_CONTAINERS_SET_H - -#include -#include - -namespace GridMate -{ - template, class Allocator = SysContAlloc> - using set = AZStd::set; - - template, class Allocator = SysContAlloc> - using multiset = AZStd::multiset; -} - -#endif // GM_CONTAINERS_SET_H diff --git a/Code/Framework/GridMate/GridMate/Containers/slist.h b/Code/Framework/GridMate/GridMate/Containers/slist.h deleted file mode 100644 index 6e4d77b604..0000000000 --- a/Code/Framework/GridMate/GridMate/Containers/slist.h +++ /dev/null @@ -1,20 +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 - * - */ -#ifndef GM_CONTAINERS_SLIST_H -#define GM_CONTAINERS_SLIST_H - -#include -#include - -namespace GridMate -{ - template - using forward_list = AZStd::forward_list; -} - -#endif // GM_CONTAINERS_SLIST_H diff --git a/Code/Framework/GridMate/GridMate/Docs.h b/Code/Framework/GridMate/GridMate/Docs.h deleted file mode 100644 index c3a8c00776..0000000000 --- a/Code/Framework/GridMate/GridMate/Docs.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 - * - */ -/** - * \mainpage - * Welcome to the GridMate network library. - * - * Check the latest \ref ReleaseNotes "release notes" for this version of GridMate. - * - * You can start learning by looking at the \ref Library "Library overview". - * - * Or if you can't wait, jump to the \ref GMExamples "code examples" to see how GridMate is used. - */ - -/** - * \page Library Library Overview - * - * \subpage Fundamentals "Fundamental Concepts" - * - * \ref GMExamples "Code examples" - * - */ - -/** - * \namespace GridMate - * \brief The main namespace for the GridMate library. - */ diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 5fb565b5ae..f9ecfc1cf8 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -37,8 +37,6 @@ set(FILES Carrier/Utils.h Containers/list.h Containers/queue.h - Containers/set.h - Containers/slist.h Containers/unordered_map.h Containers/unordered_set.h Containers/vector.h From dda3dec7356b6f4e6975f000d4e360813b04d4c5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Dec 2021 18:39:58 -0800 Subject: [PATCH 143/394] missed this file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/GridMate/GridMate/gridmate_files.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index f9ecfc1cf8..e38a238baf 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -8,7 +8,6 @@ set(FILES EBus.h - Docs.h GridMate.cpp GridMate.h GridMateEventsBus.h From ce4ebc57c9daa85a84351aa3501573ddb34f75ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:35:12 -0800 Subject: [PATCH 144/394] Removes OnlineUtilityThread.h and UserServiceTypes.h from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Online/OnlineUtilityThread.h | 93 -------------- .../GridMate/Online/UserServiceTypes.h | 114 ------------------ .../GridMate/GridMate/gridmate_files.cmake | 2 - 3 files changed, 209 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h delete mode 100644 Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h diff --git a/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h b/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h deleted file mode 100644 index fd6ce8edb4..0000000000 --- a/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h +++ /dev/null @@ -1,93 +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 - * - */ -/** - * @file - * Provides EBus definitions for getting the utility thread tick - */ -#ifndef ONLINE_UTILITY_THREAD_H -#define ONLINE_UTILITY_THREAD_H - -#include -#include - -/** - * IMPORTANT NOTE TO SERVICES THAT USE THE UTILITY THREAD: - * The online service will start ticking the utility thread at construction - * time, but you have have to let it know when you need to be ticked. This - * is done two ways: first, send the NotifyOfNewWork event to the - * OnlineUtilityThreadCommandBus; second, return whether you still have - * work to do in OnlineUtilityThreadNotificationBus's event - * IsThereUtilityThreadWork. There, however, caveats the service - * must be aware of. - * - For those that derive from OnlineUtilityNotificationBus::Handler, - * do your BusConnect and BusDisConnect calls in your Init and Shutdown - * calls, instead of at construction and destruction time. You shouldn't - * be trying to use this utility thread outside of the time between these - * calls to your service anyway, so this shouldn't cause any amount of - * headache to conform to. - * - When you call BusConnect and BusDiscconect, the online manager may - * already be ticking that event - you may or may not receive your first - * and/or last tick events the way you might expect, so be careful about - * how you do you initialization and shutdown procedures. - * - Your Init call should do as little work as possible. Set yourself up for - * being ready to do actual initialization the first time you receive the - * OnUtilityThreadTick event instead of doing it all in Init and blocking - * the main thread. - * - Your Shutdown call should abort any pending operations, including ones - * it's already in the middle of. - * - In your OnUtilityThreadTick event response, make sure you haven't already - * been told to shut down. This is because the Shutdown call may have been - * made soon after the OnUtilityThreadTick event was fired, and other - * services took up a fair amount of time before the event got to you (with - * the Shutdown call to your service being made between event-firing and - * when the event reached you). - * - Be VERY careful about Shutdown getting called before you finish - * initializing in the utility thread (or even get a change to)! If you - * use this utility thread, be sure to test whether you can shutdown - * immediately after being initialized without breaking anything. - */ -namespace GridMate -{ - //------------------------------------------------------------------------- - // For ticking services that need a separate thread (outbound) - // - BusConnect to OnlineUtilityThreadNotificationBus::Handler to receive OnUtilityThreadTick - // - Return whether you have work left to do in IsThereWork - //------------------------------------------------------------------------- - class OnlineUtilityThreadNotifications - : public GridMateEBusTraits - { - public: - virtual ~OnlineUtilityThreadNotifications() {} - - // Called on each iteration of the online manager's utility thread loop - virtual void OnUtilityThreadTick() = 0; - - // Return whether there's work left to do here to keep the thread from doing busy waiting - virtual bool IsThereUtilityThreadWork() = 0; - }; - typedef AZ::EBus OnlineUtilityThreadNotificationBus; - //------------------------------------------------------------------------- - - //------------------------------------------------------------------------- - // For services that need a separate thread (inbound) - // - Fire the NotifyOfNewWork event to notify the thread that you have a new - // request you'd like to take care of - //------------------------------------------------------------------------- - class OnlineUtilityThreadCommands - : public GridMateEBusTraits - { - public: - virtual ~OnlineUtilityThreadCommands() {} - - virtual void NotifyOfNewWork() = 0; - }; - typedef AZ::EBus OnlineUtilityThreadCommandBus; - //------------------------------------------------------------------------- -} // namespace GridMate - -#endif // ONLINE_UTILITY_THREAD_H diff --git a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h b/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h deleted file mode 100644 index c1753b3bb2..0000000000 --- a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h +++ /dev/null @@ -1,114 +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 - * - */ -#ifndef GM_USER_SERVICE_TYPES_H -#define GM_USER_SERVICE_TYPES_H - -#include - -namespace GridMate -{ - /** - * User signin state - */ - enum OLSSigninState - { - OLS_SigninUnknown, - OLS_NotSignedIn, // There is no user signed in - OLS_SignedInOffline, // User signed in without online capabilities - OLS_SignedInOnline, // User signed in with online capabilities - OLS_SigningOut, // User is in the process of signing out - }; - - /** - * service network state - */ - enum OLSOnlineState - { - OLS_OnlineUnknown, - OLS_NoNetwork, // No NIC or network is unplugged - OLS_Offline, // No online access - OLS_Online, // Has online access - }; - - /** - * Supported privilege types - */ - enum OLSUserPrivilege - { - OLS_UserPrivilegeMP, - OLS_UserPrivilegeRecordDVR, - OLS_UserPrivilegePurchaseContent, - OLS_UserPrivilegeVoiceChat, - OLS_UserPrivilegeLeaderboards - }; - - /** - * Base class for platform dependent player id. - */ - struct PlayerId - { - PlayerId(ServiceType serviceType) - : m_serviceType(serviceType) {} - virtual ~PlayerId() {} - - // Compare 2 PlayerId IDs - virtual bool Compare(const PlayerId& userId) const = 0; - - // Returns a printable string representation of the id. - virtual gridmate_string ToString() const = 0; - - ServiceType GetType() const { return m_serviceType; } - - protected: - ServiceType m_serviceType; - }; - - /** - * Interface class for a local player/member. - */ - class ILocalMember - { - public: - virtual ~ILocalMember() {} - // SignIn - virtual OLSSigninState GetSigninState() const = 0; - - virtual const PlayerId* GetPlayerId() const = 0; - - // Pad number / info ??? - virtual unsigned int GetControllerIndex() const = 0; - virtual const char* GetName() const = 0; - virtual bool IsGuest() const = 0; - - // Friends List - virtual void RefreshFriends() = 0; - virtual bool IsFriendsListRefreshing() const = 0; - virtual unsigned int GetFriendsCount() const = 0; - virtual const char* GetFriendName(unsigned int idx) const = 0; - virtual const PlayerId* GetFriendPlayerId(unsigned int idx) const = 0; - virtual OLSSigninState GetFriendSigninState(unsigned int idx) const = 0; - virtual bool IsFriendPlayingTitle(unsigned int idx) const = 0; - virtual const char* GetFriendPresenceDetails(unsigned int idx) const = 0; - virtual bool IsFriendsWith(const PlayerId* playerId) const = 0; - }; - - /** - * Generic invite structure - * pPlatformSpecific contains the native structure used by each platform - */ - struct InviteInfo - { - InviteInfo() - : m_localMember(nullptr) {} - - ILocalMember* m_localMember; - }; -} // namespace GridMate - -#endif // GM_USER_SERVICE_TYPES_H -#pragma once diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index e38a238baf..758b217112 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -39,8 +39,6 @@ set(FILES Containers/unordered_map.h Containers/unordered_set.h Containers/vector.h - Online/OnlineUtilityThread.h - Online/UserServiceTypes.h Replica/BasicHostChunkDescriptor.h Replica/DeltaCompressedDataSet.h Replica/DataSet.cpp From 10ecb525fe5d8e92c0600067b64db7e74e510e02 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:12:02 -0800 Subject: [PATCH 145/394] Removes DeltaCompressedDataSet, ReplicaFunctions.inl and BitmaskInterestHandler from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Replica/DeltaCompressedDataSet.h | 257 ----------- .../Interest/BitmaskInterestHandler.cpp | 421 ------------------ .../Replica/Interest/BitmaskInterestHandler.h | 237 ---------- .../GridMate/Replica/ReplicaFunctions.inl | 98 ---- .../GridMate/GridMate/gridmate_files.cmake | 4 - 5 files changed, 1017 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl diff --git a/Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h b/Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h deleted file mode 100644 index d84a777024..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/DeltaCompressedDataSet.h +++ /dev/null @@ -1,257 +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 - * - */ -#ifndef GM_DELTACOMPRESSED_DATASET_H -#define GM_DELTACOMPRESSED_DATASET_H - -#pragma once - -#include -#include -#include - -namespace GridMate -{ - namespace Helper - { - template - AZ::u8 GetQuantized(float value) - { - /* - * Quantizing into a single byte, thus 255 values. - * [-DeltaRange V +DeltaRange] - * [0 Q 255] - * Given V, solve for Q. - */ - const float quantized = (value + DeltaRange) * 255.f / (2.f * DeltaRange); - const int clamped = AZ::GetClamp(static_cast(quantized), 0, 255); - return static_cast(clamped); - } - - template - float GetUnquantized(AZ::u8 quantized) - { - /* - * Unquantizing from a single byte, out of 255 values. - * [0 Q 255] - * [-DeltaRange V +DeltaRange] - * Given Q, solve for V. - */ - return 2 * DeltaRange * quantized / 255.f - DeltaRange; - } - - template - struct DeltaHelper; - - /** - * \brief Works for integer and floating points numbers - */ - template - struct DeltaHelper - { - static bool IsWithinDelta(const FieldType& base, const FieldType& another, AZ::u32 deltaRange) - { - return abs(base - another) < deltaRange; - } - }; - - /** - * \brief Specialization for AZ::Vector3 - */ - template<> - struct DeltaHelper - { - static bool IsWithinDelta(const AZ::Vector3& base, const AZ::Vector3& another, AZ::u32 deltaRange) - { - const AZ::Vector3 absDiff = (base - another).GetAbs(); - return absDiff.GetX() < deltaRange && absDiff.GetY() < deltaRange && absDiff.GetZ() < deltaRange; - } - }; - } - - /** - * \brief Packing a value into a single byte within +/- @DeltaRange - */ - template - class DeltaMarshaller; - - // float specialization - template - class DeltaMarshaller - { - public: - void Marshal(WriteBuffer& wb, const float &value) - { - wb.Write(Helper::GetQuantized(value)); - } - - void Unmarshal(float& value, ReadBuffer &rb) - { - AZ::u8 delta; - rb.Read(delta); - value = Helper::GetUnquantized(delta); - } - }; - - // AZ::Vector3 specialization - template - class DeltaMarshaller - { - public: - void Marshal(WriteBuffer& wb, const AZ::Vector3& value) - { - wb.Write(Helper::GetQuantized(value.GetX())); - wb.Write(Helper::GetQuantized(value.GetY())); - wb.Write(Helper::GetQuantized(value.GetZ())); - } - - void Unmarshal(AZ::Vector3& value, ReadBuffer& rb) - { - AZ::u8 delta[3]; - rb.Read(delta[0]); - rb.Read(delta[1]); - rb.Read(delta[2]); - - value = AZ::Vector3(Helper::GetUnquantized(delta[0]), Helper::GetUnquantized(delta[1]), Helper::GetUnquantized(delta[2])); - } - }; - - /** - * \brief Delta compressed DataSet, stateless and cacheless. Stateless - because it does not keep per-player state of any kind. - * Cacheless - because it does not keep a history of its values. - * This approach requires only one extra copy of a field, because the field is split into two portions: absolute and relative portions. - * The value is always the sum of two portions. We leverage existing DataSets to omit sending the larger absolute value, thus achieving compression. - * - * \tparam FieldType - * \tparam DeltaRange - * \tparam MarshalerType - * \tparam DeltaMarshalerType - */ - template, typename DeltaMarshalerType = DeltaMarshaller> - class DeltaCompressedDataSet - { - public: - virtual ~DeltaCompressedDataSet() = default; - - template - class BindInterface; - - /** - Constructs a DataSet. - **/ - explicit DeltaCompressedDataSet(const char* debugName, const FieldType& value = FieldType()) - : m_absolutePortion(debugName, value) - , m_relativePortion(debugName) - { - static_assert(DeltaRange > 0, "Delta range cannot be zero!"); - - // We need to intercept changes to our two DataSets, in order to calculate the combined value and report back to Replica Chunk on our time. - m_absolutePortion.SetDispatchOverride([this](const TimeContext& tc) {OnAbsolutePortionChanged(tc); }); - m_relativePortion.SetDispatchOverride([this](const TimeContext& tc) {OnRelativePortionChanged(tc); }); - } - - /** - Modify the DataSet. Call this on the Primary node to change the data, - which will be propagated to all proxies. - **/ - void Set(const FieldType& v) - { - m_combinedValue = v; - - if (Helper::DeltaHelper::IsWithinDelta(m_absolutePortion.Get(), v, DeltaRange)) - { - // within bounds, so only the relative portion needs to be updated - m_relativePortion.Set(v - m_absolutePortion.Get()); - } - else - { - // relative out of range, reset absolute - m_absolutePortion.Set(v); - m_relativePortion.Set(static_cast(0)); - } - } - - /** - Returns the current value of the DataSet. - **/ - const FieldType& Get() const - { - return m_combinedValue; - } - - protected: - virtual void OnAbsolutePortionChanged(const TimeContext& /*tc*/) - { - m_combinedValue = m_absolutePortion.Get() + m_relativePortion.Get(); - } - - virtual void OnRelativePortionChanged(const TimeContext& /*tc*/) - { - m_combinedValue = m_absolutePortion.Get() + m_relativePortion.Get(); - } - - private: - DataSet m_absolutePortion; - DataSet m_relativePortion; - FieldType m_combinedValue; // the latest value on either primary or proxy - }; - - //----------------------------------------------------------------------------- - - /** - Declares a DeltaCompressedDataSet with an event handler that is called when the value is changed. - Use BindInterface to dispatch to a method on the ReplicaChunk's - ReplicaChunkInterface event handler instance. - **/ - template - template - class DeltaCompressedDataSet::BindInterface - : public DeltaCompressedDataSet - { - public: - explicit BindInterface(const char* debugName) : DeltaCompressedDataSet(debugName) { } - - protected: - void OnAbsolutePortionChanged(const GridMate::TimeContext& tc) override - { - DeltaCompressedDataSet::OnAbsolutePortionChanged(tc); - - m_lastUpdateTime = m_absolutePortion.GetLastUpdateTime(); - if (m_relativePortion.GetLastUpdateTime() < m_lastUpdateTime) - { - // relative portion wasn't updated, so its callback won't be invoked this tick, therefore we need to dispatch change event now - DispatchChangedEvent(tc); - } - } - - void OnRelativePortionChanged(const GridMate::TimeContext& tc) override - { - DeltaCompressedDataSet::OnRelativePortionChanged(tc); - - m_lastUpdateTime = m_relativePortion.GetLastUpdateTime(); - // Assuming that relative portion DataSet is dispatched after absolute portion by construction in DeltaCompressedDataSet - DispatchChangedEvent(tc); - } - - void DispatchChangedEvent(const TimeContext& tc) - { - AZ_Assert(m_relativePortion.GetReplicaChunkBase(), "DataSets should be attached to replica chunks!"); - - if (C* c = static_cast(m_relativePortion.GetReplicaChunkBase()->GetHandler())) - { - const TimeContext changeTime{ m_lastUpdateTime, m_lastUpdateTime - (tc.m_realTime - tc.m_localTime) }; - (*c.*FuncPtr)(Get(), changeTime); - } - } - - private: - AZ::u32 m_lastUpdateTime = 0; // the latest update time among m_absolutePortion and m_relativePortion - }; - //----------------------------------------------------------------------------- -} // namespace GridMate - -#endif // GM_DELTACOMPRESSED_DATASET_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp b/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp deleted file mode 100644 index d4748e554d..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.cpp +++ /dev/null @@ -1,421 +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 -#include - -#include - -namespace GridMate -{ - - void BitmaskInterestChunk::OnReplicaActivate(const ReplicaContext& rc) - { - m_interestHandler = static_cast(rc.m_rm->GetUserContext(AZ_CRC("BitmaskInterestHandler", 0x5bf5d75b))); - AZ_Warning("GridMate", m_interestHandler != nullptr, "No bitmask interest handler in the user context"); - if (m_interestHandler) - { - m_interestHandler->OnNewRulesChunk(this, rc.m_peer); - } - } - - void BitmaskInterestChunk::OnReplicaDeactivate(const ReplicaContext& rc) - { - if (m_interestHandler) - { - // even if rc.m_peer is null, we still need to call OnDeleteRulesChunk so that the interest handler can clear m_rulesReplica - m_interestHandler->OnDeleteRulesChunk(this, rc.m_peer); - } - } - - bool BitmaskInterestChunk::AddRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext& ctx) - { - if (IsProxy()) - { - auto rulePtr = m_interestHandler->CreateRule(ctx.m_sourcePeer); - rulePtr->Set(bits); - m_rules.insert(AZStd::make_pair(netId, rulePtr)); - } - - return true; - } - - bool BitmaskInterestChunk::RemoveRuleFn(RuleNetworkId netId, const RpcContext&) - { - if (IsProxy()) - { - m_rules.erase(netId); - } - - return true; - } - - bool BitmaskInterestChunk::UpdateRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext&) - { - if (IsProxy()) - { - auto it = m_rules.find(netId); - if (it != m_rules.end()) - { - it->second->Set(bits); - } - } - - return true; - } - - bool BitmaskInterestChunk::AddRuleForPeerFn(RuleNetworkId netId, PeerId peerId, InterestBitmask bitmask, const RpcContext&) - { - BitmaskInterestChunk::Ptr peerChunk = m_interestHandler->FindRulesChunkByPeerId(peerId); - if (peerChunk) - { - auto it = peerChunk->m_rules.find(netId); - if (it == peerChunk->m_rules.end()) - { - auto rulePtr = m_interestHandler->CreateRule(peerId); - peerChunk->m_rules.insert(AZStd::make_pair(netId, rulePtr)); - rulePtr->Set(bitmask); - } - } - return false; - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterest - */ - BitmaskInterest::BitmaskInterest(BitmaskInterestHandler* handler) - : m_handler(handler) - , m_bits(0) - { - AZ_Assert(m_handler, "Invalid interest handler"); - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterestRule - */ - void BitmaskInterestRule::Set(InterestBitmask newBitmask) - { - m_bits = newBitmask; - m_handler->UpdateRule(this); - } - - void BitmaskInterestRule::Destroy() - { - m_handler->DestroyRule(this); - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterestAttribute - */ - void BitmaskInterestAttribute::Set(InterestBitmask newBitmask) - { - m_bits = newBitmask; - m_handler->UpdateAttribute(this); - } - - void BitmaskInterestAttribute::Destroy() - { - m_handler->DestroyAttribute(this); - } - /////////////////////////////////////////////////////////////////////////// - - - /* - * BitmaskInterestHandler - */ - BitmaskInterestHandler::BitmaskInterestHandler() - : m_im(nullptr) - , m_rm(nullptr) - , m_lastRuleNetId(0) - , m_rulesReplica(nullptr) - { - } - - BitmaskInterestRule::Ptr BitmaskInterestHandler::CreateRule(PeerId peerId) - { - BitmaskInterestRule* rulePtr = aznew BitmaskInterestRule(this, peerId, GetNewRuleNetId()); - m_rules.insert(rulePtr); - - if (peerId == m_rm->GetLocalPeerId() && m_rulesReplica) - { - m_rulesReplica->AddRuleRpc(rulePtr->GetNetworkId(), rulePtr->Get()); - m_localRules.insert(rulePtr); - } - - return rulePtr; - } - - void BitmaskInterestHandler::FreeRule(BitmaskInterestRule* rule) - { - //TODO: should be pool-allocated - m_rules.erase(rule); - delete rule; - } - - void BitmaskInterestHandler::DestroyRule(BitmaskInterestRule* rule) - { - if (m_rm && rule->GetPeerId() == m_rm->GetLocalPeerId() && m_rulesReplica) - { - m_rulesReplica->RemoveRuleRpc(rule->GetNetworkId()); - } - - rule->m_bits = 0; - m_dirtyRules.insert(rule); - m_localRules.erase(rule); - } - - void BitmaskInterestHandler::UpdateRule(BitmaskInterestRule* rule) - { - if (m_rm && m_rulesReplica && rule->GetPeerId() == m_rm->GetLocalPeerId()) - { - m_rulesReplica->UpdateRuleRpc(rule->GetNetworkId(), rule->Get()); - } - - m_dirtyRules.insert(rule); - } - - BitmaskInterestAttribute::Ptr BitmaskInterestHandler::CreateAttribute(ReplicaId replicaId) - { - auto ptr = aznew BitmaskInterestAttribute(this, replicaId); - m_attrs.insert(ptr); - return ptr; - } - - void BitmaskInterestHandler::FreeAttribute(BitmaskInterestAttribute* attrib) - { - //TODO: should be pool-allocated - m_attrs.erase(attrib); - delete attrib; - } - - void BitmaskInterestHandler::DestroyAttribute(BitmaskInterestAttribute* attrib) - { - attrib->m_bits = 0; - m_dirtyAttributes.insert(attrib); - } - - void BitmaskInterestHandler::UpdateAttribute(BitmaskInterestAttribute* attrib) - { - m_dirtyAttributes.insert(attrib); - } - - void BitmaskInterestHandler::OnNewRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer) - { - if (chunk != m_rulesReplica) // non-local - { - m_peerChunks.insert(AZStd::make_pair(peer->GetId(), chunk)); - - for (auto& rule : m_localRules) - { - chunk->AddRuleForPeerRpc(rule->GetNetworkId(), rule->GetPeerId(), rule->Get()); - } - } - } - - void BitmaskInterestHandler::OnDeleteRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer) - { - AZ_UNUSED(chunk); - m_rulesReplica = nullptr; - - if (peer) - { - m_peerChunks.erase(peer->GetId()); - } - } - - RuleNetworkId BitmaskInterestHandler::GetNewRuleNetId() - { - ++m_lastRuleNetId; - if (m_rulesReplica) - { - return m_rulesReplica->GetReplicaId() | (static_cast(m_lastRuleNetId) << 32); - } - - return (static_cast(m_lastRuleNetId) << 32); - } - - BitmaskInterestChunk::Ptr BitmaskInterestHandler::FindRulesChunkByPeerId(PeerId peerId) - { - auto it = m_peerChunks.find(peerId); - if (it == m_peerChunks.end()) - { - return nullptr; - } - else - { - return it->second; - } - } - - const InterestMatchResult& BitmaskInterestHandler::GetLastResult() - { - return m_resultCache; - } - - void BitmaskInterestHandler::Update() - { - m_resultCache.clear(); - - for (BitmaskInterestRule* rule : m_dirtyRules) - { - InterestBitmask j = 1; - for (size_t i = 0; i < k_numGroups; ++i, j <<= 1) - { - auto ruleIt = m_ruleGroups[i].find(rule); - bool isMatch = !!(rule->m_bits & j); - if (isMatch && ruleIt == m_ruleGroups[i].end()) - { - m_ruleGroups[i].insert(rule); - - // recalculate all the attributes in this bucket - for (BitmaskInterestAttribute* attr : m_attrGroups[i]) - { - m_dirtyAttributes.insert(attr); - } - } - else if (!isMatch && ruleIt != m_ruleGroups[i].end()) - { - m_ruleGroups[i].erase(ruleIt); - - // recalculate all the attributes in this bucket - for (BitmaskInterestAttribute* attr : m_attrGroups[i]) - { - m_dirtyAttributes.insert(attr); - } - } - } - - if (rule->IsDeleted()) - { - FreeRule(rule); - } - } - - m_dirtyRules.clear(); - - for (BitmaskInterestAttribute* attr : m_dirtyAttributes) - { - InterestBitmask j = 1; - for (size_t i = 0; i < k_numGroups; ++i, j <<= 1) - { - auto attrIt = m_attrGroups[i].find(attr); - bool isMatch = !!(attr->m_bits & j); - if (isMatch && attrIt == m_attrGroups[i].end()) - { - m_attrGroups[i].insert(attr); - } - else if (!isMatch && attrIt != m_attrGroups[i].end()) - { - m_attrGroups[i].erase(attrIt); - } - } - } - - for (BitmaskInterestAttribute* attr : m_dirtyAttributes) - { - auto repIt = m_resultCache.insert(attr->GetReplicaId()); - - InterestBitmask j = 1; - for (size_t i = 0; i < k_numGroups; ++i, j <<= 1) - { - if (!!(attr->m_bits & j)) - { - for (BitmaskInterestRule* rule : m_ruleGroups[i]) - { - repIt.first->second.insert(rule->GetPeerId()); - } - } - } - - if (attr->IsDeleted()) - { - FreeAttribute(attr); - } - } - - m_dirtyAttributes.clear(); - } - - void BitmaskInterestHandler::OnRulesHandlerRegistered(InterestManager* manager) - { - AZ_Assert(m_im == nullptr, "Handler is already registered with manager %p (%p)\n", m_im, manager); - AZ_Assert(m_rulesReplica == nullptr, "Rules replica is already created\n"); - AZ_TracePrintf("GridMate", "Bitmask interest handler is registered\n"); - m_im = manager; - m_rm = m_im->GetReplicaManager(); - m_rm->RegisterUserContext(AZ_CRC("BitmaskInterestHandler", 0x5bf5d75b), this); - - auto replica = Replica::CreateReplica("BitmaskInterestHandlerRules"); - m_rulesReplica = CreateAndAttachReplicaChunk(replica); - m_rm->AddPrimary(replica); - } - - void BitmaskInterestHandler::OnRulesHandlerUnregistered(InterestManager* manager) - { - (void)manager; - - AZ_Assert(m_im == manager, "Handler was not registered with manager %p (%p)\n", manager, m_im); - AZ_TracePrintf("GridMate", "Bitmask interest handler is unregistered\n"); - - if (m_rulesReplica) - { - m_rulesReplica->m_rules.clear(); - m_rulesReplica->m_interestHandler = nullptr; - } - - for (auto& chunk : m_peerChunks) - { - chunk.second->m_rules.clear(); - chunk.second->m_interestHandler = nullptr; - } - - m_rulesReplica = nullptr; - m_im = nullptr; - m_rm->UnregisterUserContext(AZ_CRC("BitmaskInterestHandler", 0x5bf5d75b)); - m_rm = nullptr; - - m_peerChunks.clear(); - m_localRules.clear(); - - for (auto& a : m_attrs) - { - delete a; - } - - for (auto& r : m_rules) - { - delete r; - } - - m_dirtyAttributes.clear(); - m_dirtyRules.clear(); - - for (auto& group : m_attrGroups) - { - group.clear(); - } - - for (auto& group : m_ruleGroups) - { - group.clear(); - } - - m_resultCache.clear(); - } - /////////////////////////////////////////////////////////////////////////// -} diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h b/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h deleted file mode 100644 index 6b91859c95..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/BitmaskInterestHandler.h +++ /dev/null @@ -1,237 +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 - * - */ - -#ifndef GM_REPLICA_BITMASKINTERESTHANDLER_H -#define GM_REPLICA_BITMASKINTERESTHANDLER_H - -#include -#include -#include -#include - -#include -#include -#include - - -namespace GridMate -{ - class BitmaskInterestHandler; - using InterestBitmask = AZ::u32; - - /* - * Base interest - */ - class BitmaskInterest - { - friend class BitmaskInterestHandler; - - public: - InterestBitmask Get() const { return m_bits; } - - protected: - explicit BitmaskInterest(BitmaskInterestHandler* handler); - - BitmaskInterestHandler* m_handler; - InterestBitmask m_bits; - }; - /////////////////////////////////////////////////////////////////////////// - - - /* - * Bitmask rule - */ - class BitmaskInterestRule - : public InterestRule - , public BitmaskInterest - { - friend class BitmaskInterestHandler; - - public: - using Ptr = AZStd::intrusive_ptr; - - GM_CLASS_ALLOCATOR(BitmaskInterestRule); - - void Set(InterestBitmask newBitmask); - - private: - - // Intrusive ptr - template - friend struct AZStd::IntrusivePtrCountPolicy; - unsigned int m_refCount = 0; - AZ_FORCE_INLINE void add_ref() { ++m_refCount; } - AZ_FORCE_INLINE void release() { --m_refCount; if (!m_refCount) Destroy(); } - AZ_FORCE_INLINE bool IsDeleted() const { return m_refCount == 0; } - /////////////////////////////////////////////////////////////////////////// - - BitmaskInterestRule(BitmaskInterestHandler* handler, PeerId peerId, RuleNetworkId netId) - : InterestRule(peerId, netId) - , BitmaskInterest(handler) - {} - - void Destroy(); - }; - /////////////////////////////////////////////////////////////////////////// - - - /* - * Bitmask attribute - */ - class BitmaskInterestAttribute - : public InterestAttribute - , public BitmaskInterest - { - friend class BitmaskInterestHandler; - template friend class InterestPtr; - - public: - using Ptr = AZStd::intrusive_ptr; - - GM_CLASS_ALLOCATOR(BitmaskInterestAttribute); - - void Set(InterestBitmask newBitmask); - - private: - - // Intrusive ptr - template - friend struct AZStd::IntrusivePtrCountPolicy; - unsigned int m_refCount = 0; - AZ_FORCE_INLINE void add_ref() { ++m_refCount; } - AZ_FORCE_INLINE void release() { Destroy(); } - AZ_FORCE_INLINE bool IsDeleted() const { return m_refCount == 0; } - /////////////////////////////////////////////////////////////////////////// - - BitmaskInterestAttribute(BitmaskInterestHandler* handler, ReplicaId repId) - : InterestAttribute(repId) - , BitmaskInterest(handler) - {} - - void Destroy(); - }; - /////////////////////////////////////////////////////////////////////////// - - class BitmaskInterestChunk - : public ReplicaChunk - { - public: - GM_CLASS_ALLOCATOR(BitmaskInterestChunk); - - BitmaskInterestChunk() - : AddRuleRpc("AddRule") - , RemoveRuleRpc("RemoveRule") - , UpdateRuleRpc("UpdateRule") - , AddRuleForPeerRpc("AddRuleForPeerRpc") - , m_interestHandler(nullptr) - {} - - typedef AZStd::intrusive_ptr Ptr; - bool IsReplicaMigratable() override { return false; } - bool IsBroadcast() override { return true; } - static const char* GetChunkName() { return "BitmaskInterestChunk"; } - - void OnReplicaActivate(const ReplicaContext& rc) override; - void OnReplicaDeactivate(const ReplicaContext& rc) override; - - bool AddRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext& ctx); - bool RemoveRuleFn(RuleNetworkId netId, const RpcContext&); - bool UpdateRuleFn(RuleNetworkId netId, InterestBitmask bits, const RpcContext&); - bool AddRuleForPeerFn(RuleNetworkId netId, PeerId peerId, InterestBitmask bitmask, const RpcContext&); - - Rpc, RpcArg>::BindInterface AddRuleRpc; - Rpc>::BindInterface RemoveRuleRpc; - Rpc, RpcArg>::BindInterface UpdateRuleRpc; - - Rpc, RpcArg, RpcArg>::BindInterface AddRuleForPeerRpc; - - unordered_map m_rules; - BitmaskInterestHandler* m_interestHandler; - }; - - /* - * Rules handler - */ - class BitmaskInterestHandler - : public BaseRulesHandler - { - friend class BitmaskInterestRule; - friend class BitmaskInterestAttribute; - friend class BitmaskInterestChunk; - - public: - - GM_CLASS_ALLOCATOR(BitmaskInterestHandler); - - BitmaskInterestHandler(); - - // Creates new bitmask rule and binds it to the peer - BitmaskInterestRule::Ptr CreateRule(PeerId peerId); - - // Creates new bitmask attribute and binds it to the replica - BitmaskInterestAttribute::Ptr CreateAttribute(ReplicaId replicaId); - - // Calculates rules and attributes matches - void Update() override; - - // Returns last recalculated results - const InterestMatchResult& GetLastResult() override; - - InterestManager* GetManager() override { return m_im; } - private: - - // BaseRulesHandler - void OnRulesHandlerRegistered(InterestManager* manager) override; - void OnRulesHandlerUnregistered(InterestManager* manager) override; - - void DestroyRule(BitmaskInterestRule* rule); - void FreeRule(BitmaskInterestRule* rule); - void UpdateRule(BitmaskInterestRule* rule); - - void DestroyAttribute(BitmaskInterestAttribute* attrib); - void FreeAttribute(BitmaskInterestAttribute* attrib); - void UpdateAttribute(BitmaskInterestAttribute* attrib); - - - void OnNewRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer); - void OnDeleteRulesChunk(BitmaskInterestChunk::Ptr chunk, ReplicaPeer* peer); - - RuleNetworkId GetNewRuleNetId(); - - BitmaskInterestChunk::Ptr FindRulesChunkByPeerId(PeerId peerId); - - typedef unordered_set AttributeSet; - typedef unordered_set RuleSet; - static const size_t k_numGroups = sizeof(InterestBitmask) * CHAR_BIT; - - InterestManager* m_im; - ReplicaManager* m_rm; - - AZ::u32 m_lastRuleNetId; - - unordered_map m_peerChunks; - - RuleSet m_localRules; - - AttributeSet m_dirtyAttributes; - RuleSet m_dirtyRules; - - AZStd::array m_attrGroups; - AZStd::array m_ruleGroups; - - InterestMatchResult m_resultCache; - - BitmaskInterestChunk* m_rulesReplica; - - AttributeSet m_attrs; - RuleSet m_rules; - }; - /////////////////////////////////////////////////////////////////////////// -} - -#endif diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl b/Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl deleted file mode 100644 index da54d88ef7..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaFunctions.inl +++ /dev/null @@ -1,98 +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 - * - */ -#if (GM_FUNCTION_NUM_ARGS == 0) - #define GM_FUNCTION_TEMPLATE_PARMS - #define GM_FUNCTION_ARGS - #define GM_FUNCTION_ARGS_CONCAT - #define GM_FUNCTION_FORWARD - #define GM_FUNCTION_FORWARD_CONCAT -#elif (GM_FUNCTION_NUM_ARGS == 1) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0 - #define GM_FUNCTION_ARGS T0 && t0 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 2) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 3) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1, typename T2 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1, T2 && t2 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1), AZStd::forward(t2) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 4) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1, typename T2, typename T3 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1, T2 && t2, T3 && t3 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1), AZStd::forward(t2), AZStd::forward(t3) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#elif (GM_FUNCTION_NUM_ARGS == 5) - #define GM_FUNCTION_TEMPLATE_PARMS , typename T0, typename T1, typename T2, typename T3, typename T4 - #define GM_FUNCTION_ARGS T0 && t0, T1 && t1, T2 && t2, T3 && t3, T4 && t4 - #define GM_FUNCTION_ARGS_CONCAT , GM_FUNCTION_ARGS - #define GM_FUNCTION_FORWARD AZStd::forward(t0), AZStd::forward(t1), AZStd::forward(t2), AZStd::forward(t3), AZStd::forward(t4) - #define GM_FUNCTION_FORWARD_CONCAT , GM_FUNCTION_FORWARD -#else - #error Unsupported argument count -#endif - -/** - Create a ReplicaChunk that isn't attached to a Replica. To attach it to a replica, - call replica->AttachReplicaChunk(chunk). -**/ -template -ChunkType* CreateReplicaChunk(GM_FUNCTION_ARGS) -{ - static_assert(AZStd::is_base_of::value, "Class must inherit from ReplicaChunk"); - - ReplicaChunkDescriptor* descriptor = ReplicaChunkDescriptorTable::Get().FindReplicaChunkDescriptor(ReplicaChunkClassId(ChunkType::GetChunkName())); - AZ_Assert(descriptor, "Cannot find replica chunk descriptor for %s. Did you remember to register the chunk type?", ChunkType::GetChunkName()); - ReplicaChunkDescriptorTable::Get().BeginConstructReplicaChunk(descriptor); - ChunkType* chunk = aznew ChunkType(GM_FUNCTION_FORWARD); - ReplicaChunkDescriptorTable::Get().EndConstructReplicaChunk(); - chunk->Init(descriptor); - - return chunk; -} - -/** - Create a ReplicaChunk that is automatically attached to the replica. -**/ -template -ChunkType* CreateAndAttachReplicaChunk(const ReplicaPtr& replica GM_FUNCTION_ARGS_CONCAT) -{ - return CreateAndAttachReplicaChunk(replica.get() GM_FUNCTION_FORWARD_CONCAT); -} - -/** - Create a ReplicaChunk that is automatically attached to the replica. -**/ -template -ChunkType* CreateAndAttachReplicaChunk(Replica* replica GM_FUNCTION_ARGS_CONCAT) -{ - // Chunks cannot be attached while active - if (replica->IsActive()) - { - AZ_Warning("GridMate", false, "Cannot attach chunk %s while replica is active", ChunkType::GetChunkName()); - return nullptr; - } - - ChunkType* chunk = CreateReplicaChunk(GM_FUNCTION_FORWARD); - replica->AttachReplicaChunk(chunk); - return chunk; -} - -#undef GM_FUNCTION_TEMPLATE_PARMS -#undef GM_FUNCTION_ARGS -#undef GM_FUNCTION_ARGS_CONCAT -#undef GM_FUNCTION_FORWARD -#undef GM_FUNCTION_FORWARD_CONCAT diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 758b217112..2646660eba 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -40,7 +40,6 @@ set(FILES Containers/unordered_set.h Containers/vector.h Replica/BasicHostChunkDescriptor.h - Replica/DeltaCompressedDataSet.h Replica/DataSet.cpp Replica/DataSet.h Replica/Interpolators.h @@ -58,7 +57,6 @@ set(FILES Replica/ReplicaCommon.h Replica/ReplicaDefs.h Replica/ReplicaFunctions.h - Replica/ReplicaFunctions.inl Replica/ReplicaInline.inl Replica/ReplicaMgr.cpp Replica/ReplicaMgr.h @@ -80,8 +78,6 @@ set(FILES Replica/Tasks/ReplicaProcessPolicy.cpp Replica/Tasks/ReplicaProcessPolicy.h Replica/Tasks/ReplicaPriorityPolicy.h - Replica/Interest/BitmaskInterestHandler.cpp - Replica/Interest/BitmaskInterestHandler.h Replica/Interest/InterestDefs.h Replica/Interest/InterestManager.cpp Replica/Interest/InterestManager.h From e28a0eaec75e10351cdd351bde8f8aa4141bbfae Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 13 Dec 2021 15:06:20 -0800 Subject: [PATCH 146/394] Removes interest stuff from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Replica/Interest/InterestDefs.h | 132 ---------- .../Replica/Interest/InterestEvents.h | 53 ---- .../Replica/Interest/InterestManager.cpp | 243 ------------------ .../Replica/Interest/InterestManager.h | 91 ------- .../Replica/Interest/InterestQueryResult.cpp | 25 -- .../Replica/Interest/InterestQueryResult.h | 25 -- .../GridMate/Replica/Interest/RulesHandler.h | 65 ----- .../GridMate/GridMate/Replica/Replica.h | 4 +- .../GridMate/GridMate/Replica/ReplicaMgr.h | 1 - .../GridMate/GridMate/Replica/ReplicaTarget.h | 2 - .../GridMate/GridMate/gridmate_files.cmake | 5 - 11 files changed, 1 insertion(+), 645 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h delete mode 100644 Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h deleted file mode 100644 index 7695ee6b08..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestDefs.h +++ /dev/null @@ -1,132 +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 - * - */ -#ifndef GM_REPLICA_INTERESTDEFS_H -#define GM_REPLICA_INTERESTDEFS_H - -#include -#include -#include -#include -#include -#include - -namespace GridMate -{ - /** - * Bitmask used internally in InterestManager to check which handler is responsible for a given interest match - */ - using InterestHandlerSlot = AZ::u32; - - /** - * Rule identifier (unique within the session) - */ - using RuleNetworkId = AZ::u64; - /////////////////////////////////////////////////////////////////////////// - - using InterestPeerSet = unordered_set; - - /** - * InterestMatchResult: a structure to gather new matches from handlers. - * Passed to handler within matching context when handler's Match method is invoked. - * User must fill the structure with changes that handler recalculated. - * - * Specifically, the changes should have all the replicas that had their list of associated peers modified. - * Each entry replica - new full list of associated peers. - */ - class InterestMatchResult : public unordered_map - { - public: - using unordered_map::unordered_map; - - /* - * An expensive debug trace helper, prints sorted mapping between replica id's and associated peers. - */ - void PrintMatchResult(const char* name) const; - }; - /////////////////////////////////////////////////////////////////////////// - - /** - * Base class for interest rules - */ - class InterestRule - { - public: - explicit InterestRule(PeerId peerId, RuleNetworkId netId) - : m_peerId(peerId) - , m_netId(netId) - {} - - PeerId GetPeerId() const { return m_peerId; } - RuleNetworkId GetNetworkId() const { return m_netId; } - - protected: - PeerId m_peerId; ///< the peer this rule is bound to - RuleNetworkId m_netId; ///< network id - }; - /////////////////////////////////////////////////////////////////////////// - - - /** - * Base class for interest attributes - */ - class InterestAttribute - { - public: - explicit InterestAttribute(ReplicaId replicaId) - : m_replicaId(replicaId) - {} - - ReplicaId GetReplicaId() const { return m_replicaId; } - - protected: - ReplicaId m_replicaId; ///< Replica id this attribute is bound to - }; - /////////////////////////////////////////////////////////////////////////// - -#if !defined(AZ_DEBUG_BUILD) - AZ_INLINE void InterestMatchResult::PrintMatchResult(const char*) const {} -#else - AZ_INLINE void InterestMatchResult::PrintMatchResult(const char* name) const - { - if (size() == 0) - { - AZ_TracePrintf("GridMate", "InterestMatchResult %s empty \n", name); - return; - } - - AZStd::vector sorted; - for (auto& r : *this) - { - sorted.push_back(r); - } - - auto sortByReplicaId = [](const value_type& one, const value_type& another) - { - return one.first < another.first; - }; - AZStd::sort(sorted.begin(), sorted.end(), sortByReplicaId); - - AZ_TracePrintf("GridMate", "InterestMatchResult %s \n", name); - for (auto& match : sorted) - { - auto repId = match.first; - AZ_TracePrintf("GridMate", "\t\t\t for repId %d ", repId); - - // unsorted list of peers - for (auto& peerId : match.second) - { - AZ_TracePrintf("", "peer %d", peerId); - } - - AZ_TracePrintf("", "\n"); - } - } -#endif -} // GridMate - -#endif // GM_REPLICA_INTERESTDEFS_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h deleted file mode 100644 index cf7771cb32..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestEvents.h +++ /dev/null @@ -1,53 +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 - * - */ - -#ifndef GM_REPLICA_INTERESTEVENTS_H -#define GM_REPLICA_INTERESTEVENTS_H - -#if defined(GM_INTEREST_MANAGER) - -#include -#include - -#include -#include -#include - -namespace GridMate -{ - /** - * EBus for interest manager's events. - * Notifies subscribers about new interest matches and new mismatches happened. - */ - class InterestManagerEvents - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - typedef AZStd::recursive_mutex MutexType; - typedef void* BusIdType; - typedef SysContAlloc AllocatorType; - - virtual ~InterestManagerEvents() {} - - /** - * Called when new pair of replica and peer matched their interest - */ - virtual void OnInterestMatched(ReplicaId replicaId, PeerId peerId) { (void) replicaId; (void) peerId; } - - /** - * Called when pair of replica and peer mismatched interest (only called if the pair was previously matching) - */ - virtual void OnInterestUnmatched(ReplicaId replicaId, PeerId peerId) { (void) replicaId; (void) peerId; } - }; - - typedef AZ::EBus InterestManagerEventsBus; -} - -#endif // GM_INTEREST_MANAGER -#endif diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp deleted file mode 100644 index 2d77a3ec8c..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.cpp +++ /dev/null @@ -1,243 +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 - -#include - -namespace GridMate -{ - static const unsigned k_maxHandlers = sizeof(GridMate::InterestHandlerSlot) * CHAR_BIT; - - /** - * Hashing utils - */ - struct ReplicaHashByPeer - { - AZ_FORCE_INLINE AZStd::size_t operator()(const ReplicaTarget* t) const - { - static_assert(sizeof(AZStd::size_t) >= sizeof(ReplicaPeer*), "Types sizes mismatch"); - return reinterpret_cast(t->GetPeer()); - } - }; - - struct ReplicaEqualToByPeer - { - AZ_FORCE_INLINE bool operator()(const ReplicaTarget* left, const ReplicaTarget* right) const - { - return left->GetPeer() == right->GetPeer(); - } - }; - - struct ReplicaHashByPeerId - { - AZ_FORCE_INLINE AZStd::size_t operator()(PeerId peerId) const - { - static_assert(sizeof(AZStd::size_t) >= sizeof(PeerId), "Types sizes mismatch"); - return static_cast(peerId); - } - }; - - struct ReplicaEqualToByPeerId - { - AZ_FORCE_INLINE bool operator()(PeerId peerId, const ReplicaTarget* right) const - { - return peerId == right->GetPeer()->GetId(); - } - }; - /////////////////////////////////////////////////////////////////////////// - - /** - * InterestManager - */ - InterestManager::InterestManager() - : m_rm(nullptr) - , m_freeSlots(~0u) - { - } - - void InterestManager::Init(const InterestManagerDesc& desc) - { - m_rm = desc.m_rm; - AZ_Assert(m_rm, "Invalid replica manager"); - } - - bool InterestManager::IsReady() const - { - return m_rm != nullptr; - } - - InterestManager::~InterestManager() - { - while (!m_handlers.empty()) - { - m_handlers.back()->OnRulesHandlerUnregistered(this); - m_handlers.pop_back(); - } - } - - void InterestManager::RegisterHandler(BaseRulesHandler* handler) - { - AZ_Assert(handler, "Invalid rules handler"); - - for (BaseRulesHandler* h : m_handlers) - { - if (h == handler) - { - AZ_TracePrintf("GridMate", "Rules handler %p is already registered", handler); - return; - } - } - - InterestHandlerSlot slot = GetNewSlot(); - if (!slot) - { - AZ_TracePrintf("GridMate", "Too many rules handlers, max=%u\n", k_maxHandlers); - return; - } - - handler->m_slot = slot; - m_handlers.push_back(handler); - handler->OnRulesHandlerRegistered(this); - } - - void InterestManager::UnregisterHandler(BaseRulesHandler* handler) - { - AZ_Assert(handler, "Invalid rules handler"); - - for (auto it = m_handlers.begin(); it != m_handlers.end(); ++it) - { - if (*it == handler) - { - handler->OnRulesHandlerUnregistered(this); - m_handlers.erase(it); - return; - } - } - - AZ_Assert(false, "Handler was not registered"); - } - - void InterestManager::Update() - { - // Updating all handlers - for (BaseRulesHandler* handler : m_handlers) - { - handler->Update(); - } - - // merging results from every handler - for (BaseRulesHandler* handler : m_handlers) - { - const InterestMatchResult& result = handler->GetLastResult(); - - for (auto& match : result) - { - ReplicaPtr replica = m_rm->FindReplica(match.first); - if (!replica) // replica was destroyed: ignoring this match - { - continue; - } - - unordered_set targets; - - for (ReplicaTarget& targetObj : replica->m_targets) - { - targets.insert(&targetObj); - if (!match.second.count(targetObj.GetPeer()->GetId())) - { - targetObj.m_slotMask &= ~handler->m_slot; - if (!targetObj.m_slotMask) - { - targetObj.m_flags |= ReplicaTarget::TargetRemoved; - m_rm->OnReplicaChanged(replica); - } - } - } - - for (const PeerId& peerId : match.second) - { - ReplicaTarget* rt = nullptr; - - auto it = targets.find_as(peerId, ReplicaHashByPeerId(), ReplicaEqualToByPeerId()); - if (it == targets.end()) - { - ReplicaPeer* peer = m_rm->FindPeer(peerId); - - if (!ShouldForward(replica.get(), peer)) - { - continue; - } - - rt = ReplicaTarget::AddReplicaTarget(peer, replica.get()); - rt->SetNew(true); - m_rm->OnReplicaChanged(replica); - } - else - { - rt = *it; - } - - rt->m_slotMask |= handler->m_slot; - rt->m_flags &= ~ReplicaTarget::TargetRemoved; - } - } - } - } - - - bool InterestManager::ShouldForward(Replica* replica, ReplicaPeer* peer) const - { - if (!peer) // invalid peer - { - return false; - } - - if (replica->IsPrimary()) // own the replica? - { - return true; - } - - if (m_rm->GetLocalPeerId() == peer->GetId() || peer->GetId() == replica->m_upstreamHop->GetId()) // forwarding to local peer or to owner? - { - return false; - } - - if (m_rm->IsSyncHost() && !(replica->m_upstreamHop->GetMode() == Mode_Peer && peer->GetMode() == Mode_Peer)) // we are host and replica' owner and target are not connected - { - return true; - } - - return false; - } - - InterestHandlerSlot InterestManager::GetNewSlot() - { - InterestHandlerSlot s = m_freeSlots; - for (unsigned i = 0; s && i < k_maxHandlers; ++i, s >>= 1) - { - if (s & 1) - { - InterestHandlerSlot slot = (1 << i); - m_freeSlots &= ~slot; - return slot; - } - } - return 0; - } - - void InterestManager::FreeSlot(InterestHandlerSlot slot) - { - m_freeSlots |= slot; - } - /////////////////////////////////////////////////////////////////////////// -} diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h deleted file mode 100644 index e7ff19129c..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestManager.h +++ /dev/null @@ -1,91 +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 - * - */ -#ifndef GM_REPLICA_INTERESTMANAGER_H -#define GM_REPLICA_INTERESTMANAGER_H - -#include - -#include - -namespace GridMate -{ - class BaseRulesHandler; - - /** - * Interest manager initialization parameters - */ - struct InterestManagerDesc - { - ReplicaManager* m_rm; ///< Replica manager instance - - InterestManagerDesc() - : m_rm(nullptr) - { - - } - }; - - /** - * InterestManager: responsible for matching of replicas and peers pairs based on rules and attribute provided. - * InterestManager allows registration of up to 32 custom rules handler. Each rules handler is responsible of matching attributes - * and rules that user provides. InterestManager is responsible for merging results of matching from every registered handler and - * maintaining valid forwarding targets cache on every Replica. - */ - class InterestManager - { - public: - - GM_CLASS_ALLOCATOR(InterestManager); - - InterestManager(); - ~InterestManager(); - - /** - * Initialize manager with a descriptor - */ - void Init(const InterestManagerDesc& desc); - - /** - * Returns true if InterestManager is initialized and is ready to use - */ - bool IsReady() const; - - /** - * Register new handler with a given type and instance - */ - void RegisterHandler(BaseRulesHandler* handler); - - /** - * Unregister handler - */ - void UnregisterHandler(BaseRulesHandler* handler); - - /** - * Call to update current replica->peers cache - */ - void Update(); - - /** - * Returns replica manager IM is bount to - */ - ReplicaManager* GetReplicaManager() { return m_rm; } - private: - InterestManager(const InterestManager&) = delete; - InterestManager& operator=(const InterestManager&) = delete; - - InterestHandlerSlot GetNewSlot(); - void FreeSlot(InterestHandlerSlot slot); - bool ShouldForward(Replica* replica, ReplicaPeer* peer) const; - - ReplicaManager* m_rm; - vector m_handlers; - InterestHandlerSlot m_freeSlots; - }; -} // namespace GridMate - -#endif // GM_REPLICA_INTERESTMANAGER_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp deleted file mode 100644 index 7c69b45794..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.cpp +++ /dev/null @@ -1,25 +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 - -namespace GridMate -{ - InterestQueryResult::InterestQueryResult() - { - - } - - InterestQueryResult::PeerList& InterestQueryResult::Insert(ReplicaId repId) - { - auto it = m_matches.insert_key(repId); - return it.first->second; - } -} // namespace GridMate - -*/ diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h b/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h deleted file mode 100644 index 45213bd855..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/InterestQueryResult.h +++ /dev/null @@ -1,25 +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 - * - */ -#ifndef GM_REPLICA_INTERESTQUERYRESULT_H -#define GM_REPLICA_INTERESTQUERYRESULT_H -/* -#include - -#include -#include -#include -#include - -namespace GridMate -{ - - using InterestPeerList = vector; - using InterestQueryResult = unordered_map; -} // GridMate -*/ -#endif // GM_REPLICA_INTERESTQUERYRESULT_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h b/Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h deleted file mode 100644 index 0c20063908..0000000000 --- a/Code/Framework/GridMate/GridMate/Replica/Interest/RulesHandler.h +++ /dev/null @@ -1,65 +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 - * - */ -#ifndef GM_REPLICA_RULES_HANDLER_H -#define GM_REPLICA_RULES_HANDLER_H - -#include - -#include - -namespace GridMate -{ - class InterestManager; - - /** - * BaseRulesHandler: base handler class - * RulesHandler's job is to provide InterestManager with matching pairs of attributes and rules. - */ - class BaseRulesHandler - { - public: - BaseRulesHandler() - : m_slot(0) - {} - - virtual ~BaseRulesHandler() { }; - - /** - * Ticked by interest manager to retrieve new matches or mismatches of interests - */ - virtual void Update() = 0; - - /** - * Returns result of a previous update - * This only returns changes that happened on the previous tick not the whole world state - */ - virtual const InterestMatchResult& GetLastResult() = 0; - - /** - * Called by InterestManager when the given handler instance is registered - */ - virtual void OnRulesHandlerRegistered(InterestManager* manager) = 0; - - /** - * Called by InterestManager when the given handler is unregistered - */ - virtual void OnRulesHandlerUnregistered(InterestManager* manager) = 0; - - /** - * Returns interest mananger this handler is bound to, or nullptr if it's unbound - */ - virtual InterestManager* GetManager() = 0; - - private: - friend class InterestManager; - - InterestHandlerSlot m_slot; - }; -} // namespace GridMate - -#endif // GM_REPLICA_RULES_HANDLER_H diff --git a/Code/Framework/GridMate/GridMate/Replica/Replica.h b/Code/Framework/GridMate/GridMate/Replica/Replica.h index a70acd5201..9f4e5488fa 100644 --- a/Code/Framework/GridMate/GridMate/Replica/Replica.h +++ b/Code/Framework/GridMate/GridMate/Replica/Replica.h @@ -29,8 +29,7 @@ namespace GridMate class ReplicaStatus; class ReplicaTask; - class InterestManager; - + //------------------------------------------------------------------------- // Replica //------------------------------------------------------------------------- @@ -55,7 +54,6 @@ namespace GridMate friend class ReplicaMarshalNewTask; - friend class InterestManager; friend class ReplicaTarget; enum Flags diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h index bd9f1a1ee9..30317d4227 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h @@ -329,7 +329,6 @@ namespace GridMate friend class ReplicaUpdateTaskBase; friend class ReplicaDestroyPeerTask; friend class SendLimitProcessPolicy; - friend class InterestManager; typedef unordered_map UserContextMapType; typedef unordered_map ReplicaMap; diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h index be1a86b627..af914fb504 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaTarget.h @@ -46,8 +46,6 @@ namespace GridMate */ class ReplicaTarget { - friend class InterestManager; - public: static ReplicaTarget* AddReplicaTarget(ReplicaPeer* peer, Replica* replica); diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 2646660eba..a95250a66c 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -78,11 +78,6 @@ set(FILES Replica/Tasks/ReplicaProcessPolicy.cpp Replica/Tasks/ReplicaProcessPolicy.h Replica/Tasks/ReplicaPriorityPolicy.h - Replica/Interest/InterestDefs.h - Replica/Interest/InterestManager.cpp - Replica/Interest/InterestManager.h - Replica/Interest/InterestQueryResult.h - Replica/Interest/RulesHandler.h Serialize/Buffer.cpp Serialize/Buffer.h Serialize/PackedSize.h From 583020b3ae3e5721f4673c8e940381eda53352fc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 10:43:31 -0800 Subject: [PATCH 147/394] =?UTF-8?q?=EF=BB=BFRemoves=20unused=20files=20fro?= =?UTF-8?q?m=20AsetProcessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/AssetBuilderApplicationTests.cpp | 1 + .../AssetBuilderSDK/AssetBuilderEBusHelper.h | 67 --------- .../assetprocessor_windows_files.cmake | 1 - .../Platform/Windows/native/resource.h | 26 ---- .../assetprocessor_test_files.cmake | 1 - .../native/AssetManager/AssetData.h | 134 ------------------ .../native/AssetManager/assetdata.cpp | 16 --- .../tests/resourcecompiler/RCJobTest.cpp | 2 - .../native/tests/resourcecompiler/RCJobTest.h | 13 -- 9 files changed, 1 insertion(+), 260 deletions(-) delete mode 100644 Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h delete mode 100644 Code/Tools/AssetProcessor/Platform/Windows/native/resource.h delete mode 100644 Code/Tools/AssetProcessor/native/AssetManager/AssetData.h delete mode 100644 Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp delete mode 100644 Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h diff --git a/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp b/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp index 679b4a0a04..1b86c3aa2c 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/Tests/AssetBuilderApplicationTests.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h deleted file mode 100644 index 6a29e0c36a..0000000000 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderEBusHelper.h +++ /dev/null @@ -1,67 +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 - * - */ -#ifndef ASSETBUILDERUTILEBUSHELPER_H -#define ASSETBUILDERUTILEBUSHELPER_H - -#include -#include -#include -#include -#include - -namespace AssetBuilderSDK -{ - //!This EBUS is used to send commands from the assetprocessor to the builder - class AssetBuilderCommandBusTraits - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - typedef AZ::Uuid BusIdType; - typedef AZStd::recursive_mutex MutexType; - - virtual ~AssetBuilderCommandBusTraits() {} - - //Shutdown the builder. - virtual void ShutDown() {} - }; - - typedef AZ::EBus AssetBuilderCommandBus; - - //!Information that builders will send to the assetprocessor - struct AssetBuilderDesc - { - AZStd::string m_name;//builder name - AZStd::string m_regex;//builder regex - AZ::Uuid m_busId;// builder id - }; - - //!This EBUS is used to send information from the builder to the AssetProcessor - class AssetBuilderBusTraits - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - typedef AZStd::recursive_mutex MutexType; - - virtual ~AssetBuilderBusTraits() {} - - //Use this function to send AssetBuilderDesc info to the assetprocessor - virtual void RegisterBuilderInformation(AssetBuilderDesc builderDesc) {} - - //Use this function to register all the component descriptors - virtual void RegisterComponentDescriptor(AZ::ComponentDescriptor* descriptor) {} - }; - - typedef AZ::EBus AssetBuilderBus; -} - - -#endif //ASSETBUILDERUTILEBUSHELPER_H diff --git a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake index 96dd7434c1..39e697bf40 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake @@ -10,5 +10,4 @@ set(FILES native/FileWatcher/FileWatcher_platform.h native/FileWatcher/FileWatcher_windows.cpp native/FileWatcher/FileWatcher_windows.h - native/resource.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/resource.h b/Code/Tools/AssetProcessor/Platform/Windows/native/resource.h deleted file mode 100644 index 38259ae0f0..0000000000 --- a/Code/Tools/AssetProcessor/Platform/Windows/native/resource.h +++ /dev/null @@ -1,26 +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 - * - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Editor.rc -// -#define IDI_ICON1 2 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 3 -#define _APS_NEXT_COMMAND_VALUE 32769 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 -#endif -#endif diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index a7a46ad62c..20ab4b706d 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -25,7 +25,6 @@ set(FILES native/tests/resourcecompiler/RCControllerTest.cpp native/tests/resourcecompiler/RCControllerTest.h native/tests/resourcecompiler/RCJobTest.cpp - native/tests/resourcecompiler/RCJobTest.h native/tests/assetBuilderSDK/assetBuilderSDKTest.h native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp native/tests/assetBuilderSDK/SerializationDependenciesTests.cpp diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetData.h b/Code/Tools/AssetProcessor/native/AssetManager/AssetData.h deleted file mode 100644 index a03d831283..0000000000 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetData.h +++ /dev/null @@ -1,134 +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 - * - */ -#ifndef ASSETPROCESSOR_ASSETDATA_H -#define ASSETPROCESSOR_ASSETDATA_H - -#include -#include -#include -#include -#include -#include -#include - -namespace AssetProcessor -{ - using namespace AzToolsFramework::AssetDatabase; - - //Check the extension of all the products - //return true if any one of the product extension matches the input extension, else return false - bool CheckProductsExtension( const ProductDatabseEntryContainer& products, const char* ext ); - - //! this is the interface which we use to speak to the legacy database tables. - // its known as the legacy database interface because the forthcoming tables will completely replace these - // but this layer exits for compatibility with the previous version and allows us to upgrade in place. - class AssetDatabaseInterface - { - public: - - AssetDatabaseInterface() - { - qRegisterMetaType( "SourceEntry" ); - qRegisterMetaType( "ProductEntry" ); - qRegisterMetaType( "SourceEntryContainer" ); - qRegisterMetaType( "ProductEntryContainer" ); - } - - virtual ~AssetDatabaseInterface() - { - } - - //! Returns true if the database or file exists already - virtual bool DataExists() = 0; - - //! Actually connects to the database, loads it, or creates empty database depending on above. - virtual void LoadData() = 0; - - //! Use with care. Resets all data! This causes an immediate commit and save! - virtual void ClearData() = 0; - - //! Retrieve the scan folders - virtual void GetScanFolders(QStringList& scanFolderList) = 0; - - //! Retrieves a specific scan folder by id, return false if not found - virtual bool GetScanFolder(AZ::s64 scanFolderID, QString& scanFolder) = 0; - - //! Adds a scan folder - virtual AZ::s64 AddScanFolder(QString scanFolder) = 0; - - // ! remove a scanfolder - virtual void RemoveScanFolder(AZ::s64 scanFolderID) = 0; - virtual void RemoveScanFolder(QString scanFolder) = 0; - - //! query the scanFolder ID for a given folder, return false if not found - virtual bool GetScanFolderID(QString scanfolder, AZ::s64& scanFolderID) = 0; - - //! query the sourceID of a source - virtual bool GetSourceID(QString sourceName, QString jobDescription, AZ::s64& sourceID) = 0; - - //! Retrieve the fingerprint for a given source name on a given platform for a particular jobDescription - //! This could return zero if its never seen this file before. - virtual bool GetFingerprintForSource(QString sourceName, QString jobDescription, AZ::u32& fingerprint) = 0; - - //! Set the fingerprint for the given source name, platform and jobDescription to the value provided - //! If updating a existing fingerprint you do not have to supply guid or scanfolderid - virtual void SetSource(QString sourceName, QString jobDescription, AZ::u32 fingerprint, AZ::Uuid guid = AZ::Uuid::CreateNull(), AZ::s64 scanFolderID = 0) = 0; - - //! Removing a fingerprint will destroy its entry in the database - //! and any entries that refer to it (products, etc). if you want to merely set it dirty - //! Then instead call SetSource to zero - virtual void RemoveSource(QString sourceName, QString jobDescription) = 0; - virtual void RemoveSource(AZ::s64 sourceID) = 0; - - //! Given a source name, jobDescription, and platform return the list of products by the last compile of that file - //! returns false if it doesn't know about source or if the source did not emitted any products. - virtual bool GetProductsForSource(QString sourceName, QString jobDescription, ProductDatabseEntryContainer& products, QString platform = QString()) = 0; - - //! Given a source name and platform return the list of all jobDescriptions associated with them from the last compile of that file - //! returns false if it doesn't know about any job description for that source and platform. - virtual bool GetJobDescriptionsForSource(QString sourceName, QStringList& jobDescription) = 0; - - //! Given an product file name, compute source file name - //! False is returned if its never heard of that product. - virtual bool GetSourceFromProductName(QString productName, SourceDatabaseEntry& source) = 0; - - //! For a given source, set the list of products for that source. - //! Removes any data that's present and overwrites it with the new list - //! Note that an empty list is acceptable data, it means the source emitted no products - virtual void SetProductsForSource(QString sourceName, QString jobDescription, const ProductDatabseEntryContainer& productList = ProductDatabseEntryContainer(), QString platform = QString()) = 0; - - //! Clear the products for a given source. This removes the entry entirely, not just sets it to empty. - virtual void RemoveProducts(QString sourceName, QString jobDescription, QString platform = QString()) = 0; - virtual void RemoveProduct(AZ::s64 productID) = 0; - - //! GetMatchingProductFiles - checks the database for all products that begin with the given match check - //! Note that the input string is expected to not include the cache folder - //! so it probably starts with platform name. - virtual void GetMatchingProducts(QString matchCheck, ProductDatabseEntryContainer& products, QString platform = QString()) = 0; - - //! GetMatchingSourceFiles - checks the database for all source files that begin with the given match check - //! note that the input string is expected to be the relative path name - //! and the output is the relative name (so to convert it to a full path, you will need to call the appropriate function) - virtual void GetMatchingSources(QString matchCheck, SourceDatabaseEntryContainer& sources) = 0; - - //! Get a giant list of ALL known source files in the database. - virtual void GetSources(SourceDatabaseEntryContainer& sources) = 0; - - //! Get a giant list of ALL known products in the database. - virtual void GetProducts(ProductDatabseEntryContainer& products, QString platform = QString()) = 0; - - //! finds all elements in the database that ends with the given input. (Used to look things up by extensions, in general) - virtual void GetSourcesByExtension(QString extension, SourceDatabaseEntryContainer& sources) = 0; - - //! SetJobLogForSource updates the Job Log table to record the status of a particular job. - //! It also sets all prior jobs that match that job exactly to not be the "latest one" but keeps them in the database. - virtual void SetJobLogForSource(AZ::s64 jobId, const AZStd::string& sourceName, const AZStd::string& platform, const AZ::Uuid& builderUuid, const AZStd::string& jobKey, AzToolsFramework::AssetProcessor::JobStatus status) = 0; - }; -} // namespace AssetProcessor - -#endif // ASSETPROCESSOR_ASSETDATA_H diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp deleted file mode 100644 index aa433ebb3e..0000000000 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetdata.cpp +++ /dev/null @@ -1,16 +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 "AssetData.h" -#include -#include - -namespace AssetProcessor -{ - -} - diff --git a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp index e639e75351..aad990ac72 100644 --- a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.cpp @@ -6,8 +6,6 @@ * */ -#include "RCJobTest.h" - #include #include diff --git a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h deleted file mode 100644 index cd9c8a108e..0000000000 --- a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCJobTest.h +++ /dev/null @@ -1,13 +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 - - From a9d8a5dcb3b43816105089e7c001fac7a8796249 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:35:16 -0800 Subject: [PATCH 148/394] Removes BufferedDataStream and FileStreamDataSource from CrashHandler Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../include/Uploader/BufferedDataStream.h | 32 ----------------- .../include/Uploader/FileStreamDataSource.h | 30 ---------------- .../Uploader/src/BufferedDataStream.cpp | 34 ------------------- .../Uploader/src/FileStreamDataSource.cpp | 29 ---------------- 4 files changed, 125 deletions(-) delete mode 100644 Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h delete mode 100644 Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h delete mode 100644 Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp delete mode 100644 Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h deleted file mode 100644 index 944fde999d..0000000000 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h +++ /dev/null @@ -1,32 +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 O3de -{ - class BufferedDataStream : public crashpad::MinidumpUserExtensionStreamDataSource - { - public: - BufferedDataStream(uint32_t stream_type, const void* data, size_t data_size); - - size_t StreamDataSize() override; - bool ReadStreamData(Delegate* delegate) override; - - private: - std::vector data_; - - BufferedDataStream(const BufferedDataStream& rhs) = delete; - BufferedDataStream& operator=(const BufferedDataStream& rhs) = delete; - }; - -} diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h deleted file mode 100644 index 6a3e11728c..0000000000 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h +++ /dev/null @@ -1,30 +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 "base/files/file_path.h" - -namespace O3de -{ - class FileStreamDataSource : public crashpad::UserStreamDataSource - { - public: - FileStreamDataSource(const base::FilePath& filePath); - - std::unique_ptr ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) override; - - private: - FileStreamDataSource(const FileStreamDataSource& rhs) = delete; - FileStreamDataSource& operator=(const FileStreamDataSource& rhs) = delete; - - base::FilePath m_filePath; - }; -} diff --git a/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp b/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp deleted file mode 100644 index b4350b29d5..0000000000 --- a/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp +++ /dev/null @@ -1,34 +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 - -namespace O3de -{ - BufferedDataStream::BufferedDataStream(uint32_t stream_type, const void* data, size_t data_size) - : crashpad::MinidumpUserExtensionStreamDataSource(stream_type) - { - data_.resize(data_size); - - if (data_size) - { - memcpy(data_.data(), data, data_size); - } - } - - size_t BufferedDataStream::StreamDataSize() - { - return data_.size(); - } - - bool BufferedDataStream::ReadStreamData(Delegate* delegate) - { - return delegate->ExtensionStreamDataSourceRead(data_.size() ? data_.data() : nullptr, data_.size()); - } -} - diff --git a/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp b/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp deleted file mode 100644 index f490189057..0000000000 --- a/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp +++ /dev/null @@ -1,29 +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 - -namespace O3de -{ - FileStreamDataSource::FileStreamDataSource(const base::FilePath& filePath) : - m_filePath{ filePath } - { - - } - - std::unique_ptr FileStreamDataSource::ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) - { - static constexpr char testBuffer[] = "Test Data From buffer."; - - return std::make_unique( 0xCAFEBABE, testBuffer, sizeof(testBuffer)); - } -} - From f9f427bd9ceb0bb800cca1b77470abf3d3747835 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:47:37 -0800 Subject: [PATCH 149/394] Remove unused test files from SceneAPI/SceneBuilder Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../SceneBuilder/Tests/TestFbxMesh.cpp | 181 ------------------ .../SceneAPI/SceneBuilder/Tests/TestFbxMesh.h | 86 --------- .../SceneBuilder/Tests/TestFbxNode.cpp | 34 ---- .../SceneAPI/SceneBuilder/Tests/TestFbxNode.h | 37 ---- .../SceneBuilder/Tests/TestFbxSkin.cpp | 91 --------- .../SceneAPI/SceneBuilder/Tests/TestFbxSkin.h | 50 ----- 6 files changed, 479 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp delete mode 100644 Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp deleted file mode 100644 index 4451f0ae93..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.cpp +++ /dev/null @@ -1,181 +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 -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - TestFbxMesh::TestFbxMesh() - : m_vertexControlPoints(nullptr) - , m_vertexCount(0) - , m_polygonVertexIndices(nullptr) - , m_materialIndices(new FbxLayerElementArrayTemplate(eFbxInt)) - , m_uvElements(FbxGeometryElementUV::Create(nullptr, "TestElements_UV")) - , m_vertexColorElements(FbxGeometryElementVertexColor::Create(nullptr, "TestElements_VertexColors")) - , m_expectedVertexCount(0) - { - } - - int TestFbxMesh::GetDeformerCount() const - { - // For current test need, only have one skin for the mesh - return m_skin ? 1 : 0; - } - - AZStd::shared_ptr TestFbxMesh::GetSkin(int index) const - { - // For current test need, only have one skin for the mesh - return m_skin; - } - - bool TestFbxMesh::GetMaterialIndices(FbxLayerElementArrayTemplate** lockableArray) const - { - *lockableArray = m_materialIndices; - return true; - } - - int TestFbxMesh::GetControlPointsCount() const - { - return static_cast(m_vertexCount); - } - - AZStd::vector TestFbxMesh::GetControlPoints() const - { - return m_vertexControlPoints; - } - - int TestFbxMesh::GetPolygonCount() const - { - return static_cast(m_polygonInfo.size()); - } - - int TestFbxMesh::GetPolygonSize(int polygonIndex) const - { - if (m_polygonInfo.find(polygonIndex) != m_polygonInfo.end()) - { - return aznumeric_caster(m_polygonInfo.find(polygonIndex)->second.m_vertexCount); - } - return -1; - } - - int* TestFbxMesh::GetPolygonVertices() const - { - return m_polygonVertexIndices; - } - - int TestFbxMesh::GetPolygonVertexIndex(int polygonIndex) const - { - if (m_polygonInfo.find(polygonIndex) != m_polygonInfo.end()) - { - return aznumeric_caster(m_polygonInfo.find(polygonIndex)->second.m_startVertexIndex); - } - return -1; - } - - FbxUVWrapper TestFbxMesh::GetElementUV(int index) - { - (void)index; - return m_uvElements; - } - - int TestFbxMesh::GetElementUVCount() const - { - return 1; - } - - FbxVertexColorWrapper TestFbxMesh::GetElementVertexColor(int index) - { - (void)index; - return m_vertexColorElements; - } - - int TestFbxMesh::GetElementVertexColorCount() const - { - return 1; - } - - bool TestFbxMesh::GetPolygonVertexNormal(int polyIndex, int vertexIndex, Vector3& normal) const - { - normal = Vector3(1.0f, 0.0f, 0.0f); - return true; - } - - void TestFbxMesh::CreateMesh(std::vector& points, std::vector >& polygonVertexIndices) - { - m_vertexControlPoints.clear(); - m_materialIndices->Clear(); - m_polygonInfo.clear(); - - // Create fbx control point (position) data, and associated material index data - m_vertexCount = aznumeric_caster(points.size()); - m_vertexControlPoints.reserve(points.size()); - for (unsigned int i = 0; i < points.size(); ++i) - { - m_vertexControlPoints.push_back(Vector3(points[i].GetX(), points[i].GetY(), points[i].GetZ())); - m_materialIndices->Add(i); - } - - // Create fbx face data - m_expectedVertexCount = 0; - for (const std::vector& onePolygonIndices : polygonVertexIndices) - { - for (const int& index : onePolygonIndices) - { - m_expectedVertexCount++; - } - } - if (m_polygonVertexIndices) - { - delete m_polygonVertexIndices; - } - m_polygonVertexIndices = new int[m_expectedVertexCount]; - size_t i = 0; - for (const std::vector& onePolygonIndices : polygonVertexIndices) - { - m_polygonInfo.insert(std::make_pair(aznumeric_caster(m_polygonInfo.size()), - TestFbxPolygon(i, aznumeric_caster(onePolygonIndices.size())))); - for (const int& index : onePolygonIndices) - { - m_polygonVertexIndices[i] = index; - i++; - } - } - } - - void TestFbxMesh::SetSkin(const AZStd::shared_ptr& skin) - { - m_skin = skin; - } - - void TestFbxMesh::CreateExpectMeshInfo(std::vector >& expectedFaceVertexIndices) - { - m_expectedFaceVertexIndices = expectedFaceVertexIndices; - } - - size_t TestFbxMesh::GetExpectedVetexCount() const - { - return m_expectedVertexCount; - } - - size_t TestFbxMesh::GetExpectedFaceCount() const - { - return m_expectedFaceVertexIndices.size(); - } - - AZ::Vector3 TestFbxMesh::GetExpectedFaceVertexPosition(unsigned int faceIndex, unsigned int vertexIndex) const - { - return m_vertexControlPoints[m_expectedFaceVertexIndices[faceIndex][vertexIndex]]; - } - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h deleted file mode 100644 index 68f2e1f19b..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxMesh.h +++ /dev/null @@ -1,86 +0,0 @@ -#pragma once - -/* - * 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 -#include - -namespace AZ -{ - namespace FbxSDKWrapper - { - struct TestFbxPolygon - { - size_t m_startVertexIndex; - size_t m_vertexCount; - - TestFbxPolygon(size_t startVertexIndex, size_t vertexCount) - : m_startVertexIndex(startVertexIndex) - , m_vertexCount(vertexCount) - { - } - }; - - // TestFbxMesh - // FbxMesh Test Data creation - class TestFbxMesh - : public FbxMeshWrapper - { - public: - TestFbxMesh(); - ~TestFbxMesh() override = default; - - int GetDeformerCount() const override; - AZStd::shared_ptr GetSkin(int index) const override; - bool GetMaterialIndices(FbxLayerElementArrayTemplate** lockableArray) const override; - - int GetControlPointsCount() const; - AZStd::vector GetControlPoints() const override; - - int GetPolygonCount() const override; - int GetPolygonSize(int polygonIndex) const override; - int* GetPolygonVertices() const override; - int GetPolygonVertexIndex(int polygonIndex) const; - - FbxUVWrapper GetElementUV(int index = 0) override; - int GetElementUVCount() const override; - FbxVertexColorWrapper GetElementVertexColor(int index = 0) override; - int GetElementVertexColorCount() const override; - - bool GetPolygonVertexNormal(int polyIndex, int vertexIndex, Vector3& normal) const override; - - // Create test data APIs - void CreateMesh(std::vector& points, std::vector >& polygonVertexIndices); - void CreateExpectMeshInfo(std::vector >& expectedFaceVertexIndices); - void SetSkin(const AZStd::shared_ptr& skin); - - size_t GetExpectedVetexCount() const; - size_t GetExpectedFaceCount() const; - AZ::Vector3 GetExpectedFaceVertexPosition(unsigned int faceIndex, unsigned int vertexIndex) const; - - protected: - AZStd::vector m_vertexControlPoints; // vertex positions - size_t m_vertexCount; - int* m_polygonVertexIndices; // store all polygons' vertex indices in sequence. Each index maps to a control point. - FbxLayerElementArrayTemplate* m_materialIndices; - std::unordered_map m_polygonInfo; - - FbxUVWrapper m_uvElements; - FbxVertexColorWrapper m_vertexColorElements; - AZStd::shared_ptr m_skin; - - // Expected converted data - unsigned int m_expectedVertexCount; - std::vector > m_expectedFaceVertexIndices; - }; - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp deleted file mode 100644 index 0217044515..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.cpp +++ /dev/null @@ -1,34 +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 - -namespace AZ -{ - namespace FbxSDKWrapper - { - const std::shared_ptr TestFbxNode::GetMesh() const - { - return m_testFbxMesh; - } - - const char* TestFbxNode::GetName() const - { - return m_name.c_str(); - } - - void TestFbxNode::SetMesh(std::shared_ptr testFbxMesh) - { - m_testFbxMesh = testFbxMesh; - } - - void TestFbxNode::SetName(const char* name) - { - m_name = name; - } - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h deleted file mode 100644 index ede0eb801c..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxNode.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -/* - * 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 - -namespace AZ -{ - namespace FbxSDKWrapper - { - // TestFbxNode - // FbxNode Test Data creation - class TestFbxNode - : public FbxNodeWrapper - { - public: - ~TestFbxNode() override = default; - - const std::shared_ptr GetMesh() const override; - const char* GetName() const override; - - void SetMesh(std::shared_ptr testFbxMesh); - void SetName(const char* name); - - protected: - std::shared_ptr m_testFbxMesh; - AZStd::string m_name; - }; - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp deleted file mode 100644 index 9225f907b1..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.cpp +++ /dev/null @@ -1,91 +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 FbxSDKWrapper - { - const char* TestFbxSkin::GetName() const - { - return m_name.c_str(); - } - - int TestFbxSkin::GetClusterCount() const - { - return aznumeric_caster(m_links.size()); - } - - int TestFbxSkin::GetClusterControlPointIndicesCount(int index) const - { - return aznumeric_caster(m_controlPointIndices[index].size()); - } - - int TestFbxSkin::GetClusterControlPointIndex(int clusterIndex, int pointIndex) const - { - return m_controlPointIndices[clusterIndex][pointIndex]; - } - - double TestFbxSkin::GetClusterControlPointWeight(int clusterIndex, int pointIndex) const - { - return m_weights[clusterIndex][pointIndex]; - } - - AZStd::shared_ptr TestFbxSkin::GetClusterLink(int index) const - { - return m_links[index]; - } - - void TestFbxSkin::SetName(const char* name) - { - m_name = name; - } - - void TestFbxSkin::CreateSkinWeightData(AZStd::vector& boneNames, AZStd::vector>& weights, AZStd::vector>& controlPointIndices) - { - m_links.resize(boneNames.size()); - for (size_t linkIndex = 0; linkIndex < boneNames.size(); ++linkIndex) - { - m_links[linkIndex] = AZStd::make_shared(); - m_links[linkIndex]->SetName(boneNames[linkIndex].c_str()); - } - m_weights = weights; - m_controlPointIndices = controlPointIndices; - } - - void TestFbxSkin::CreateExpectSkinWeightData(AZStd::vector>& boneIds, AZStd::vector>& weights) - { - m_expectedBoneIds = boneIds; - m_expectedWeights = weights; - } - - size_t TestFbxSkin::GetExpectedVertexCount() const - { - return m_expectedBoneIds.size(); - } - - size_t TestFbxSkin::GetExpectedLinkCount(size_t vertexIndex) const - { - return m_expectedBoneIds[vertexIndex].size(); - } - - int TestFbxSkin::GetExpectedSkinLinkBoneId(size_t vertexIndex, size_t linkIndex) const - { - return m_expectedBoneIds[vertexIndex][linkIndex]; - } - - float TestFbxSkin::GetExpectedSkinLinkWeight(size_t vertextIndex, size_t linkIndex) const - { - return m_expectedWeights[vertextIndex][linkIndex]; - } - } -} diff --git a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h b/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h deleted file mode 100644 index b90353e6a7..0000000000 --- a/Code/Tools/SceneAPI/SceneBuilder/Tests/TestFbxSkin.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -/* - * 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 - -namespace AZ -{ - namespace FbxSDKWrapper - { - class TestFbxSkin - : public FbxSkinWrapper - { - public: - ~TestFbxSkin() override = default; - - const char* GetName() const override; - int GetClusterCount() const override; - int GetClusterControlPointIndicesCount(int index) const override; - int GetClusterControlPointIndex(int clusterIndex, int pointIndex) const override; - double GetClusterControlPointWeight(int clusterIndex, int pointIndex) const override; - AZStd::shared_ptr GetClusterLink(int index) const override; - - void SetName(const char* name); - void CreateSkinWeightData(AZStd::vector& boneNames, AZStd::vector>& weights, AZStd::vector>& controlPointIndices); - void CreateExpectSkinWeightData(AZStd::vector>& boneIds, AZStd::vector>& weights); - - size_t GetExpectedVertexCount() const; - size_t GetExpectedLinkCount(size_t vertexIndex) const; - int GetExpectedSkinLinkBoneId(size_t vertexIndex, size_t linkIndex) const; - float GetExpectedSkinLinkWeight(size_t vertexIndex, size_t linkIndex) const; - - protected: - AZStd::string m_name; - AZStd::vector> m_links; - AZStd::vector> m_weights; - AZStd::vector> m_controlPointIndices; - - AZStd::vector> m_expectedBoneIds; - AZStd::vector> m_expectedWeights; - }; - } -} From 7d2e53ca7a7d81b8fb1b059cc2ae57721e54bc36 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 13:27:17 -0800 Subject: [PATCH 150/394] Remove unused files from SceneCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GraphData/MockIMeshVertexColorData.h | 38 --------------- .../GraphData/MockIMeshVertexUVData.h | 39 --------------- .../DataTypes/GraphData/MockITransform.h | 36 -------------- .../Mocks/DataTypes/Groups/MockIMeshGroup.h | 48 ------------------- .../DataTypes/Rules/MockIBlendShapeRule.h | 30 ------------ .../DataTypes/Rules/MockIMeshAdvancedRule.h | 48 ------------------- .../SceneCore/scenecore_testing_files.cmake | 1 - 7 files changed, 240 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h delete mode 100644 Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h deleted file mode 100644 index 122152ae41..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexColorData.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -/* - * 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 - -namespace AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshVertexColorData - : public IMeshVertexColorData - { - public: - AZ_RTTI(MockIMeshVertexColorData, "{15AD4D4A-BFCC-41C3-B9BB-F7EFBA0AE0CC}", IMeshVertexColorData) - - virtual ~MockIMeshVertexColorData() = default; - - MOCK_CONST_METHOD0(GetCustomName, - const AZ::Name& ()); - - MOCK_CONST_METHOD0(GetCount, - size_t()); - MOCK_CONST_METHOD1(GetColor, - const Color&(size_t index)); - }; - } // namespace DataTypes - } //namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h deleted file mode 100644 index 28b2039fa5..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockIMeshVertexUVData.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -/* - * 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 AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshVertexUVData - : public IMeshVertexUVData - { - public: - AZ_RTTI(MockIMeshVertexUVData, "{34528E85-2EE0-4999-B838-113BEDB1A258}", IMeshVertexUVData); - - ~MockIMeshVertexUVData() override = default; - - MOCK_CONST_METHOD0(GetCustomName, - const AZ::Name& ()); - - MOCK_CONST_METHOD0(GetCount, - size_t()); - MOCK_CONST_METHOD1(GetUV, - const AZ::Vector2&(size_t index)); - }; - } // DataTypes - } // SceneAPI -} // AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h deleted file mode 100644 index ce396e4d63..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/GraphData/MockITransform.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -/* - * 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 - -namespace AZ -{ - class Transform; - namespace SceneAPI - { - namespace DataTypes - { - class MockITransform - : public ITransform - { - public: - AZ_RTTI(MockITransform, "{1D4A832F-823C-4A80-97E1-A95D1B2BF18F}", ITransform); - - virtual ~MockITransform() override = default; - - MOCK_METHOD0(GetMatrix, - AZ::SceneAPI::DataTypes::MatrixType&()); - MOCK_CONST_METHOD0(GetMatrix, - const AZ::SceneAPI::DataTypes::MatrixType&()); - }; - } // DataTypes - } // SceneAPI -} // AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h deleted file mode 100644 index e4bb07ace1..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Groups/MockIMeshGroup.h +++ /dev/null @@ -1,48 +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 -#include - -namespace AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshGroup - : public IMeshGroup - { - public: - AZ_RTTI(MockIMeshGroup, "{AB119B84-E6D8-4CF3-9456-E44B23EDCDFE}", IMeshGroup); - - // IMeshGroup - MOCK_METHOD0(GetSceneNodeSelectionList, - ISceneNodeSelectionList&()); - MOCK_CONST_METHOD0(GetSceneNodeSelectionList, - const ISceneNodeSelectionList&()); - MOCK_CONST_METHOD0(GetId, - const Uuid&()); - MOCK_METHOD1(SetName, - void(AZStd::string&&)); - MOCK_METHOD1(OverrideId, - void(const Uuid&)); - - // IGroup - MOCK_CONST_METHOD0(GetName, - const AZStd::string&()); - - MOCK_METHOD0(GetRuleContainer, Containers::RuleContainer&()); - MOCK_CONST_METHOD0(GetRuleContainerConst, const Containers::RuleContainer&()); - }; - } // namespace DataTypes - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h deleted file mode 100644 index e32e858041..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIBlendShapeRule.h +++ /dev/null @@ -1,30 +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::SceneAPI::DataTypes { class IMockSceneNodeSelectionList; } - -namespace AZ::SceneAPI::DataTypes -{ - class MockIBlendShapeRule - : public IBlendShapeRule - { - public: - ISceneNodeSelectionList& GetSceneNodeSelectionList() override - { - return const_cast(static_cast(this)->GetSceneNodeSelectionList()); - } - - MOCK_CONST_METHOD0(GetSceneNodeSelectionList, const ISceneNodeSelectionList&()); - }; -} // namespace AZ::SceneAPI::DataTypes diff --git a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h b/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h deleted file mode 100644 index d729e6f59b..0000000000 --- a/Code/Tools/SceneAPI/SceneCore/Mocks/DataTypes/Rules/MockIMeshAdvancedRule.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -/* - * 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 AZ -{ - namespace SceneAPI - { - namespace DataTypes - { - class MockIMeshAdvancedRule - : public IMeshAdvancedRule - { - public: - AZ_RTTI(MockIMeshAdvancedRule, "{6F67873D-778C-4D11-8818-B1906E60B67D}", IMeshAdvancedRule); - - virtual ~MockIMeshAdvancedRule() override = default; - - MOCK_CONST_METHOD0(Use32bitVertices, - bool()); - MOCK_CONST_METHOD0(MergeMeshes, - bool()); - MOCK_CONST_METHOD0(GetVertexColorStreamName, - const AZStd::string&()); - MOCK_CONST_METHOD0(IsVertexColorStreamDisabled, - bool()); - MOCK_CONST_METHOD1(GetUVStreamName, - AZStd::string&(size_t index)); - MOCK_CONST_METHOD1(IsUVStreamDisabled, - bool(size_t index)); - MOCK_CONST_METHOD0(GetUVStreamCount, - size_t()); - MOCK_CONST_METHOD0(UseCustomNormals, - bool()); - }; - } // DataTypes - } // SceneAPI -} // AZ diff --git a/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake b/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake index 1346af63f6..91b543e5e9 100644 --- a/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake +++ b/Code/Tools/SceneAPI/SceneCore/scenecore_testing_files.cmake @@ -11,7 +11,6 @@ set(FILES Mocks/DataTypes/GraphData/MockIMeshData.h Mocks/DataTypes/MockIGraphObject.h Mocks/DataTypes/Groups/MockIGroup.h - Mocks/DataTypes/Groups/MockIMeshGroup.h Mocks/DataTypes/ManifestBase/MockISceneNodeSelectionList.h Mocks/Events/MockAssetImportRequest.h Tests/TestsMain.cpp From fdd75bbbf50f95e36094795b0a2d7b55d7be247d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:53:44 -0800 Subject: [PATCH 151/394] Removes SceneUIStandaloneAllocator from SceneUI Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../SceneUI/SceneUIStandaloneAllocator.cpp | 36 ------------------- .../SceneUI/SceneUIStandaloneAllocator.h | 27 -------------- .../SceneAPI/SceneUI/SceneUI_files.cmake | 2 -- 3 files changed, 65 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp delete mode 100644 Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp b/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp deleted file mode 100644 index 615d4cc47c..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.cpp +++ /dev/null @@ -1,36 +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 - -namespace AZ -{ - namespace SceneAPI - { - bool SceneUIStandaloneAllocator::m_allocatorInitialized = false; - - void SceneUIStandaloneAllocator::Initialize() - { - if (!AZ::AllocatorInstance().IsReady()) - { - AZ::AllocatorInstance().Create(); - m_allocatorInitialized = true; - } - } - - void SceneUIStandaloneAllocator::TearDown() - { - if (m_allocatorInitialized) - { - AZ::AllocatorInstance().Destroy(); - } - } - } -} diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h b/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h deleted file mode 100644 index 919b3de234..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/SceneUIStandaloneAllocator.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -/* - * 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 - -namespace AZ -{ - namespace SceneAPI - { - class SceneUIStandaloneAllocator - { - public: - SCENE_UI_API static void Initialize(); - SCENE_UI_API static void TearDown(); - - private: - static bool m_allocatorInitialized; - }; - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake index 15adb433fe..992098ae4f 100644 --- a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake +++ b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake @@ -13,8 +13,6 @@ set(FILES ManifestMetaInfoHandler.cpp GraphMetaInfoHandler.h GraphMetaInfoHandler.cpp - SceneUIStandaloneAllocator.h - SceneUIStandaloneAllocator.cpp CommonWidgets/OverlayWidget.h CommonWidgets/OverlayWidgetLayer.h CommonWidgets/JobWatcher.h From 65516e5bd1e7a6ea13a3dd65103a75c6973bb7d0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:58:17 -0800 Subject: [PATCH 152/394] Removes OverlayWidgetLayer from SceneUI Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommonWidgets/OverlayWidgetLayer.h | 29 ----- .../CommonWidgets/OverlayWidgetLayer.ui | 106 ------------------ .../SceneAPI/SceneUI/SceneUI_files.cmake | 1 - 3 files changed, 136 deletions(-) delete mode 100644 Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h delete mode 100644 Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui diff --git a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h b/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h deleted file mode 100644 index 374f91a8ed..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -/* - * 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 - -namespace AZ -{ - namespace SceneAPI - { - namespace UI - { - // left in for backwards compatibility with original SceneAPI code - class OverlayWidgetLayer : public AzQtComponents::OverlayWidgetLayer - { - public: - AZ_CLASS_ALLOCATOR(OverlayWidgetLayer, SystemAllocator, 0) - - using AzQtComponents::OverlayWidgetLayer::OverlayWidgetLayer; - }; - } // namespace UI - } // namespace SceneAPI -} // namespace AZ diff --git a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui b/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui deleted file mode 100644 index 5084f436e3..0000000000 --- a/Code/Tools/SceneAPI/SceneUI/CommonWidgets/OverlayWidgetLayer.ui +++ /dev/null @@ -1,106 +0,0 @@ - - - AZ::SceneAPI::UI::OverlayWidgetLayer - - - - 0 - 0 - 64 - 75 - - - - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - 30 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - QLayout::SetDefaultConstraint - - - 2 - - - 2 - - - 2 - - - 2 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - diff --git a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake index 992098ae4f..724f4f0673 100644 --- a/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake +++ b/Code/Tools/SceneAPI/SceneUI/SceneUI_files.cmake @@ -14,7 +14,6 @@ set(FILES GraphMetaInfoHandler.h GraphMetaInfoHandler.cpp CommonWidgets/OverlayWidget.h - CommonWidgets/OverlayWidgetLayer.h CommonWidgets/JobWatcher.h CommonWidgets/JobWatcher.cpp CommonWidgets/ProcessingOverlayWidget.h From d62438188572c86eb40a8e6d2284f7b4bcc92e73 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 11:41:34 -0800 Subject: [PATCH 153/394] Removes resource/targetver files from LuaIDE Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp | 5 ---- Code/Tools/LuaIDE/Source/Editor/LuaEditor.h | 9 ------ Code/Tools/LuaIDE/Source/Editor/Resource.h | 29 ------------------- Code/Tools/LuaIDE/Source/Editor/targetver.h | 16 ---------- Code/Tools/LuaIDE/lua_ide_files.cmake | 4 --- Code/Tools/LuaIDE/targetver.h | 16 ---------- 6 files changed, 79 deletions(-) delete mode 100644 Code/Tools/LuaIDE/Source/Editor/LuaEditor.h delete mode 100644 Code/Tools/LuaIDE/Source/Editor/Resource.h delete mode 100644 Code/Tools/LuaIDE/Source/Editor/targetver.h delete mode 100644 Code/Tools/LuaIDE/targetver.h diff --git a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp b/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp index f6d905515b..19d2069b17 100644 --- a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp +++ b/Code/Tools/LuaIDE/Source/Editor/LuaEditor.cpp @@ -6,13 +6,8 @@ * */ -#include "LuaEditor.h" #include -#if defined(AZ_COMPILER_MSVC) -#include "resource.h" -#endif - #include #if defined(EXTERNAL_CRASH_REPORTING) diff --git a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.h b/Code/Tools/LuaIDE/Source/Editor/LuaEditor.h deleted file mode 100644 index d2963c0bf0..0000000000 --- a/Code/Tools/LuaIDE/Source/Editor/LuaEditor.h +++ /dev/null @@ -1,9 +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 diff --git a/Code/Tools/LuaIDE/Source/Editor/Resource.h b/Code/Tools/LuaIDE/Source/Editor/Resource.h deleted file mode 100644 index 96dfe0315c..0000000000 --- a/Code/Tools/LuaIDE/Source/Editor/Resource.h +++ /dev/null @@ -1,29 +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 - * - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Editor.rc -// -#define IDC_MYICON 2 -#define IDD_EDITOR_DIALOG 102 -#define IDR_MAINFRAME 128 -#define IDI_ICON1 129 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 110 -#endif -#endif diff --git a/Code/Tools/LuaIDE/Source/Editor/targetver.h b/Code/Tools/LuaIDE/Source/Editor/targetver.h deleted file mode 100644 index 13641a9302..0000000000 --- a/Code/Tools/LuaIDE/Source/Editor/targetver.h +++ /dev/null @@ -1,16 +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 - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include diff --git a/Code/Tools/LuaIDE/lua_ide_files.cmake b/Code/Tools/LuaIDE/lua_ide_files.cmake index e5a7948d97..1506e45c88 100644 --- a/Code/Tools/LuaIDE/lua_ide_files.cmake +++ b/Code/Tools/LuaIDE/lua_ide_files.cmake @@ -7,11 +7,8 @@ # set(FILES - targetver.h Source/StandaloneToolsApplication.cpp Source/StandaloneToolsApplication.h - Source/Editor/Resource.h - Source/Editor/targetver.h Source/Telemetry/TelemetryBus.h Source/Telemetry/TelemetryComponent.cpp Source/Telemetry/TelemetryComponent.h @@ -21,7 +18,6 @@ set(FILES Source/LuaIDEApplication.cpp Source/AssetDatabaseLocationListener.h Source/AssetDatabaseLocationListener.cpp - Source/Editor/LuaEditor.h Source/Editor/LuaEditor.cpp Source/LUA/BasicScriptChecker.h Source/LUA/BreakpointPanel.cpp diff --git a/Code/Tools/LuaIDE/targetver.h b/Code/Tools/LuaIDE/targetver.h deleted file mode 100644 index 13641a9302..0000000000 --- a/Code/Tools/LuaIDE/targetver.h +++ /dev/null @@ -1,16 +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 - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include From 92d77c2b4a700b4695f37d7700da167368b3be4d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 11:53:26 -0800 Subject: [PATCH 154/394] Removes unused files from LuaIDE, Telemetry is not being used, the only ebus called is Initialized, but no "LogEvents are being called. Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LuaIDE/Source/LUA/BasicScriptChecker.h | 27 ------- .../LuaIDE/Source/LUA/LUADebuggerMessages.h | 35 -------- .../LUA/LUATargetContextTrackerMessages.cpp | 15 ---- .../LuaIDE/Source/LUA/ScriptCheckerAPI.h | 40 ---------- .../Source/StandaloneToolsApplication.cpp | 13 +-- .../LuaIDE/Source/Telemetry/TelemetryBus.h | 31 ------- .../Source/Telemetry/TelemetryComponent.cpp | 48 ----------- .../Source/Telemetry/TelemetryComponent.h | 41 ---------- .../Source/Telemetry/TelemetryEvent.cpp | 80 ------------------- .../LuaIDE/Source/Telemetry/TelemetryEvent.h | 45 ----------- Code/Tools/LuaIDE/lua_ide_files.cmake | 9 --- 11 files changed, 1 insertion(+), 383 deletions(-) delete mode 100644 Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h delete mode 100644 Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h delete mode 100644 Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp delete mode 100644 Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp delete mode 100644 Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h diff --git a/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h b/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h deleted file mode 100644 index c24bba2aaa..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/BasicScriptChecker.h +++ /dev/null @@ -1,27 +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 - * - */ - -#ifndef BASICSCRIPTCHECKER_H -#define BASICSCRIPTCHECKER_H - -#include -#include - -namespace LUAEditor -{ - class BasicScriptChecker - { - public: - AZ_CLASS_ALLOCATOR(BasicScriptChecker, AZ::SystemAllocator, 0); - - // eat a script and export any errors: - void ConsumeScript ( - }; - } - -#endif diff --git a/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h b/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h deleted file mode 100644 index d35be7574a..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/LUADebuggerMessages.h +++ /dev/null @@ -1,35 +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 - * - */ - -#ifndef LUADEBUGGER_API_H -#define LUADEBUGGER_API_H - -#include -#include - -#pragma once - -namespace LUADebugger -{ - class Messages - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // Bus configuration - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // we have one bus that we always broadcast to - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Multiple; // we can have multiple listeners. - ////////////////////////////////////////////////////////////////////////// - typedef AZ::EBus Bus; - typedef Bus::Handler Handler; - - virtual ~Messages() {} - }; -}; - -#endif//LUADEBUGGER_API_H diff --git a/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp b/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp deleted file mode 100644 index a54135993d..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/LUATargetContextTrackerMessages.cpp +++ /dev/null @@ -1,15 +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 "LUATargetContextTrackerMessages.h" - - -namespace LUAEditor -{ -} diff --git a/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h b/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h deleted file mode 100644 index 30f912d4d2..0000000000 --- a/Code/Tools/LuaIDE/Source/LUA/ScriptCheckerAPI.h +++ /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 - * - */ - -#ifndef SCRIPTCHECKER_H -#define SCRIPTCHECKER_H - -#include -#include - - -namespace LUAEditor -{ - class ScriptCheckerRequests - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // Bus configuration - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - typedef AZ::EBus Bus; - typedef Bus::Handler Handler; - - virtual void StartScriptingCheck(const BreakpointMap& uniqueBreakpoints) = 0; - virtual void BreakpointHit(const Breakpoint& bp) = 0; - virtual void BreakpointResume() = 0; - - virtual ~ScriptCheckerRequests() {} - }; -} - -#pragma once - -#endif diff --git a/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp b/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp index 6f7f2e8705..f9dac47dc5 100644 --- a/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp +++ b/Code/Tools/LuaIDE/Source/StandaloneToolsApplication.cpp @@ -8,9 +8,6 @@ #include "StandaloneToolsApplication.h" -#include -#include - #include #include #include @@ -38,7 +35,6 @@ namespace StandaloneTools { LegacyFramework::Application::RegisterCoreComponents(); - RegisterComponentDescriptor(Telemetry::TelemetryComponent::CreateDescriptor()); RegisterComponentDescriptor(LegacyFramework::IPCComponent::CreateDescriptor()); RegisterComponentDescriptor(AZ::UserSettingsComponent::CreateDescriptor()); @@ -62,7 +58,6 @@ namespace StandaloneTools EnsureComponentCreated(AZ::StreamerComponent::RTTI_Type()); EnsureComponentCreated(AZ::JobManagerComponent::RTTI_Type()); - EnsureComponentCreated(Telemetry::TelemetryComponent::RTTI_Type()); EnsureComponentCreated(AzFramework::TargetManagementComponent::RTTI_Type()); EnsureComponentCreated(LegacyFramework::IPCComponent::RTTI_Type()); @@ -90,14 +85,8 @@ namespace StandaloneTools void BaseApplication::OnApplicationEntityActivated() { - const int k_processIntervalInSecs = 2; - const bool doSDKInitShutdown = true; - EBUS_EVENT(Telemetry::TelemetryEventsBus, Initialize, "O3DE_IDE", k_processIntervalInSecs, doSDKInitShutdown); - - bool launched = LaunchDiscoveryService(); - + [[maybe_unused]] bool launched = LaunchDiscoveryService(); AZ_Warning("EditorApplication", launched, "Could not launch GridHub; Only replay is available."); - (void)launched; } void BaseApplication::SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.h deleted file mode 100644 index 9c7e9aa10d..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryBus.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 -#ifndef TELEMETRY_TELEMETRYBUS_H -#define TELEMETRY_TELEMETRYBUS_H - -#include - -#include "Source/Telemetry/TelemetryEvent.h" - -namespace Telemetry -{ - class TelemetryComponent; - - class TelemetryEvents - : public AZ::EBusTraits - { - public: - virtual void Initialize(const char* applicationName, AZ::u32 processIntervalInSecs, bool doSDKInitShutdown) = 0; - virtual void LogEvent(const TelemetryEvent& event) = 0; - virtual void Shutdown() = 0; - }; - - typedef AZ::EBus TelemetryEventsBus; -} -#endif diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp deleted file mode 100644 index 84519b8114..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.cpp +++ /dev/null @@ -1,48 +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 "TelemetryComponent.h" - -#include - -namespace Telemetry -{ - void TelemetryComponent::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serialize = azrtti_cast(context); - - if (serialize) - { - serialize->Class() - ->Version(1) - ; - } - } - - void TelemetryComponent::Activate() - { - TelemetryEventsBus::Handler::BusConnect(); - } - - void TelemetryComponent::Deactivate() - { - Shutdown(); - TelemetryEventsBus::Handler::BusDisconnect(); - } - - void TelemetryComponent::Initialize([[maybe_unused]] const char* applicationName, [[maybe_unused]] AZ::u32 processInterval, [[maybe_unused]] bool doAPIInitShutdown) - { - } - - void TelemetryComponent::LogEvent([[maybe_unused]] const TelemetryEvent& telemetryEvent) - { - } - - void TelemetryComponent::Shutdown() - { - } -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h deleted file mode 100644 index f924908ea2..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryComponent.h +++ /dev/null @@ -1,41 +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 - -#include "TelemetryBus.h" - -namespace Telemetry -{ - class TelemetryComponent - : public AZ::Component - , public TelemetryEventsBus::Handler - { - public: - AZ_COMPONENT(TelemetryComponent, "{CE41EE3C-AF98-4B22-BA7C-2D425D1F468A}") - - TelemetryComponent() = default; - - ////////////////// - // AZ::Component - void Activate() override; - void Deactivate() override; - static void Reflect(AZ::ReflectContext* context); - ////////////////// - - ////////////////////////////////////////// - // Telemetry::TelemetryEventBus::Handler - void Initialize(const char* applicationName, AZ::u32 processIntervalInSeconds, bool doSDKInitShutdown) override; - void LogEvent(const TelemetryEvent& event) override; - void Shutdown() override; - ////////////////////////////////////////// - }; -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp deleted file mode 100644 index 24dc381ad7..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.cpp +++ /dev/null @@ -1,80 +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 "TelemetryEvent.h" - -#include "TelemetryBus.h" - -namespace Telemetry -{ - TelemetryEvent::TelemetryEvent(const char* eventName) - : m_eventName(eventName) - { - } - - void TelemetryEvent::SetAttribute(const AZStd::string& name, const AZStd::string& value) - { - m_attributes[name] = value; - } - - const AZStd::string& TelemetryEvent::GetAttribute(const AZStd::string& name) - { - static AZStd::string k_emptyString; - - AZStd::unordered_map< AZStd::string, AZStd::string >::iterator attributeIter = m_attributes.find(name); - - if (attributeIter != m_attributes.end()) - { - return attributeIter->second; - } - - return k_emptyString; - } - - void TelemetryEvent::SetMetric(const AZStd::string& name, double metric) - { - m_metrics[name] = metric; - } - - double TelemetryEvent::GetMetric(const AZStd::string& name) - { - AZStd::unordered_map< AZStd::string, double >::iterator metricIter = m_metrics.find(name); - - if (metricIter != m_metrics.end()) - { - return metricIter->second; - } - - return 0.0; - } - - void TelemetryEvent::Log() - { - EBUS_EVENT(TelemetryEventsBus, LogEvent, (*this)); - } - - void TelemetryEvent::ResetEvent() - { - m_metrics.clear(); - m_attributes.clear(); - } - - const char* TelemetryEvent::GetEventName() const - { - return m_eventName.c_str(); - } - - const TelemetryEvent::AttributesMap& TelemetryEvent::GetAttributes() const - { - return m_attributes; - } - - const TelemetryEvent::MetricsMap& TelemetryEvent::GetMetrics() const - { - return m_metrics; - } -} diff --git a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h b/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h deleted file mode 100644 index f7ffed824b..0000000000 --- a/Code/Tools/LuaIDE/Source/Telemetry/TelemetryEvent.h +++ /dev/null @@ -1,45 +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 - * - */ - -#ifndef TELEMETRY_TELEMETRYEVENT_H -#define TELEMETRY_TELEMETRYEVENT_H - -#include -#include - -namespace Telemetry -{ - class TelemetryEvent - { - public: - typedef AZStd::unordered_map< AZStd::string, AZStd::string > AttributesMap; - typedef AZStd::unordered_map< AZStd::string, double > MetricsMap; - - TelemetryEvent(const char* eventName); - - void SetAttribute(const AZStd::string& name, const AZStd::string& value); - const AZStd::string& GetAttribute(const AZStd::string& name); - - void SetMetric(const AZStd::string& name, double metric); - double GetMetric(const AZStd::string& name); - - void Log(); - void ResetEvent(); - - const char* GetEventName() const; - const AttributesMap& GetAttributes() const; - const MetricsMap& GetMetrics() const; - - private: - AZStd::string m_eventName; - AttributesMap m_attributes; - MetricsMap m_metrics; - }; -} - -#endif diff --git a/Code/Tools/LuaIDE/lua_ide_files.cmake b/Code/Tools/LuaIDE/lua_ide_files.cmake index 1506e45c88..26b40372d3 100644 --- a/Code/Tools/LuaIDE/lua_ide_files.cmake +++ b/Code/Tools/LuaIDE/lua_ide_files.cmake @@ -9,17 +9,11 @@ set(FILES Source/StandaloneToolsApplication.cpp Source/StandaloneToolsApplication.h - Source/Telemetry/TelemetryBus.h - Source/Telemetry/TelemetryComponent.cpp - Source/Telemetry/TelemetryComponent.h - Source/Telemetry/TelemetryEvent.cpp - Source/Telemetry/TelemetryEvent.h Source/LuaIDEApplication.h Source/LuaIDEApplication.cpp Source/AssetDatabaseLocationListener.h Source/AssetDatabaseLocationListener.cpp Source/Editor/LuaEditor.cpp - Source/LUA/BasicScriptChecker.h Source/LUA/BreakpointPanel.cpp Source/LUA/BreakpointPanel.hxx Source/LUA/ClassReferenceFilter.cpp @@ -33,7 +27,6 @@ set(FILES Source/LUA/LUAContextControlMessages.h Source/LUA/LUADebuggerComponent.cpp Source/LUA/LUADebuggerComponent.h - Source/LUA/LUADebuggerMessages.h Source/LUA/LUAEditorBlockState.h Source/LUA/LUAEditorBreakpointWidget.cpp Source/LUA/LUAEditorBreakpointWidget.hxx @@ -71,10 +64,8 @@ set(FILES Source/LUA/LUAEditorViewMessages.h Source/LUA/LUALocalsTrackerMessages.h Source/LUA/LUAStackTrackerMessages.h - Source/LUA/LUATargetContextTrackerMessages.cpp Source/LUA/LUATargetContextTrackerMessages.h Source/LUA/LUAWatchesDebuggerMessages.h - Source/LUA/ScriptCheckerAPI.h Source/LUA/StackPanel.cpp Source/LUA/StackPanel.hxx Source/LUA/TargetContextButton.cpp From e4122bff2277778a3961340a78c8ae4216a8d574 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 15 Dec 2021 13:52:32 -0800 Subject: [PATCH 155/394] Removes unused files from TestImpactFramework Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../TestImpactTestTargetMetaArtifactFactory.h | 21 -- .../TestImpactBuildTargetDescriptor.cpp | 18 -- .../Static/TestImpactBuildTargetDescriptor.h | 1 - .../Run/TestImpactInstrumentedTestRunner.cpp | 1 - .../Run/TestImpactTestRunSerializer.cpp | 180 ------------------ .../Run/TestImpactTestRunSerializer.h | 22 --- .../TestEngine/Run/TestImpactTestRunner.cpp | 1 - .../testimpactframework_runtime_files.cmake | 3 - 8 files changed, 247 deletions(-) delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp delete mode 100644 Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h deleted file mode 100644 index d9d844805e..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Factory/TestImpactTestTargetMetaArtifactFactory.h +++ /dev/null @@ -1,21 +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 TestImpact -{ - //! Constructs a list of test target meta-data artifacts from the specified master test list data. - //! @param masterTestListData The raw master test list data in JSON format. - //! @return The constructed list of test target meta-data artifacts. - TestTargetMetas TestTargetMetaMapFactory(const AZStd::string& masterTestListData); -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp deleted file mode 100644 index f0cf8fadae..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp +++ /dev/null @@ -1,18 +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 - -namespace TestImpact -{ - BuildTargetDescriptor::BuildTargetDescriptor(BuildMetaData&& buildMetaData, TargetSources&& sources) - : m_buildMetaData(AZStd::move(buildMetaData)) - , m_sources(AZStd::move(sources)) - { - } -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h index 20012835aa..c42c36d624 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/Artifact/Static/TestImpactBuildTargetDescriptor.h @@ -44,7 +44,6 @@ namespace TestImpact struct BuildTargetDescriptor { BuildTargetDescriptor() = default; - BuildTargetDescriptor(BuildMetaData&& buildMetaData, TargetSources&& sources); BuildMetaData m_buildMetaData; TargetSources m_sources; diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp index 51a3445a53..c4cb7fa779 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp deleted file mode 100644 index 5e385c9c12..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.cpp +++ /dev/null @@ -1,180 +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 -#include -#include - -namespace TestImpact -{ - namespace TestRunFields - { - // Keys for pertinent JSON node and attribute names - constexpr const char* Keys[] = - { - "suites", - "name", - "enabled", - "tests", - "duration", - "status", - "result" - }; - - enum - { - SuitesKey, - NameKey, - EnabledKey, - TestsKey, - DurationKey, - StatusKey, - ResultKey - }; - } // namespace - - AZStd::string SerializeTestRun(const TestRun& testRun) - { - rapidjson::StringBuffer stringBuffer; - rapidjson::PrettyWriter writer(stringBuffer); - - // Run - writer.StartObject(); - - // Run duration - writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]); - writer.Uint(static_cast(testRun.GetDuration().count())); - - // Suites - writer.Key(TestRunFields::Keys[TestRunFields::SuitesKey]); - writer.StartArray(); - - for (const auto& suite : testRun.GetTestSuites()) - { - // Suite - writer.StartObject(); - - // Suite name - writer.Key(TestRunFields::Keys[TestRunFields::NameKey]); - writer.String(suite.m_name.c_str()); - - // Suite duration - writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]); - writer.Uint(static_cast(suite.m_duration.count())); - - // Suite enabled - writer.Key(TestRunFields::Keys[TestRunFields::EnabledKey]); - writer.Bool(suite.m_enabled); - - // Suite tests - writer.Key(TestRunFields::Keys[TestRunFields::TestsKey]); - writer.StartArray(); - for (const auto& test : suite.m_tests) - { - // Test - writer.StartObject(); - - // Test name - writer.Key(TestRunFields::Keys[TestRunFields::NameKey]); - writer.String(test.m_name.c_str()); - - // Test enabled - writer.Key(TestRunFields::Keys[TestRunFields::EnabledKey]); - writer.Bool(test.m_enabled); - - // Test duration - writer.Key(TestRunFields::Keys[TestRunFields::DurationKey]); - writer.Uint(static_cast(test.m_duration.count())); - - // Test status - writer.Key(TestRunFields::Keys[TestRunFields::StatusKey]); - writer.Bool(static_cast(test.m_status)); - - // Test result - if (test.m_status == TestRunStatus::Run) - { - writer.Key(TestRunFields::Keys[TestRunFields::ResultKey]); - writer.Bool(static_cast(test.m_result.value())); - } - else - { - writer.Key(TestRunFields::Keys[TestRunFields::ResultKey]); - writer.Null(); - } - - // End test - writer.EndObject(); - } - - // End tests - writer.EndArray(); - - // End suite - writer.EndObject(); - } - - // End suites - writer.EndArray(); - - // End run - writer.EndObject(); - - return stringBuffer.GetString(); - } - - TestRun DeserializeTestRun(const AZStd::string& testEnumString) - { - AZStd::vector testSuites; - rapidjson::Document doc; - - if (doc.Parse<0>(testEnumString.c_str()).HasParseError()) - { - throw TestEngineException("Could not parse enumeration data"); - } - - // Run duration - const AZStd::chrono::milliseconds runDuration = AZStd::chrono::milliseconds{doc[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}; - - // Suites - for (const auto& suite : doc[TestRunFields::Keys[TestRunFields::SuitesKey]].GetArray()) - { - // Suite name - const AZStd::string name = suite[TestRunFields::Keys[TestRunFields::NameKey]].GetString(); - - // Suite duration - const AZStd::chrono::milliseconds suiteDuration = AZStd::chrono::milliseconds{suite[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}; - - // Suite enabled - testSuites.emplace_back(TestRunSuite{ - suite[TestRunFields::Keys[TestRunFields::NameKey]].GetString(), - suite[TestRunFields::Keys[TestRunFields::EnabledKey]].GetBool(), - {}, - AZStd::chrono::milliseconds{suite[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}}); - - // Suite tests - for (const auto& test : suite[TestRunFields::Keys[TestRunFields::TestsKey]].GetArray()) - { - AZStd::optional result; - TestRunStatus status = static_cast(test[TestRunFields::Keys[TestRunFields::StatusKey]].GetBool()); - if (status == TestRunStatus::Run) - { - result = static_cast(test[TestRunFields::Keys[TestRunFields::ResultKey]].GetBool()); - } - const AZStd::chrono::milliseconds testDuration = AZStd::chrono::milliseconds{test[TestRunFields::Keys[TestRunFields::DurationKey]].GetUint()}; - testSuites.back().m_tests.emplace_back( - TestRunCase{test[TestRunFields::Keys[TestRunFields::NameKey]].GetString(), test[TestRunFields::Keys[TestRunFields::EnabledKey]].GetBool(), result, testDuration, status}); - } - } - - return TestRun(std::move(testSuites), runDuration); - } -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h deleted file mode 100644 index cf39249bb6..0000000000 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunSerializer.h +++ /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 - * - */ - -#pragma once - -#include - -#include - -namespace TestImpact -{ - //! Serializes the specified test run to JSON format. - AZStd::string SerializeTestRun(const TestRun& testRun); - - //! Deserializes a test run from the specified test run data in JSON format. - TestRun DeserializeTestRun(const AZStd::string& testRunString); -} // namespace TestImpact diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp index 28c38d05d4..c27a26ca4c 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp +++ b/Code/Tools/TestImpactFramework/Runtime/Code/Source/TestEngine/Run/TestImpactTestRunner.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake index 75f253ad27..a55df20d34 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake +++ b/Code/Tools/TestImpactFramework/Runtime/Code/testimpactframework_runtime_files.cmake @@ -35,7 +35,6 @@ set(FILES Source/Artifact/Factory/TestImpactTestTargetMetaMapFactory.h Source/Artifact/Factory/TestImpactModuleCoverageFactory.cpp Source/Artifact/Factory/TestImpactModuleCoverageFactory.h - Source/Artifact/Static/TestImpactBuildTargetDescriptor.cpp Source/Artifact/Static/TestImpactBuildTargetDescriptor.h Source/Artifact/Static/TestImpactTargetDescriptorCompiler.cpp Source/Artifact/Static/TestImpactTargetDescriptorCompiler.h @@ -90,8 +89,6 @@ set(FILES Source/TestEngine/Enumeration/TestImpactTestEnumerationSerializer.h Source/TestEngine/Enumeration/TestImpactTestEnumerator.cpp Source/TestEngine/Enumeration/TestImpactTestEnumerator.h - Source/TestEngine/Run/TestImpactTestRunSerializer.cpp - Source/TestEngine/Run/TestImpactTestRunSerializer.h Source/TestEngine/Run/TestImpactTestRunner.cpp Source/TestEngine/Run/TestImpactTestRunner.h Source/TestEngine/Run/TestImpactInstrumentedTestRunner.cpp From df0b97591a9bd904705297a06486dafe9c87d9e9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 21 Dec 2021 15:38:27 -0800 Subject: [PATCH 156/394] removes unused files from AtomFont Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AtomLyIntegration/AtomFont/FBitmap.h | 65 ------------------- .../AtomLyIntegration/AtomFont/resource.h | 21 ------ .../AtomFont/Code/atomfont_files.cmake | 2 - .../Code/Source/ImguiAtomSystemComponent.cpp | 1 - 4 files changed, 89 deletions(-) delete mode 100644 Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h delete mode 100644 Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h b/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h deleted file mode 100644 index 2570fd2b17..0000000000 --- a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/FBitmap.h +++ /dev/null @@ -1,65 +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 - -namespace AZ -{ - class FontBitmap - { - public: - FontBitmap(); - ~FontBitmap(); - - int Blur(int iterationCount); - int Scale(float scaleX, float scaleY); - - int BlitFrom(FontBitmap* source, int srcX, int srcY, int destX, int destY, int width, int height); - int BlitTo(FontBitmap* destination, int destX, int destY, int srcX, int srcY, int width, int height); - - int Create(int width, int height); - int Release(); - - int SaveBitmap(const AZStd::string& fileName); - int Get32Bpp(unsigned int** buffer) - { - (*buffer) = new unsigned int[m_width * m_height]; - - if (!(*buffer)) - { - return 0; - } - - int dataSize = m_width * m_height; - - for (int i = 0; i < dataSize; i++) - { - (*buffer)[i] = (m_data[i] << 24) | (m_data[i] << 16) | (m_data[i] << 8) | (m_data[i]); - } - - return 1; - } - - int GetWidth() { return m_width; } - int GetHeight() { return m_height; } - - void SetRenderData(void* renderData) { m_renderData = renderData; }; - void* GetRenderData() { return m_renderData; }; - - unsigned char* GetData() { return m_data; } - - public: - - int m_width; - int m_height; - - unsigned char* m_data; - void* m_renderData; - }; -} diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h b/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h deleted file mode 100644 index eb3d76bc60..0000000000 --- a/Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/resource.h +++ /dev/null @@ -1,21 +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 - * - */ - - -#define VS_VERSION_INFO 1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake b/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake index f12dc84f90..bf1f819d6b 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake +++ b/Gems/AtomLyIntegration/AtomFont/Code/atomfont_files.cmake @@ -20,7 +20,6 @@ set(FILES Source/AtomNullFont.cpp Source/Module.cpp Include/AtomLyIntegration/AtomFont/AtomFont.h - Include/AtomLyIntegration/AtomFont/FBitmap.h Include/AtomLyIntegration/AtomFont/FFont.h Include/AtomLyIntegration/AtomFont/FontRenderer.h Include/AtomLyIntegration/AtomFont/FontCommon.h @@ -28,5 +27,4 @@ set(FILES Include/AtomLyIntegration/AtomFont/GlyphBitmap.h Include/AtomLyIntegration/AtomFont/GlyphCache.h Include/AtomLyIntegration/AtomFont/AtomNullFont.h - Include/AtomLyIntegration/AtomFont/resource.h ) diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp index 700d930482..2c2963c5af 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/ImguiAtomSystemComponent.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include From bba337df5ea1577ef482901bd67350eff2d13d56 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:00:27 -0800 Subject: [PATCH 157/394] Removes unused files from Gems/AudioSystem Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Tests/AudioSystemTest.cpp | 1 - .../Mocks/IAudioSystemImplementationMock.h | 136 - .../Code/Tests/WaveTable48000Sine.h | 48015 ---------------- .../Code/audiosystem_tests_files.cmake | 1 - 4 files changed, 48153 deletions(-) delete mode 100644 Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h delete mode 100644 Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h diff --git a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp index 1f03eec419..32179b2120 100644 --- a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp +++ b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h b/Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h deleted file mode 100644 index b6f68fc896..0000000000 --- a/Gems/AudioSystem/Code/Tests/Mocks/IAudioSystemImplementationMock.h +++ /dev/null @@ -1,136 +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 Audio -{ - struct AudioSystemImplementationMock - : public AudioSystemImplementation - { - public: - MOCK_METHOD1(Update, void(float)); - - MOCK_METHOD0(Initialize, EAudioRequestStatus()); - - MOCK_METHOD0(ShutDown, EAudioRequestStatus()); - - MOCK_METHOD0(Release, EAudioRequestStatus()); - - MOCK_METHOD0(OnAudioSystemRefresh, void()); - - MOCK_METHOD0(OnLoseFocus, EAudioRequestStatus()); - - MOCK_METHOD0(OnGetFocus, EAudioRequestStatus()); - - MOCK_METHOD0(MuteAll, EAudioRequestStatus()); - - MOCK_METHOD0(UnmuteAll, EAudioRequestStatus()); - - MOCK_METHOD0(StopAllSounds, EAudioRequestStatus()); - - MOCK_METHOD2(RegisterAudioObject, EAudioRequestStatus(IATLAudioObjectData*, const char*)); - - MOCK_METHOD1(RegisterAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD1(UnregisterAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD1(ResetAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD1(UpdateAudioObject, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD2(PrepareTriggerSync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*)); - - MOCK_METHOD2(UnprepareTriggerSync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*)); - - MOCK_METHOD3(PrepareTriggerAsync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*, IATLEventData*)); - - MOCK_METHOD3(UnprepareTriggerAsync, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*, IATLEventData*)); - - MOCK_METHOD4(ActivateTrigger, EAudioRequestStatus(IATLAudioObjectData*, const IATLTriggerImplData*, IATLEventData*, const SATLSourceData*)); - - MOCK_METHOD2(StopEvent, EAudioRequestStatus(IATLAudioObjectData*, const IATLEventData*)); - - MOCK_METHOD1(StopAllEvents, EAudioRequestStatus(IATLAudioObjectData*)); - - MOCK_METHOD2(SetPosition, EAudioRequestStatus(IATLAudioObjectData*, const SATLWorldPosition&)); - - MOCK_METHOD2(SetMultiplePositions, EAudioRequestStatus(IATLAudioObjectData*, const MultiPositionParams&)); - - MOCK_METHOD3(SetRtpc, EAudioRequestStatus(IATLAudioObjectData*, const IATLRtpcImplData*, float)); - - MOCK_METHOD2(SetSwitchState, EAudioRequestStatus(IATLAudioObjectData*, const IATLSwitchStateImplData*)); - - MOCK_METHOD3(SetObstructionOcclusion, EAudioRequestStatus(IATLAudioObjectData*, float, float)); - - MOCK_METHOD3(SetEnvironment, EAudioRequestStatus(IATLAudioObjectData*, const IATLEnvironmentImplData*, float)); - - MOCK_METHOD2(SetListenerPosition, EAudioRequestStatus(IATLListenerData*, const SATLWorldPosition&)); - - MOCK_METHOD1(RegisterInMemoryFile, EAudioRequestStatus(SATLAudioFileEntryInfo*)); - - MOCK_METHOD1(UnregisterInMemoryFile, EAudioRequestStatus(SATLAudioFileEntryInfo*)); - - MOCK_METHOD2(ParseAudioFileEntry, EAudioRequestStatus(const AZ::rapidxml::xml_node*, SATLAudioFileEntryInfo*)); - - MOCK_METHOD1(DeleteAudioFileEntryData, void(IATLAudioFileEntryData*)); - - MOCK_METHOD1(GetAudioFileLocation, const char* const(SATLAudioFileEntryInfo*)); - - MOCK_METHOD1(NewAudioTriggerImplData, IATLTriggerImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioTriggerImplData, void(IATLTriggerImplData*)); - - MOCK_METHOD1(NewAudioRtpcImplData, IATLRtpcImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioRtpcImplData, void(IATLRtpcImplData*)); - - MOCK_METHOD1(NewAudioSwitchStateImplData, IATLSwitchStateImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioSwitchStateImplData, void(IATLSwitchStateImplData*)); - - MOCK_METHOD1(NewAudioEnvironmentImplData, IATLEnvironmentImplData*(const AZ::rapidxml::xml_node*)); - - MOCK_METHOD1(DeleteAudioEnvironmentImplData, void(IATLEnvironmentImplData*)); - - MOCK_METHOD1(NewGlobalAudioObjectData, IATLAudioObjectData*(TAudioObjectID)); - - MOCK_METHOD1(NewAudioObjectData, IATLAudioObjectData*(TAudioObjectID)); - - MOCK_METHOD1(DeleteAudioObjectData, void(IATLAudioObjectData*)); - - MOCK_METHOD1(NewDefaultAudioListenerObjectData, IATLListenerData*(TATLIDType)); - - MOCK_METHOD1(NewAudioListenerObjectData, IATLListenerData*(TATLIDType)); - - MOCK_METHOD1(DeleteAudioListenerObjectData, void(IATLListenerData*)); - - MOCK_METHOD1(NewAudioEventData, IATLEventData*(TAudioEventID)); - - MOCK_METHOD1(DeleteAudioEventData, void(IATLEventData*)); - - MOCK_METHOD1(ResetAudioEventData, void(IATLEventData*)); - - MOCK_METHOD1(SetLanguage, void(const char*)); - - MOCK_CONST_METHOD0(GetImplSubPath, const char* const()); - - MOCK_CONST_METHOD0(GetImplementationNameString, const char* const()); - - MOCK_CONST_METHOD1(GetMemoryInfo, void(SAudioImplMemoryInfo&)); - - MOCK_METHOD1(CreateAudioSource, bool(const SAudioInputConfig&)); - - MOCK_METHOD1(DestroyAudioSource, void(TAudioSourceId)); - }; - -} // namespace Audio diff --git a/Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h b/Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h deleted file mode 100644 index bc2cc6ee74..0000000000 --- a/Gems/AudioSystem/Code/Tests/WaveTable48000Sine.h +++ /dev/null @@ -1,48015 +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 -namespace WaveTable -{ - static const std::size_t TABLE_SIZE = 48000; - static const float g_sineTable[TABLE_SIZE] = { - 0.0f, - 0.00013089969352575288f, - 0.0002617993848085749f, - 0.00039269907160553524f, - 0.0005235987516737029f, - 0.0006544984227701477f, - 0.0007853980826519387f, - 0.0009162977290761456f, - 0.0010471973597998385f, - 0.0011780969725800877f, - 0.0013089965651739636f, - 0.0014398961353385368f, - 0.001570795680830879f, - 0.001701695199408061f, - 0.001832594688827156f, - 0.001963494146845236f, - 0.002094393571219374f, - 0.0022252929597066447f, - 0.002356192310064121f, - 0.002487091620048879f, - 0.002617990887417994f, - 0.002748890109928542f, - 0.002879789285337601f, - 0.003010688411402248f, - 0.0031415874858795635f, - 0.003272486506526625f, - 0.003403385471100515f, - 0.0035342843773583143f, - 0.003665183223057106f, - 0.003796082005953973f, - 0.003926980723806f, - 0.004057879374370274f, - 0.0041887779554038804f, - 0.004319676464663909f, - 0.004450574899907449f, - 0.004581473258891589f, - 0.004712371539373423f, - 0.004843269739110043f, - 0.004974167855858545f, - 0.005105065887376025f, - 0.0052359638314195805f, - 0.005366861685746309f, - 0.0054977594481133134f, - 0.005628657116277695f, - 0.005759554687996557f, - 0.005890452161027005f, - 0.006021349533126148f, - 0.006152246802051093f, - 0.006283143965558951f, - 0.0064140410214068334f, - 0.006544937967351858f, - 0.006675834801151138f, - 0.0068067315205617915f, - 0.00693762812334094f, - 0.007068524607245704f, - 0.007199420970033209f, - 0.007330317209460581f, - 0.007461213323284948f, - 0.007592109309263441f, - 0.0077230051651531895f, - 0.007853900888711334f, - 0.007984796477695006f, - 0.008115691929861349f, - 0.008246587242967505f, - 0.008377482414770612f, - 0.008508377443027825f, - 0.008639272325496288f, - 0.008770167059933153f, - 0.008901061644095577f, - 0.009031956075740713f, - 0.009162850352625722f, - 0.009293744472507763f, - 0.009424638433144006f, - 0.009555532232291615f, - 0.009686425867707762f, - 0.009817319337149617f, - 0.009948212638374358f, - 0.010079105769139163f, - 0.010209998727201214f, - 0.010340891510317696f, - 0.010471784116245794f, - 0.0106026765427427f, - 0.010733568787565609f, - 0.010864460848471714f, - 0.010995352723218221f, - 0.011126244409562329f, - 0.011257135905261244f, - 0.011388027208072178f, - 0.01151891831575234f, - 0.01164980922605895f, - 0.011780699936749225f, - 0.011911590445580392f, - 0.012042480750309672f, - 0.012173370848694298f, - 0.012304260738491505f, - 0.012435150417458529f, - 0.012566039883352607f, - 0.012696929133930989f, - 0.012827818166950918f, - 0.012958706980169652f, - 0.01308959557134444f, - 0.013220483938232544f, - 0.01335137207859123f, - 0.013482259990177761f, - 0.013613147670749408f, - 0.013744035118063451f, - 0.013874922329877162f, - 0.014005809303947826f, - 0.014136696038032732f, - 0.014267582529889175f, - 0.014398468777274442f, - 0.01452935477794584f, - 0.014660240529660666f, - 0.014791126030176233f, - 0.014922011277249849f, - 0.015052896268638833f, - 0.01518378100210051f, - 0.015314665475392198f, - 0.01544554968627123f, - 0.015576433632494946f, - 0.015707317311820675f, - 0.015838200722005768f, - 0.015969083860807566f, - 0.016099966725983433f, - 0.016230849315290716f, - 0.01636173162648678f, - 0.016492613657328997f, - 0.01662349540557473f, - 0.01675437686898136f, - 0.01688525804530627f, - 0.01701613893230685f, - 0.01714701952774048f, - 0.017277899829364566f, - 0.017408779834936508f, - 0.017539659542213707f, - 0.017670538948953582f, - 0.017801418052913544f, - 0.017932296851851017f, - 0.018063175343523426f, - 0.018194053525688206f, - 0.018324931396102796f, - 0.018455808952524636f, - 0.018586686192711175f, - 0.018717563114419872f, - 0.018848439715408175f, - 0.018979315993433558f, - 0.01911019194625349f, - 0.01924106757162545f, - 0.019371942867306906f, - 0.01950281783105536f, - 0.0196336924606283f, - 0.019764566753783224f, - 0.01989544070827764f, - 0.020026314321869045f, - 0.02015718759231497f, - 0.02028806051737293f, - 0.020418933094800456f, - 0.020549805322355078f, - 0.020680677197794338f, - 0.02081154871887578f, - 0.02094241988335696f, - 0.02107329068899543f, - 0.021204161133548758f, - 0.021335031214774515f, - 0.021465900930430278f, - 0.02159677027827362f, - 0.021727639256062144f, - 0.021858507861553442f, - 0.021989376092505106f, - 0.022120243946674754f, - 0.022251111421820003f, - 0.022381978515698467f, - 0.022512845226067772f, - 0.022643711550685557f, - 0.022774577487309464f, - 0.02290544303369714f, - 0.02303630818760623f, - 0.02316717294679441f, - 0.023298037309019342f, - 0.023428901272038692f, - 0.02355976483361015f, - 0.02369062799149141f, - 0.02382149074344015f, - 0.023952353087214086f, - 0.02408321502057092f, - 0.02421407654126838f, - 0.02434493764706417f, - 0.024475798335716035f, - 0.024606658604981707f, - 0.024737518452618935f, - 0.02486837787638546f, - 0.024999236874039054f, - 0.02513009544333748f, - 0.025260953582038507f, - 0.025391811287899916f, - 0.025522668558679504f, - 0.025653525392135054f, - 0.025784381786024383f, - 0.025915237738105296f, - 0.026046093246135604f, - 0.02617694830787315f, - 0.02630780292107576f, - 0.026438657083501262f, - 0.02656951079290753f, - 0.026700364047052408f, - 0.026831216843693755f, - 0.026962069180589455f, - 0.02709292105549738f, - 0.02722377246617542f, - 0.027354623410381484f, - 0.02748547388587346f, - 0.027616323890409262f, - 0.02774717342174682f, - 0.02787802247764405f, - 0.02800887105585891f, - 0.028139719154149326f, - 0.02827056677027325f, - 0.028401413901988654f, - 0.02853226054705351f, - 0.028663106703225777f, - 0.028793952368263466f, - 0.02892479753992456f, - 0.029055642215967056f, - 0.02918648639414897f, - 0.029317330072228334f, - 0.02944817324796316f, - 0.029579015919111502f, - 0.029709858083431386f, - 0.029840699738680886f, - 0.02997154088261806f, - 0.03010238151300097f, - 0.03023322162758771f, - 0.030364061224136367f, - 0.03049490030040503f, - 0.030625738854151822f, - 0.030756576883134854f, - 0.030887414385112243f, - 0.031018251357842138f, - 0.031149087799082674f, - 0.031279923706592f, - 0.03141075907812829f, - 0.031541593911449714f, - 0.031672428204314436f, - 0.03180326195448067f, - 0.03193409515970659f, - 0.03206492781775042f, - 0.03219575992637039f, - 0.032326591483324695f, - 0.03245742248637159f, - 0.03258825293326932f, - 0.03271908282177614f, - 0.03284991214965032f, - 0.03298074091465013f, - 0.03311156911453385f, - 0.033242396747059776f, - 0.033373223809986224f, - 0.03350405030107149f, - 0.03363487621807391f, - 0.033765701558751804f, - 0.03389652632086353f, - 0.034027350502167444f, - 0.03415817410042189f, - 0.034288997113385254f, - 0.03441981953881592f, - 0.034550641374472266f, - 0.03468146261811272f, - 0.03481228326749567f, - 0.03494310332037955f, - 0.0350739227745228f, - 0.03520474162768387f, - 0.035335559877621193f, - 0.03546637752209324f, - 0.0355971945588585f, - 0.035728010985675435f, - 0.035858826800302564f, - 0.035989642000498374f, - 0.0361204565840214f, - 0.03625127054863016f, - 0.03638208389208319f, - 0.03651289661213904f, - 0.036643708706556276f, - 0.036774520173093454f, - 0.03690533100950918f, - 0.03703614121356202f, - 0.03716695078301058f, - 0.037297759715613485f, - 0.03742856800912936f, - 0.03755937566131683f, - 0.03769018266993454f, - 0.03782098903274115f, - 0.03795179474749534f, - 0.03808259981195578f, - 0.03821340422388115f, - 0.03834420798103017f, - 0.038475011081161546f, - 0.038605813522034f, - 0.03873661530140627f, - 0.03886741641703711f, - 0.03899821686668525f, - 0.0391290166481095f, - 0.03925981575906861f, - 0.03939061419732138f, - 0.039521411960626626f, - 0.03965220904674316f, - 0.03978300545342979f, - 0.039913801178445375f, - 0.04004459621954876f, - 0.04017539057449881f, - 0.0403061842410544f, - 0.0404369772169744f, - 0.04056776950001773f, - 0.040698561087943286f, - 0.040829351978509995f, - 0.040960142169476785f, - 0.041090931658602614f, - 0.041221720443646415f, - 0.04135250852236719f, - 0.04148329589252389f, - 0.04161408255187552f, - 0.0417448684981811f, - 0.04187565372919963f, - 0.042006438242690146f, - 0.042137222036411695f, - 0.04226800510812332f, - 0.0423987874555841f, - 0.04252956907655312f, - 0.04266034996878945f, - 0.04279113013005222f, - 0.04292190955810053f, - 0.04305268825069351f, - 0.04318346620559032f, - 0.043314243420550104f, - 0.043445019893332014f, - 0.04357579562169526f, - 0.04370657060339901f, - 0.04383734483620249f, - 0.0439681183178649f, - 0.044098891046145484f, - 0.04422966301880348f, - 0.044360434233598166f, - 0.04449120468828878f, - 0.04462197438063463f, - 0.044752743308395f, - 0.0448835114693292f, - 0.04501427886119656f, - 0.04514504548175642f, - 0.045275811328768116f, - 0.04540657639999101f, - 0.0455373406931845f, - 0.045668104206107944f, - 0.04579886693652077f, - 0.04592962888218238f, - 0.0460603900408522f, - 0.04619115041028969f, - 0.0463219099882543f, - 0.04645266877250549f, - 0.04658342676080276f, - 0.04671418395090559f, - 0.046844940340573495f, - 0.04697569592756601f, - 0.04710645070964266f, - 0.04723720468456301f, - 0.047367957850086614f, - 0.04749871020397305f, - 0.04762946174398193f, - 0.047760212467872855f, - 0.04789096237340543f, - 0.04802171145833931f, - 0.04815245972043413f, - 0.048283207157449576f, - 0.0484139537671453f, - 0.04854469954728101f, - 0.04867544449561641f, - 0.04880618860991122f, - 0.04893693188792517f, - 0.049067674327418015f, - 0.049198415926149514f, - 0.049329156681879455f, - 0.04945989659236761f, - 0.0495906356553738f, - 0.04972137386865785f, - 0.049852111229979595f, - 0.04998284773709888f, - 0.05011358338777558f, - 0.050244318179769556f, - 0.050375052110840715f, - 0.05050578517874898f, - 0.05063651738125424f, - 0.05076724871611646f, - 0.0508979791810956f, - 0.05102870877395161f, - 0.051159437492444476f, - 0.0512901653343342f, - 0.05142089229738081f, - 0.05155161837934431f, - 0.05168234357798477f, - 0.051813067891062235f, - 0.05194379131633677f, - 0.05207451385156847f, - 0.052205235494517464f, - 0.05233595624294383f, - 0.05246667609460773f, - 0.05259739504726932f, - 0.052728113098688745f, - 0.052858830246626194f, - 0.05298954648884189f, - 0.053120261823095996f, - 0.05325097624714877f, - 0.053381689758760474f, - 0.053512402355691324f, - 0.05364311403570163f, - 0.05377382479655166f, - 0.053904534636001734f, - 0.05403524355181216f, - 0.05416595154174331f, - 0.054296658603555495f, - 0.0544273647350091f, - 0.05455806993386453f, - 0.054688774197882165f, - 0.05481947752482241f, - 0.05495017991244575f, - 0.055080881358512586f, - 0.0552115818607834f, - 0.05534228141701868f, - 0.05547298002497891f, - 0.055603677682424614f, - 0.05573437438711633f, - 0.055865070136814604f, - 0.05599576492927998f, - 0.05612645876227306f, - 0.056257151633554436f, - 0.05638784354088471f, - 0.05651853448202452f, - 0.05664922445473452f, - 0.05677991345677535f, - 0.05691060148590771f, - 0.057041288539892286f, - 0.0571719746164898f, - 0.057302659713460956f, - 0.05743334382856654f, - 0.05756402695956728f, - 0.057694709104223973f, - 0.05782539026029742f, - 0.05795607042554842f, - 0.05808674959773781f, - 0.05821742777462645f, - 0.05834810495397517f, - 0.05847878113354489f, - 0.05860945631109649f, - 0.0587401304843909f, - 0.05887080365118903f, - 0.05900147580925186f, - 0.05913214695634033f, - 0.05926281709021543f, - 0.05939348620863818f, - 0.059524154309369595f, - 0.0596548213901707f, - 0.05978548744880254f, - 0.05991615248302624f, - 0.060046816490602825f, - 0.06017747946929344f, - 0.060308141416859216f, - 0.06043880233106127f, - 0.06056946220966077f, - 0.06070012105041891f, - 0.06083077885109687f, - 0.060961435609455855f, - 0.06109209132325713f, - 0.061222745990261916f, - 0.06135339960823149f, - 0.06148405217492714f, - 0.06161470368811016f, - 0.06174535414554187f, - 0.06187600354498365f, - 0.062006651884196795f, - 0.062137299160942724f, - 0.06226794537298282f, - 0.062398590518078494f, - 0.06252923459399116f, - 0.06265987759848231f, - 0.06279051952931337f, - 0.06292116038424585f, - 0.06305180016104124f, - 0.06318243885746107f, - 0.06331307647126688f, - 0.06344371300022023f, - 0.06357434844208269f, - 0.06370498279461588f, - 0.06383561605558138f, - 0.06396624822274087f, - 0.06409687929385596f, - 0.06422750926668835f, - 0.06435813813899972f, - 0.06448876590855177f, - 0.06461939257310625f, - 0.0647500181304249f, - 0.06488064257826946f, - 0.06501126591440175f, - 0.06514188813658356f, - 0.06527250924257672f, - 0.06540312923014306f, - 0.06553374809704446f, - 0.0656643658410428f, - 0.06579498245989994f, - 0.06592559795137785f, - 0.06605621231323845f, - 0.0661868255432437f, - 0.06631743763915558f, - 0.06644804859873607f, - 0.0665786584197472f, - 0.06670926709995102f, - 0.06683987463710955f, - 0.06697048102898488f, - 0.06710108627333913f, - 0.0672316903679344f, - 0.06736229331053281f, - 0.06749289509889651f, - 0.0676234957307877f, - 0.06775409520396856f, - 0.0678846935162013f, - 0.06801529066524817f, - 0.06814588664887139f, - 0.06827648146483326f, - 0.06840707511089607f, - 0.06853766758482212f, - 0.06866825888437376f, - 0.06879884900731334f, - 0.06892943795140322f, - 0.06906002571440578f, - 0.0691906122940835f, - 0.06932119768819875f, - 0.069451781894514f, - 0.06958236491079174f, - 0.06971294673479446f, - 0.06984352736428466f, - 0.0699741067970249f, - 0.07010468503077771f, - 0.07023526206330569f, - 0.07036583789237144f, - 0.07049641251573754f, - 0.07062698593116667f, - 0.0707575581364215f, - 0.07088812912926466f, - 0.07101869890745888f, - 0.0711492674687669f, - 0.07127983481095142f, - 0.07141040093177523f, - 0.07154096582900113f, - 0.0716715295003919f, - 0.07180209194371036f, - 0.07193265315671939f, - 0.07206321313718184f, - 0.0721937718828606f, - 0.07232432939151857f, - 0.07245488566091872f, - 0.07258544068882397f, - 0.07271599447299729f, - 0.0728465470112017f, - 0.0729770983012002f, - 0.07310764834075585f, - 0.07323819712763169f, - 0.0733687446595908f, - 0.07349929093439629f, - 0.07362983594981132f, - 0.07376037970359897f, - 0.07389092219352245f, - 0.07402146341734493f, - 0.07415200337282965f, - 0.0742825420577398f, - 0.07441307946983869f, - 0.07454361560688955f, - 0.07467415046665571f, - 0.07480468404690047f, - 0.07493521634538716f, - 0.07506574735987918f, - 0.0751962770881399f, - 0.07532680552793272f, - 0.07545733267702107f, - 0.07558785853316843f, - 0.07571838309413825f, - 0.07584890635769402f, - 0.07597942832159926f, - 0.07610994898361757f, - 0.07624046834151242f, - 0.07637098639304746f, - 0.07650150313598628f, - 0.07663201856809251f, - 0.0767625326871298f, - 0.07689304549086184f, - 0.07702355697705233f, - 0.07715406714346495f, - 0.07728457598786351f, - 0.0774150835080117f, - 0.07754558970167338f, - 0.07767609456661233f, - 0.07780659810059236f, - 0.07793710030137735f, - 0.07806760116673121f, - 0.07819810069441781f, - 0.07832859888220106f, - 0.07845909572784494f, - 0.07858959122911342f, - 0.07872008538377047f, - 0.07885057818958013f, - 0.07898106964430644f, - 0.07911155974571346f, - 0.07924204849156528f, - 0.07937253587962599f, - 0.07950302190765976f, - 0.07963350657343073f, - 0.07976398987470307f, - 0.07989447180924097f, - 0.08002495237480871f, - 0.08015543156917052f, - 0.08028590939009063f, - 0.08041638583533338f, - 0.08054686090266312f, - 0.08067733458984412f, - 0.0808078068946408f, - 0.08093827781481755f, - 0.08106874734813876f, - 0.0811992154923689f, - 0.08132968224527241f, - 0.08146014760461379f, - 0.08159061156815754f, - 0.08172107413366822f, - 0.08185153529891036f, - 0.08198199506164856f, - 0.08211245341964743f, - 0.08224291037067158f, - 0.08237336591248569f, - 0.08250382004285442f, - 0.0826342727595425f, - 0.08276472406031463f, - 0.08289517394293557f, - 0.0830256224051701f, - 0.08315606944478302f, - 0.08328651505953917f, - 0.08341695924720335f, - 0.0835474020055405f, - 0.0836778433323155f, - 0.08380828322529323f, - 0.08393872168223869f, - 0.0840691587009168f, - 0.08419959427909263f, - 0.08433002841453112f, - 0.08446046110499739f, - 0.08459089234825647f, - 0.08472132214207344f, - 0.08485175048421345f, - 0.08498217737244167f, - 0.08511260280452321f, - 0.08524302677822329f, - 0.08537344929130715f, - 0.08550387034154003f, - 0.08563428992668717f, - 0.0857647080445139f, - 0.08589512469278551f, - 0.08602553986926739f, - 0.08615595357172488f, - 0.08628636579792337f, - 0.08641677654562831f, - 0.08654718581260512f, - 0.08667759359661928f, - 0.08680799989543628f, - 0.08693840470682167f, - 0.08706880802854099f, - 0.08719920985835979f, - 0.0873296101940437f, - 0.08746000903335832f, - 0.08759040637406931f, - 0.08772080221394238f, - 0.08785119655074317f, - 0.08798158938223746f, - 0.08811198070619097f, - 0.08824237052036951f, - 0.08837275882253885f, - 0.08850314561046486f, - 0.08863353088191339f, - 0.08876391463465029f, - 0.08889429686644151f, - 0.08902467757505297f, - 0.08915505675825063f, - 0.08928543441380046f, - 0.08941581053946852f, - 0.0895461851330208f, - 0.0896765581922234f, - 0.0898069297148424f, - 0.08993729969864393f, - 0.09006766814139411f, - 0.09019803504085915f, - 0.0903284003948052f, - 0.09045876420099855f, - 0.09058912645720539f, - 0.09071948716119202f, - 0.09084984631072475f, - 0.09098020390356992f, - 0.09111055993749385f, - 0.09124091441026297f, - 0.09137126731964366f, - 0.09150161866340238f, - 0.09163196843930557f, - 0.09176231664511976f, - 0.09189266327861144f, - 0.09202300833754715f, - 0.09215335181969346f, - 0.092283693722817f, - 0.09241403404468439f, - 0.09254437278306224f, - 0.0926747099357173f, - 0.09280504550041621f, - 0.09293537947492576f, - 0.09306571185701269f, - 0.09319604264444378f, - 0.09332637183498588f, - 0.09345669942640579f, - 0.0935870254164704f, - 0.09371734980294662f, - 0.09384767258360137f, - 0.09397799375620161f, - 0.09410831331851431f, - 0.09423863126830649f, - 0.09436894760334519f, - 0.09449926232139745f, - 0.09462957542023039f, - 0.09475988689761111f, - 0.09489019675130679f, - 0.09502050497908457f, - 0.09515081157871166f, - 0.09528111654795532f, - 0.09541141988458278f, - 0.09554172158636133f, - 0.09567202165105829f, - 0.09580232007644102f, - 0.09593261686027688f, - 0.09606291200033325f, - 0.09619320549437757f, - 0.09632349734017734f, - 0.09645378753549996f, - 0.09658407607811301f, - 0.09671436296578402f, - 0.09684464819628054f, - 0.09697493176737017f, - 0.09710521367682055f, - 0.09723549392239932f, - 0.09736577250187418f, - 0.09749604941301283f, - 0.09762632465358302f, - 0.0977565982213525f, - 0.0978868701140891f, - 0.0980171403295606f, - 0.0981474088655349f, - 0.09827767571977984f, - 0.09840794089006338f, - 0.09853820437415343f, - 0.09866846616981796f, - 0.09879872627482501f, - 0.09892898468694256f, - 0.09905924140393867f, - 0.09918949642358145f, - 0.09931974974363901f, - 0.09945000136187948f, - 0.09958025127607106f, - 0.09971049948398193f, - 0.09984074598338033f, - 0.09997099077203452f, - 0.1001012338477128f, - 0.10023147520818346f, - 0.1003617148512149f, - 0.10049195277457545f, - 0.10062218897603352f, - 0.1007524234533576f, - 0.10088265620431612f, - 0.10101288722667755f, - 0.10114311651821048f, - 0.10127334407668342f, - 0.10140356989986497f, - 0.10153379398552376f, - 0.10166401633142841f, - 0.10179423693534759f, - 0.10192445579505004f, - 0.10205467290830447f, - 0.10218488827287965f, - 0.10231510188654439f, - 0.10244531374706746f, - 0.10257552385221778f, - 0.10270573219976423f, - 0.10283593878747568f, - 0.10296614361312112f, - 0.1030963466744695f, - 0.10322654796928983f, - 0.10335674749535115f, - 0.10348694525042253f, - 0.10361714123227304f, - 0.10374733543867186f, - 0.1038775278673881f, - 0.10400771851619094f, - 0.10413790738284966f, - 0.10426809446513347f, - 0.1043982797608116f, - 0.10452846326765346f, - 0.10465864498342833f, - 0.10478882490590559f, - 0.10491900303285465f, - 0.10504917936204494f, - 0.10517935389124591f, - 0.10530952661822708f, - 0.10543969754075797f, - 0.10556986665660809f, - 0.1057000339635471f, - 0.10583019945934458f, - 0.10596036314177015f, - 0.10609052500859356f, - 0.10622068505758449f, - 0.10635084328651265f, - 0.10648099969314787f, - 0.10661115427525991f, - 0.10674130703061863f, - 0.10687145795699389f, - 0.1070016070521556f, - 0.10713175431387366f, - 0.10726189973991807f, - 0.1073920433280588f, - 0.10752218507606585f, - 0.10765232498170936f, - 0.10778246304275935f, - 0.10791259925698593f, - 0.1080427336221593f, - 0.10817286613604961f, - 0.10830299679642708f, - 0.10843312560106197f, - 0.10856325254772455f, - 0.1086933776341851f, - 0.10882350085821402f, - 0.10895362221758163f, - 0.10908374171005837f, - 0.10921385933341467f, - 0.10934397508542099f, - 0.10947408896384782f, - 0.10960420096646573f, - 0.10973431109104528f, - 0.10986441933535702f, - 0.10999452569717164f, - 0.11012463017425977f, - 0.11025473276439213f, - 0.11038483346533942f, - 0.1105149322748724f, - 0.11064502919076188f, - 0.11077512421077869f, - 0.11090521733269364f, - 0.11103530855427768f, - 0.11116539787330172f, - 0.11129548528753666f, - 0.11142557079475356f, - 0.11155565439272339f, - 0.11168573607921722f, - 0.11181581585200615f, - 0.11194589370886128f, - 0.11207596964755374f, - 0.11220604366585477f, - 0.11233611576153554f, - 0.1124661859323673f, - 0.11259625417612139f, - 0.11272632049056906f, - 0.11285638487348167f, - 0.11298644732263063f, - 0.11311650783578736f, - 0.11324656641072324f, - 0.11337662304520983f, - 0.11350667773701863f, - 0.11363673048392113f, - 0.11376678128368899f, - 0.11389683013409377f, - 0.11402687703290713f, - 0.11415692197790078f, - 0.1142869649668464f, - 0.11441700599751572f, - 0.11454704506768061f, - 0.11467708217511281f, - 0.11480711731758417f, - 0.1149371504928666f, - 0.11506718169873202f, - 0.11519721093295235f, - 0.11532723819329961f, - 0.1154572634775458f, - 0.11558728678346294f, - 0.11571730810882319f, - 0.11584732745139861f, - 0.11597734480896137f, - 0.11610736017928366f, - 0.1162373735601377f, - 0.11636738494929574f, - 0.11649739434453009f, - 0.11662740174361308f, - 0.116757407144317f, - 0.11688741054441433f, - 0.11701741194167745f, - 0.11714741133387882f, - 0.11727740871879096f, - 0.11740740409418637f, - 0.11753739745783764f, - 0.11766738880751736f, - 0.11779737814099817f, - 0.11792736545605269f, - 0.11805735075045372f, - 0.11818733402197391f, - 0.11831731526838604f, - 0.11844729448746297f, - 0.11857727167697749f, - 0.1187072468347025f, - 0.11883721995841091f, - 0.11896719104587565f, - 0.11909716009486973f, - 0.11922712710316614f, - 0.11935709206853792f, - 0.11948705498875821f, - 0.11961701586160008f, - 0.11974697468483667f, - 0.11987693145624123f, - 0.12000688617358696f, - 0.12013683883464708f, - 0.12026678943719496f, - 0.12039673797900388f, - 0.12052668445784721f, - 0.12065662887149839f, - 0.12078657121773083f, - 0.12091651149431798f, - 0.12104644969903339f, - 0.12117638582965058f, - 0.12130631988394312f, - 0.12143625185968468f, - 0.12156618175464885f, - 0.12169610956660931f, - 0.12182603529333985f, - 0.12195595893261418f, - 0.12208588048220609f, - 0.12221579993988943f, - 0.12234571730343806f, - 0.12247563257062587f, - 0.1226055457392268f, - 0.12273545680701484f, - 0.12286536577176398f, - 0.12299527263124826f, - 0.12312517738324179f, - 0.12325508002551865f, - 0.12338498055585302f, - 0.1235148789720191f, - 0.12364477527179106f, - 0.12377466945294323f, - 0.12390456151324988f, - 0.12403445145048532f, - 0.12416433926242397f, - 0.1242942249468402f, - 0.12442410850150845f, - 0.12455398992420325f, - 0.12468386921269904f, - 0.12481374636477043f, - 0.12494362137819202f, - 0.12507349425073838f, - 0.12520336498018422f, - 0.12533323356430426f, - 0.12546310000087316f, - 0.12559296428766573f, - 0.12572282642245683f, - 0.12585268640302122f, - 0.12598254422713384f, - 0.12611239989256962f, - 0.1262422533971035f, - 0.12637210473851046f, - 0.12650195391456553f, - 0.1266318009230438f, - 0.12676164576172042f, - 0.12689148842837042f, - 0.1270213289207691f, - 0.1271511672366916f, - 0.1272810033739132f, - 0.1274108373302092f, - 0.1275406691033549f, - 0.12767049869112573f, - 0.12780032609129705f, - 0.12793015130164428f, - 0.12805997431994295f, - 0.12818979514396855f, - 0.12831961377149664f, - 0.12844943020030286f, - 0.12857924442816274f, - 0.12870905645285202f, - 0.1288388662721464f, - 0.1289686738838216f, - 0.1290984792856534f, - 0.12922828247541768f, - 0.1293580834508902f, - 0.12948788220984694f, - 0.12961767875006383f, - 0.12974747306931675f, - 0.1298772651653818f, - 0.13000705503603502f, - 0.13013684267905243f, - 0.13026662809221023f, - 0.13039641127328455f, - 0.13052619222005157f, - 0.13065597093028758f, - 0.13078574740176882f, - 0.13091552163227158f, - 0.1310452936195723f, - 0.13117506336144727f, - 0.13130483085567296f, - 0.13143459610002586f, - 0.1315643590922825f, - 0.13169411983021936f, - 0.13182387831161305f, - 0.13195363453424022f, - 0.1320833884958775f, - 0.1322131401943016f, - 0.13234288962728927f, - 0.13247263679261728f, - 0.13260238168806243f, - 0.1327321243114016f, - 0.13286186466041167f, - 0.1329916027328696f, - 0.13312133852655236f, - 0.13325107203923692f, - 0.1333808032687004f, - 0.1335105322127198f, - 0.1336402588690723f, - 0.13376998323553513f, - 0.13389970530988538f, - 0.13402942508990037f, - 0.13415914257335737f, - 0.1342888577580337f, - 0.13441857064170676f, - 0.13454828122215393f, - 0.13467798949715257f, - 0.13480769546448032f, - 0.1349373991219146f, - 0.13506710046723303f, - 0.13519679949821317f, - 0.13532649621263265f, - 0.13545619060826922f, - 0.13558588268290053f, - 0.13571557243430438f, - 0.13584525986025855f, - 0.13597494495854093f, - 0.13610462772692933f, - 0.1362343081632017f, - 0.136363986265136f, - 0.13649366203051028f, - 0.13662333545710248f, - 0.13675300654269076f, - 0.13688267528505324f, - 0.13701234168196802f, - 0.13714200573121338f, - 0.1372716674305675f, - 0.1374013267778087f, - 0.13753098377071526f, - 0.1376606384070656f, - 0.13779029068463805f, - 0.13791994060121113f, - 0.1380495881545633f, - 0.138179233342473f, - 0.13830887616271895f, - 0.13843851661307963f, - 0.13856815469133374f, - 0.13869779039525995f, - 0.138827423722637f, - 0.13895705467124364f, - 0.13908668323885873f, - 0.13921630942326102f, - 0.1393459332222295f, - 0.13947555463354305f, - 0.13960517365498062f, - 0.1397347902843213f, - 0.13986440451934407f, - 0.13999401635782807f, - 0.14012362579755241f, - 0.14025323283629626f, - 0.1403828374718389f, - 0.14051243970195954f, - 0.14064203952443746f, - 0.14077163693705205f, - 0.14090123193758267f, - 0.14103082452380872f, - 0.14116041469350973f, - 0.14129000244446516f, - 0.14141958777445454f, - 0.14154917068125755f, - 0.1416787511626537f, - 0.14180832921642275f, - 0.1419379048403444f, - 0.14206747803219835f, - 0.1421970487897645f, - 0.14232661711082262f, - 0.1424561829931526f, - 0.1425857464345344f, - 0.1427153074327479f, - 0.1428448659855732f, - 0.1429744220907903f, - 0.14310397574617928f, - 0.14323352694952035f, - 0.14336307569859363f, - 0.1434926219911793f, - 0.14362216582505768f, - 0.14375170719800903f, - 0.14388124610781372f, - 0.14401078255225216f, - 0.14414031652910472f, - 0.1442698480361519f, - 0.14439937707117423f, - 0.14452890363195223f, - 0.1446584277162665f, - 0.1447879493218977f, - 0.1449174684466265f, - 0.14504698508823363f, - 0.14517649924449985f, - 0.14530601091320602f, - 0.1454355200921329f, - 0.14556502677906144f, - 0.14569453097177262f, - 0.14582403266804733f, - 0.14595353186566662f, - 0.14608302856241162f, - 0.14621252275606336f, - 0.14634201444440303f, - 0.14647150362521183f, - 0.14660099029627094f, - 0.14673047445536175f, - 0.1468599561002655f, - 0.14698943522876354f, - 0.14711891183863737f, - 0.14724838592766837f, - 0.14737785749363805f, - 0.147507326534328f, - 0.1476367930475197f, - 0.14776625703099486f, - 0.14789571848253516f, - 0.14802517739992224f, - 0.1481546337809379f, - 0.14828408762336395f, - 0.1484135389249822f, - 0.14854298768357457f, - 0.14867243389692297f, - 0.1488018775628094f, - 0.14893131867901585f, - 0.14906075724332438f, - 0.14919019325351712f, - 0.1493196267073762f, - 0.1494490576026838f, - 0.1495784859372222f, - 0.14970791170877362f, - 0.14983733491512044f, - 0.149966755554045f, - 0.1500961736233297f, - 0.15022558912075706f, - 0.1503550020441095f, - 0.1504844123911696f, - 0.15061382015971997f, - 0.15074322534754322f, - 0.150872627952422f, - 0.1510020279721391f, - 0.15113142540447722f, - 0.1512608202472192f, - 0.1513902124981479f, - 0.15151960215504617f, - 0.15164898921569706f, - 0.15177837367788347f, - 0.15190775553938837f, - 0.15203713479799502f, - 0.15216651145148638f, - 0.1522958854976457f, - 0.15242525693425618f, - 0.15255462575910103f, - 0.1526839919699636f, - 0.15281335556462725f, - 0.15294271654087527f, - 0.1530720748964912f, - 0.15320143062925848f, - 0.15333078373696063f, - 0.15346013421738122f, - 0.1535894820683039f, - 0.15371882728751224f, - 0.15384816987279004f, - 0.153977509821921f, - 0.15410684713268896f, - 0.15423618180287768f, - 0.1543655138302711f, - 0.1544948432126532f, - 0.15462416994780787f, - 0.15475349403351912f, - 0.15488281546757113f, - 0.15501213424774787f, - 0.1551414503718336f, - 0.1552707638376125f, - 0.15540007464286879f, - 0.1555293827853868f, - 0.15565868826295087f, - 0.15578799107334532f, - 0.1559172912143547f, - 0.15604658868376334f, - 0.15617588347935588f, - 0.15630517559891685f, - 0.15643446504023087f, - 0.15656375180108256f, - 0.1566930358792567f, - 0.15682231727253798f, - 0.15695159597871122f, - 0.1570808719955613f, - 0.15721014532087305f, - 0.15733941595243142f, - 0.1574686838880214f, - 0.15759794912542807f, - 0.15772721166243642f, - 0.1578564714968316f, - 0.15798572862639884f, - 0.15811498304892327f, - 0.15824423476219016f, - 0.15837348376398488f, - 0.1585027300520927f, - 0.1586319736242991f, - 0.15876121447838948f, - 0.1588904526121493f, - 0.1590196880233642f, - 0.15914892070981965f, - 0.15927815066930137f, - 0.15940737789959503f, - 0.1595366023984863f, - 0.159665824163761f, - 0.15979504319320495f, - 0.15992425948460398f, - 0.16005347303574405f, - 0.16018268384441112f, - 0.1603118919083911f, - 0.1604410972254702f, - 0.16057029979343443f, - 0.1606994996100699f, - 0.16082869667316294f, - 0.16095789098049965f, - 0.1610870825298664f, - 0.16121627131904953f, - 0.16134545734583539f, - 0.16147464060801042f, - 0.16160382110336113f, - 0.161732998829674f, - 0.16186217378473564f, - 0.1619913459663327f, - 0.16212051537225175f, - 0.1622496820002796f, - 0.16237884584820295f, - 0.16250800691380868f, - 0.16263716519488358f, - 0.16276632068921462f, - 0.16289547339458874f, - 0.16302462330879292f, - 0.1631537704296142f, - 0.16328291475483975f, - 0.1634120562822566f, - 0.16354119500965206f, - 0.16367033093481334f, - 0.16379946405552764f, - 0.16392859436958246f, - 0.16405772187476508f, - 0.16418684656886293f, - 0.16431596844966354f, - 0.16444508751495443f, - 0.16457420376252316f, - 0.16470331719015738f, - 0.16483242779564475f, - 0.16496153557677298f, - 0.1650906405313299f, - 0.1652197426571033f, - 0.16534884195188101f, - 0.16547793841345101f, - 0.16560703203960123f, - 0.1657361228281197f, - 0.1658652107767945f, - 0.1659942958834137f, - 0.16612337814576547f, - 0.16625245756163806f, - 0.1663815341288197f, - 0.1665106078450987f, - 0.1666396787082634f, - 0.16676874671610228f, - 0.1668978118664037f, - 0.1670268741569562f, - 0.16715593358554834f, - 0.16728499014996873f, - 0.16741404384800598f, - 0.16754309467744885f, - 0.16767214263608604f, - 0.16780118772170638f, - 0.1679302299320987f, - 0.16805926926505185f, - 0.16818830571835489f, - 0.16831733928979672f, - 0.1684463699771664f, - 0.16857539777825306f, - 0.16870442269084582f, - 0.16883344471273387f, - 0.16896246384170646f, - 0.16909148007555286f, - 0.16922049341206247f, - 0.1693495038490246f, - 0.16947851138422873f, - 0.16960751601546442f, - 0.1697365177405211f, - 0.16986551655718837f, - 0.16999451246325598f, - 0.1701235054565135f, - 0.1702524955347507f, - 0.17038148269575742f, - 0.17051046693732344f, - 0.17063944825723867f, - 0.17076842665329311f, - 0.17089740212327664f, - 0.17102637466497936f, - 0.17115534427619136f, - 0.17128431095470278f, - 0.1714132746983038f, - 0.17154223550478467f, - 0.1716711933719357f, - 0.17180014829754717f, - 0.17192910027940952f, - 0.17205804931531324f, - 0.17218699540304871f, - 0.17231593854040655f, - 0.17244487872517736f, - 0.1725738159551517f, - 0.17270275022812037f, - 0.1728316815418741f, - 0.17296060989420356f, - 0.1730895352828998f, - 0.17321845770575356f, - 0.17334737716055584f, - 0.1734762936450977f, - 0.1736052071571701f, - 0.17373411769456415f, - 0.17386302525507108f, - 0.173991929836482f, - 0.17412083143658824f, - 0.17424973005318106f, - 0.17437862568405185f, - 0.17450751832699196f, - 0.1746364079797929f, - 0.1747652946402462f, - 0.17489417830614337f, - 0.17502305897527604f, - 0.17515193664543588f, - 0.17528081131441461f, - 0.175409682980004f, - 0.17553855163999585f, - 0.17566741729218205f, - 0.1757962799343545f, - 0.1759251395643052f, - 0.17605399617982614f, - 0.17618284977870943f, - 0.1763117003587472f, - 0.1764405479177316f, - 0.1765693924534549f, - 0.17669823396370934f, - 0.1768270724462873f, - 0.17695590789898114f, - 0.1770847403195833f, - 0.17721356970588625f, - 0.1773423960556826f, - 0.17747121936676488f, - 0.17760003963692578f, - 0.17772885686395798f, - 0.1778576710456542f, - 0.1779864821798073f, - 0.17811529026421014f, - 0.17824409529665555f, - 0.17837289727493658f, - 0.1785016961968462f, - 0.17863049206017745f, - 0.17875928486272352f, - 0.1788880746022775f, - 0.17901686127663266f, - 0.1791456448835823f, - 0.17927442542091968f, - 0.1794032028864382f, - 0.17953197727793135f, - 0.17966074859319253f, - 0.17978951683001534f, - 0.17991828198619333f, - 0.1800470440595202f, - 0.1801758030477896f, - 0.1803045589487953f, - 0.1804333117603311f, - 0.18056206148019083f, - 0.1806908081061684f, - 0.1808195516360578f, - 0.18094829206765306f, - 0.18107702939874817f, - 0.18120576362713736f, - 0.1813344947506147f, - 0.1814632227669745f, - 0.181591947674011f, - 0.18172066946951848f, - 0.18184938815129142f, - 0.18197810371712422f, - 0.18210681616481136f, - 0.18223552549214747f, - 0.182364231696927f, - 0.18249293477694473f, - 0.18262163472999535f, - 0.18275033155387355f, - 0.1828790252463742f, - 0.18300771580529218f, - 0.18313640322842234f, - 0.18326508751355977f, - 0.1833937686584994f, - 0.18352244666103634f, - 0.1836511215189658f, - 0.18377979323008284f, - 0.1839084617921828f, - 0.18403712720306095f, - 0.18416578946051265f, - 0.1842944485623333f, - 0.18442310450631838f, - 0.18455175729026335f, - 0.18468040691196383f, - 0.18480905336921544f, - 0.18493769665981385f, - 0.1850663367815548f, - 0.18519497373223404f, - 0.18532360750964746f, - 0.18545223811159092f, - 0.1855808655358604f, - 0.18570948978025187f, - 0.1858381108425614f, - 0.18596672872058512f, - 0.1860953434121192f, - 0.18622395491495977f, - 0.18635256322690327f, - 0.18648116834574593f, - 0.1866097702692841f, - 0.18673836899531432f, - 0.186866964521633f, - 0.18699555684603675f, - 0.18712414596632218f, - 0.18725273188028588f, - 0.1873813145857246f, - 0.18750989408043517f, - 0.18763847036221432f, - 0.18776704342885897f, - 0.1878956132781661f, - 0.18802417990793263f, - 0.18815274331595563f, - 0.1882813035000322f, - 0.18840986045795952f, - 0.18853841418753478f, - 0.18866696468655522f, - 0.18879551195281824f, - 0.18892405598412113f, - 0.18905259677826136f, - 0.18918113433303646f, - 0.18930966864624388f, - 0.1894381997156813f, - 0.18956672753914636f, - 0.18969525211443672f, - 0.1898237734393502f, - 0.18995229151168463f, - 0.1900808063292378f, - 0.19020931788980777f, - 0.19033782619119247f, - 0.19046633123118986f, - 0.1905948330075982f, - 0.19072333151821552f, - 0.19085182676084012f, - 0.1909803187332702f, - 0.19110880743330413f, - 0.19123729285874028f, - 0.1913657750073771f, - 0.19149425387701297f, - 0.19162272946544662f, - 0.19175120177047658f, - 0.19187967078990142f, - 0.19200813652152002f, - 0.19213659896313104f, - 0.19226505811253333f, - 0.19239351396752583f, - 0.19252196652590742f, - 0.19265041578547712f, - 0.19277886174403402f, - 0.1929073043993772f, - 0.19303574374930582f, - 0.19316417979161915f, - 0.1932926125241164f, - 0.19342104194459697f, - 0.19354946805086023f, - 0.1936778908407057f, - 0.1938063103119328f, - 0.1939347264623411f, - 0.19406313928973032f, - 0.1941915487919f, - 0.19431995496665f, - 0.1944483578117801f, - 0.19457675732509006f, - 0.1947051535043799f, - 0.1948335463474495f, - 0.1949619358520989f, - 0.19509032201612825f, - 0.19521870483733764f, - 0.19534708431352724f, - 0.19547546044249733f, - 0.19560383322204822f, - 0.19573220264998029f, - 0.1958605687240939f, - 0.1959889314421896f, - 0.19611729080206794f, - 0.19624564680152945f, - 0.19637399943837477f, - 0.19650234871040478f, - 0.19663069461542007f, - 0.19675903715122148f, - 0.19688737631561004f, - 0.19701571210638652f, - 0.19714404452135204f, - 0.19727237355830765f, - 0.19740069921505438f, - 0.19752902148939344f, - 0.19765734037912616f, - 0.19778565588205368f, - 0.19791396799597746f, - 0.19804227671869887f, - 0.19817058204801935f, - 0.19829888398174045f, - 0.19842718251766375f, - 0.19855547765359088f, - 0.19868376938732354f, - 0.19881205771666352f, - 0.19894034263941257f, - 0.1990686241533726f, - 0.19919690225634556f, - 0.1993251769461334f, - 0.19945344822053815f, - 0.199581716077362f, - 0.19970998051440703f, - 0.19983824152947546f, - 0.1999664991203697f, - 0.20009475328489196f, - 0.20022300402084464f, - 0.20035125132603032f, - 0.20047949519825137f, - 0.20060773563531045f, - 0.20073597263501022f, - 0.20086420619515324f, - 0.2009924363135424f, - 0.2011206629879805f, - 0.20124888621627032f, - 0.20137710599621486f, - 0.20150532232561713f, - 0.2016335352022801f, - 0.20176174462400692f, - 0.2018899505886008f, - 0.20201815309386487f, - 0.20214635213760246f, - 0.20227454771761694f, - 0.2024027398317117f, - 0.20253092847769016f, - 0.20265911365335593f, - 0.2027872953565125f, - 0.20291547358496353f, - 0.20304364833651278f, - 0.20317181960896397f, - 0.2032999874001209f, - 0.2034281517077874f, - 0.20355631252976764f, - 0.20368446986386532f, - 0.2038126237078847f, - 0.20394077405962985f, - 0.20406892091690487f, - 0.2041970642775141f, - 0.2043252041392618f, - 0.20445334049995234f, - 0.2045814733573901f, - 0.2047096027093796f, - 0.20483772855372537f, - 0.20496585088823197f, - 0.20509396971070412f, - 0.2052220850189465f, - 0.20535019681076389f, - 0.20547830508396114f, - 0.20560640983634315f, - 0.20573451106571486f, - 0.20586260876988133f, - 0.2059907029466476f, - 0.2061187935938188f, - 0.2062468807092002f, - 0.20637496429059698f, - 0.20650304433581448f, - 0.2066311208426582f, - 0.20675919380893343f, - 0.2068872632324457f, - 0.20701532911100068f, - 0.20714339144240385f, - 0.207271450224461f, - 0.2073995054549779f, - 0.20752755713176022f, - 0.20765560525261395f, - 0.207783649815345f, - 0.20791169081775931f, - 0.20803972825766298f, - 0.20816776213286214f, - 0.20829579244116292f, - 0.20842381918037156f, - 0.20855184234829438f, - 0.20867986194273772f, - 0.208807877961508f, - 0.2089358904024117f, - 0.20906389926325536f, - 0.20919190454184558f, - 0.20931990623598906f, - 0.20944790434349247f, - 0.20957589886216263f, - 0.20970388978980642f, - 0.20983187712423065f, - 0.20995986086324236f, - 0.21008784100464864f, - 0.21021581754625648f, - 0.21034379048587304f, - 0.21047175982130567f, - 0.21059972555036147f, - 0.2107276876708479f, - 0.21085564618057237f, - 0.21098360107734224f, - 0.21111155235896514f, - 0.21123950002324865f, - 0.21136744406800034f, - 0.211495384491028f, - 0.21162332129013942f, - 0.21175125446314239f, - 0.21187918400784478f, - 0.21200710992205463f, - 0.21213503220357993f, - 0.21226295085022873f, - 0.21239086585980926f, - 0.21251877723012966f, - 0.21264668495899822f, - 0.21277458904422328f, - 0.21290248948361323f, - 0.21303038627497656f, - 0.2131582794161218f, - 0.21328616890485746f, - 0.21341405473899222f, - 0.2135419369163349f, - 0.21366981543469413f, - 0.21379769029187876f, - 0.2139255614856978f, - 0.2140534290139601f, - 0.21418129287447468f, - 0.21430915306505077f, - 0.21443700958349732f, - 0.21456486242762368f, - 0.21469271159523914f, - 0.21482055708415293f, - 0.2149483988921745f, - 0.21507623701711337f, - 0.215204071456779f, - 0.21533190220898102f, - 0.21545972927152907f, - 0.21558755264223287f, - 0.21571537231890217f, - 0.21584318829934687f, - 0.21597100058137683f, - 0.21609880916280205f, - 0.2162266140414326f, - 0.21635441521507848f, - 0.2164822126815499f, - 0.21661000643865713f, - 0.2167377964842104f, - 0.21686558281602009f, - 0.2169933654318966f, - 0.2171211443296504f, - 0.21724891950709205f, - 0.21737669096203222f, - 0.21750445869228147f, - 0.21763222269565052f, - 0.21775998296995036f, - 0.21788773951299162f, - 0.21801549232258535f, - 0.21814324139654256f, - 0.21827098673267423f, - 0.21839872832879148f, - 0.21852646618270558f, - 0.2186542002922277f, - 0.21878193065516915f, - 0.21890965726934136f, - 0.21903738013255572f, - 0.21916509924262373f, - 0.21929281459735697f, - 0.21942052619456712f, - 0.2195482340320658f, - 0.21967593810766478f, - 0.21980363841917597f, - 0.21993133496441117f, - 0.2200590277411823f, - 0.22018671674730156f, - 0.22031440198058083f, - 0.22044208343883234f, - 0.22056976111986837f, - 0.22069743502150108f, - 0.22082510514154285f, - 0.22095277147780618f, - 0.22108043402810337f, - 0.22120809279024709f, - 0.22133574776204992f, - 0.2214633989413245f, - 0.22159104632588356f, - 0.22171868991353993f, - 0.2218463297021064f, - 0.22197396568939598f, - 0.22210159787322165f, - 0.2222292262513964f, - 0.2223568508217334f, - 0.22248447158204587f, - 0.222612088530147f, - 0.22273970166385013f, - 0.22286731098096865f, - 0.22299491647931602f, - 0.2231225181567057f, - 0.22325011601095138f, - 0.2233777100398666f, - 0.22350530024126505f, - 0.22363288661296066f, - 0.22376046915276712f, - 0.22388804785849836f, - 0.2240156227279685f, - 0.22414319375899133f, - 0.22427076094938114f, - 0.2243983242969521f, - 0.22452588379951835f, - 0.22465343945489424f, - 0.22478099126089418f, - 0.22490853921533252f, - 0.2250360833160238f, - 0.22516362356078262f, - 0.22529115994742355f, - 0.2254186924737613f, - 0.22554622113761072f, - 0.22567374593678652f, - 0.22580126686910368f, - 0.22592878393237714f, - 0.2260562971244219f, - 0.22618380644305308f, - 0.2263113118860859f, - 0.22643881345133546f, - 0.22656631113661713f, - 0.2266938049397463f, - 0.22682129485853836f, - 0.2269487808908088f, - 0.22707626303437323f, - 0.22720374128704718f, - 0.2273312156466464f, - 0.22745868611098674f, - 0.2275861526778839f, - 0.22771361534515377f, - 0.22784107411061244f, - 0.22796852897207578f, - 0.22809597992736f, - 0.2282234269742813f, - 0.22835087011065572f, - 0.22847830933429972f, - 0.22860574464302963f, - 0.22873317603466184f, - 0.2288606035070129f, - 0.22898802705789933f, - 0.22911544668513778f, - 0.22924286238654495f, - 0.22937027415993763f, - 0.2294976820031326f, - 0.22962508591394679f, - 0.2297524858901972f, - 0.2298798819297008f, - 0.23000727403027474f, - 0.2301346621897362f, - 0.23026204640590237f, - 0.23038942667659057f, - 0.23051680299961824f, - 0.2306441753728027f, - 0.23077154379396153f, - 0.2308989082609124f, - 0.23102626877147278f, - 0.23115362532346043f, - 0.23128097791469324f, - 0.2314083265429889f, - 0.23153567120616542f, - 0.23166301190204083f, - 0.23179034862843303f, - 0.23191768138316027f, - 0.2320450101640407f, - 0.23217233496889256f, - 0.23229965579553416f, - 0.23242697264178397f, - 0.23255428550546037f, - 0.23268159438438188f, - 0.2328088992763672f, - 0.2329362001792349f, - 0.2330634970908037f, - 0.2331907900088925f, - 0.23331807893132006f, - 0.2334453638559054f, - 0.23357264478046752f, - 0.23369992170282544f, - 0.23382719462079835f, - 0.23395446353220545f, - 0.23408172843486602f, - 0.2342089893265994f, - 0.23433624620522506f, - 0.23446349906856243f, - 0.23459074791443105f, - 0.23471799274065067f, - 0.2348452335450408f, - 0.23497247032542132f, - 0.23509970307961206f, - 0.23522693180543292f, - 0.23535415650070385f, - 0.23548137716324485f, - 0.23560859379087612f, - 0.23573580638141778f, - 0.23586301493269005f, - 0.23599021944251333f, - 0.2361174199087079f, - 0.2362446163290943f, - 0.23637180870149305f, - 0.23649899702372468f, - 0.23662618129360988f, - 0.23675336150896942f, - 0.23688053766762407f, - 0.23700770976739466f, - 0.23713487780610223f, - 0.2372620417815677f, - 0.23738920169161218f, - 0.23751635753405687f, - 0.2376435093067229f, - 0.23777065700743158f, - 0.23789780063400434f, - 0.2380249401842625f, - 0.23815207565602764f, - 0.23827920704712136f, - 0.23840633435536515f, - 0.23853345757858085f, - 0.23866057671459023f, - 0.23878769176121506f, - 0.2389148027162773f, - 0.23904190957759897f, - 0.23916901234300209f, - 0.2392961110103088f, - 0.23942320557734129f, - 0.23955029604192182f, - 0.23967738240187275f, - 0.23980446465501654f, - 0.23993154279917553f, - 0.2400586168321724f, - 0.24018568675182975f, - 0.24031275255597018f, - 0.24043981424241656f, - 0.2405668718089917f, - 0.24069392525351843f, - 0.24082097457381976f, - 0.24094801976771885f, - 0.24107506083303865f, - 0.2412020977676024f, - 0.24132913056923344f, - 0.24145615923575492f, - 0.2415831837649904f, - 0.24171020415476335f, - 0.24183722040289715f, - 0.24196423250721555f, - 0.24209124046554223f, - 0.24221824427570088f, - 0.24234524393551535f, - 0.24247223944280955f, - 0.2425992307954074f, - 0.242726217991133f, - 0.24285320102781044f, - 0.24298017990326387f, - 0.24310715461531757f, - 0.24323412516179588f, - 0.24336109154052313f, - 0.2434880537493238f, - 0.24361501178602252f, - 0.24374196564844378f, - 0.24386891533441232f, - 0.2439958608417529f, - 0.2441228021682903f, - 0.2442497393118494f, - 0.24437667227025528f, - 0.24450360104133287f, - 0.24463052562290727f, - 0.24475744601280378f, - 0.24488436220884752f, - 0.24501127420886387f, - 0.2451381820106783f, - 0.2452650856121161f, - 0.24539198501100298f, - 0.24551888020516452f, - 0.24564577119242634f, - 0.2457726579706142f, - 0.24589954053755403f, - 0.24602641889107163f, - 0.24615329302899303f, - 0.24628016294914426f, - 0.2464070286493514f, - 0.24653389012744067f, - 0.2466607473812384f, - 0.2467876004085708f, - 0.24691444920726435f, - 0.24704129377514555f, - 0.24716813411004088f, - 0.24729497020977703f, - 0.24742180207218067f, - 0.24754862969507857f, - 0.24767545307629757f, - 0.24780227221366466f, - 0.2479290871050067f, - 0.24805589774815082f, - 0.24818270414092414f, - 0.2483095062811539f, - 0.24843630416666732f, - 0.24856309779529184f, - 0.2486898871648548f, - 0.24881667227318371f, - 0.24894345311810617f, - 0.24907022969744982f, - 0.24919700200904238f, - 0.24932377005071168f, - 0.24945053382028548f, - 0.24957729331559173f, - 0.24970404853445857f, - 0.24983079947471395f, - 0.2499575461341861f, - 0.25008428851070325f, - 0.2502110266020936f, - 0.25033776040618566f, - 0.2504644899208079f, - 0.2505912151437886f, - 0.25071793607295667f, - 0.2508446527061406f, - 0.2509713650411691f, - 0.2510980730758712f, - 0.25122477680807553f, - 0.25135147623561127f, - 0.25147817135630735f, - 0.2516048621679929f, - 0.25173154866849706f, - 0.2518582308556492f, - 0.2519849087272786f, - 0.25211158228121466f, - 0.25223825151528684f, - 0.25236491642732467f, - 0.25249157701515795f, - 0.2526182332766162f, - 0.2527448852095293f, - 0.25287153281172714f, - 0.2529981760810394f, - 0.2531248150152964f, - 0.2532514496123281f, - 0.2533780798699646f, - 0.2535047057860361f, - 0.25363132735837296f, - 0.2537579445848056f, - 0.2538845574631644f, - 0.25401116599127993f, - 0.2541377701669827f, - 0.2542643699881034f, - 0.2543909654524729f, - 0.2545175565579219f, - 0.2546441433022813f, - 0.25477072568338216f, - 0.25489730369905544f, - 0.2550238773471323f, - 0.25515044662544384f, - 0.2552770115318215f, - 0.2554035720640965f, - 0.2555301282201003f, - 0.2556566799976644f, - 0.2557832273946203f, - 0.25590977040879975f, - 0.25603630903803437f, - 0.25616284328015604f, - 0.25628937313299666f, - 0.256415898594388f, - 0.25654241966216224f, - 0.25666893633415144f, - 0.25679544860818776f, - 0.2569219564821034f, - 0.2570484599537308f, - 0.2571749590209022f, - 0.2573014536814502f, - 0.25742794393320734f, - 0.25755442977400617f, - 0.2576809112016794f, - 0.25780738821405985f, - 0.25793386080898034f, - 0.25806032898427383f, - 0.25818679273777334f, - 0.25831325206731187f, - 0.2584397069707226f, - 0.2585661574458388f, - 0.25869260349049367f, - 0.25881904510252074f, - 0.25894548227975345f, - 0.2590719150200252f, - 0.25919834332116964f, - 0.25932476718102054f, - 0.2594511865974116f, - 0.25957760156817666f, - 0.25970401209114974f, - 0.25983041816416463f, - 0.2599568197850555f, - 0.2600832169516566f, - 0.26020960966180195f, - 0.26033599791332596f, - 0.260462381704063f, - 0.2605887610318474f, - 0.26071513589451384f, - 0.26084150628989694f, - 0.26096787221583123f, - 0.2610942336701515f, - 0.26122059065069264f, - 0.26134694315528956f, - 0.2614732911817772f, - 0.2615996347279907f, - 0.26172597379176504f, - 0.26185230837093554f, - 0.26197863846333747f, - 0.2621049640668062f, - 0.2622312851791772f, - 0.26235760179828604f, - 0.2624839139219682f, - 0.2626102215480594f, - 0.2627365246743954f, - 0.262862823298812f, - 0.26298911741914516f, - 0.26311540703323094f, - 0.2632416921389052f, - 0.26336797273400414f, - 0.26349424881636413f, - 0.2636205203838213f, - 0.26374678743421204f, - 0.2638730499653729f, - 0.26399930797514026f, - 0.26412556146135086f, - 0.26425181042184137f, - 0.26437805485444843f, - 0.26450429475700893f, - 0.2646305301273598f, - 0.26475676096333806f, - 0.2648829872627807f, - 0.265009209023525f, - 0.265135426243408f, - 0.26526163892026716f, - 0.2653878470519398f, - 0.2655140506362634f, - 0.2656402496710754f, - 0.2657664441542136f, - 0.2658926340835155f, - 0.26601881945681893f, - 0.2661450002719618f, - 0.26627117652678195f, - 0.2663973482191174f, - 0.2665235153468064f, - 0.2666496779076869f, - 0.26677583589959714f, - 0.2669019893203755f, - 0.2670281381678605f, - 0.2671542824398904f, - 0.26728042213430386f, - 0.2674065572489395f, - 0.267532687781636f, - 0.26765881373023226f, - 0.267784935092567f, - 0.26791105186647923f, - 0.268037164049808f, - 0.2681632716403923f, - 0.2682893746360714f, - 0.26841547303468455f, - 0.26854156683407115f, - 0.26866765603207055f, - 0.26879374062652217f, - 0.2689198206152657f, - 0.26904589599614076f, - 0.269171966766987f, - 0.26929803292564447f, - 0.2694240944699528f, - 0.269550151397752f, - 0.2696762037068823f, - 0.26980225139518366f, - 0.2699282944604963f, - 0.2700543329006606f, - 0.2701803667135168f, - 0.2703063958969054f, - 0.27043242044866705f, - 0.2705584403666421f, - 0.27068445564867144f, - 0.27081046629259575f, - 0.27093647229625584f, - 0.27106247365749275f, - 0.2711884703741474f, - 0.2713144624440608f, - 0.27144044986507426f, - 0.2715664326350289f, - 0.2716924107517661f, - 0.2718183842131272f, - 0.2719443530169538f, - 0.2720703171610873f, - 0.2721962766433695f, - 0.272322231461642f, - 0.27244818161374657f, - 0.2725741270975252f, - 0.27270006791081985f, - 0.2728260040514725f, - 0.27295193551732516f, - 0.2730778623062203f, - 0.27320378441599996f, - 0.2733297018445066f, - 0.2734556145895827f, - 0.2735815226490706f, - 0.2737074260208131f, - 0.2738333247026528f, - 0.27395921869243245f, - 0.2740851079879949f, - 0.27421099258718307f, - 0.27433687248783994f, - 0.27446274768780865f, - 0.27458861818493235f, - 0.2747144839770542f, - 0.2748403450620176f, - 0.274966201437666f, - 0.2750920531018427f, - 0.2752179000523915f, - 0.2753437422871559f, - 0.2754695798039797f, - 0.27559541260070664f, - 0.2757212406751806f, - 0.2758470640252456f, - 0.2759728826487457f, - 0.2760986965435251f, - 0.2762245057074278f, - 0.2763503101382982f, - 0.2764761098339808f, - 0.27660190479231994f, - 0.2767276950111601f, - 0.27685348048834607f, - 0.27697926122172234f, - 0.2771050372091338f, - 0.2772308084484254f, - 0.2773565749374419f, - 0.2774823366740285f, - 0.2776080936560302f, - 0.2777338458812922f, - 0.27785959334765975f, - 0.2779853360529783f, - 0.2781110739950932f, - 0.27823680717185f, - 0.27836253558109425f, - 0.2784882592206716f, - 0.2786139780884279f, - 0.27873969218220906f, - 0.27886540149986083f, - 0.2789911060392293f, - 0.27911680579816045f, - 0.2792425007745006f, - 0.27936819096609594f, - 0.27949387637079287f, - 0.27961955698643765f, - 0.2797452328108769f, - 0.2798709038419571f, - 0.27999657007752504f, - 0.28012223151542737f, - 0.280247888153511f, - 0.28037353998962267f, - 0.2804991870216095f, - 0.28062482924731863f, - 0.280750466664597f, - 0.2808760992712921f, - 0.28100172706525106f, - 0.2811273500443213f, - 0.2812529682063504f, - 0.2813785815491859f, - 0.2815041900706754f, - 0.2816297937686666f, - 0.2817553926410074f, - 0.2818809866855457f, - 0.2820065759001294f, - 0.2821321602826067f, - 0.2822577398308256f, - 0.2823833145426343f, - 0.2825088844158813f, - 0.2826344494484148f, - 0.28276000963808345f, - 0.2828855649827357f, - 0.28301111548022023f, - 0.28313666112838576f, - 0.283262201925081f, - 0.2833877378681551f, - 0.28351326895545675f, - 0.28363879518483515f, - 0.2837643165541395f, - 0.2838898330612188f, - 0.2840153447039226f, - 0.2841408514801002f, - 0.28426635338760103f, - 0.28439185042427473f, - 0.2845173425879709f, - 0.28464282987653927f, - 0.2847683122878297f, - 0.284893789819692f, - 0.2850192624699761f, - 0.2851447302365322f, - 0.2852701931172104f, - 0.28539565110986087f, - 0.285521104212334f, - 0.28564655242248016f, - 0.28577199573814976f, - 0.28589743415719343f, - 0.2860228676774618f, - 0.28614829629680566f, - 0.2862737200130757f, - 0.286399138824123f, - 0.2865245527277983f, - 0.2866499617219528f, - 0.28677536580443774f, - 0.2869007649731042f, - 0.2870261592258036f, - 0.2871515485603873f, - 0.28727693297470674f, - 0.2874023124666136f, - 0.2875276870339595f, - 0.28765305667459606f, - 0.28777842138637527f, - 0.287903781167149f, - 0.28802913601476915f, - 0.2881544859270879f, - 0.28827983090195747f, - 0.28840517093722995f, - 0.2885305060307577f, - 0.2886558361803932f, - 0.28878116138398896f, - 0.2889064816393975f, - 0.2890317969444716f, - 0.2891571072970639f, - 0.28928241269502725f, - 0.28940771313621466f, - 0.2895330086184791f, - 0.2896582991396736f, - 0.2897835846976515f, - 0.2899088652902659f, - 0.2900341409153701f, - 0.2901594115708178f, - 0.29028467725446233f, - 0.29040993796415737f, - 0.2905351936977566f, - 0.2906604444531137f, - 0.2907856902280826f, - 0.29091093102051735f, - 0.2910361668282718f, - 0.29116139764920024f, - 0.29128662348115675f, - 0.29141184432199563f, - 0.2915370601695713f, - 0.2916622710217383f, - 0.291787476876351f, - 0.2919126777312641f, - 0.29203787358433236f, - 0.2921630644334105f, - 0.2922882502763535f, - 0.29241343111101636f, - 0.292538606935254f, - 0.29266377774692165f, - 0.2927889435438746f, - 0.29291410432396797f, - 0.2930392600850574f, - 0.2931644108249983f, - 0.2932895565416462f, - 0.2934146972328567f, - 0.2935398328964857f, - 0.29366496353038896f, - 0.2937900891324224f, - 0.29391520970044205f, - 0.29404032523230395f, - 0.2941654357258643f, - 0.29429054117897946f, - 0.29441564158950567f, - 0.29454073695529936f, - 0.29466582727421714f, - 0.29479091254411555f, - 0.29491599276285135f, - 0.29504106792828133f, - 0.29516613803826225f, - 0.2952912030906511f, - 0.29541626308330504f, - 0.29554131801408107f, - 0.29566636788083644f, - 0.2957914126814286f, - 0.2959164524137147f, - 0.2960414870755524f, - 0.2961665166647991f, - 0.2962915411793126f, - 0.2964165606169506f, - 0.296541574975571f, - 0.2966665842530315f, - 0.2967915884471902f, - 0.29691658755590533f, - 0.2970415815770349f, - 0.2971665705084372f, - 0.29729155434797067f, - 0.2974165330934936f, - 0.29754150674286456f, - 0.29766647529394225f, - 0.2977914387445853f, - 0.2979163970926525f, - 0.29804135033600265f, - 0.2981662984724949f, - 0.29829124149998804f, - 0.2984161794163414f, - 0.2985411122194142f, - 0.2986660399070657f, - 0.29879096247715525f, - 0.29891587992754237f, - 0.29904079225608665f, - 0.29916569946064775f, - 0.29929060153908543f, - 0.2994154984892595f, - 0.29954039030902985f, - 0.2996652769962566f, - 0.29979015854879976f, - 0.29991503496451954f, - 0.30003990624127624f, - 0.3001647723769301f, - 0.30028963336934184f, - 0.30041448921637176f, - 0.3005393399158806f, - 0.300664185465729f, - 0.3007890258637778f, - 0.300913861107888f, - 0.30103869119592036f, - 0.3011635161257362f, - 0.3012883358951965f, - 0.3014131505021625f, - 0.30153795994449567f, - 0.30166276422005733f, - 0.30178756332670903f, - 0.3019123572623124f, - 0.30203714602472903f, - 0.3021619296118208f, - 0.3022867080214495f, - 0.30241148125147715f, - 0.30253624929976575f, - 0.30266101216417757f, - 0.3027857698425746f, - 0.30291052233281923f, - 0.30303526963277394f, - 0.3031600117403012f, - 0.30328474865326355f, - 0.3034094803695237f, - 0.3035342068869443f, - 0.30365892820338825f, - 0.3037836443167186f, - 0.3039083552247982f, - 0.30403306092549026f, - 0.304157761416658f, - 0.3042824566961646f, - 0.3044071467618735f, - 0.3045318316116483f, - 0.30465651124335236f, - 0.3047811856548494f, - 0.3049058548440031f, - 0.3050305188086775f, - 0.30515517754673627f, - 0.30527983105604356f, - 0.30540447933446335f, - 0.30552912237985996f, - 0.30565376019009755f, - 0.3057783927630406f, - 0.30590302009655346f, - 0.30602764218850076f, - 0.30615225903674703f, - 0.30627687063915704f, - 0.30640147699359566f, - 0.3065260780979277f, - 0.3066506739500182f, - 0.30677526454773235f, - 0.30689984988893515f, - 0.3070244299714919f, - 0.30714900479326807f, - 0.30727357435212893f, - 0.3073981386459402f, - 0.3075226976725674f, - 0.30764725142987615f, - 0.30777179991573245f, - 0.3078963431280021f, - 0.3080208810645511f, - 0.3081454137232455f, - 0.3082699411019515f, - 0.3083944631985353f, - 0.3085189800108633f, - 0.308643491536802f, - 0.30876799777421776f, - 0.30889249872097735f, - 0.3090169943749474f, - 0.3091414847339948f, - 0.30926596979598625f, - 0.309390449558789f, - 0.3095149240202699f, - 0.3096393931782962f, - 0.30976385703073517f, - 0.3098883155754541f, - 0.3100127688103205f, - 0.3101372167332019f, - 0.3102616593419658f, - 0.31038609663447997f, - 0.31051052860861234f, - 0.3106349552622306f, - 0.31075937659320285f, - 0.3108837925993972f, - 0.3110082032786816f, - 0.31113260862892456f, - 0.3112570086479944f, - 0.31138140333375935f, - 0.3115057926840881f, - 0.31163017669684934f, - 0.3117545553699116f, - 0.3118789287011438f, - 0.31200329668841487f, - 0.3121276593295937f, - 0.31225201662254937f, - 0.31237636856515116f, - 0.3125007151552682f, - 0.31262505639077f, - 0.31274939226952586f, - 0.3128737227894054f, - 0.3129980479482782f, - 0.31312236774401403f, - 0.31324668217448265f, - 0.313370991237554f, - 0.3134952949310981f, - 0.31361959325298505f, - 0.3137438862010849f, - 0.3138681737732681f, - 0.31399245596740494f, - 0.31411673278136587f, - 0.3142410042130214f, - 0.31436527026024225f, - 0.3144895309208991f, - 0.31461378619286284f, - 0.31473803607400436f, - 0.3148622805621946f, - 0.3149865196553048f, - 0.31511075335120603f, - 0.31523498164776964f, - 0.315359204542867f, - 0.31548342203436963f, - 0.315607634120149f, - 0.31573184079807687f, - 0.3158560420660249f, - 0.315980237921865f, - 0.3161044283634691f, - 0.3162286133887093f, - 0.3163527929954575f, - 0.3164769671815861f, - 0.31660113594496736f, - 0.3167252992834737f, - 0.31684945719497765f, - 0.3169736096773517f, - 0.31709775672846857f, - 0.31722189834620107f, - 0.3173460345284221f, - 0.3174701652730045f, - 0.3175942905778214f, - 0.3177184104407459f, - 0.3178425248596513f, - 0.3179666338324109f, - 0.3180907373568982f, - 0.31821483543098655f, - 0.3183389280525497f, - 0.31846301521946135f, - 0.3185870969295952f, - 0.31871117318082526f, - 0.31883524397102553f, - 0.31895930929807f, - 0.3190833691598328f, - 0.3192074235541883f, - 0.3193314724790109f, - 0.3194555159321749f, - 0.319579553911555f, - 0.3197035864150258f, - 0.3198276134404619f, - 0.3199516349857384f, - 0.32007565104873f, - 0.3201996616273118f, - 0.3203236667193589f, - 0.32044766632274646f, - 0.3205716604353499f, - 0.32069564905504455f, - 0.3208196321797059f, - 0.3209436098072095f, - 0.321067581935431f, - 0.3211915485622463f, - 0.32131550968553113f, - 0.3214394653031616f, - 0.3215634154130136f, - 0.32168736001296333f, - 0.32181129910088707f, - 0.3219352326746612f, - 0.322059160732162f, - 0.3221830832712662f, - 0.32230700028985027f, - 0.3224309117857909f, - 0.322554817756965f, - 0.32267871820124944f, - 0.32280261311652125f, - 0.3229265025006575f, - 0.3230503863515353f, - 0.32317426466703203f, - 0.3232981374450251f, - 0.3234220046833919f, - 0.32354586638001f, - 0.3236697225327571f, - 0.3237935731395109f, - 0.32391741819814934f, - 0.3240412577065504f, - 0.324165091662592f, - 0.32428892006415233f, - 0.3244127429091096f, - 0.32453656019534216f, - 0.3246603719207285f, - 0.3247841780831471f, - 0.32490797868047644f, - 0.3250317737105954f, - 0.3251555631713827f, - 0.3252793470607173f, - 0.32540312537647814f, - 0.32552689811654445f, - 0.32565066527879516f, - 0.32577442686110974f, - 0.32589818286136757f, - 0.32602193327744805f, - 0.3261456781072308f, - 0.32626941734859544f, - 0.3263931509994218f, - 0.32651687905758964f, - 0.326640601520979f, - 0.3267643183874699f, - 0.32688802965494246f, - 0.32701173532127703f, - 0.32713543538435375f, - 0.3272591298420532f, - 0.3273828186922559f, - 0.3275065019328424f, - 0.3276301795616935f, - 0.32775385157669f, - 0.32787751797571274f, - 0.32800117875664286f, - 0.3281248339173614f, - 0.32824848345574953f, - 0.32837212736968857f, - 0.3284957656570599f, - 0.32861939831574505f, - 0.3287430253436256f, - 0.32886664673858323f, - 0.3289902624984997f, - 0.3291138726212569f, - 0.32923747710473683f, - 0.3293610759468215f, - 0.32948466914539315f, - 0.329608256698334f, - 0.32973183860352645f, - 0.3298554148588529f, - 0.32997898546219584f, - 0.33010255041143816f, - 0.33022610970446237f, - 0.33034966333915144f, - 0.3304732113133883f, - 0.33059675362505586f, - 0.3307202902720374f, - 0.33084382125221623f, - 0.33096734656347543f, - 0.3310908662036986f, - 0.33121438017076926f, - 0.33133788846257095f, - 0.33146139107698747f, - 0.3315848880119026f, - 0.33170837926520025f, - 0.33183186483476446f, - 0.33195534471847926f, - 0.3320788189142289f, - 0.3322022874198977f, - 0.3323257502333702f, - 0.3324492073525306f, - 0.33257265877526365f, - 0.3326961044994541f, - 0.3328195445229866f, - 0.3329429788437462f, - 0.3330664074596178f, - 0.3331898303684865f, - 0.3333132475682373f, - 0.3334366590567559f, - 0.3335600648319273f, - 0.3336834648916371f, - 0.33380685923377096f, - 0.33393024785621434f, - 0.3340536307568532f, - 0.3341770079335734f, - 0.33430037938426077f, - 0.3344237451068015f, - 0.3345471050990817f, - 0.3346704593589876f, - 0.3347938078844056f, - 0.33491715067322225f, - 0.3350404877233239f, - 0.33516381903259734f, - 0.3352871445989293f, - 0.33541046442020656f, - 0.3355337784943162f, - 0.3356570868191452f, - 0.33578038939258065f, - 0.3359036862125099f, - 0.3360269772768201f, - 0.336150262583399f, - 0.33627354213013383f, - 0.33639681591491244f, - 0.3365200839356225f, - 0.33664334619015174f, - 0.3367666026763883f, - 0.33688985339222005f, - 0.33701309833553517f, - 0.33713633750422195f, - 0.3372595708961686f, - 0.3373827985092636f, - 0.3375060203413956f, - 0.33762923639045306f, - 0.3377524466543248f, - 0.33787565113089957f, - 0.3379988498180663f, - 0.33812204271371415f, - 0.3382452298157322f, - 0.3383684111220095f, - 0.3384915866304355f, - 0.3386147563388996f, - 0.33873792024529137f, - 0.33886107834750034f, - 0.3389842306434164f, - 0.33910737713092914f, - 0.3392305178079286f, - 0.3393536526723048f, - 0.33947678172194784f, - 0.3395999049547479f, - 0.3397230223685954f, - 0.3398461339613807f, - 0.3399692397309942f, - 0.34009233967532676f, - 0.3402154337922689f, - 0.34033852207971144f, - 0.34046160453554547f, - 0.3405846811576618f, - 0.3407077519439516f, - 0.3408308168923062f, - 0.3409538760006168f, - 0.34107692926677485f, - 0.3411999766886718f, - 0.3413230182641994f, - 0.3414460539912493f, - 0.34156908386771334f, - 0.3416921078914833f, - 0.3418151260604514f, - 0.3419381383725096f, - 0.34206114482555017f, - 0.34218414541746545f, - 0.34230714014614794f, - 0.34243012900948994f, - 0.34255311200538424f, - 0.3426760891317235f, - 0.3427990603864005f, - 0.3429220257673083f, - 0.34304498527233984f, - 0.3431679388993882f, - 0.34329088664634655f, - 0.3434138285111084f, - 0.34353676449156706f, - 0.34365969458561607f, - 0.3437826187911491f, - 0.3439055371060597f, - 0.3440284495282419f, - 0.3441513560555896f, - 0.3442742566859968f, - 0.34439715141735755f, - 0.3445200402475662f, - 0.34464292317451706f, - 0.3447658001961045f, - 0.34488867131022305f, - 0.3450115365147675f, - 0.34513439580763244f, - 0.34525724918671274f, - 0.3453800966499033f, - 0.3455029381950993f, - 0.3456257738201957f, - 0.345748603523088f, - 0.34587142730167125f, - 0.34599424515384103f, - 0.34611705707749296f, - 0.34623986307052257f, - 0.3463626631308257f, - 0.3464854572562982f, - 0.3466082454448359f, - 0.346731027694335f, - 0.3468538040026917f, - 0.3469765743678021f, - 0.34709933878756266f, - 0.3472220972598698f, - 0.3473448497826201f, - 0.3474675963537102f, - 0.34759033697103703f, - 0.34771307163249726f, - 0.347835800335988f, - 0.34795852307940617f, - 0.34808123986064915f, - 0.34820395067761406f, - 0.3483266555281984f, - 0.3484493544102996f, - 0.3485720473218152f, - 0.34869473426064296f, - 0.3488174152246807f, - 0.3489400902118262f, - 0.3490627592199776f, - 0.34918542224703286f, - 0.34930807929089025f, - 0.34943073034944805f, - 0.3495533754206047f, - 0.3496760145022587f, - 0.3497986475923088f, - 0.3499212746886534f, - 0.3500438957891915f, - 0.3501665108918221f, - 0.35028911999444406f, - 0.35041172309495666f, - 0.350534320191259f, - 0.3506569112812504f, - 0.3507794963628305f, - 0.3509020754338987f, - 0.35102464849235454f, - 0.3511472155360979f, - 0.35126977656302855f, - 0.3513923315710465f, - 0.3515148805580518f, - 0.3516374235219446f, - 0.35175996046062513f, - 0.35188249137199373f, - 0.352005016253951f, - 0.3521275351043973f, - 0.3522500479212335f, - 0.3523725547023603f, - 0.3524950554456785f, - 0.3526175501490892f, - 0.35274003881049343f, - 0.3528625214277924f, - 0.3529849979988874f, - 0.35310746852167985f, - 0.3532299329940712f, - 0.35335239141396296f, - 0.35347484377925714f, - 0.3535972900878553f, - 0.35371973033765935f, - 0.3538421645265715f, - 0.35396459265249364f, - 0.35408701471332815f, - 0.3542094307069774f, - 0.3543318406313437f, - 0.3544542444843296f, - 0.35457664226383784f, - 0.354699033967771f, - 0.3548214195940322f, - 0.35494379914052415f, - 0.35506617260515f, - 0.3551885399858129f, - 0.3553109012804161f, - 0.355433256486863f, - 0.3555556056030571f, - 0.35567794862690205f, - 0.35580028555630133f, - 0.35592261638915884f, - 0.3560449411233785f, - 0.35616725975686425f, - 0.35628957228752023f, - 0.35641187871325075f, - 0.3565341790319599f, - 0.3566564732415522f, - 0.35677876133993225f, - 0.3569010433250046f, - 0.357023319194674f, - 0.35714558894684534f, - 0.35726785257942334f, - 0.3573901100903133f, - 0.3575123614774203f, - 0.35763460673864955f, - 0.3577568458719064f, - 0.3578790788750964f, - 0.35800130574612504f, - 0.358123526482898f, - 0.35824574108332113f, - 0.35836794954530027f, - 0.3584901518667414f, - 0.3586123480455506f, - 0.3587345380796341f, - 0.3588567219668983f, - 0.35897889970524943f, - 0.3591010712925941f, - 0.359223236726839f, - 0.35934539600589066f, - 0.3594675491276561f, - 0.3595896960900422f, - 0.3597118368909561f, - 0.35983397152830476f, - 0.35995609999999545f, - 0.3600782223039357f, - 0.36020033843803295f, - 0.3603224484001947f, - 0.36044455218832855f, - 0.3605666498003424f, - 0.36068874123414413f, - 0.36081082648764173f, - 0.36093290555874336f, - 0.3610549784453571f, - 0.36117704514539134f, - 0.36129910565675444f, - 0.361421159977355f, - 0.36154320810510165f, - 0.3616652500379031f, - 0.3617872857736682f, - 0.3619093153103059f, - 0.36203133864572523f, - 0.3621533557778354f, - 0.36227536670454563f, - 0.36239737142376544f, - 0.36251936993340406f, - 0.3626413622313712f, - 0.3627633483155767f, - 0.36288532818393016f, - 0.36300730183434154f, - 0.36312926926472094f, - 0.3632512304729783f, - 0.363373185457024f, - 0.3634951342147684f, - 0.3636170767441219f, - 0.36373901304299494f, - 0.3638609431092983f, - 0.3639828669409427f, - 0.364104784535839f, - 0.3642266958918982f, - 0.36434860100703137f, - 0.36447049987914965f, - 0.3645923925061644f, - 0.364714278885987f, - 0.36483615901652894f, - 0.36495803289570194f, - 0.3650799005214176f, - 0.3652017618915878f, - 0.36532361700412447f, - 0.36544546585693966f, - 0.3655673084479455f, - 0.3656891447750543f, - 0.3658109748361784f, - 0.36593279862923017f, - 0.3660546161521225f, - 0.36617642740276773f, - 0.3662982323790788f, - 0.3664200310789687f, - 0.36654182350035025f, - 0.36666360964113676f, - 0.3667853894992414f, - 0.3669071630725774f, - 0.36702893035905837f, - 0.3671506913565977f, - 0.36727244606310916f, - 0.36739419447650645f, - 0.36751593659470355f, - 0.36763767241561435f, - 0.3677594019371529f, - 0.3678811251572335f, - 0.3680028420737703f, - 0.3681245526846779f, - 0.36824625698787083f, - 0.3683679549812635f, - 0.36848964666277084f, - 0.3686113320303076f, - 0.3687330110817888f, - 0.3688546838151295f, - 0.3689763502282448f, - 0.36909801031905004f, - 0.36921966408546053f, - 0.3693413115253919f, - 0.36946295263675966f, - 0.3695845874174795f, - 0.36970621586546737f, - 0.36982783797863905f, - 0.3699494537549106f, - 0.3700710631921983f, - 0.3701926662884183f, - 0.3703142630414869f, - 0.3704358534493207f, - 0.3705574375098362f, - 0.37067901522095015f, - 0.37080058658057935f, - 0.3709221515866406f, - 0.371043710237051f, - 0.3711652625297277f, - 0.3712868084625879f, - 0.3714083480335489f, - 0.37152988124052827f, - 0.3716514080814434f, - 0.3717729285542121f, - 0.37189444265675214f, - 0.3720159503869814f, - 0.37213745174281776f, - 0.3722589467221795f, - 0.37238043532298476f, - 0.3725019175431518f, - 0.3726233933805992f, - 0.37274486283324537f, - 0.372866325899009f, - 0.37298778257580895f, - 0.37310923286156394f, - 0.37323067675419297f, - 0.3733521142516153f, - 0.37347354535175f, - 0.37359497005251635f, - 0.3737163883518339f, - 0.373837800247622f, - 0.3739592057378004f, - 0.37408060482028893f, - 0.37420199749300725f, - 0.3743233837538755f, - 0.3744447636008137f, - 0.374566137031742f, - 0.37468750404458073f, - 0.3748088646372504f, - 0.37493021880767136f, - 0.3750515665537643f, - 0.37517290787345f, - 0.37529424276464923f, - 0.3754155712252831f, - 0.37553689325327244f, - 0.3756582088465387f, - 0.37577951800300297f, - 0.3759008207205867f, - 0.3760221169972115f, - 0.3761434068307989f, - 0.37626469021927056f, - 0.3763859671605485f, - 0.3765072376525545f, - 0.3766285016932107f, - 0.3767497592804394f, - 0.37687101041216264f, - 0.37699225508630296f, - 0.37711349330078286f, - 0.3772347250535249f, - 0.37735595034245184f, - 0.37747716916548657f, - 0.377598381520552f, - 0.37771958740557104f, - 0.3778407868184671f, - 0.37796197975716334f, - 0.37808316621958316f, - 0.3782043462036501f, - 0.3783255197072877f, - 0.37844668672841975f, - 0.37856784726497006f, - 0.37868900131486255f, - 0.3788101488760214f, - 0.37893128994637065f, - 0.3790524245238346f, - 0.37917355260633756f, - 0.3792946741918043f, - 0.37941578927815917f, - 0.37953689786332706f, - 0.37965799994523275f, - 0.37977909552180106f, - 0.37990018459095726f, - 0.38002126715062645f, - 0.38014234319873386f, - 0.3802634127332049f, - 0.38038447575196516f, - 0.3805055322529401f, - 0.3806265822340556f, - 0.3807476256932375f, - 0.3808686626284116f, - 0.38098969303750413f, - 0.3811107169184412f, - 0.381231734269149f, - 0.38135274508755407f, - 0.38147374937158296f, - 0.38159474711916214f, - 0.3817157383282184f, - 0.3818367229966787f, - 0.38195770112246985f, - 0.382078672703519f, - 0.3821996377377533f, - 0.38232059622310005f, - 0.38244154815748665f, - 0.3825624935388407f, - 0.3826834323650898f, - 0.38280436463416156f, - 0.38292529034398404f, - 0.3830462094924851f, - 0.3831671220775929f, - 0.3832880280972355f, - 0.3834089275493413f, - 0.3835298204318387f, - 0.3836507067426563f, - 0.38377158647972265f, - 0.3838924596409666f, - 0.3840133262243169f, - 0.38413418622770257f, - 0.3842550396490528f, - 0.3843758864862967f, - 0.3844967267373636f, - 0.38461756040018313f, - 0.3847383874726845f, - 0.3848592079527976f, - 0.38498002183845215f, - 0.385100829127578f, - 0.38522162981810515f, - 0.3853424239079639f, - 0.3854632113950842f, - 0.38558399227739654f, - 0.3857047665528313f, - 0.3858255342193191f, - 0.38594629527479063f, - 0.38606704971717676f, - 0.3861877975444082f, - 0.38630853875441595f, - 0.3864292733451314f, - 0.3865500013144856f, - 0.3866707226604099f, - 0.38679143738083605f, - 0.3869121454736952f, - 0.3870328469369193f, - 0.38715354176844013f, - 0.38727422996618965f, - 0.38739491152809985f, - 0.387515586452103f, - 0.3876362547361311f, - 0.3877569163781168f, - 0.3878775713759925f, - 0.3879982197276907f, - 0.3881188614311443f, - 0.38823949648428613f, - 0.388360124885049f, - 0.38848074663136606f, - 0.3886013617211705f, - 0.38872197015239557f, - 0.38884257192297467f, - 0.38896316703084144f, - 0.38908375547392937f, - 0.3892043372501723f, - 0.389324912357504f, - 0.3894454807938585f, - 0.3895660425571699f, - 0.3896865976453725f, - 0.38980714605640043f, - 0.38992768778818826f, - 0.3900482228386705f, - 0.3901687512057818f, - 0.390289272887457f, - 0.39040978788163094f, - 0.39053029618623863f, - 0.3906507977992152f, - 0.39077129271849587f, - 0.39089178094201604f, - 0.39101226246771104f, - 0.3911327372935168f, - 0.3912532054173686f, - 0.3913736668372024f, - 0.3914941215509542f, - 0.39161456955656f, - 0.3917350108519559f, - 0.3918554454350784f, - 0.3919758733038635f, - 0.392096294456248f, - 0.39221670889016835f, - 0.3923371166035614f, - 0.392457517594364f, - 0.3925779118605131f, - 0.39269829939994566f, - 0.3928186802105989f, - 0.39293905429041026f, - 0.39305942163731705f, - 0.3931797822492568f, - 0.39330013612416737f, - 0.39342048325998624f, - 0.3935408236546514f, - 0.39366115730610085f, - 0.39378148421227277f, - 0.3939018043711053f, - 0.394022117780537f, - 0.39414242443850594f, - 0.39426272434295095f, - 0.39438301749181076f, - 0.39450330388302407f, - 0.3946235835145299f, - 0.39474385638426723f, - 0.3948641224901752f, - 0.39498438183019313f, - 0.39510463440226035f, - 0.39522488020431645f, - 0.39534511923430093f, - 0.3954653514901537f, - 0.39558557696981445f, - 0.3957057956712232f, - 0.3958260075923201f, - 0.39594621273104524f, - 0.396066411085339f, - 0.3961866026531419f, - 0.3963067874323943f, - 0.39642696542103695f, - 0.3965471366170107f, - 0.39666730101825637f, - 0.39678745862271503f, - 0.39690760942832776f, - 0.39702775343303587f, - 0.3971478906347806f, - 0.3972680210315036f, - 0.39738814462114636f, - 0.3975082614016506f, - 0.3976283713709582f, - 0.39774847452701106f, - 0.3978685708677513f, - 0.397988660391121f, - 0.39810874309506256f, - 0.39822881897751833f, - 0.39834888803643087f, - 0.398468950269743f, - 0.3985890056753972f, - 0.3987090542513364f, - 0.3988290959955037f, - 0.3989491309058422f, - 0.39906915898029516f, - 0.39918918021680594f, - 0.39930919461331793f, - 0.39942920216777467f, - 0.39954920287811996f, - 0.3996691967422976f, - 0.39978918375825157f, - 0.39990916392392595f, - 0.40002913723726474f, - 0.40014910369621237f, - 0.4002690632987132f, - 0.40038901604271177f, - 0.4005089619261527f, - 0.40062890094698084f, - 0.40074883310314097f, - 0.4008687583925781f, - 0.4009886768132373f, - 0.4011085883630639f, - 0.4012284930400032f, - 0.4013483908420007f, - 0.40146828176700194f, - 0.4015881658129526f, - 0.40170804297779855f, - 0.4018279132594857f, - 0.4019477766559601f, - 0.402067633165168f, - 0.4021874827850556f, - 0.40230732551356935f, - 0.40242716134865575f, - 0.4025469902882614f, - 0.4026668123303332f, - 0.40278662747281796f, - 0.40290643571366264f, - 0.4030262370508144f, - 0.4031460314822205f, - 0.40326581900582825f, - 0.4033855996195851f, - 0.40350537332143877f, - 0.4036251401093368f, - 0.4037448999812271f, - 0.40386465293505763f, - 0.4039843989687764f, - 0.40410413808033163f, - 0.40422387026767176f, - 0.404343595528745f, - 0.4044633138615f, - 0.4045830252638853f, - 0.40470272973384974f, - 0.4048224272693423f, - 0.4049421178683121f, - 0.4050618015287079f, - 0.4051814782484793f, - 0.4053011480255754f, - 0.40542081085794585f, - 0.4055404667435402f, - 0.4056601156803084f, - 0.4057797576662f, - 0.40589939269916503f, - 0.4060190207771536f, - 0.40613864189811605f, - 0.40625825606000254f, - 0.4063778632607637f, - 0.40649746349834975f, - 0.4066170567707117f, - 0.40673664307580015f, - 0.40685622241156616f, - 0.40697579477596074f, - 0.40709536016693504f, - 0.4072149185824403f, - 0.4073344700204279f, - 0.40745401447884944f, - 0.40757355195565653f, - 0.40769308244880087f, - 0.4078126059562345f, - 0.40793212247590915f, - 0.40805163200577715f, - 0.4081711345437907f, - 0.4082906300879021f, - 0.4084101186360639f, - 0.40852960018622864f, - 0.40864907473634904f, - 0.4087685422843779f, - 0.4088880028282683f, - 0.4090074563659732f, - 0.40912690289544584f, - 0.4092463424146396f, - 0.4093657749215077f, - 0.40948520041400394f, - 0.4096046188900819f, - 0.4097240303476953f, - 0.4098434347847982f, - 0.40996283219934454f, - 0.4100822225892885f, - 0.41020160595258437f, - 0.41032098228718655f, - 0.4104403515910495f, - 0.4105597138621279f, - 0.4106790690983767f, - 0.4107984172977505f, - 0.4109177584582044f, - 0.4110370925776935f, - 0.411156419654173f, - 0.4112757396855984f, - 0.41139505266992515f, - 0.4115143586051088f, - 0.4116336574891051f, - 0.4117529493198698f, - 0.41187223409535895f, - 0.4119915118135287f, - 0.4121107824723353f, - 0.41223004606973485f, - 0.4123493026036839f, - 0.4124685520721391f, - 0.4125877944730571f, - 0.41270702980439467f, - 0.41282625806410883f, - 0.4129454792501566f, - 0.4130646933604951f, - 0.4131839003930817f, - 0.4133031003458738f, - 0.41342229321682894f, - 0.4135414790039047f, - 0.41366065770505905f, - 0.41377982931824975f, - 0.4138989938414348f, - 0.41401815127257247f, - 0.414137301609621f, - 0.41425644485053864f, - 0.41437558099328414f, - 0.41449471003581595f, - 0.41461383197609286f, - 0.4147329468120738f, - 0.4148520545417177f, - 0.4149711551629838f, - 0.4150902486738312f, - 0.41520933507221935f, - 0.41532841435610773f, - 0.4154474865234559f, - 0.41556655157222366f, - 0.4156856095003708f, - 0.4158046603058574f, - 0.4159237039866434f, - 0.4160427405406891f, - 0.4161617699659549f, - 0.41628079226040116f, - 0.41639980742198845f, - 0.4165188154486777f, - 0.41663781633842945f, - 0.4167568100892048f, - 0.4168757966989648f, - 0.4169947761656706f, - 0.4171137484872836f, - 0.4172327136617653f, - 0.4173516716870771f, - 0.4174706225611807f, - 0.417589566282038f, - 0.4177085028476109f, - 0.41782743225586144f, - 0.417946354504752f, - 0.4180652695922445f, - 0.41818417751630155f, - 0.41830307827488566f, - 0.4184219718659596f, - 0.41854085828748605f, - 0.41865973753742813f, - 0.4187786096137486f, - 0.4188974745144106f, - 0.4190163322373777f, - 0.4191351827806131f, - 0.4192540261420804f, - 0.4193728623197433f, - 0.4194916913115654f, - 0.4196105131155107f, - 0.41972932772954324f, - 0.4198481351516271f, - 0.4199669353797266f, - 0.42008572841180625f, - 0.42020451424583033f, - 0.4203232928797636f, - 0.4204420643115708f, - 0.4205608285392168f, - 0.4206795855606666f, - 0.42079833537388545f, - 0.4209170779768384f, - 0.421035813367491f, - 0.42115454154380866f, - 0.421273262503757f, - 0.42139197624530184f, - 0.4215106827664091f, - 0.4216293820650445f, - 0.4217480741391745f, - 0.42186675898676507f, - 0.42198543660578275f, - 0.422104106994194f, - 0.42222277014996545f, - 0.42234142607106373f, - 0.4224600747554558f, - 0.4225787162011086f, - 0.42269735040598927f, - 0.42281597736806503f, - 0.4229345970853033f, - 0.42305320955567144f, - 0.42317181477713717f, - 0.42329041274766815f, - 0.42340900346523225f, - 0.42352758692779746f, - 0.423646163133332f, - 0.4237647320798039f, - 0.4238832937651816f, - 0.4240018481874336f, - 0.4241203953445284f, - 0.42423893523443484f, - 0.4243574678551219f, - 0.42447599320455826f, - 0.4245945112807131f, - 0.42471302208155576f, - 0.4248315256050555f, - 0.42495002184918185f, - 0.42506851081190444f, - 0.4251869924911929f, - 0.425305466885017f, - 0.4254239339913469f, - 0.4255423938081526f, - 0.4256608463334044f, - 0.4257792915650727f, - 0.4258977295011277f, - 0.4260161601395402f, - 0.42613458347828087f, - 0.42625299951532064f, - 0.42637140824863035f, - 0.4264898096761813f, - 0.42660820379594444f, - 0.4267265906058913f, - 0.4268449701039933f, - 0.4269633422882221f, - 0.42708170715654936f, - 0.427200064706947f, - 0.42731841493738687f, - 0.4274367578458412f, - 0.4275550934302821f, - 0.427673421688682f, - 0.42779174261901337f, - 0.42791005621924877f, - 0.42802836248736104f, - 0.4281466614213229f, - 0.4282649530191074f, - 0.4283832372786876f, - 0.4285015141980368f, - 0.4286197837751283f, - 0.42873804600793564f, - 0.4288563008944324f, - 0.42897454843259225f, - 0.4290927886203891f, - 0.4292110214557969f, - 0.42932924693678987f, - 0.42944746506134224f, - 0.4295656758274283f, - 0.4296838792330225f, - 0.4298020752760995f, - 0.429920263954634f, - 0.430038445266601f, - 0.4301566192099755f, - 0.4302747857827325f, - 0.43039294498284725f, - 0.4305110968082951f, - 0.43062924125705165f, - 0.43074737832709253f, - 0.43086550801639356f, - 0.43098363032293036f, - 0.4311017452446791f, - 0.43121985277961594f, - 0.4313379529257171f, - 0.4314560456809589f, - 0.4315741310433181f, - 0.431692209010771f, - 0.43181027958129453f, - 0.4319283427528656f, - 0.4320463985234612f, - 0.43216444689105854f, - 0.4322824878536348f, - 0.43240052140916746f, - 0.43251854755563396f, - 0.432636566291012f, - 0.43275457761327935f, - 0.4328725815204139f, - 0.4329905780103938f, - 0.43310856708119705f, - 0.433226548730802f, - 0.4333445229571871f, - 0.4334624897583309f, - 0.433580449132212f, - 0.4336984010768093f, - 0.4338163455901016f, - 0.43393428267006806f, - 0.4340522123146878f, - 0.4341701345219402f, - 0.4342880492898046f, - 0.4344059566162606f, - 0.4345238564992879f, - 0.4346417489368663f, - 0.43475963392697575f, - 0.4348775114675963f, - 0.43499538155670825f, - 0.43511324419229186f, - 0.4352310993723275f, - 0.4353489470947959f, - 0.43546678735767763f, - 0.43558462015895366f, - 0.43570244549660486f, - 0.4358202633686125f, - 0.43593807377295757f, - 0.4360558767076215f, - 0.43617367217058584f, - 0.43629146015983206f, - 0.436409240673342f, - 0.43652701370909763f, - 0.4366447792650807f, - 0.4367625373392735f, - 0.4368802879296581f, - 0.4369980310342171f, - 0.4371157666509328f, - 0.43723349477778817f, - 0.43735121541276556f, - 0.43746892855384795f, - 0.4375866341990185f, - 0.4377043323462603f, - 0.43782202299355666f, - 0.437939706138891f, - 0.43805738178024667f, - 0.4381750499156074f, - 0.43829271054295715f, - 0.43841036366027963f, - 0.438528009265559f, - 0.4386456473567795f, - 0.4387632779319252f, - 0.43888090098898075f, - 0.4389985165259306f, - 0.43911612454075943f, - 0.43923372503145214f, - 0.4393513179959937f, - 0.43946890343236905f, - 0.4395864813385635f, - 0.43970405171256227f, - 0.43982161455235097f, - 0.4399391698559151f, - 0.4400567176212405f, - 0.4401742578463128f, - 0.4402917905291182f, - 0.4404093156676427f, - 0.4405268332598725f, - 0.4406443433037941f, - 0.4407618457973939f, - 0.44087934073865853f, - 0.4409968281255748f, - 0.4411143079561295f, - 0.4412317802283098f, - 0.44134924494010264f, - 0.4414667020894955f, - 0.4415841516744756f, - 0.44170159369303064f, - 0.44181902814314816f, - 0.441936455022816f, - 0.4420538743300221f, - 0.44217128606275447f, - 0.4422886902190013f, - 0.4424060867967509f, - 0.44252347579399176f, - 0.4426408572087124f, - 0.44275823103890144f, - 0.44287559728254794f, - 0.44299295593764076f, - 0.4431103070021689f, - 0.4432276504741216f, - 0.4433449863514882f, - 0.4434623146322584f, - 0.4435796353144215f, - 0.44369694839596757f, - 0.44381425387488616f, - 0.4439315517491674f, - 0.44404884201680145f, - 0.44416612467577854f, - 0.4442833997240891f, - 0.44440066715972376f, - 0.4445179269806729f, - 0.44463517918492745f, - 0.44475242377047836f, - 0.44486966073531664f, - 0.4449868900774335f, - 0.44510411179482023f, - 0.4452213258854682f, - 0.44533853234736903f, - 0.44545573117851445f, - 0.4455729223768963f, - 0.4456901059405064f, - 0.44580728186733704f, - 0.4459244501553803f, - 0.44604161080262855f, - 0.44615876380707437f, - 0.4462759091667102f, - 0.446393046879529f, - 0.4465101769435236f, - 0.4466272993566868f, - 0.44674441411701193f, - 0.44686152122249223f, - 0.4469786206711211f, - 0.447095712460892f, - 0.4472127965897988f, - 0.447329873055835f, - 0.44744694185699474f, - 0.44756400299127197f, - 0.44768105645666095f, - 0.447798102251156f, - 0.44791514037275154f, - 0.4480321708194422f, - 0.44814919358922256f, - 0.4482662086800876f, - 0.44838321609003223f, - 0.4485002158170516f, - 0.448617207859141f, - 0.4487341922142957f, - 0.44885116888051124f, - 0.44896813785578327f, - 0.4490850991381075f, - 0.4492020527254799f, - 0.44931899861589664f, - 0.4494359368073536f, - 0.44955286729784716f, - 0.44966979008537383f, - 0.4497867051679301f, - 0.44990361254351274f, - 0.4500205122101186f, - 0.4501374041657445f, - 0.4502542884083875f, - 0.45037116493604495f, - 0.4504880337467142f, - 0.45060489483839267f, - 0.4507217482090781f, - 0.450838593856768f, - 0.45095543177946046f, - 0.4510722619751534f, - 0.451189084441845f, - 0.45130589917753355f, - 0.45142270618021746f, - 0.45153950544789523f, - 0.4516562969785656f, - 0.45177308077022726f, - 0.4518898568208793f, - 0.4520066251285207f, - 0.45212338569115074f, - 0.45224013850676864f, - 0.452356883573374f, - 0.4524736208889663f, - 0.45259035045154544f, - 0.4527070722591111f, - 0.4528237863096635f, - 0.45294049260120256f, - 0.4530571911317287f, - 0.45317388189924224f, - 0.45329056490174374f, - 0.4534072401372339f, - 0.45352390760371347f, - 0.4536405672991834f, - 0.4537572192216448f, - 0.4538738633690988f, - 0.45399049973954675f, - 0.4541071283309902f, - 0.4542237491414307f, - 0.4543403621688699f, - 0.4544569674113098f, - 0.45457356486675227f, - 0.45469015453319955f, - 0.4548067364086538f, - 0.4549233104911177f, - 0.4550398767785934f, - 0.45515643526908384f, - 0.4552729859605917f, - 0.45538952885111983f, - 0.4555060639386715f, - 0.45562259122124993f, - 0.45573911069685824f, - 0.4558556223635f, - 0.4559721262191788f, - 0.45608862226189845f, - 0.4562051104896628f, - 0.45632159090047586f, - 0.45643806349234173f, - 0.4565545282632646f, - 0.456670985211249f, - 0.45678743433429947f, - 0.4569038756304206f, - 0.4570203090976173f, - 0.45713673473389455f, - 0.4572531525372573f, - 0.4573695625057108f, - 0.4574859646372604f, - 0.4576023589299116f, - 0.45771874538167f, - 0.4578351239905414f, - 0.4579514947545316f, - 0.45806785767164665f, - 0.45818421273989274f, - 0.4583005599572761f, - 0.4584168993218032f, - 0.4585332308314806f, - 0.45864955448431494f, - 0.45876587027831306f, - 0.4588821782114819f, - 0.45899847828182866f, - 0.4591147704873605f, - 0.4592310548260848f, - 0.45934733129600896f, - 0.45946359989514074f, - 0.4595798606214878f, - 0.4596961134730582f, - 0.45981235844785984f, - 0.459928595543901f, - 0.4600448247591899f, - 0.46016104609173497f, - 0.46027725953954485f, - 0.4603934651006283f, - 0.460509662772994f, - 0.46062585255465116f, - 0.46074203444360873f, - 0.46085820843787595f, - 0.46097437453546236f, - 0.4610905327343773f, - 0.46120668303263057f, - 0.46132282542823205f, - 0.4614389599191914f, - 0.46155508650351895f, - 0.4616712051792247f, - 0.46178731594431904f, - 0.4619034187968125f, - 0.46201951373471584f, - 0.4621356007560395f, - 0.46225167985879445f, - 0.46236775104099176f, - 0.46248381430064256f, - 0.46259986963575817f, - 0.4627159170443501f, - 0.4628319565244297f, - 0.4629479880740087f, - 0.46306401169109906f, - 0.4631800273737127f, - 0.46329603511986167f, - 0.46341203492755834f, - 0.46352802679481486f, - 0.46364401071964395f, - 0.46375998670005814f, - 0.46387595473407023f, - 0.46399191481969315f, - 0.46410786695494005f, - 0.46422381113782396f, - 0.4643397473663583f, - 0.4644556756385565f, - 0.4645715959524322f, - 0.4646875083059991f, - 0.4648034126972711f, - 0.46491930912426216f, - 0.46503519758498646f, - 0.4651510780774583f, - 0.4652669505996921f, - 0.46538281514970237f, - 0.4654986717255039f, - 0.4656145203251114f, - 0.46573036094653986f, - 0.46584619358780444f, - 0.46596201824692035f, - 0.4660778349219029f, - 0.4661936436107678f, - 0.4663094443115305f, - 0.4664252370222068f, - 0.4665410217408127f, - 0.46665679846536423f, - 0.4667725671938776f, - 0.4668883279243692f, - 0.4670040806548553f, - 0.4671198253833527f, - 0.46723556210787814f, - 0.4673512908264484f, - 0.46746701153708053f, - 0.46758272423779185f, - 0.46769842892659935f, - 0.4678141256015207f, - 0.4679298142605734f, - 0.46804549490177505f, - 0.4681611675231437f, - 0.4682768321226973f, - 0.46839248869845374f, - 0.46850813724843143f, - 0.4686237777706488f, - 0.4687394102631243f, - 0.4688550347238767f, - 0.46897065115092484f, - 0.46908625954228744f, - 0.4692018598959837f, - 0.46931745221003285f, - 0.46943303648245427f, - 0.46954861271126747f, - 0.4696641808944921f, - 0.46977974103014775f, - 0.4698952931162545f, - 0.47001083715083236f, - 0.4701263731319015f, - 0.4702419010574822f, - 0.47035742092559507f, - 0.4704729327342605f, - 0.4705884364814994f, - 0.4707039321653325f, - 0.47081941978378095f, - 0.4709348993348658f, - 0.4710503708166085f, - 0.47116583422703023f, - 0.4712812895641527f, - 0.47139673682599764f, - 0.4715121760105868f, - 0.4716276071159422f, - 0.471743030140086f, - 0.47185844508104047f, - 0.4719738519368279f, - 0.47208925070547086f, - 0.47220464138499213f, - 0.4723200239734144f, - 0.47243539846876065f, - 0.472550764869054f, - 0.47266612317231765f, - 0.47278147337657495f, - 0.47289681547984946f, - 0.4730121494801648f, - 0.47312747537554467f, - 0.47324279316401324f, - 0.4733581028435943f, - 0.4734734044123121f, - 0.47358869786819113f, - 0.47370398320925566f, - 0.47381926043353045f, - 0.47393452953904036f, - 0.47404979052381f, - 0.47416504338586457f, - 0.4742802881232292f, - 0.4743955247339292f, - 0.4745107532159901f, - 0.4746259735674376f, - 0.47474118578629704f, - 0.47485638987059453f, - 0.47497158581835613f, - 0.47508677362760793f, - 0.4752019532963762f, - 0.47531712482268745f, - 0.47543228820456807f, - 0.4755474434400449f, - 0.4756625905271448f, - 0.4757777294638947f, - 0.4758928602483217f, - 0.4760079828784532f, - 0.4761230973523165f, - 0.47623820366793906f, - 0.47635330182334873f, - 0.47646839181657324f, - 0.47658347364564063f, - 0.4766985473085789f, - 0.4768136128034164f, - 0.4769286701281814f, - 0.4770437192809025f, - 0.4771587602596084f, - 0.4772737930623278f, - 0.47738881768708974f, - 0.4775038341319232f, - 0.4776188423948575f, - 0.477733842473922f, - 0.4778488343671461f, - 0.47796381807255955f, - 0.47807879358819216f, - 0.4781937609120738f, - 0.47830872004223446f, - 0.47842367097670446f, - 0.4785386137135141f, - 0.47865354825069384f, - 0.4787684745862744f, - 0.4788833927182865f, - 0.478998302644761f, - 0.479113204363729f, - 0.47922809787322174f, - 0.4793429831712704f, - 0.4794578602559066f, - 0.47957272912516186f, - 0.479687589777068f, - 0.47980244220965684f, - 0.4799172864209605f, - 0.4800321224090111f, - 0.48014695017184106f, - 0.48026176970748263f, - 0.4803765810139686f, - 0.48049138408933156f, - 0.48060617893160446f, - 0.4807209655388204f, - 0.4808357439090124f, - 0.48095051404021383f, - 0.48106527593045817f, - 0.48118002957777894f, - 0.4812947749802099f, - 0.4814095121357849f, - 0.48152424104253816f, - 0.48163896169850345f, - 0.4817536741017153f, - 0.48186837825020806f, - 0.48198307414201635f, - 0.4820977617751749f, - 0.48221244114771855f, - 0.48232711225768227f, - 0.4824417751031012f, - 0.48255642968201073f, - 0.48267107599244613f, - 0.4827857140324431f, - 0.4829003438000374f, - 0.4830149652932646f, - 0.4831295785101609f, - 0.4832441834487624f, - 0.48335878010710526f, - 0.4834733684832261f, - 0.48358794857516146f, - 0.48370252038094796f, - 0.4838170838986224f, - 0.4839316391262218f, - 0.4840461860617833f, - 0.4841607247033442f, - 0.484275255048942f, - 0.48438977709661396f, - 0.4845042908443979f, - 0.48461879629033183f, - 0.4847332934324536f, - 0.4848477822688013f, - 0.4849622627974134f, - 0.48507673501632803f, - 0.4851911989235838f, - 0.4853056545172195f, - 0.48542010179527395f, - 0.48553454075578606f, - 0.485648971396795f, - 0.48576339371634003f, - 0.48587780771246053f, - 0.48599221338319604f, - 0.4861066107265863f, - 0.4862209997406711f, - 0.48633538042349045f, - 0.4864497527730845f, - 0.4865641167874934f, - 0.48667847246475754f, - 0.4867928198029176f, - 0.4869071588000142f, - 0.4870214894540882f, - 0.4871358117631805f, - 0.4872501257253323f, - 0.4873644313385848f, - 0.48747872860097946f, - 0.48759301751055784f, - 0.4877072980653615f, - 0.48782157026343254f, - 0.48793583410281266f, - 0.48805008958154406f, - 0.48816433669766907f, - 0.48827857544923f, - 0.48839280583426936f, - 0.48850702785083017f, - 0.4886212414969549f, - 0.4887354467706867f, - 0.48884964367006867f, - 0.488963832193144f, - 0.4890780123379562f, - 0.4891921841025489f, - 0.48930634748496554f, - 0.48942050248325014f, - 0.4895346490954466f, - 0.48964878731959915f, - 0.489762917153752f, - 0.48987703859594967f, - 0.48999115164423657f, - 0.49010525629665747f, - 0.4902193525512572f, - 0.49033344040608073f, - 0.49044751985917323f, - 0.49056159090858015f, - 0.49067565355234644f, - 0.49078970778851816f, - 0.49090375361514077f, - 0.4910177910302602f, - 0.4911318200319224f, - 0.4912458406181737f, - 0.4913598527870601f, - 0.49147385653662823f, - 0.49158785186492454f, - 0.49170183876999585f, - 0.491815817249889f, - 0.49192978730265097f, - 0.49204374892632896f, - 0.4921577021189702f, - 0.49227164687862224f, - 0.49238558320333253f, - 0.4924995110911489f, - 0.4926134305401193f, - 0.49272734154829156f, - 0.49284124411371394f, - 0.49295513823443476f, - 0.4930690239085025f, - 0.4931829011339656f, - 0.49329676990887306f, - 0.4934106302312736f, - 0.49352448209921623f, - 0.49363832551075026f, - 0.4937521604639249f, - 0.4938659869567897f, - 0.4939798049873943f, - 0.4940936145537883f, - 0.49420741565402176f, - 0.4943212082861446f, - 0.4944349924482071f, - 0.4945487681382596f, - 0.49466253535435256f, - 0.4947762940945366f, - 0.4948900443568625f, - 0.49500378613938123f, - 0.4951175194401438f, - 0.49523124425720144f, - 0.4953449605886056f, - 0.4954586684324076f, - 0.49557236778665914f, - 0.495686058649412f, - 0.49579974101871815f, - 0.49591341489262974f, - 0.49602708026919906f, - 0.4961407371464782f, - 0.49625438552251994f, - 0.49636802539537683f, - 0.4964816567631017f, - 0.4965952796237475f, - 0.4967088939753674f, - 0.49682249981601456f, - 0.49693609714374226f, - 0.4970496859566043f, - 0.4971632662526543f, - 0.49727683802994604f, - 0.49739040128653356f, - 0.49750395602047087f, - 0.49761750222981227f, - 0.4977310399126122f, - 0.49784456906692526f, - 0.4979580896908061f, - 0.49807160178230964f, - 0.4981851053394908f, - 0.4982986003604048f, - 0.4984120868431069f, - 0.4985255647856525f, - 0.4986390341860973f, - 0.498752495042497f, - 0.4988659473529074f, - 0.49897939111538453f, - 0.4990928263279846f, - 0.4992062529887639f, - 0.49931967109577896f, - 0.49943308064708636f, - 0.49954648164074283f, - 0.49965987407480533f, - 0.49977325794733085f, - 0.4998866332563766f, - 0.49999999999999994f, - 0.5001133581762583f, - 0.5002267077832097f, - 0.5003400488189113f, - 0.5004533812814214f, - 0.500566705168798f, - 0.5006800204790993f, - 0.5007933272103837f, - 0.5009066253607098f, - 0.5010199149281362f, - 0.5011331959107218f, - 0.5012464683065254f, - 0.5013597321136062f, - 0.5014729873300233f, - 0.5015862339538365f, - 0.5016994719831049f, - 0.5018127014158884f, - 0.5019259222502468f, - 0.5020391344842402f, - 0.5021523381159286f, - 0.5022655331433725f, - 0.5023787195646321f, - 0.502491897377768f, - 0.502605066580841f, - 0.5027182271719121f, - 0.5028313791490421f, - 0.5029445225102923f, - 0.5030576572537239f, - 0.5031707833773984f, - 0.5032839008793776f, - 0.5033970097577231f, - 0.5035101100104967f, - 0.5036232016357608f, - 0.5037362846315774f, - 0.5038493589960087f, - 0.5039624247271174f, - 0.5040754818229661f, - 0.5041885302816177f, - 0.504301570101135f, - 0.504414601279581f, - 0.5045276238150193f, - 0.5046406377055128f, - 0.5047536429491255f, - 0.5048666395439209f, - 0.5049796274879629f, - 0.5050926067793152f, - 0.5052055774160422f, - 0.5053185393962082f, - 0.5054314927178775f, - 0.5055444373791147f, - 0.5056573733779846f, - 0.5057703007125519f, - 0.5058832193808819f, - 0.5059961293810394f, - 0.5061090307110901f, - 0.5062219233690992f, - 0.5063348073531325f, - 0.5064476826612556f, - 0.5065605492915346f, - 0.5066734072420352f, - 0.5067862565108241f, - 0.5068990970959671f, - 0.5070119289955314f, - 0.507124752207583f, - 0.507237566730189f, - 0.5073503725614165f, - 0.5074631696993323f, - 0.5075759581420037f, - 0.5076887378874984f, - 0.5078015089338836f, - 0.5079142712792272f, - 0.5080270249215968f, - 0.5081397698590607f, - 0.508252506089687f, - 0.5083652336115438f, - 0.5084779524226998f, - 0.5085906625212233f, - 0.5087033639051833f, - 0.5088160565726486f, - 0.5089287405216881f, - 0.5090414157503713f, - 0.5091540822567673f, - 0.5092667400389456f, - 0.5093793890949759f, - 0.509492029422928f, - 0.5096046610208719f, - 0.5097172838868775f, - 0.5098298980190152f, - 0.5099425034153554f, - 0.5100551000739685f, - 0.5101676879929252f, - 0.5102802671702964f, - 0.5103928376041531f, - 0.5105053992925664f, - 0.5106179522336077f, - 0.5107304964253483f, - 0.5108430318658598f, - 0.510955558553214f, - 0.5110680764854828f, - 0.5111805856607381f, - 0.511293086077052f, - 0.5114055777324973f, - 0.5115180606251459f, - 0.511630534753071f, - 0.5117430001143449f, - 0.5118554567070408f, - 0.5119679045292318f, - 0.512080343578991f, - 0.5121927738543919f, - 0.5123051953535079f, - 0.5124176080744131f, - 0.5125300120151807f, - 0.5126424071738851f, - 0.5127547935486003f, - 0.5128671711374007f, - 0.5129795399383605f, - 0.5130918999495547f, - 0.5132042511690578f, - 0.5133165935949446f, - 0.5134289272252903f, - 0.51354125205817f, - 0.5136535680916592f, - 0.5137658753238332f, - 0.5138781737527678f, - 0.5139904633765386f, - 0.5141027441932217f, - 0.5142150162008932f, - 0.5143272793976292f, - 0.5144395337815063f, - 0.5145517793506011f, - 0.5146640161029901f, - 0.5147762440367502f, - 0.5148884631499584f, - 0.5150006734406919f, - 0.5151128749070281f, - 0.5152250675470443f, - 0.515337251358818f, - 0.5154494263404272f, - 0.5155615924899498f, - 0.5156737498054638f, - 0.5157858982850474f, - 0.515898037926779f, - 0.5160101687287371f, - 0.5161222906890003f, - 0.5162344038056476f, - 0.5163465080767576f, - 0.51645860350041f, - 0.5165706900746835f, - 0.5166827677976579f, - 0.5167948366674127f, - 0.5169068966820275f, - 0.5170189478395824f, - 0.5171309901381571f, - 0.5172430235758322f, - 0.5173550481506878f, - 0.5174670638608043f, - 0.5175790707042626f, - 0.5176910686791433f, - 0.5178030577835273f, - 0.5179150380154959f, - 0.5180270093731302f, - 0.5181389718545116f, - 0.5182509254577218f, - 0.5183628701808424f, - 0.5184748060219552f, - 0.5185867329791424f, - 0.5186986510504858f, - 0.5188105602340681f, - 0.5189224605279716f, - 0.5190343519302789f, - 0.5191462344390728f, - 0.5192581080524363f, - 0.5193699727684524f, - 0.5194818285852042f, - 0.5195936755007753f, - 0.5197055135132491f, - 0.5198173426207094f, - 0.51992916282124f, - 0.5200409741129248f, - 0.5201527764938481f, - 0.5202645699620938f, - 0.5203763545157469f, - 0.5204881301528917f, - 0.5205998968716131f, - 0.5207116546699958f, - 0.520823403546125f, - 0.5209351434980859f, - 0.5210468745239638f, - 0.5211585966218443f, - 0.5212703097898131f, - 0.5213820140259559f, - 0.5214937093283587f, - 0.5216053956951078f, - 0.5217170731242893f, - 0.5218287416139896f, - 0.5219404011622957f, - 0.5220520517672937f, - 0.522163693427071f, - 0.5222753261397145f, - 0.5223869499033112f, - 0.5224985647159488f, - 0.5226101705757147f, - 0.5227217674806964f, - 0.5228333554289819f, - 0.5229449344186591f, - 0.523056504447816f, - 0.5231680655145411f, - 0.5232796176169229f, - 0.5233911607530496f, - 0.5235026949210103f, - 0.5236142201188937f, - 0.5237257363447888f, - 0.523837243596785f, - 0.5239487418729715f, - 0.524060231171438f, - 0.5241717114902739f, - 0.524283182827569f, - 0.5243946451814137f, - 0.5245060985498976f, - 0.5246175429311113f, - 0.5247289783231451f, - 0.5248404047240897f, - 0.5249518221320356f, - 0.525063230545074f, - 0.5251746299612956f, - 0.525286020378792f, - 0.5253974017956543f, - 0.525508774209974f, - 0.5256201376198429f, - 0.5257314920233527f, - 0.5258428374185955f, - 0.5259541738036633f, - 0.5260655011766484f, - 0.5261768195356432f, - 0.5262881288787403f, - 0.5263994292040327f, - 0.526510720509613f, - 0.5266220027935744f, - 0.52673327605401f, - 0.5268445402890132f, - 0.5269557954966776f, - 0.5270670416750967f, - 0.5271782788223645f, - 0.527289506936575f, - 0.527400726015822f, - 0.5275119360582002f, - 0.527623137061804f, - 0.5277343290247277f, - 0.5278455119450663f, - 0.5279566858209148f, - 0.528067850650368f, - 0.5281790064315213f, - 0.52829015316247f, - 0.5284012908413095f, - 0.5285124194661358f, - 0.5286235390350444f, - 0.5287346495461317f, - 0.5288457509974935f, - 0.5289568433872263f, - 0.5290679267134264f, - 0.5291790009741906f, - 0.5292900661676155f, - 0.5294011222917983f, - 0.5295121693448357f, - 0.5296232073248252f, - 0.529734236229864f, - 0.5298452560580499f, - 0.5299562668074804f, - 0.5300672684762535f, - 0.5301782610624672f, - 0.5302892445642196f, - 0.530400218979609f, - 0.530511184306734f, - 0.5306221405436932f, - 0.5307330876885854f, - 0.5308440257395095f, - 0.5309549546945646f, - 0.53106587455185f, - 0.531176785309465f, - 0.5312876869655093f, - 0.5313985795180829f, - 0.5315094629652852f, - 0.5316203373052164f, - 0.5317312025359768f, - 0.5318420586556667f, - 0.5319529056623866f, - 0.5320637435542374f, - 0.5321745723293194f, - 0.5322853919857339f, - 0.532396202521582f, - 0.5325070039349651f, - 0.5326177962239845f, - 0.532728579386742f, - 0.532839353421339f, - 0.5329501183258778f, - 0.5330608740984603f, - 0.5331716207371886f, - 0.5332823582401652f, - 0.5333930866054928f, - 0.533503805831274f, - 0.5336145159156115f, - 0.5337252168566085f, - 0.533835908652368f, - 0.5339465913009935f, - 0.5340572648005885f, - 0.5341679291492565f, - 0.5342785843451012f, - 0.5343892303862268f, - 0.5344998672707373f, - 0.534610494996737f, - 0.5347211135623303f, - 0.5348317229656218f, - 0.5349423232047161f, - 0.5350529142777183f, - 0.5351634961827334f, - 0.5352740689178664f, - 0.5353846324812231f, - 0.5354951868709087f, - 0.5356057320850288f, - 0.5357162681216895f, - 0.5358267949789967f, - 0.5359373126550564f, - 0.5360478211479751f, - 0.5361583204558592f, - 0.5362688105768153f, - 0.5363792915089503f, - 0.5364897632503709f, - 0.5366002257991844f, - 0.5367106791534981f, - 0.5368211233114193f, - 0.5369315582710555f, - 0.5370419840305145f, - 0.5371524005879043f, - 0.5372628079413326f, - 0.5373732060889082f, - 0.5374835950287388f, - 0.5375939747589332f, - 0.5377043452776002f, - 0.5378147065828485f, - 0.5379250586727871f, - 0.5380354015455252f, - 0.538145735199172f, - 0.538256059631837f, - 0.5383663748416296f, - 0.5384766808266601f, - 0.5385869775850382f, - 0.5386972651148738f, - 0.5388075434142774f, - 0.5389178124813592f, - 0.5390280723142299f, - 0.5391383229110002f, - 0.5392485642697811f, - 0.5393587963886834f, - 0.5394690192658185f, - 0.5395792328992977f, - 0.5396894372872324f, - 0.5397996324277345f, - 0.5399098183189157f, - 0.5400199949588882f, - 0.5401301623457638f, - 0.540240320477655f, - 0.5403504693526743f, - 0.5404606089689343f, - 0.5405707393245477f, - 0.5406808604176276f, - 0.540790972246287f, - 0.5409010748086391f, - 0.5410111681027976f, - 0.5411212521268758f, - 0.5412313268789876f, - 0.5413413923572468f, - 0.5414514485597675f, - 0.5415614954846638f, - 0.5416715331300502f, - 0.5417815614940413f, - 0.5418915805747517f, - 0.5420015903702963f, - 0.54211159087879f, - 0.542221582098348f, - 0.5423315640270858f, - 0.5424415366631187f, - 0.5425515000045624f, - 0.5426614540495328f, - 0.5427713987961459f, - 0.5428813342425175f, - 0.5429912603867642f, - 0.5431011772270024f, - 0.5432110847613484f, - 0.5433209829879193f, - 0.5434308719048322f, - 0.5435407515102038f, - 0.5436506218021514f, - 0.5437604827787924f, - 0.5438703344382446f, - 0.5439801767786254f, - 0.544090009798053f, - 0.5441998334946452f, - 0.5443096478665201f, - 0.5444194529117965f, - 0.5445292486285925f, - 0.544639035015027f, - 0.5447488120692189f, - 0.5448585797892869f, - 0.5449683381733503f, - 0.5450780872195286f, - 0.545187826925941f, - 0.5452975572907074f, - 0.5454072783119474f, - 0.545516989987781f, - 0.5456266923163284f, - 0.5457363852957098f, - 0.5458460689240457f, - 0.5459557431994567f, - 0.5460654081200635f, - 0.5461750636839872f, - 0.5462847098893486f, - 0.5463943467342691f, - 0.54650397421687f, - 0.5466135923352731f, - 0.5467232010875999f, - 0.5468328004719724f, - 0.5469423904865125f, - 0.5470519711293425f, - 0.5471615423985848f, - 0.5472711042923619f, - 0.5473806568087966f, - 0.5474901999460114f, - 0.5475997337021298f, - 0.5477092580752745f, - 0.5478187730635691f, - 0.5479282786651369f, - 0.5480377748781018f, - 0.5481472617005875f, - 0.5482567391307179f, - 0.5483662071666172f, - 0.5484756658064097f, - 0.5485851150482199f, - 0.5486945548901724f, - 0.5488039853303919f, - 0.5489134063670033f, - 0.5490228179981318f, - 0.5491322202219024f, - 0.5492416130364411f, - 0.5493509964398732f, - 0.5494603704303241f, - 0.5495697350059202f, - 0.5496790901647873f, - 0.5497884359050517f, - 0.5498977722248397f, - 0.5500070991222781f, - 0.5501164165954934f, - 0.5502257246426123f, - 0.5503350232617623f, - 0.5504443124510703f, - 0.5505535922086636f, - 0.55066286253267f, - 0.5507721234212171f, - 0.5508813748724325f, - 0.5509906168844443f, - 0.5510998494553808f, - 0.5512090725833704f, - 0.5513182862665412f, - 0.5514274905030223f, - 0.5515366852909424f, - 0.5516458706284302f, - 0.5517550465136151f, - 0.5518642129446264f, - 0.5519733699195936f, - 0.552082517436646f, - 0.5521916554939137f, - 0.5523007840895265f, - 0.5524099032216148f, - 0.5525190128883084f, - 0.5526281130877381f, - 0.5527372038180344f, - 0.5528462850773279f, - 0.5529553568637499f, - 0.553064419175431f, - 0.5531734720105028f, - 0.5532825153670967f, - 0.5533915492433441f, - 0.5535005736373768f, - 0.5536095885473267f, - 0.5537185939713258f, - 0.5538275899075065f, - 0.553936576354001f, - 0.5540455533089419f, - 0.554154520770462f, - 0.554263478736694f, - 0.5543724272057712f, - 0.5544813661758264f, - 0.5545902956449934f, - 0.5546992156114054f, - 0.5548081260731963f, - 0.5549170270284998f, - 0.5550259184754498f, - 0.5551348004121808f, - 0.555243672836827f, - 0.5553525357475227f, - 0.555461389142403f, - 0.5555702330196022f, - 0.5556790673772557f, - 0.5557878922134984f, - 0.5558967075264658f, - 0.5560055133142934f, - 0.5561143095751165f, - 0.5562230963070712f, - 0.5563318735082935f, - 0.5564406411769194f, - 0.5565493993110853f, - 0.5566581479089276f, - 0.5567668869685829f, - 0.556875616488188f, - 0.5569843364658799f, - 0.5570930468997956f, - 0.5572017477880724f, - 0.5573104391288479f, - 0.5574191209202596f, - 0.5575277931604451f, - 0.5576364558475426f, - 0.5577451089796901f, - 0.5578537525550258f, - 0.5579623865716883f, - 0.5580710110278159f, - 0.5581796259215475f, - 0.558288231251022f, - 0.5583968270143785f, - 0.5585054132097562f, - 0.5586139898352945f, - 0.5587225568891331f, - 0.5588311143694116f, - 0.5589396622742699f, - 0.5590482006018481f, - 0.5591567293502865f, - 0.5592652485177254f, - 0.5593737581023053f, - 0.559482258102167f, - 0.5595907485154513f, - 0.5596992293402994f, - 0.5598077005748523f, - 0.5599161622172515f, - 0.5600246142656385f, - 0.5601330567181552f, - 0.5602414895729432f, - 0.5603499128281446f, - 0.5604583264819016f, - 0.5605667305323568f, - 0.5606751249776524f, - 0.5607835098159312f, - 0.5608918850453359f, - 0.5610002506640097f, - 0.561108606670096f, - 0.5612169530617378f, - 0.5613252898370787f, - 0.5614336169942624f, - 0.5615419345314329f, - 0.5616502424467339f, - 0.5617585407383098f, - 0.5618668294043049f, - 0.5619751084428636f, - 0.5620833778521306f, - 0.5621916376302508f, - 0.5622998877753692f, - 0.5624081282856309f, - 0.5625163591591814f, - 0.562624580394166f, - 0.5627327919887303f, - 0.5628409939410203f, - 0.5629491862491819f, - 0.5630573689113614f, - 0.5631655419257048f, - 0.5632737052903589f, - 0.5633818590034703f, - 0.5634900030631856f, - 0.5635981374676521f, - 0.5637062622150166f, - 0.5638143773034268f, - 0.5639224827310299f, - 0.5640305784959735f, - 0.5641386645964056f, - 0.564246741030474f, - 0.564354807796327f, - 0.5644628648921128f, - 0.56457091231598f, - 0.564678950066077f, - 0.5647869781405529f, - 0.5648949965375564f, - 0.5650030052552367f, - 0.5651110042917433f, - 0.5652189936452255f, - 0.5653269733138329f, - 0.5654349432957153f, - 0.5655429035890227f, - 0.5656508541919053f, - 0.5657587951025133f, - 0.5658667263189971f, - 0.5659746478395076f, - 0.5660825596621953f, - 0.5661904617852113f, - 0.5662983542067067f, - 0.5664062369248328f, - 0.5665141099377411f, - 0.5666219732435831f, - 0.5667298268405107f, - 0.5668376707266757f, - 0.5669455049002304f, - 0.5670533293593273f, - 0.5671611441021184f, - 0.5672689491267565f, - 0.5673767444313944f, - 0.5674845300141851f, - 0.5675923058732817f, - 0.5677000720068376f, - 0.5678078284130059f, - 0.5679155750899405f, - 0.5680233120357953f, - 0.568131039248724f, - 0.5682387567268808f, - 0.5683464644684202f, - 0.5684541624714963f, - 0.5685618507342639f, - 0.5686695292548779f, - 0.5687771980314931f, - 0.5688848570622647f, - 0.5689925063453478f, - 0.5691001458788982f, - 0.5692077756610713f, - 0.5693153956900229f, - 0.569423005963909f, - 0.5695306064808858f, - 0.5696381972391096f, - 0.5697457782367367f, - 0.5698533494719238f, - 0.5699609109428276f, - 0.5700684626476054f, - 0.570176004584414f, - 0.5702835367514107f, - 0.5703910591467531f, - 0.5704985717685989f, - 0.5706060746151057f, - 0.5707135676844316f, - 0.5708210509747348f, - 0.5709285244841734f, - 0.5710359882109061f, - 0.5711434421530912f, - 0.5712508863088879f, - 0.5713583206764549f, - 0.5714657452539514f, - 0.5715731600395367f, - 0.5716805650313705f, - 0.5717879602276122f, - 0.5718953456264217f, - 0.572002721225959f, - 0.572110087024384f, - 0.5722174430198573f, - 0.5723247892105395f, - 0.5724321255945909f, - 0.5725394521701724f, - 0.5726467689354452f, - 0.5727540758885702f, - 0.5728613730277089f, - 0.5729686603510229f, - 0.5730759378566735f, - 0.5731832055428228f, - 0.5732904634076327f, - 0.5733977114492653f, - 0.5735049496658832f, - 0.5736121780556487f, - 0.5737193966167243f, - 0.5738266053472733f, - 0.5739338042454583f, - 0.5740409933094426f, - 0.5741481725373896f, - 0.5742553419274629f, - 0.5743625014778259f, - 0.5744696511866426f, - 0.5745767910520772f, - 0.5746839210722935f, - 0.5747910412454561f, - 0.5748981515697296f, - 0.5750052520432786f, - 0.5751123426642678f, - 0.5752194234308625f, - 0.5753264943412277f, - 0.5754335553935289f, - 0.5755406065859318f, - 0.5756476479166016f, - 0.5757546793837045f, - 0.5758617009854066f, - 0.575968712719874f, - 0.5760757145852731f, - 0.5761827065797704f, - 0.5762896887015329f, - 0.5763966609487271f, - 0.5765036233195202f, - 0.5766105758120796f, - 0.5767175184245725f, - 0.5768244511551666f, - 0.5769313740020295f, - 0.5770382869633292f, - 0.5771451900372336f, - 0.5772520832219112f, - 0.5773589665155303f, - 0.5774658399162595f, - 0.5775727034222675f, - 0.5776795570317234f, - 0.5777864007427961f, - 0.5778932345536548f, - 0.5780000584624692f, - 0.5781068724674087f, - 0.5782136765666431f, - 0.5783204707583424f, - 0.5784272550406766f, - 0.578534029411816f, - 0.5786407938699312f, - 0.5787475484131928f, - 0.5788542930397714f, - 0.5789610277478381f, - 0.579067752535564f, - 0.5791744674011204f, - 0.5792811723426788f, - 0.5793878673584109f, - 0.5794945524464883f, - 0.579601227605083f, - 0.5797078928323673f, - 0.5798145481265136f, - 0.5799211934856942f, - 0.5800278289080819f, - 0.5801344543918494f, - 0.5802410699351697f, - 0.580347675536216f, - 0.5804542711931617f, - 0.5805608569041804f, - 0.5806674326674455f, - 0.5807739984811311f, - 0.5808805543434111f, - 0.5809871002524597f, - 0.5810936362064514f, - 0.5812001622035605f, - 0.581306678241962f, - 0.5814131843198306f, - 0.5815196804353413f, - 0.5816261665866693f, - 0.5817326427719902f, - 0.5818391089894793f, - 0.5819455652373126f, - 0.5820520115136658f, - 0.582158447816715f, - 0.5822648741446365f, - 0.5823712904956067f, - 0.5824776968678022f, - 0.5825840932593995f, - 0.5826904796685761f, - 0.5827968560935086f, - 0.5829032225323744f, - 0.5830095789833509f, - 0.5831159254446159f, - 0.5832222619143469f, - 0.5833285883907221f, - 0.5834349048719195f, - 0.5835412113561175f, - 0.5836475078414944f, - 0.583753794326229f, - 0.5838600708085f, - 0.5839663372864865f, - 0.5840725937583675f, - 0.5841788402223225f, - 0.5842850766765307f, - 0.5843913031191721f, - 0.5844975195484263f, - 0.5846037259624736f, - 0.5847099223594939f, - 0.5848161087376677f, - 0.5849222850951753f, - 0.5850284514301977f, - 0.5851346077409155f, - 0.5852407540255101f, - 0.5853468902821624f, - 0.5854530165090538f, - 0.5855591327043659f, - 0.5856652388662805f, - 0.5857713349929795f, - 0.5858774210826451f, - 0.5859834971334591f, - 0.5860895631436043f, - 0.586195619111263f, - 0.5863016650346183f, - 0.586407700911853f, - 0.5865137267411501f, - 0.586619742520693f, - 0.5867257482486651f, - 0.5868317439232499f, - 0.5869377295426313f, - 0.5870437051049934f, - 0.5871496706085203f, - 0.587255626051396f, - 0.5873615714318053f, - 0.5874675067479328f, - 0.5875734319979632f, - 0.5876793471800815f, - 0.5877852522924731f, - 0.5878911473333231f, - 0.5879970323008172f, - 0.588102907193141f, - 0.5882087720084803f, - 0.5883146267450213f, - 0.5884204714009501f, - 0.5885263059744531f, - 0.5886321304637168f, - 0.5887379448669279f, - 0.5888437491822734f, - 0.5889495434079404f, - 0.5890553275421161f, - 0.5891611015829878f, - 0.5892668655287433f, - 0.5893726193775701f, - 0.5894783631276564f, - 0.5895840967771903f, - 0.5896898203243599f, - 0.5897955337673537f, - 0.5899012371043605f, - 0.5900069303335688f, - 0.5901126134531678f, - 0.5902182864613466f, - 0.5903239493562945f, - 0.5904296021362011f, - 0.5905352447992559f, - 0.5906408773436488f, - 0.5907464997675699f, - 0.5908521120692093f, - 0.5909577142467575f, - 0.5910633062984046f, - 0.5911688882223418f, - 0.5912744600167599f, - 0.5913800216798498f, - 0.5914855732098028f, - 0.5915911146048104f, - 0.5916966458630639f, - 0.5918021669827553f, - 0.5919076779620766f, - 0.5920131787992196f, - 0.5921186694923767f, - 0.5922241500397403f, - 0.5923296204395032f, - 0.5924350806898581f, - 0.5925405307889978f, - 0.5926459707351157f, - 0.592751400526405f, - 0.5928568201610592f, - 0.592962229637272f, - 0.5930676289532372f, - 0.5931730181071486f, - 0.5932783970972008f, - 0.5933837659215878f, - 0.5934891245785043f, - 0.5935944730661451f, - 0.5936998113827049f, - 0.5938051395263788f, - 0.5939104574953621f, - 0.59401576528785f, - 0.5941210629020386f, - 0.594226350336123f, - 0.5943316275882995f, - 0.5944368946567642f, - 0.5945421515397132f, - 0.594647398235343f, - 0.5947526347418505f, - 0.5948578610574321f, - 0.5949630771802851f, - 0.5950682831086064f, - 0.5951734788405934f, - 0.5952786643744437f, - 0.595383839708355f, - 0.5954890048405249f, - 0.5955941597691516f, - 0.5956993044924334f, - 0.5958044390085684f, - 0.5959095633157553f, - 0.5960146774121929f, - 0.5961197812960801f, - 0.5962248749656158f, - 0.5963299584189994f, - 0.5964350316544301f, - 0.5965400946701078f, - 0.5966451474642321f, - 0.5967501900350032f, - 0.5968552223806207f, - 0.5969602444992854f, - 0.5970652563891975f, - 0.5971702580485577f, - 0.597275249475567f, - 0.5973802306684263f, - 0.5974852016253366f, - 0.5975901623444994f, - 0.5976951128241161f, - 0.5978000530623887f, - 0.5979049830575188f, - 0.5980099028077086f, - 0.5981148123111603f, - 0.5982197115660762f, - 0.598324600570659f, - 0.5984294793231114f, - 0.5985343478216364f, - 0.598639206064437f, - 0.5987440540497165f, - 0.5988488917756785f, - 0.5989537192405264f, - 0.5990585364424642f, - 0.5991633433796958f, - 0.5992681400504254f, - 0.5993729264528573f, - 0.5994777025851961f, - 0.5995824684456463f, - 0.5996872240324129f, - 0.599791969343701f, - 0.5998967043777158f, - 0.6000014291326625f, - 0.600106143606747f, - 0.6002108477981747f, - 0.6003155417051517f, - 0.6004202253258839f, - 0.600524898658578f, - 0.6006295617014402f, - 0.600734214452677f, - 0.6008388569104954f, - 0.6009434890731024f, - 0.6010481109387049f, - 0.6011527225055106f, - 0.6012573237717266f, - 0.6013619147355609f, - 0.6014664953952211f, - 0.6015710657489155f, - 0.6016756257948522f, - 0.6017801755312397f, - 0.6018847149562864f, - 0.6019892440682011f, - 0.6020937628651928f, - 0.6021982713454704f, - 0.6023027695072435f, - 0.6024072573487212f, - 0.6025117348681134f, - 0.6026162020636296f, - 0.6027206589334803f, - 0.6028251054758751f, - 0.6029295416890247f, - 0.6030339675711395f, - 0.6031383831204301f, - 0.6032427883351075f, - 0.6033471832133827f, - 0.6034515677534668f, - 0.6035559419535714f, - 0.603660305811908f, - 0.6037646593266883f, - 0.6038690024961243f, - 0.6039733353184281f, - 0.604077657791812f, - 0.6041819699144884f, - 0.6042862716846701f, - 0.6043905631005696f, - 0.6044948441604001f, - 0.6045991148623748f, - 0.6047033752047071f, - 0.6048076251856103f, - 0.6049118648032983f, - 0.6050160940559849f, - 0.6051203129418842f, - 0.6052245214592104f, - 0.6053287196061778f, - 0.6054329073810013f, - 0.6055370847818956f, - 0.6056412518070754f, - 0.605745408454756f, - 0.6058495547231526f, - 0.6059536906104808f, - 0.6060578161149561f, - 0.6061619312347947f, - 0.6062660359682123f, - 0.606370130313425f, - 0.6064742142686494f, - 0.6065782878321021f, - 0.6066823510019996f, - 0.6067864037765591f, - 0.6068904461539973f, - 0.6069944781325318f, - 0.6070984997103797f, - 0.6072025108857589f, - 0.6073065116568872f, - 0.6074105020219825f, - 0.6075144819792629f, - 0.6076184515269468f, - 0.6077224106632527f, - 0.6078263593863993f, - 0.6079302976946054f, - 0.6080342255860901f, - 0.6081381430590725f, - 0.6082420501117722f, - 0.6083459467424087f, - 0.6084498329492019f, - 0.6085537087303713f, - 0.6086575740841376f, - 0.6087614290087207f, - 0.6088652735023411f, - 0.6089691075632195f, - 0.6090729311895768f, - 0.6091767443796341f, - 0.6092805471316124f, - 0.609384339443733f, - 0.6094881213142177f, - 0.6095918927412881f, - 0.609695653723166f, - 0.6097994042580738f, - 0.6099031443442333f, - 0.6100068739798674f, - 0.6101105931631985f, - 0.6102143018924493f, - 0.6103180001658429f, - 0.6104216879816026f, - 0.6105253653379514f, - 0.610629032233113f, - 0.6107326886653113f, - 0.6108363346327698f, - 0.6109399701337128f, - 0.6110435951663644f, - 0.6111472097289492f, - 0.6112508138196917f, - 0.6113544074368165f, - 0.6114579905785488f, - 0.6115615632431135f, - 0.611665125428736f, - 0.6117686771336419f, - 0.6118722183560569f, - 0.6119757490942067f, - 0.6120792693463173f, - 0.612182779110615f, - 0.6122862783853261f, - 0.6123897671686774f, - 0.6124932454588955f, - 0.6125967132542072f, - 0.6127001705528395f, - 0.6128036173530202f, - 0.6129070536529764f, - 0.6130104794509358f, - 0.6131138947451263f, - 0.6132172995337759f, - 0.6133206938151127f, - 0.6134240775873651f, - 0.6135274508487616f, - 0.6136308135975309f, - 0.6137341658319021f, - 0.6138375075501042f, - 0.6139408387503664f, - 0.6140441594309183f, - 0.6141474695899892f, - 0.6142507692258092f, - 0.6143540583366084f, - 0.6144573369206167f, - 0.6145606049760645f, - 0.6146638625011823f, - 0.6147671094942009f, - 0.6148703459533512f, - 0.6149735718768642f, - 0.6150767872629712f, - 0.6151799921099037f, - 0.6152831864158932f, - 0.6153863701791714f, - 0.6154895433979706f, - 0.6155927060705226f, - 0.61569585819506f, - 0.6157989997698151f, - 0.6159021307930208f, - 0.6160052512629098f, - 0.6161083611777153f, - 0.6162114605356704f, - 0.6163145493350087f, - 0.6164176275739637f, - 0.6165206952507691f, - 0.616623752363659f, - 0.6167267989108675f, - 0.6168298348906289f, - 0.6169328603011778f, - 0.6170358751407486f, - 0.6171388794075766f, - 0.6172418730998965f, - 0.6173448562159436f, - 0.6174478287539535f, - 0.6175507907121617f, - 0.6176537420888039f, - 0.617756682882116f, - 0.6178596130903343f, - 0.6179625327116951f, - 0.6180654417444349f, - 0.6181683401867902f, - 0.618271228036998f, - 0.6183741052932953f, - 0.6184769719539194f, - 0.6185798280171078f, - 0.618682673481098f, - 0.6187855083441275f, - 0.6188883326044347f, - 0.6189911462602573f, - 0.619093949309834f, - 0.619196741751403f, - 0.6192995235832034f, - 0.6194022948034734f, - 0.6195050554104526f, - 0.61960780540238f, - 0.6197105447774951f, - 0.6198132735340375f, - 0.6199159916702468f, - 0.6200186991843631f, - 0.6201213960746266f, - 0.6202240823392773f, - 0.620326757976556f, - 0.6204294229847033f, - 0.62053207736196f, - 0.6206347211065673f, - 0.6207373542167662f, - 0.6208399766907984f, - 0.6209425885269052f, - 0.6210451897233286f, - 0.6211477802783104f, - 0.6212503601900927f, - 0.6213529294569181f, - 0.6214554880770288f, - 0.6215580360486677f, - 0.6216605733700774f, - 0.6217631000395012f, - 0.6218656160551823f, - 0.6219681214153641f, - 0.6220706161182901f, - 0.6221731001622042f, - 0.6222755735453502f, - 0.6223780362659725f, - 0.6224804883223153f, - 0.6225829297126231f, - 0.6226853604351406f, - 0.6227877804881126f, - 0.6228901898697841f, - 0.6229925885784007f, - 0.6230949766122075f, - 0.6231973539694503f, - 0.6232997206483747f, - 0.6234020766472268f, - 0.6235044219642528f, - 0.6236067565976989f, - 0.6237090805458119f, - 0.6238113938068381f, - 0.6239136963790246f, - 0.6240159882606185f, - 0.624118269449867f, - 0.6242205399450177f, - 0.624322799744318f, - 0.6244250488460158f, - 0.624527287248359f, - 0.624629514949596f, - 0.6247317319479749f, - 0.6248339382417444f, - 0.6249361338291533f, - 0.6250383187084502f, - 0.6251404928778843f, - 0.6252426563357051f, - 0.6253448090801619f, - 0.6254469511095043f, - 0.6255490824219823f, - 0.6256512030158455f, - 0.6257533128893445f, - 0.6258554120407296f, - 0.6259575004682513f, - 0.6260595781701602f, - 0.6261616451447074f, - 0.6262637013901441f, - 0.6263657469047214f, - 0.6264677816866908f, - 0.626569805734304f, - 0.6266718190458129f, - 0.6267738216194696f, - 0.626875813453526f, - 0.6269777945462348f, - 0.6270797648958485f, - 0.6271817245006197f, - 0.6272836733588016f, - 0.6273856114686472f, - 0.6274875388284098f, - 0.627589455436343f, - 0.6276913612907005f, - 0.6277932563897359f, - 0.6278951407317036f, - 0.6279970143148578f, - 0.6280988771374527f, - 0.6282007291977431f, - 0.6283025704939835f, - 0.6284044010244292f, - 0.6285062207873353f, - 0.6286080297809572f, - 0.6287098280035502f, - 0.6288116154533703f, - 0.6289133921286731f, - 0.6290151580277149f, - 0.6291169131487518f, - 0.6292186574900406f, - 0.6293203910498375f, - 0.6294221138263995f, - 0.6295238258179836f, - 0.6296255270228471f, - 0.6297272174392473f, - 0.6298288970654419f, - 0.6299305658996883f, - 0.6300322239402446f, - 0.6301338711853691f, - 0.6302355076333199f, - 0.6303371332823555f, - 0.6304387481307346f, - 0.6305403521767162f, - 0.6306419454185591f, - 0.6307435278545227f, - 0.6308450994828663f, - 0.6309466603018495f, - 0.6310482103097323f, - 0.6311497495047745f, - 0.6312512778852362f, - 0.6313527954493777f, - 0.6314543021954597f, - 0.6315557981217428f, - 0.631657283226488f, - 0.6317587575079561f, - 0.6318602209644087f, - 0.6319616735941072f, - 0.632063115395313f, - 0.6321645463662882f, - 0.6322659665052947f, - 0.6323673758105945f, - 0.6324687742804502f, - 0.6325701619131244f, - 0.6326715387068799f, - 0.6327729046599793f, - 0.632874259770686f, - 0.6329756040372632f, - 0.6330769374579744f, - 0.6331782600310835f, - 0.6332795717548539f, - 0.6333808726275502f, - 0.6334821626474363f, - 0.6335834418127766f, - 0.6336847101218358f, - 0.6337859675728786f, - 0.6338872141641702f, - 0.6339884498939755f, - 0.6340896747605602f, - 0.6341908887621895f, - 0.6342920918971293f, - 0.6343932841636455f, - 0.6344944655600041f, - 0.6345956360844714f, - 0.634696795735314f, - 0.6347979445107985f, - 0.6348990824091918f, - 0.6350002094287606f, - 0.6351013255677724f, - 0.6352024308244947f, - 0.6353035251971949f, - 0.635404608684141f, - 0.6355056812836005f, - 0.635606742993842f, - 0.6357077938131337f, - 0.6358088337397441f, - 0.6359098627719418f, - 0.6360108809079958f, - 0.6361118881461753f, - 0.6362128844847493f, - 0.6363138699219876f, - 0.6364148444561595f, - 0.636515808085535f, - 0.6366167608083841f, - 0.636717702622977f, - 0.636818633527584f, - 0.6369195535204759f, - 0.6370204625999233f, - 0.6371213607641971f, - 0.6372222480115685f, - 0.6373231243403089f, - 0.6374239897486896f, - 0.6375248442349826f, - 0.6376256877974597f, - 0.6377265204343927f, - 0.6378273421440542f, - 0.6379281529247165f, - 0.6380289527746521f, - 0.6381297416921341f, - 0.6382305196754353f, - 0.638331286722829f, - 0.6384320428325886f, - 0.6385327880029876f, - 0.6386335222322997f, - 0.6387342455187991f, - 0.6388349578607596f, - 0.6389356592564558f, - 0.6390363497041621f, - 0.6391370292021531f, - 0.6392376977487039f, - 0.6393383553420893f, - 0.6394390019805847f, - 0.6395396376624656f, - 0.6396402623860077f, - 0.6397408761494866f, - 0.6398414789511784f, - 0.6399420707893594f, - 0.6400426516623058f, - 0.6401432215682944f, - 0.6402437805056018f, - 0.640344328472505f, - 0.640444865467281f, - 0.6405453914882073f, - 0.6406459065335615f, - 0.6407464106016211f, - 0.6408469036906641f, - 0.6409473857989685f, - 0.6410478569248126f, - 0.6411483170664748f, - 0.6412487662222338f, - 0.6413492043903685f, - 0.6414496315691578f, - 0.641550047756881f, - 0.6416504529518174f, - 0.6417508471522467f, - 0.6418512303564486f, - 0.6419516025627031f, - 0.6420519637692903f, - 0.6421523139744906f, - 0.6422526531765844f, - 0.6423529813738525f, - 0.6424532985645758f, - 0.6425536047470355f, - 0.6426538999195126f, - 0.6427541840802888f, - 0.6428544572276458f, - 0.6429547193598653f, - 0.6430549704752294f, - 0.6431552105720203f, - 0.6432554396485205f, - 0.6433556577030124f, - 0.6434558647337789f, - 0.6435560607391031f, - 0.643656245717268f, - 0.6437564196665571f, - 0.6438565825852537f, - 0.6439567344716418f, - 0.6440568753240052f, - 0.6441570051406281f, - 0.6442571239197947f, - 0.6443572316597895f, - 0.6444573283588975f, - 0.644557414015403f, - 0.6446574886275913f, - 0.6447575521937479f, - 0.6448576047121578f, - 0.644957646181107f, - 0.6450576765988812f, - 0.6451576959637664f, - 0.6452577042740486f, - 0.6453577015280145f, - 0.6454576877239505f, - 0.6455576628601434f, - 0.6456576269348803f, - 0.645757579946448f, - 0.6458575218931341f, - 0.6459574527732259f, - 0.6460573725850114f, - 0.6461572813267784f, - 0.6462571789968149f, - 0.6463570655934093f, - 0.6464569411148499f, - 0.6465568055594255f, - 0.6466566589254249f, - 0.6467565012111371f, - 0.6468563324148515f, - 0.6469561525348573f, - 0.6470559615694442f, - 0.6471557595169022f, - 0.6472555463755209f, - 0.6473553221435907f, - 0.647455086819402f, - 0.6475548404012453f, - 0.6476545828874114f, - 0.6477543142761911f, - 0.6478540345658756f, - 0.6479537437547563f, - 0.6480534418411247f, - 0.6481531288232724f, - 0.6482528046994913f, - 0.6483524694680736f, - 0.6484521231273114f, - 0.6485517656754973f, - 0.648651397110924f, - 0.6487510174318842f, - 0.648850626636671f, - 0.6489502247235776f, - 0.6490498116908974f, - 0.649149387536924f, - 0.649248952259951f, - 0.649348505858273f, - 0.6494480483301837f, - 0.6495475796739774f, - 0.6496470998879489f, - 0.6497466089703928f, - 0.6498461069196041f, - 0.6499455937338781f, - 0.6500450694115097f, - 0.6501445339507947f, - 0.6502439873500288f, - 0.6503434296075078f, - 0.6504428607215278f, - 0.6505422806903853f, - 0.6506416895123764f, - 0.650741087185798f, - 0.6508404737089468f, - 0.65093984908012f, - 0.6510392132976147f, - 0.6511385663597284f, - 0.6512379082647587f, - 0.6513372390110033f, - 0.6514365585967603f, - 0.6515358670203278f, - 0.6516351642800043f, - 0.6517344503740885f, - 0.6518337253008788f, - 0.6519329890586743f, - 0.6520322416457741f, - 0.6521314830604776f, - 0.6522307133010844f, - 0.6523299323658942f, - 0.6524291402532068f, - 0.6525283369613222f, - 0.652627522488541f, - 0.6527266968331633f, - 0.6528258599934902f, - 0.6529250119678224f, - 0.6530241527544608f, - 0.6531232823517068f, - 0.6532224007578618f, - 0.6533215079712273f, - 0.6534206039901054f, - 0.653519688812798f, - 0.6536187624376072f, - 0.6537178248628356f, - 0.6538168760867856f, - 0.65391591610776f, - 0.654014944924062f, - 0.6541139625339946f, - 0.6542129689358611f, - 0.6543119641279651f, - 0.6544109481086103f, - 0.6545099208761008f, - 0.6546088824287407f, - 0.6547078327648341f, - 0.6548067718826858f, - 0.6549056997806002f, - 0.6550046164568826f, - 0.6551035219098377f, - 0.6552024161377709f, - 0.6553012991389878f, - 0.6554001709117939f, - 0.6554990314544952f, - 0.6555978807653977f, - 0.6556967188428074f, - 0.6557955456850312f, - 0.6558943612903755f, - 0.6559931656571472f, - 0.656091958783653f, - 0.6561907406682004f, - 0.6562895113090967f, - 0.6563882707046497f, - 0.656487018853167f, - 0.6565857557529565f, - 0.6566844814023264f, - 0.6567831957995851f, - 0.6568818989430413f, - 0.6569805908310036f, - 0.657079271461781f, - 0.6571779408336825f, - 0.6572765989450177f, - 0.6573752457940958f, - 0.6574738813792266f, - 0.6575725056987202f, - 0.6576711187508865f, - 0.6577697205340358f, - 0.6578683110464788f, - 0.6579668902865259f, - 0.6580654582524882f, - 0.6581640149426765f, - 0.6582625603554024f, - 0.6583610944889771f, - 0.6584596173417123f, - 0.6585581289119198f, - 0.6586566291979117f, - 0.6587551181980003f, - 0.6588535959104977f, - 0.658952062333717f, - 0.6590505174659704f, - 0.6591489613055715f, - 0.6592473938508332f, - 0.6593458151000688f, - 0.6594442250515921f, - 0.6595426237037167f, - 0.6596410110547567f, - 0.6597393871030262f, - 0.6598377518468393f, - 0.659936105284511f, - 0.6600344474143557f, - 0.6601327782346886f, - 0.6602310977438246f, - 0.6603294059400792f, - 0.6604277028217677f, - 0.660525988387206f, - 0.6606242626347099f, - 0.6607225255625956f, - 0.6608207771691793f, - 0.6609190174527775f, - 0.6610172464117068f, - 0.6611154640442842f, - 0.6612136703488268f, - 0.6613118653236518f, - 0.6614100489670767f, - 0.661508221277419f, - 0.6616063822529966f, - 0.6617045318921277f, - 0.6618026701931303f, - 0.6619007971543232f, - 0.6619989127740245f, - 0.6620970170505532f, - 0.6621951099822285f, - 0.6622931915673695f, - 0.6623912618042956f, - 0.6624893206913265f, - 0.6625873682267818f, - 0.6626854044089815f, - 0.6627834292362458f, - 0.6628814427068951f, - 0.66297944481925f, - 0.6630774355716312f, - 0.6631754149623597f, - 0.6632733829897566f, - 0.6633713396521433f, - 0.6634692849478413f, - 0.6635672188751723f, - 0.6636651414324585f, - 0.6637630526180216f, - 0.6638609524301842f, - 0.6639588408672686f, - 0.6640567179275978f, - 0.6641545836094944f, - 0.6642524379112816f, - 0.6643502808312829f, - 0.6644481123678215f, - 0.6645459325192213f, - 0.664643741283806f, - 0.6647415386598998f, - 0.664839324645827f, - 0.6649370992399118f, - 0.6650348624404793f, - 0.6651326142458539f, - 0.6652303546543609f, - 0.6653280836643253f, - 0.665425801274073f, - 0.6655235074819292f, - 0.66562120228622f, - 0.6657188856852714f, - 0.6658165576774094f, - 0.6659142182609606f, - 0.6660118674342517f, - 0.6661095051956092f, - 0.6662071315433603f, - 0.6663047464758322f, - 0.6664023499913523f, - 0.6664999420882481f, - 0.6665975227648477f, - 0.6666950920194786f, - 0.6667926498504694f, - 0.6668901962561481f, - 0.6669877312348436f, - 0.6670852547848845f, - 0.6671827669045997f, - 0.6672802675923184f, - 0.66737775684637f, - 0.6674752346650841f, - 0.6675727010467903f, - 0.6676701559898188f, - 0.6677675994924995f, - 0.6678650315531627f, - 0.667962452170139f, - 0.6680598613417592f, - 0.6681572590663541f, - 0.668254645342255f, - 0.668352020167793f, - 0.6684493835412997f, - 0.6685467354611069f, - 0.6686440759255462f, - 0.6687414049329501f, - 0.6688387224816505f, - 0.6689360285699804f, - 0.6690333231962718f, - 0.6691306063588582f, - 0.6692278780560724f, - 0.6693251382862476f, - 0.6694223870477175f, - 0.6695196243388155f, - 0.6696168501578758f, - 0.6697140645032321f, - 0.6698112673732189f, - 0.6699084587661707f, - 0.670005638680422f, - 0.6701028071143077f, - 0.6701999640661628f, - 0.6702971095343225f, - 0.6703942435171224f, - 0.6704913660128979f, - 0.6705884770199851f, - 0.67068557653672f, - 0.6707826645614386f, - 0.6708797410924776f, - 0.6709768061281735f, - 0.671073859666863f, - 0.6711709017068831f, - 0.6712679322465713f, - 0.6713649512842649f, - 0.6714619588183013f, - 0.6715589548470183f, - 0.6716559393687542f, - 0.6717529123818471f, - 0.6718498738846351f, - 0.6719468238754573f, - 0.6720437623526522f, - 0.6721406893145586f, - 0.6722376047595159f, - 0.6723345086858635f, - 0.672431401091941f, - 0.672528281976088f, - 0.6726251513366446f, - 0.672722009171951f, - 0.6728188554803475f, - 0.6729156902601746f, - 0.6730125135097732f, - 0.6731093252274843f, - 0.6732061254116489f, - 0.6733029140606084f, - 0.6733996911727044f, - 0.6734964567462786f, - 0.6735932107796729f, - 0.6736899532712296f, - 0.6737866842192909f, - 0.6738834036221993f, - 0.6739801114782978f, - 0.6740768077859292f, - 0.6741734925434364f, - 0.6742701657491632f, - 0.6743668274014527f, - 0.6744634774986489f, - 0.6745601160390955f, - 0.6746567430211369f, - 0.6747533584431171f, - 0.6748499623033809f, - 0.6749465546002729f, - 0.675043135332138f, - 0.6751397044973214f, - 0.6752362620941683f, - 0.6753328081210244f, - 0.6754293425762352f, - 0.6755258654581467f, - 0.6756223767651051f, - 0.6757188764954564f, - 0.6758153646475473f, - 0.6759118412197246f, - 0.6760083062103351f, - 0.676104759617726f, - 0.6762012014402444f, - 0.6762976316762379f, - 0.6763940503240542f, - 0.6764904573820412f, - 0.6765868528485469f, - 0.6766832367219198f, - 0.6767796090005082f, - 0.6768759696826606f, - 0.6769723187667264f, - 0.6770686562510543f, - 0.6771649821339938f, - 0.6772612964138942f, - 0.6773575990891053f, - 0.677453890157977f, - 0.6775501696188592f, - 0.6776464374701022f, - 0.6777426937100568f, - 0.6778389383370732f, - 0.6779351713495027f, - 0.678031392745696f, - 0.6781276025240047f, - 0.6782238006827802f, - 0.6783199872203741f, - 0.6784161621351382f, - 0.6785123254254246f, - 0.6786084770895857f, - 0.6787046171259739f, - 0.6788007455329417f, - 0.6788968623088422f, - 0.6789929674520284f, - 0.6790890609608535f, - 0.679185142833671f, - 0.6792812130688346f, - 0.6793772716646981f, - 0.6794733186196157f, - 0.6795693539319414f, - 0.6796653776000299f, - 0.6797613896222358f, - 0.6798573899969138f, - 0.6799533787224191f, - 0.6800493557971071f, - 0.680145321219333f, - 0.6802412749874527f, - 0.6803372170998218f, - 0.6804331475547964f, - 0.6805290663507331f, - 0.680624973485988f, - 0.6807208689589178f, - 0.6808167527678795f, - 0.68091262491123f, - 0.6810084853873266f, - 0.6811043341945268f, - 0.6812001713311883f, - 0.6812959967956689f, - 0.6813918105863266f, - 0.6814876127015197f, - 0.6815834031396066f, - 0.6816791818989462f, - 0.6817749489778971f, - 0.6818707043748186f, - 0.6819664480880696f, - 0.6820621801160097f, - 0.6821579004569986f, - 0.6822536091093964f, - 0.6823493060715629f, - 0.6824449913418582f, - 0.6825406649186431f, - 0.682636326800278f, - 0.6827319769851238f, - 0.6828276154715418f, - 0.682923242257893f, - 0.6830188573425389f, - 0.6831144607238412f, - 0.6832100524001619f, - 0.6833056323698627f, - 0.6834012006313063f, - 0.683496757182855f, - 0.6835923020228712f, - 0.6836878351497182f, - 0.6837833565617587f, - 0.6838788662573562f, - 0.683974364234874f, - 0.6840698504926759f, - 0.6841653250291257f, - 0.6842607878425875f, - 0.6843562389314256f, - 0.6844516782940044f, - 0.6845471059286886f, - 0.6846425218338431f, - 0.684737926007833f, - 0.6848333184490235f, - 0.68492869915578f, - 0.6850240681264684f, - 0.6851194253594544f, - 0.6852147708531041f, - 0.6853101046057839f, - 0.6854054266158602f, - 0.6855007368816997f, - 0.6855960354016691f, - 0.6856913221741359f, - 0.6857865971974669f, - 0.6858818604700301f, - 0.6859771119901927f, - 0.686072351756323f, - 0.6861675797667888f, - 0.6862627960199583f, - 0.6863580005142005f, - 0.6864531932478837f, - 0.6865483742193769f, - 0.686643543427049f, - 0.6867387008692697f, - 0.6868338465444082f, - 0.6869289804508343f, - 0.687024102586918f, - 0.6871192129510292f, - 0.6872143115415383f, - 0.6873093983568158f, - 0.6874044733952326f, - 0.6874995366551594f, - 0.6875945881349674f, - 0.6876896278330278f, - 0.6877846557477123f, - 0.6878796718773925f, - 0.6879746762204404f, - 0.688069668775228f, - 0.6881646495401278f, - 0.6882596185135121f, - 0.6883545756937539f, - 0.688449521079226f, - 0.6885444546683015f, - 0.6886393764593539f, - 0.6887342864507566f, - 0.6888291846408834f, - 0.6889240710281082f, - 0.689018945610805f, - 0.6891138083873485f, - 0.689208659356113f, - 0.6893034985154732f, - 0.6893983258638043f, - 0.6894931413994814f, - 0.6895879451208796f, - 0.6896827370263748f, - 0.6897775171143427f, - 0.6898722853831591f, - 0.6899670418312003f, - 0.6900617864568426f, - 0.6901565192584627f, - 0.6902512402344372f, - 0.6903459493831431f, - 0.6904406467029578f, - 0.6905353321922585f, - 0.6906300058494228f, - 0.6907246676728286f, - 0.6908193176608538f, - 0.6909139558118766f, - 0.6910085821242756f, - 0.691103196596429f, - 0.691197799226716f, - 0.6912923900135154f, - 0.6913869689552063f, - 0.6914815360501684f, - 0.6915760912967813f, - 0.6916706346934246f, - 0.6917651662384784f, - 0.691859685930323f, - 0.6919541937673388f, - 0.6920486897479065f, - 0.6921431738704068f, - 0.6922376461332208f, - 0.6923321065347298f, - 0.6924265550733151f, - 0.6925209917473585f, - 0.6926154165552417f, - 0.6927098294953471f, - 0.6928042305660566f, - 0.6928986197657526f, - 0.6929929970928181f, - 0.6930873625456359f, - 0.6931817161225888f, - 0.6932760578220605f, - 0.693370387642434f, - 0.6934647055820933f, - 0.6935590116394222f, - 0.6936533058128049f, - 0.6937475881006255f, - 0.6938418585012688f, - 0.6939361170131192f, - 0.6940303636345616f, - 0.6941245983639813f, - 0.6942188211997635f, - 0.6943130321402938f, - 0.6944072311839579f, - 0.6945014183291416f, - 0.6945955935742312f, - 0.6946897569176129f, - 0.6947839083576733f, - 0.6948780478927992f, - 0.6949721755213775f, - 0.6950662912417952f, - 0.6951603950524399f, - 0.6952544869516989f, - 0.6953485669379602f, - 0.6954426350096116f, - 0.6955366911650414f, - 0.6956307354026379f, - 0.6957247677207896f, - 0.6958187881178854f, - 0.6959127965923143f, - 0.6960067931424654f, - 0.6961007777667281f, - 0.6961947504634921f, - 0.6962887112311471f, - 0.6963826600680832f, - 0.6964765969726905f, - 0.6965705219433594f, - 0.6966644349784806f, - 0.6967583360764451f, - 0.6968522252356436f, - 0.6969461024544675f, - 0.6970399677313083f, - 0.6971338210645576f, - 0.697227662452607f, - 0.697321491893849f, - 0.6974153093866755f, - 0.697509114929479f, - 0.6976029085206524f, - 0.6976966901585884f, - 0.6977904598416801f, - 0.6978842175683209f, - 0.697977963336904f, - 0.6980716971458233f, - 0.6981654189934726f, - 0.6982591288782461f, - 0.6983528267985382f, - 0.6984465127527432f, - 0.6985401867392559f, - 0.6986338487564712f, - 0.6987274988027843f, - 0.6988211368765903f, - 0.6989147629762851f, - 0.6990083771002643f, - 0.6991019792469237f, - 0.6991955694146595f, - 0.6992891476018682f, - 0.6993827138069463f, - 0.6994762680282904f, - 0.6995698102642978f, - 0.6996633405133653f, - 0.6997568587738907f, - 0.6998503650442712f, - 0.6999438593229048f, - 0.7000373416081895f, - 0.7001308118985237f, - 0.7002242701923053f, - 0.7003177164879333f, - 0.7004111507838063f, - 0.7005045730783236f, - 0.7005979833698842f, - 0.7006913816568877f, - 0.7007847679377337f, - 0.7008781422108219f, - 0.7009715044745526f, - 0.7010648547273258f, - 0.7011581929675422f, - 0.7012515191936025f, - 0.7013448334039074f, - 0.7014381355968581f, - 0.7015314257708557f, - 0.7016247039243019f, - 0.7017179700555983f, - 0.701811224163147f, - 0.70190446624535f, - 0.7019976963006095f, - 0.7020909143273281f, - 0.7021841203239086f, - 0.702277314288754f, - 0.7023704962202673f, - 0.7024636661168517f, - 0.7025568239769111f, - 0.7026499697988492f, - 0.7027431035810697f, - 0.7028362253219772f, - 0.7029293350199758f, - 0.7030224326734701f, - 0.7031155182808649f, - 0.7032085918405654f, - 0.7033016533509765f, - 0.7033947028105039f, - 0.703487740217553f, - 0.7035807655705297f, - 0.7036737788678402f, - 0.7037667801078905f, - 0.7038597692890872f, - 0.7039527464098368f, - 0.7040457114685466f, - 0.704138664463623f, - 0.7042316053934737f, - 0.7043245342565062f, - 0.704417451051128f, - 0.704510355775747f, - 0.7046032484287715f, - 0.7046961290086097f, - 0.7047889975136701f, - 0.7048818539423614f, - 0.7049746982930926f, - 0.7050675305642727f, - 0.7051603507543113f, - 0.7052531588616178f, - 0.7053459548846018f, - 0.7054387388216735f, - 0.705531510671243f, - 0.7056242704317206f, - 0.7057170181015171f, - 0.7058097536790431f, - 0.7059024771627096f, - 0.7059951885509279f, - 0.7060878878421093f, - 0.7061805750346656f, - 0.7062732501270086f, - 0.7063659131175501f, - 0.7064585640047025f, - 0.7065512027868784f, - 0.7066438294624902f, - 0.706736444029951f, - 0.7068290464876738f, - 0.7069216368340717f, - 0.7070142150675583f, - 0.7071067811865476f, - 0.707199335189453f, - 0.7072918770746889f, - 0.7073844068406696f, - 0.7074769244858096f, - 0.7075694300085236f, - 0.7076619234072266f, - 0.7077544046803337f, - 0.7078468738262603f, - 0.707939330843422f, - 0.7080317757302345f, - 0.7081242084851137f, - 0.708216629106476f, - 0.7083090375927377f, - 0.7084014339423154f, - 0.7084938181536258f, - 0.7085861902250861f, - 0.7086785501551135f, - 0.7087708979421253f, - 0.7088632335845394f, - 0.7089555570807734f, - 0.7090478684292455f, - 0.709140167628374f, - 0.7092324546765771f, - 0.7093247295722739f, - 0.709416992313883f, - 0.7095092428998236f, - 0.709601481328515f, - 0.7096937075983767f, - 0.7097859217078285f, - 0.7098781236552902f, - 0.7099703134391823f, - 0.7100624910579247f, - 0.7101546565099381f, - 0.7102468097936434f, - 0.7103389509074615f, - 0.7104310798498135f, - 0.7105231966191209f, - 0.7106153012138052f, - 0.7107073936322884f, - 0.7107994738729924f, - 0.7108915419343395f, - 0.710983597814752f, - 0.7110756415126528f, - 0.7111676730264644f, - 0.7112596923546102f, - 0.7113516994955131f, - 0.711443694447597f, - 0.7115356772092853f, - 0.7116276477790021f, - 0.7117196061551713f, - 0.7118115523362174f, - 0.7119034863205648f, - 0.7119954081066383f, - 0.7120873176928628f, - 0.7121792150776638f, - 0.712271100259466f, - 0.7123629732366955f, - 0.7124548340077779f, - 0.7125466825711391f, - 0.7126385189252054f, - 0.7127303430684032f, - 0.7128221549991591f, - 0.7129139547159f, - 0.7130057422170529f, - 0.7130975175010451f, - 0.7131892805663039f, - 0.7132810314112572f, - 0.7133727700343326f, - 0.7134644964339584f, - 0.7135562106085627f, - 0.713647912556574f, - 0.7137396022764213f, - 0.7138312797665333f, - 0.7139229450253392f, - 0.7140145980512682f, - 0.71410623884275f, - 0.7141978673982143f, - 0.7142894837160911f, - 0.7143810877948109f, - 0.7144726796328034f, - 0.7145642592284996f, - 0.7146558265803303f, - 0.7147473816867265f, - 0.7148389245461194f, - 0.7149304551569403f, - 0.7150219735176212f, - 0.7151134796265938f, - 0.71520497348229f, - 0.7152964550831421f, - 0.7153879244275828f, - 0.7154793815140448f, - 0.7155708263409608f, - 0.7156622589067639f, - 0.7157536792098877f, - 0.7158450872487655f, - 0.7159364830218311f, - 0.7160278665275186f, - 0.7161192377642619f, - 0.7162105967304956f, - 0.7163019434246541f, - 0.7163932778451726f, - 0.7164845999904855f, - 0.7165759098590286f, - 0.7166672074492371f, - 0.7167584927595464f, - 0.7168497657883927f, - 0.7169410265342119f, - 0.7170322749954402f, - 0.7171235111705143f, - 0.7172147350578707f, - 0.7173059466559465f, - 0.7173971459631786f, - 0.7174883329780044f, - 0.7175795076988615f, - 0.7176706701241876f, - 0.7177618202524206f, - 0.7178529580819988f, - 0.7179440836113604f, - 0.7180351968389442f, - 0.7181262977631888f, - 0.7182173863825334f, - 0.718308462695417f, - 0.7183995267002792f, - 0.7184905783955595f, - 0.718581617779698f, - 0.7186726448511346f, - 0.7187636596083096f, - 0.7188546620496634f, - 0.7189456521736368f, - 0.7190366299786707f, - 0.7191275954632061f, - 0.7192185486256845f, - 0.7193094894645474f, - 0.7194004179782365f, - 0.7194913341651938f, - 0.7195822380238615f, - 0.7196731295526819f, - 0.7197640087500976f, - 0.7198548756145515f, - 0.7199457301444868f, - 0.7200365723383464f, - 0.7201274021945737f, - 0.7202182197116126f, - 0.7203090248879069f, - 0.7203998177219006f, - 0.7204905982120382f, - 0.7205813663567638f, - 0.7206721221545225f, - 0.7207628656037591f, - 0.7208535967029187f, - 0.7209443154504467f, - 0.7210350218447887f, - 0.7211257158843903f, - 0.7212163975676976f, - 0.7213070668931567f, - 0.7213977238592142f, - 0.7214883684643165f, - 0.7215790007069105f, - 0.7216696205854433f, - 0.7217602280983622f, - 0.7218508232441144f, - 0.7219414060211479f, - 0.7220319764279104f, - 0.7221225344628502f, - 0.7222130801244154f, - 0.7223036134110545f, - 0.7223941343212164f, - 0.7224846428533498f, - 0.7225751390059041f, - 0.7226656227773287f, - 0.722756094166073f, - 0.722846553170587f, - 0.7229369997893205f, - 0.7230274340207238f, - 0.7231178558632474f, - 0.7232082653153421f, - 0.7232986623754584f, - 0.7233890470420474f, - 0.7234794193135605f, - 0.7235697791884493f, - 0.7236601266651654f, - 0.7237504617421607f, - 0.7238407844178875f, - 0.7239310946907979f, - 0.7240213925593446f, - 0.7241116780219803f, - 0.7242019510771581f, - 0.7242922117233312f, - 0.7243824599589528f, - 0.7244726957824766f, - 0.7245629191923566f, - 0.7246531301870466f, - 0.7247433287650011f, - 0.7248335149246744f, - 0.7249236886645213f, - 0.7250138499829966f, - 0.7251039988785554f, - 0.7251941353496532f, - 0.7252842593947453f, - 0.7253743710122876f, - 0.725464470200736f, - 0.7255545569585468f, - 0.7256446312841762f, - 0.7257346931760809f, - 0.7258247426327177f, - 0.7259147796525436f, - 0.7260048042340158f, - 0.7260948163755919f, - 0.7261848160757295f, - 0.7262748033328864f, - 0.7263647781455208f, - 0.726454740512091f, - 0.7265446904310554f, - 0.7266346279008729f, - 0.7267245529200023f, - 0.7268144654869028f, - 0.7269043656000338f, - 0.7269942532578549f, - 0.7270841284588259f, - 0.7271739912014068f, - 0.7272638414840578f, - 0.7273536793052393f, - 0.727443504663412f, - 0.7275333175570369f, - 0.7276231179845749f, - 0.7277129059444872f, - 0.7278026814352356f, - 0.7278924444552817f, - 0.7279821950030874f, - 0.7280719330771148f, - 0.7281616586758263f, - 0.7282513717976846f, - 0.7283410724411523f, - 0.7284307606046926f, - 0.7285204362867684f, - 0.7286100994858437f, - 0.7286997502003816f, - 0.728789388428846f, - 0.7288790141697012f, - 0.7289686274214116f, - 0.7290582281824413f, - 0.7291478164512553f, - 0.7292373922263184f, - 0.7293269555060958f, - 0.729416506289053f, - 0.7295060445736552f, - 0.7295955703583684f, - 0.729685083641659f, - 0.7297745844219925f, - 0.7298640726978357f, - 0.7299535484676551f, - 0.7300430117299178f, - 0.7301324624830907f, - 0.7302219007256411f, - 0.7303113264560365f, - 0.7304007396727447f, - 0.7304901403742333f, - 0.7305795285589709f, - 0.7306689042254256f, - 0.7307582673720661f, - 0.7308476179973611f, - 0.7309369560997796f, - 0.7310262816777908f, - 0.7311155947298641f, - 0.7312048952544693f, - 0.7312941832500761f, - 0.7313834587151545f, - 0.7314727216481751f, - 0.7315619720476083f, - 0.7316512099119247f, - 0.7317404352395952f, - 0.7318296480290911f, - 0.7319188482788838f, - 0.7320080359874447f, - 0.7320972111532456f, - 0.7321863737747585f, - 0.7322755238504557f, - 0.7323646613788097f, - 0.7324537863582931f, - 0.7325428987873787f, - 0.7326319986645397f, - 0.7327210859882493f, - 0.732810160756981f, - 0.7328992229692086f, - 0.7329882726234062f, - 0.7330773097180476f, - 0.7331663342516073f, - 0.7332553462225601f, - 0.7333443456293804f, - 0.7334333324705435f, - 0.7335223067445248f, - 0.7336112684497994f, - 0.7337002175848432f, - 0.7337891541481318f, - 0.7338780781381417f, - 0.7339669895533488f, - 0.7340558883922301f, - 0.7341447746532619f, - 0.7342336483349213f, - 0.7343225094356856f, - 0.7344113579540319f, - 0.7345001938884381f, - 0.7345890172373819f, - 0.7346778279993413f, - 0.7347666261727948f, - 0.7348554117562205f, - 0.7349441847480972f, - 0.7350329451469039f, - 0.7351216929511197f, - 0.7352104281592239f, - 0.735299150769696f, - 0.7353878607810158f, - 0.7354765581916634f, - 0.7355652430001187f, - 0.7356539152048623f, - 0.7357425748043749f, - 0.7358312217971372f, - 0.7359198561816302f, - 0.7360084779563355f, - 0.7360970871197343f, - 0.7361856836703083f, - 0.7362742676065396f, - 0.7363628389269102f, - 0.7364513976299025f, - 0.736539943713999f, - 0.7366284771776825f, - 0.7367169980194362f, - 0.7368055062377431f, - 0.7368940018310867f, - 0.7369824847979507f, - 0.737070955136819f, - 0.7371594128461754f, - 0.7372478579245046f, - 0.7373362903702909f, - 0.7374247101820189f, - 0.7375131173581739f, - 0.7376015118972408f, - 0.7376898937977051f, - 0.7377782630580524f, - 0.7378666196767684f, - 0.7379549636523393f, - 0.7380432949832512f, - 0.7381316136679905f, - 0.7382199197050442f, - 0.7383082130928991f, - 0.738396493830042f, - 0.7384847619149606f, - 0.7385730173461422f, - 0.7386612601220749f, - 0.7387494902412463f, - 0.7388377077021447f, - 0.7389259125032587f, - 0.7390141046430768f, - 0.7391022841200879f, - 0.7391904509327809f, - 0.7392786050796453f, - 0.7393667465591708f, - 0.7394548753698466f, - 0.7395429915101628f, - 0.7396310949786097f, - 0.7397191857736777f, - 0.7398072638938572f, - 0.739895329337639f, - 0.7399833821035144f, - 0.7400714221899743f, - 0.7401594495955105f, - 0.7402474643186144f, - 0.740335466357778f, - 0.7404234557114936f, - 0.7405114323782531f, - 0.7405993963565493f, - 0.7406873476448749f, - 0.7407752862417228f, - 0.7408632121455865f, - 0.7409511253549591f, - 0.7410390258683343f, - 0.741126913684206f, - 0.7412147888010684f, - 0.7413026512174156f, - 0.741390500931742f, - 0.7414783379425426f, - 0.7415661622483123f, - 0.741653973847546f, - 0.7417417727387392f, - 0.7418295589203876f, - 0.7419173323909868f, - 0.7420050931490331f, - 0.7420928411930224f, - 0.7421805765214515f, - 0.7422682991328169f, - 0.7423560090256155f, - 0.7424437061983444f, - 0.7425313906495011f, - 0.7426190623775831f, - 0.742706721381088f, - 0.7427943676585137f, - 0.7428820012083587f, - 0.7429696220291213f, - 0.7430572301193002f, - 0.7431448254773941f, - 0.7432324081019024f, - 0.743319977991324f, - 0.7434075351441586f, - 0.7434950795589059f, - 0.743582611234066f, - 0.743670130168139f, - 0.7437576363596251f, - 0.7438451298070251f, - 0.7439326105088396f, - 0.74402007846357f, - 0.7441075336697173f, - 0.744194976125783f, - 0.7442824058302687f, - 0.7443698227816766f, - 0.7444572269785088f, - 0.7445446184192673f, - 0.7446319971024551f, - 0.7447193630265748f, - 0.7448067161901294f, - 0.744894056591622f, - 0.7449813842295563f, - 0.7450686991024358f, - 0.7451560012087645f, - 0.7452432905470463f, - 0.7453305671157857f, - 0.7454178309134872f, - 0.7455050819386556f, - 0.7455923201897958f, - 0.7456795456654131f, - 0.7457667583640127f, - 0.7458539582841005f, - 0.7459411454241821f, - 0.7460283197827638f, - 0.7461154813583517f, - 0.7462026301494524f, - 0.7462897661545728f, - 0.7463768893722195f, - 0.7464639998008998f, - 0.7465510974391213f, - 0.7466381822853914f, - 0.7467252543382178f, - 0.7468123135961089f, - 0.7468993600575726f, - 0.7469863937211177f, - 0.7470734145852527f, - 0.7471604226484866f, - 0.7472474179093285f, - 0.7473344003662876f, - 0.7474213700178738f, - 0.7475083268625967f, - 0.7475952708989664f, - 0.7476822021254932f, - 0.7477691205406873f, - 0.7478560261430597f, - 0.7479429189311211f, - 0.7480297989033825f, - 0.7481166660583555f, - 0.7482035203945515f, - 0.7482903619104824f, - 0.74837719060466f, - 0.7484640064755966f, - 0.7485508095218047f, - 0.748637599741797f, - 0.7487243771340861f, - 0.7488111416971853f, - 0.7488978934296082f, - 0.7489846323298677f, - 0.749071358396478f, - 0.7491580716279529f, - 0.7492447720228066f, - 0.7493314595795536f, - 0.7494181342967084f, - 0.749504796172786f, - 0.7495914452063014f, - 0.7496780813957699f, - 0.749764704739707f, - 0.7498513152366284f, - 0.7499379128850503f, - 0.7500244976834886f, - 0.7501110696304596f, - 0.7501976287244801f, - 0.750284174964067f, - 0.7503707083477371f, - 0.7504572288740079f, - 0.7505437365413969f, - 0.7506302313484218f, - 0.7507167132936003f, - 0.7508031823754509f, - 0.7508896385924917f, - 0.7509760819432415f, - 0.751062512426219f, - 0.7511489300399432f, - 0.7512353347829335f, - 0.7513217266537091f, - 0.75140810565079f, - 0.751494471772696f, - 0.7515808250179473f, - 0.7516671653850642f, - 0.7517534928725673f, - 0.7518398074789773f, - 0.7519261092028154f, - 0.7520123980426028f, - 0.752098673996861f, - 0.7521849370641114f, - 0.7522711872428762f, - 0.7523574245316774f, - 0.7524436489290375f, - 0.7525298604334788f, - 0.7526160590435244f, - 0.7527022447576971f, - 0.7527884175745201f, - 0.7528745774925171f, - 0.7529607245102115f, - 0.7530468586261273f, - 0.7531329798387888f, - 0.7532190881467199f, - 0.7533051835484456f, - 0.7533912660424904f, - 0.7534773356273794f, - 0.7535633923016378f, - 0.7536494360637911f, - 0.7537354669123649f, - 0.7538214848458852f, - 0.7539074898628778f, - 0.7539934819618694f, - 0.7540794611413864f, - 0.7541654273999556f, - 0.7542513807361038f, - 0.7543373211483584f, - 0.7544232486352468f, - 0.7545091631952967f, - 0.7545950648270359f, - 0.7546809535289924f, - 0.7547668292996949f, - 0.7548526921376715f, - 0.7549385420414512f, - 0.755024379009563f, - 0.7551102030405359f, - 0.7551960141328996f, - 0.7552818122851837f, - 0.7553675974959178f, - 0.7554533697636322f, - 0.7555391290868573f, - 0.7556248754641235f, - 0.7557106088939616f, - 0.7557963293749026f, - 0.7558820369054777f, - 0.7559677314842183f, - 0.756053413109656f, - 0.7561390817803227f, - 0.7562247374947506f, - 0.7563103802514719f, - 0.7563960100490192f, - 0.7564816268859252f, - 0.7565672307607229f, - 0.7566528216719454f, - 0.7567383996181263f, - 0.7568239645977991f, - 0.7569095166094978f, - 0.7569950556517564f, - 0.7570805817231092f, - 0.7571660948220907f, - 0.757251594947236f, - 0.7573370820970796f, - 0.757422556270157f, - 0.7575080174650034f, - 0.7575934656801546f, - 0.7576789009141465f, - 0.757764323165515f, - 0.7578497324327966f, - 0.7579351287145278f, - 0.7580205120092454f, - 0.7581058823154861f, - 0.7581912396317875f, - 0.758276583956687f, - 0.7583619152887219f, - 0.7584472336264302f, - 0.7585325389683502f, - 0.75861783131302f, - 0.7587031106589781f, - 0.7587883770047635f, - 0.7588736303489151f, - 0.7589588706899718f, - 0.7590440980264735f, - 0.7591293123569597f, - 0.7592145136799701f, - 0.7592997019940451f, - 0.7593848772977247f, - 0.7594700395895496f, - 0.7595551888680605f, - 0.7596403251317985f, - 0.7597254483793048f, - 0.7598105586091206f, - 0.7598956558197879f, - 0.7599807400098484f, - 0.7600658111778442f, - 0.7601508693223177f, - 0.7602359144418114f, - 0.7603209465348683f, - 0.760405965600031f, - 0.7604909716358429f, - 0.7605759646408475f, - 0.7606609446135884f, - 0.7607459115526094f, - 0.7608308654564548f, - 0.760915806323669f, - 0.7610007341527963f, - 0.7610856489423817f, - 0.7611705506909701f, - 0.7612554393971067f, - 0.7613403150593372f, - 0.7614251776762069f, - 0.7615100272462618f, - 0.7615948637680483f, - 0.7616796872401125f, - 0.761764497661001f, - 0.7618492950292607f, - 0.7619340793434385f, - 0.7620188506020816f, - 0.7621036088037377f, - 0.7621883539469544f, - 0.7622730860302794f, - 0.7623578050522613f, - 0.7624425110114479f, - 0.7625272039063881f, - 0.7626118837356307f, - 0.7626965504977247f, - 0.7627812041912193f, - 0.7628658448146641f, - 0.7629504723666087f, - 0.7630350868456032f, - 0.7631196882501975f, - 0.7632042765789422f, - 0.7632888518303877f, - 0.763373414003085f, - 0.7634579630955851f, - 0.7635424991064392f, - 0.763627022034199f, - 0.7637115318774159f, - 0.7637960286346421f, - 0.7638805123044298f, - 0.7639649828853312f, - 0.764049440375899f, - 0.764133884774686f, - 0.7642183160802454f, - 0.7643027342911304f, - 0.7643871394058945f, - 0.7644715314230917f, - 0.7645559103412755f, - 0.7646402761590003f, - 0.7647246288748206f, - 0.7648089684872911f, - 0.7648932949949664f, - 0.7649776083964018f, - 0.7650619086901526f, - 0.7651461958747742f, - 0.7652304699488225f, - 0.7653147309108533f, - 0.7653989787594231f, - 0.7654832134930881f, - 0.7655674351104051f, - 0.765651643609931f, - 0.7657358389902227f, - 0.7658200212498376f, - 0.7659041903873335f, - 0.7659883464012679f, - 0.766072489290199f, - 0.766156619052685f, - 0.7662407356872842f, - 0.7663248391925555f, - 0.7664089295670575f, - 0.7664930068093498f, - 0.7665770709179914f, - 0.7666611218915421f, - 0.7667451597285615f, - 0.7668291844276097f, - 0.766913195987247f, - 0.766997194406034f, - 0.7670811796825312f, - 0.7671651518152995f, - 0.7672491108029003f, - 0.7673330566438948f, - 0.7674169893368448f, - 0.7675009088803121f, - 0.7675848152728585f, - 0.7676687085130465f, - 0.7677525885994386f, - 0.7678364555305974f, - 0.7679203093050861f, - 0.7680041499214677f, - 0.7680879773783057f, - 0.7681717916741636f, - 0.7682555928076056f, - 0.7683393807771954f, - 0.7684231555814975f, - 0.7685069172190767f, - 0.7685906656884972f, - 0.7686744009883244f, - 0.7687581231171233f, - 0.7688418320734596f, - 0.7689255278558986f, - 0.7690092104630065f, - 0.7690928798933494f, - 0.7691765361454935f, - 0.7692601792180056f, - 0.7693438091094522f, - 0.7694274258184006f, - 0.769511029343418f, - 0.7695946196830717f, - 0.7696781968359295f, - 0.7697617608005592f, - 0.7698453115755293f, - 0.7699288491594078f, - 0.7700123735507636f, - 0.7700958847481653f, - 0.7701793827501822f, - 0.7702628675553833f, - 0.7703463391623383f, - 0.7704297975696169f, - 0.7705132427757893f, - 0.7705966747794252f, - 0.7706800935790953f, - 0.7707634991733702f, - 0.7708468915608208f, - 0.7709302707400181f, - 0.7710136367095335f, - 0.7710969894679386f, - 0.7711803290138051f, - 0.771263655345705f, - 0.7713469684622104f, - 0.771430268361894f, - 0.7715135550433284f, - 0.7715968285050864f, - 0.7716800887457412f, - 0.7717633357638662f, - 0.7718465695580349f, - 0.7719297901268212f, - 0.772012997468799f, - 0.7720961915825428f, - 0.7721793724666268f, - 0.772262540119626f, - 0.7723456945401151f, - 0.7724288357266694f, - 0.7725119636778645f, - 0.7725950783922756f, - 0.7726781798684788f, - 0.77276126810505f, - 0.7728443431005658f, - 0.7729274048536025f, - 0.7730104533627369f, - 0.7730934886265461f, - 0.7731765106436073f, - 0.7732595194124977f, - 0.7733425149317952f, - 0.7734254972000777f, - 0.7735084662159232f, - 0.7735914219779101f, - 0.773674364484617f, - 0.7737572937346227f, - 0.7738402097265062f, - 0.7739231124588467f, - 0.7740060019302238f, - 0.7740888781392172f, - 0.7741717410844068f, - 0.7742545907643728f, - 0.7743374271776954f, - 0.7744202503229555f, - 0.7745030601987338f, - 0.7745858568036115f, - 0.7746686401361697f, - 0.77475141019499f, - 0.7748341669786543f, - 0.7749169104857444f, - 0.7749996407148426f, - 0.7750823576645314f, - 0.7751650613333934f, - 0.7752477517200114f, - 0.7753304288229687f, - 0.7754130926408485f, - 0.7754957431722344f, - 0.7755783804157104f, - 0.7756610043698603f, - 0.7757436150332685f, - 0.7758262124045193f, - 0.7759087964821977f, - 0.7759913672648884f, - 0.7760739247511768f, - 0.776156468939648f, - 0.7762389998288878f, - 0.776321517417482f, - 0.7764040217040168f, - 0.7764865126870785f, - 0.7765689903652537f, - 0.7766514547371288f, - 0.7767339058012912f, - 0.7768163435563279f, - 0.7768987680008265f, - 0.7769811791333745f, - 0.7770635769525599f, - 0.7771459614569708f, - 0.7772283326451958f, - 0.777310690515823f, - 0.7773930350674417f, - 0.7774753662986408f, - 0.7775576842080096f, - 0.7776399887941375f, - 0.7777222800556143f, - 0.7778045579910298f, - 0.7778868225989745f, - 0.7779690738780384f, - 0.7780513118268125f, - 0.7781335364438876f, - 0.7782157477278548f, - 0.7782979456773055f, - 0.7783801302908311f, - 0.7784623015670233f, - 0.7785444595044746f, - 0.7786266041017768f, - 0.7787087353575223f, - 0.7787908532703041f, - 0.778872957838715f, - 0.7789550490613482f, - 0.779037126936797f, - 0.7791191914636553f, - 0.7792012426405166f, - 0.7792832804659752f, - 0.7793653049386253f, - 0.7794473160570614f, - 0.7795293138198784f, - 0.7796112982256712f, - 0.779693269273035f, - 0.7797752269605652f, - 0.7798571712868576f, - 0.7799391022505081f, - 0.7800210198501127f, - 0.780102924084268f, - 0.7801848149515703f, - 0.7802666924506166f, - 0.780348556580004f, - 0.7804304073383297f, - 0.7805122447241912f, - 0.7805940687361862f, - 0.7806758793729128f, - 0.780757676632969f, - 0.7808394605149535f, - 0.7809212310174646f, - 0.7810029881391015f, - 0.7810847318784632f, - 0.781166462234149f, - 0.7812481792047585f, - 0.7813298827888916f, - 0.7814115729851481f, - 0.7814932497921285f, - 0.7815749132084333f, - 0.781656563232663f, - 0.7817381998634186f, - 0.7818198230993014f, - 0.7819014329389127f, - 0.7819830293808543f, - 0.7820646124237278f, - 0.7821461820661356f, - 0.7822277383066798f, - 0.782309281143963f, - 0.7823908105765881f, - 0.782472326603158f, - 0.782553829222276f, - 0.7826353184325455f, - 0.7827167942325703f, - 0.7827982566209543f, - 0.7828797055963016f, - 0.7829611411572166f, - 0.7830425633023042f, - 0.7831239720301687f, - 0.7832053673394157f, - 0.7832867492286504f, - 0.7833681176964781f, - 0.7834494727415048f, - 0.7835308143623365f, - 0.7836121425575794f, - 0.7836934573258398f, - 0.7837747586657247f, - 0.7838560465758406f, - 0.7839373210547951f, - 0.7840185821011953f, - 0.784099829713649f, - 0.7841810638907639f, - 0.7842622846311482f, - 0.78434349193341f, - 0.784424685796158f, - 0.7845058662180011f, - 0.784587033197548f, - 0.784668186733408f, - 0.7847493268241906f, - 0.7848304534685056f, - 0.7849115666649628f, - 0.7849926664121722f, - 0.7850737527087446f, - 0.7851548255532901f, - 0.7852358849444198f, - 0.7853169308807448f, - 0.7853979633608764f, - 0.7854789823834262f, - 0.7855599879470057f, - 0.7856409800502271f, - 0.7857219586917025f, - 0.7858029238700444f, - 0.7858838755838654f, - 0.7859648138317786f, - 0.786045738612397f, - 0.7861266499243341f, - 0.7862075477662034f, - 0.7862884321366188f, - 0.7863693030341944f, - 0.7864501604575445f, - 0.7865310044052833f, - 0.786611834876026f, - 0.7866926518683874f, - 0.7867734553809828f, - 0.7868542454124274f, - 0.7869350219613372f, - 0.7870157850263281f, - 0.787096534606016f, - 0.7871772706990176f, - 0.7872579933039491f, - 0.7873387024194277f, - 0.7874193980440705f, - 0.7875000801764944f, - 0.7875807488153173f, - 0.7876614039591567f, - 0.7877420456066309f, - 0.7878226737563578f, - 0.7879032884069561f, - 0.7879838895570445f, - 0.7880644772052418f, - 0.7881450513501671f, - 0.78822561199044f, - 0.7883061591246798f, - 0.7883866927515069f, - 0.7884672128695407f, - 0.7885477194774019f, - 0.7886282125737109f, - 0.7887086921570886f, - 0.7887891582261559f, - 0.7888696107795341f, - 0.7889500498158446f, - 0.7890304753337092f, - 0.7891108873317497f, - 0.7891912858085884f, - 0.7892716707628477f, - 0.78935204219315f, - 0.7894324000981184f, - 0.7895127444763759f, - 0.7895930753265458f, - 0.7896733926472517f, - 0.7897536964371172f, - 0.7898339866947666f, - 0.789914263418824f, - 0.7899945266079139f, - 0.790074776260661f, - 0.7901550123756903f, - 0.790235234951627f, - 0.7903154439870963f, - 0.7903956394807241f, - 0.790475821431136f, - 0.7905559898369584f, - 0.7906361446968174f, - 0.7907162860093397f, - 0.790796413773152f, - 0.7908765279868815f, - 0.7909566286491553f, - 0.7910367157586009f, - 0.7911167893138462f, - 0.791196849313519f, - 0.7912768957562476f, - 0.7913569286406602f, - 0.7914369479653858f, - 0.791516953729053f, - 0.791596945930291f, - 0.7916769245677292f, - 0.7917568896399972f, - 0.7918368411457248f, - 0.7919167790835422f, - 0.7919967034520793f, - 0.792076614249967f, - 0.7921565114758359f, - 0.792236395128317f, - 0.7923162652060415f, - 0.7923961217076407f, - 0.7924759646317465f, - 0.7925557939769908f, - 0.7926356097420056f, - 0.7927154119254235f, - 0.7927952005258769f, - 0.7928749755419987f, - 0.792954736972422f, - 0.7930344848157802f, - 0.7931142190707066f, - 0.7931939397358354f, - 0.7932736468098001f, - 0.7933533402912352f, - 0.7934330201787752f, - 0.7935126864710547f, - 0.7935923391667087f, - 0.7936719782643723f, - 0.7937516037626811f, - 0.7938312156602706f, - 0.7939108139557766f, - 0.7939903986478353f, - 0.794069969735083f, - 0.7941495272161564f, - 0.7942290710896922f, - 0.7943086013543273f, - 0.7943881180086994f, - 0.7944676210514454f, - 0.7945471104812034f, - 0.7946265862966114f, - 0.7947060484963074f, - 0.7947854970789301f, - 0.7948649320431179f, - 0.79494435338751f, - 0.7950237611107452f, - 0.7951031552114631f, - 0.7951825356883034f, - 0.7952619025399057f, - 0.7953412557649101f, - 0.7954205953619569f, - 0.7954999213296866f, - 0.7955792336667402f, - 0.7956585323717585f, - 0.7957378174433829f, - 0.7958170888802548f, - 0.7958963466810158f, - 0.7959755908443079f, - 0.7960548213687734f, - 0.7961340382530546f, - 0.7962132414957941f, - 0.7962924310956347f, - 0.7963716070512197f, - 0.7964507693611923f, - 0.7965299180241963f, - 0.7966090530388752f, - 0.7966881744038732f, - 0.7967672821178347f, - 0.7968463761794039f, - 0.7969254565872258f, - 0.7970045233399453f, - 0.7970835764362076f, - 0.7971626158746583f, - 0.7972416416539427f, - 0.7973206537727071f, - 0.7973996522295975f, - 0.7974786370232603f, - 0.797557608152342f, - 0.7976365656154896f, - 0.7977155094113502f, - 0.797794439538571f, - 0.7978733559957996f, - 0.7979522587816837f, - 0.7980311478948717f, - 0.7981100233340114f, - 0.7981888850977515f, - 0.7982677331847406f, - 0.7983465675936279f, - 0.7984253883230624f, - 0.7985041953716935f, - 0.798582988738171f, - 0.7986617684211448f, - 0.7987405344192648f, - 0.7988192867311816f, - 0.7988980253555458f, - 0.7989767502910082f, - 0.7990554615362198f, - 0.7991341590898319f, - 0.7992128429504961f, - 0.7992915131168641f, - 0.799370169587588f, - 0.7994488123613199f, - 0.7995274414367125f, - 0.7996060568124184f, - 0.7996846584870905f, - 0.799763246459382f, - 0.7998418207279464f, - 0.7999203812914373f, - 0.7999989281485086f, - 0.8000774612978142f, - 0.8001559807380089f, - 0.8002344864677469f, - 0.8003129784856832f, - 0.8003914567904727f, - 0.800469921380771f, - 0.8005483722552333f, - 0.8006268094125156f, - 0.8007052328512739f, - 0.8007836425701643f, - 0.8008620385678433f, - 0.8009404208429677f, - 0.8010187893941942f, - 0.8010971442201803f, - 0.8011754853195833f, - 0.8012538126910607f, - 0.8013321263332704f, - 0.8014104262448708f, - 0.8014887124245199f, - 0.8015669848708765f, - 0.8016452435825994f, - 0.8017234885583475f, - 0.8018017197967805f, - 0.8018799372965575f, - 0.8019581410563383f, - 0.8020363310747831f, - 0.8021145073505521f, - 0.8021926698823056f, - 0.8022708186687045f, - 0.8023489537084096f, - 0.8024270750000823f, - 0.8025051825423837f, - 0.8025832763339755f, - 0.8026613563735199f, - 0.8027394226596789f, - 0.8028174751911146f, - 0.8028955139664897f, - 0.8029735389844671f, - 0.8030515502437099f, - 0.8031295477428814f, - 0.8032075314806448f, - 0.8032855014556644f, - 0.8033634576666039f, - 0.8034414001121275f, - 0.8035193287908998f, - 0.8035972437015856f, - 0.8036751448428496f, - 0.8037530322133574f, - 0.8038309058117739f, - 0.8039087656367649f, - 0.8039866116869965f, - 0.8040644439611346f, - 0.8041422624578458f, - 0.8042200671757965f, - 0.8042978581136537f, - 0.8043756352700844f, - 0.8044533986437559f, - 0.8045311482333357f, - 0.8046088840374916f, - 0.8046866060548918f, - 0.8047643142842044f, - 0.8048420087240977f, - 0.8049196893732407f, - 0.8049973562303022f, - 0.8050750092939516f, - 0.8051526485628582f, - 0.8052302740356917f, - 0.8053078857111219f, - 0.8053854835878191f, - 0.8054630676644536f, - 0.8055406379396961f, - 0.8056181944122174f, - 0.8056957370806885f, - 0.805773265943781f, - 0.805850781000166f, - 0.8059282822485158f, - 0.806005769687502f, - 0.8060832433157973f, - 0.8061607031320739f, - 0.8062381491350047f, - 0.8063155813232625f, - 0.8063929996955208f, - 0.8064704042504528f, - 0.8065477949867325f, - 0.8066251719030334f, - 0.80670253499803f, - 0.8067798842703966f, - 0.8068572197188077f, - 0.8069345413419385f, - 0.8070118491384639f, - 0.8070891431070593f, - 0.8071664232464002f, - 0.8072436895551626f, - 0.8073209420320224f, - 0.8073981806756559f, - 0.80747540548474f, - 0.8075526164579508f, - 0.8076298135939659f, - 0.8077069968914623f, - 0.8077841663491175f, - 0.8078613219656092f, - 0.8079384637396154f, - 0.8080155916698144f, - 0.8080927057548845f, - 0.8081698059935044f, - 0.8082468923843529f, - 0.8083239649261094f, - 0.8084010236174531f, - 0.8084780684570637f, - 0.8085550994436209f, - 0.8086321165758049f, - 0.8087091198522962f, - 0.8087861092717751f, - 0.8088630848329226f, - 0.8089400465344195f, - 0.8090169943749475f, - 0.8090939283531876f, - 0.809170848467822f, - 0.8092477547175324f, - 0.8093246471010013f, - 0.8094015256169109f, - 0.8094783902639441f, - 0.8095552410407837f, - 0.809632077946113f, - 0.8097089009786154f, - 0.8097857101369745f, - 0.8098625054198743f, - 0.8099392868259987f, - 0.8100160543540323f, - 0.8100928080026597f, - 0.8101695477705656f, - 0.8102462736564353f, - 0.810322985658954f, - 0.8103996837768072f, - 0.8104763680086807f, - 0.8105530383532606f, - 0.8106296948092333f, - 0.8107063373752851f, - 0.8107829660501028f, - 0.8108595808323734f, - 0.8109361817207842f, - 0.8110127687140226f, - 0.8110893418107763f, - 0.8111659010097334f, - 0.8112424463095818f, - 0.8113189777090101f, - 0.8113954952067067f, - 0.8114719988013609f, - 0.8115484884916616f, - 0.811624964276298f, - 0.8117014261539602f, - 0.8117778741233376f, - 0.8118543081831205f, - 0.8119307283319991f, - 0.8120071345686641f, - 0.8120835268918063f, - 0.8121599053001165f, - 0.8122362697922862f, - 0.8123126203670068f, - 0.8123889570229701f, - 0.8124652797588682f, - 0.8125415885733931f, - 0.8126178834652374f, - 0.812694164433094f, - 0.8127704314756554f, - 0.8128466845916151f, - 0.8129229237796666f, - 0.8129991490385032f, - 0.8130753603668194f, - 0.8131515577633086f, - 0.8132277412266656f, - 0.8133039107555851f, - 0.8133800663487617f, - 0.8134562080048906f, - 0.8135323357226671f, - 0.8136084495007869f, - 0.8136845493379458f, - 0.8137606352328397f, - 0.8138367071841649f, - 0.8139127651906181f, - 0.8139888092508959f, - 0.8140648393636953f, - 0.8141408555277136f, - 0.8142168577416484f, - 0.8142928460041973f, - 0.8143688203140582f, - 0.8144447806699294f, - 0.8145207270705094f, - 0.8145966595144967f, - 0.8146725780005903f, - 0.8147484825274894f, - 0.8148243730938933f, - 0.8149002496985018f, - 0.8149761123400148f, - 0.8150519610171321f, - 0.8151277957285542f, - 0.8152036164729818f, - 0.8152794232491157f, - 0.8153552160556569f, - 0.8154309948913068f, - 0.8155067597547668f, - 0.815582510644739f, - 0.815658247559925f, - 0.8157339704990273f, - 0.8158096794607486f, - 0.8158853744437913f, - 0.8159610554468585f, - 0.8160367224686536f, - 0.8161123755078797f, - 0.8161880145632409f, - 0.8162636396334408f, - 0.8163392507171839f, - 0.8164148478131745f, - 0.8164904309201172f, - 0.816566000036717f, - 0.8166415551616789f, - 0.8167170962937085f, - 0.8167926234315112f, - 0.816868136573793f, - 0.8169436357192599f, - 0.8170191208666183f, - 0.8170945920145749f, - 0.8171700491618364f, - 0.8172454923071099f, - 0.8173209214491025f, - 0.8173963365865221f, - 0.8174717377180762f, - 0.8175471248424729f, - 0.8176224979584207f, - 0.8176978570646277f, - 0.8177732021598029f, - 0.8178485332426552f, - 0.8179238503118937f, - 0.8179991533662282f, - 0.8180744424043681f, - 0.8181497174250234f, - 0.8182249784269044f, - 0.8183002254087214f, - 0.8183754583691851f, - 0.8184506773070064f, - 0.8185258822208966f, - 0.8186010731095669f, - 0.8186762499717289f, - 0.8187514128060945f, - 0.8188265616113759f, - 0.8189016963862854f, - 0.8189768171295355f, - 0.8190519238398392f, - 0.8191270165159092f, - 0.8192020951564594f, - 0.8192771597602028f, - 0.8193522103258535f, - 0.8194272468521255f, - 0.819502269337733f, - 0.8195772777813903f, - 0.8196522721818125f, - 0.8197272525377145f, - 0.8198022188478113f, - 0.8198771711108187f, - 0.8199521093254523f, - 0.8200270334904279f, - 0.820101943604462f, - 0.8201768396662708f, - 0.8202517216745709f, - 0.8203265896280796f, - 0.8204014435255137f, - 0.8204762833655906f, - 0.8205511091470281f, - 0.820625920868544f, - 0.8207007185288565f, - 0.8207755021266838f, - 0.8208502716607448f, - 0.820925027129758f, - 0.8209997685324427f, - 0.8210744958675181f, - 0.8211492091337039f, - 0.82122390832972f, - 0.8212985934542861f, - 0.8213732645061228f, - 0.8214479214839504f, - 0.8215225643864899f, - 0.821597193212462f, - 0.8216718079605884f, - 0.8217464086295901f, - 0.8218209952181893f, - 0.8218955677251077f, - 0.8219701261490676f, - 0.8220446704887915f, - 0.822119200743002f, - 0.8221937169104222f, - 0.8222682189897751f, - 0.8223427069797842f, - 0.8224171808791731f, - 0.822491640686666f, - 0.8225660864009867f, - 0.8226405180208598f, - 0.8227149355450097f, - 0.8227893389721617f, - 0.8228637283010405f, - 0.8229381035303717f, - 0.8230124646588808f, - 0.8230868116852936f, - 0.8231611446083363f, - 0.8232354634267353f, - 0.8233097681392169f, - 0.823384058744508f, - 0.8234583352413357f, - 0.8235325976284275f, - 0.8236068459045105f, - 0.8236810800683128f, - 0.8237553001185622f, - 0.8238295060539872f, - 0.8239036978733162f, - 0.8239778755752779f, - 0.8240520391586014f, - 0.8241261886220157f, - 0.8242003239642504f, - 0.8242744451840353f, - 0.8243485522801002f, - 0.8244226452511754f, - 0.8244967240959913f, - 0.8245707888132785f, - 0.824644839401768f, - 0.8247188758601911f, - 0.824792898187279f, - 0.8248669063817634f, - 0.8249409004423763f, - 0.8250148803678496f, - 0.8250888461569159f, - 0.8251627978083077f, - 0.8252367353207579f, - 0.8253106586929996f, - 0.825384567923766f, - 0.8254584630117909f, - 0.8255323439558081f, - 0.8256062107545517f, - 0.8256800634067557f, - 0.825753901911155f, - 0.8258277262664844f, - 0.8259015364714786f, - 0.8259753325248732f, - 0.8260491144254036f, - 0.8261228821718056f, - 0.8261966357628152f, - 0.8262703751971686f, - 0.8263441004736024f, - 0.8264178115908533f, - 0.8264915085476582f, - 0.8265651913427544f, - 0.8266388599748795f, - 0.8267125144427709f, - 0.8267861547451668f, - 0.8268597808808053f, - 0.8269333928484247f, - 0.827006990646764f, - 0.8270805742745618f, - 0.8271541437305574f, - 0.8272276990134904f, - 0.8273012401221f, - 0.8273747670551265f, - 0.82744827981131f, - 0.8275217783893907f, - 0.8275952627881092f, - 0.8276687330062066f, - 0.8277421890424237f, - 0.8278156308955021f, - 0.8278890585641832f, - 0.8279624720472091f, - 0.8280358713433216f, - 0.8281092564512632f, - 0.8281826273697764f, - 0.828255984097604f, - 0.8283293266334892f, - 0.8284026549761753f, - 0.8284759691244055f, - 0.8285492690769237f, - 0.828622554832474f, - 0.8286958263898009f, - 0.8287690837476486f, - 0.8288423269047619f, - 0.8289155558598859f, - 0.8289887706117658f, - 0.829061971159147f, - 0.8291351575007754f, - 0.8292083296353968f, - 0.8292814875617577f, - 0.8293546312786041f, - 0.829427760784683f, - 0.8295008760787413f, - 0.8295739771595263f, - 0.8296470640257853f, - 0.8297201366762659f, - 0.8297931951097162f, - 0.8298662393248841f, - 0.8299392693205183f, - 0.8300122850953674f, - 0.8300852866481803f, - 0.8301582739777059f, - 0.8302312470826938f, - 0.8303042059618936f, - 0.8303771506140551f, - 0.8304500810379285f, - 0.8305229972322642f, - 0.8305958991958126f, - 0.8306687869273247f, - 0.8307416604255515f, - 0.8308145196892445f, - 0.8308873647171551f, - 0.8309601955080351f, - 0.8310330120606368f, - 0.8311058143737122f, - 0.8311786024460142f, - 0.8312513762762952f, - 0.8313241358633086f, - 0.8313968812058073f, - 0.8314696123025452f, - 0.8315423291522759f, - 0.8316150317537535f, - 0.8316877201057321f, - 0.8317603942069663f, - 0.831833054056211f, - 0.8319056996522209f, - 0.8319783309937515f, - 0.8320509480795582f, - 0.8321235509083965f, - 0.8321961394790227f, - 0.8322687137901928f, - 0.8323412738406634f, - 0.8324138196291911f, - 0.832486351154533f, - 0.832558868415446f, - 0.8326313714106878f, - 0.832703860139016f, - 0.8327763345991885f, - 0.8328487947899635f, - 0.8329212407100995f, - 0.832993672358355f, - 0.833066089733489f, - 0.8331384928342604f, - 0.833210881659429f, - 0.8332832562077542f, - 0.8333556164779959f, - 0.8334279624689144f, - 0.8335002941792697f, - 0.8335726116078228f, - 0.8336449147533342f, - 0.8337172036145656f, - 0.8337894781902777f, - 0.8338617384792323f, - 0.8339339844801914f, - 0.8340062161919168f, - 0.8340784336131711f, - 0.8341506367427168f, - 0.8342228255793167f, - 0.8342950001217339f, - 0.8343671603687316f, - 0.8344393063190734f, - 0.8345114379715232f, - 0.834583555324845f, - 0.834655658377803f, - 0.8347277471291618f, - 0.8347998215776861f, - 0.8348718817221409f, - 0.8349439275612917f, - 0.8350159590939038f, - 0.835087976318743f, - 0.8351599792345754f, - 0.8352319678401672f, - 0.8353039421342848f, - 0.8353759021156951f, - 0.8354478477831652f, - 0.8355197791354618f, - 0.8355916961713529f, - 0.835663598889606f, - 0.835735487288989f, - 0.8358073613682702f, - 0.8358792211262182f, - 0.8359510665616015f, - 0.836022897673189f, - 0.8360947144597501f, - 0.8361665169200543f, - 0.836238305052871f, - 0.8363100788569704f, - 0.8363818383311223f, - 0.8364535834740975f, - 0.8365253142846665f, - 0.8365970307616002f, - 0.8366687329036697f, - 0.8367404207096467f, - 0.8368120941783026f, - 0.8368837533084093f, - 0.836955398098739f, - 0.837027028548064f, - 0.837098644655157f, - 0.8371702464187911f, - 0.837241833837739f, - 0.8373134069107743f, - 0.8373849656366705f, - 0.8374565100142016f, - 0.8375280400421417f, - 0.837599555719265f, - 0.8376710570443463f, - 0.8377425440161603f, - 0.8378140166334822f, - 0.8378854748950871f, - 0.837956918799751f, - 0.8380283483462494f, - 0.8380997635333584f, - 0.8381711643598543f, - 0.8382425508245138f, - 0.8383139229261137f, - 0.838385280663431f, - 0.838456624035243f, - 0.8385279530403272f, - 0.8385992676774615f, - 0.8386705679454239f, - 0.8387418538429928f, - 0.8388131253689466f, - 0.8388843825220641f, - 0.8389556253011243f, - 0.8390268537049065f, - 0.8390980677321903f, - 0.8391692673817553f, - 0.8392404526523817f, - 0.8393116235428496f, - 0.8393827800519397f, - 0.8394539221784325f, - 0.8395250499211092f, - 0.839596163278751f, - 0.8396672622501393f, - 0.839738346834056f, - 0.8398094170292829f, - 0.8398804728346023f, - 0.8399515142487968f, - 0.840022541270649f, - 0.8400935538989419f, - 0.8401645521324587f, - 0.8402355359699828f, - 0.8403065054102982f, - 0.8403774604521884f, - 0.840448401094438f, - 0.8405193273358312f, - 0.840590239175153f, - 0.840661136611188f, - 0.8407320196427216f, - 0.8408028882685391f, - 0.8408737424874263f, - 0.840944582298169f, - 0.8410154076995536f, - 0.8410862186903664f, - 0.841157015269394f, - 0.8412277974354234f, - 0.8412985651872419f, - 0.8413693185236365f, - 0.8414400574433953f, - 0.8415107819453062f, - 0.8415814920281569f, - 0.8416521876907362f, - 0.8417228689318327f, - 0.8417935357502352f, - 0.841864188144733f, - 0.8419348261141152f, - 0.8420054496571717f, - 0.8420760587726923f, - 0.842146653459467f, - 0.8422172337162864f, - 0.8422877995419411f, - 0.842358350935222f, - 0.84242888789492f, - 0.8424994104198266f, - 0.8425699185087334f, - 0.8426404121604323f, - 0.8427108913737154f, - 0.8427813561473749f, - 0.8428518064802037f, - 0.8429222423709944f, - 0.8429926638185403f, - 0.8430630708216347f, - 0.843133463379071f, - 0.8432038414896432f, - 0.8432742051521455f, - 0.8433445543653719f, - 0.8434148891281174f, - 0.8434852094391766f, - 0.8435555152973445f, - 0.8436258067014166f, - 0.8436960836501886f, - 0.8437663461424559f, - 0.8438365941770148f, - 0.8439068277526618f, - 0.8439770468681932f, - 0.8440472515224061f, - 0.8441174417140972f, - 0.844187617442064f, - 0.844257778705104f, - 0.8443279255020151f, - 0.8443980578315953f, - 0.8444681756926429f, - 0.8445382790839564f, - 0.8446083680043347f, - 0.8446784424525767f, - 0.8447485024274819f, - 0.8448185479278496f, - 0.8448885789524799f, - 0.8449585955001726f, - 0.845028597569728f, - 0.8450985851599467f, - 0.8451685582696294f, - 0.8452385168975773f, - 0.8453084610425915f, - 0.8453783907034736f, - 0.8454483058790254f, - 0.8455182065680489f, - 0.8455880927693462f, - 0.8456579644817201f, - 0.8457278217039733f, - 0.8457976644349087f, - 0.8458674926733296f, - 0.8459373064180395f, - 0.8460071056678422f, - 0.8460768904215418f, - 0.8461466606779423f, - 0.8462164164358484f, - 0.8462861576940648f, - 0.8463558844513966f, - 0.846425596706649f, - 0.8464952944586275f, - 0.8465649777061378f, - 0.8466346464479859f, - 0.846704300682978f, - 0.8467739404099207f, - 0.8468435656276206f, - 0.8469131763348849f, - 0.8469827725305208f, - 0.8470523542133356f, - 0.8471219213821372f, - 0.8471914740357335f, - 0.8472610121729327f, - 0.8473305357925435f, - 0.8474000448933744f, - 0.8474695394742345f, - 0.847539019533933f, - 0.8476084850712794f, - 0.8476779360850831f, - 0.8477473725741547f, - 0.847816794537304f, - 0.8478862019733416f, - 0.8479555948810782f, - 0.8480249732593247f, - 0.8480943371068925f, - 0.8481636864225929f, - 0.8482330212052378f, - 0.8483023414536389f, - 0.8483716471666085f, - 0.8484409383429592f, - 0.8485102149815037f, - 0.8485794770810549f, - 0.8486487246404258f, - 0.8487179576584303f, - 0.8487871761338818f, - 0.8488563800655943f, - 0.8489255694523822f, - 0.8489947442930597f, - 0.8490639045864417f, - 0.8491330503313429f, - 0.8492021815265789f, - 0.8492712981709648f, - 0.8493404002633165f, - 0.8494094878024498f, - 0.8494785607871812f, - 0.8495476192163268f, - 0.8496166630887035f, - 0.8496856924031283f, - 0.8497547071584183f, - 0.8498237073533909f, - 0.8498926929868639f, - 0.8499616640576553f, - 0.850030620564583f, - 0.8500995625064658f, - 0.8501684898821222f, - 0.8502374026903713f, - 0.8503063009300321f, - 0.8503751845999242f, - 0.8504440536988672f, - 0.8505129082256812f, - 0.8505817481791862f, - 0.8506505735582028f, - 0.8507193843615516f, - 0.8507881805880536f, - 0.85085696223653f, - 0.8509257293058021f, - 0.8509944817946918f, - 0.851063219702021f, - 0.8511319430266118f, - 0.8512006517672868f, - 0.8512693459228684f, - 0.8513380254921799f, - 0.8514066904740443f, - 0.851475340867285f, - 0.8515439766707258f, - 0.8516125978831908f, - 0.8516812045035038f, - 0.8517497965304895f, - 0.8518183739629726f, - 0.8518869367997779f, - 0.8519554850397307f, - 0.8520240186816564f, - 0.8520925377243809f, - 0.8521610421667298f, - 0.8522295320075295f, - 0.8522980072456064f, - 0.8523664678797871f, - 0.8524349139088989f, - 0.8525033453317686f, - 0.8525717621472239f, - 0.8526401643540922f, - 0.8527085519512018f, - 0.8527769249373806f, - 0.8528452833114573f, - 0.8529136270722604f, - 0.8529819562186188f, - 0.853050270749362f, - 0.8531185706633193f, - 0.8531868559593203f, - 0.8532551266361951f, - 0.8533233826927737f, - 0.8533916241278867f, - 0.8534598509403649f, - 0.853528063129039f, - 0.8535962606927403f, - 0.8536644436303004f, - 0.8537326119405507f, - 0.8538007656223234f, - 0.8538689046744508f, - 0.853937029095765f, - 0.854005138885099f, - 0.8540732340412859f, - 0.8541413145631583f, - 0.8542093804495503f, - 0.8542774316992952f, - 0.854345468311227f, - 0.8544134902841802f, - 0.854481497616989f, - 0.8545494903084883f, - 0.8546174683575127f, - 0.8546854317628978f, - 0.8547533805234789f, - 0.8548213146380919f, - 0.8548892341055726f, - 0.8549571389247571f, - 0.8550250290944821f, - 0.855092904613584f, - 0.8551607654809001f, - 0.8552286116952675f, - 0.8552964432555238f, - 0.8553642601605066f, - 0.8554320624090538f, - 0.8554998500000037f, - 0.8555676229321949f, - 0.855635381204466f, - 0.8557031248156561f, - 0.8557708537646042f, - 0.8558385680501499f, - 0.855906267671133f, - 0.8559739526263934f, - 0.8560416229147714f, - 0.8561092785351074f, - 0.8561769194862423f, - 0.8562445457670169f, - 0.8563121573762726f, - 0.8563797543128508f, - 0.8564473365755934f, - 0.8565149041633421f, - 0.8565824570749393f, - 0.8566499953092276f, - 0.8567175188650495f, - 0.8567850277412484f, - 0.8568525219366672f, - 0.8569200014501496f, - 0.8569874662805391f, - 0.8570549164266801f, - 0.8571223518874166f, - 0.8571897726615931f, - 0.8572571787480544f, - 0.8573245701456458f, - 0.8573919468532121f, - 0.857459308869599f, - 0.8575266561936523f, - 0.857593988824218f, - 0.8576613067601424f, - 0.8577286100002721f, - 0.8577958985434537f, - 0.8578631723885344f, - 0.8579304315343613f, - 0.8579976759797822f, - 0.8580649057236446f, - 0.8581321207647966f, - 0.8581993211020866f, - 0.8582665067343631f, - 0.8583336776604749f, - 0.858400833879271f, - 0.8584679753896007f, - 0.8585351021903136f, - 0.8586022142802594f, - 0.8586693116582883f, - 0.8587363943232506f, - 0.8588034622739966f, - 0.8588705155093773f, - 0.8589375540282439f, - 0.8590045778294476f, - 0.8590715869118398f, - 0.8591385812742725f, - 0.8592055609155976f, - 0.8592725258346676f, - 0.859339476030335f, - 0.8594064115014527f, - 0.8594733322468736f, - 0.8595402382654513f, - 0.8596071295560391f, - 0.8596740061174911f, - 0.859740867948661f, - 0.8598077150484037f, - 0.8598745474155735f, - 0.859941365049025f, - 0.8600081679476136f, - 0.8600749561101947f, - 0.8601417295356236f, - 0.8602084882227565f, - 0.8602752321704493f, - 0.8603419613775584f, - 0.8604086758429405f, - 0.8604753755654523f, - 0.860542060543951f, - 0.860608730777294f, - 0.860675386264339f, - 0.8607420270039436f, - 0.8608086529949662f, - 0.8608752642362651f, - 0.860941860726699f, - 0.8610084424651265f, - 0.8610750094504069f, - 0.8611415616813999f, - 0.8612080991569648f, - 0.8612746218759616f, - 0.8613411298372504f, - 0.8614076230396918f, - 0.8614741014821461f, - 0.8615405651634744f, - 0.861607014082538f, - 0.8616734482381981f, - 0.8617398676293164f, - 0.861806272254755f, - 0.861872662113376f, - 0.8619390372040416f, - 0.8620053975256148f, - 0.8620717430769583f, - 0.8621380738569354f, - 0.8622043898644096f, - 0.8622706910982445f, - 0.862336977557304f, - 0.8624032492404523f, - 0.8624695061465539f, - 0.8625357482744737f, - 0.8626019756230764f, - 0.8626681881912273f, - 0.8627343859777917f, - 0.8628005689816356f, - 0.8628667372016249f, - 0.8629328906366257f, - 0.8629990292855046f, - 0.8630651531471283f, - 0.8631312622203637f, - 0.8631973565040781f, - 0.8632634359971391f, - 0.8633295006984143f, - 0.8633955506067716f, - 0.8634615857210796f, - 0.8635276060402065f, - 0.8635936115630212f, - 0.8636596022883926f, - 0.8637255782151901f, - 0.8637915393422831f, - 0.8638574856685415f, - 0.8639234171928353f, - 0.8639893339140347f, - 0.8640552358310103f, - 0.8641211229426328f, - 0.8641869952477733f, - 0.8642528527453032f, - 0.8643186954340939f, - 0.8643845233130173f, - 0.8644503363809454f, - 0.8645161346367506f, - 0.8645819180793054f, - 0.8646476867074825f, - 0.8647134405201551f, - 0.8647791795161965f, - 0.8648449036944803f, - 0.8649106130538804f, - 0.8649763075932707f, - 0.8650419873115257f, - 0.86510765220752f, - 0.8651733022801282f, - 0.8652389375282258f, - 0.865304557950688f, - 0.8653701635463902f, - 0.8654357543142085f, - 0.865501330253019f, - 0.865566891361698f, - 0.8656324376391221f, - 0.8656979690841683f, - 0.8657634856957137f, - 0.8658289874726356f, - 0.8658944744138118f, - 0.86595994651812f, - 0.8660254037844386f, - 0.8660908462116458f, - 0.8661562737986204f, - 0.8662216865442413f, - 0.8662870844473874f, - 0.8663524675069385f, - 0.8664178357217741f, - 0.8664831890907742f, - 0.8665485276128189f, - 0.8666138512867886f, - 0.8666791601115642f, - 0.8667444540860265f, - 0.8668097332090567f, - 0.8668749974795362f, - 0.866940246896347f, - 0.8670054814583709f, - 0.86707070116449f, - 0.8671359060135869f, - 0.8672010960045444f, - 0.8672662711362453f, - 0.8673314314075731f, - 0.867396576817411f, - 0.8674617073646429f, - 0.8675268230481528f, - 0.867591923866825f, - 0.867657009819544f, - 0.8677220809051944f, - 0.8677871371226616f, - 0.8678521784708306f, - 0.8679172049485868f, - 0.8679822165548163f, - 0.8680472132884051f, - 0.8681121951482392f, - 0.8681771621332054f, - 0.8682421142421906f, - 0.8683070514740816f, - 0.868371973827766f, - 0.8684368813021311f, - 0.868501773896065f, - 0.8685666516084556f, - 0.8686315144381913f, - 0.8686963623841606f, - 0.8687611954452524f, - 0.8688260136203558f, - 0.8688908169083602f, - 0.8689556053081553f, - 0.8690203788186308f, - 0.8690851374386769f, - 0.8691498811671838f, - 0.8692146100030426f, - 0.8692793239451436f, - 0.8693440229923785f, - 0.8694087071436383f, - 0.8694733763978147f, - 0.8695380307537997f, - 0.8696026702104855f, - 0.8696672947667645f, - 0.8697319044215294f, - 0.869796499173673f, - 0.8698610790220885f, - 0.8699256439656696f, - 0.8699901940033097f, - 0.8700547291339029f, - 0.8701192493563434f, - 0.8701837546695257f, - 0.8702482450723443f, - 0.8703127205636945f, - 0.8703771811424711f, - 0.8704416268075701f, - 0.8705060575578868f, - 0.8705704733923174f, - 0.8706348743097583f, - 0.8706992603091056f, - 0.8707636313892565f, - 0.8708279875491077f, - 0.8708923287875566f, - 0.8709566551035008f, - 0.871020966495838f, - 0.8710852629634662f, - 0.8711495445052839f, - 0.8712138111201894f, - 0.8712780628070816f, - 0.8713422995648596f, - 0.8714065213924227f, - 0.8714707282886704f, - 0.8715349202525028f, - 0.8715990972828196f, - 0.8716632593785215f, - 0.8717274065385089f, - 0.8717915387616827f, - 0.8718556560469439f, - 0.871919758393194f, - 0.8719838457993347f, - 0.8720479182642678f, - 0.8721119757868953f, - 0.8721760183661197f, - 0.8722400460008437f, - 0.8723040586899701f, - 0.8723680564324022f, - 0.8724320392270433f, - 0.8724960070727971f, - 0.8725599599685675f, - 0.8726238979132588f, - 0.8726878209057753f, - 0.8727517289450217f, - 0.8728156220299031f, - 0.8728795001593247f, - 0.8729433633321917f, - 0.8730072115474101f, - 0.8730710448038858f, - 0.873134863100525f, - 0.8731986664362342f, - 0.8732624548099202f, - 0.8733262282204899f, - 0.8733899866668506f, - 0.8734537301479098f, - 0.8735174586625755f, - 0.8735811722097554f, - 0.8736448707883578f, - 0.8737085543972916f, - 0.8737722230354652f, - 0.8738358767017879f, - 0.8738995153951687f, - 0.8739631391145178f, - 0.8740267478587445f, - 0.8740903416267588f, - 0.8741539204174714f, - 0.8742174842297927f, - 0.8742810330626336f, - 0.8743445669149051f, - 0.8744080857855189f, - 0.8744715896733861f, - 0.8745350785774191f, - 0.8745985524965296f, - 0.8746620114296303f, - 0.8747254553756337f, - 0.8747888843334528f, - 0.8748522983020006f, - 0.8749156972801907f, - 0.8749790812669367f, - 0.8750424502611525f, - 0.8751058042617523f, - 0.8751691432676505f, - 0.8752324672777618f, - 0.8752957762910014f, - 0.8753590703062843f, - 0.875422349322526f, - 0.8754856133386423f, - 0.8755488623535492f, - 0.8756120963661629f, - 0.8756753153753997f, - 0.8757385193801767f, - 0.8758017083794106f, - 0.875864882372019f, - 0.8759280413569192f, - 0.875991185333029f, - 0.8760543142992665f, - 0.8761174282545501f, - 0.8761805271977982f, - 0.8762436111279296f, - 0.8763066800438637f, - 0.8763697339445193f, - 0.8764327728288164f, - 0.8764957966956747f, - 0.8765588055440142f, - 0.8766217993727555f, - 0.8766847781808191f, - 0.8767477419671259f, - 0.8768106907305969f, - 0.8768736244701537f, - 0.8769365431847178f, - 0.8769994468732112f, - 0.877062335534556f, - 0.8771252091676746f, - 0.8771880677714897f, - 0.8772509113449243f, - 0.8773137398869014f, - 0.8773765533963447f, - 0.8774393518721777f, - 0.8775021353133245f, - 0.8775649037187093f, - 0.8776276570872565f, - 0.877690395417891f, - 0.8777531187095375f, - 0.8778158269611217f, - 0.8778785201715686f, - 0.8779411983398044f, - 0.878003861464755f, - 0.8780665095453465f, - 0.8781291425805056f, - 0.8781917605691592f, - 0.878254363510234f, - 0.8783169514026578f, - 0.8783795242453578f, - 0.8784420820372619f, - 0.8785046247772983f, - 0.8785671524643954f, - 0.8786296650974816f, - 0.8786921626754859f, - 0.8787546451973374f, - 0.8788171126619654f, - 0.8788795650682996f, - 0.8789420024152699f, - 0.8790044247018064f, - 0.8790668319268397f, - 0.8791292240893002f, - 0.8791916011881189f, - 0.8792539632222272f, - 0.8793163101905562f, - 0.8793786420920379f, - 0.8794409589256041f, - 0.8795032606901871f, - 0.8795655473847193f, - 0.8796278190081335f, - 0.8796900755593626f, - 0.87975231703734f, - 0.8798145434409991f, - 0.8798767547692736f, - 0.8799389510210978f, - 0.8800011321954057f, - 0.880063298291132f, - 0.8801254493072114f, - 0.8801875852425789f, - 0.88024970609617f, - 0.8803118118669202f, - 0.8803739025537654f, - 0.8804359781556415f, - 0.880498038671485f, - 0.8805600841002325f, - 0.8806221144408208f, - 0.8806841296921871f, - 0.8807461298532688f, - 0.8808081149230036f, - 0.8808700849003293f, - 0.8809320397841839f, - 0.8809939795735061f, - 0.8810559042672345f, - 0.8811178138643079f, - 0.8811797083636657f, - 0.8812415877642472f, - 0.8813034520649922f, - 0.8813653012648406f, - 0.8814271353627328f, - 0.881488954357609f, - 0.8815507582484103f, - 0.8816125470340774f, - 0.8816743207135517f, - 0.8817360792857747f, - 0.8817978227496882f, - 0.8818595511042342f, - 0.8819212643483549f, - 0.8819829624809932f, - 0.8820446455010916f, - 0.8821063134075935f, - 0.8821679661994418f, - 0.8822296038755805f, - 0.8822912264349532f, - 0.8823528338765042f, - 0.8824144261991776f, - 0.8824760034019183f, - 0.8825375654836711f, - 0.8825991124433811f, - 0.8826606442799938f, - 0.8827221609924547f, - 0.88278366257971f, - 0.8828451490407057f, - 0.8829066203743882f, - 0.8829680765797043f, - 0.883029517655601f, - 0.8830909436010256f, - 0.8831523544149253f, - 0.8832137500962479f, - 0.8832751306439417f, - 0.8833364960569546f, - 0.8833978463342355f, - 0.8834591814747328f, - 0.8835205014773957f, - 0.8835818063411736f, - 0.8836430960650159f, - 0.8837043706478724f, - 0.8837656300886934f, - 0.883826874386429f, - 0.88388810354003f, - 0.883949317548447f, - 0.8840105164106312f, - 0.8840717001255342f, - 0.8841328686921074f, - 0.8841940221093026f, - 0.8842551603760723f, - 0.8843162834913687f, - 0.8843773914541444f, - 0.8844384842633525f, - 0.8844995619179461f, - 0.8845606244168785f, - 0.8846216717591038f, - 0.8846827039435756f, - 0.8847437209692485f, - 0.8848047228350765f, - 0.8848657095400148f, - 0.8849266810830181f, - 0.8849876374630418f, - 0.8850485786790414f, - 0.8851095047299729f, - 0.8851704156147919f, - 0.8852313113324551f, - 0.8852921918819191f, - 0.8853530572621403f, - 0.8854139074720762f, - 0.8854747425106839f, - 0.8855355623769212f, - 0.8855963670697459f, - 0.885657156588116f, - 0.8857179309309899f, - 0.8857786900973266f, - 0.8858394340860846f, - 0.8859001628962232f, - 0.8859608765267019f, - 0.8860215749764803f, - 0.8860822582445184f, - 0.8861429263297763f, - 0.8862035792312147f, - 0.8862642169477941f, - 0.8863248394784756f, - 0.8863854468222204f, - 0.8864460389779901f, - 0.8865066159447463f, - 0.8865671777214513f, - 0.8866277243070672f, - 0.8866882557005564f, - 0.8867487719008821f, - 0.8868092729070071f, - 0.8868697587178948f, - 0.8869302293325086f, - 0.8869906847498127f, - 0.887051124968771f, - 0.887111549988348f, - 0.8871719598075082f, - 0.8872323544252165f, - 0.8872927338404382f, - 0.8873530980521384f, - 0.8874134470592832f, - 0.8874737808608383f, - 0.8875340994557699f, - 0.8875944028430445f, - 0.8876546910216288f, - 0.8877149639904898f, - 0.8877752217485947f, - 0.887835464294911f, - 0.8878956916284064f, - 0.8879559037480491f, - 0.8880161006528072f, - 0.8880762823416495f, - 0.8881364488135445f, - 0.8881966000674615f, - 0.8882567361023695f, - 0.8883168569172385f, - 0.888376962511038f, - 0.8884370528827384f, - 0.8884971280313099f, - 0.8885571879557229f, - 0.8886172326549487f, - 0.8886772621279584f, - 0.8887372763737231f, - 0.8887972753912148f, - 0.8888572591794053f, - 0.8889172277372669f, - 0.8889771810637719f, - 0.889037119157893f, - 0.8890970420186032f, - 0.8891569496448759f, - 0.8892168420356844f, - 0.8892767191900025f, - 0.8893365811068044f, - 0.8893964277850641f, - 0.8894562592237565f, - 0.889516075421856f, - 0.8895758763783379f, - 0.8896356620921776f, - 0.8896954325623505f, - 0.8897551877878325f, - 0.8898149277675997f, - 0.8898746525006286f, - 0.8899343619858956f, - 0.8899940562223779f, - 0.8900537352090524f, - 0.8901133989448966f, - 0.8901730474288883f, - 0.8902326806600052f, - 0.8902922986372256f, - 0.890351901359528f, - 0.8904114888258913f, - 0.8904710610352942f, - 0.890530617986716f, - 0.8905901596791361f, - 0.8906496861115346f, - 0.8907091972828913f, - 0.8907686931921865f, - 0.8908281738384008f, - 0.8908876392205151f, - 0.8909470893375103f, - 0.8910065241883678f, - 0.8910659437720693f, - 0.8911253480875966f, - 0.8911847371339318f, - 0.8912441109100572f, - 0.8913034694149555f, - 0.8913628126476099f, - 0.8914221406070031f, - 0.8914814532921188f, - 0.8915407507019406f, - 0.8916000328354525f, - 0.8916592996916388f, - 0.8917185512694839f, - 0.8917777875679724f, - 0.8918370085860897f, - 0.8918962143228206f, - 0.8919554047771509f, - 0.8920145799480662f, - 0.8920737398345527f, - 0.8921328844355967f, - 0.8921920137501848f, - 0.8922511277773036f, - 0.8923102265159405f, - 0.8923693099650827f, - 0.8924283781237179f, - 0.8924874309908339f, - 0.892546468565419f, - 0.8926054908464613f, - 0.8926644978329498f, - 0.8927234895238733f, - 0.8927824659182209f, - 0.8928414270149821f, - 0.8929003728131468f, - 0.8929593033117048f, - 0.8930182185096464f, - 0.8930771184059619f, - 0.8931360029996425f, - 0.8931948722896789f, - 0.8932537262750625f, - 0.8933125649547847f, - 0.8933713883278376f, - 0.893430196393213f, - 0.8934889891499034f, - 0.8935477665969013f, - 0.8936065287331997f, - 0.8936652755577916f, - 0.8937240070696704f, - 0.8937827232678297f, - 0.8938414241512637f, - 0.8939001097189663f, - 0.8939587799699321f, - 0.8940174349031557f, - 0.894076074517632f, - 0.8941346988123563f, - 0.8941933077863242f, - 0.8942519014385313f, - 0.8943104797679736f, - 0.8943690427736475f, - 0.8944275904545494f, - 0.8944861228096763f, - 0.894544639838025f, - 0.8946031415385931f, - 0.8946616279103781f, - 0.8947200989523777f, - 0.8947785546635901f, - 0.8948369950430137f, - 0.8948954200896473f, - 0.8949538298024895f, - 0.8950122241805395f, - 0.895070603222797f, - 0.8951289669282615f, - 0.8951873152959329f, - 0.8952456483248116f, - 0.895303966013898f, - 0.8953622683621928f, - 0.895420555368697f, - 0.8954788270324119f, - 0.895537083352339f, - 0.8955953243274801f, - 0.8956535499568372f, - 0.8957117602394129f, - 0.8957699551742094f, - 0.8958281347602298f, - 0.8958862989964771f, - 0.8959444478819547f, - 0.8960025814156662f, - 0.8960606995966157f, - 0.8961188024238071f, - 0.8961768898962448f, - 0.8962349620129337f, - 0.8962930187728786f, - 0.8963510601750848f, - 0.8964090862185577f, - 0.8964670969023032f, - 0.8965250922253272f, - 0.8965830721866358f, - 0.8966410367852358f, - 0.8966989860201339f, - 0.8967569198903371f, - 0.8968148383948527f, - 0.8968727415326884f, - 0.8969306293028518f, - 0.8969885017043513f, - 0.8970463587361952f, - 0.897104200397392f, - 0.8971620266869508f, - 0.8972198376038805f, - 0.8972776331471908f, - 0.8973354133158912f, - 0.8973931781089917f, - 0.8974509275255026f, - 0.8975086615644342f, - 0.8975663802247975f, - 0.8976240835056033f, - 0.8976817714058629f, - 0.8977394439245879f, - 0.8977971010607901f, - 0.8978547428134815f, - 0.8979123691816745f, - 0.8979699801643816f, - 0.8980275757606155f, - 0.8980851559693898f, - 0.8981427207897174f, - 0.8982002702206122f, - 0.898257804261088f, - 0.898315322910159f, - 0.8983728261668397f, - 0.8984303140301446f, - 0.8984877864990889f, - 0.8985452435726876f, - 0.8986026852499563f, - 0.8986601115299109f, - 0.8987175224115672f, - 0.8987749178939415f, - 0.8988322979760505f, - 0.8988896626569108f, - 0.8989470119355396f, - 0.8990043458109542f, - 0.8990616642821723f, - 0.8991189673482116f, - 0.8991762550080903f, - 0.8992335272608268f, - 0.8992907841054398f, - 0.8993480255409481f, - 0.899405251566371f, - 0.8994624621807279f, - 0.8995196573830384f, - 0.8995768371723228f, - 0.899634001547601f, - 0.8996911505078936f, - 0.8997482840522215f, - 0.8998054021796056f, - 0.8998625048890672f, - 0.8999195921796278f, - 0.8999766640503094f, - 0.900033720500134f, - 0.9000907615281238f, - 0.9001477871333017f, - 0.9002047973146905f, - 0.9002617920713133f, - 0.9003187714021935f, - 0.9003757353063547f, - 0.900432683782821f, - 0.9004896168306166f, - 0.9005465344487658f, - 0.9006034366362934f, - 0.9006603233922243f, - 0.9007171947155841f, - 0.9007740506053981f, - 0.900830891060692f, - 0.900887716080492f, - 0.9009445256638244f, - 0.9010013198097157f, - 0.9010580985171928f, - 0.9011148617852828f, - 0.9011716096130131f, - 0.9012283419994113f, - 0.9012850589435053f, - 0.9013417604443235f, - 0.901398446500894f, - 0.9014551171122456f, - 0.9015117722774074f, - 0.9015684119954085f, - 0.9016250362652786f, - 0.9016816450860471f, - 0.9017382384567442f, - 0.9017948163764002f, - 0.9018513788440458f, - 0.9019079258587115f, - 0.9019644574194285f, - 0.9020209735252284f, - 0.9020774741751425f, - 0.9021339593682028f, - 0.9021904291034415f, - 0.9022468833798908f, - 0.9023033221965837f, - 0.9023597455525527f, - 0.9024161534468313f, - 0.902472545878453f, - 0.9025289228464514f, - 0.9025852843498605f, - 0.9026416303877147f, - 0.9026979609590483f, - 0.9027542760628964f, - 0.9028105756982937f, - 0.9028668598642757f, - 0.902923128559878f, - 0.9029793817841365f, - 0.9030356195360872f, - 0.9030918418147665f, - 0.903148048619211f, - 0.9032042399484579f, - 0.9032604158015439f, - 0.9033165761775068f, - 0.9033727210753842f, - 0.9034288504942142f, - 0.9034849644330348f, - 0.9035410628908846f, - 0.9035971458668025f, - 0.9036532133598274f, - 0.9037092653689985f, - 0.9037653018933556f, - 0.9038213229319384f, - 0.903877328483787f, - 0.9039333185479418f, - 0.9039892931234433f, - 0.9040452522093325f, - 0.9041011958046506f, - 0.9041571239084389f, - 0.9042130365197393f, - 0.9042689336375934f, - 0.9043248152610438f, - 0.9043806813891327f, - 0.904436532020903f, - 0.9044923671553977f, - 0.9045481867916599f, - 0.9046039909287334f, - 0.9046597795656619f, - 0.9047155527014895f, - 0.9047713103352605f, - 0.9048270524660196f, - 0.9048827790928115f, - 0.9049384902146814f, - 0.9049941858306748f, - 0.9050498659398374f, - 0.905105530541215f, - 0.9051611796338539f, - 0.9052168132168005f, - 0.9052724312891015f, - 0.905328033849804f, - 0.9053836208979552f, - 0.9054391924326027f, - 0.9054947484527942f, - 0.9055502889575779f, - 0.905605813946002f, - 0.9056613234171151f, - 0.9057168173699662f, - 0.9057722958036043f, - 0.9058277587170788f, - 0.9058832061094394f, - 0.905938637979736f, - 0.9059940543270186f, - 0.906049455150338f, - 0.9061048404487447f, - 0.9061602102212899f, - 0.9062155644670244f, - 0.9062709031850003f, - 0.9063262263742691f, - 0.9063815340338829f, - 0.9064368261628938f, - 0.9064921027603547f, - 0.9065473638253183f, - 0.9066026093568377f, - 0.9066578393539664f, - 0.9067130538157578f, - 0.9067682527412662f, - 0.9068234361295453f, - 0.90687860397965f, - 0.9069337562906348f, - 0.9069888930615547f, - 0.907044014291465f, - 0.907099119979421f, - 0.9071542101244788f, - 0.9072092847256943f, - 0.9072643437821237f, - 0.9073193872928236f, - 0.907374415256851f, - 0.907429427673263f, - 0.9074844245411169f, - 0.9075394058594702f, - 0.9075943716273812f, - 0.9076493218439077f, - 0.9077042565081084f, - 0.9077591756190417f, - 0.907814079175767f, - 0.9078689671773431f, - 0.9079238396228299f, - 0.9079786965112868f, - 0.9080335378417741f, - 0.9080883636133521f, - 0.9081431738250813f, - 0.9081979684760225f, - 0.908252747565237f, - 0.9083075110917859f, - 0.9083622590547311f, - 0.9084169914531343f, - 0.9084717082860578f, - 0.908526409552564f, - 0.9085810952517157f, - 0.9086357653825757f, - 0.9086904199442074f, - 0.9087450589356743f, - 0.90879968235604f, - 0.9088542902043688f, - 0.9089088824797248f, - 0.9089634591811726f, - 0.9090180203077772f, - 0.9090725658586036f, - 0.9091270958327171f, - 0.9091816102291834f, - 0.9092361090470685f, - 0.9092905922854385f, - 0.9093450599433599f, - 0.9093995120198993f, - 0.9094539485141238f, - 0.9095083694251005f, - 0.9095627747518971f, - 0.9096171644935812f, - 0.909671538649221f, - 0.9097258972178848f, - 0.909780240198641f, - 0.9098345675905586f, - 0.9098888793927067f, - 0.9099431756041547f, - 0.9099974562239722f, - 0.9100517212512291f, - 0.9101059706849957f, - 0.9101602045243422f, - 0.9102144227683396f, - 0.9102686254160588f, - 0.9103228124665711f, - 0.9103769839189478f, - 0.9104311397722609f, - 0.9104852800255823f, - 0.9105394046779844f, - 0.9105935137285399f, - 0.9106476071763215f, - 0.9107016850204024f, - 0.9107557472598559f, - 0.9108097938937557f, - 0.9108638249211758f, - 0.9109178403411904f, - 0.9109718401528738f, - 0.9110258243553009f, - 0.9110797929475465f, - 0.9111337459286861f, - 0.9111876832977951f, - 0.9112416050539494f, - 0.9112955111962248f, - 0.9113494017236979f, - 0.9114032766354452f, - 0.9114571359305436f, - 0.9115109796080703f, - 0.9115648076671025f, - 0.9116186201067179f, - 0.9116724169259948f, - 0.911726198124011f, - 0.911779963699845f, - 0.9118337136525758f, - 0.9118874479812822f, - 0.9119411666850435f, - 0.9119948697629394f, - 0.9120485572140494f, - 0.9121022290374539f, - 0.912155885232233f, - 0.9122095257974676f, - 0.9122631507322384f, - 0.9123167600356266f, - 0.9123703537067135f, - 0.9124239317445809f, - 0.9124774941483107f, - 0.9125310409169852f, - 0.9125845720496868f, - 0.9126380875454984f, - 0.9126915874035028f, - 0.9127450716227835f, - 0.9127985402024239f, - 0.912851993141508f, - 0.9129054304391199f, - 0.9129588520943438f, - 0.9130122581062644f, - 0.9130656484739665f, - 0.9131190231965356f, - 0.9131723822730567f, - 0.9132257257026158f, - 0.9132790534842989f, - 0.9133323656171922f, - 0.9133856621003821f, - 0.9134389429329554f, - 0.9134922081139992f, - 0.9135454576426009f, - 0.9135986915178479f, - 0.9136519097388281f, - 0.9137051123046298f, - 0.9137582992143412f, - 0.9138114704670509f, - 0.9138646260618479f, - 0.9139177659978216f, - 0.9139708902740612f, - 0.9140239988896565f, - 0.9140770918436976f, - 0.9141301691352746f, - 0.9141832307634781f, - 0.9142362767273989f, - 0.9142893070261281f, - 0.9143423216587571f, - 0.9143953206243773f, - 0.9144483039220809f, - 0.9145012715509597f, - 0.9145542235101064f, - 0.9146071597986135f, - 0.914660080415574f, - 0.9147129853600812f, - 0.9147658746312284f, - 0.9148187482281096f, - 0.9148716061498187f, - 0.91492444839545f, - 0.9149772749640979f, - 0.9150300858548575f, - 0.9150828810668237f, - 0.915135660599092f, - 0.915188424450758f, - 0.9152411726209175f, - 0.9152939051086669f, - 0.9153466219131025f, - 0.9153993230333209f, - 0.9154520084684193f, - 0.9155046782174949f, - 0.9155573322796452f, - 0.9156099706539679f, - 0.915662593339561f, - 0.9157152003355231f, - 0.9157677916409526f, - 0.9158203672549483f, - 0.9158729271766095f, - 0.9159254714050356f, - 0.915977999939326f, - 0.9160305127785809f, - 0.9160830099219006f, - 0.9161354913683853f, - 0.916187957117136f, - 0.9162404071672534f, - 0.916292841517839f, - 0.9163452601679942f, - 0.9163976631168211f, - 0.9164500503634215f, - 0.916502421906898f, - 0.916554777746353f, - 0.9166071178808896f, - 0.9166594423096107f, - 0.9167117510316201f, - 0.9167640440460211f, - 0.916816321351918f, - 0.9168685829484149f, - 0.9169208288346163f, - 0.9169730590096271f, - 0.9170252734725522f, - 0.917077472222497f, - 0.9171296552585672f, - 0.9171818225798684f, - 0.9172339741855068f, - 0.9172861100745889f, - 0.9173382302462213f, - 0.9173903346995111f, - 0.9174424234335653f, - 0.9174944964474914f, - 0.9175465537403971f, - 0.9175985953113905f, - 0.91765062115958f, - 0.9177026312840739f, - 0.9177546256839811f, - 0.9178066043584109f, - 0.9178585673064723f, - 0.9179105145272752f, - 0.9179624460199294f, - 0.9180143617835451f, - 0.9180662618172328f, - 0.9181181461201031f, - 0.918170014691267f, - 0.9182218675298357f, - 0.9182737046349209f, - 0.9183255260056341f, - 0.9183773316410876f, - 0.9184291215403936f, - 0.9184808957026647f, - 0.9185326541270138f, - 0.918584396812554f, - 0.9186361237583988f, - 0.9186878349636618f, - 0.9187395304274569f, - 0.9187912101488983f, - 0.9188428741271006f, - 0.9188945223611784f, - 0.9189461548502469f, - 0.9189977715934213f, - 0.9190493725898171f, - 0.9191009578385503f, - 0.9191525273387368f, - 0.9192040810894931f, - 0.9192556190899358f, - 0.9193071413391819f, - 0.9193586478363485f, - 0.9194101385805529f, - 0.919461613570913f, - 0.9195130728065468f, - 0.9195645162865724f, - 0.9196159440101086f, - 0.9196673559762739f, - 0.9197187521841876f, - 0.919770132632969f, - 0.9198214973217376f, - 0.9198728462496134f, - 0.9199241794157164f, - 0.9199754968191671f, - 0.9200267984590863f, - 0.9200780843345948f, - 0.920129354444814f, - 0.9201806087888652f, - 0.9202318473658703f, - 0.9202830701749513f, - 0.9203342772152305f, - 0.9203854684858305f, - 0.9204366439858741f, - 0.9204878037144846f, - 0.9205389476707853f, - 0.9205900758538996f, - 0.9206411882629518f, - 0.920692284897066f, - 0.9207433657553665f, - 0.9207944308369783f, - 0.9208454801410263f, - 0.9208965136666357f, - 0.9209475314129321f, - 0.9209985333790414f, - 0.9210495195640896f, - 0.9211004899672032f, - 0.9211514445875087f, - 0.9212023834241331f, - 0.9212533064762035f, - 0.9213042137428473f, - 0.9213551052231924f, - 0.9214059809163667f, - 0.9214568408214984f, - 0.9215076849377161f, - 0.9215585132641485f, - 0.9216093257999248f, - 0.9216601225441744f, - 0.9217109034960267f, - 0.9217616686546117f, - 0.9218124180190594f, - 0.9218631515885005f, - 0.9219138693620655f, - 0.9219645713388854f, - 0.9220152575180915f, - 0.9220659278988153f, - 0.9221165824801885f, - 0.9221672212613431f, - 0.9222178442414115f, - 0.9222684514195263f, - 0.9223190427948204f, - 0.9223696183664268f, - 0.922420178133479f, - 0.9224707220951107f, - 0.9225212502504557f, - 0.9225717625986485f, - 0.9226222591388232f, - 0.9226727398701148f, - 0.9227232047916583f, - 0.9227736539025889f, - 0.9228240872020423f, - 0.9228745046891543f, - 0.9229249063630609f, - 0.9229752922228988f, - 0.9230256622678042f, - 0.9230760164969143f, - 0.9231263549093662f, - 0.9231766775042974f, - 0.9232269842808457f, - 0.923277275238149f, - 0.9233275503753456f, - 0.923377809691574f, - 0.9234280531859732f, - 0.9234782808576822f, - 0.9235284927058404f, - 0.9235786887295874f, - 0.923628868928063f, - 0.9236790333004073f, - 0.9237291818457611f, - 0.9237793145632649f, - 0.9238294314520596f, - 0.9238795325112867f, - 0.9239296177400876f, - 0.9239796871376041f, - 0.9240297407029783f, - 0.9240797784353525f, - 0.9241298003338693f, - 0.9241798063976717f, - 0.9242297966259029f, - 0.9242797710177061f, - 0.924329729572225f, - 0.924379672288604f, - 0.9244295991659868f, - 0.9244795102035182f, - 0.924529405400343f, - 0.9245792847556061f, - 0.9246291482684531f, - 0.9246789959380294f, - 0.9247288277634809f, - 0.9247786437439538f, - 0.9248284438785945f, - 0.9248782281665496f, - 0.9249279966069661f, - 0.9249777491989913f, - 0.9250274859417728f, - 0.925077206834458f, - 0.9251269118761953f, - 0.9251766010661329f, - 0.9252262744034193f, - 0.9252759318872036f, - 0.9253255735166347f, - 0.9253751992908621f, - 0.9254248092090354f, - 0.9254744032703046f, - 0.92552398147382f, - 0.925573543818732f, - 0.9256230903041914f, - 0.9256726209293492f, - 0.9257221356933567f, - 0.9257716345953655f, - 0.9258211176345275f, - 0.9258705848099947f, - 0.9259200361209196f, - 0.9259694715664548f, - 0.9260188911457534f, - 0.9260682948579684f, - 0.9261176827022533f, - 0.926167054677762f, - 0.9262164107836482f, - 0.9262657510190666f, - 0.9263150753831717f, - 0.9263643838751181f, - 0.926413676494061f, - 0.926462953239156f, - 0.9265122141095584f, - 0.9265614591044244f, - 0.9266106882229103f, - 0.9266599014641722f, - 0.9267090988273671f, - 0.9267582803116519f, - 0.9268074459161839f, - 0.9268565956401208f, - 0.9269057294826203f, - 0.9269548474428405f, - 0.9270039495199399f, - 0.927053035713077f, - 0.9271021060214109f, - 0.9271511604441005f, - 0.9272001989803056f, - 0.9272492216291858f, - 0.927298228389901f, - 0.9273472192616116f, - 0.9273961942434781f, - 0.9274451533346614f, - 0.9274940965343225f, - 0.9275430238416228f, - 0.927591935255724f, - 0.9276408307757881f, - 0.9276897104009771f, - 0.9277385741304536f, - 0.9277874219633802f, - 0.92783625389892f, - 0.9278850699362362f, - 0.9279338700744925f, - 0.9279826543128525f, - 0.9280314226504806f, - 0.9280801750865408f, - 0.9281289116201981f, - 0.9281776322506171f, - 0.9282263369769632f, - 0.9282750257984018f, - 0.9283236987140986f, - 0.9283723557232197f, - 0.9284209968249313f, - 0.9284696220183998f, - 0.9285182313027922f, - 0.9285668246772757f, - 0.9286154021410173f, - 0.928663963693185f, - 0.9287125093329466f, - 0.92876103905947f, - 0.9288095528719241f, - 0.9288580507694775f, - 0.9289065327512991f, - 0.9289549988165583f, - 0.9290034489644244f, - 0.9290518831940675f, - 0.9291003015046575f, - 0.9291487038953649f, - 0.9291970903653602f, - 0.9292454609138144f, - 0.9292938155398988f, - 0.9293421542427845f, - 0.9293904770216437f, - 0.929438783875648f, - 0.92948707480397f, - 0.929535349805782f, - 0.9295836088802568f, - 0.9296318520265677f, - 0.929680079243888f, - 0.9297282905313912f, - 0.9297764858882513f, - 0.9298246653136426f, - 0.9298728288067395f, - 0.9299209763667167f, - 0.929969107992749f, - 0.9300172236840121f, - 0.9300653234396812f, - 0.9301134072589323f, - 0.9301614751409415f, - 0.930209527084885f, - 0.9302575630899397f, - 0.9303055831552822f, - 0.93035358728009f, - 0.9304015754635404f, - 0.9304495477048111f, - 0.9304975040030803f, - 0.9305454443575261f, - 0.930593368767327f, - 0.930641277231662f, - 0.9306891697497102f, - 0.9307370463206508f, - 0.9307849069436637f, - 0.9308327516179286f, - 0.9308805803426258f, - 0.9309283931169356f, - 0.9309761899400391f, - 0.931023970811117f, - 0.9310717357293506f, - 0.9311194846939218f, - 0.931167217704012f, - 0.9312149347588035f, - 0.9312626358574787f, - 0.9313103209992203f, - 0.9313579901832111f, - 0.9314056434086343f, - 0.9314532806746735f, - 0.9315009019805123f, - 0.9315485073253348f, - 0.9315960967083253f, - 0.9316436701286684f, - 0.9316912275855489f, - 0.931738769078152f, - 0.9317862946056629f, - 0.9318338041672674f, - 0.9318812977621515f, - 0.9319287753895011f, - 0.9319762370485031f, - 0.932023682738344f, - 0.932071112458211f, - 0.9321185262072912f, - 0.9321659239847722f, - 0.932213305789842f, - 0.9322606716216887f, - 0.9323080214795005f, - 0.9323553553624664f, - 0.9324026732697751f, - 0.932449975200616f, - 0.9324972611541784f, - 0.9325445311296522f, - 0.9325917851262273f, - 0.9326390231430941f, - 0.9326862451794433f, - 0.9327334512344656f, - 0.9327806413073523f, - 0.9328278153972945f, - 0.9328749735034843f, - 0.9329221156251134f, - 0.932969241761374f, - 0.9330163519114588f, - 0.9330634460745605f, - 0.9331105242498721f, - 0.9331575864365869f, - 0.9332046326338985f, - 0.933251662841001f, - 0.9332986770570884f, - 0.9333456752813549f, - 0.9333926575129956f, - 0.9334396237512051f, - 0.933486573995179f, - 0.9335335082441126f, - 0.9335804264972017f, - 0.9336273287536425f, - 0.9336742150126313f, - 0.9337210852733645f, - 0.9337679395350391f, - 0.9338147777968525f, - 0.9338616000580019f, - 0.9339084063176851f, - 0.9339551965751f, - 0.9340019708294449f, - 0.9340487290799184f, - 0.9340954713257194f, - 0.9341421975660468f, - 0.9341889078001f, - 0.9342356020270786f, - 0.9342822802461825f, - 0.934328942456612f, - 0.9343755886575675f, - 0.9344222188482497f, - 0.9344688330278597f, - 0.9345154311955987f, - 0.9345620133506681f, - 0.93460857949227f, - 0.9346551296196064f, - 0.9347016637318797f, - 0.9347481818282924f, - 0.9347946839080477f, - 0.9348411699703485f, - 0.9348876400143983f, - 0.9349340940394011f, - 0.9349805320445608f, - 0.9350269540290816f, - 0.9350733599921682f, - 0.9351197499330254f, - 0.9351661238508583f, - 0.9352124817448724f, - 0.9352588236142733f, - 0.9353051494582668f, - 0.9353514592760592f, - 0.9353977530668571f, - 0.9354440308298673f, - 0.9354902925642967f, - 0.9355365382693527f, - 0.9355827679442428f, - 0.935628981588175f, - 0.9356751792003573f, - 0.9357213607799982f, - 0.9357675263263063f, - 0.9358136758384908f, - 0.9358598093157607f, - 0.9359059267573256f, - 0.9359520281623954f, - 0.9359981135301799f, - 0.9360441828598897f, - 0.9360902361507353f, - 0.9361362734019276f, - 0.9361822946126777f, - 0.9362282997821971f, - 0.9362742889096975f, - 0.9363202619943911f, - 0.9363662190354898f, - 0.9364121600322064f, - 0.9364580849837536f, - 0.9365039938893445f, - 0.9365498867481924f, - 0.936595763559511f, - 0.9366416243225143f, - 0.9366874690364163f, - 0.9367332977004317f, - 0.936779110313775f, - 0.9368249068756614f, - 0.9368706873853062f, - 0.9369164518419247f, - 0.9369622002447331f, - 0.9370079325929472f, - 0.9370536488857836f, - 0.9370993491224588f, - 0.9371450333021899f, - 0.9371907014241939f, - 0.9372363534876885f, - 0.9372819894918915f, - 0.9373276094360207f, - 0.9373732133192946f, - 0.9374188011409317f, - 0.9374643729001508f, - 0.9375099285961714f, - 0.9375554682282125f, - 0.9376009917954939f, - 0.9376464992972356f, - 0.937691990732658f, - 0.9377374661009813f, - 0.9377829254014265f, - 0.9378283686332147f, - 0.9378737957955671f, - 0.9379192068877054f, - 0.9379646019088514f, - 0.9380099808582274f, - 0.938055343735056f, - 0.9381006905385595f, - 0.9381460212679611f, - 0.9381913359224842f, - 0.9382366345013521f, - 0.9382819170037887f, - 0.9383271834290182f, - 0.938372433776265f, - 0.9384176680447536f, - 0.938462886233709f, - 0.9385080883423563f, - 0.9385532743699211f, - 0.9385984443156292f, - 0.9386435981787065f, - 0.9386887359583792f, - 0.9387338576538741f, - 0.9387789632644179f, - 0.9388240527892379f, - 0.9388691262275612f, - 0.9389141835786158f, - 0.9389592248416295f, - 0.9390042500158305f, - 0.9390492591004475f, - 0.9390942520947091f, - 0.9391392289978444f, - 0.9391841898090827f, - 0.9392291345276536f, - 0.939274063152787f, - 0.9393189756837131f, - 0.9393638721196624f, - 0.9394087524598655f, - 0.9394536167035534f, - 0.9394984648499574f, - 0.9395432968983091f, - 0.93958811284784f, - 0.9396329126977826f, - 0.9396776964473692f, - 0.9397224640958322f, - 0.9397672156424046f, - 0.9398119510863197f, - 0.9398566704268109f, - 0.9399013736631119f, - 0.9399460607944569f, - 0.9399907318200801f, - 0.9400353867392159f, - 0.9400800255510995f, - 0.9401246482549658f, - 0.9401692548500502f, - 0.9402138453355885f, - 0.9402584197108165f, - 0.9403029779749704f, - 0.940347520127287f, - 0.9403920461670027f, - 0.9404365560933549f, - 0.9404810499055807f, - 0.9405255276029177f, - 0.940569989184604f, - 0.9406144346498777f, - 0.940658863997977f, - 0.940703277228141f, - 0.9407476743396084f, - 0.9407920553316185f, - 0.9408364202034109f, - 0.9408807689542255f, - 0.9409251015833022f, - 0.9409694180898815f, - 0.9410137184732041f, - 0.9410580027325108f, - 0.941102270867043f, - 0.941146522876042f, - 0.9411907587587495f, - 0.9412349785144076f, - 0.9412791821422588f, - 0.9413233696415454f, - 0.9413675410115103f, - 0.9414116962513969f, - 0.9414558353604482f, - 0.9414999583379082f, - 0.9415440651830208f, - 0.9415881558950302f, - 0.9416322304731809f, - 0.9416762889167177f, - 0.9417203312248857f, - 0.9417643573969303f, - 0.9418083674320971f, - 0.9418523613296318f, - 0.9418963390887809f, - 0.9419403007087906f, - 0.9419842461889077f, - 0.9420281755283794f, - 0.9420720887264526f, - 0.9421159857823752f, - 0.9421598666953949f, - 0.9422037314647598f, - 0.9422475800897183f, - 0.9422914125695191f, - 0.942335228903411f, - 0.9423790290906435f, - 0.9424228131304659f, - 0.942466581022128f, - 0.9425103327648798f, - 0.9425540683579717f, - 0.9425977878006543f, - 0.9426414910921784f, - 0.9426851782317952f, - 0.9427288492187562f, - 0.942772504052313f, - 0.9428161427317178f, - 0.9428597652562225f, - 0.9429033716250801f, - 0.942946961837543f, - 0.9429905358928644f, - 0.9430340937902979f, - 0.9430776355290968f, - 0.9431211611085153f, - 0.9431646705278075f, - 0.9432081637862278f, - 0.9432516408830312f, - 0.9432951018174723f, - 0.9433385465888069f, - 0.9433819751962903f, - 0.9434253876391784f, - 0.9434687839167274f, - 0.9435121640281936f, - 0.9435555279728338f, - 0.943598875749905f, - 0.9436422073586643f, - 0.9436855227983694f, - 0.9437288220682778f, - 0.943772105167648f, - 0.9438153720957381f, - 0.9438586228518068f, - 0.9439018574351129f, - 0.9439450758449158f, - 0.9439882780804748f, - 0.9440314641410498f, - 0.9440746340259005f, - 0.9441177877342875f, - 0.9441609252654712f, - 0.9442040466187126f, - 0.9442471517932728f, - 0.9442902407884131f, - 0.9443333136033951f, - 0.944376370237481f, - 0.944419410689933f, - 0.9444624349600135f, - 0.9445054430469854f, - 0.9445484349501115f, - 0.9445914106686555f, - 0.9446343702018808f, - 0.9446773135490514f, - 0.9447202407094314f, - 0.9447631516822854f, - 0.9448060464668779f, - 0.9448489250624742f, - 0.9448917874683394f, - 0.944934633683739f, - 0.9449774637079391f, - 0.9450202775402056f, - 0.9450630751798048f, - 0.9451058566260037f, - 0.945148621878069f, - 0.945191370935268f, - 0.9452341037968682f, - 0.9452768204621375f, - 0.9453195209303438f, - 0.9453622052007554f, - 0.9454048732726411f, - 0.9454475251452698f, - 0.9454901608179104f, - 0.9455327802898326f, - 0.9455753835603061f, - 0.9456179706286009f, - 0.945660541493987f, - 0.9457030961557354f, - 0.9457456346131168f, - 0.9457881568654022f, - 0.945830662911863f, - 0.9458731527517709f, - 0.9459156263843979f, - 0.9459580838090162f, - 0.9460005250248984f, - 0.946042950031317f, - 0.9460853588275453f, - 0.9461277514128567f, - 0.9461701277865244f, - 0.9462124879478228f, - 0.9462548318960258f, - 0.9462971596304078f, - 0.9463394711502437f, - 0.9463817664548085f, - 0.9464240455433773f, - 0.9464663084152258f, - 0.9465085550696299f, - 0.9465507855058656f, - 0.9465929997232092f, - 0.9466351977209375f, - 0.9466773794983274f, - 0.9467195450546563f, - 0.9467616943892014f, - 0.9468038275012408f, - 0.9468459443900523f, - 0.9468880450549144f, - 0.9469301294951056f, - 0.9469721977099049f, - 0.9470142496985914f, - 0.9470562854604447f, - 0.9470983049947443f, - 0.9471403083007703f, - 0.9471822953778031f, - 0.947224266225123f, - 0.9472662208420111f, - 0.9473081592277484f, - 0.9473500813816162f, - 0.9473919873028965f, - 0.947433876990871f, - 0.9474757504448218f, - 0.9475176076640317f, - 0.9475594486477835f, - 0.94760127339536f, - 0.9476430819060447f, - 0.9476848741791213f, - 0.9477266502138736f, - 0.9477684100095857f, - 0.9478101535655421f, - 0.9478518808810277f, - 0.9478935919553273f, - 0.9479352867877264f, - 0.9479769653775104f, - 0.9480186277239652f, - 0.9480602738263769f, - 0.948101903684032f, - 0.9481435172962172f, - 0.9481851146622192f, - 0.9482266957813255f, - 0.9482682606528235f, - 0.9483098092760011f, - 0.9483513416501462f, - 0.9483928577745474f, - 0.9484343576484932f, - 0.9484758412712724f, - 0.9485173086421743f, - 0.9485587597604885f, - 0.9486001946255046f, - 0.9486416132365126f, - 0.9486830155928029f, - 0.9487244016936659f, - 0.9487657715383927f, - 0.9488071251262743f, - 0.948848462456602f, - 0.9488897835286678f, - 0.9489310883417635f, - 0.9489723768951813f, - 0.9490136491882138f, - 0.949054905220154f, - 0.9490961449902946f, - 0.9491373684979292f, - 0.9491785757423513f, - 0.9492197667228551f, - 0.9492609414387346f, - 0.9493020998892844f, - 0.949343242073799f, - 0.9493843679915738f, - 0.9494254776419038f, - 0.9494665710240848f, - 0.9495076481374126f, - 0.9495487089811835f, - 0.9495897535546937f, - 0.9496307818572399f, - 0.9496717938881194f, - 0.9497127896466291f, - 0.9497537691320669f, - 0.9497947323437304f, - 0.9498356792809176f, - 0.9498766099429272f, - 0.9499175243290576f, - 0.949958422438608f, - 0.9499993042708774f, - 0.9500401698251654f, - 0.9500810191007717f, - 0.9501218520969964f, - 0.9501626688131399f, - 0.9502034692485029f, - 0.9502442534023859f, - 0.9502850212740905f, - 0.950325772862918f, - 0.95036650816817f, - 0.9504072271891487f, - 0.9504479299251564f, - 0.9504886163754955f, - 0.950529286539469f, - 0.95056994041638f, - 0.9506105780055318f, - 0.9506511993062282f, - 0.9506918043177731f, - 0.9507323930394708f, - 0.9507729654706257f, - 0.9508135216105429f, - 0.9508540614585271f, - 0.9508945850138839f, - 0.9509350922759189f, - 0.950975583243938f, - 0.9510160579172474f, - 0.9510565162951535f, - 0.9510969583769633f, - 0.9511373841619836f, - 0.9511777936495217f, - 0.9512181868388853f, - 0.9512585637293822f, - 0.9512989243203207f, - 0.9513392686110091f, - 0.9513795966007562f, - 0.9514199082888709f, - 0.9514602036746626f, - 0.9515004827574406f, - 0.951540745536515f, - 0.9515809920111957f, - 0.9516212221807933f, - 0.9516614360446183f, - 0.9517016336019816f, - 0.9517418148521947f, - 0.9517819797945687f, - 0.9518221284284157f, - 0.9518622607530478f, - 0.9519023767677771f, - 0.9519424764719163f, - 0.9519825598647785f, - 0.9520226269456766f, - 0.9520626777139243f, - 0.9521027121688351f, - 0.9521427303097232f, - 0.9521827321359029f, - 0.9522227176466886f, - 0.9522626868413954f, - 0.9523026397193383f, - 0.9523425762798328f, - 0.9523824965221944f, - 0.9524224004457393f, - 0.9524622880497836f, - 0.9525021593336441f, - 0.9525420142966373f, - 0.9525818529380805f, - 0.9526216752572909f, - 0.9526614812535863f, - 0.9527012709262845f, - 0.9527410442747039f, - 0.9527808012981629f, - 0.9528205419959802f, - 0.952860266367475f, - 0.9528999744119666f, - 0.9529396661287746f, - 0.9529793415172189f, - 0.9530190005766195f, - 0.953058643306297f, - 0.9530982697055722f, - 0.953137879773766f, - 0.9531774735101997f, - 0.953217050914195f, - 0.9532566119850735f, - 0.9532961567221576f, - 0.9533356851247696f, - 0.9533751971922322f, - 0.9534146929238683f, - 0.9534541723190013f, - 0.9534936353769545f, - 0.9535330820970519f, - 0.9535725124786176f, - 0.9536119265209759f, - 0.9536513242234514f, - 0.9536907055853693f, - 0.9537300706060544f, - 0.9537694192848325f, - 0.9538087516210293f, - 0.9538480676139708f, - 0.9538873672629833f, - 0.9539266505673936f, - 0.9539659175265284f, - 0.9540051681397148f, - 0.9540444024062804f, - 0.954083620325553f, - 0.9541228218968605f, - 0.9541620071195313f, - 0.9542011759928938f, - 0.9542403285162768f, - 0.9542794646890098f, - 0.9543185845104218f, - 0.9543576879798428f, - 0.9543967750966026f, - 0.9544358458600315f, - 0.95447490026946f, - 0.954513938324219f, - 0.9545529600236395f, - 0.954591965367053f, - 0.954630954353791f, - 0.9546699269831855f, - 0.9547088832545687f, - 0.9547478231672731f, - 0.9547867467206316f, - 0.9548256539139771f, - 0.954864544746643f, - 0.9549034192179628f, - 0.9549422773272706f, - 0.9549811190739003f, - 0.9550199444571866f, - 0.9550587534764642f, - 0.955097546131068f, - 0.9551363224203335f, - 0.955175082343596f, - 0.9552138259001917f, - 0.9552525530894564f, - 0.9552912639107268f, - 0.9553299583633393f, - 0.9553686364466313f, - 0.9554072981599396f, - 0.955445943502602f, - 0.9554845724739565f, - 0.9555231850733408f, - 0.9555617813000934f, - 0.9556003611535531f, - 0.9556389246330588f, - 0.9556774717379497f, - 0.9557160024675653f, - 0.9557545168212455f, - 0.9557930147983301f, - 0.9558314963981597f, - 0.9558699616200749f, - 0.9559084104634163f, - 0.9559468429275256f, - 0.9559852590117439f, - 0.9560236587154131f, - 0.9560620420378751f, - 0.9561004089784724f, - 0.9561387595365474f, - 0.956177093711443f, - 0.9562154115025026f, - 0.9562537129090695f, - 0.9562919979304871f, - 0.9563302665660999f, - 0.9563685188152519f, - 0.9564067546772876f, - 0.956444974151552f, - 0.9564831772373903f, - 0.9565213639341476f, - 0.9565595342411698f, - 0.9565976881578028f, - 0.9566358256833928f, - 0.9566739468172865f, - 0.9567120515588305f, - 0.956750139907372f, - 0.9567882118622583f, - 0.956826267422837f, - 0.9568643065884562f, - 0.956902329358464f, - 0.9569403357322089f, - 0.9569783257090396f, - 0.9570162992883052f, - 0.9570542564693553f, - 0.957092197251539f, - 0.9571301216342066f, - 0.9571680296167082f, - 0.9572059211983942f, - 0.9572437963786153f, - 0.9572816551567226f, - 0.9573194975320672f, - 0.957357323504001f, - 0.9573951330718756f, - 0.9574329262350434f, - 0.9574707029928565f, - 0.9575084633446679f, - 0.9575462072898304f, - 0.9575839348276973f, - 0.9576216459576222f, - 0.957659340678959f, - 0.9576970189910616f, - 0.9577346808932845f, - 0.9577723263849824f, - 0.9578099554655104f, - 0.9578475681342234f, - 0.9578851643904772f, - 0.9579227442336274f, - 0.9579603076630302f, - 0.957997854678042f, - 0.9580353852780193f, - 0.9580728994623191f, - 0.9581103972302987f, - 0.9581478785813154f, - 0.9581853435147271f, - 0.9582227920298917f, - 0.9582602241261677f, - 0.9582976398029137f, - 0.9583350390594885f, - 0.9583724218952513f, - 0.9584097883095615f, - 0.958447138301779f, - 0.9584844718712636f, - 0.9585217890173758f, - 0.9585590897394761f, - 0.9585963740369254f, - 0.9586336419090848f, - 0.9586708933553157f, - 0.9587081283749799f, - 0.9587453469674392f, - 0.9587825491320561f, - 0.958819734868193f, - 0.9588569041752129f, - 0.9588940570524785f, - 0.9589311934993537f, - 0.958968313515202f, - 0.9590054170993874f, - 0.9590425042512739f, - 0.9590795749702262f, - 0.959116629255609f, - 0.9591536671067876f, - 0.9591906885231273f, - 0.9592276935039936f, - 0.9592646820487525f, - 0.9593016541567703f, - 0.9593386098274134f, - 0.9593755490600485f, - 0.9594124718540429f, - 0.9594493782087636f, - 0.9594862681235786f, - 0.9595231415978556f, - 0.9595599986309626f, - 0.9595968392222685f, - 0.9596336633711416f, - 0.9596704710769512f, - 0.9597072623390667f, - 0.9597440371568574f, - 0.9597807955296933f, - 0.9598175374569445f, - 0.9598542629379817f, - 0.9598909719721753f, - 0.9599276645588964f, - 0.9599643406975163f, - 0.9600010003874067f, - 0.9600376436279392f, - 0.960074270418486f, - 0.9601108807584197f, - 0.9601474746471127f, - 0.9601840520839382f, - 0.9602206130682693f, - 0.9602571575994796f, - 0.960293685676943f, - 0.9603301973000336f, - 0.9603666924681256f, - 0.9604031711805938f, - 0.9604396334368132f, - 0.9604760792361589f, - 0.9605125085780064f, - 0.9605489214617315f, - 0.9605853178867105f, - 0.9606216978523195f, - 0.9606580613579353f, - 0.9606944084029347f, - 0.960730738986695f, - 0.9607670531085937f, - 0.9608033507680084f, - 0.9608396319643172f, - 0.9608758966968985f, - 0.9609121449651311f, - 0.9609483767683935f, - 0.9609845921060651f, - 0.9610207909775254f, - 0.961056973382154f, - 0.961093139319331f, - 0.9611292887884368f, - 0.9611654217888519f, - 0.9612015383199571f, - 0.9612376383811337f, - 0.961273721971763f, - 0.9613097890912268f, - 0.961345839738907f, - 0.961381873914186f, - 0.9614178916164463f, - 0.9614538928450708f, - 0.9614898775994426f, - 0.9615258458789451f, - 0.9615617976829619f, - 0.9615977330108771f, - 0.9616336518620751f, - 0.9616695542359401f, - 0.9617054401318572f, - 0.9617413095492113f, - 0.961777162487388f, - 0.9618129989457728f, - 0.9618488189237516f, - 0.9618846224207109f, - 0.961920409436037f, - 0.9619561799691168f, - 0.9619919340193372f, - 0.9620276715860858f, - 0.9620633926687502f, - 0.9620990972667183f, - 0.9621347853793782f, - 0.9621704570061185f, - 0.962206112146328f, - 0.9622417507993957f, - 0.9622773729647109f, - 0.9623129786416633f, - 0.9623485678296428f, - 0.9623841405280397f, - 0.9624196967362442f, - 0.9624552364536473f, - 0.9624907596796398f, - 0.9625262664136134f, - 0.9625617566549592f, - 0.9625972304030695f, - 0.9626326876573363f, - 0.9626681284171521f, - 0.9627035526819095f, - 0.9627389604510016f, - 0.9627743517238219f, - 0.9628097264997636f, - 0.9628450847782207f, - 0.9628804265585875f, - 0.9629157518402583f, - 0.962951060622628f, - 0.9629863529050913f, - 0.9630216286870436f, - 0.9630568879678804f, - 0.9630921307469976f, - 0.9631273570237915f, - 0.9631625667976582f, - 0.9631977600679945f, - 0.9632329368341974f, - 0.9632680970956643f, - 0.9633032408517924f, - 0.9633383681019799f, - 0.9633734788456246f, - 0.963408573082125f, - 0.9634436508108799f, - 0.963478712031288f, - 0.9635137567427488f, - 0.9635487849446616f, - 0.9635837966364262f, - 0.9636187918174428f, - 0.9636537704871119f, - 0.9636887326448338f, - 0.9637236782900097f, - 0.9637586074220407f, - 0.9637935200403284f, - 0.9638284161442745f, - 0.963863295733281f, - 0.9638981588067503f, - 0.9639330053640852f, - 0.9639678354046883f, - 0.9640026489279632f, - 0.964037445933313f, - 0.9640722264201416f, - 0.964106990387853f, - 0.9641417378358517f, - 0.9641764687635421f, - 0.9642111831703293f, - 0.9642458810556184f, - 0.9642805624188147f, - 0.9643152272593241f, - 0.9643498755765526f, - 0.9643845073699066f, - 0.9644191226387925f, - 0.9644537213826173f, - 0.9644883036007882f, - 0.9645228692927125f, - 0.9645574184577981f, - 0.9645919510954528f, - 0.9646264672050852f, - 0.9646609667861036f, - 0.9646954498379169f, - 0.9647299163599343f, - 0.9647643663515653f, - 0.9647987998122195f, - 0.9648332167413067f, - 0.9648676171382377f, - 0.9649020010024225f, - 0.9649363683332723f, - 0.9649707191301982f, - 0.9650050533926114f, - 0.9650393711199239f, - 0.9650736723115474f, - 0.9651079569668942f, - 0.965142225085377f, - 0.9651764766664084f, - 0.9652107117094015f, - 0.96524493021377f, - 0.9652791321789275f, - 0.9653133176042876f, - 0.9653474864892649f, - 0.9653816388332739f, - 0.9654157746357293f, - 0.9654498938960462f, - 0.9654839966136399f, - 0.9655180827879262f, - 0.965552152418321f, - 0.9655862055042406f, - 0.9656202420451013f, - 0.9656542620403201f, - 0.9656882654893141f, - 0.9657222523915004f, - 0.9657562227462969f, - 0.9657901765531214f, - 0.9658241138113921f, - 0.9658580345205277f, - 0.9658919386799467f, - 0.9659258262890683f, - 0.9659596973473118f, - 0.9659935518540969f, - 0.9660273898088434f, - 0.9660612112109715f, - 0.9660950160599019f, - 0.9661288043550551f, - 0.9661625760958522f, - 0.9661963312817147f, - 0.9662300699120641f, - 0.9662637919863222f, - 0.9662974975039113f, - 0.9663311864642539f, - 0.9663648588667726f, - 0.9663985147108904f, - 0.966432153996031f, - 0.9664657767216176f, - 0.9664993828870742f, - 0.966532972491825f, - 0.9665665455352944f, - 0.9666001020169073f, - 0.9666336419360885f, - 0.9666671652922634f, - 0.9667006720848577f, - 0.966734162313297f, - 0.9667676359770075f, - 0.966801093075416f, - 0.9668345336079488f, - 0.9668679575740331f, - 0.9669013649730962f, - 0.9669347558045656f, - 0.9669681300678692f, - 0.967001487762435f, - 0.9670348288876918f, - 0.9670681534430678f, - 0.9671014614279925f, - 0.9671347528418948f, - 0.9671680276842043f, - 0.9672012859543511f, - 0.9672345276517651f, - 0.9672677527758767f, - 0.9673009613261169f, - 0.9673341533019163f, - 0.9673673287027063f, - 0.9674004875279185f, - 0.9674336297769847f, - 0.967466755449337f, - 0.967499864544408f, - 0.96753295706163f, - 0.9675660330004362f, - 0.9675990923602598f, - 0.9676321351405344f, - 0.9676651613406938f, - 0.9676981709601721f, - 0.9677311639984035f, - 0.9677641404548231f, - 0.9677971003288655f, - 0.9678300436199659f, - 0.9678629703275602f, - 0.9678958804510839f, - 0.9679287739899732f, - 0.9679616509436644f, - 0.9679945113115943f, - 0.9680273550931997f, - 0.9680601822879179f, - 0.9680929928951864f, - 0.968125786914443f, - 0.9681585643451258f, - 0.9681913251866732f, - 0.9682240694385238f, - 0.9682567971001165f, - 0.9682895081708907f, - 0.9683222026502856f, - 0.9683548805377412f, - 0.9683875418326976f, - 0.968420186534595f, - 0.9684528146428742f, - 0.9684854261569761f, - 0.9685180210763418f, - 0.9685505994004129f, - 0.9685831611286311f, - 0.9686157062604385f, - 0.9686482347952775f, - 0.9686807467325907f, - 0.968713242071821f, - 0.9687457208124116f, - 0.968778182953806f, - 0.968810628495448f, - 0.9688430574367815f, - 0.968875469777251f, - 0.9689078655163011f, - 0.9689402446533767f, - 0.9689726071879229f, - 0.9690049531193854f, - 0.9690372824472097f, - 0.969069595170842f, - 0.9691018912897286f, - 0.969134170803316f, - 0.9691664337110514f, - 0.9691986800123816f, - 0.9692309097067544f, - 0.9692631227936174f, - 0.9692953192724185f, - 0.9693274991426063f, - 0.9693596624036293f, - 0.9693918090549363f, - 0.9694239390959766f, - 0.9694560525261995f, - 0.969488149345055f, - 0.9695202295519929f, - 0.9695522931464635f, - 0.9695843401279176f, - 0.969616370495806f, - 0.9696483842495798f, - 0.9696803813886905f, - 0.9697123619125898f, - 0.9697443258207298f, - 0.9697762731125628f, - 0.9698082037875413f, - 0.9698401178451183f, - 0.9698720152847468f, - 0.9699038961058803f, - 0.9699357603079727f, - 0.9699676078904779f, - 0.9699994388528501f, - 0.970031253194544f, - 0.9700630509150144f, - 0.9700948320137165f, - 0.9701265964901058f, - 0.9701583443436379f, - 0.9701900755737689f, - 0.9702217901799551f, - 0.970253488161653f, - 0.9702851695183196f, - 0.9703168342494118f, - 0.9703484823543873f, - 0.9703801138327036f, - 0.9704117286838189f, - 0.9704433269071914f, - 0.9704749085022796f, - 0.9705064734685425f, - 0.9705380218054391f, - 0.9705695535124289f, - 0.9706010685889717f, - 0.9706325670345273f, - 0.9706640488485562f, - 0.9706955140305188f, - 0.970726962579876f, - 0.9707583944960889f, - 0.9707898097786191f, - 0.9708212084269281f, - 0.9708525904404779f, - 0.970883955818731f, - 0.9709153045611497f, - 0.970946636667197f, - 0.970977952136336f, - 0.9710092509680301f, - 0.9710405331617431f, - 0.9710717987169388f, - 0.9711030476330816f, - 0.9711342799096361f, - 0.971165495546067f, - 0.9711966945418395f, - 0.971227876896419f, - 0.9712590426092713f, - 0.9712901916798622f, - 0.9713213241076581f, - 0.9713524398921256f, - 0.9713835390327314f, - 0.9714146215289428f, - 0.971445687380227f, - 0.9714767365860517f, - 0.9715077691458851f, - 0.9715387850591953f, - 0.9715697843254509f, - 0.9716007669441208f, - 0.9716317329146739f, - 0.9716626822365798f, - 0.9716936149093082f, - 0.971724530932329f, - 0.9717554303051126f, - 0.9717863130271293f, - 0.97181717909785f, - 0.971848028516746f, - 0.9718788612832886f, - 0.9719096773969493f, - 0.9719404768572004f, - 0.971971259663514f, - 0.9720020258153627f, - 0.9720327753122192f, - 0.9720635081535567f, - 0.9720942243388486f, - 0.9721249238675687f, - 0.9721556067391908f, - 0.9721862729531892f, - 0.9722169225090385f, - 0.9722475554062133f, - 0.9722781716441892f, - 0.9723087712224411f, - 0.9723393541404449f, - 0.9723699203976766f, - 0.9724004699936124f, - 0.9724310029277289f, - 0.9724615191995027f, - 0.9724920188084113f, - 0.9725225017539318f, - 0.9725529680355419f, - 0.9725834176527198f, - 0.9726138506049435f, - 0.9726442668916916f, - 0.972674666512443f, - 0.9727050494666768f, - 0.9727354157538723f, - 0.9727657653735093f, - 0.9727960983250677f, - 0.9728264146080278f, - 0.9728567142218701f, - 0.9728869971660754f, - 0.9729172634401249f, - 0.9729475130434998f, - 0.972977745975682f, - 0.9730079622361534f, - 0.9730381618243962f, - 0.973068344739893f, - 0.9730985109821265f, - 0.97312866055058f, - 0.9731587934447369f, - 0.9731889096640807f, - 0.9732190092080953f, - 0.9732490920762653f, - 0.973279158268075f, - 0.9733092077830092f, - 0.9733392406205531f, - 0.9733692567801921f, - 0.9733992562614119f, - 0.9734292390636983f, - 0.9734592051865377f, - 0.9734891546294167f, - 0.9735190873918219f, - 0.9735490034732407f, - 0.9735789028731603f, - 0.9736087855910683f, - 0.9736386516264529f, - 0.9736685009788023f, - 0.9736983336476048f, - 0.9737281496323495f, - 0.9737579489325255f, - 0.973787731547622f, - 0.9738174974771289f, - 0.973847246720536f, - 0.9738769792773336f, - 0.9739066951470123f, - 0.973936394329063f, - 0.9739660768229765f, - 0.9739957426282445f, - 0.9740253917443586f, - 0.9740550241708108f, - 0.9740846399070933f, - 0.9741142389526986f, - 0.9741438213071195f, - 0.9741733869698493f, - 0.9742029359403813f, - 0.9742324682182092f, - 0.9742619838028269f, - 0.9742914826937288f, - 0.9743209648904093f, - 0.9743504303923634f, - 0.9743798791990859f, - 0.9744093113100726f, - 0.9744387267248188f, - 0.9744681254428208f, - 0.9744975074635748f, - 0.9745268727865771f, - 0.9745562214113248f, - 0.974585553337315f, - 0.974614868564045f, - 0.9746441670910124f, - 0.9746734489177156f, - 0.9747027140436524f, - 0.9747319624683215f, - 0.9747611941912218f, - 0.9747904092118523f, - 0.9748196075297125f, - 0.9748487891443022f, - 0.9748779540551212f, - 0.9749071022616699f, - 0.9749362337634486f, - 0.9749653485599585f, - 0.9749944466507005f, - 0.9750235280351761f, - 0.9750525927128869f, - 0.9750816406833349f, - 0.9751106719460225f, - 0.9751396865004521f, - 0.9751686843461267f, - 0.9751976654825493f, - 0.9752266299092234f, - 0.9752555776256526f, - 0.975284508631341f, - 0.9753134229257928f, - 0.9753423205085127f, - 0.9753712013790053f, - 0.9754000655367759f, - 0.9754289129813299f, - 0.9754577437121731f, - 0.9754865577288113f, - 0.9755153550307509f, - 0.9755441356174984f, - 0.9755728994885607f, - 0.975601646643445f, - 0.9756303770816586f, - 0.9756590908027092f, - 0.975687787806105f, - 0.975716468091354f, - 0.9757451316579651f, - 0.9757737785054468f, - 0.9758024086333085f, - 0.9758310220410595f, - 0.9758596187282096f, - 0.9758881986942688f, - 0.9759167619387473f, - 0.9759453084611559f, - 0.9759738382610051f, - 0.9760023513378064f, - 0.9760308476910711f, - 0.9760593273203109f, - 0.9760877902250377f, - 0.976116236404764f, - 0.9761446658590023f, - 0.9761730785872654f, - 0.9762014745890666f, - 0.9762298538639191f, - 0.976258216411337f, - 0.976286562230834f, - 0.9763148913219246f, - 0.9763432036841232f, - 0.9763714993169449f, - 0.9763997782199046f, - 0.976428040392518f, - 0.9764562858343007f, - 0.9764845145447686f, - 0.9765127265234382f, - 0.9765409217698262f, - 0.9765691002834492f, - 0.9765972620638246f, - 0.9766254071104696f, - 0.9766535354229022f, - 0.9766816470006403f, - 0.9767097418432023f, - 0.9767378199501068f, - 0.9767658813208725f, - 0.9767939259550187f, - 0.9768219538520648f, - 0.9768499650115308f, - 0.9768779594329364f, - 0.9769059371158022f, - 0.9769338980596487f, - 0.9769618422639967f, - 0.9769897697283675f, - 0.9770176804522825f, - 0.9770455744352636f, - 0.9770734516768327f, - 0.9771013121765122f, - 0.9771291559338247f, - 0.977156982948293f, - 0.9771847932194404f, - 0.9772125867467903f, - 0.9772403635298668f, - 0.9772681235681935f, - 0.9772958668612949f, - 0.9773235934086957f, - 0.9773513032099207f, - 0.9773789962644952f, - 0.9774066725719447f, - 0.9774343321317949f, - 0.9774619749435719f, - 0.9774896010068019f, - 0.9775172103210118f, - 0.9775448028857284f, - 0.9775723787004789f, - 0.9775999377647907f, - 0.9776274800781917f, - 0.9776550056402099f, - 0.9776825144503738f, - 0.9777100065082119f, - 0.9777374818132533f, - 0.9777649403650269f, - 0.9777923821630625f, - 0.9778198072068899f, - 0.9778472154960389f, - 0.9778746070300401f, - 0.9779019818084241f, - 0.9779293398307218f, - 0.9779566810964645f, - 0.9779840056051836f, - 0.9780113133564111f, - 0.9780386043496789f, - 0.9780658785845194f, - 0.9780931360604654f, - 0.9781203767770498f, - 0.9781476007338057f, - 0.9781748079302667f, - 0.9782019983659666f, - 0.9782291720404396f, - 0.97825632895322f, - 0.9782834691038425f, - 0.978310592491842f, - 0.9783376991167538f, - 0.9783647889781135f, - 0.9783918620754569f, - 0.9784189184083201f, - 0.9784459579762393f, - 0.9784729807787514f, - 0.9784999868153933f, - 0.9785269760857024f, - 0.978553948589216f, - 0.9785809043254721f, - 0.9786078432940087f, - 0.9786347654943645f, - 0.9786616709260778f, - 0.9786885595886878f, - 0.9787154314817338f, - 0.9787422866047552f, - 0.978769124957292f, - 0.9787959465388842f, - 0.9788227513490724f, - 0.978849539387397f, - 0.9788763106533994f, - 0.9789030651466206f, - 0.9789298028666022f, - 0.9789565238128861f, - 0.9789832279850146f, - 0.9790099153825298f, - 0.9790365860049746f, - 0.9790632398518921f, - 0.9790898769228255f, - 0.9791164972173182f, - 0.9791431007349144f, - 0.979169687475158f, - 0.9791962574375935f, - 0.9792228106217657f, - 0.9792493470272197f, - 0.9792758666535006f, - 0.9793023695001541f, - 0.9793288555667261f, - 0.9793553248527628f, - 0.9793817773578104f, - 0.979408213081416f, - 0.9794346320231264f, - 0.979461034182489f, - 0.9794874195590514f, - 0.9795137881523615f, - 0.9795401399619674f, - 0.9795664749874177f, - 0.979592793228261f, - 0.9796190946840465f, - 0.9796453793543235f, - 0.9796716472386415f, - 0.9796978983365506f, - 0.9797241326476009f, - 0.9797503501713428f, - 0.9797765509073272f, - 0.979802734855105f, - 0.9798289020142277f, - 0.9798550523842469f, - 0.9798811859647144f, - 0.9799073027551826f, - 0.9799334027552039f, - 0.979959485964331f, - 0.9799855523821172f, - 0.9800116020081155f, - 0.98003763484188f, - 0.9800636508829642f, - 0.9800896501309226f, - 0.9801156325853096f, - 0.9801415982456801f, - 0.980167547111589f, - 0.9801934791825919f, - 0.9802193944582444f, - 0.9802452929381023f, - 0.9802711746217219f, - 0.9802970395086597f, - 0.9803228875984726f, - 0.9803487188907177f, - 0.9803745333849524f, - 0.9804003310807343f, - 0.9804261119776214f, - 0.9804518760751719f, - 0.9804776233729444f, - 0.9805033538704977f, - 0.9805290675673909f, - 0.9805547644631835f, - 0.9805804445574351f, - 0.9806061078497057f, - 0.9806317543395556f, - 0.9806573840265452f, - 0.9806829969102356f, - 0.9807085929901878f, - 0.980734172265963f, - 0.9807597347371233f, - 0.9807852804032304f, - 0.9808108092638468f, - 0.9808363213185349f, - 0.9808618165668576f, - 0.9808872950083781f, - 0.9809127566426598f, - 0.9809382014692664f, - 0.980963629487762f, - 0.9809890406977108f, - 0.9810144350986774f, - 0.9810398126902266f, - 0.9810651734719237f, - 0.9810905174433341f, - 0.9811158446040235f, - 0.981141154953558f, - 0.9811664484915039f, - 0.9811917252174278f, - 0.9812169851308965f, - 0.9812422282314772f, - 0.9812674545187376f, - 0.9812926639922451f, - 0.981317856651568f, - 0.9813430324962745f, - 0.9813681915259334f, - 0.9813933337401133f, - 0.9814184591383835f, - 0.9814435677203137f, - 0.9814686594854735f, - 0.9814937344334329f, - 0.9815187925637623f, - 0.9815438338760324f, - 0.9815688583698141f, - 0.9815938660446786f, - 0.9816188569001975f, - 0.9816438309359423f, - 0.9816687881514853f, - 0.9816937285463988f, - 0.9817186521202556f, - 0.9817435588726284f, - 0.9817684488030906f, - 0.9817933219112157f, - 0.9818181781965774f, - 0.9818430176587499f, - 0.9818678402973076f, - 0.981892646111825f, - 0.9819174351018772f, - 0.9819422072670395f, - 0.9819669626068873f, - 0.9819917011209965f, - 0.9820164228089433f, - 0.9820411276703039f, - 0.9820658157046551f, - 0.9820904869115739f, - 0.9821151412906375f, - 0.9821397788414234f, - 0.9821643995635096f, - 0.9821890034564742f, - 0.9822135905198955f, - 0.9822381607533524f, - 0.9822627141564236f, - 0.9822872507286886f, - 0.9823117704697271f, - 0.9823362733791187f, - 0.9823607594564435f, - 0.9823852287012823f, - 0.9824096811132155f, - 0.9824341166918242f, - 0.9824585354366898f, - 0.9824829373473939f, - 0.9825073224235181f, - 0.9825316906646449f, - 0.9825560420703565f, - 0.9825803766402359f, - 0.982604694373866f, - 0.98262899527083f, - 0.9826532793307118f, - 0.9826775465530949f, - 0.9827017969375639f, - 0.9827260304837031f, - 0.9827502471910972f, - 0.9827744470593314f, - 0.9827986300879908f, - 0.9828227962766614f, - 0.9828469456249287f, - 0.9828710781323792f, - 0.9828951937985994f, - 0.9829192926231758f, - 0.9829433746056958f, - 0.9829674397457466f, - 0.9829914880429159f, - 0.9830155194967916f, - 0.983039534106962f, - 0.9830635318730154f, - 0.983087512794541f, - 0.9831114768711275f, - 0.9831354241023644f, - 0.9831593544878415f, - 0.9831832680271487f, - 0.9832071647198762f, - 0.9832310445656145f, - 0.9832549075639545f, - 0.9832787537144874f, - 0.9833025830168044f, - 0.9833263954704974f, - 0.9833501910751581f, - 0.9833739698303791f, - 0.9833977317357526f, - 0.9834214767908719f, - 0.9834452049953297f, - 0.9834689163487196f, - 0.9834926108506353f, - 0.983516288500671f, - 0.9835399492984206f, - 0.983563593243479f, - 0.9835872203354409f, - 0.9836108305739015f, - 0.9836344239584563f, - 0.983658000488701f, - 0.9836815601642315f, - 0.9837051029846443f, - 0.9837286289495358f, - 0.9837521380585031f, - 0.9837756303111433f, - 0.9837991057070539f, - 0.9838225642458326f, - 0.9838460059270774f, - 0.9838694307503867f, - 0.983892838715359f, - 0.9839162298215935f, - 0.9839396040686892f, - 0.9839629614562455f, - 0.9839863019838624f, - 0.9840096256511397f, - 0.984032932457678f, - 0.9840562224030779f, - 0.9840794954869402f, - 0.9841027517088662f, - 0.9841259910684574f, - 0.9841492135653157f, - 0.9841724191990431f, - 0.9841956079692419f, - 0.9842187798755149f, - 0.984241934917465f, - 0.9842650730946955f, - 0.9842881944068098f, - 0.9843112988534118f, - 0.9843343864341056f, - 0.9843574571484958f, - 0.9843805109961867f, - 0.9844035479767836f, - 0.9844265680898916f, - 0.9844495713351163f, - 0.9844725577120637f, - 0.9844955272203396f, - 0.9845184798595508f, - 0.9845414156293036f, - 0.9845643345292053f, - 0.9845872365588633f, - 0.9846101217178848f, - 0.9846329900058779f, - 0.9846558414224508f, - 0.9846786759672118f, - 0.9847014936397698f, - 0.9847242944397336f, - 0.9847470783667127f, - 0.9847698454203168f, - 0.9847925956001554f, - 0.9848153289058391f, - 0.9848380453369782f, - 0.9848607448931833f, - 0.9848834275740658f, - 0.9849060933792367f, - 0.9849287423083078f, - 0.9849513743608911f, - 0.9849739895365985f, - 0.9849965878350428f, - 0.9850191692558368f, - 0.9850417337985934f, - 0.9850642814629259f, - 0.9850868122484481f, - 0.985109326154774f, - 0.9851318231815176f, - 0.9851543033282936f, - 0.9851767665947168f, - 0.9851992129804021f, - 0.9852216424849652f, - 0.9852440551080216f, - 0.9852664508491873f, - 0.9852888297080786f, - 0.9853111916843119f, - 0.9853335367775041f, - 0.9853558649872725f, - 0.9853781763132342f, - 0.9854004707550071f, - 0.9854227483122092f, - 0.9854450089844587f, - 0.9854672527713741f, - 0.9854894796725745f, - 0.9855116896876789f, - 0.9855338828163067f, - 0.9855560590580777f, - 0.985578218412612f, - 0.9856003608795296f, - 0.9856224864584513f, - 0.985644595148998f, - 0.985666686950791f, - 0.9856887618634513f, - 0.9857108198866013f, - 0.9857328610198625f, - 0.9857548852628574f, - 0.9857768926152087f, - 0.9857988830765393f, - 0.9858208566464723f, - 0.9858428133246314f, - 0.9858647531106401f, - 0.9858866760041226f, - 0.9859085820047033f, - 0.9859304711120068f, - 0.9859523433256581f, - 0.9859741986452822f, - 0.9859960370705049f, - 0.9860178586009518f, - 0.9860396632362491f, - 0.9860614509760233f, - 0.9860832218199008f, - 0.9861049757675088f, - 0.9861267128184743f, - 0.986148432972425f, - 0.9861701362289889f, - 0.9861918225877937f, - 0.9862134920484682f, - 0.9862351446106409f, - 0.9862567802739409f, - 0.9862783990379974f, - 0.98630000090244f, - 0.9863215858668984f, - 0.986343153931003f, - 0.9863647050943842f, - 0.9863862393566726f, - 0.9864077567174993f, - 0.9864292571764954f, - 0.9864507407332929f, - 0.9864722073875234f, - 0.9864936571388191f, - 0.9865150899868125f, - 0.9865365059311363f, - 0.9865579049714237f, - 0.9865792871073078f, - 0.9866006523384224f, - 0.9866220006644014f, - 0.986643332084879f, - 0.9866646465994896f, - 0.986685944207868f, - 0.9867072249096495f, - 0.986728488704469f, - 0.9867497355919626f, - 0.986770965571766f, - 0.9867921786435155f, - 0.9868133748068476f, - 0.9868345540613992f, - 0.9868557164068072f, - 0.9868768618427093f, - 0.9868979903687428f, - 0.9869191019845459f, - 0.9869401966897569f, - 0.9869612744840142f, - 0.9869823353669567f, - 0.9870033793382235f, - 0.987024406397454f, - 0.9870454165442881f, - 0.9870664097783656f, - 0.9870873860993268f, - 0.9871083455068123f, - 0.987129288000463f, - 0.98715021357992f, - 0.9871711222448248f, - 0.9871920139948192f, - 0.987212888829545f, - 0.9872337467486447f, - 0.987254587751761f, - 0.9872754118385365f, - 0.9872962190086146f, - 0.9873170092616387f, - 0.9873377825972526f, - 0.9873585390151003f, - 0.9873792785148262f, - 0.987400001096075f, - 0.9874207067584915f, - 0.9874413955017208f, - 0.9874620673254088f, - 0.9874827222292009f, - 0.9875033602127433f, - 0.9875239812756824f, - 0.987544585417665f, - 0.9875651726383378f, - 0.9875857429373482f, - 0.9876062963143437f, - 0.9876268327689722f, - 0.9876473523008817f, - 0.9876678549097206f, - 0.9876883405951378f, - 0.987708809356782f, - 0.9877292611943025f, - 0.987749696107349f, - 0.9877701140955714f, - 0.9877905151586197f, - 0.9878108992961444f, - 0.9878312665077962f, - 0.9878516167932261f, - 0.9878719501520854f, - 0.9878922665840258f, - 0.987912566088699f, - 0.9879328486657574f, - 0.9879531143148533f, - 0.9879733630356394f, - 0.9879935948277689f, - 0.9880138096908951f, - 0.9880340076246716f, - 0.9880541886287523f, - 0.9880743527027913f, - 0.9880944998464434f, - 0.9881146300593631f, - 0.9881347433412055f, - 0.9881548396916261f, - 0.9881749191102805f, - 0.9881949815968246f, - 0.9882150271509147f, - 0.9882350557722072f, - 0.9882550674603591f, - 0.9882750622150273f, - 0.9882950400358693f, - 0.9883150009225429f, - 0.9883349448747059f, - 0.9883548718920167f, - 0.9883747819741338f, - 0.9883946751207159f, - 0.9884145513314222f, - 0.9884344106059124f, - 0.9884542529438459f, - 0.9884740783448829f, - 0.9884938868086836f, - 0.9885136783349084f, - 0.9885334529232186f, - 0.988553210573275f, - 0.9885729512847394f, - 0.9885926750572733f, - 0.9886123818905387f, - 0.9886320717841981f, - 0.9886517447379141f, - 0.9886714007513494f, - 0.9886910398241674f, - 0.9887106619560315f, - 0.9887302671466056f, - 0.9887498553955536f, - 0.98876942670254f, - 0.9887889810672295f, - 0.9888085184892867f, - 0.9888280389683773f, - 0.9888475425041665f, - 0.9888670290963202f, - 0.9888864987445045f, - 0.9889059514483859f, - 0.9889253872076309f, - 0.9889448060219066f, - 0.9889642078908802f, - 0.9889835928142193f, - 0.9890029607915917f, - 0.9890223118226655f, - 0.9890416459071093f, - 0.9890609630445917f, - 0.9890802632347816f, - 0.9890995464773484f, - 0.9891188127719618f, - 0.9891380621182915f, - 0.9891572945160078f, - 0.989176509964781f, - 0.989195708464282f, - 0.9892148900141817f, - 0.9892340546141515f, - 0.9892532022638632f, - 0.9892723329629883f, - 0.9892914467111994f, - 0.9893105435081687f, - 0.9893296233535692f, - 0.989348686247074f, - 0.9893677321883562f, - 0.9893867611770896f, - 0.9894057732129481f, - 0.989424768295606f, - 0.9894437464247379f, - 0.9894627076000184f, - 0.9894816518211228f, - 0.9895005790877264f, - 0.9895194893995048f, - 0.9895383827561343f, - 0.9895572591572908f, - 0.9895761186026509f, - 0.9895949610918917f, - 0.9896137866246902f, - 0.9896325952007238f, - 0.9896513868196702f, - 0.9896701614812075f, - 0.9896889191850139f, - 0.9897076599307681f, - 0.9897263837181489f, - 0.9897450905468355f, - 0.9897637804165074f, - 0.9897824533268442f, - 0.9898011092775262f, - 0.9898197482682336f, - 0.989838370298647f, - 0.9898569753684473f, - 0.9898755634773158f, - 0.9898941346249338f, - 0.9899126888109834f, - 0.9899312260351465f, - 0.9899497462971054f, - 0.9899682495965428f, - 0.9899867359331419f, - 0.9900052053065856f, - 0.9900236577165575f, - 0.9900420931627416f, - 0.9900605116448219f, - 0.9900789131624829f, - 0.990097297715409f, - 0.9901156653032854f, - 0.9901340159257975f, - 0.9901523495826307f, - 0.9901706662734708f, - 0.9901889659980042f, - 0.9902072487559171f, - 0.9902255145468963f, - 0.9902437633706288f, - 0.990261995226802f, - 0.9902802101151034f, - 0.990298408035221f, - 0.9903165889868428f, - 0.9903347529696575f, - 0.9903528999833537f, - 0.9903710300276205f, - 0.9903891431021473f, - 0.9904072392066237f, - 0.9904253183407397f, - 0.9904433805041853f, - 0.9904614256966512f, - 0.9904794539178282f, - 0.9904974651674073f, - 0.9905154594450799f, - 0.9905334367505377f, - 0.9905513970834728f, - 0.9905693404435773f, - 0.9905872668305437f, - 0.9906051762440649f, - 0.990623068683834f, - 0.9906409441495444f, - 0.99065880264089f, - 0.9906766441575645f, - 0.9906944686992625f, - 0.9907122762656784f, - 0.990730066856507f, - 0.9907478404714436f, - 0.9907655971101836f, - 0.9907833367724228f, - 0.9908010594578572f, - 0.9908187651661832f, - 0.9908364538970972f, - 0.9908541256502963f, - 0.9908717804254776f, - 0.9908894182223387f, - 0.9909070390405773f, - 0.9909246428798915f, - 0.9909422297399796f, - 0.9909597996205404f, - 0.9909773525212727f, - 0.9909948884418758f, - 0.9910124073820492f, - 0.9910299093414927f, - 0.9910473943199065f, - 0.991064862316991f, - 0.9910823133324467f, - 0.9910997473659748f, - 0.9911171644172765f, - 0.9911345644860533f, - 0.9911519475720071f, - 0.9911693136748401f, - 0.9911866627942546f, - 0.9912039949299534f, - 0.9912213100816396f, - 0.9912386082490164f, - 0.9912558894317876f, - 0.9912731536296567f, - 0.9912904008423282f, - 0.9913076310695066f, - 0.9913248443108964f, - 0.9913420405662029f, - 0.9913592198351313f, - 0.9913763821173873f, - 0.991393527412677f, - 0.9914106557207062f, - 0.9914277670411817f, - 0.9914448613738104f, - 0.9914619387182991f, - 0.9914789990743554f, - 0.991496042441687f, - 0.9915130688200017f, - 0.9915300782090078f, - 0.9915470706084138f, - 0.9915640460179288f, - 0.9915810044372617f, - 0.9915979458661219f, - 0.9916148703042194f, - 0.9916317777512638f, - 0.9916486682069655f, - 0.9916655416710354f, - 0.991682398143184f, - 0.9916992376231227f, - 0.9917160601105629f, - 0.9917328656052162f, - 0.9917496541067949f, - 0.9917664256150112f, - 0.9917831801295777f, - 0.9917999176502074f, - 0.9918166381766134f, - 0.9918333417085092f, - 0.9918500282456088f, - 0.991866697787626f, - 0.9918833503342753f, - 0.9918999858852715f, - 0.9919166044403294f, - 0.9919332059991641f, - 0.9919497905614914f, - 0.9919663581270269f, - 0.991982908695487f, - 0.9919994422665879f, - 0.9920159588400463f, - 0.9920324584155794f, - 0.9920489409929042f, - 0.9920654065717385f, - 0.9920818551518f, - 0.992098286732807f, - 0.9921147013144779f, - 0.9921310988965313f, - 0.9921474794786864f, - 0.9921638430606625f, - 0.9921801896421792f, - 0.9921965192229564f, - 0.9922128318027144f, - 0.9922291273811734f, - 0.9922454059580544f, - 0.9922616675330785f, - 0.992277912105967f, - 0.9922941396764415f, - 0.9923103502442241f, - 0.9923265438090368f, - 0.9923427203706023f, - 0.9923588799286435f, - 0.9923750224828832f, - 0.9923911480330451f, - 0.9924072565788528f, - 0.9924233481200302f, - 0.9924394226563017f, - 0.9924554801873917f, - 0.9924715207130252f, - 0.9924875442329275f, - 0.9925035507468237f, - 0.9925195402544398f, - 0.9925355127555017f, - 0.9925514682497356f, - 0.9925674067368684f, - 0.9925833282166266f, - 0.9925992326887378f, - 0.9926151201529294f, - 0.992630990608929f, - 0.9926468440564647f, - 0.992662680495265f, - 0.9926784999250583f, - 0.9926943023455738f, - 0.9927100877565406f, - 0.9927258561576882f, - 0.9927416075487465f, - 0.9927573419294455f, - 0.9927730592995156f, - 0.9927887596586877f, - 0.9928044430066926f, - 0.9928201093432615f, - 0.992835758668126f, - 0.9928513909810182f, - 0.9928670062816699f, - 0.9928826045698137f, - 0.9928981858451823f, - 0.9929137501075087f, - 0.9929292973565262f, - 0.9929448275919686f, - 0.9929603408135695f, - 0.9929758370210633f, - 0.9929913162141845f, - 0.9930067783926675f, - 0.9930222235562478f, - 0.9930376517046605f, - 0.9930530628376414f, - 0.9930684569549263f, - 0.9930838340562514f, - 0.9930991941413535f, - 0.993114537209969f, - 0.9931298632618353f, - 0.9931451722966897f, - 0.9931604643142699f, - 0.9931757393143138f, - 0.9931909972965598f, - 0.9932062382607463f, - 0.9932214622066123f, - 0.9932366691338969f, - 0.9932518590423394f, - 0.9932670319316798f, - 0.9932821878016578f, - 0.9932973266520139f, - 0.9933124484824886f, - 0.993327553292823f, - 0.9933426410827579f, - 0.9933577118520353f, - 0.9933727656003964f, - 0.9933878023275837f, - 0.9934028220333393f, - 0.993417824717406f, - 0.9934328103795266f, - 0.9934477790194444f, - 0.9934627306369029f, - 0.9934776652316459f, - 0.9934925828034175f, - 0.9935074833519622f, - 0.9935223668770244f, - 0.9935372333783493f, - 0.9935520828556822f, - 0.9935669153087685f, - 0.9935817307373542f, - 0.9935965291411853f, - 0.9936113105200084f, - 0.9936260748735701f, - 0.9936408222016174f, - 0.9936555525038977f, - 0.9936702657801585f, - 0.9936849620301478f, - 0.9936996412536137f, - 0.9937143034503048f, - 0.9937289486199696f, - 0.9937435767623575f, - 0.9937581878772176f, - 0.9937727819642996f, - 0.9937873590233535f, - 0.9938019190541295f, - 0.9938164620563781f, - 0.99383098802985f, - 0.9938454969742966f, - 0.993859988889469f, - 0.993874463775119f, - 0.9938889216309986f, - 0.9939033624568601f, - 0.9939177862524559f, - 0.9939321930175389f, - 0.9939465827518624f, - 0.9939609554551797f, - 0.9939753111272446f, - 0.993989649767811f, - 0.9940039713766333f, - 0.9940182759534661f, - 0.9940325634980643f, - 0.9940468340101831f, - 0.9940610874895779f, - 0.9940753239360045f, - 0.9940895433492191f, - 0.9941037457289779f, - 0.9941179310750375f, - 0.9941320993871551f, - 0.9941462506650875f, - 0.9941603849085927f, - 0.9941745021174282f, - 0.9941886022913522f, - 0.994202685430123f, - 0.9942167515334995f, - 0.9942308006012406f, - 0.9942448326331054f, - 0.9942588476288536f, - 0.9942728455882452f, - 0.9942868265110402f, - 0.9943007903969989f, - 0.9943147372458823f, - 0.9943286670574512f, - 0.994342579831467f, - 0.9943564755676915f, - 0.9943703542658863f, - 0.9943842159258137f, - 0.9943980605472362f, - 0.9944118881299167f, - 0.9944256986736181f, - 0.9944394921781038f, - 0.9944532686431374f, - 0.994467028068483f, - 0.9944807704539047f, - 0.994494495799167f, - 0.9945082041040348f, - 0.9945218953682733f, - 0.9945355695916478f, - 0.994549226773924f, - 0.9945628669148678f, - 0.9945764900142456f, - 0.9945900960718239f, - 0.9946036850873697f, - 0.9946172570606501f, - 0.9946308119914323f, - 0.9946443498794845f, - 0.9946578707245742f, - 0.9946713745264703f, - 0.9946848612849409f, - 0.9946983309997552f, - 0.9947117836706824f, - 0.9947252192974918f, - 0.9947386378799533f, - 0.9947520394178371f, - 0.9947654239109133f, - 0.9947787913589528f, - 0.9947921417617265f, - 0.9948054751190055f, - 0.9948187914305615f, - 0.9948320906961663f, - 0.9948453729155919f, - 0.9948586380886109f, - 0.9948718862149959f, - 0.9948851172945199f, - 0.9948983313269562f, - 0.9949115283120783f, - 0.9949247082496602f, - 0.994937871139476f, - 0.9949510169813002f, - 0.9949641457749074f, - 0.9949772575200729f, - 0.9949903522165718f, - 0.99500342986418f, - 0.9950164904626732f, - 0.9950295340118275f, - 0.9950425605114196f, - 0.9950555699612262f, - 0.9950685623610246f, - 0.9950815377105919f, - 0.9950944960097059f, - 0.9951074372581447f, - 0.9951203614556862f, - 0.9951332686021092f, - 0.9951461586971925f, - 0.9951590317407152f, - 0.9951718877324568f, - 0.9951847266721968f, - 0.9951975485597155f, - 0.9952103533947931f, - 0.9952231411772101f, - 0.9952359119067475f, - 0.9952486655831865f, - 0.9952614022063083f, - 0.995274121775895f, - 0.9952868242917284f, - 0.995299509753591f, - 0.9953121781612654f, - 0.9953248295145346f, - 0.9953374638131817f, - 0.9953500810569902f, - 0.9953626812457439f, - 0.9953752643792271f, - 0.995387830457224f, - 0.9954003794795193f, - 0.9954129114458982f, - 0.9954254263561456f, - 0.9954379242100473f, - 0.995450405007389f, - 0.9954628687479571f, - 0.9954753154315378f, - 0.9954877450579179f, - 0.9955001576268845f, - 0.9955125531382248f, - 0.9955249315917265f, - 0.9955372929871774f, - 0.9955496373243657f, - 0.99556196460308f, - 0.995574274823109f, - 0.9955865679842417f, - 0.9955988440862675f, - 0.9956111031289763f, - 0.9956233451121576f, - 0.9956355700356019f, - 0.9956477778990998f, - 0.9956599687024419f, - 0.9956721424454194f, - 0.9956842991278237f, - 0.9956964387494467f, - 0.9957085613100801f, - 0.9957206668095163f, - 0.995732755247548f, - 0.9957448266239678f, - 0.9957568809385691f, - 0.9957689181911452f, - 0.99578093838149f, - 0.9957929415093973f, - 0.9958049275746618f, - 0.9958168965770776f, - 0.9958288485164402f, - 0.9958407833925443f, - 0.9958527012051857f, - 0.99586460195416f, - 0.9958764856392636f, - 0.9958883522602925f, - 0.9959002018170436f, - 0.9959120343093137f, - 0.9959238497369003f, - 0.9959356480996007f, - 0.9959474293972128f, - 0.9959591936295349f, - 0.9959709407963652f, - 0.9959826708975025f, - 0.9959943839327459f, - 0.9960060799018945f, - 0.996017758804748f, - 0.9960294206411063f, - 0.9960410654107695f, - 0.9960526931135383f, - 0.9960643037492132f, - 0.9960758973175954f, - 0.9960874738184862f, - 0.9960990332516871f, - 0.9961105756170003f, - 0.9961221009142279f, - 0.9961336091431725f, - 0.9961451003036367f, - 0.9961565743954237f, - 0.996168031418337f, - 0.9961794713721802f, - 0.9961908942567572f, - 0.9962023000718725f, - 0.9962136888173304f, - 0.996225060492936f, - 0.9962364150984943f, - 0.9962477526338107f, - 0.996259073098691f, - 0.9962703764929413f, - 0.9962816628163678f, - 0.9962929320687772f, - 0.9963041842499764f, - 0.9963154193597725f, - 0.996326637397973f, - 0.9963378383643858f, - 0.996349022258819f, - 0.9963601890810808f, - 0.99637133883098f, - 0.9963824715083254f, - 0.9963935871129264f, - 0.9964046856445924f, - 0.9964157671031334f, - 0.9964268314883593f, - 0.9964378788000807f, - 0.9964489090381083f, - 0.996459922202253f, - 0.9964709182923261f, - 0.9964818973081393f, - 0.9964928592495044f, - 0.9965038041162334f, - 0.9965147319081391f, - 0.9965256426250341f, - 0.9965365362667313f, - 0.9965474128330444f, - 0.9965582723237866f, - 0.9965691147387721f, - 0.9965799400778151f, - 0.99659074834073f, - 0.9966015395273318f, - 0.9966123136374353f, - 0.9966230706708561f, - 0.9966338106274099f, - 0.9966445335069125f, - 0.9966552393091803f, - 0.9966659280340299f, - 0.996676599681278f, - 0.9966872542507419f, - 0.9966978917422389f, - 0.9967085121555869f, - 0.9967191154906037f, - 0.9967297017471077f, - 0.9967402709249177f, - 0.9967508230238523f, - 0.9967613580437309f, - 0.9967718759843729f, - 0.9967823768455981f, - 0.9967928606272266f, - 0.9968033273290787f, - 0.9968137769509751f, - 0.9968242094927366f, - 0.9968346249541847f, - 0.9968450233351408f, - 0.9968554046354268f, - 0.9968657688548647f, - 0.9968761159932769f, - 0.9968864460504862f, - 0.9968967590263156f, - 0.9969070549205883f, - 0.996917333733128f, - 0.9969275954637584f, - 0.9969378401123039f, - 0.9969480676785889f, - 0.996958278162438f, - 0.9969684715636763f, - 0.9969786478821293f, - 0.9969888071176224f, - 0.9969989492699817f, - 0.9970090743390333f, - 0.9970191823246038f, - 0.99702927322652f, - 0.997039347044609f, - 0.9970494037786981f, - 0.997059443428615f, - 0.9970694659941878f, - 0.9970794714752446f, - 0.9970894598716139f, - 0.9970994311831248f, - 0.9971093854096064f, - 0.997119322550888f, - 0.9971292426067994f, - 0.9971391455771705f, - 0.9971490314618319f, - 0.9971589002606139f, - 0.9971687519733476f, - 0.9971785865998641f, - 0.997188404139995f, - 0.997198204593572f, - 0.9972079879604271f, - 0.9972177542403927f, - 0.9972275034333016f, - 0.9972372355389866f, - 0.9972469505572809f, - 0.9972566484880182f, - 0.9972663293310322f, - 0.9972759930861571f, - 0.9972856397532273f, - 0.9972952693320775f, - 0.9973048818225426f, - 0.9973144772244581f, - 0.9973240555376595f, - 0.9973336167619825f, - 0.9973431608972635f, - 0.9973526879433389f, - 0.9973621979000453f, - 0.99737169076722f, - 0.9973811665447002f, - 0.9973906252323236f, - 0.9974000668299281f, - 0.9974094913373519f, - 0.9974188987544336f, - 0.9974282890810118f, - 0.9974376623169258f, - 0.9974470184620149f, - 0.9974563575161188f, - 0.9974656794790775f, - 0.9974749843507313f, - 0.9974842721309207f, - 0.9974935428194865f, - 0.99750279641627f, - 0.9975120329211127f, - 0.997521252333856f, - 0.9975304546543423f, - 0.9975396398824137f, - 0.9975488080179128f, - 0.9975579590606826f, - 0.9975670930105662f, - 0.9975762098674072f, - 0.9975853096310494f, - 0.9975943923013368f, - 0.9976034578781139f, - 0.9976125063612252f, - 0.9976215377505157f, - 0.9976305520458307f, - 0.9976395492470157f, - 0.9976485293539166f, - 0.9976574923663794f, - 0.9976664382842505f, - 0.9976753671073768f, - 0.9976842788356053f, - 0.9976931734687832f, - 0.997702051006758f, - 0.9977109114493777f, - 0.9977197547964906f, - 0.997728581047945f, - 0.9977373902035896f, - 0.9977461822632737f, - 0.9977549572268465f, - 0.9977637150941577f, - 0.9977724558650571f, - 0.9977811795393952f, - 0.9977898861170221f, - 0.9977985755977891f, - 0.9978072479815469f, - 0.9978159032681472f, - 0.9978245414574415f, - 0.9978331625492818f, - 0.9978417665435205f, - 0.9978503534400102f, - 0.9978589232386035f, - 0.9978674759391538f, - 0.9978760115415145f, - 0.9978845300455393f, - 0.9978930314510823f, - 0.9979015157579979f, - 0.9979099829661405f, - 0.9979184330753651f, - 0.997926866085527f, - 0.9979352819964817f, - 0.9979436808080849f, - 0.9979520625201928f, - 0.9979604271326616f, - 0.9979687746453482f, - 0.9979771050581093f, - 0.9979854183708025f, - 0.9979937145832851f, - 0.998001993695415f, - 0.9980102557070504f, - 0.9980185006180496f, - 0.9980267284282716f, - 0.9980349391375751f, - 0.9980431327458196f, - 0.9980513092528646f, - 0.9980594686585701f, - 0.9980676109627962f, - 0.9980757361654035f, - 0.9980838442662526f, - 0.9980919352652047f, - 0.9981000091621212f, - 0.9981080659568636f, - 0.998116105649294f, - 0.9981241282392745f, - 0.9981321337266679f, - 0.9981401221113367f, - 0.9981480933931443f, - 0.9981560475719538f, - 0.9981639846476291f, - 0.9981719046200344f, - 0.9981798074890336f, - 0.9981876932544914f, - 0.9981955619162729f, - 0.9982034134742431f, - 0.9982112479282674f, - 0.9982190652782118f, - 0.9982268655239421f, - 0.9982346486653247f, - 0.9982424147022264f, - 0.9982501636345139f, - 0.9982578954620546f, - 0.9982656101847159f, - 0.9982733078023657f, - 0.998280988314872f, - 0.9982886517221033f, - 0.9982962980239283f, - 0.9983039272202159f, - 0.9983115393108354f, - 0.9983191342956564f, - 0.9983267121745487f, - 0.9983342729473825f, - 0.9983418166140283f, - 0.9983493431743568f, - 0.998356852628239f, - 0.9983643449755462f, - 0.9983718202161501f, - 0.9983792783499226f, - 0.9983867193767358f, - 0.9983941432964624f, - 0.998401550108975f, - 0.9984089398141468f, - 0.9984163124118512f, - 0.9984236679019618f, - 0.9984310062843526f, - 0.9984383275588977f, - 0.998445631725472f, - 0.99845291878395f, - 0.998460188734207f, - 0.9984674415761184f, - 0.99847467730956f, - 0.9984818959344077f, - 0.9984890974505379f, - 0.9984962818578272f, - 0.9985034491561524f, - 0.9985105993453908f, - 0.9985177324254199f, - 0.9985248483961172f, - 0.9985319472573612f, - 0.9985390290090299f, - 0.9985460936510022f, - 0.998553141183157f, - 0.9985601716053734f, - 0.998567184917531f, - 0.9985741811195097f, - 0.9985811602111896f, - 0.9985881221924512f, - 0.9985950670631749f, - 0.9986019948232421f, - 0.9986089054725338f, - 0.9986157990109317f, - 0.9986226754383176f, - 0.9986295347545738f, - 0.9986363769595828f, - 0.9986432020532272f, - 0.9986500100353901f, - 0.998656800905955f, - 0.9986635746648053f, - 0.998670331311825f, - 0.9986770708468985f, - 0.9986837932699102f, - 0.9986904985807448f, - 0.9986971867792875f, - 0.9987038578654238f, - 0.9987105118390394f, - 0.99871714870002f, - 0.9987237684482522f, - 0.9987303710836224f, - 0.9987369566060175f, - 0.9987435250153247f, - 0.9987500763114314f, - 0.9987566104942254f, - 0.9987631275635946f, - 0.9987696275194275f, - 0.9987761103616126f, - 0.9987825760900391f, - 0.9987890247045957f, - 0.9987954562051724f, - 0.9988018705916587f, - 0.9988082678639448f, - 0.9988146480219211f, - 0.9988210110654783f, - 0.9988273569945072f, - 0.9988336858088992f, - 0.9988399975085459f, - 0.9988462920933391f, - 0.9988525695631708f, - 0.9988588299179337f, - 0.9988650731575204f, - 0.9988712992818238f, - 0.9988775082907375f, - 0.998883700184155f, - 0.99888987496197f, - 0.9988960326240769f, - 0.9989021731703701f, - 0.9989082966007445f, - 0.998914402915095f, - 0.9989204921133172f, - 0.9989265641953067f, - 0.9989326191609592f, - 0.9989386570101713f, - 0.9989446777428392f, - 0.9989506813588601f, - 0.9989566678581309f, - 0.9989626372405491f, - 0.9989685895060123f, - 0.9989745246544187f, - 0.9989804426856664f, - 0.9989863435996542f, - 0.9989922273962809f, - 0.9989980940754456f, - 0.9990039436370479f, - 0.9990097760809875f, - 0.9990155914071644f, - 0.9990213896154791f, - 0.9990271707058322f, - 0.9990329346781247f, - 0.9990386815322577f, - 0.9990444112681328f, - 0.9990501238856518f, - 0.9990558193847169f, - 0.9990614977652303f, - 0.999067159027095f, - 0.9990728031702137f, - 0.9990784301944899f, - 0.9990840400998271f, - 0.9990896328861292f, - 0.9990952085533004f, - 0.999100767101245f, - 0.9991063085298679f, - 0.9991118328390742f, - 0.9991173400287691f, - 0.9991228300988584f, - 0.9991283030492478f, - 0.9991337588798437f, - 0.9991391975905526f, - 0.9991446191812813f, - 0.9991500236519368f, - 0.9991554110024266f, - 0.9991607812326584f, - 0.9991661343425401f, - 0.9991714703319801f, - 0.9991767892008868f, - 0.9991820909491692f, - 0.9991873755767364f, - 0.999192643083498f, - 0.9991978934693634f, - 0.9992031267342429f, - 0.9992083428780468f, - 0.9992135419006857f, - 0.9992187238020704f, - 0.9992238885821124f, - 0.9992290362407229f, - 0.9992341667778138f, - 0.9992392801932973f, - 0.9992443764870856f, - 0.9992494556590916f, - 0.999254517709228f, - 0.9992595626374083f, - 0.9992645904435459f, - 0.9992696011275547f, - 0.9992745946893489f, - 0.9992795711288428f, - 0.9992845304459512f, - 0.9992894726405892f, - 0.9992943977126721f, - 0.9992993056621154f, - 0.9993041964888351f, - 0.9993090701927474f, - 0.9993139267737686f, - 0.9993187662318158f, - 0.9993235885668059f, - 0.9993283937786562f, - 0.9993331818672846f, - 0.9993379528326087f, - 0.9993427066745472f, - 0.9993474433930183f, - 0.9993521629879408f, - 0.9993568654592342f, - 0.9993615508068175f, - 0.9993662190306108f, - 0.9993708701305338f, - 0.999375504106507f, - 0.999380120958451f, - 0.9993847206862865f, - 0.9993893032899348f, - 0.9993938687693175f, - 0.9993984171243561f, - 0.9994029483549729f, - 0.9994074624610901f, - 0.9994119594426306f, - 0.9994164392995171f, - 0.9994209020316729f, - 0.9994253476390215f, - 0.9994297761214869f, - 0.9994341874789929f, - 0.9994385817114643f, - 0.9994429588188255f, - 0.9994473188010017f, - 0.999451661657918f, - 0.9994559873895001f, - 0.999460295995674f, - 0.9994645874763657f, - 0.9994688618315016f, - 0.9994731190610087f, - 0.9994773591648138f, - 0.9994815821428444f, - 0.9994857879950282f, - 0.999489976721293f, - 0.999494148321567f, - 0.9994983027957789f, - 0.9995024401438574f, - 0.9995065603657316f, - 0.9995106634613309f, - 0.9995147494305849f, - 0.9995188182734238f, - 0.9995228699897778f, - 0.9995269045795775f, - 0.9995309220427536f, - 0.9995349223792375f, - 0.9995389055889605f, - 0.9995428716718544f, - 0.9995468206278512f, - 0.9995507524568833f, - 0.9995546671588833f, - 0.999558564733784f, - 0.9995624451815189f, - 0.9995663085020212f, - 0.999570154695225f, - 0.9995739837610642f, - 0.9995777956994731f, - 0.9995815905103866f, - 0.9995853681937397f, - 0.9995891287494675f, - 0.9995928721775056f, - 0.9995965984777899f, - 0.9996003076502565f, - 0.9996039996948419f, - 0.9996076746114829f, - 0.9996113324001163f, - 0.9996149730606797f, - 0.9996185965931106f, - 0.9996222029973468f, - 0.9996257922733267f, - 0.9996293644209887f, - 0.9996329194402717f, - 0.9996364573311145f, - 0.9996399780934567f, - 0.999643481727238f, - 0.9996469682323983f, - 0.9996504376088778f, - 0.9996538898566172f, - 0.9996573249755573f, - 0.9996607429656391f, - 0.9996641438268042f, - 0.9996675275589942f, - 0.9996708941621513f, - 0.9996742436362176f, - 0.9996775759811358f, - 0.9996808911968489f, - 0.9996841892832999f, - 0.9996874702404326f, - 0.9996907340681903f, - 0.9996939807665175f, - 0.9996972103353584f, - 0.9997004227746578f, - 0.9997036180843604f, - 0.9997067962644115f, - 0.9997099573147569f, - 0.9997131012353422f, - 0.9997162280261135f, - 0.9997193376870174f, - 0.9997224302180006f, - 0.99972550561901f, - 0.9997285638899929f, - 0.999731605030897f, - 0.9997346290416701f, - 0.9997376359222604f, - 0.9997406256726165f, - 0.9997435982926869f, - 0.9997465537824209f, - 0.9997494921417679f, - 0.9997524133706773f, - 0.9997553174690993f, - 0.999758204436984f, - 0.999761074274282f, - 0.9997639269809441f, - 0.9997667625569213f, - 0.9997695810021652f, - 0.9997723823166274f, - 0.99977516650026f, - 0.9997779335530151f, - 0.9997806834748455f, - 0.999783416265704f, - 0.9997861319255437f, - 0.9997888304543181f, - 0.9997915118519811f, - 0.9997941761184866f, - 0.999796823253789f, - 0.9997994532578429f, - 0.9998020661306034f, - 0.9998046618720255f, - 0.9998072404820648f, - 0.9998098019606773f, - 0.9998123463078188f, - 0.9998148735234459f, - 0.9998173836075153f, - 0.9998198765599838f, - 0.999822352380809f, - 0.9998248110699482f, - 0.9998272526273595f, - 0.9998296770530009f, - 0.9998320843468308f, - 0.999834474508808f, - 0.9998368475388918f, - 0.9998392034370412f, - 0.999841542203216f, - 0.9998438638373761f, - 0.9998461683394817f, - 0.9998484557094933f, - 0.9998507259473718f, - 0.9998529790530782f, - 0.9998552150265739f, - 0.9998574338678207f, - 0.9998596355767804f, - 0.9998618201534154f, - 0.9998639875976882f, - 0.9998661379095618f, - 0.9998682710889991f, - 0.9998703871359639f, - 0.9998724860504196f, - 0.9998745678323304f, - 0.9998766324816606f, - 0.9998786799983749f, - 0.999880710382438f, - 0.9998827236338154f, - 0.9998847197524724f, - 0.9998866987383749f, - 0.9998886605914888f, - 0.9998906053117809f, - 0.9998925328992174f, - 0.9998944433537655f, - 0.9998963366753925f, - 0.9998982128640659f, - 0.9999000719197535f, - 0.9999019138424236f, - 0.9999037386320444f, - 0.999905546288585f, - 0.9999073368120139f, - 0.999909110202301f, - 0.9999108664594155f, - 0.9999126055833274f, - 0.999914327574007f, - 0.9999160324314248f, - 0.9999177201555515f, - 0.999919390746358f, - 0.9999210442038161f, - 0.9999226805278972f, - 0.9999242997185733f, - 0.9999259017758166f, - 0.9999274866995999f, - 0.9999290544898957f, - 0.9999306051466773f, - 0.9999321386699181f, - 0.999933655059592f, - 0.9999351543156727f, - 0.9999366364381348f, - 0.9999381014269527f, - 0.9999395492821014f, - 0.999940980003556f, - 0.9999423935912921f, - 0.9999437900452854f, - 0.9999451693655121f, - 0.9999465315519485f, - 0.9999478766045711f, - 0.999949204523357f, - 0.9999505153082835f, - 0.999951808959328f, - 0.9999530854764684f, - 0.9999543448596829f, - 0.9999555871089498f, - 0.9999568122242479f, - 0.9999580202055561f, - 0.9999592110528538f, - 0.9999603847661206f, - 0.9999615413453363f, - 0.9999626807904812f, - 0.9999638031015358f, - 0.9999649082784806f, - 0.999965996321297f, - 0.9999670672299661f, - 0.9999681210044697f, - 0.9999691576447897f, - 0.9999701771509083f, - 0.9999711795228081f, - 0.9999721647604719f, - 0.9999731328638829f, - 0.9999740838330242f, - 0.9999750176678799f, - 0.9999759343684338f, - 0.9999768339346702f, - 0.9999777163665737f, - 0.9999785816641292f, - 0.9999794298273218f, - 0.9999802608561371f, - 0.9999810747505607f, - 0.9999818715105789f, - 0.9999826511361778f, - 0.9999834136273441f, - 0.9999841589840648f, - 0.999984887206327f, - 0.9999855982941185f, - 0.9999862922474267f, - 0.9999869690662402f, - 0.9999876287505469f, - 0.999988271300336f, - 0.999988896715596f, - 0.9999895049963164f, - 0.9999900961424869f, - 0.9999906701540973f, - 0.9999912270311376f, - 0.9999917667735985f, - 0.9999922893814706f, - 0.999992794854745f, - 0.999993283193413f, - 0.9999937543974662f, - 0.9999942084668966f, - 0.9999946454016965f, - 0.9999950652018582f, - 0.9999954678673746f, - 0.9999958533982388f, - 0.9999962217944444f, - 0.9999965730559848f, - 0.999996907182854f, - 0.9999972241750464f, - 0.9999975240325565f, - 0.9999978067553793f, - 0.9999980723435097f, - 0.9999983207969434f, - 0.999998552115676f, - 0.9999987662997035f, - 0.9999989633490224f, - 0.9999991432636292f, - 0.9999993060435208f, - 0.9999994516886945f, - 0.9999995801991477f, - 0.9999996915748783f, - 0.9999997858158843f, - 0.9999998629221643f, - 0.9999999228937166f, - 0.9999999657305405f, - 0.9999999914326351f, - 1.0f, - 0.9999999914326351f, - 0.9999999657305405f, - 0.9999999228937166f, - 0.9999998629221643f, - 0.9999997858158843f, - 0.9999996915748783f, - 0.9999995801991477f, - 0.9999994516886945f, - 0.9999993060435208f, - 0.9999991432636292f, - 0.9999989633490224f, - 0.9999987662997035f, - 0.999998552115676f, - 0.9999983207969434f, - 0.9999980723435097f, - 0.9999978067553793f, - 0.9999975240325565f, - 0.9999972241750464f, - 0.999996907182854f, - 0.9999965730559848f, - 0.9999962217944444f, - 0.9999958533982388f, - 0.9999954678673746f, - 0.9999950652018582f, - 0.9999946454016965f, - 0.9999942084668966f, - 0.9999937543974662f, - 0.999993283193413f, - 0.999992794854745f, - 0.9999922893814706f, - 0.9999917667735985f, - 0.9999912270311376f, - 0.9999906701540973f, - 0.9999900961424869f, - 0.9999895049963164f, - 0.999988896715596f, - 0.999988271300336f, - 0.9999876287505469f, - 0.9999869690662402f, - 0.9999862922474267f, - 0.9999855982941185f, - 0.999984887206327f, - 0.9999841589840648f, - 0.9999834136273441f, - 0.9999826511361778f, - 0.9999818715105789f, - 0.9999810747505607f, - 0.9999802608561371f, - 0.9999794298273218f, - 0.9999785816641292f, - 0.9999777163665737f, - 0.9999768339346702f, - 0.9999759343684338f, - 0.9999750176678799f, - 0.9999740838330242f, - 0.9999731328638829f, - 0.9999721647604719f, - 0.9999711795228081f, - 0.9999701771509083f, - 0.9999691576447897f, - 0.9999681210044697f, - 0.9999670672299661f, - 0.999965996321297f, - 0.9999649082784806f, - 0.9999638031015358f, - 0.9999626807904812f, - 0.9999615413453363f, - 0.9999603847661206f, - 0.9999592110528538f, - 0.9999580202055561f, - 0.9999568122242479f, - 0.9999555871089498f, - 0.9999543448596829f, - 0.9999530854764684f, - 0.999951808959328f, - 0.9999505153082835f, - 0.999949204523357f, - 0.9999478766045711f, - 0.9999465315519485f, - 0.9999451693655121f, - 0.9999437900452854f, - 0.9999423935912921f, - 0.999940980003556f, - 0.9999395492821014f, - 0.9999381014269527f, - 0.9999366364381348f, - 0.9999351543156727f, - 0.999933655059592f, - 0.9999321386699181f, - 0.9999306051466773f, - 0.9999290544898957f, - 0.9999274866995999f, - 0.9999259017758166f, - 0.9999242997185733f, - 0.9999226805278972f, - 0.9999210442038161f, - 0.999919390746358f, - 0.9999177201555515f, - 0.9999160324314248f, - 0.999914327574007f, - 0.9999126055833274f, - 0.9999108664594155f, - 0.999909110202301f, - 0.9999073368120139f, - 0.999905546288585f, - 0.9999037386320445f, - 0.9999019138424236f, - 0.9999000719197535f, - 0.9998982128640659f, - 0.9998963366753925f, - 0.9998944433537655f, - 0.9998925328992174f, - 0.9998906053117809f, - 0.9998886605914888f, - 0.9998866987383749f, - 0.9998847197524724f, - 0.9998827236338154f, - 0.9998807103824381f, - 0.9998786799983749f, - 0.9998766324816606f, - 0.9998745678323304f, - 0.9998724860504196f, - 0.9998703871359639f, - 0.9998682710889991f, - 0.9998661379095618f, - 0.9998639875976882f, - 0.9998618201534154f, - 0.9998596355767804f, - 0.9998574338678207f, - 0.9998552150265739f, - 0.9998529790530782f, - 0.9998507259473718f, - 0.9998484557094933f, - 0.9998461683394817f, - 0.9998438638373761f, - 0.999841542203216f, - 0.9998392034370412f, - 0.9998368475388918f, - 0.9998344745088081f, - 0.9998320843468308f, - 0.9998296770530009f, - 0.9998272526273595f, - 0.9998248110699482f, - 0.999822352380809f, - 0.9998198765599838f, - 0.9998173836075153f, - 0.9998148735234459f, - 0.9998123463078188f, - 0.9998098019606773f, - 0.9998072404820648f, - 0.9998046618720255f, - 0.9998020661306034f, - 0.9997994532578429f, - 0.999796823253789f, - 0.9997941761184866f, - 0.9997915118519811f, - 0.9997888304543181f, - 0.9997861319255437f, - 0.999783416265704f, - 0.9997806834748455f, - 0.9997779335530151f, - 0.99977516650026f, - 0.9997723823166275f, - 0.9997695810021652f, - 0.9997667625569213f, - 0.9997639269809441f, - 0.999761074274282f, - 0.999758204436984f, - 0.9997553174690993f, - 0.9997524133706773f, - 0.9997494921417679f, - 0.9997465537824209f, - 0.9997435982926869f, - 0.9997406256726165f, - 0.9997376359222604f, - 0.9997346290416701f, - 0.999731605030897f, - 0.9997285638899929f, - 0.99972550561901f, - 0.9997224302180006f, - 0.9997193376870174f, - 0.9997162280261135f, - 0.9997131012353422f, - 0.9997099573147569f, - 0.9997067962644115f, - 0.9997036180843604f, - 0.9997004227746578f, - 0.9996972103353584f, - 0.9996939807665175f, - 0.9996907340681903f, - 0.9996874702404326f, - 0.9996841892832999f, - 0.9996808911968489f, - 0.9996775759811358f, - 0.9996742436362176f, - 0.9996708941621513f, - 0.9996675275589942f, - 0.9996641438268042f, - 0.9996607429656391f, - 0.9996573249755573f, - 0.9996538898566173f, - 0.9996504376088778f, - 0.9996469682323983f, - 0.999643481727238f, - 0.9996399780934567f, - 0.9996364573311145f, - 0.9996329194402717f, - 0.9996293644209887f, - 0.9996257922733267f, - 0.9996222029973468f, - 0.9996185965931106f, - 0.9996149730606797f, - 0.9996113324001163f, - 0.9996076746114829f, - 0.9996039996948419f, - 0.9996003076502565f, - 0.9995965984777899f, - 0.9995928721775056f, - 0.9995891287494675f, - 0.9995853681937397f, - 0.9995815905103866f, - 0.9995777956994731f, - 0.9995739837610642f, - 0.999570154695225f, - 0.9995663085020212f, - 0.9995624451815189f, - 0.999558564733784f, - 0.9995546671588833f, - 0.9995507524568833f, - 0.9995468206278512f, - 0.9995428716718544f, - 0.9995389055889605f, - 0.9995349223792375f, - 0.9995309220427536f, - 0.9995269045795775f, - 0.9995228699897779f, - 0.9995188182734239f, - 0.9995147494305849f, - 0.9995106634613309f, - 0.9995065603657316f, - 0.9995024401438574f, - 0.9994983027957789f, - 0.999494148321567f, - 0.999489976721293f, - 0.9994857879950282f, - 0.9994815821428444f, - 0.9994773591648138f, - 0.9994731190610087f, - 0.9994688618315016f, - 0.9994645874763657f, - 0.999460295995674f, - 0.9994559873895001f, - 0.999451661657918f, - 0.9994473188010017f, - 0.9994429588188255f, - 0.9994385817114643f, - 0.9994341874789929f, - 0.9994297761214869f, - 0.9994253476390215f, - 0.9994209020316729f, - 0.9994164392995171f, - 0.9994119594426306f, - 0.9994074624610901f, - 0.9994029483549729f, - 0.9993984171243561f, - 0.9993938687693175f, - 0.9993893032899348f, - 0.9993847206862865f, - 0.999380120958451f, - 0.999375504106507f, - 0.9993708701305338f, - 0.9993662190306108f, - 0.9993615508068175f, - 0.9993568654592342f, - 0.9993521629879409f, - 0.9993474433930183f, - 0.9993427066745472f, - 0.9993379528326088f, - 0.9993331818672846f, - 0.9993283937786562f, - 0.9993235885668059f, - 0.9993187662318158f, - 0.9993139267737686f, - 0.9993090701927474f, - 0.9993041964888351f, - 0.9992993056621154f, - 0.9992943977126721f, - 0.9992894726405892f, - 0.9992845304459512f, - 0.9992795711288428f, - 0.9992745946893489f, - 0.9992696011275547f, - 0.9992645904435459f, - 0.9992595626374083f, - 0.999254517709228f, - 0.9992494556590916f, - 0.9992443764870856f, - 0.9992392801932973f, - 0.9992341667778138f, - 0.9992290362407229f, - 0.9992238885821124f, - 0.9992187238020706f, - 0.9992135419006857f, - 0.9992083428780468f, - 0.9992031267342429f, - 0.9991978934693634f, - 0.999192643083498f, - 0.9991873755767364f, - 0.9991820909491692f, - 0.9991767892008868f, - 0.9991714703319801f, - 0.9991661343425401f, - 0.9991607812326584f, - 0.9991554110024267f, - 0.9991500236519368f, - 0.9991446191812813f, - 0.9991391975905526f, - 0.9991337588798437f, - 0.9991283030492478f, - 0.9991228300988584f, - 0.9991173400287692f, - 0.9991118328390742f, - 0.9991063085298679f, - 0.999100767101245f, - 0.9990952085533004f, - 0.9990896328861292f, - 0.9990840400998271f, - 0.9990784301944899f, - 0.9990728031702137f, - 0.999067159027095f, - 0.9990614977652303f, - 0.9990558193847169f, - 0.9990501238856518f, - 0.9990444112681328f, - 0.9990386815322577f, - 0.9990329346781247f, - 0.9990271707058324f, - 0.9990213896154791f, - 0.9990155914071644f, - 0.9990097760809875f, - 0.9990039436370479f, - 0.9989980940754456f, - 0.9989922273962809f, - 0.9989863435996542f, - 0.9989804426856664f, - 0.9989745246544187f, - 0.9989685895060123f, - 0.9989626372405491f, - 0.9989566678581309f, - 0.9989506813588601f, - 0.9989446777428392f, - 0.9989386570101713f, - 0.9989326191609592f, - 0.9989265641953067f, - 0.9989204921133172f, - 0.998914402915095f, - 0.9989082966007445f, - 0.9989021731703701f, - 0.9988960326240769f, - 0.99888987496197f, - 0.998883700184155f, - 0.9988775082907375f, - 0.9988712992818238f, - 0.9988650731575204f, - 0.9988588299179337f, - 0.9988525695631708f, - 0.9988462920933391f, - 0.9988399975085459f, - 0.9988336858088992f, - 0.9988273569945072f, - 0.9988210110654783f, - 0.9988146480219211f, - 0.9988082678639448f, - 0.9988018705916587f, - 0.9987954562051724f, - 0.9987890247045957f, - 0.9987825760900391f, - 0.9987761103616126f, - 0.9987696275194275f, - 0.9987631275635946f, - 0.9987566104942254f, - 0.9987500763114314f, - 0.9987435250153247f, - 0.9987369566060175f, - 0.9987303710836224f, - 0.9987237684482522f, - 0.99871714870002f, - 0.9987105118390394f, - 0.9987038578654238f, - 0.9986971867792875f, - 0.9986904985807448f, - 0.9986837932699102f, - 0.9986770708468985f, - 0.998670331311825f, - 0.9986635746648053f, - 0.998656800905955f, - 0.9986500100353901f, - 0.9986432020532272f, - 0.9986363769595828f, - 0.9986295347545738f, - 0.9986226754383176f, - 0.9986157990109317f, - 0.9986089054725338f, - 0.9986019948232421f, - 0.9985950670631749f, - 0.9985881221924512f, - 0.9985811602111897f, - 0.9985741811195098f, - 0.998567184917531f, - 0.9985601716053734f, - 0.998553141183157f, - 0.9985460936510022f, - 0.9985390290090299f, - 0.9985319472573612f, - 0.9985248483961172f, - 0.9985177324254199f, - 0.9985105993453908f, - 0.9985034491561524f, - 0.9984962818578272f, - 0.9984890974505379f, - 0.9984818959344077f, - 0.9984746773095601f, - 0.9984674415761184f, - 0.998460188734207f, - 0.99845291878395f, - 0.998445631725472f, - 0.9984383275588977f, - 0.9984310062843526f, - 0.9984236679019618f, - 0.9984163124118512f, - 0.9984089398141469f, - 0.998401550108975f, - 0.9983941432964624f, - 0.9983867193767358f, - 0.9983792783499226f, - 0.9983718202161501f, - 0.9983643449755462f, - 0.998356852628239f, - 0.9983493431743568f, - 0.9983418166140283f, - 0.9983342729473825f, - 0.9983267121745487f, - 0.9983191342956564f, - 0.9983115393108354f, - 0.9983039272202159f, - 0.9982962980239283f, - 0.9982886517221033f, - 0.998280988314872f, - 0.9982733078023657f, - 0.9982656101847159f, - 0.9982578954620546f, - 0.9982501636345139f, - 0.9982424147022264f, - 0.9982346486653247f, - 0.9982268655239421f, - 0.9982190652782118f, - 0.9982112479282674f, - 0.9982034134742431f, - 0.9981955619162729f, - 0.9981876932544915f, - 0.9981798074890336f, - 0.9981719046200344f, - 0.9981639846476291f, - 0.9981560475719538f, - 0.9981480933931443f, - 0.9981401221113367f, - 0.9981321337266679f, - 0.9981241282392745f, - 0.998116105649294f, - 0.9981080659568636f, - 0.9981000091621212f, - 0.9980919352652047f, - 0.9980838442662526f, - 0.9980757361654035f, - 0.9980676109627962f, - 0.9980594686585701f, - 0.9980513092528646f, - 0.9980431327458196f, - 0.9980349391375751f, - 0.9980267284282716f, - 0.9980185006180496f, - 0.9980102557070504f, - 0.998001993695415f, - 0.9979937145832851f, - 0.9979854183708025f, - 0.9979771050581093f, - 0.9979687746453482f, - 0.9979604271326616f, - 0.9979520625201928f, - 0.9979436808080849f, - 0.9979352819964817f, - 0.997926866085527f, - 0.9979184330753651f, - 0.9979099829661405f, - 0.9979015157579979f, - 0.9978930314510823f, - 0.9978845300455393f, - 0.9978760115415145f, - 0.9978674759391538f, - 0.9978589232386035f, - 0.9978503534400102f, - 0.9978417665435205f, - 0.9978331625492818f, - 0.9978245414574415f, - 0.9978159032681472f, - 0.9978072479815469f, - 0.9977985755977891f, - 0.9977898861170221f, - 0.9977811795393952f, - 0.9977724558650571f, - 0.9977637150941577f, - 0.9977549572268466f, - 0.9977461822632737f, - 0.9977373902035898f, - 0.997728581047945f, - 0.9977197547964907f, - 0.9977109114493777f, - 0.997702051006758f, - 0.9976931734687832f, - 0.9976842788356053f, - 0.9976753671073768f, - 0.9976664382842505f, - 0.9976574923663794f, - 0.9976485293539165f, - 0.9976395492470157f, - 0.9976305520458307f, - 0.9976215377505158f, - 0.9976125063612252f, - 0.9976034578781139f, - 0.9975943923013368f, - 0.9975853096310495f, - 0.9975762098674072f, - 0.9975670930105662f, - 0.9975579590606826f, - 0.9975488080179128f, - 0.9975396398824137f, - 0.9975304546543422f, - 0.997521252333856f, - 0.9975120329211127f, - 0.9975027964162702f, - 0.9974935428194865f, - 0.9974842721309207f, - 0.9974749843507313f, - 0.9974656794790776f, - 0.9974563575161188f, - 0.9974470184620149f, - 0.9974376623169258f, - 0.9974282890810118f, - 0.9974188987544336f, - 0.9974094913373519f, - 0.9974000668299281f, - 0.9973906252323237f, - 0.9973811665447003f, - 0.9973716907672201f, - 0.9973621979000453f, - 0.9973526879433389f, - 0.9973431608972635f, - 0.9973336167619825f, - 0.9973240555376595f, - 0.9973144772244581f, - 0.9973048818225426f, - 0.9972952693320775f, - 0.9972856397532273f, - 0.9972759930861571f, - 0.9972663293310322f, - 0.9972566484880182f, - 0.9972469505572809f, - 0.9972372355389866f, - 0.9972275034333016f, - 0.9972177542403927f, - 0.9972079879604271f, - 0.9971982045935719f, - 0.997188404139995f, - 0.9971785865998641f, - 0.9971687519733476f, - 0.9971589002606139f, - 0.9971490314618319f, - 0.9971391455771705f, - 0.9971292426067994f, - 0.997119322550888f, - 0.9971093854096064f, - 0.9970994311831248f, - 0.9970894598716139f, - 0.9970794714752446f, - 0.9970694659941878f, - 0.997059443428615f, - 0.9970494037786981f, - 0.9970393470446091f, - 0.99702927322652f, - 0.9970191823246038f, - 0.9970090743390334f, - 0.9969989492699818f, - 0.9969888071176224f, - 0.9969786478821293f, - 0.9969684715636763f, - 0.996958278162438f, - 0.9969480676785889f, - 0.9969378401123039f, - 0.9969275954637584f, - 0.996917333733128f, - 0.9969070549205883f, - 0.9968967590263156f, - 0.9968864460504863f, - 0.9968761159932769f, - 0.9968657688548647f, - 0.9968554046354268f, - 0.9968450233351408f, - 0.9968346249541847f, - 0.9968242094927366f, - 0.9968137769509751f, - 0.9968033273290787f, - 0.9967928606272266f, - 0.9967823768455981f, - 0.996771875984373f, - 0.9967613580437309f, - 0.9967508230238523f, - 0.9967402709249177f, - 0.9967297017471077f, - 0.9967191154906037f, - 0.9967085121555869f, - 0.9966978917422389f, - 0.9966872542507419f, - 0.9966765996812781f, - 0.9966659280340299f, - 0.9966552393091803f, - 0.9966445335069125f, - 0.9966338106274099f, - 0.9966230706708561f, - 0.9966123136374353f, - 0.9966015395273318f, - 0.99659074834073f, - 0.9965799400778151f, - 0.9965691147387721f, - 0.9965582723237866f, - 0.9965474128330444f, - 0.9965365362667314f, - 0.9965256426250341f, - 0.9965147319081391f, - 0.9965038041162335f, - 0.9964928592495044f, - 0.9964818973081393f, - 0.9964709182923261f, - 0.996459922202253f, - 0.9964489090381082f, - 0.9964378788000807f, - 0.9964268314883593f, - 0.9964157671031334f, - 0.9964046856445924f, - 0.9963935871129264f, - 0.9963824715083254f, - 0.99637133883098f, - 0.9963601890810808f, - 0.996349022258819f, - 0.9963378383643858f, - 0.996326637397973f, - 0.9963154193597725f, - 0.9963041842499764f, - 0.9962929320687772f, - 0.9962816628163678f, - 0.9962703764929413f, - 0.996259073098691f, - 0.9962477526338107f, - 0.9962364150984943f, - 0.996225060492936f, - 0.9962136888173304f, - 0.9962023000718725f, - 0.9961908942567573f, - 0.9961794713721802f, - 0.996168031418337f, - 0.9961565743954237f, - 0.9961451003036367f, - 0.9961336091431725f, - 0.996122100914228f, - 0.9961105756170003f, - 0.9960990332516872f, - 0.9960874738184862f, - 0.9960758973175954f, - 0.9960643037492132f, - 0.9960526931135383f, - 0.9960410654107695f, - 0.9960294206411063f, - 0.996017758804748f, - 0.9960060799018945f, - 0.9959943839327459f, - 0.9959826708975025f, - 0.9959709407963652f, - 0.9959591936295349f, - 0.9959474293972129f, - 0.9959356480996007f, - 0.9959238497369003f, - 0.9959120343093137f, - 0.9959002018170435f, - 0.9958883522602925f, - 0.9958764856392636f, - 0.99586460195416f, - 0.9958527012051857f, - 0.9958407833925443f, - 0.9958288485164402f, - 0.9958168965770777f, - 0.9958049275746618f, - 0.9957929415093973f, - 0.99578093838149f, - 0.9957689181911452f, - 0.9957568809385692f, - 0.9957448266239679f, - 0.995732755247548f, - 0.9957206668095163f, - 0.9957085613100801f, - 0.9956964387494467f, - 0.9956842991278239f, - 0.9956721424454195f, - 0.9956599687024419f, - 0.9956477778990998f, - 0.9956355700356019f, - 0.9956233451121576f, - 0.9956111031289762f, - 0.9955988440862676f, - 0.9955865679842417f, - 0.995574274823109f, - 0.99556196460308f, - 0.9955496373243657f, - 0.9955372929871774f, - 0.9955249315917265f, - 0.9955125531382248f, - 0.9955001576268846f, - 0.9954877450579179f, - 0.9954753154315379f, - 0.9954628687479571f, - 0.9954504050073891f, - 0.9954379242100473f, - 0.9954254263561456f, - 0.9954129114458982f, - 0.9954003794795193f, - 0.995387830457224f, - 0.9953752643792271f, - 0.995362681245744f, - 0.9953500810569902f, - 0.9953374638131816f, - 0.9953248295145346f, - 0.9953121781612654f, - 0.995299509753591f, - 0.9952868242917284f, - 0.995274121775895f, - 0.9952614022063083f, - 0.9952486655831865f, - 0.9952359119067475f, - 0.9952231411772102f, - 0.9952103533947931f, - 0.9951975485597157f, - 0.9951847266721969f, - 0.9951718877324568f, - 0.9951590317407152f, - 0.9951461586971925f, - 0.9951332686021092f, - 0.9951203614556862f, - 0.9951074372581447f, - 0.9950944960097059f, - 0.9950815377105919f, - 0.9950685623610246f, - 0.9950555699612263f, - 0.9950425605114196f, - 0.9950295340118275f, - 0.9950164904626732f, - 0.99500342986418f, - 0.994990352216572f, - 0.9949772575200729f, - 0.9949641457749074f, - 0.9949510169813002f, - 0.994937871139476f, - 0.9949247082496602f, - 0.9949115283120783f, - 0.9948983313269562f, - 0.9948851172945199f, - 0.9948718862149959f, - 0.9948586380886109f, - 0.9948453729155919f, - 0.9948320906961663f, - 0.9948187914305615f, - 0.9948054751190055f, - 0.9947921417617265f, - 0.9947787913589529f, - 0.9947654239109134f, - 0.9947520394178371f, - 0.9947386378799533f, - 0.9947252192974918f, - 0.9947117836706824f, - 0.9946983309997552f, - 0.9946848612849408f, - 0.9946713745264703f, - 0.9946578707245742f, - 0.9946443498794845f, - 0.9946308119914323f, - 0.9946172570606501f, - 0.9946036850873697f, - 0.9945900960718239f, - 0.9945764900142456f, - 0.9945628669148678f, - 0.994549226773924f, - 0.9945355695916478f, - 0.9945218953682734f, - 0.9945082041040348f, - 0.994494495799167f, - 0.9944807704539047f, - 0.994467028068483f, - 0.9944532686431374f, - 0.9944394921781038f, - 0.9944256986736181f, - 0.9944118881299168f, - 0.9943980605472362f, - 0.9943842159258137f, - 0.9943703542658863f, - 0.9943564755676915f, - 0.994342579831467f, - 0.9943286670574512f, - 0.9943147372458823f, - 0.9943007903969989f, - 0.9942868265110402f, - 0.9942728455882452f, - 0.9942588476288537f, - 0.9942448326331055f, - 0.9942308006012406f, - 0.9942167515334995f, - 0.994202685430123f, - 0.9941886022913522f, - 0.9941745021174282f, - 0.9941603849085927f, - 0.9941462506650875f, - 0.9941320993871551f, - 0.9941179310750375f, - 0.9941037457289779f, - 0.9940895433492191f, - 0.9940753239360046f, - 0.9940610874895779f, - 0.9940468340101831f, - 0.9940325634980643f, - 0.9940182759534661f, - 0.9940039713766333f, - 0.993989649767811f, - 0.9939753111272446f, - 0.9939609554551797f, - 0.9939465827518624f, - 0.9939321930175389f, - 0.9939177862524559f, - 0.9939033624568601f, - 0.9938889216309986f, - 0.993874463775119f, - 0.993859988889469f, - 0.9938454969742966f, - 0.99383098802985f, - 0.9938164620563781f, - 0.9938019190541295f, - 0.9937873590233535f, - 0.9937727819642996f, - 0.9937581878772176f, - 0.9937435767623575f, - 0.9937289486199696f, - 0.9937143034503048f, - 0.9936996412536138f, - 0.9936849620301478f, - 0.9936702657801585f, - 0.9936555525038977f, - 0.9936408222016174f, - 0.9936260748735701f, - 0.9936113105200084f, - 0.9935965291411853f, - 0.9935817307373542f, - 0.9935669153087686f, - 0.9935520828556822f, - 0.9935372333783493f, - 0.9935223668770244f, - 0.993507483351962f, - 0.9934925828034176f, - 0.9934776652316458f, - 0.9934627306369029f, - 0.9934477790194444f, - 0.9934328103795266f, - 0.9934178247174059f, - 0.9934028220333393f, - 0.9933878023275837f, - 0.9933727656003964f, - 0.9933577118520353f, - 0.9933426410827579f, - 0.993327553292823f, - 0.9933124484824886f, - 0.9932973266520139f, - 0.9932821878016578f, - 0.9932670319316798f, - 0.9932518590423394f, - 0.9932366691338969f, - 0.9932214622066123f, - 0.9932062382607464f, - 0.9931909972965598f, - 0.9931757393143139f, - 0.99316046431427f, - 0.9931451722966897f, - 0.9931298632618354f, - 0.993114537209969f, - 0.9930991941413535f, - 0.9930838340562514f, - 0.9930684569549263f, - 0.9930530628376414f, - 0.9930376517046605f, - 0.9930222235562478f, - 0.9930067783926676f, - 0.9929913162141845f, - 0.9929758370210634f, - 0.9929603408135695f, - 0.9929448275919686f, - 0.9929292973565264f, - 0.9929137501075087f, - 0.9928981858451823f, - 0.9928826045698137f, - 0.9928670062816699f, - 0.9928513909810182f, - 0.9928357586681261f, - 0.9928201093432615f, - 0.9928044430066926f, - 0.9927887596586877f, - 0.9927730592995158f, - 0.9927573419294455f, - 0.9927416075487465f, - 0.9927258561576883f, - 0.9927100877565406f, - 0.9926943023455738f, - 0.9926784999250583f, - 0.992662680495265f, - 0.9926468440564647f, - 0.992630990608929f, - 0.9926151201529294f, - 0.992599232688738f, - 0.9925833282166268f, - 0.9925674067368683f, - 0.9925514682497356f, - 0.9925355127555016f, - 0.9925195402544398f, - 0.9925035507468237f, - 0.9924875442329275f, - 0.9924715207130254f, - 0.9924554801873918f, - 0.9924394226563017f, - 0.9924233481200302f, - 0.9924072565788528f, - 0.9923911480330452f, - 0.9923750224828832f, - 0.9923588799286435f, - 0.9923427203706023f, - 0.9923265438090368f, - 0.9923103502442241f, - 0.9922941396764415f, - 0.992277912105967f, - 0.9922616675330785f, - 0.9922454059580544f, - 0.9922291273811734f, - 0.9922128318027144f, - 0.9921965192229565f, - 0.9921801896421792f, - 0.9921638430606625f, - 0.9921474794786864f, - 0.9921310988965313f, - 0.9921147013144778f, - 0.992098286732807f, - 0.9920818551518f, - 0.9920654065717385f, - 0.9920489409929042f, - 0.9920324584155794f, - 0.9920159588400463f, - 0.991999442266588f, - 0.991982908695487f, - 0.9919663581270269f, - 0.9919497905614914f, - 0.9919332059991641f, - 0.9919166044403294f, - 0.9918999858852715f, - 0.9918833503342754f, - 0.991866697787626f, - 0.9918500282456089f, - 0.9918333417085092f, - 0.9918166381766135f, - 0.9917999176502074f, - 0.9917831801295777f, - 0.9917664256150112f, - 0.9917496541067949f, - 0.9917328656052162f, - 0.9917160601105628f, - 0.9916992376231227f, - 0.991682398143184f, - 0.9916655416710354f, - 0.9916486682069656f, - 0.9916317777512638f, - 0.9916148703042194f, - 0.9915979458661219f, - 0.9915810044372617f, - 0.9915640460179288f, - 0.991547070608414f, - 0.9915300782090077f, - 0.9915130688200017f, - 0.991496042441687f, - 0.9914789990743555f, - 0.9914619387182991f, - 0.9914448613738105f, - 0.9914277670411819f, - 0.9914106557207063f, - 0.991393527412677f, - 0.9913763821173874f, - 0.9913592198351313f, - 0.9913420405662029f, - 0.9913248443108964f, - 0.9913076310695066f, - 0.9912904008423282f, - 0.9912731536296567f, - 0.9912558894317876f, - 0.9912386082490164f, - 0.9912213100816396f, - 0.9912039949299535f, - 0.9911866627942546f, - 0.9911693136748401f, - 0.9911519475720071f, - 0.9911345644860533f, - 0.9911171644172765f, - 0.9910997473659748f, - 0.9910823133324467f, - 0.991064862316991f, - 0.9910473943199065f, - 0.9910299093414928f, - 0.9910124073820492f, - 0.9909948884418758f, - 0.9909773525212727f, - 0.9909597996205404f, - 0.9909422297399797f, - 0.9909246428798915f, - 0.9909070390405773f, - 0.9908894182223387f, - 0.9908717804254776f, - 0.9908541256502963f, - 0.9908364538970972f, - 0.9908187651661832f, - 0.9908010594578572f, - 0.9907833367724228f, - 0.9907655971101836f, - 0.9907478404714436f, - 0.990730066856507f, - 0.9907122762656784f, - 0.9906944686992625f, - 0.9906766441575646f, - 0.99065880264089f, - 0.9906409441495445f, - 0.990623068683834f, - 0.9906051762440649f, - 0.9905872668305437f, - 0.9905693404435773f, - 0.9905513970834728f, - 0.9905334367505378f, - 0.9905154594450799f, - 0.9904974651674073f, - 0.9904794539178282f, - 0.9904614256966512f, - 0.9904433805041853f, - 0.9904253183407397f, - 0.9904072392066238f, - 0.9903891431021473f, - 0.9903710300276206f, - 0.9903528999833537f, - 0.9903347529696576f, - 0.9903165889868428f, - 0.990298408035221f, - 0.9902802101151035f, - 0.990261995226802f, - 0.9902437633706288f, - 0.9902255145468963f, - 0.9902072487559171f, - 0.9901889659980042f, - 0.990170666273471f, - 0.9901523495826308f, - 0.9901340159257975f, - 0.9901156653032854f, - 0.990097297715409f, - 0.9900789131624829f, - 0.9900605116448219f, - 0.9900420931627417f, - 0.9900236577165575f, - 0.9900052053065856f, - 0.9899867359331419f, - 0.989968249596543f, - 0.9899497462971054f, - 0.9899312260351465f, - 0.9899126888109834f, - 0.9898941346249339f, - 0.9898755634773158f, - 0.9898569753684473f, - 0.989838370298647f, - 0.9898197482682336f, - 0.9898011092775263f, - 0.9897824533268442f, - 0.9897637804165074f, - 0.9897450905468355f, - 0.9897263837181489f, - 0.9897076599307681f, - 0.9896889191850139f, - 0.9896701614812076f, - 0.9896513868196702f, - 0.9896325952007238f, - 0.9896137866246902f, - 0.9895949610918917f, - 0.9895761186026509f, - 0.9895572591572908f, - 0.9895383827561343f, - 0.989519489399505f, - 0.9895005790877264f, - 0.9894816518211228f, - 0.9894627076000184f, - 0.9894437464247379f, - 0.9894247682956061f, - 0.9894057732129481f, - 0.9893867611770896f, - 0.9893677321883562f, - 0.989348686247074f, - 0.9893296233535692f, - 0.9893105435081687f, - 0.9892914467111994f, - 0.9892723329629883f, - 0.9892532022638632f, - 0.9892340546141516f, - 0.9892148900141817f, - 0.989195708464282f, - 0.989176509964781f, - 0.9891572945160078f, - 0.9891380621182916f, - 0.9891188127719618f, - 0.9890995464773485f, - 0.9890802632347816f, - 0.9890609630445917f, - 0.9890416459071093f, - 0.9890223118226656f, - 0.9890029607915917f, - 0.9889835928142193f, - 0.9889642078908802f, - 0.9889448060219067f, - 0.9889253872076309f, - 0.9889059514483859f, - 0.9888864987445046f, - 0.9888670290963203f, - 0.9888475425041665f, - 0.9888280389683773f, - 0.9888085184892869f, - 0.9887889810672295f, - 0.9887694267025401f, - 0.9887498553955536f, - 0.9887302671466056f, - 0.9887106619560315f, - 0.9886910398241674f, - 0.9886714007513494f, - 0.988651744737914f, - 0.9886320717841981f, - 0.9886123818905387f, - 0.9885926750572733f, - 0.9885729512847394f, - 0.9885532105732752f, - 0.9885334529232186f, - 0.9885136783349086f, - 0.9884938868086836f, - 0.9884740783448829f, - 0.9884542529438459f, - 0.9884344106059124f, - 0.9884145513314223f, - 0.9883946751207159f, - 0.9883747819741338f, - 0.9883548718920167f, - 0.988334944874706f, - 0.9883150009225429f, - 0.9882950400358694f, - 0.9882750622150273f, - 0.9882550674603591f, - 0.9882350557722072f, - 0.9882150271509146f, - 0.9881949815968246f, - 0.9881749191102804f, - 0.9881548396916261f, - 0.9881347433412055f, - 0.9881146300593631f, - 0.9880944998464434f, - 0.9880743527027914f, - 0.9880541886287523f, - 0.9880340076246716f, - 0.9880138096908951f, - 0.9879935948277689f, - 0.9879733630356394f, - 0.9879531143148532f, - 0.9879328486657575f, - 0.987912566088699f, - 0.9878922665840258f, - 0.9878719501520854f, - 0.9878516167932261f, - 0.9878312665077962f, - 0.9878108992961444f, - 0.9877905151586197f, - 0.9877701140955715f, - 0.9877496961073491f, - 0.9877292611943025f, - 0.987708809356782f, - 0.9876883405951377f, - 0.9876678549097206f, - 0.9876473523008817f, - 0.9876268327689722f, - 0.9876062963143437f, - 0.9875857429373482f, - 0.9875651726383379f, - 0.987544585417665f, - 0.9875239812756824f, - 0.9875033602127433f, - 0.9874827222292009f, - 0.9874620673254086f, - 0.9874413955017208f, - 0.9874207067584914f, - 0.987400001096075f, - 0.9873792785148262f, - 0.9873585390151004f, - 0.9873377825972526f, - 0.9873170092616388f, - 0.9872962190086146f, - 0.9872754118385366f, - 0.987254587751761f, - 0.9872337467486447f, - 0.987212888829545f, - 0.9871920139948192f, - 0.9871711222448248f, - 0.98715021357992f, - 0.9871292880004631f, - 0.9871083455068124f, - 0.9870873860993268f, - 0.9870664097783656f, - 0.9870454165442881f, - 0.9870244063974541f, - 0.9870033793382236f, - 0.9869823353669567f, - 0.9869612744840142f, - 0.9869401966897569f, - 0.9869191019845459f, - 0.9868979903687428f, - 0.9868768618427093f, - 0.9868557164068074f, - 0.9868345540613992f, - 0.9868133748068477f, - 0.9867921786435155f, - 0.986770965571766f, - 0.9867497355919627f, - 0.986728488704469f, - 0.9867072249096495f, - 0.986685944207868f, - 0.9866646465994896f, - 0.986643332084879f, - 0.9866220006644014f, - 0.9866006523384224f, - 0.9865792871073079f, - 0.9865579049714237f, - 0.9865365059311364f, - 0.9865150899868125f, - 0.9864936571388191f, - 0.9864722073875234f, - 0.9864507407332929f, - 0.9864292571764955f, - 0.9864077567174993f, - 0.9863862393566726f, - 0.9863647050943842f, - 0.9863431539310031f, - 0.9863215858668984f, - 0.98630000090244f, - 0.9862783990379974f, - 0.9862567802739409f, - 0.986235144610641f, - 0.9862134920484683f, - 0.9861918225877938f, - 0.9861701362289889f, - 0.9861484329724252f, - 0.9861267128184743f, - 0.9861049757675088f, - 0.9860832218199008f, - 0.9860614509760234f, - 0.9860396632362493f, - 0.9860178586009519f, - 0.985996037070505f, - 0.9859741986452824f, - 0.9859523433256581f, - 0.9859304711120068f, - 0.9859085820047033f, - 0.9858866760041226f, - 0.9858647531106401f, - 0.9858428133246314f, - 0.9858208566464725f, - 0.9857988830765393f, - 0.9857768926152087f, - 0.9857548852628574f, - 0.9857328610198625f, - 0.9857108198866013f, - 0.9856887618634514f, - 0.985666686950791f, - 0.985644595148998f, - 0.9856224864584513f, - 0.9856003608795295f, - 0.985578218412612f, - 0.9855560590580777f, - 0.9855338828163068f, - 0.9855116896876789f, - 0.9854894796725746f, - 0.9854672527713743f, - 0.9854450089844587f, - 0.9854227483122092f, - 0.9854004707550071f, - 0.9853781763132342f, - 0.9853558649872725f, - 0.9853335367775041f, - 0.9853111916843119f, - 0.9852888297080786f, - 0.9852664508491873f, - 0.9852440551080217f, - 0.9852216424849652f, - 0.9851992129804021f, - 0.9851767665947168f, - 0.9851543033282936f, - 0.9851318231815176f, - 0.9851093261547739f, - 0.9850868122484482f, - 0.9850642814629259f, - 0.9850417337985934f, - 0.9850191692558368f, - 0.984996587835043f, - 0.9849739895365986f, - 0.9849513743608911f, - 0.9849287423083078f, - 0.9849060933792367f, - 0.9848834275740658f, - 0.9848607448931833f, - 0.9848380453369782f, - 0.9848153289058391f, - 0.9847925956001554f, - 0.9847698454203168f, - 0.9847470783667127f, - 0.9847242944397336f, - 0.9847014936397698f, - 0.9846786759672118f, - 0.9846558414224508f, - 0.984632990005878f, - 0.9846101217178849f, - 0.9845872365588633f, - 0.9845643345292053f, - 0.9845414156293036f, - 0.9845184798595507f, - 0.9844955272203396f, - 0.9844725577120637f, - 0.9844495713351165f, - 0.9844265680898916f, - 0.9844035479767836f, - 0.9843805109961867f, - 0.9843574571484958f, - 0.9843343864341058f, - 0.9843112988534118f, - 0.9842881944068098f, - 0.9842650730946955f, - 0.984241934917465f, - 0.984218779875515f, - 0.984195607969242f, - 0.9841724191990431f, - 0.9841492135653158f, - 0.9841259910684574f, - 0.9841027517088663f, - 0.9840794954869402f, - 0.9840562224030779f, - 0.9840329324576781f, - 0.9840096256511397f, - 0.9839863019838624f, - 0.9839629614562455f, - 0.9839396040686892f, - 0.9839162298215935f, - 0.9838928387153592f, - 0.9838694307503867f, - 0.9838460059270775f, - 0.9838225642458326f, - 0.983799105707054f, - 0.9837756303111433f, - 0.9837521380585033f, - 0.9837286289495358f, - 0.9837051029846443f, - 0.9836815601642316f, - 0.9836580004887009f, - 0.9836344239584563f, - 0.9836108305739015f, - 0.983587220335441f, - 0.983563593243479f, - 0.9835399492984207f, - 0.983516288500671f, - 0.9834926108506354f, - 0.9834689163487197f, - 0.9834452049953296f, - 0.9834214767908719f, - 0.9833977317357526f, - 0.9833739698303791f, - 0.9833501910751581f, - 0.9833263954704974f, - 0.9833025830168044f, - 0.9832787537144875f, - 0.9832549075639546f, - 0.9832310445656146f, - 0.9832071647198762f, - 0.9831832680271487f, - 0.9831593544878416f, - 0.9831354241023644f, - 0.9831114768711275f, - 0.983087512794541f, - 0.9830635318730155f, - 0.983039534106962f, - 0.9830155194967917f, - 0.9829914880429159f, - 0.9829674397457466f, - 0.9829433746056958f, - 0.9829192926231759f, - 0.9828951937985994f, - 0.9828710781323792f, - 0.9828469456249287f, - 0.9828227962766612f, - 0.9827986300879908f, - 0.9827744470593314f, - 0.9827502471910973f, - 0.9827260304837031f, - 0.982701796937564f, - 0.982677546553095f, - 0.9826532793307118f, - 0.98262899527083f, - 0.982604694373866f, - 0.9825803766402359f, - 0.9825560420703565f, - 0.982531690664645f, - 0.9825073224235181f, - 0.9824829373473939f, - 0.9824585354366898f, - 0.9824341166918243f, - 0.9824096811132156f, - 0.9823852287012823f, - 0.9823607594564436f, - 0.9823362733791187f, - 0.9823117704697271f, - 0.9822872507286886f, - 0.9822627141564236f, - 0.9822381607533524f, - 0.9822135905198955f, - 0.9821890034564742f, - 0.9821643995635096f, - 0.9821397788414234f, - 0.9821151412906375f, - 0.9820904869115739f, - 0.9820658157046551f, - 0.9820411276703039f, - 0.9820164228089433f, - 0.9819917011209967f, - 0.9819669626068873f, - 0.9819422072670395f, - 0.9819174351018772f, - 0.981892646111825f, - 0.9818678402973076f, - 0.9818430176587499f, - 0.9818181781965774f, - 0.9817933219112157f, - 0.9817684488030907f, - 0.9817435588726284f, - 0.9817186521202556f, - 0.9816937285463989f, - 0.9816687881514853f, - 0.9816438309359423f, - 0.9816188569001975f, - 0.9815938660446787f, - 0.9815688583698141f, - 0.9815438338760325f, - 0.9815187925637624f, - 0.9814937344334329f, - 0.9814686594854736f, - 0.9814435677203137f, - 0.9814184591383837f, - 0.9813933337401133f, - 0.9813681915259334f, - 0.9813430324962745f, - 0.981317856651568f, - 0.9812926639922452f, - 0.9812674545187375f, - 0.9812422282314773f, - 0.9812169851308965f, - 0.9811917252174278f, - 0.9811664484915039f, - 0.981141154953558f, - 0.9811158446040236f, - 0.9810905174433341f, - 0.9810651734719237f, - 0.9810398126902266f, - 0.9810144350986774f, - 0.9809890406977108f, - 0.980963629487762f, - 0.9809382014692665f, - 0.9809127566426599f, - 0.9808872950083781f, - 0.9808618165668577f, - 0.9808363213185349f, - 0.9808108092638469f, - 0.9807852804032304f, - 0.9807597347371233f, - 0.980734172265963f, - 0.9807085929901876f, - 0.9806829969102356f, - 0.9806573840265452f, - 0.9806317543395556f, - 0.9806061078497057f, - 0.9805804445574352f, - 0.9805547644631836f, - 0.980529067567391f, - 0.9805033538704978f, - 0.9804776233729444f, - 0.9804518760751719f, - 0.9804261119776214f, - 0.9804003310807343f, - 0.9803745333849524f, - 0.9803487188907178f, - 0.9803228875984726f, - 0.9802970395086598f, - 0.9802711746217219f, - 0.9802452929381023f, - 0.9802193944582444f, - 0.980193479182592f, - 0.9801675471115892f, - 0.9801415982456801f, - 0.9801156325853096f, - 0.9800896501309226f, - 0.9800636508829642f, - 0.9800376348418799f, - 0.9800116020081155f, - 0.9799855523821172f, - 0.979959485964331f, - 0.9799334027552039f, - 0.9799073027551827f, - 0.9798811859647144f, - 0.9798550523842469f, - 0.9798289020142277f, - 0.9798027348551049f, - 0.9797765509073272f, - 0.9797503501713428f, - 0.9797241326476009f, - 0.9796978983365506f, - 0.9796716472386416f, - 0.9796453793543235f, - 0.9796190946840466f, - 0.9795927932282611f, - 0.9795664749874177f, - 0.9795401399619674f, - 0.9795137881523615f, - 0.9794874195590514f, - 0.979461034182489f, - 0.9794346320231264f, - 0.979408213081416f, - 0.9793817773578104f, - 0.9793553248527628f, - 0.9793288555667261f, - 0.9793023695001541f, - 0.9792758666535006f, - 0.9792493470272198f, - 0.9792228106217659f, - 0.9791962574375935f, - 0.979169687475158f, - 0.9791431007349144f, - 0.9791164972173182f, - 0.9790898769228255f, - 0.979063239851892f, - 0.9790365860049747f, - 0.9790099153825298f, - 0.9789832279850146f, - 0.9789565238128862f, - 0.9789298028666022f, - 0.9789030651466206f, - 0.9788763106533994f, - 0.9788495393873972f, - 0.9788227513490724f, - 0.9787959465388842f, - 0.978769124957292f, - 0.9787422866047553f, - 0.9787154314817338f, - 0.9786885595886878f, - 0.9786616709260778f, - 0.9786347654943645f, - 0.9786078432940089f, - 0.9785809043254722f, - 0.9785539485892161f, - 0.9785269760857024f, - 0.9784999868153934f, - 0.9784729807787513f, - 0.9784459579762393f, - 0.97841891840832f, - 0.9783918620754569f, - 0.9783647889781135f, - 0.978337699116754f, - 0.978310592491842f, - 0.9782834691038426f, - 0.97825632895322f, - 0.9782291720404396f, - 0.9782019983659667f, - 0.9781748079302667f, - 0.9781476007338057f, - 0.9781203767770498f, - 0.9780931360604654f, - 0.9780658785845194f, - 0.9780386043496789f, - 0.9780113133564111f, - 0.9779840056051837f, - 0.9779566810964645f, - 0.9779293398307218f, - 0.9779019818084241f, - 0.97787460703004f, - 0.9778472154960389f, - 0.9778198072068898f, - 0.9777923821630625f, - 0.9777649403650269f, - 0.9777374818132533f, - 0.9777100065082119f, - 0.9776825144503739f, - 0.97765500564021f, - 0.9776274800781918f, - 0.9775999377647907f, - 0.9775723787004789f, - 0.9775448028857284f, - 0.9775172103210118f, - 0.977489601006802f, - 0.9774619749435719f, - 0.977434332131795f, - 0.9774066725719447f, - 0.9773789962644953f, - 0.9773513032099207f, - 0.9773235934086958f, - 0.9772958668612949f, - 0.9772681235681935f, - 0.9772403635298668f, - 0.9772125867467903f, - 0.9771847932194404f, - 0.9771569829482929f, - 0.9771291559338247f, - 0.9771013121765122f, - 0.9770734516768327f, - 0.9770455744352636f, - 0.9770176804522827f, - 0.9769897697283676f, - 0.9769618422639967f, - 0.9769338980596487f, - 0.9769059371158023f, - 0.9768779594329365f, - 0.9768499650115308f, - 0.9768219538520649f, - 0.9767939259550187f, - 0.9767658813208725f, - 0.9767378199501067f, - 0.9767097418432024f, - 0.9766816470006403f, - 0.9766535354229023f, - 0.9766254071104696f, - 0.9765972620638246f, - 0.9765691002834492f, - 0.9765409217698262f, - 0.9765127265234383f, - 0.9764845145447687f, - 0.9764562858343007f, - 0.976428040392518f, - 0.9763997782199046f, - 0.9763714993169449f, - 0.9763432036841233f, - 0.9763148913219246f, - 0.9762865622308341f, - 0.976258216411337f, - 0.9762298538639193f, - 0.9762014745890666f, - 0.9761730785872653f, - 0.9761446658590023f, - 0.976116236404764f, - 0.9760877902250377f, - 0.9760593273203108f, - 0.9760308476910711f, - 0.9760023513378064f, - 0.9759738382610053f, - 0.9759453084611559f, - 0.9759167619387474f, - 0.9758881986942688f, - 0.9758596187282097f, - 0.9758310220410595f, - 0.9758024086333085f, - 0.9757737785054468f, - 0.9757451316579651f, - 0.975716468091354f, - 0.975687787806105f, - 0.9756590908027093f, - 0.9756303770816586f, - 0.9756016466434451f, - 0.9755728994885607f, - 0.9755441356174985f, - 0.9755153550307509f, - 0.9754865577288113f, - 0.9754577437121731f, - 0.9754289129813299f, - 0.975400065536776f, - 0.9753712013790053f, - 0.9753423205085128f, - 0.9753134229257928f, - 0.9752845086313411f, - 0.9752555776256526f, - 0.9752266299092235f, - 0.9751976654825494f, - 0.9751686843461267f, - 0.9751396865004521f, - 0.9751106719460225f, - 0.975081640683335f, - 0.9750525927128869f, - 0.9750235280351761f, - 0.9749944466507005f, - 0.9749653485599585f, - 0.9749362337634486f, - 0.9749071022616699f, - 0.9748779540551212f, - 0.9748487891443023f, - 0.9748196075297126f, - 0.9747904092118523f, - 0.9747611941912218f, - 0.9747319624683215f, - 0.9747027140436524f, - 0.9746734489177156f, - 0.9746441670910125f, - 0.974614868564045f, - 0.974585553337315f, - 0.9745562214113248f, - 0.9745268727865772f, - 0.9744975074635748f, - 0.9744681254428208f, - 0.9744387267248189f, - 0.9744093113100725f, - 0.974379879199086f, - 0.9743504303923632f, - 0.9743209648904093f, - 0.9742914826937288f, - 0.974261983802827f, - 0.9742324682182092f, - 0.9742029359403814f, - 0.9741733869698493f, - 0.9741438213071196f, - 0.9741142389526986f, - 0.9740846399070932f, - 0.9740550241708108f, - 0.9740253917443586f, - 0.9739957426282445f, - 0.9739660768229765f, - 0.973936394329063f, - 0.9739066951470123f, - 0.9738769792773336f, - 0.973847246720536f, - 0.9738174974771289f, - 0.9737877315476221f, - 0.9737579489325255f, - 0.9737281496323495f, - 0.9736983336476048f, - 0.9736685009788023f, - 0.9736386516264529f, - 0.9736087855910683f, - 0.9735789028731603f, - 0.9735490034732407f, - 0.973519087391822f, - 0.9734891546294168f, - 0.9734592051865377f, - 0.9734292390636984f, - 0.9733992562614119f, - 0.973369256780192f, - 0.9733392406205531f, - 0.9733092077830092f, - 0.973279158268075f, - 0.9732490920762653f, - 0.9732190092080953f, - 0.9731889096640807f, - 0.9731587934447369f, - 0.9731286605505801f, - 0.9730985109821266f, - 0.973068344739893f, - 0.9730381618243963f, - 0.9730079622361534f, - 0.972977745975682f, - 0.9729475130434998f, - 0.9729172634401249f, - 0.9728869971660754f, - 0.97285671422187f, - 0.9728264146080279f, - 0.9727960983250677f, - 0.9727657653735095f, - 0.9727354157538723f, - 0.9727050494666769f, - 0.972674666512443f, - 0.9726442668916917f, - 0.9726138506049435f, - 0.9725834176527198f, - 0.972552968035542f, - 0.9725225017539318f, - 0.9724920188084114f, - 0.9724615191995027f, - 0.9724310029277289f, - 0.9724004699936124f, - 0.9723699203976767f, - 0.9723393541404449f, - 0.9723087712224412f, - 0.9722781716441892f, - 0.9722475554062133f, - 0.9722169225090385f, - 0.9721862729531892f, - 0.9721556067391908f, - 0.9721249238675687f, - 0.9720942243388487f, - 0.9720635081535567f, - 0.9720327753122192f, - 0.9720020258153627f, - 0.971971259663514f, - 0.9719404768572004f, - 0.9719096773969493f, - 0.9718788612832886f, - 0.971848028516746f, - 0.97181717909785f, - 0.9717863130271293f, - 0.9717554303051126f, - 0.971724530932329f, - 0.9716936149093083f, - 0.9716626822365799f, - 0.971631732914674f, - 0.9716007669441208f, - 0.971569784325451f, - 0.9715387850591953f, - 0.9715077691458851f, - 0.9714767365860517f, - 0.971445687380227f, - 0.9714146215289428f, - 0.9713835390327314f, - 0.9713524398921256f, - 0.9713213241076581f, - 0.9712901916798623f, - 0.9712590426092713f, - 0.9712278768964191f, - 0.9711966945418395f, - 0.9711654955460669f, - 0.9711342799096361f, - 0.9711030476330816f, - 0.9710717987169388f, - 0.9710405331617431f, - 0.9710092509680303f, - 0.9709779521363361f, - 0.9709466366671972f, - 0.9709153045611497f, - 0.9708839558187311f, - 0.970852590440478f, - 0.9708212084269281f, - 0.9707898097786191f, - 0.9707583944960889f, - 0.970726962579876f, - 0.9706955140305187f, - 0.9706640488485562f, - 0.9706325670345273f, - 0.9706010685889717f, - 0.9705695535124289f, - 0.9705380218054391f, - 0.9705064734685425f, - 0.9704749085022796f, - 0.9704433269071914f, - 0.9704117286838189f, - 0.9703801138327036f, - 0.9703484823543873f, - 0.9703168342494118f, - 0.9702851695183196f, - 0.9702534881616531f, - 0.9702217901799551f, - 0.970190075573769f, - 0.970158344343638f, - 0.9701265964901059f, - 0.9700948320137166f, - 0.9700630509150144f, - 0.970031253194544f, - 0.96999943885285f, - 0.9699676078904779f, - 0.9699357603079727f, - 0.9699038961058803f, - 0.9698720152847468f, - 0.9698401178451183f, - 0.9698082037875413f, - 0.9697762731125628f, - 0.9697443258207299f, - 0.9697123619125899f, - 0.9696803813886905f, - 0.9696483842495799f, - 0.9696163704958061f, - 0.9695843401279176f, - 0.9695522931464635f, - 0.9695202295519928f, - 0.969488149345055f, - 0.9694560525261995f, - 0.9694239390959766f, - 0.9693918090549363f, - 0.9693596624036294f, - 0.9693274991426063f, - 0.9692953192724186f, - 0.9692631227936174f, - 0.9692309097067544f, - 0.9691986800123816f, - 0.9691664337110514f, - 0.9691341708033161f, - 0.9691018912897286f, - 0.969069595170842f, - 0.9690372824472097f, - 0.9690049531193854f, - 0.968972607187923f, - 0.9689402446533768f, - 0.9689078655163011f, - 0.9688754697772511f, - 0.9688430574367816f, - 0.9688106284954479f, - 0.968778182953806f, - 0.9687457208124116f, - 0.9687132420718211f, - 0.9686807467325907f, - 0.9686482347952776f, - 0.9686157062604386f, - 0.9685831611286312f, - 0.9685505994004129f, - 0.9685180210763419f, - 0.9684854261569761f, - 0.9684528146428742f, - 0.968420186534595f, - 0.9683875418326976f, - 0.9683548805377413f, - 0.9683222026502856f, - 0.9682895081708907f, - 0.9682567971001166f, - 0.9682240694385239f, - 0.9681913251866732f, - 0.9681585643451259f, - 0.9681257869144431f, - 0.9680929928951865f, - 0.9680601822879179f, - 0.9680273550931996f, - 0.9679945113115943f, - 0.9679616509436644f, - 0.9679287739899732f, - 0.9678958804510839f, - 0.9678629703275603f, - 0.9678300436199659f, - 0.9677971003288655f, - 0.9677641404548231f, - 0.9677311639984036f, - 0.9676981709601721f, - 0.9676651613406938f, - 0.9676321351405345f, - 0.9675990923602598f, - 0.9675660330004362f, - 0.9675329570616299f, - 0.967499864544408f, - 0.967466755449337f, - 0.9674336297769848f, - 0.9674004875279185f, - 0.9673673287027064f, - 0.9673341533019163f, - 0.967300961326117f, - 0.9672677527758768f, - 0.9672345276517651f, - 0.9672012859543511f, - 0.9671680276842043f, - 0.9671347528418948f, - 0.9671014614279925f, - 0.9670681534430678f, - 0.9670348288876918f, - 0.9670014877624351f, - 0.9669681300678692f, - 0.9669347558045656f, - 0.9669013649730962f, - 0.9668679575740331f, - 0.9668345336079488f, - 0.966801093075416f, - 0.9667676359770077f, - 0.9667341623132969f, - 0.9667006720848577f, - 0.9666671652922634f, - 0.9666336419360886f, - 0.9666001020169073f, - 0.9665665455352945f, - 0.966532972491825f, - 0.9664993828870743f, - 0.9664657767216176f, - 0.966432153996031f, - 0.9663985147108906f, - 0.9663648588667726f, - 0.9663311864642539f, - 0.9662974975039114f, - 0.9662637919863222f, - 0.9662300699120641f, - 0.9661963312817148f, - 0.9661625760958523f, - 0.9661288043550552f, - 0.9660950160599019f, - 0.9660612112109715f, - 0.9660273898088434f, - 0.9659935518540969f, - 0.9659596973473118f, - 0.9659258262890683f, - 0.9658919386799467f, - 0.9658580345205277f, - 0.9658241138113922f, - 0.9657901765531214f, - 0.965756222746297f, - 0.9657222523915004f, - 0.9656882654893142f, - 0.9656542620403201f, - 0.9656202420451013f, - 0.9655862055042406f, - 0.965552152418321f, - 0.9655180827879263f, - 0.9654839966136399f, - 0.9654498938960462f, - 0.9654157746357293f, - 0.965381638833274f, - 0.9653474864892649f, - 0.9653133176042877f, - 0.9652791321789275f, - 0.9652449302137701f, - 0.9652107117094016f, - 0.9651764766664083f, - 0.965142225085377f, - 0.9651079569668941f, - 0.9650736723115474f, - 0.9650393711199239f, - 0.9650050533926116f, - 0.9649707191301983f, - 0.9649363683332725f, - 0.9649020010024226f, - 0.9648676171382378f, - 0.9648332167413068f, - 0.9647987998122194f, - 0.9647643663515653f, - 0.9647299163599343f, - 0.964695449837917f, - 0.9646609667861036f, - 0.9646264672050853f, - 0.9645919510954529f, - 0.9645574184577982f, - 0.9645228692927126f, - 0.9644883036007883f, - 0.9644537213826173f, - 0.9644191226387926f, - 0.9643845073699066f, - 0.9643498755765526f, - 0.9643152272593242f, - 0.9642805624188147f, - 0.9642458810556184f, - 0.9642111831703293f, - 0.9641764687635422f, - 0.9641417378358517f, - 0.9641069903878531f, - 0.9640722264201416f, - 0.964037445933313f, - 0.9640026489279632f, - 0.9639678354046883f, - 0.9639330053640852f, - 0.9638981588067503f, - 0.963863295733281f, - 0.9638284161442744f, - 0.9637935200403285f, - 0.9637586074220408f, - 0.9637236782900097f, - 0.9636887326448338f, - 0.9636537704871119f, - 0.9636187918174429f, - 0.9635837966364263f, - 0.9635487849446616f, - 0.9635137567427488f, - 0.9634787120312881f, - 0.9634436508108799f, - 0.9634085730821251f, - 0.9633734788456246f, - 0.9633383681019799f, - 0.9633032408517925f, - 0.9632680970956643f, - 0.9632329368341975f, - 0.9631977600679945f, - 0.9631625667976582f, - 0.9631273570237914f, - 0.9630921307469977f, - 0.9630568879678804f, - 0.9630216286870436f, - 0.9629863529050913f, - 0.962951060622628f, - 0.9629157518402583f, - 0.9628804265585876f, - 0.9628450847782208f, - 0.9628097264997637f, - 0.9627743517238219f, - 0.9627389604510017f, - 0.9627035526819095f, - 0.9626681284171521f, - 0.9626326876573363f, - 0.9625972304030695f, - 0.9625617566549592f, - 0.9625262664136134f, - 0.9624907596796399f, - 0.9624552364536473f, - 0.9624196967362443f, - 0.9623841405280397f, - 0.962348567829643f, - 0.9623129786416634f, - 0.9622773729647108f, - 0.9622417507993957f, - 0.9622061121463279f, - 0.9621704570061186f, - 0.9621347853793781f, - 0.9620990972667183f, - 0.9620633926687502f, - 0.9620276715860859f, - 0.9619919340193372f, - 0.9619561799691169f, - 0.961920409436037f, - 0.9618846224207109f, - 0.9618488189237516f, - 0.9618129989457728f, - 0.961777162487388f, - 0.9617413095492113f, - 0.9617054401318572f, - 0.9616695542359401f, - 0.9616336518620752f, - 0.9615977330108773f, - 0.961561797682962f, - 0.9615258458789451f, - 0.9614898775994427f, - 0.9614538928450709f, - 0.9614178916164464f, - 0.9613818739141861f, - 0.961345839738907f, - 0.9613097890912268f, - 0.961273721971763f, - 0.9612376383811337f, - 0.9612015383199571f, - 0.961165421788852f, - 0.9611292887884368f, - 0.9610931393193312f, - 0.961056973382154f, - 0.9610207909775255f, - 0.9609845921060651f, - 0.9609483767683935f, - 0.9609121449651311f, - 0.9608758966968985f, - 0.9608396319643173f, - 0.9608033507680084f, - 0.9607670531085937f, - 0.960730738986695f, - 0.9606944084029349f, - 0.9606580613579353f, - 0.9606216978523197f, - 0.9605853178867105f, - 0.9605489214617317f, - 0.9605125085780064f, - 0.9604760792361587f, - 0.9604396334368132f, - 0.9604031711805938f, - 0.9603666924681257f, - 0.9603301973000336f, - 0.9602936856769431f, - 0.9602571575994797f, - 0.9602206130682693f, - 0.9601840520839382f, - 0.9601474746471128f, - 0.9601108807584198f, - 0.960074270418486f, - 0.9600376436279393f, - 0.9600010003874067f, - 0.9599643406975165f, - 0.9599276645588964f, - 0.9598909719721753f, - 0.9598542629379817f, - 0.9598175374569446f, - 0.9597807955296933f, - 0.9597440371568575f, - 0.9597072623390667f, - 0.9596704710769514f, - 0.9596336633711416f, - 0.9595968392222685f, - 0.9595599986309626f, - 0.9595231415978555f, - 0.9594862681235786f, - 0.9594493782087636f, - 0.9594124718540429f, - 0.9593755490600485f, - 0.9593386098274134f, - 0.9593016541567703f, - 0.9592646820487525f, - 0.9592276935039936f, - 0.9591906885231273f, - 0.9591536671067877f, - 0.959116629255609f, - 0.9590795749702262f, - 0.9590425042512738f, - 0.9590054170993874f, - 0.9589683135152021f, - 0.9589311934993539f, - 0.9588940570524787f, - 0.9588569041752129f, - 0.958819734868193f, - 0.9587825491320562f, - 0.9587453469674393f, - 0.9587081283749799f, - 0.9586708933553157f, - 0.9586336419090848f, - 0.9585963740369254f, - 0.9585590897394762f, - 0.958521789017376f, - 0.9584844718712637f, - 0.9584471383017791f, - 0.9584097883095616f, - 0.9583724218952514f, - 0.9583350390594885f, - 0.9582976398029137f, - 0.9582602241261677f, - 0.9582227920298917f, - 0.9581853435147271f, - 0.9581478785813153f, - 0.9581103972302988f, - 0.9580728994623191f, - 0.9580353852780193f, - 0.957997854678042f, - 0.9579603076630303f, - 0.9579227442336274f, - 0.9578851643904772f, - 0.9578475681342234f, - 0.9578099554655104f, - 0.9577723263849826f, - 0.9577346808932846f, - 0.9576970189910616f, - 0.957659340678959f, - 0.9576216459576223f, - 0.9575839348276973f, - 0.9575462072898304f, - 0.9575084633446679f, - 0.9574707029928566f, - 0.9574329262350434f, - 0.9573951330718756f, - 0.957357323504001f, - 0.9573194975320672f, - 0.9572816551567226f, - 0.9572437963786152f, - 0.9572059211983942f, - 0.9571680296167082f, - 0.9571301216342067f, - 0.957092197251539f, - 0.9570542564693554f, - 0.9570162992883053f, - 0.9569783257090397f, - 0.9569403357322089f, - 0.956902329358464f, - 0.9568643065884562f, - 0.956826267422837f, - 0.9567882118622583f, - 0.9567501399073719f, - 0.9567120515588305f, - 0.9566739468172865f, - 0.9566358256833929f, - 0.9565976881578028f, - 0.9565595342411699f, - 0.9565213639341477f, - 0.9564831772373904f, - 0.956444974151552f, - 0.9564067546772876f, - 0.9563685188152519f, - 0.9563302665660999f, - 0.9562919979304872f, - 0.9562537129090694f, - 0.9562154115025027f, - 0.9561770937114431f, - 0.9561387595365474f, - 0.9561004089784724f, - 0.9560620420378751f, - 0.9560236587154131f, - 0.9559852590117439f, - 0.9559468429275256f, - 0.9559084104634163f, - 0.9558699616200749f, - 0.9558314963981597f, - 0.9557930147983302f, - 0.9557545168212455f, - 0.9557160024675654f, - 0.9556774717379497f, - 0.9556389246330589f, - 0.9556003611535532f, - 0.9555617813000935f, - 0.9555231850733408f, - 0.9554845724739564f, - 0.9554459435026021f, - 0.9554072981599396f, - 0.9553686364466313f, - 0.9553299583633394f, - 0.9552912639107268f, - 0.9552525530894564f, - 0.9552138259001918f, - 0.9551750823435962f, - 0.9551363224203335f, - 0.9550975461310681f, - 0.9550587534764642f, - 0.9550199444571866f, - 0.9549811190739003f, - 0.9549422773272706f, - 0.9549034192179627f, - 0.9548645447466431f, - 0.9548256539139771f, - 0.9547867467206317f, - 0.9547478231672732f, - 0.9547088832545688f, - 0.9546699269831855f, - 0.9546309543537911f, - 0.954591965367053f, - 0.9545529600236397f, - 0.954513938324219f, - 0.9544749002694601f, - 0.9544358458600316f, - 0.9543967750966027f, - 0.9543576879798429f, - 0.9543185845104218f, - 0.9542794646890099f, - 0.9542403285162769f, - 0.9542011759928939f, - 0.9541620071195313f, - 0.9541228218968605f, - 0.954083620325553f, - 0.9540444024062804f, - 0.9540051681397148f, - 0.9539659175265283f, - 0.9539266505673936f, - 0.9538873672629833f, - 0.9538480676139709f, - 0.9538087516210293f, - 0.9537694192848326f, - 0.9537300706060545f, - 0.9536907055853694f, - 0.9536513242234516f, - 0.9536119265209759f, - 0.9535725124786176f, - 0.953533082097052f, - 0.9534936353769546f, - 0.9534541723190012f, - 0.9534146929238684f, - 0.9533751971922322f, - 0.9533356851247697f, - 0.9532961567221576f, - 0.9532566119850736f, - 0.953217050914195f, - 0.9531774735101997f, - 0.953137879773766f, - 0.9530982697055721f, - 0.9530586433062971f, - 0.9530190005766195f, - 0.9529793415172189f, - 0.9529396661287746f, - 0.9528999744119667f, - 0.9528602663674751f, - 0.9528205419959803f, - 0.9527808012981629f, - 0.952741044274704f, - 0.9527012709262846f, - 0.9526614812535863f, - 0.9526216752572909f, - 0.9525818529380804f, - 0.9525420142966373f, - 0.9525021593336441f, - 0.9524622880497837f, - 0.9524224004457393f, - 0.9523824965221945f, - 0.9523425762798328f, - 0.9523026397193384f, - 0.9522626868413955f, - 0.9522227176466886f, - 0.9521827321359029f, - 0.9521427303097232f, - 0.9521027121688351f, - 0.9520626777139242f, - 0.9520226269456766f, - 0.9519825598647784f, - 0.9519424764719164f, - 0.9519023767677771f, - 0.9518622607530478f, - 0.9518221284284158f, - 0.9517819797945688f, - 0.9517418148521947f, - 0.9517016336019816f, - 0.9516614360446183f, - 0.9516212221807933f, - 0.9515809920111957f, - 0.9515407455365149f, - 0.9515004827574407f, - 0.9514602036746626f, - 0.951419908288871f, - 0.9513795966007562f, - 0.9513392686110093f, - 0.9512989243203208f, - 0.9512585637293823f, - 0.9512181868388854f, - 0.9511777936495216f, - 0.9511373841619836f, - 0.9510969583769633f, - 0.9510565162951536f, - 0.9510160579172474f, - 0.950975583243938f, - 0.950935092275919f, - 0.950894585013884f, - 0.9508540614585271f, - 0.9508135216105429f, - 0.9507729654706258f, - 0.9507323930394708f, - 0.9506918043177731f, - 0.9506511993062281f, - 0.9506105780055318f, - 0.95056994041638f, - 0.9505292865394691f, - 0.9504886163754955f, - 0.9504479299251565f, - 0.9504072271891487f, - 0.9503665081681701f, - 0.950325772862918f, - 0.9502850212740906f, - 0.9502442534023859f, - 0.9502034692485029f, - 0.9501626688131399f, - 0.9501218520969965f, - 0.9500810191007717f, - 0.9500401698251654f, - 0.9499993042708774f, - 0.9499584224386081f, - 0.9499175243290577f, - 0.9498766099429272f, - 0.9498356792809177f, - 0.9497947323437304f, - 0.9497537691320668f, - 0.9497127896466292f, - 0.9496717938881193f, - 0.94963078185724f, - 0.9495897535546937f, - 0.9495487089811835f, - 0.9495076481374126f, - 0.9494665710240849f, - 0.9494254776419039f, - 0.9493843679915739f, - 0.949343242073799f, - 0.9493020998892844f, - 0.9492609414387346f, - 0.9492197667228551f, - 0.9491785757423514f, - 0.9491373684979292f, - 0.9490961449902947f, - 0.9490549052201539f, - 0.949013649188214f, - 0.9489723768951814f, - 0.9489310883417637f, - 0.9488897835286679f, - 0.9488484624566021f, - 0.9488071251262743f, - 0.9487657715383927f, - 0.948724401693666f, - 0.9486830155928029f, - 0.9486416132365126f, - 0.9486001946255046f, - 0.9485587597604886f, - 0.9485173086421744f, - 0.9484758412712725f, - 0.9484343576484932f, - 0.9483928577745475f, - 0.9483513416501462f, - 0.9483098092760012f, - 0.9482682606528235f, - 0.9482266957813255f, - 0.9481851146622192f, - 0.948143517296217f, - 0.948101903684032f, - 0.9480602738263769f, - 0.9480186277239653f, - 0.9479769653775104f, - 0.9479352867877265f, - 0.9478935919553274f, - 0.9478518808810278f, - 0.9478101535655422f, - 0.9477684100095857f, - 0.9477266502138736f, - 0.9476848741791213f, - 0.9476430819060448f, - 0.94760127339536f, - 0.9475594486477835f, - 0.9475176076640318f, - 0.9474757504448219f, - 0.947433876990871f, - 0.9473919873028965f, - 0.9473500813816164f, - 0.9473081592277485f, - 0.9472662208420112f, - 0.947224266225123f, - 0.9471822953778031f, - 0.9471403083007703f, - 0.9470983049947443f, - 0.9470562854604446f, - 0.9470142496985915f, - 0.9469721977099049f, - 0.9469301294951057f, - 0.9468880450549144f, - 0.9468459443900524f, - 0.9468038275012408f, - 0.9467616943892015f, - 0.9467195450546563f, - 0.9466773794983274f, - 0.9466351977209375f, - 0.9465929997232092f, - 0.9465507855058656f, - 0.9465085550696299f, - 0.9464663084152259f, - 0.9464240455433774f, - 0.9463817664548085f, - 0.9463394711502439f, - 0.946297159630408f, - 0.9462548318960259f, - 0.9462124879478228f, - 0.9461701277865245f, - 0.9461277514128565f, - 0.9460853588275454f, - 0.946042950031317f, - 0.9460005250248984f, - 0.9459580838090162f, - 0.945915626384398f, - 0.945873152751771f, - 0.9458306629118631f, - 0.9457881568654022f, - 0.9457456346131169f, - 0.9457030961557354f, - 0.9456605414939872f, - 0.9456179706286009f, - 0.9455753835603061f, - 0.9455327802898327f, - 0.9454901608179105f, - 0.9454475251452698f, - 0.9454048732726411f, - 0.9453622052007555f, - 0.9453195209303438f, - 0.9452768204621376f, - 0.9452341037968682f, - 0.945191370935268f, - 0.945148621878069f, - 0.9451058566260037f, - 0.9450630751798049f, - 0.9450202775402055f, - 0.9449774637079391f, - 0.9449346336837391f, - 0.9448917874683395f, - 0.9448489250624742f, - 0.944806046466878f, - 0.9447631516822854f, - 0.9447202407094315f, - 0.9446773135490514f, - 0.9446343702018808f, - 0.9445914106686555f, - 0.9445484349501115f, - 0.9445054430469854f, - 0.9444624349600135f, - 0.9444194106899331f, - 0.9443763702374811f, - 0.9443333136033952f, - 0.9442902407884131f, - 0.9442471517932729f, - 0.9442040466187127f, - 0.9441609252654712f, - 0.9441177877342876f, - 0.9440746340259004f, - 0.9440314641410498f, - 0.9439882780804748f, - 0.9439450758449159f, - 0.943901857435113f, - 0.9438586228518069f, - 0.9438153720957381f, - 0.9437721051676481f, - 0.9437288220682779f, - 0.9436855227983694f, - 0.9436422073586643f, - 0.943598875749905f, - 0.9435555279728338f, - 0.9435121640281936f, - 0.9434687839167274f, - 0.9434253876391784f, - 0.9433819751962904f, - 0.9433385465888069f, - 0.9432951018174724f, - 0.9432516408830312f, - 0.943208163786228f, - 0.9431646705278075f, - 0.9431211611085153f, - 0.9430776355290968f, - 0.9430340937902978f, - 0.9429905358928645f, - 0.9429469618375429f, - 0.9429033716250801f, - 0.9428597652562226f, - 0.9428161427317179f, - 0.9427725040523132f, - 0.9427288492187563f, - 0.9426851782317953f, - 0.9426414910921784f, - 0.9425977878006543f, - 0.9425540683579716f, - 0.9425103327648798f, - 0.942466581022128f, - 0.9424228131304659f, - 0.9423790290906435f, - 0.9423352289034111f, - 0.9422914125695191f, - 0.9422475800897184f, - 0.9422037314647598f, - 0.942159866695395f, - 0.9421159857823752f, - 0.9420720887264526f, - 0.9420281755283794f, - 0.9419842461889077f, - 0.9419403007087906f, - 0.9418963390887809f, - 0.9418523613296319f, - 0.9418083674320971f, - 0.9417643573969303f, - 0.9417203312248857f, - 0.9416762889167177f, - 0.9416322304731809f, - 0.9415881558950303f, - 0.9415440651830208f, - 0.9414999583379082f, - 0.9414558353604483f, - 0.9414116962513968f, - 0.9413675410115104f, - 0.9413233696415454f, - 0.9412791821422588f, - 0.9412349785144076f, - 0.9411907587587496f, - 0.941146522876042f, - 0.9411022708670431f, - 0.941058002732511f, - 0.9410137184732043f, - 0.9409694180898815f, - 0.9409251015833022f, - 0.9408807689542255f, - 0.940836420203411f, - 0.9407920553316185f, - 0.9407476743396084f, - 0.9407032772281411f, - 0.940658863997977f, - 0.9406144346498778f, - 0.9405699891846041f, - 0.9405255276029179f, - 0.9404810499055807f, - 0.9404365560933549f, - 0.9403920461670028f, - 0.940347520127287f, - 0.9403029779749705f, - 0.9402584197108165f, - 0.9402138453355885f, - 0.9401692548500502f, - 0.9401246482549659f, - 0.9400800255510996f, - 0.9400353867392162f, - 0.9399907318200801f, - 0.9399460607944571f, - 0.939901373663112f, - 0.9398566704268109f, - 0.9398119510863197f, - 0.9397672156424046f, - 0.9397224640958322f, - 0.9396776964473691f, - 0.9396329126977827f, - 0.93958811284784f, - 0.9395432968983092f, - 0.9394984648499575f, - 0.9394536167035535f, - 0.9394087524598655f, - 0.9393638721196624f, - 0.9393189756837133f, - 0.939274063152787f, - 0.9392291345276537f, - 0.9391841898090827f, - 0.9391392289978444f, - 0.9390942520947091f, - 0.9390492591004476f, - 0.9390042500158307f, - 0.9389592248416296f, - 0.9389141835786159f, - 0.9388691262275614f, - 0.938824052789238f, - 0.9387789632644179f, - 0.9387338576538742f, - 0.9386887359583792f, - 0.9386435981787065f, - 0.9385984443156292f, - 0.9385532743699212f, - 0.9385080883423563f, - 0.9384628862337091f, - 0.9384176680447536f, - 0.9383724337762651f, - 0.9383271834290183f, - 0.9382819170037887f, - 0.9382366345013521f, - 0.938191335922484f, - 0.9381460212679611f, - 0.9381006905385594f, - 0.938055343735056f, - 0.9380099808582275f, - 0.9379646019088516f, - 0.9379192068877055f, - 0.9378737957955672f, - 0.9378283686332147f, - 0.9377829254014266f, - 0.9377374661009814f, - 0.937691990732658f, - 0.9376464992972356f, - 0.9376009917954938f, - 0.9375554682282126f, - 0.9375099285961713f, - 0.9374643729001509f, - 0.9374188011409317f, - 0.9373732133192947f, - 0.9373276094360208f, - 0.9372819894918916f, - 0.9372363534876886f, - 0.9371907014241939f, - 0.9371450333021899f, - 0.9370993491224587f, - 0.9370536488857836f, - 0.9370079325929472f, - 0.9369622002447331f, - 0.9369164518419248f, - 0.9368706873853062f, - 0.9368249068756616f, - 0.9367791103137751f, - 0.9367332977004318f, - 0.9366874690364164f, - 0.9366416243225143f, - 0.936595763559511f, - 0.9365498867481924f, - 0.9365039938893444f, - 0.9364580849837536f, - 0.9364121600322064f, - 0.9363662190354899f, - 0.9363202619943911f, - 0.9362742889096978f, - 0.9362282997821972f, - 0.9361822946126779f, - 0.9361362734019276f, - 0.9360902361507354f, - 0.9360441828598898f, - 0.93599811353018f, - 0.9359520281623954f, - 0.9359059267573258f, - 0.9358598093157607f, - 0.9358136758384908f, - 0.9357675263263066f, - 0.9357213607799982f, - 0.9356751792003574f, - 0.935628981588175f, - 0.9355827679442429f, - 0.9355365382693527f, - 0.9354902925642967f, - 0.9354440308298674f, - 0.9353977530668571f, - 0.9353514592760593f, - 0.9353051494582667f, - 0.9352588236142733f, - 0.9352124817448724f, - 0.9351661238508584f, - 0.9351197499330254f, - 0.9350733599921683f, - 0.9350269540290816f, - 0.9349805320445609f, - 0.9349340940394011f, - 0.9348876400143983f, - 0.9348411699703485f, - 0.9347946839080475f, - 0.9347481818282924f, - 0.9347016637318797f, - 0.9346551296196065f, - 0.93460857949227f, - 0.9345620133506682f, - 0.9345154311955987f, - 0.9344688330278598f, - 0.9344222188482498f, - 0.9343755886575675f, - 0.9343289424566121f, - 0.9342822802461825f, - 0.9342356020270786f, - 0.9341889078000999f, - 0.9341421975660468f, - 0.9340954713257194f, - 0.9340487290799185f, - 0.9340019708294449f, - 0.9339551965751001f, - 0.9339084063176851f, - 0.933861600058002f, - 0.9338147777968525f, - 0.9337679395350391f, - 0.9337210852733645f, - 0.9336742150126311f, - 0.9336273287536425f, - 0.9335804264972017f, - 0.9335335082441127f, - 0.9334865739951791f, - 0.9334396237512053f, - 0.9333926575129956f, - 0.933345675281355f, - 0.9332986770570884f, - 0.9332516628410009f, - 0.9332046326338986f, - 0.9331575864365869f, - 0.9331105242498721f, - 0.9330634460745604f, - 0.9330163519114588f, - 0.932969241761374f, - 0.9329221156251134f, - 0.9328749735034844f, - 0.9328278153972946f, - 0.9327806413073523f, - 0.9327334512344656f, - 0.9326862451794433f, - 0.9326390231430941f, - 0.9325917851262273f, - 0.9325445311296521f, - 0.9324972611541784f, - 0.932449975200616f, - 0.9324026732697752f, - 0.9323553553624665f, - 0.9323080214795008f, - 0.9322606716216887f, - 0.9322133057898422f, - 0.9321659239847723f, - 0.9321185262072911f, - 0.932071112458211f, - 0.932023682738344f, - 0.9319762370485032f, - 0.9319287753895013f, - 0.9318812977621515f, - 0.9318338041672675f, - 0.931786294605663f, - 0.931738769078152f, - 0.931691227585549f, - 0.9316436701286684f, - 0.9315960967083254f, - 0.9315485073253349f, - 0.9315009019805123f, - 0.9314532806746735f, - 0.9314056434086343f, - 0.9313579901832111f, - 0.9313103209992203f, - 0.9312626358574788f, - 0.9312149347588036f, - 0.9311672177040121f, - 0.9311194846939218f, - 0.9310717357293509f, - 0.9310239708111171f, - 0.9309761899400392f, - 0.9309283931169358f, - 0.9308805803426258f, - 0.9308327516179286f, - 0.9307849069436637f, - 0.9307370463206509f, - 0.9306891697497102f, - 0.9306412772316621f, - 0.930593368767327f, - 0.9305454443575262f, - 0.9304975040030803f, - 0.9304495477048113f, - 0.9304015754635404f, - 0.93035358728009f, - 0.9303055831552823f, - 0.9302575630899397f, - 0.9302095270848851f, - 0.9301614751409415f, - 0.9301134072589324f, - 0.9300653234396812f, - 0.9300172236840122f, - 0.9299691079927491f, - 0.9299209763667168f, - 0.9298728288067395f, - 0.9298246653136427f, - 0.9297764858882515f, - 0.9297282905313912f, - 0.9296800792438881f, - 0.9296318520265677f, - 0.9295836088802569f, - 0.9295353498057819f, - 0.9294870748039701f, - 0.929438783875648f, - 0.9293904770216438f, - 0.9293421542427847f, - 0.9292938155398989f, - 0.9292454609138144f, - 0.9291970903653601f, - 0.9291487038953649f, - 0.9291003015046575f, - 0.9290518831940675f, - 0.9290034489644244f, - 0.9289549988165583f, - 0.9289065327512991f, - 0.9288580507694776f, - 0.9288095528719242f, - 0.9287610390594702f, - 0.9287125093329466f, - 0.928663963693185f, - 0.9286154021410173f, - 0.9285668246772756f, - 0.9285182313027923f, - 0.9284696220183998f, - 0.9284209968249313f, - 0.9283723557232197f, - 0.9283236987140988f, - 0.9282750257984019f, - 0.9282263369769633f, - 0.9281776322506172f, - 0.9281289116201982f, - 0.928080175086541f, - 0.9280314226504806f, - 0.9279826543128527f, - 0.9279338700744925f, - 0.9278850699362362f, - 0.9278362538989199f, - 0.9277874219633803f, - 0.9277385741304536f, - 0.9276897104009771f, - 0.9276408307757882f, - 0.9275919352557241f, - 0.9275430238416229f, - 0.9274940965343225f, - 0.9274451533346614f, - 0.927396194243478f, - 0.9273472192616116f, - 0.927298228389901f, - 0.9272492216291858f, - 0.9272001989803056f, - 0.9271511604441006f, - 0.9271021060214109f, - 0.9270530357130772f, - 0.9270039495199399f, - 0.9269548474428406f, - 0.9269057294826203f, - 0.9268565956401207f, - 0.9268074459161839f, - 0.9267582803116519f, - 0.9267090988273671f, - 0.9266599014641722f, - 0.9266106882229103f, - 0.9265614591044246f, - 0.9265122141095585f, - 0.9264629532391561f, - 0.9264136764940611f, - 0.9263643838751181f, - 0.9263150753831718f, - 0.9262657510190667f, - 0.9262164107836482f, - 0.926167054677762f, - 0.9261176827022533f, - 0.9260682948579684f, - 0.9260188911457533f, - 0.9259694715664549f, - 0.9259200361209197f, - 0.9258705848099948f, - 0.9258211176345275f, - 0.9257716345953656f, - 0.9257221356933567f, - 0.9256726209293492f, - 0.9256230903041914f, - 0.925573543818732f, - 0.9255239814738201f, - 0.9254744032703047f, - 0.9254248092090355f, - 0.9253751992908621f, - 0.9253255735166348f, - 0.9252759318872036f, - 0.9252262744034195f, - 0.925176601066133f, - 0.9251269118761954f, - 0.925077206834458f, - 0.9250274859417728f, - 0.9249777491989915f, - 0.9249279966069661f, - 0.9248782281665496f, - 0.9248284438785945f, - 0.9247786437439539f, - 0.924728827763481f, - 0.9246789959380295f, - 0.9246291482684532f, - 0.9245792847556062f, - 0.924529405400343f, - 0.9244795102035183f, - 0.9244295991659868f, - 0.9243796722886038f, - 0.9243297295722251f, - 0.924279771017706f, - 0.9242297966259029f, - 0.9241798063976717f, - 0.9241298003338695f, - 0.9240797784353525f, - 0.9240297407029784f, - 0.9239796871376041f, - 0.9239296177400877f, - 0.9238795325112867f, - 0.9238294314520596f, - 0.9237793145632649f, - 0.923729181845761f, - 0.9236790333004073f, - 0.9236288689280628f, - 0.9235786887295874f, - 0.9235284927058404f, - 0.9234782808576824f, - 0.9234280531859733f, - 0.9233778096915742f, - 0.9233275503753456f, - 0.9232772752381491f, - 0.9232269842808457f, - 0.9231766775042974f, - 0.9231263549093662f, - 0.9230760164969143f, - 0.9230256622678042f, - 0.9229752922228988f, - 0.9229249063630611f, - 0.9228745046891543f, - 0.9228240872020425f, - 0.922773653902589f, - 0.9227232047916584f, - 0.9226727398701149f, - 0.9226222591388231f, - 0.9225717625986485f, - 0.9225212502504557f, - 0.9224707220951107f, - 0.922420178133479f, - 0.9223696183664268f, - 0.9223190427948205f, - 0.9222684514195264f, - 0.9222178442414115f, - 0.9221672212613431f, - 0.9221165824801885f, - 0.9220659278988154f, - 0.9220152575180915f, - 0.9219645713388854f, - 0.9219138693620657f, - 0.9218631515885005f, - 0.9218124180190596f, - 0.9217616686546116f, - 0.9217109034960268f, - 0.9216601225441744f, - 0.921609325799925f, - 0.9215585132641486f, - 0.9215076849377162f, - 0.9214568408214985f, - 0.9214059809163667f, - 0.9213551052231925f, - 0.9213042137428474f, - 0.9212533064762035f, - 0.9212023834241331f, - 0.9211514445875087f, - 0.9211004899672033f, - 0.9210495195640896f, - 0.9209985333790415f, - 0.9209475314129322f, - 0.9208965136666357f, - 0.9208454801410264f, - 0.9207944308369783f, - 0.9207433657553665f, - 0.920692284897066f, - 0.9206411882629518f, - 0.9205900758538997f, - 0.9205389476707853f, - 0.9204878037144847f, - 0.9204366439858742f, - 0.9203854684858306f, - 0.9203342772152305f, - 0.9202830701749514f, - 0.9202318473658704f, - 0.9201806087888652f, - 0.920129354444814f, - 0.9200780843345949f, - 0.9200267984590864f, - 0.9199754968191672f, - 0.9199241794157165f, - 0.9198728462496134f, - 0.9198214973217378f, - 0.919770132632969f, - 0.9197187521841877f, - 0.919667355976274f, - 0.9196159440101087f, - 0.9195645162865725f, - 0.9195130728065467f, - 0.919461613570913f, - 0.9194101385805529f, - 0.9193586478363485f, - 0.9193071413391819f, - 0.9192556190899359f, - 0.9192040810894931f, - 0.919152527338737f, - 0.9191009578385503f, - 0.9190493725898172f, - 0.9189977715934213f, - 0.918946154850247f, - 0.9188945223611784f, - 0.9188428741271006f, - 0.9187912101488984f, - 0.9187395304274568f, - 0.9186878349636618f, - 0.9186361237583988f, - 0.9185843968125541f, - 0.9185326541270138f, - 0.9184808957026648f, - 0.9184291215403936f, - 0.9183773316410877f, - 0.9183255260056341f, - 0.9182737046349208f, - 0.9182218675298358f, - 0.9181700146912669f, - 0.9181181461201031f, - 0.9180662618172328f, - 0.9180143617835452f, - 0.9179624460199295f, - 0.9179105145272753f, - 0.9178585673064723f, - 0.9178066043584109f, - 0.9177546256839813f, - 0.9177026312840738f, - 0.91765062115958f, - 0.9175985953113905f, - 0.9175465537403972f, - 0.9174944964474913f, - 0.9174424234335653f, - 0.917390334699511f, - 0.9173382302462215f, - 0.9172861100745889f, - 0.9172339741855069f, - 0.9171818225798684f, - 0.9171296552585673f, - 0.9170774722224971f, - 0.9170252734725521f, - 0.9169730590096271f, - 0.9169208288346163f, - 0.916868582948415f, - 0.9168163213519179f, - 0.9167640440460212f, - 0.9167117510316201f, - 0.9166594423096108f, - 0.9166071178808896f, - 0.9165547777463531f, - 0.916502421906898f, - 0.9164500503634216f, - 0.9163976631168211f, - 0.9163452601679942f, - 0.9162928415178391f, - 0.9162404071672533f, - 0.916187957117136f, - 0.9161354913683853f, - 0.9160830099219007f, - 0.916030512778581f, - 0.9159779999393262f, - 0.9159254714050356f, - 0.9158729271766096f, - 0.9158203672549483f, - 0.9157677916409525f, - 0.9157152003355231f, - 0.9156625933395611f, - 0.9156099706539679f, - 0.9155573322796452f, - 0.9155046782174949f, - 0.9154520084684195f, - 0.915399323033321f, - 0.9153466219131026f, - 0.915293905108667f, - 0.9152411726209176f, - 0.9151884244507581f, - 0.915135660599092f, - 0.9150828810668237f, - 0.9150300858548575f, - 0.9149772749640979f, - 0.91492444839545f, - 0.9148716061498187f, - 0.9148187482281097f, - 0.9147658746312285f, - 0.9147129853600813f, - 0.9146600804155741f, - 0.9146071597986136f, - 0.9145542235101065f, - 0.9145012715509598f, - 0.914448303922081f, - 0.9143953206243775f, - 0.9143423216587572f, - 0.9142893070261282f, - 0.914236276727399f, - 0.9141832307634781f, - 0.9141301691352747f, - 0.9140770918436976f, - 0.9140239988896567f, - 0.9139708902740612f, - 0.9139177659978217f, - 0.913864626061848f, - 0.9138114704670508f, - 0.9137582992143412f, - 0.9137051123046297f, - 0.9136519097388283f, - 0.9135986915178479f, - 0.913545457642601f, - 0.9134922081139992f, - 0.9134389429329555f, - 0.9133856621003821f, - 0.9133323656171923f, - 0.913279053484299f, - 0.913225725702616f, - 0.9131723822730567f, - 0.9131190231965356f, - 0.9130656484739667f, - 0.9130122581062643f, - 0.9129588520943438f, - 0.9129054304391199f, - 0.9128519931415081f, - 0.912798540202424f, - 0.9127450716227836f, - 0.9126915874035029f, - 0.9126380875454985f, - 0.9125845720496869f, - 0.9125310409169851f, - 0.9124774941483107f, - 0.9124239317445808f, - 0.9123703537067135f, - 0.9123167600356266f, - 0.9122631507322385f, - 0.9122095257974676f, - 0.9121558852322332f, - 0.9121022290374539f, - 0.9120485572140495f, - 0.9119948697629394f, - 0.9119411666850435f, - 0.9118874479812823f, - 0.9118337136525758f, - 0.9117799636998452f, - 0.9117261981240109f, - 0.9116724169259949f, - 0.911618620106718f, - 0.9115648076671026f, - 0.9115109796080703f, - 0.9114571359305438f, - 0.9114032766354453f, - 0.911349401723698f, - 0.9112955111962249f, - 0.9112416050539492f, - 0.9111876832977952f, - 0.9111337459286861f, - 0.9110797929475466f, - 0.9110258243553008f, - 0.9109718401528738f, - 0.9109178403411904f, - 0.9108638249211759f, - 0.9108097938937557f, - 0.910755747259856f, - 0.9107016850204024f, - 0.9106476071763215f, - 0.9105935137285399f, - 0.9105394046779844f, - 0.9104852800255824f, - 0.9104311397722609f, - 0.9103769839189478f, - 0.910322812466571f, - 0.9102686254160589f, - 0.9102144227683396f, - 0.9101602045243424f, - 0.9101059706849957f, - 0.9100517212512292f, - 0.9099974562239722f, - 0.9099431756041546f, - 0.9098888793927068f, - 0.9098345675905587f, - 0.909780240198641f, - 0.9097258972178848f, - 0.9096715386492211f, - 0.9096171644935813f, - 0.9095627747518972f, - 0.9095083694251006f, - 0.909453948514124f, - 0.9093995120198993f, - 0.90934505994336f, - 0.9092905922854385f, - 0.9092361090470686f, - 0.9091816102291834f, - 0.9091270958327172f, - 0.9090725658586035f, - 0.9090180203077773f, - 0.9089634591811726f, - 0.9089088824797249f, - 0.908854290204369f, - 0.9087996823560401f, - 0.9087450589356745f, - 0.9086904199442076f, - 0.9086357653825758f, - 0.9085810952517158f, - 0.9085264095525641f, - 0.9084717082860579f, - 0.9084169914531344f, - 0.9083622590547312f, - 0.908307511091786f, - 0.9082527475652371f, - 0.9081979684760226f, - 0.9081431738250815f, - 0.9080883636133521f, - 0.9080335378417743f, - 0.9079786965112868f, - 0.9079238396228297f, - 0.9078689671773432f, - 0.907814079175767f, - 0.9077591756190418f, - 0.9077042565081084f, - 0.9076493218439079f, - 0.9075943716273812f, - 0.9075394058594705f, - 0.9074844245411169f, - 0.9074294276732632f, - 0.9073744152568511f, - 0.9073193872928236f, - 0.9072643437821236f, - 0.9072092847256942f, - 0.9071542101244788f, - 0.9070991199794209f, - 0.907044014291465f, - 0.9069888930615546f, - 0.9069337562906349f, - 0.9068786039796499f, - 0.9068234361295454f, - 0.906768252741266f, - 0.9067130538157578f, - 0.9066578393539665f, - 0.9066026093568378f, - 0.9065473638253184f, - 0.9064921027603547f, - 0.906436826162894f, - 0.9063815340338829f, - 0.9063262263742693f, - 0.9062709031850005f, - 0.9062155644670247f, - 0.9061602102212899f, - 0.906104840448745f, - 0.9060494551503381f, - 0.9059940543270186f, - 0.905938637979736f, - 0.9058832061094393f, - 0.9058277587170789f, - 0.9057722958036043f, - 0.9057168173699663f, - 0.9056613234171151f, - 0.9056058139460021f, - 0.9055502889575779f, - 0.9054947484527944f, - 0.9054391924326027f, - 0.9053836208979554f, - 0.9053280338498041f, - 0.9052724312891014f, - 0.9052168132168005f, - 0.9051611796338538f, - 0.905105530541215f, - 0.9050498659398374f, - 0.9049941858306749f, - 0.9049384902146814f, - 0.9048827790928116f, - 0.9048270524660195f, - 0.9047713103352606f, - 0.9047155527014895f, - 0.9046597795656618f, - 0.9046039909287334f, - 0.9045481867916598f, - 0.9044923671553976f, - 0.9044365320209031f, - 0.9043806813891327f, - 0.9043248152610439f, - 0.9042689336375935f, - 0.9042130365197394f, - 0.904157123908439f, - 0.9041011958046508f, - 0.9040452522093327f, - 0.9039892931234434f, - 0.9039333185479418f, - 0.9038773284837871f, - 0.9038213229319384f, - 0.9037653018933558f, - 0.9037092653689986f, - 0.9036532133598275f, - 0.9035971458668026f, - 0.9035410628908849f, - 0.9034849644330348f, - 0.9034288504942144f, - 0.9033727210753844f, - 0.903316576177507f, - 0.903260415801544f, - 0.9032042399484578f, - 0.9031480486192112f, - 0.9030918418147664f, - 0.9030356195360872f, - 0.9029793817841365f, - 0.9029231285598781f, - 0.9028668598642757f, - 0.9028105756982938f, - 0.9027542760628964f, - 0.9026979609590485f, - 0.9026416303877147f, - 0.9025852843498605f, - 0.9025289228464515f, - 0.9024725458784529f, - 0.9024161534468313f, - 0.9023597455525526f, - 0.9023033221965836f, - 0.9022468833798908f, - 0.9021904291034415f, - 0.9021339593682027f, - 0.9020774741751426f, - 0.9020209735252284f, - 0.9019644574194287f, - 0.9019079258587115f, - 0.9018513788440458f, - 0.9017948163764001f, - 0.9017382384567443f, - 0.9016816450860472f, - 0.9016250362652786f, - 0.9015684119954087f, - 0.9015117722774075f, - 0.9014551171122459f, - 0.9013984465008941f, - 0.9013417604443237f, - 0.9012850589435055f, - 0.9012283419994113f, - 0.9011716096130131f, - 0.9011148617852828f, - 0.9010580985171929f, - 0.9010013198097157f, - 0.9009445256638244f, - 0.900887716080492f, - 0.9008308910606921f, - 0.9007740506053981f, - 0.9007171947155843f, - 0.9006603233922245f, - 0.9006034366362935f, - 0.9005465344487658f, - 0.9004896168306165f, - 0.900432683782821f, - 0.9003757353063547f, - 0.9003187714021935f, - 0.9002617920713133f, - 0.9002047973146906f, - 0.9001477871333018f, - 0.900090761528124f, - 0.900033720500134f, - 0.8999766640503094f, - 0.8999195921796278f, - 0.899862504889067f, - 0.8998054021796055f, - 0.8997482840522213f, - 0.8996911505078936f, - 0.8996340015476009f, - 0.8995768371723227f, - 0.8995196573830384f, - 0.8994624621807279f, - 0.8994052515663712f, - 0.8993480255409482f, - 0.8992907841054399f, - 0.8992335272608268f, - 0.8991762550080905f, - 0.8991189673482116f, - 0.8990616642821725f, - 0.8990043458109543f, - 0.8989470119355397f, - 0.8988896626569108f, - 0.8988322979760506f, - 0.8987749178939416f, - 0.8987175224115673f, - 0.8986601115299109f, - 0.8986026852499566f, - 0.8985452435726876f, - 0.8984877864990888f, - 0.8984303140301446f, - 0.8983728261668396f, - 0.898315322910159f, - 0.898257804261088f, - 0.8982002702206123f, - 0.8981427207897175f, - 0.8980851559693899f, - 0.8980275757606156f, - 0.8979699801643817f, - 0.8979123691816745f, - 0.8978547428134817f, - 0.8977971010607901f, - 0.8977394439245879f, - 0.897681771405863f, - 0.8976240835056033f, - 0.8975663802247975f, - 0.8975086615644342f, - 0.8974509275255026f, - 0.8973931781089917f, - 0.8973354133158912f, - 0.8972776331471907f, - 0.8972198376038806f, - 0.8971620266869507f, - 0.897104200397392f, - 0.8970463587361951f, - 0.8969885017043514f, - 0.8969306293028518f, - 0.8968727415326884f, - 0.8968148383948527f, - 0.8967569198903371f, - 0.8966989860201341f, - 0.896641036785236f, - 0.8965830721866361f, - 0.8965250922253273f, - 0.8964670969023035f, - 0.896409086218558f, - 0.8963510601750849f, - 0.8962930187728788f, - 0.8962349620129337f, - 0.8961768898962449f, - 0.896118802423807f, - 0.8960606995966158f, - 0.8960025814156664f, - 0.8959444478819548f, - 0.8958862989964771f, - 0.8958281347602299f, - 0.8957699551742094f, - 0.895711760239413f, - 0.8956535499568373f, - 0.89559532432748f, - 0.8955370833523391f, - 0.8954788270324118f, - 0.895420555368697f, - 0.8953622683621927f, - 0.8953039660138981f, - 0.8952456483248117f, - 0.8951873152959331f, - 0.8951289669282615f, - 0.8950706032227971f, - 0.8950122241805395f, - 0.8949538298024893f, - 0.8948954200896472f, - 0.8948369950430136f, - 0.8947785546635901f, - 0.8947200989523776f, - 0.8946616279103781f, - 0.8946031415385931f, - 0.8945446398380251f, - 0.8944861228096762f, - 0.8944275904545494f, - 0.8943690427736476f, - 0.8943104797679736f, - 0.8942519014385314f, - 0.8941933077863242f, - 0.8941346988123565f, - 0.894076074517632f, - 0.8940174349031558f, - 0.8939587799699322f, - 0.8939001097189665f, - 0.8938414241512639f, - 0.89378272326783f, - 0.8937240070696705f, - 0.8936652755577917f, - 0.8936065287331997f, - 0.8935477665969013f, - 0.8934889891499035f, - 0.893430196393213f, - 0.8933713883278376f, - 0.8933125649547847f, - 0.8932537262750626f, - 0.8931948722896789f, - 0.8931360029996427f, - 0.893077118405962f, - 0.8930182185096465f, - 0.8929593033117048f, - 0.8929003728131469f, - 0.8928414270149823f, - 0.8927824659182209f, - 0.8927234895238733f, - 0.8926644978329498f, - 0.8926054908464613f, - 0.8925464685654189f, - 0.8924874309908339f, - 0.8924283781237179f, - 0.8923693099650828f, - 0.8923102265159405f, - 0.8922511277773036f, - 0.8921920137501846f, - 0.8921328844355966f, - 0.8920737398345526f, - 0.8920145799480661f, - 0.8919554047771507f, - 0.8918962143228206f, - 0.8918370085860896f, - 0.8917777875679727f, - 0.891718551269484f, - 0.891659299691639f, - 0.8916000328354526f, - 0.8915407507019408f, - 0.891481453292119f, - 0.8914221406070032f, - 0.8913628126476099f, - 0.8913034694149558f, - 0.8912441109100573f, - 0.8911847371339319f, - 0.8911253480875966f, - 0.8910659437720695f, - 0.8910065241883679f, - 0.8909470893375104f, - 0.8908876392205152f, - 0.890828173838401f, - 0.8907686931921865f, - 0.8907091972828912f, - 0.8906496861115346f, - 0.8905901596791361f, - 0.890530617986716f, - 0.890471061035294f, - 0.8904114888258914f, - 0.8903519013595281f, - 0.8902922986372258f, - 0.8902326806600052f, - 0.8901730474288884f, - 0.8901133989448967f, - 0.8900537352090525f, - 0.8899940562223779f, - 0.8899343619858956f, - 0.8898746525006286f, - 0.8898149277675996f, - 0.8897551877878325f, - 0.8896954325623504f, - 0.8896356620921776f, - 0.8895758763783379f, - 0.8895160754218561f, - 0.8894562592237564f, - 0.8893964277850642f, - 0.8893365811068044f, - 0.8892767191900026f, - 0.8892168420356843f, - 0.8891569496448759f, - 0.8890970420186034f, - 0.889037119157893f, - 0.888977181063772f, - 0.888917227737267f, - 0.8888572591794056f, - 0.888797275391215f, - 0.8887372763737235f, - 0.8886772621279585f, - 0.888617232654949f, - 0.888557187955723f, - 0.8884971280313098f, - 0.8884370528827384f, - 0.888376962511038f, - 0.8883168569172386f, - 0.8882567361023695f, - 0.8881966000674616f, - 0.8881364488135446f, - 0.8880762823416496f, - 0.8880161006528073f, - 0.8879559037480492f, - 0.8878956916284065f, - 0.8878354642949111f, - 0.8877752217485947f, - 0.8877149639904898f, - 0.8876546910216289f, - 0.8875944028430445f, - 0.88753409945577f, - 0.8874737808608383f, - 0.8874134470592833f, - 0.8873530980521385f, - 0.8872927338404382f, - 0.8872323544252164f, - 0.8871719598075082f, - 0.887111549988348f, - 0.8870511249687709f, - 0.8869906847498127f, - 0.8869302293325085f, - 0.8868697587178946f, - 0.886809272907007f, - 0.8867487719008821f, - 0.8866882557005565f, - 0.8866277243070672f, - 0.8865671777214514f, - 0.8865066159447464f, - 0.8864460389779902f, - 0.8863854468222205f, - 0.8863248394784757f, - 0.8862642169477941f, - 0.8862035792312148f, - 0.8861429263297764f, - 0.8860822582445185f, - 0.8860215749764804f, - 0.885960876526702f, - 0.8859001628962232f, - 0.8858394340860847f, - 0.8857786900973266f, - 0.8857179309309902f, - 0.8856571565881161f, - 0.8855963670697458f, - 0.8855355623769212f, - 0.8854747425106839f, - 0.8854139074720763f, - 0.8853530572621403f, - 0.8852921918819191f, - 0.8852313113324553f, - 0.8851704156147921f, - 0.8851095047299729f, - 0.8850485786790416f, - 0.8849876374630419f, - 0.8849266810830182f, - 0.8848657095400148f, - 0.8848047228350765f, - 0.8847437209692485f, - 0.8846827039435756f, - 0.8846216717591039f, - 0.8845606244168785f, - 0.8844995619179461f, - 0.8844384842633525f, - 0.8843773914541445f, - 0.8843162834913686f, - 0.8842551603760724f, - 0.8841940221093026f, - 0.8841328686921074f, - 0.8840717001255342f, - 0.8840105164106313f, - 0.883949317548447f, - 0.88388810354003f, - 0.883826874386429f, - 0.8837656300886935f, - 0.8837043706478727f, - 0.883643096065016f, - 0.8835818063411738f, - 0.8835205014773959f, - 0.883459181474733f, - 0.8833978463342356f, - 0.8833364960569547f, - 0.8832751306439418f, - 0.883213750096248f, - 0.8831523544149253f, - 0.8830909436010256f, - 0.8830295176556012f, - 0.8829680765797044f, - 0.8829066203743884f, - 0.8828451490407058f, - 0.8827836625797102f, - 0.8827221609924548f, - 0.8826606442799937f, - 0.8825991124433812f, - 0.882537565483671f, - 0.8824760034019185f, - 0.8824144261991776f, - 0.8823528338765042f, - 0.8822912264349533f, - 0.8822296038755807f, - 0.8821679661994419f, - 0.8821063134075936f, - 0.8820446455010917f, - 0.8819829624809934f, - 0.881921264348355f, - 0.8818595511042341f, - 0.8817978227496881f, - 0.8817360792857746f, - 0.8816743207135517f, - 0.8816125470340772f, - 0.8815507582484102f, - 0.881488954357609f, - 0.8814271353627328f, - 0.8813653012648406f, - 0.8813034520649923f, - 0.8812415877642473f, - 0.8811797083636658f, - 0.8811178138643081f, - 0.8810559042672345f, - 0.8809939795735062f, - 0.880932039784184f, - 0.8808700849003294f, - 0.8808081149230037f, - 0.880746129853269f, - 0.8806841296921872f, - 0.8806221144408211f, - 0.8805600841002326f, - 0.8804980386714851f, - 0.8804359781556416f, - 0.8803739025537652f, - 0.8803118118669203f, - 0.8802497060961699f, - 0.880187585242579f, - 0.8801254493072113f, - 0.8800632982911321f, - 0.8800011321954057f, - 0.879938951021098f, - 0.8798767547692737f, - 0.8798145434409993f, - 0.87975231703734f, - 0.8796900755593628f, - 0.8796278190081336f, - 0.8795655473847193f, - 0.8795032606901871f, - 0.879440958925604f, - 0.879378642092038f, - 0.8793163101905562f, - 0.8792539632222272f, - 0.8791916011881189f, - 0.8791292240893002f, - 0.8790668319268395f, - 0.8790044247018065f, - 0.8789420024152699f, - 0.8788795650682995f, - 0.8788171126619654f, - 0.8787546451973375f, - 0.8786921626754859f, - 0.8786296650974817f, - 0.8785671524643954f, - 0.8785046247772985f, - 0.878442082037262f, - 0.8783795242453579f, - 0.8783169514026578f, - 0.8782543635102342f, - 0.8781917605691594f, - 0.8781291425805058f, - 0.8780665095453466f, - 0.8780038614647551f, - 0.8779411983398044f, - 0.8778785201715689f, - 0.8778158269611217f, - 0.8777531187095378f, - 0.877690395417891f, - 0.8776276570872567f, - 0.8775649037187093f, - 0.8775021353133247f, - 0.8774393518721778f, - 0.8773765533963446f, - 0.8773137398869014f, - 0.8772509113449242f, - 0.8771880677714897f, - 0.8771252091676746f, - 0.877062335534556f, - 0.8769994468732112f, - 0.8769365431847179f, - 0.8768736244701537f, - 0.8768106907305971f, - 0.8767477419671259f, - 0.8766847781808192f, - 0.8766217993727555f, - 0.8765588055440142f, - 0.8764957966956747f, - 0.8764327728288163f, - 0.8763697339445193f, - 0.8763066800438635f, - 0.8762436111279297f, - 0.876180527197798f, - 0.8761174282545501f, - 0.8760543142992665f, - 0.875991185333029f, - 0.875928041356919f, - 0.875864882372019f, - 0.8758017083794106f, - 0.8757385193801767f, - 0.8756753153753999f, - 0.8756120963661629f, - 0.8755488623535495f, - 0.8754856133386425f, - 0.8754223493225263f, - 0.8753590703062845f, - 0.8752957762910017f, - 0.875232467277762f, - 0.8751691432676507f, - 0.8751058042617523f, - 0.8750424502611525f, - 0.8749790812669368f, - 0.8749156972801907f, - 0.8748522983020007f, - 0.8747888843334528f, - 0.8747254553756338f, - 0.8746620114296303f, - 0.8745985524965298f, - 0.8745350785774191f, - 0.8744715896733863f, - 0.8744080857855189f, - 0.8743445669149051f, - 0.8742810330626336f, - 0.8742174842297926f, - 0.8741539204174714f, - 0.8740903416267588f, - 0.8740267478587445f, - 0.8739631391145177f, - 0.873899515395169f, - 0.8738358767017879f, - 0.8737722230354653f, - 0.8737085543972916f, - 0.873644870788358f, - 0.8735811722097553f, - 0.8735174586625752f, - 0.8734537301479098f, - 0.8733899866668505f, - 0.8733262282204899f, - 0.87326245480992f, - 0.8731986664362342f, - 0.8731348631005251f, - 0.8730710448038859f, - 0.8730072115474102f, - 0.8729433633321918f, - 0.8728795001593248f, - 0.8728156220299033f, - 0.872751728945022f, - 0.8726878209057753f, - 0.8726238979132589f, - 0.8725599599685676f, - 0.8724960070727973f, - 0.8724320392270434f, - 0.8723680564324023f, - 0.8723040586899702f, - 0.8722400460008438f, - 0.8721760183661198f, - 0.8721119757868955f, - 0.8720479182642678f, - 0.8719838457993346f, - 0.8719197583931941f, - 0.8718556560469439f, - 0.8717915387616827f, - 0.8717274065385089f, - 0.8716632593785216f, - 0.8715990972828197f, - 0.8715349202525029f, - 0.8714707282886706f, - 0.8714065213924229f, - 0.8713422995648596f, - 0.8712780628070818f, - 0.8712138111201895f, - 0.8711495445052838f, - 0.8710852629634663f, - 0.8710209664958379f, - 0.870956655103501f, - 0.8708923287875566f, - 0.8708279875491077f, - 0.8707636313892564f, - 0.8706992603091057f, - 0.8706348743097582f, - 0.8705704733923175f, - 0.8705060575578868f, - 0.8704416268075701f, - 0.8703771811424711f, - 0.8703127205636945f, - 0.8702482450723443f, - 0.8701837546695257f, - 0.8701192493563437f, - 0.870054729133903f, - 0.86999019400331f, - 0.8699256439656697f, - 0.8698610790220889f, - 0.8697964991736731f, - 0.8697319044215296f, - 0.8696672947667646f, - 0.8696026702104855f, - 0.8695380307537999f, - 0.8694733763978146f, - 0.8694087071436384f, - 0.8693440229923785f, - 0.8692793239451438f, - 0.8692146100030426f, - 0.8691498811671841f, - 0.8690851374386769f, - 0.8690203788186309f, - 0.8689556053081554f, - 0.8688908169083602f, - 0.8688260136203559f, - 0.8687611954452523f, - 0.8686963623841606f, - 0.8686315144381912f, - 0.8685666516084557f, - 0.868501773896065f, - 0.8684368813021313f, - 0.868371973827766f, - 0.8683070514740818f, - 0.8682421142421906f, - 0.8681771621332055f, - 0.8681121951482392f, - 0.8680472132884048f, - 0.8679822165548163f, - 0.8679172049485867f, - 0.8678521784708305f, - 0.8677871371226615f, - 0.8677220809051945f, - 0.867657009819544f, - 0.867591923866825f, - 0.8675268230481528f, - 0.867461707364643f, - 0.8673965768174111f, - 0.8673314314075731f, - 0.8672662711362455f, - 0.8672010960045444f, - 0.8671359060135871f, - 0.8670707011644901f, - 0.8670054814583711f, - 0.8669402468963472f, - 0.8668749974795364f, - 0.8668097332090567f, - 0.8667444540860266f, - 0.8666791601115642f, - 0.8666138512867888f, - 0.8665485276128189f, - 0.8664831890907742f, - 0.8664178357217742f, - 0.8663524675069385f, - 0.8662870844473876f, - 0.8662216865442411f, - 0.8661562737986205f, - 0.8660908462116459f, - 0.8660254037844387f, - 0.8659599465181201f, - 0.865894474413812f, - 0.8658289874726357f, - 0.8657634856957138f, - 0.8656979690841684f, - 0.865632437639122f, - 0.865566891361698f, - 0.8655013302530189f, - 0.8654357543142085f, - 0.8653701635463901f, - 0.865304557950688f, - 0.8652389375282258f, - 0.8651733022801283f, - 0.8651076522075198f, - 0.8650419873115257f, - 0.8649763075932706f, - 0.8649106130538802f, - 0.8648449036944803f, - 0.8647791795161965f, - 0.8647134405201551f, - 0.8646476867074826f, - 0.8645819180793053f, - 0.8645161346367507f, - 0.8644503363809455f, - 0.8643845233130175f, - 0.8643186954340942f, - 0.8642528527453034f, - 0.8641869952477736f, - 0.864121122942633f, - 0.8640552358310103f, - 0.8639893339140349f, - 0.8639234171928354f, - 0.8638574856685417f, - 0.8637915393422833f, - 0.8637255782151902f, - 0.8636596022883927f, - 0.8635936115630213f, - 0.8635276060402065f, - 0.8634615857210798f, - 0.8633955506067718f, - 0.8633295006984142f, - 0.8632634359971392f, - 0.8631973565040781f, - 0.8631312622203638f, - 0.8630651531471283f, - 0.8629990292855048f, - 0.8629328906366257f, - 0.8628667372016251f, - 0.8628005689816357f, - 0.862734385977792f, - 0.8626681881912273f, - 0.8626019756230765f, - 0.8625357482744738f, - 0.8624695061465539f, - 0.8624032492404523f, - 0.8623369775573039f, - 0.8622706910982445f, - 0.8622043898644095f, - 0.8621380738569355f, - 0.8620717430769582f, - 0.8620053975256148f, - 0.8619390372040415f, - 0.861872662113376f, - 0.8618062722547549f, - 0.8617398676293165f, - 0.8616734482381982f, - 0.861607014082538f, - 0.8615405651634747f, - 0.8614741014821462f, - 0.8614076230396919f, - 0.8613411298372505f, - 0.8612746218759618f, - 0.861208099156965f, - 0.8611415616814002f, - 0.8610750094504072f, - 0.8610084424651268f, - 0.860941860726699f, - 0.8608752642362651f, - 0.8608086529949663f, - 0.8607420270039436f, - 0.860675386264339f, - 0.860608730777294f, - 0.8605420605439512f, - 0.8604753755654523f, - 0.8604086758429407f, - 0.8603419613775585f, - 0.8602752321704494f, - 0.8602084882227565f, - 0.8601417295356236f, - 0.8600749561101947f, - 0.8600081679476136f, - 0.8599413650490251f, - 0.8598745474155733f, - 0.8598077150484038f, - 0.8597408679486611f, - 0.8596740061174911f, - 0.8596071295560391f, - 0.8595402382654513f, - 0.8594733322468736f, - 0.8594064115014528f, - 0.859339476030335f, - 0.8592725258346674f, - 0.8592055609155975f, - 0.8591385812742722f, - 0.8590715869118397f, - 0.8590045778294474f, - 0.8589375540282439f, - 0.8588705155093775f, - 0.8588034622739966f, - 0.8587363943232507f, - 0.8586693116582884f, - 0.8586022142802596f, - 0.8585351021903137f, - 0.8584679753896008f, - 0.858400833879271f, - 0.8583336776604751f, - 0.8582665067343632f, - 0.8581993211020867f, - 0.8581321207647966f, - 0.8580649057236447f, - 0.8579976759797822f, - 0.8579304315343614f, - 0.8578631723885344f, - 0.8577958985434538f, - 0.8577286100002721f, - 0.8576613067601424f, - 0.8575939888242181f, - 0.8575266561936522f, - 0.857459308869599f, - 0.857391946853212f, - 0.8573245701456458f, - 0.8572571787480545f, - 0.8571897726615932f, - 0.8571223518874166f, - 0.8570549164266803f, - 0.8569874662805392f, - 0.8569200014501497f, - 0.8568525219366673f, - 0.8567850277412483f, - 0.8567175188650497f, - 0.8566499953092275f, - 0.8565824570749394f, - 0.856514904163342f, - 0.8564473365755934f, - 0.8563797543128508f, - 0.8563121573762726f, - 0.8562445457670169f, - 0.8561769194862424f, - 0.8561092785351074f, - 0.8560416229147715f, - 0.8559739526263934f, - 0.8559062676711331f, - 0.8558385680501499f, - 0.8557708537646043f, - 0.8557031248156562f, - 0.8556353812044661f, - 0.8555676229321952f, - 0.855499850000004f, - 0.8554320624090541f, - 0.8553642601605067f, - 0.8552964432555241f, - 0.8552286116952678f, - 0.8551607654809001f, - 0.8550929046135841f, - 0.855025029094482f, - 0.8549571389247571f, - 0.8548892341055725f, - 0.8548213146380921f, - 0.854753380523479f, - 0.854685431762898f, - 0.8546174683575128f, - 0.8545494903084884f, - 0.8544814976169891f, - 0.8544134902841801f, - 0.8543454683112272f, - 0.8542774316992952f, - 0.8542093804495503f, - 0.8541413145631583f, - 0.8540732340412859f, - 0.8540051388850991f, - 0.8539370290957652f, - 0.8538689046744508f, - 0.8538007656223235f, - 0.8537326119405507f, - 0.8536644436303005f, - 0.8535962606927403f, - 0.8535280631290388f, - 0.8534598509403648f, - 0.8533916241278866f, - 0.8533233826927737f, - 0.853255126636195f, - 0.8531868559593203f, - 0.8531185706633192f, - 0.8530502707493621f, - 0.852981956218619f, - 0.8529136270722604f, - 0.8528452833114574f, - 0.8527769249373807f, - 0.8527085519512019f, - 0.8526401643540923f, - 0.852571762147224f, - 0.8525033453317686f, - 0.852434913908899f, - 0.8523664678797873f, - 0.8522980072456066f, - 0.8522295320075296f, - 0.8521610421667299f, - 0.8520925377243809f, - 0.8520240186816567f, - 0.8519554850397308f, - 0.8518869367997779f, - 0.8518183739629727f, - 0.8517497965304894f, - 0.8516812045035039f, - 0.8516125978831908f, - 0.851543976670726f, - 0.851475340867285f, - 0.8514066904740444f, - 0.85133802549218f, - 0.8512693459228686f, - 0.8512006517672868f, - 0.8511319430266118f, - 0.851063219702021f, - 0.8509944817946917f, - 0.8509257293058022f, - 0.8508569622365298f, - 0.8507881805880536f, - 0.8507193843615515f, - 0.8506505735582028f, - 0.8505817481791862f, - 0.8505129082256813f, - 0.8504440536988672f, - 0.8503751845999242f, - 0.850306300930032f, - 0.8502374026903713f, - 0.8501684898821221f, - 0.8500995625064659f, - 0.850030620564583f, - 0.8499616640576553f, - 0.8498926929868639f, - 0.8498237073533911f, - 0.8497547071584183f, - 0.8496856924031285f, - 0.8496166630887039f, - 0.849547619216327f, - 0.8494785607871813f, - 0.8494094878024501f, - 0.8493404002633166f, - 0.849271298170965f, - 0.8492021815265789f, - 0.8491330503313431f, - 0.8490639045864417f, - 0.8489947442930599f, - 0.8489255694523822f, - 0.8488563800655945f, - 0.8487871761338819f, - 0.8487179576584305f, - 0.848648724640426f, - 0.8485794770810547f, - 0.8485102149815037f, - 0.8484409383429592f, - 0.8483716471666086f, - 0.8483023414536388f, - 0.8482330212052378f, - 0.8481636864225929f, - 0.8480943371068926f, - 0.8480249732593248f, - 0.8479555948810784f, - 0.8478862019733416f, - 0.8478167945373042f, - 0.8477473725741548f, - 0.8476779360850831f, - 0.8476084850712793f, - 0.8475390195339328f, - 0.8474695394742344f, - 0.8474000448933743f, - 0.8473305357925435f, - 0.8472610121729326f, - 0.8471914740357335f, - 0.847121921382137f, - 0.8470523542133356f, - 0.8469827725305207f, - 0.846913176334885f, - 0.8468435656276209f, - 0.8467739404099207f, - 0.8467043006829782f, - 0.8466346464479859f, - 0.8465649777061379f, - 0.8464952944586276f, - 0.8464255967066493f, - 0.8463558844513968f, - 0.8462861576940651f, - 0.8462164164358486f, - 0.8461466606779425f, - 0.8460768904215418f, - 0.8460071056678422f, - 0.8459373064180395f, - 0.8458674926733295f, - 0.8457976644349088f, - 0.8457278217039732f, - 0.8456579644817203f, - 0.8455880927693463f, - 0.845518206568049f, - 0.8454483058790254f, - 0.8453783907034738f, - 0.8453084610425916f, - 0.8452385168975772f, - 0.8451685582696296f, - 0.8450985851599467f, - 0.8450285975697281f, - 0.8449585955001726f, - 0.84488857895248f, - 0.8448185479278497f, - 0.844748502427482f, - 0.8446784424525767f, - 0.8446083680043348f, - 0.8445382790839564f, - 0.844468175692643f, - 0.8443980578315953f, - 0.844327925502015f, - 0.844257778705104f, - 0.8441876174420638f, - 0.8441174417140972f, - 0.8440472515224061f, - 0.8439770468681933f, - 0.843906827752662f, - 0.843836594177015f, - 0.843766346142456f, - 0.8436960836501886f, - 0.8436258067014168f, - 0.8435555152973446f, - 0.8434852094391767f, - 0.8434148891281175f, - 0.8433445543653721f, - 0.8432742051521455f, - 0.8432038414896433f, - 0.843133463379071f, - 0.8430630708216348f, - 0.8429926638185403f, - 0.8429222423709947f, - 0.8428518064802037f, - 0.8427813561473751f, - 0.8427108913737154f, - 0.8426404121604322f, - 0.8425699185087334f, - 0.8424994104198266f, - 0.8424288878949201f, - 0.8423583509352219f, - 0.8422877995419413f, - 0.8422172337162865f, - 0.8421466534594673f, - 0.8420760587726923f, - 0.8420054496571718f, - 0.8419348261141153f, - 0.8418641881447329f, - 0.8417935357502353f, - 0.8417228689318327f, - 0.8416521876907364f, - 0.8415814920281569f, - 0.8415107819453062f, - 0.8414400574433953f, - 0.8413693185236366f, - 0.8412985651872418f, - 0.8412277974354235f, - 0.841157015269394f, - 0.8410862186903665f, - 0.8410154076995536f, - 0.8409445822981692f, - 0.8408737424874263f, - 0.8408028882685392f, - 0.8407320196427215f, - 0.8406611366111881f, - 0.8405902391751532f, - 0.8405193273358313f, - 0.8404484010944382f, - 0.8403774604521885f, - 0.8403065054102984f, - 0.840235535969983f, - 0.8401645521324589f, - 0.840093553898942f, - 0.840022541270649f, - 0.839951514248797f, - 0.8398804728346023f, - 0.839809417029283f, - 0.839738346834056f, - 0.8396672622501394f, - 0.839596163278751f, - 0.8395250499211093f, - 0.8394539221784325f, - 0.8393827800519398f, - 0.8393116235428497f, - 0.8392404526523817f, - 0.8391692673817553f, - 0.8390980677321902f, - 0.8390268537049066f, - 0.8389556253011242f, - 0.8388843825220641f, - 0.8388131253689466f, - 0.8387418538429929f, - 0.838670567945424f, - 0.8385992676774617f, - 0.8385279530403272f, - 0.8384566240352431f, - 0.838385280663431f, - 0.8383139229261136f, - 0.8382425508245138f, - 0.8381711643598542f, - 0.8380997635333584f, - 0.8380283483462493f, - 0.837956918799751f, - 0.8378854748950871f, - 0.8378140166334822f, - 0.8377425440161606f, - 0.8376710570443464f, - 0.8375995557192653f, - 0.8375280400421418f, - 0.8374565100142018f, - 0.8373849656366705f, - 0.8373134069107744f, - 0.837241833837739f, - 0.8371702464187912f, - 0.8370986446551572f, - 0.8370270285480642f, - 0.8369553980987391f, - 0.8368837533084095f, - 0.8368120941783027f, - 0.8367404207096469f, - 0.8366687329036699f, - 0.8365970307616002f, - 0.8365253142846666f, - 0.8364535834740975f, - 0.8363818383311225f, - 0.8363100788569703f, - 0.8362383050528711f, - 0.8361665169200543f, - 0.8360947144597504f, - 0.8360228976731892f, - 0.8359510665616016f, - 0.8358792211262183f, - 0.8358073613682702f, - 0.835735487288989f, - 0.8356635988896058f, - 0.8355916961713529f, - 0.8355197791354617f, - 0.8354478477831652f, - 0.8353759021156951f, - 0.8353039421342849f, - 0.8352319678401672f, - 0.8351599792345755f, - 0.835087976318743f, - 0.8350159590939039f, - 0.8349439275612917f, - 0.834871881722141f, - 0.834799821577686f, - 0.8347277471291618f, - 0.8346556583778029f, - 0.8345835553248451f, - 0.8345114379715233f, - 0.8344393063190736f, - 0.8343671603687318f, - 0.8342950001217341f, - 0.834222825579317f, - 0.8341506367427169f, - 0.8340784336131711f, - 0.8340062161919171f, - 0.8339339844801914f, - 0.8338617384792324f, - 0.8337894781902776f, - 0.8337172036145657f, - 0.8336449147533345f, - 0.833572611607823f, - 0.8335002941792699f, - 0.8334279624689146f, - 0.833355616477996f, - 0.8332832562077545f, - 0.833210881659429f, - 0.8331384928342604f, - 0.833066089733489f, - 0.8329936723583549f, - 0.8329212407100995f, - 0.8328487947899635f, - 0.8327763345991887f, - 0.832703860139016f, - 0.832631371410688f, - 0.832558868415446f, - 0.8324863511545331f, - 0.8324138196291911f, - 0.8323412738406633f, - 0.8322687137901928f, - 0.8321961394790226f, - 0.8321235509083965f, - 0.832050948079558f, - 0.8319783309937515f, - 0.8319056996522208f, - 0.831833054056211f, - 0.8317603942069663f, - 0.8316877201057322f, - 0.8316150317537534f, - 0.831542329152276f, - 0.8314696123025453f, - 0.8313968812058075f, - 0.8313241358633087f, - 0.8312513762762953f, - 0.8311786024460143f, - 0.8311058143737123f, - 0.831033012060637f, - 0.8309601955080352f, - 0.8308873647171553f, - 0.8308145196892446f, - 0.8307416604255519f, - 0.8306687869273248f, - 0.8305958991958129f, - 0.8305229972322643f, - 0.8304500810379286f, - 0.8303771506140553f, - 0.8303042059618937f, - 0.8302312470826939f, - 0.8301582739777059f, - 0.8300852866481804f, - 0.8300122850953675f, - 0.8299392693205185f, - 0.8298662393248842f, - 0.8297931951097163f, - 0.8297201366762659f, - 0.8296470640257851f, - 0.8295739771595263f, - 0.8295008760787412f, - 0.829427760784683f, - 0.829354631278604f, - 0.8292814875617577f, - 0.8292083296353968f, - 0.8291351575007755f, - 0.829061971159147f, - 0.8289887706117659f, - 0.8289155558598859f, - 0.828842326904762f, - 0.8287690837476486f, - 0.8286958263898008f, - 0.828622554832474f, - 0.8285492690769235f, - 0.8284759691244054f, - 0.8284026549761753f, - 0.8283293266334892f, - 0.8282559840976043f, - 0.8281826273697765f, - 0.8281092564512634f, - 0.8280358713433217f, - 0.8279624720472092f, - 0.8278890585641833f, - 0.8278156308955023f, - 0.8277421890424237f, - 0.8276687330062067f, - 0.8275952627881092f, - 0.8275217783893908f, - 0.8274482798113101f, - 0.8273747670551268f, - 0.8273012401221002f, - 0.8272276990134906f, - 0.8271541437305575f, - 0.827080574274562f, - 0.8270069906467641f, - 0.8269333928484247f, - 0.8268597808808054f, - 0.8267861547451667f, - 0.826712514442771f, - 0.8266388599748794f, - 0.8265651913427546f, - 0.8264915085476582f, - 0.8264178115908534f, - 0.8263441004736024f, - 0.8262703751971687f, - 0.8261966357628152f, - 0.8261228821718055f, - 0.8260491144254036f, - 0.8259753325248731f, - 0.8259015364714786f, - 0.8258277262664843f, - 0.825753901911155f, - 0.8256800634067557f, - 0.8256062107545517f, - 0.8255323439558081f, - 0.825458463011791f, - 0.825384567923766f, - 0.8253106586929997f, - 0.8252367353207578f, - 0.8251627978083078f, - 0.8250888461569158f, - 0.8250148803678498f, - 0.8249409004423764f, - 0.8248669063817635f, - 0.8247928981872792f, - 0.8247188758601912f, - 0.8246448394017684f, - 0.8245707888132786f, - 0.8244967240959915f, - 0.8244226452511755f, - 0.8243485522801002f, - 0.8242744451840354f, - 0.8242003239642504f, - 0.8241261886220158f, - 0.8240520391586014f, - 0.823977875575278f, - 0.8239036978733163f, - 0.8238295060539874f, - 0.8237553001185624f, - 0.823681080068313f, - 0.8236068459045105f, - 0.8235325976284276f, - 0.8234583352413358f, - 0.8233840587445079f, - 0.823309768139217f, - 0.8232354634267351f, - 0.8231611446083364f, - 0.8230868116852936f, - 0.8230124646588809f, - 0.8229381035303717f, - 0.8228637283010407f, - 0.8227893389721617f, - 0.82271493554501f, - 0.8226405180208598f, - 0.8225660864009866f, - 0.822491640686666f, - 0.822417180879173f, - 0.8223427069797842f, - 0.822268218989775f, - 0.8221937169104222f, - 0.8221192007430019f, - 0.8220446704887916f, - 0.8219701261490678f, - 0.8218955677251079f, - 0.8218209952181895f, - 0.8217464086295903f, - 0.8216718079605886f, - 0.8215971932124622f, - 0.8215225643864901f, - 0.8214479214839505f, - 0.8213732645061229f, - 0.8212985934542862f, - 0.8212239083297201f, - 0.8211492091337041f, - 0.8210744958675185f, - 0.8209997685324428f, - 0.8209250271297582f, - 0.8208502716607449f, - 0.820775502126684f, - 0.8207007185288566f, - 0.820625920868544f, - 0.8205511091470282f, - 0.8204762833655905f, - 0.8204014435255137f, - 0.8203265896280796f, - 0.8202517216745712f, - 0.8201768396662708f, - 0.8201019436044622f, - 0.820027033490428f, - 0.8199521093254525f, - 0.8198771711108188f, - 0.8198022188478112f, - 0.8197272525377145f, - 0.8196522721818124f, - 0.8195772777813903f, - 0.8195022693377327f, - 0.8194272468521255f, - 0.8193522103258535f, - 0.8192771597602029f, - 0.8192020951564594f, - 0.8191270165159094f, - 0.819051923839839f, - 0.8189768171295356f, - 0.8189016963862853f, - 0.818826561611376f, - 0.8187514128060945f, - 0.8186762499717289f, - 0.8186010731095669f, - 0.8185258822208967f, - 0.8184506773070065f, - 0.8183754583691852f, - 0.8183002254087217f, - 0.8182249784269046f, - 0.8181497174250237f, - 0.8180744424043682f, - 0.8179991533662282f, - 0.8179238503118939f, - 0.8178485332426552f, - 0.817773202159803f, - 0.8176978570646277f, - 0.8176224979584208f, - 0.817547124842473f, - 0.8174717377180765f, - 0.8173963365865221f, - 0.8173209214491027f, - 0.8172454923071099f, - 0.8171700491618366f, - 0.817094592014575f, - 0.8170191208666183f, - 0.81694363571926f, - 0.8168681365737929f, - 0.8167926234315113f, - 0.8167170962937084f, - 0.816641555161679f, - 0.816566000036717f, - 0.8164904309201173f, - 0.8164148478131745f, - 0.816339250717184f, - 0.8162636396334408f, - 0.8161880145632407f, - 0.8161123755078797f, - 0.8160367224686533f, - 0.8159610554468585f, - 0.8158853744437912f, - 0.8158096794607486f, - 0.8157339704990273f, - 0.815658247559925f, - 0.8155825106447389f, - 0.8155067597547669f, - 0.8154309948913068f, - 0.815355216055657f, - 0.815279423249116f, - 0.8152036164729819f, - 0.8151277957285544f, - 0.8150519610171321f, - 0.8149761123400149f, - 0.8149002496985019f, - 0.8148243730938937f, - 0.8147484825274895f, - 0.8146725780005906f, - 0.8145966595144968f, - 0.8145207270705096f, - 0.8144447806699295f, - 0.8143688203140582f, - 0.8142928460041974f, - 0.8142168577416484f, - 0.8141408555277139f, - 0.8140648393636953f, - 0.813988809250896f, - 0.8139127651906181f, - 0.8138367071841651f, - 0.8137606352328397f, - 0.813684549337946f, - 0.813608449500787f, - 0.8135323357226674f, - 0.8134562080048907f, - 0.8133800663487616f, - 0.8133039107555852f, - 0.8132277412266656f, - 0.8131515577633087f, - 0.8130753603668193f, - 0.8129991490385035f, - 0.8129229237796666f, - 0.8128466845916152f, - 0.8127704314756554f, - 0.8126941644330941f, - 0.8126178834652374f, - 0.8125415885733932f, - 0.8124652797588681f, - 0.81238895702297f, - 0.8123126203670068f, - 0.8122362697922862f, - 0.8121599053001165f, - 0.8120835268918063f, - 0.8120071345686641f, - 0.8119307283319993f, - 0.8118543081831205f, - 0.8117778741233378f, - 0.8117014261539602f, - 0.8116249642762983f, - 0.8115484884916616f, - 0.811471998801361f, - 0.8113954952067067f, - 0.8113189777090102f, - 0.8112424463095818f, - 0.8111659010097335f, - 0.8110893418107764f, - 0.8110127687140228f, - 0.8109361817207843f, - 0.8108595808323736f, - 0.8107829660501029f, - 0.8107063373752853f, - 0.8106296948092334f, - 0.8105530383532606f, - 0.8104763680086808f, - 0.8103996837768072f, - 0.8103229856589541f, - 0.8102462736564353f, - 0.8101695477705658f, - 0.8100928080026597f, - 0.8100160543540325f, - 0.8099392868259987f, - 0.8098625054198744f, - 0.8097857101369745f, - 0.8097089009786153f, - 0.809632077946113f, - 0.8095552410407836f, - 0.8094783902639441f, - 0.8094015256169108f, - 0.8093246471010013f, - 0.8092477547175324f, - 0.8091708484678221f, - 0.8090939283531876f, - 0.8090169943749475f, - 0.8089400465344195f, - 0.8088630848329226f, - 0.8087861092717751f, - 0.8087091198522962f, - 0.8086321165758049f, - 0.8085550994436209f, - 0.8084780684570638f, - 0.8084010236174533f, - 0.8083239649261096f, - 0.8082468923843531f, - 0.8081698059935046f, - 0.8080927057548846f, - 0.8080155916698146f, - 0.8079384637396156f, - 0.8078613219656092f, - 0.8077841663491176f, - 0.8077069968914623f, - 0.807629813593966f, - 0.8075526164579508f, - 0.8074754054847401f, - 0.807398180675656f, - 0.8073209420320226f, - 0.8072436895551627f, - 0.8071664232464004f, - 0.8070891431070594f, - 0.8070118491384641f, - 0.8069345413419386f, - 0.8068572197188077f, - 0.8067798842703967f, - 0.8067025349980299f, - 0.8066251719030335f, - 0.8065477949867323f, - 0.806470404250453f, - 0.8063929996955208f, - 0.8063155813232628f, - 0.8062381491350047f, - 0.8061607031320741f, - 0.8060832433157973f, - 0.8060057696875019f, - 0.8059282822485158f, - 0.8058507810001659f, - 0.805773265943781f, - 0.8056957370806884f, - 0.8056181944122174f, - 0.805540637939696f, - 0.8054630676644536f, - 0.8053854835878193f, - 0.805307885711122f, - 0.8052302740356918f, - 0.8051526485628583f, - 0.8050750092939518f, - 0.8049973562303023f, - 0.8049196893732409f, - 0.8048420087240977f, - 0.8047643142842045f, - 0.8046866060548918f, - 0.804608884037492f, - 0.8045311482333358f, - 0.8044533986437562f, - 0.8043756352700846f, - 0.8042978581136541f, - 0.8042200671757967f, - 0.8041422624578458f, - 0.8040644439611347f, - 0.8039866116869965f, - 0.8039087656367649f, - 0.8038309058117737f, - 0.8037530322133574f, - 0.8036751448428497f, - 0.8035972437015858f, - 0.8035193287908999f, - 0.8034414001121277f, - 0.8033634576666039f, - 0.8032855014556646f, - 0.8032075314806449f, - 0.8031295477428813f, - 0.8030515502437099f, - 0.802973538984467f, - 0.8028955139664897f, - 0.8028174751911145f, - 0.8027394226596789f, - 0.8026613563735199f, - 0.8025832763339757f, - 0.8025051825423837f, - 0.8024270750000824f, - 0.8023489537084096f, - 0.8022708186687046f, - 0.8021926698823055f, - 0.8021145073505522f, - 0.8020363310747831f, - 0.8019581410563384f, - 0.8018799372965574f, - 0.8018017197967806f, - 0.801723488558348f, - 0.8016452435825996f, - 0.8015669848708769f, - 0.80148871242452f, - 0.801410426244871f, - 0.8013321263332706f, - 0.8012538126910607f, - 0.8011754853195834f, - 0.8010971442201803f, - 0.8010187893941944f, - 0.8009404208429677f, - 0.8008620385678434f, - 0.8007836425701643f, - 0.800705232851274f, - 0.8006268094125157f, - 0.8005483722552336f, - 0.800469921380771f, - 0.800391456790473f, - 0.8003129784856832f, - 0.8002344864677468f, - 0.8001559807380089f, - 0.8000774612978142f, - 0.7999989281485086f, - 0.7999203812914373f, - 0.7998418207279465f, - 0.799763246459382f, - 0.7996846584870906f, - 0.7996060568124184f, - 0.7995274414367126f, - 0.7994488123613199f, - 0.7993701695875878f, - 0.7992915131168641f, - 0.7992128429504959f, - 0.7991341590898319f, - 0.7990554615362196f, - 0.7989767502910082f, - 0.7988980253555458f, - 0.7988192867311817f, - 0.7987405344192647f, - 0.7986617684211448f, - 0.798582988738171f, - 0.7985041953716936f, - 0.7984253883230625f, - 0.798346567593628f, - 0.7982677331847409f, - 0.7981888850977515f, - 0.7981100233340116f, - 0.7980311478948717f, - 0.7979522587816841f, - 0.7978733559957997f, - 0.7977944395385712f, - 0.7977155094113503f, - 0.7976365656154899f, - 0.7975576081523421f, - 0.7974786370232603f, - 0.7973996522295976f, - 0.7973206537727071f, - 0.797241641653943f, - 0.7971626158746582f, - 0.7970835764362079f, - 0.7970045233399453f, - 0.796925456587226f, - 0.796846376179404f, - 0.7967672821178349f, - 0.7966881744038733f, - 0.7966090530388754f, - 0.7965299180241964f, - 0.7964507693611923f, - 0.7963716070512198f, - 0.7962924310956346f, - 0.7962132414957941f, - 0.7961340382530545f, - 0.7960548213687735f, - 0.7959755908443079f, - 0.7958963466810159f, - 0.7958170888802548f, - 0.7957378174433831f, - 0.7956585323717587f, - 0.7955792336667401f, - 0.7954999213296866f, - 0.7954205953619568f, - 0.79534125576491f, - 0.7952619025399057f, - 0.7951825356883034f, - 0.7951031552114634f, - 0.7950237611107454f, - 0.7949443533875102f, - 0.794864932043118f, - 0.7947854970789303f, - 0.7947060484963078f, - 0.7946265862966115f, - 0.7945471104812034f, - 0.7944676210514455f, - 0.7943881180086994f, - 0.7943086013543276f, - 0.7942290710896922f, - 0.7941495272161566f, - 0.7940699697350831f, - 0.7939903986478355f, - 0.7939108139557767f, - 0.7938312156602707f, - 0.7937516037626812f, - 0.7936719782643723f, - 0.7935923391667088f, - 0.7935126864710547f, - 0.7934330201787753f, - 0.7933533402912352f, - 0.7932736468098002f, - 0.7931939397358353f, - 0.7931142190707068f, - 0.7930344848157802f, - 0.7929547369724222f, - 0.7928749755419987f, - 0.792795200525877f, - 0.7927154119254235f, - 0.7926356097420055f, - 0.7925557939769908f, - 0.7924759646317464f, - 0.7923961217076407f, - 0.7923162652060413f, - 0.792236395128317f, - 0.7921565114758358f, - 0.7920766142499671f, - 0.7919967034520793f, - 0.7919167790835422f, - 0.7918368411457248f, - 0.7917568896399974f, - 0.7916769245677292f, - 0.7915969459302911f, - 0.7915169537290532f, - 0.7914369479653858f, - 0.7913569286406604f, - 0.7912768957562476f, - 0.7911968493135192f, - 0.7911167893138463f, - 0.7910367157586012f, - 0.7909566286491554f, - 0.7908765279868818f, - 0.7907964137731522f, - 0.7907162860093397f, - 0.7906361446968175f, - 0.7905559898369584f, - 0.7904758214311361f, - 0.7903956394807241f, - 0.7903154439870965f, - 0.790235234951627f, - 0.7901550123756905f, - 0.7900747762606611f, - 0.7899945266079141f, - 0.7899142634188241f, - 0.7898339866947668f, - 0.7897536964371173f, - 0.7896733926472516f, - 0.7895930753265459f, - 0.7895127444763758f, - 0.7894324000981184f, - 0.7893520421931499f, - 0.7892716707628478f, - 0.7891912858085884f, - 0.7891108873317498f, - 0.7890304753337092f, - 0.7889500498158447f, - 0.7888696107795341f, - 0.7887891582261558f, - 0.7887086921570886f, - 0.7886282125737107f, - 0.7885477194774019f, - 0.7884672128695406f, - 0.7883866927515069f, - 0.7883061591246798f, - 0.7882256119904401f, - 0.7881450513501673f, - 0.7880644772052419f, - 0.7879838895570447f, - 0.7879032884069562f, - 0.7878226737563581f, - 0.7877420456066309f, - 0.787661403959157f, - 0.7875807488153173f, - 0.7875000801764945f, - 0.7874193980440705f, - 0.787338702419428f, - 0.7872579933039493f, - 0.7871772706990178f, - 0.7870965346060161f, - 0.7870157850263283f, - 0.7869350219613374f, - 0.7868542454124274f, - 0.7867734553809829f, - 0.7866926518683874f, - 0.7866118348760262f, - 0.7865310044052833f, - 0.7864501604575446f, - 0.7863693030341944f, - 0.786288432136619f, - 0.7862075477662035f, - 0.7861266499243343f, - 0.7860457386123971f, - 0.7859648138317787f, - 0.7858838755838654f, - 0.7858029238700442f, - 0.7857219586917025f, - 0.7856409800502269f, - 0.7855599879470058f, - 0.7854789823834261f, - 0.7853979633608765f, - 0.7853169308807448f, - 0.78523588494442f, - 0.7851548255532901f, - 0.7850737527087446f, - 0.7849926664121722f, - 0.7849115666649629f, - 0.7848304534685056f, - 0.7847493268241907f, - 0.784668186733408f, - 0.7845870331975481f, - 0.784505866218001f, - 0.7844246857961582f, - 0.7843434919334104f, - 0.7842622846311483f, - 0.7841810638907643f, - 0.7840998297136492f, - 0.7840185821011957f, - 0.7839373210547953f, - 0.7838560465758406f, - 0.7837747586657248f, - 0.7836934573258398f, - 0.7836121425575795f, - 0.7835308143623365f, - 0.783449472741505f, - 0.7833681176964782f, - 0.7832867492286505f, - 0.7832053673394158f, - 0.7831239720301689f, - 0.7830425633023042f, - 0.7829611411572168f, - 0.7828797055963016f, - 0.7827982566209543f, - 0.7827167942325703f, - 0.7826353184325454f, - 0.7825538292222761f, - 0.7824723266031579f, - 0.7823908105765882f, - 0.782309281143963f, - 0.7822277383066799f, - 0.7821461820661356f, - 0.7820646124237279f, - 0.7819830293808543f, - 0.7819014329389126f, - 0.7818198230993014f, - 0.7817381998634184f, - 0.781656563232663f, - 0.7815749132084331f, - 0.7814932497921286f, - 0.7814115729851481f, - 0.7813298827888916f, - 0.7812481792047584f, - 0.7811664622341491f, - 0.7810847318784634f, - 0.7810029881391016f, - 0.7809212310174648f, - 0.7808394605149535f, - 0.7807576766329692f, - 0.7806758793729128f, - 0.7805940687361864f, - 0.7805122447241913f, - 0.7804304073383299f, - 0.7803485565800041f, - 0.780266692450617f, - 0.7801848149515704f, - 0.7801029240842683f, - 0.7800210198501129f, - 0.7799391022505081f, - 0.7798571712868578f, - 0.7797752269605652f, - 0.7796932692730351f, - 0.7796112982256712f, - 0.7795293138198786f, - 0.7794473160570615f, - 0.7793653049386254f, - 0.7792832804659753f, - 0.7792012426405168f, - 0.7791191914636554f, - 0.7790371269367973f, - 0.7789550490613483f, - 0.7788729578387149f, - 0.7787908532703042f, - 0.7787087353575222f, - 0.7786266041017766f, - 0.7785444595044745f, - 0.7784623015670235f, - 0.778380130290831f, - 0.7782979456773056f, - 0.7782157477278548f, - 0.7781335364438878f, - 0.7780513118268125f, - 0.7779690738780383f, - 0.7778868225989743f, - 0.7778045579910299f, - 0.7777222800556142f, - 0.7776399887941375f, - 0.7775576842080096f, - 0.777475366298641f, - 0.7773930350674418f, - 0.7773106905158232f, - 0.7772283326451958f, - 0.777145961456971f, - 0.7770635769525602f, - 0.7769811791333746f, - 0.7768987680008265f, - 0.7768163435563281f, - 0.7767339058012912f, - 0.776651454737129f, - 0.7765689903652537f, - 0.7764865126870788f, - 0.776404021704017f, - 0.7763215174174823f, - 0.7762389998288879f, - 0.7761564689396482f, - 0.7760739247511768f, - 0.7759913672648884f, - 0.7759087964821978f, - 0.7758262124045193f, - 0.7757436150332685f, - 0.7756610043698603f, - 0.7755783804157105f, - 0.7754957431722345f, - 0.7754130926408486f, - 0.7753304288229687f, - 0.7752477517200115f, - 0.7751650613333934f, - 0.7750823576645315f, - 0.7749996407148426f, - 0.7749169104857443f, - 0.7748341669786543f, - 0.7747514101949899f, - 0.7746686401361697f, - 0.7745858568036114f, - 0.7745030601987338f, - 0.7744202503229554f, - 0.7743374271776955f, - 0.7742545907643726f, - 0.7741717410844069f, - 0.7740888781392171f, - 0.774006001930224f, - 0.7739231124588467f, - 0.7738402097265062f, - 0.7737572937346229f, - 0.7736743644846171f, - 0.7735914219779103f, - 0.7735084662159233f, - 0.7734254972000779f, - 0.7733425149317954f, - 0.7732595194124979f, - 0.7731765106436074f, - 0.7730934886265464f, - 0.7730104533627371f, - 0.7729274048536025f, - 0.7728443431005659f, - 0.7727612681050501f, - 0.7726781798684789f, - 0.7725950783922756f, - 0.7725119636778646f, - 0.7724288357266695f, - 0.7723456945401154f, - 0.772262540119626f, - 0.772179372466627f, - 0.7720961915825428f, - 0.7720129974687993f, - 0.7719297901268213f, - 0.7718465695580349f, - 0.7717633357638662f, - 0.7716800887457411f, - 0.7715968285050865f, - 0.7715135550433283f, - 0.7714302683618941f, - 0.7713469684622104f, - 0.7712636553457051f, - 0.7711803290138051f, - 0.7710969894679387f, - 0.7710136367095335f, - 0.770930270740018f, - 0.7708468915608208f, - 0.7707634991733701f, - 0.7706800935790953f, - 0.7705966747794251f, - 0.7705132427757893f, - 0.7704297975696172f, - 0.7703463391623384f, - 0.7702628675553835f, - 0.7701793827501823f, - 0.7700958847481655f, - 0.7700123735507637f, - 0.769928849159408f, - 0.7698453115755293f, - 0.7697617608005595f, - 0.7696781968359294f, - 0.7695946196830719f, - 0.769511029343418f, - 0.7694274258184008f, - 0.7693438091094524f, - 0.7692601792180058f, - 0.7691765361454937f, - 0.7690928798933497f, - 0.7690092104630067f, - 0.7689255278558986f, - 0.7688418320734596f, - 0.7687581231171233f, - 0.7686744009883244f, - 0.7685906656884971f, - 0.7685069172190767f, - 0.7684231555814977f, - 0.7683393807771957f, - 0.7682555928076056f, - 0.7681717916741638f, - 0.7680879773783057f, - 0.7680041499214679f, - 0.7679203093050861f, - 0.7678364555305973f, - 0.7677525885994386f, - 0.7676687085130464f, - 0.7675848152728585f, - 0.767500908880312f, - 0.767416989336845f, - 0.7673330566438948f, - 0.7672491108029005f, - 0.7671651518152995f, - 0.7670811796825312f, - 0.7669971944060339f, - 0.7669131959872472f, - 0.7668291844276096f, - 0.7667451597285616f, - 0.766661121891542f, - 0.7665770709179915f, - 0.7664930068093498f, - 0.7664089295670578f, - 0.7663248391925557f, - 0.7662407356872843f, - 0.7661566190526852f, - 0.7660724892901991f, - 0.7659883464012682f, - 0.7659041903873336f, - 0.7658200212498376f, - 0.7657358389902228f, - 0.7656516436099309f, - 0.7655674351104053f, - 0.7654832134930881f, - 0.7653989787594233f, - 0.7653147309108534f, - 0.7652304699488226f, - 0.7651461958747743f, - 0.7650619086901528f, - 0.7649776083964019f, - 0.7648932949949664f, - 0.7648089684872912f, - 0.7647246288748206f, - 0.7646402761590004f, - 0.7645559103412753f, - 0.7644715314230917f, - 0.7643871394058945f, - 0.7643027342911306f, - 0.7642183160802454f, - 0.7641338847746861f, - 0.764049440375899f, - 0.7639649828853313f, - 0.7638805123044298f, - 0.763796028634642f, - 0.7637115318774159f, - 0.7636270220341989f, - 0.7635424991064393f, - 0.763457963095585f, - 0.7633734140030851f, - 0.7632888518303876f, - 0.7632042765789422f, - 0.7631196882501974f, - 0.7630350868456033f, - 0.762950472366609f, - 0.7628658448146642f, - 0.7627812041912195f, - 0.7626965504977248f, - 0.7626118837356309f, - 0.7625272039063882f, - 0.7624425110114481f, - 0.7623578050522613f, - 0.7622730860302798f, - 0.7621883539469545f, - 0.762103608803738f, - 0.7620188506020819f, - 0.7619340793434387f, - 0.7618492950292608f, - 0.761764497661001f, - 0.7616796872401126f, - 0.7615948637680483f, - 0.7615100272462619f, - 0.7614251776762069f, - 0.7613403150593372f, - 0.7612554393971067f, - 0.7611705506909703f, - 0.7610856489423817f, - 0.7610007341527966f, - 0.7609158063236691f, - 0.7608308654564551f, - 0.7607459115526095f, - 0.7606609446135882f, - 0.7605759646408475f, - 0.7604909716358428f, - 0.7604059656000309f, - 0.7603209465348681f, - 0.7602359144418116f, - 0.7601508693223177f, - 0.7600658111778443f, - 0.7599807400098484f, - 0.759895655819788f, - 0.7598105586091205f, - 0.7597254483793046f, - 0.7596403251317985f, - 0.7595551888680606f, - 0.7594700395895495f, - 0.7593848772977247f, - 0.7592997019940451f, - 0.7592145136799703f, - 0.7591293123569597f, - 0.7590440980264738f, - 0.7589588706899723f, - 0.7588736303489152f, - 0.7587883770047638f, - 0.7587031106589783f, - 0.75861783131302f, - 0.7585325389683503f, - 0.7584472336264303f, - 0.758361915288722f, - 0.758276583956687f, - 0.7581912396317878f, - 0.7581058823154864f, - 0.7580205120092456f, - 0.757935128714528f, - 0.7578497324327969f, - 0.7577643231655151f, - 0.7576789009141464f, - 0.7575934656801547f, - 0.7575080174650033f, - 0.7574225562701571f, - 0.7573370820970795f, - 0.757251594947236f, - 0.7571660948220909f, - 0.7570805817231094f, - 0.7569950556517564f, - 0.7569095166094979f, - 0.7568239645977991f, - 0.7567383996181264f, - 0.7566528216719455f, - 0.7565672307607227f, - 0.7564816268859251f, - 0.7563960100490191f, - 0.756310380251472f, - 0.7562247374947505f, - 0.7561390817803229f, - 0.7560534131096559f, - 0.7559677314842184f, - 0.7558820369054776f, - 0.7557963293749027f, - 0.7557106088939616f, - 0.7556248754641236f, - 0.7555391290868573f, - 0.7554533697636323f, - 0.755367597495918f, - 0.7552818122851837f, - 0.7551960141328998f, - 0.7551102030405361f, - 0.7550243790095632f, - 0.7549385420414514f, - 0.7548526921376718f, - 0.754766829299695f, - 0.7546809535289928f, - 0.7545950648270361f, - 0.7545091631952967f, - 0.754423248635247f, - 0.7543373211483584f, - 0.754251380736104f, - 0.7541654273999555f, - 0.7540794611413866f, - 0.7539934819618695f, - 0.7539074898628781f, - 0.7538214848458852f, - 0.7537354669123651f, - 0.7536494360637912f, - 0.7535633923016378f, - 0.7534773356273795f, - 0.7533912660424903f, - 0.7533051835484457f, - 0.7532190881467199f, - 0.7531329798387888f, - 0.7530468586261273f, - 0.7529607245102117f, - 0.7528745774925171f, - 0.7527884175745203f, - 0.7527022447576971f, - 0.7526160590435246f, - 0.7525298604334789f, - 0.7524436489290374f, - 0.7523574245316774f, - 0.7522711872428761f, - 0.7521849370641114f, - 0.7520986739968608f, - 0.7520123980426029f, - 0.7519261092028157f, - 0.7518398074789774f, - 0.7517534928725675f, - 0.7516671653850643f, - 0.7515808250179475f, - 0.7514944717726961f, - 0.7514081056507902f, - 0.7513217266537091f, - 0.7512353347829336f, - 0.7511489300399432f, - 0.7510625124262191f, - 0.7509760819432415f, - 0.7508896385924919f, - 0.750803182375451f, - 0.7507167132936007f, - 0.7506302313484219f, - 0.7505437365413972f, - 0.7504572288740081f, - 0.7503707083477371f, - 0.7502841749640671f, - 0.75019762872448f, - 0.7501110696304596f, - 0.7500244976834884f, - 0.7499379128850504f, - 0.7498513152366285f, - 0.7497647047397072f, - 0.74967808139577f, - 0.7495914452063016f, - 0.7495047961727861f, - 0.7494181342967086f, - 0.7493314595795536f, - 0.7492447720228065f, - 0.7491580716279529f, - 0.7490713583964779f, - 0.7489846323298678f, - 0.748897893429608f, - 0.7488111416971854f, - 0.748724377134086f, - 0.748637599741797f, - 0.7485508095218046f, - 0.7484640064755966f, - 0.7483771906046599f, - 0.7482903619104824f, - 0.7482035203945514f, - 0.7481166660583556f, - 0.7480297989033825f, - 0.7479429189311211f, - 0.7478560261430599f, - 0.7477691205406874f, - 0.7476822021254934f, - 0.7475952708989666f, - 0.747508326862597f, - 0.747421370017874f, - 0.747334400366288f, - 0.7472474179093286f, - 0.7471604226484866f, - 0.7470734145852529f, - 0.7469863937211177f, - 0.7468993600575728f, - 0.746812313596109f, - 0.746725254338218f, - 0.7466381822853914f, - 0.7465510974391215f, - 0.7464639998009f, - 0.7463768893722197f, - 0.7462897661545728f, - 0.7462026301494524f, - 0.7461154813583518f, - 0.7460283197827637f, - 0.7459411454241822f, - 0.7458539582841004f, - 0.7457667583640128f, - 0.7456795456654131f, - 0.7455923201897959f, - 0.7455050819386556f, - 0.7454178309134875f, - 0.7453305671157857f, - 0.7452432905470464f, - 0.7451560012087645f, - 0.7450686991024357f, - 0.7449813842295563f, - 0.7448940565916219f, - 0.7448067161901294f, - 0.7447193630265747f, - 0.7446319971024552f, - 0.7445446184192673f, - 0.7444572269785088f, - 0.7443698227816768f, - 0.7442824058302688f, - 0.7441949761257831f, - 0.7441075336697173f, - 0.7440200784635702f, - 0.7439326105088397f, - 0.7438451298070252f, - 0.7437576363596251f, - 0.7436701301681392f, - 0.7435826112340662f, - 0.7434950795589063f, - 0.7434075351441588f, - 0.7433199779913243f, - 0.7432324081019025f, - 0.7431448254773945f, - 0.7430572301193004f, - 0.7429696220291213f, - 0.7428820012083589f, - 0.7427943676585137f, - 0.7427067213810881f, - 0.742619062377583f, - 0.7425313906495012f, - 0.7424437061983445f, - 0.7423560090256157f, - 0.7422682991328169f, - 0.7421805765214516f, - 0.7420928411930225f, - 0.742005093149033f, - 0.7419173323909869f, - 0.7418295589203875f, - 0.7417417727387393f, - 0.7416539738475458f, - 0.7415661622483123f, - 0.7414783379425426f, - 0.7413905009317422f, - 0.7413026512174156f, - 0.7412147888010685f, - 0.741126913684206f, - 0.7410390258683345f, - 0.740951125354959f, - 0.7408632121455863f, - 0.7407752862417228f, - 0.7406873476448749f, - 0.7405993963565491f, - 0.7405114323782531f, - 0.7404234557114935f, - 0.7403354663577782f, - 0.7402474643186145f, - 0.7401594495955107f, - 0.7400714221899748f, - 0.7399833821035146f, - 0.7398953293376394f, - 0.7398072638938573f, - 0.7397191857736777f, - 0.7396310949786099f, - 0.7395429915101628f, - 0.7394548753698467f, - 0.7393667465591707f, - 0.7392786050796456f, - 0.739190450932781f, - 0.7391022841200882f, - 0.7390141046430769f, - 0.7389259125032589f, - 0.7388377077021449f, - 0.7387494902412463f, - 0.7386612601220749f, - 0.7385730173461422f, - 0.7384847619149607f, - 0.738396493830042f, - 0.7383082130928991f, - 0.7382199197050442f, - 0.7381316136679907f, - 0.7380432949832512f, - 0.7379549636523394f, - 0.7378666196767684f, - 0.7377782630580525f, - 0.7376898937977051f, - 0.7376015118972407f, - 0.7375131173581739f, - 0.7374247101820188f, - 0.7373362903702909f, - 0.7372478579245044f, - 0.7371594128461755f, - 0.7370709551368189f, - 0.7369824847979508f, - 0.7368940018310867f, - 0.7368055062377432f, - 0.7367169980194361f, - 0.7366284771776827f, - 0.7365399437139992f, - 0.7364513976299025f, - 0.7363628389269105f, - 0.7362742676065397f, - 0.7361856836703086f, - 0.7360970871197344f, - 0.7360084779563358f, - 0.7359198561816305f, - 0.7358312217971374f, - 0.7357425748043751f, - 0.7356539152048627f, - 0.7355652430001188f, - 0.7354765581916634f, - 0.735387860781016f, - 0.7352991507696961f, - 0.7352104281592241f, - 0.7351216929511197f, - 0.7350329451469041f, - 0.7349441847480973f, - 0.7348554117562207f, - 0.7347666261727948f, - 0.7346778279993417f, - 0.734589017237382f, - 0.734500193888438f, - 0.734411357954032f, - 0.7343225094356854f, - 0.7342336483349213f, - 0.7341447746532618f, - 0.7340558883922301f, - 0.7339669895533489f, - 0.7338780781381419f, - 0.7337891541481318f, - 0.7337002175848433f, - 0.7336112684497994f, - 0.7335223067445249f, - 0.7334333324705437f, - 0.7333443456293803f, - 0.73325534622256f, - 0.7331663342516072f, - 0.7330773097180475f, - 0.7329882726234063f, - 0.7328992229692087f, - 0.7328101607569812f, - 0.7327210859882494f, - 0.7326319986645399f, - 0.7325428987873788f, - 0.7324537863582933f, - 0.7323646613788097f, - 0.7322755238504559f, - 0.7321863737747585f, - 0.7320972111532457f, - 0.7320080359874446f, - 0.731918848278884f, - 0.7318296480290912f, - 0.7317404352395955f, - 0.7316512099119248f, - 0.7315619720476085f, - 0.7314727216481753f, - 0.7313834587151549f, - 0.7312941832500762f, - 0.7312048952544692f, - 0.7311155947298642f, - 0.7310262816777907f, - 0.7309369560997797f, - 0.7308476179973611f, - 0.7307582673720663f, - 0.7306689042254256f, - 0.7305795285589711f, - 0.7304901403742334f, - 0.7304007396727448f, - 0.7303113264560365f, - 0.730221900725641f, - 0.7301324624830907f, - 0.7300430117299177f, - 0.7299535484676553f, - 0.7298640726978355f, - 0.7297745844219925f, - 0.7296850836416587f, - 0.7295955703583686f, - 0.7295060445736552f, - 0.729416506289053f, - 0.7293269555060957f, - 0.7292373922263184f, - 0.7291478164512551f, - 0.7290582281824414f, - 0.7289686274214114f, - 0.7288790141697014f, - 0.728789388428846f, - 0.7286997502003816f, - 0.7286100994858439f, - 0.7285204362867687f, - 0.7284307606046929f, - 0.7283410724411524f, - 0.7282513717976848f, - 0.7281616586758265f, - 0.728071933077115f, - 0.7279821950030876f, - 0.7278924444552817f, - 0.7278026814352357f, - 0.7277129059444872f, - 0.727623117984575f, - 0.7275333175570369f, - 0.7274435046634122f, - 0.7273536793052393f, - 0.727263841484058f, - 0.7271739912014069f, - 0.7270841284588261f, - 0.726994253257855f, - 0.7269043656000338f, - 0.7268144654869029f, - 0.7267245529200022f, - 0.726634627900873f, - 0.7265446904310554f, - 0.7264547405120911f, - 0.7263647781455208f, - 0.7262748033328865f, - 0.7261848160757295f, - 0.726094816375592f, - 0.7260048042340158f, - 0.7259147796525437f, - 0.7258247426327177f, - 0.7257346931760807f, - 0.7256446312841762f, - 0.7255545569585466f, - 0.7254644702007361f, - 0.7253743710122875f, - 0.7252842593947454f, - 0.725194135349653f, - 0.7251039988785555f, - 0.7250138499829968f, - 0.7249236886645213f, - 0.7248335149246746f, - 0.7247433287650011f, - 0.7246531301870468f, - 0.7245629191923566f, - 0.7244726957824769f, - 0.7243824599589528f, - 0.7242922117233314f, - 0.7242019510771582f, - 0.7241116780219806f, - 0.7240213925593447f, - 0.7239310946907982f, - 0.7238407844178876f, - 0.7237504617421611f, - 0.7236601266651655f, - 0.7235697791884493f, - 0.7234794193135606f, - 0.7233890470420473f, - 0.7232986623754584f, - 0.723208265315342f, - 0.7231178558632476f, - 0.7230274340207239f, - 0.7229369997893207f, - 0.722846553170587f, - 0.7227560941660732f, - 0.7226656227773288f, - 0.7225751390059041f, - 0.7224846428533499f, - 0.7223941343212162f, - 0.7223036134110545f, - 0.7222130801244152f, - 0.7221225344628502f, - 0.7220319764279104f, - 0.7219414060211481f, - 0.7218508232441144f, - 0.7217602280983623f, - 0.7216696205854433f, - 0.7215790007069106f, - 0.7214883684643164f, - 0.7213977238592143f, - 0.7213070668931567f, - 0.7212163975676976f, - 0.7211257158843902f, - 0.7210350218447888f, - 0.7209443154504467f, - 0.7208535967029189f, - 0.7207628656037592f, - 0.7206721221545228f, - 0.7205813663567642f, - 0.7204905982120383f, - 0.7203998177219006f, - 0.720309024887907f, - 0.7202182197116126f, - 0.7201274021945738f, - 0.7200365723383463f, - 0.7199457301444869f, - 0.7198548756145516f, - 0.7197640087500978f, - 0.7196731295526819f, - 0.7195822380238617f, - 0.7194913341651938f, - 0.7194004179782367f, - 0.7193094894645474f, - 0.7192185486256845f, - 0.7191275954632063f, - 0.7190366299786706f, - 0.7189456521736369f, - 0.7188546620496633f, - 0.7187636596083097f, - 0.7186726448511346f, - 0.7185816177796982f, - 0.7184905783955596f, - 0.7183995267002793f, - 0.7183084626954169f, - 0.7182173863825335f, - 0.7181262977631888f, - 0.718035196838944f, - 0.7179440836113604f, - 0.7178529580819987f, - 0.7177618202524206f, - 0.7176706701241875f, - 0.7175795076988616f, - 0.7174883329780043f, - 0.7173971459631786f, - 0.7173059466559464f, - 0.7172147350578708f, - 0.7171235111705142f, - 0.7170322749954403f, - 0.7169410265342121f, - 0.7168497657883928f, - 0.7167584927595466f, - 0.7166672074492371f, - 0.7165759098590289f, - 0.7164845999904857f, - 0.7163932778451728f, - 0.7163019434246544f, - 0.7162105967304959f, - 0.7161192377642621f, - 0.7160278665275188f, - 0.7159364830218313f, - 0.7158450872487655f, - 0.7157536792098879f, - 0.715662258906764f, - 0.7155708263409609f, - 0.7154793815140448f, - 0.7153879244275831f, - 0.7152964550831422f, - 0.7152049734822902f, - 0.7151134796265938f, - 0.7150219735176214f, - 0.7149304551569404f, - 0.7148389245461193f, - 0.7147473816867266f, - 0.7146558265803302f, - 0.7145642592284996f, - 0.7144726796328033f, - 0.7143810877948108f, - 0.7142894837160912f, - 0.7141978673982146f, - 0.71410623884275f, - 0.7140145980512683f, - 0.7139229450253392f, - 0.7138312797665334f, - 0.7137396022764213f, - 0.7136479125565739f, - 0.7135562106085626f, - 0.7134644964339582f, - 0.7133727700343326f, - 0.7132810314112573f, - 0.713189280566304f, - 0.7130975175010453f, - 0.713005742217053f, - 0.7129139547159002f, - 0.7128221549991592f, - 0.7127303430684034f, - 0.7126385189252055f, - 0.7125466825711393f, - 0.7124548340077779f, - 0.7123629732366956f, - 0.7122711002594662f, - 0.7121792150776639f, - 0.712087317692863f, - 0.7119954081066386f, - 0.711903486320565f, - 0.7118115523362177f, - 0.7117196061551714f, - 0.7116276477790023f, - 0.7115356772092855f, - 0.7114436944475969f, - 0.7113516994955132f, - 0.7112596923546101f, - 0.7111676730264646f, - 0.7110756415126527f, - 0.7109835978147522f, - 0.7108915419343395f, - 0.7107994738729926f, - 0.7107073936322884f, - 0.7106153012138055f, - 0.7105231966191209f, - 0.7104310798498132f, - 0.7103389509074614f, - 0.7102468097936432f, - 0.7101546565099381f, - 0.7100624910579245f, - 0.7099703134391823f, - 0.7098781236552902f, - 0.7097859217078286f, - 0.7096937075983767f, - 0.7096014813285151f, - 0.7095092428998235f, - 0.7094169923138831f, - 0.7093247295722738f, - 0.7092324546765773f, - 0.7091401676283738f, - 0.7090478684292456f, - 0.7089555570807736f, - 0.7088632335845395f, - 0.7087708979421257f, - 0.7086785501551136f, - 0.7085861902250864f, - 0.7084938181536259f, - 0.7084014339423157f, - 0.7083090375927378f, - 0.708216629106476f, - 0.7081242084851139f, - 0.7080317757302345f, - 0.7079393308434222f, - 0.7078468738262603f, - 0.7077544046803339f, - 0.7076619234072267f, - 0.7075694300085238f, - 0.7074769244858096f, - 0.7073844068406698f, - 0.707291877074689f, - 0.7071993351894532f, - 0.7071067811865476f, - 0.7070142150675583f, - 0.7069216368340717f, - 0.7068290464876736f, - 0.7067364440299511f, - 0.7066438294624902f, - 0.7065512027868786f, - 0.7064585640047025f, - 0.7063659131175501f, - 0.7062732501270085f, - 0.7061805750346657f, - 0.7060878878421093f, - 0.705995188550928f, - 0.7059024771627096f, - 0.7058097536790429f, - 0.7057170181015171f, - 0.7056242704317205f, - 0.705531510671243f, - 0.7054387388216734f, - 0.7053459548846018f, - 0.7052531588616175f, - 0.7051603507543114f, - 0.705067530564273f, - 0.7049746982930927f, - 0.7048818539423616f, - 0.7047889975136702f, - 0.7046961290086099f, - 0.7046032484287716f, - 0.7045103557757473f, - 0.7044174510511281f, - 0.7043245342565064f, - 0.7042316053934738f, - 0.7041386644636233f, - 0.7040457114685466f, - 0.7039527464098372f, - 0.7038597692890873f, - 0.7037667801078908f, - 0.7036737788678403f, - 0.7035807655705297f, - 0.7034877402175531f, - 0.7033947028105039f, - 0.7033016533509767f, - 0.7032085918405654f, - 0.7031155182808652f, - 0.7030224326734701f, - 0.702929335019976f, - 0.7028362253219772f, - 0.7027431035810701f, - 0.7026499697988492f, - 0.702556823976911f, - 0.7024636661168517f, - 0.702370496220267f, - 0.702277314288754f, - 0.7021841203239085f, - 0.7020909143273282f, - 0.7019976963006094f, - 0.7019044662453501f, - 0.701811224163147f, - 0.7017179700555985f, - 0.7016247039243019f, - 0.7015314257708558f, - 0.701438135596858f, - 0.7013448334039075f, - 0.7012515191936025f, - 0.7011581929675424f, - 0.7010648547273258f, - 0.7009715044745527f, - 0.7008781422108219f, - 0.7007847679377338f, - 0.700691381656888f, - 0.7005979833698844f, - 0.7005045730783239f, - 0.7004111507838066f, - 0.7003177164879333f, - 0.7002242701923054f, - 0.7001308118985237f, - 0.7000373416081898f, - 0.6999438593229049f, - 0.6998503650442714f, - 0.6997568587738907f, - 0.6996633405133657f, - 0.6995698102642979f, - 0.6994762680282907f, - 0.6993827138069464f, - 0.6992891476018684f, - 0.6991955694146597f, - 0.6991019792469236f, - 0.6990083771002644f, - 0.6989147629762851f, - 0.6988211368765905f, - 0.6987274988027843f, - 0.6986338487564714f, - 0.6985401867392559f, - 0.6984465127527434f, - 0.6983528267985382f, - 0.6982591288782464f, - 0.6981654189934726f, - 0.6980716971458231f, - 0.697977963336904f, - 0.6978842175683206f, - 0.6977904598416802f, - 0.6976966901585883f, - 0.6976029085206524f, - 0.697509114929479f, - 0.6974153093866755f, - 0.6973214918938488f, - 0.6972276624526071f, - 0.6971338210645575f, - 0.6970399677313084f, - 0.6969461024544679f, - 0.6968522252356437f, - 0.6967583360764453f, - 0.6966644349784809f, - 0.6965705219433598f, - 0.6964765969726906f, - 0.6963826600680835f, - 0.6962887112311472f, - 0.6961947504634924f, - 0.6961007777667283f, - 0.6960067931424657f, - 0.6959127965923144f, - 0.6958187881178854f, - 0.6957247677207897f, - 0.6956307354026379f, - 0.6955366911650416f, - 0.6954426350096117f, - 0.6953485669379604f, - 0.6952544869516989f, - 0.69516039505244f, - 0.6950662912417952f, - 0.6949721755213776f, - 0.6948780478927993f, - 0.6947839083576736f, - 0.6946897569176129f, - 0.6945955935742311f, - 0.6945014183291417f, - 0.6944072311839578f, - 0.6943130321402939f, - 0.6942188211997635f, - 0.6941245983639814f, - 0.6940303636345615f, - 0.6939361170131193f, - 0.6938418585012687f, - 0.6937475881006258f, - 0.6936533058128049f, - 0.6935590116394225f, - 0.6934647055820933f, - 0.6933703876424339f, - 0.6932760578220604f, - 0.693181716122589f, - 0.6930873625456359f, - 0.6929929970928183f, - 0.6928986197657526f, - 0.6928042305660567f, - 0.6927098294953471f, - 0.692615416555242f, - 0.6925209917473585f, - 0.6924265550733153f, - 0.6923321065347298f, - 0.692237646133221f, - 0.6921431738704068f, - 0.6920486897479067f, - 0.6919541937673389f, - 0.6918596859303232f, - 0.6917651662384785f, - 0.6916706346934248f, - 0.6915760912967814f, - 0.6914815360501687f, - 0.6913869689552065f, - 0.6912923900135156f, - 0.6911977992267161f, - 0.691103196596429f, - 0.6910085821242757f, - 0.6909139558118766f, - 0.690819317660854f, - 0.6907246676728286f, - 0.690630005849423f, - 0.6905353321922585f, - 0.690440646702958f, - 0.6903459493831432f, - 0.6902512402344373f, - 0.6901565192584627f, - 0.6900617864568425f, - 0.6899670418312003f, - 0.6898722853831589f, - 0.6897775171143428f, - 0.6896827370263747f, - 0.6895879451208797f, - 0.6894931413994813f, - 0.6893983258638045f, - 0.6893034985154731f, - 0.689208659356113f, - 0.6891138083873484f, - 0.6890189456108051f, - 0.688924071028108f, - 0.6888291846408835f, - 0.6887342864507565f, - 0.688639376459354f, - 0.6885444546683019f, - 0.6884495210792262f, - 0.6883545756937542f, - 0.6882596185135124f, - 0.6881646495401281f, - 0.6880696687752281f, - 0.6879746762204406f, - 0.6878796718773926f, - 0.6877846557477123f, - 0.687689627833028f, - 0.6875945881349674f, - 0.6874995366551596f, - 0.6874044733952327f, - 0.6873093983568161f, - 0.6872143115415383f, - 0.6871192129510294f, - 0.687024102586918f, - 0.6869289804508345f, - 0.6868338465444083f, - 0.6867387008692699f, - 0.6866435434270491f, - 0.6865483742193768f, - 0.6864531932478838f, - 0.6863580005142005f, - 0.6862627960199585f, - 0.6861675797667887f, - 0.6860723517563231f, - 0.6859771119901927f, - 0.6858818604700302f, - 0.685786597197467f, - 0.6856913221741361f, - 0.6855960354016692f, - 0.6855007368816994f, - 0.6854054266158602f, - 0.6853101046057838f, - 0.6852147708531041f, - 0.6851194253594542f, - 0.6850240681264684f, - 0.6849286991557799f, - 0.6848333184490235f, - 0.6847379260078332f, - 0.6846425218338432f, - 0.6845471059286888f, - 0.6844516782940044f, - 0.6843562389314258f, - 0.6842607878425876f, - 0.684165325029126f, - 0.684069850492676f, - 0.6839743642348742f, - 0.6838788662573563f, - 0.6837833565617589f, - 0.6836878351497182f, - 0.6835923020228716f, - 0.6834967571828551f, - 0.6834012006313066f, - 0.683305632369863f, - 0.6832100524001622f, - 0.6831144607238414f, - 0.6830188573425389f, - 0.6829232422578931f, - 0.6828276154715418f, - 0.682731976985124f, - 0.682636326800278f, - 0.6825406649186432f, - 0.6824449913418582f, - 0.682349306071563f, - 0.6822536091093965f, - 0.6821579004569989f, - 0.6820621801160097f, - 0.6819664480880694f, - 0.6818707043748186f, - 0.681774948977897f, - 0.6816791818989463f, - 0.6815834031396066f, - 0.6814876127015198f, - 0.6813918105863265f, - 0.6812959967956689f, - 0.6812001713311882f, - 0.6811043341945269f, - 0.6810084853873265f, - 0.6809126249112301f, - 0.6808167527678793f, - 0.6807208689589179f, - 0.6806249734859879f, - 0.6805290663507332f, - 0.6804331475547964f, - 0.680337217099822f, - 0.6802412749874527f, - 0.6801453212193332f, - 0.6800493557971075f, - 0.6799533787224193f, - 0.6798573899969141f, - 0.6797613896222359f, - 0.6796653776000299f, - 0.6795693539319416f, - 0.6794733186196157f, - 0.6793772716646983f, - 0.6792812130688347f, - 0.6791851428336713f, - 0.6790890609608535f, - 0.6789929674520286f, - 0.6788968623088423f, - 0.678800745532942f, - 0.678704617125974f, - 0.6786084770895859f, - 0.6785123254254247f, - 0.6784161621351381f, - 0.6783199872203741f, - 0.6782238006827802f, - 0.678127602524005f, - 0.6780313927456961f, - 0.6779351713495028f, - 0.6778389383370732f, - 0.6777426937100569f, - 0.6776464374701022f, - 0.6775501696188593f, - 0.677453890157977f, - 0.6773575990891052f, - 0.6772612964138942f, - 0.6771649821339937f, - 0.6770686562510544f, - 0.6769723187667263f, - 0.6768759696826607f, - 0.6767796090005079f, - 0.6766832367219198f, - 0.6765868528485468f, - 0.6764904573820412f, - 0.6763940503240541f, - 0.6762976316762379f, - 0.6762012014402446f, - 0.6761047596177261f, - 0.6760083062103355f, - 0.6759118412197247f, - 0.6758153646475477f, - 0.6757188764954565f, - 0.6756223767651053f, - 0.6755258654581469f, - 0.6754293425762355f, - 0.6753328081210246f, - 0.6752362620941688f, - 0.6751397044973216f, - 0.675043135332138f, - 0.6749465546002731f, - 0.6748499623033809f, - 0.6747533584431173f, - 0.6746567430211369f, - 0.6745601160390957f, - 0.6744634774986489f, - 0.6743668274014529f, - 0.6742701657491632f, - 0.6741734925434367f, - 0.6740768077859292f, - 0.6739801114782981f, - 0.6738834036221995f, - 0.6737866842192908f, - 0.6736899532712296f, - 0.6735932107796728f, - 0.6734964567462787f, - 0.6733996911727043f, - 0.6733029140606085f, - 0.6732061254116488f, - 0.6731093252274845f, - 0.6730125135097733f, - 0.6729156902601748f, - 0.6728188554803475f, - 0.6727220091719508f, - 0.6726251513366446f, - 0.6725282819760878f, - 0.672431401091941f, - 0.6723345086858638f, - 0.672237604759516f, - 0.6721406893145587f, - 0.6720437623526522f, - 0.6719468238754576f, - 0.6718498738846352f, - 0.6717529123818473f, - 0.6716559393687547f, - 0.6715589548470186f, - 0.6714619588183013f, - 0.671364951284265f, - 0.6712679322465713f, - 0.6711709017068834f, - 0.6710738596668631f, - 0.6709768061281737f, - 0.6708797410924777f, - 0.670782664561439f, - 0.6706855765367201f, - 0.6705884770199855f, - 0.670491366012898f, - 0.6703942435171226f, - 0.6702971095343226f, - 0.6701999640661627f, - 0.6701028071143077f, - 0.670005638680422f, - 0.6699084587661709f, - 0.6698112673732189f, - 0.6697140645032323f, - 0.6696168501578758f, - 0.6695196243388157f, - 0.6694223870477175f, - 0.6693251382862478f, - 0.6692278780560724f, - 0.669130606358858f, - 0.669033323196272f, - 0.6689360285699801f, - 0.6688387224816507f, - 0.66874140493295f, - 0.6686440759255463f, - 0.6685467354611068f, - 0.6684493835412998f, - 0.6683520201677929f, - 0.6682546453422551f, - 0.6681572590663541f, - 0.6680598613417593f, - 0.6679624521701389f, - 0.6678650315531628f, - 0.6677675994924994f, - 0.6676701559898189f, - 0.6675727010467907f, - 0.6674752346650843f, - 0.6673777568463704f, - 0.6672802675923185f, - 0.6671827669046f, - 0.6670852547848846f, - 0.6669877312348439f, - 0.6668901962561483f, - 0.6667926498504694f, - 0.6666950920194789f, - 0.6665975227648477f, - 0.6664999420882485f, - 0.6664023499913524f, - 0.6663047464758325f, - 0.6662071315433604f, - 0.6661095051956094f, - 0.6660118674342517f, - 0.6659142182609609f, - 0.6658165576774094f, - 0.6657188856852716f, - 0.6656212022862201f, - 0.6655235074819292f, - 0.6654258012740731f, - 0.6653280836643254f, - 0.665230354654361f, - 0.6651326142458538f, - 0.6650348624404793f, - 0.6649370992399118f, - 0.6648393246458271f, - 0.6647415386598998f, - 0.6646437412838062f, - 0.6645459325192213f, - 0.6644481123678214f, - 0.6643502808312829f, - 0.6642524379112815f, - 0.6641545836094944f, - 0.6640567179275976f, - 0.6639588408672686f, - 0.6638609524301841f, - 0.6637630526180216f, - 0.6636651414324587f, - 0.6635672188751724f, - 0.6634692849478416f, - 0.6633713396521435f, - 0.6632733829897569f, - 0.6631754149623598f, - 0.6630774355716315f, - 0.6629794448192501f, - 0.6628814427068954f, - 0.6627834292362459f, - 0.6626854044089817f, - 0.6625873682267819f, - 0.6624893206913268f, - 0.6623912618042959f, - 0.6622931915673699f, - 0.6621951099822287f, - 0.6620970170505532f, - 0.6619989127740246f, - 0.661900797154323f, - 0.6618026701931305f, - 0.6617045318921277f, - 0.6616063822529968f, - 0.661508221277419f, - 0.6614100489670769f, - 0.6613118653236518f, - 0.661213670348827f, - 0.6611154640442843f, - 0.661017246411707f, - 0.6609190174527775f, - 0.6608207771691792f, - 0.6607225255625956f, - 0.6606242626347099f, - 0.6605259883872061f, - 0.6604277028217675f, - 0.6603294059400793f, - 0.6602310977438245f, - 0.6601327782346886f, - 0.6600344474143557f, - 0.6599361052845111f, - 0.6598377518468392f, - 0.6597393871030262f, - 0.6596410110547566f, - 0.6595426237037169f, - 0.6594442250515921f, - 0.659345815100069f, - 0.6592473938508332f, - 0.6591489613055717f, - 0.6590505174659709f, - 0.6589520623337171f, - 0.6588535959104981f, - 0.6587551181980004f, - 0.658656629197912f, - 0.65855812891192f, - 0.6584596173417123f, - 0.6583610944889773f, - 0.6582625603554024f, - 0.6581640149426768f, - 0.6580654582524883f, - 0.6579668902865262f, - 0.6578683110464789f, - 0.6577697205340362f, - 0.6576711187508866f, - 0.6575725056987204f, - 0.6574738813792267f, - 0.657375245794096f, - 0.6572765989450177f, - 0.6571779408336824f, - 0.6570792714617811f, - 0.6569805908310036f, - 0.6568818989430415f, - 0.6567831957995851f, - 0.6566844814023265f, - 0.6565857557529564f, - 0.6564870188531671f, - 0.6563882707046497f, - 0.656289511309097f, - 0.6561907406682005f, - 0.6560919587836528f, - 0.6559931656571472f, - 0.6558943612903754f, - 0.6557955456850313f, - 0.6556967188428073f, - 0.6555978807653977f, - 0.6554990314544951f, - 0.6554001709117939f, - 0.6553012991389876f, - 0.655202416137771f, - 0.6551035219098379f, - 0.6550046164568826f, - 0.6549056997806005f, - 0.6548067718826859f, - 0.6547078327648344f, - 0.6546088824287408f, - 0.6545099208761012f, - 0.6544109481086104f, - 0.6543119641279653f, - 0.6542129689358612f, - 0.6541139625339949f, - 0.6540149449240622f, - 0.6539159161077603f, - 0.6538168760867857f, - 0.6537178248628356f, - 0.6536187624376074f, - 0.653519688812798f, - 0.6534206039901056f, - 0.6533215079712273f, - 0.6532224007578619f, - 0.6531232823517068f, - 0.6530241527544609f, - 0.6529250119678224f, - 0.6528258599934904f, - 0.6527266968331634f, - 0.6526275224885412f, - 0.6525283369613223f, - 0.6524291402532066f, - 0.6523299323658942f, - 0.6522307133010844f, - 0.6521314830604777f, - 0.652032241645774f, - 0.6519329890586744f, - 0.6518337253008787f, - 0.6517344503740886f, - 0.6516351642800043f, - 0.6515358670203281f, - 0.6514365585967603f, - 0.6513372390110032f, - 0.6512379082647587f, - 0.6511385663597282f, - 0.6510392132976147f, - 0.6509398490801201f, - 0.6508404737089468f, - 0.6507410871857982f, - 0.6506416895123764f, - 0.6505422806903854f, - 0.6504428607215279f, - 0.650343429607508f, - 0.6502439873500292f, - 0.650144533950795f, - 0.6500450694115097f, - 0.6499455937338782f, - 0.6498461069196042f, - 0.649746608970393f, - 0.649647099887949f, - 0.6495475796739777f, - 0.6494480483301838f, - 0.6493485058582733f, - 0.6492489522599513f, - 0.6491493875369242f, - 0.6490498116908975f, - 0.6489502247235774f, - 0.648850626636671f, - 0.6487510174318841f, - 0.6486513971109241f, - 0.6485517656754973f, - 0.6484521231273116f, - 0.6483524694680736f, - 0.6482528046994914f, - 0.6481531288232724f, - 0.6480534418411248f, - 0.6479537437547563f, - 0.6478540345658759f, - 0.6477543142761911f, - 0.6476545828874112f, - 0.6475548404012453f, - 0.6474550868194019f, - 0.6473553221435908f, - 0.6472555463755207f, - 0.6471557595169022f, - 0.6470559615694442f, - 0.6469561525348574f, - 0.6468563324148514f, - 0.6467565012111373f, - 0.6466566589254248f, - 0.6465568055594256f, - 0.6464569411148499f, - 0.6463570655934093f, - 0.6462571789968152f, - 0.6461572813267785f, - 0.6460573725850117f, - 0.6459574527732261f, - 0.6458575218931344f, - 0.6457575799464481f, - 0.6456576269348805f, - 0.6455576628601436f, - 0.6454576877239508f, - 0.6453577015280147f, - 0.6452577042740486f, - 0.6451576959637665f, - 0.6450576765988812f, - 0.6449576461811072f, - 0.6448576047121579f, - 0.6447575521937481f, - 0.6446574886275914f, - 0.6445574140154031f, - 0.6444573283588975f, - 0.6443572316597899f, - 0.6442571239197948f, - 0.6441570051406283f, - 0.6440568753240054f, - 0.6439567344716417f, - 0.6438565825852538f, - 0.643756419666557f, - 0.6436562457172681f, - 0.643556060739103f, - 0.643455864733779f, - 0.6433556577030123f, - 0.6432554396485206f, - 0.6431552105720203f, - 0.6430549704752295f, - 0.6429547193598654f, - 0.6428544572276457f, - 0.6427541840802888f, - 0.6426538999195125f, - 0.6425536047470355f, - 0.6424532985645757f, - 0.6423529813738525f, - 0.6422526531765845f, - 0.6421523139744906f, - 0.6420519637692905f, - 0.6419516025627031f, - 0.6418512303564489f, - 0.6417508471522468f, - 0.6416504529518177f, - 0.6415500477568811f, - 0.6414496315691581f, - 0.6413492043903686f, - 0.6412487662222341f, - 0.6411483170664749f, - 0.6410478569248128f, - 0.6409473857989686f, - 0.6408469036906643f, - 0.6407464106016212f, - 0.6406459065335618f, - 0.6405453914882075f, - 0.640444865467281f, - 0.6403443284725051f, - 0.6402437805056017f, - 0.6401432215682945f, - 0.6400426516623059f, - 0.6399420707893595f, - 0.6398414789511784f, - 0.6397408761494867f, - 0.6396402623860077f, - 0.6395396376624658f, - 0.6394390019805848f, - 0.6393383553420895f, - 0.6392376977487039f, - 0.639137029202153f, - 0.6390363497041621f, - 0.6389356592564557f, - 0.6388349578607597f, - 0.638734245518799f, - 0.6386335222322999f, - 0.6385327880029875f, - 0.6384320428325887f, - 0.638331286722829f, - 0.6382305196754354f, - 0.638129741692134f, - 0.6380289527746522f, - 0.6379281529247164f, - 0.6378273421440543f, - 0.6377265204343927f, - 0.6376256877974598f, - 0.6375248442349827f, - 0.6374239897486899f, - 0.6373231243403092f, - 0.6372222480115687f, - 0.6371213607641975f, - 0.6370204625999234f, - 0.6369195535204762f, - 0.6368186335275843f, - 0.636717702622977f, - 0.6366167608083843f, - 0.6365158080855351f, - 0.6364148444561597f, - 0.6363138699219876f, - 0.6362128844847497f, - 0.6361118881461754f, - 0.6360108809079961f, - 0.6359098627719418f, - 0.6358088337397443f, - 0.6357077938131338f, - 0.635606742993842f, - 0.6355056812836006f, - 0.6354046086841408f, - 0.6353035251971951f, - 0.6352024308244947f, - 0.6351013255677727f, - 0.6350002094287606f, - 0.6348990824091918f, - 0.6347979445107985f, - 0.6346967957353142f, - 0.6345956360844714f, - 0.6344944655600042f, - 0.6343932841636455f, - 0.6342920918971292f, - 0.6341908887621895f, - 0.6340896747605601f, - 0.6339884498939756f, - 0.63388721416417f, - 0.6337859675728786f, - 0.6336847101218356f, - 0.6335834418127766f, - 0.6334821626474361f, - 0.6333808726275503f, - 0.6332795717548542f, - 0.6331782600310835f, - 0.6330769374579747f, - 0.6329756040372633f, - 0.6328742597706862f, - 0.6327729046599794f, - 0.6326715387068801f, - 0.6325701619131245f, - 0.6324687742804506f, - 0.6323673758105947f, - 0.6322659665052949f, - 0.6321645463662883f, - 0.6320631153953133f, - 0.6319616735941073f, - 0.6318602209644087f, - 0.6317587575079563f, - 0.631657283226488f, - 0.631555798121743f, - 0.6314543021954597f, - 0.6313527954493778f, - 0.6312512778852362f, - 0.6311497495047746f, - 0.6310482103097323f, - 0.6309466603018499f, - 0.6308450994828664f, - 0.6307435278545229f, - 0.6306419454185592f, - 0.6305403521767161f, - 0.6304387481307347f, - 0.6303371332823554f, - 0.6302355076333199f, - 0.630133871185369f, - 0.6300322239402447f, - 0.6299305658996882f, - 0.629828897065442f, - 0.6297272174392473f, - 0.6296255270228472f, - 0.6295238258179836f, - 0.6294221138263993f, - 0.6293203910498374f, - 0.6292186574900407f, - 0.6291169131487518f, - 0.629015158027715f, - 0.6289133921286731f, - 0.6288116154533704f, - 0.6287098280035502f, - 0.6286080297809574f, - 0.6285062207873354f, - 0.6284044010244295f, - 0.628302570493984f, - 0.6282007291977432f, - 0.6280988771374527f, - 0.627997014314858f, - 0.6278951407317037f, - 0.6277932563897363f, - 0.6276913612907006f, - 0.6275894554363433f, - 0.6274875388284099f, - 0.6273856114686475f, - 0.6272836733588016f, - 0.62718172450062f, - 0.6270797648958486f, - 0.6269777945462347f, - 0.6268758134535262f, - 0.6267738216194695f, - 0.626671819045813f, - 0.626569805734304f, - 0.6264677816866909f, - 0.6263657469047214f, - 0.6262637013901442f, - 0.6261616451447074f, - 0.6260595781701604f, - 0.6259575004682513f, - 0.6258554120407298f, - 0.6257533128893445f, - 0.6256512030158454f, - 0.6255490824219823f, - 0.6254469511095042f, - 0.625344809080162f, - 0.6252426563357051f, - 0.6251404928778844f, - 0.6250383187084501f, - 0.6249361338291533f, - 0.6248339382417444f, - 0.624731731947975f, - 0.624629514949596f, - 0.6245272872483592f, - 0.6244250488460157f, - 0.6243227997443181f, - 0.624220539945018f, - 0.6241182694498673f, - 0.6240159882606189f, - 0.6239136963790247f, - 0.6238113938068384f, - 0.623709080545812f, - 0.6236067565976993f, - 0.623504421964253f, - 0.6234020766472272f, - 0.6232997206483749f, - 0.6231973539694503f, - 0.6230949766122077f, - 0.6229925885784007f, - 0.6228901898697844f, - 0.6227877804881126f, - 0.6226853604351407f, - 0.6225829297126231f, - 0.6224804883223155f, - 0.6223780362659725f, - 0.6222755735453505f, - 0.6221731001622043f, - 0.62207061611829f, - 0.6219681214153642f, - 0.6218656160551822f, - 0.6217631000395013f, - 0.6216605733700773f, - 0.6215580360486677f, - 0.6214554880770287f, - 0.6213529294569182f, - 0.6212503601900927f, - 0.6211477802783105f, - 0.6210451897233286f, - 0.6209425885269054f, - 0.6208399766907984f, - 0.6207373542167661f, - 0.6206347211065673f, - 0.6205320773619599f, - 0.6204294229847033f, - 0.6203267579765559f, - 0.6202240823392773f, - 0.6201213960746267f, - 0.6200186991843631f, - 0.619915991670247f, - 0.6198132735340376f, - 0.6197105447774954f, - 0.6196078054023801f, - 0.6195050554104529f, - 0.6194022948034735f, - 0.6192995235832035f, - 0.6191967417514032f, - 0.6190939493098342f, - 0.6189911462602574f, - 0.6188883326044349f, - 0.6187855083441276f, - 0.6186826734810982f, - 0.6185798280171079f, - 0.6184769719539198f, - 0.6183741052932955f, - 0.618271228036998f, - 0.6181683401867902f, - 0.6180654417444348f, - 0.6179625327116952f, - 0.6178596130903343f, - 0.6177566828821162f, - 0.6176537420888039f, - 0.6175507907121619f, - 0.6174478287539535f, - 0.6173448562159439f, - 0.6172418730998965f, - 0.6171388794075767f, - 0.6170358751407486f, - 0.6169328603011776f, - 0.6168298348906289f, - 0.6167267989108673f, - 0.6166237523636591f, - 0.616520695250769f, - 0.6164176275739638f, - 0.6163145493350086f, - 0.6162114605356706f, - 0.6161083611777152f, - 0.61600525126291f, - 0.6159021307930207f, - 0.6157989997698152f, - 0.6156958581950599f, - 0.6155927060705227f, - 0.6154895433979706f, - 0.6153863701791716f, - 0.6152831864158935f, - 0.6151799921099038f, - 0.6150767872629717f, - 0.6149735718768644f, - 0.6148703459533515f, - 0.6147671094942011f, - 0.6146638625011827f, - 0.6145606049760647f, - 0.6144573369206167f, - 0.6143540583366086f, - 0.6142507692258093f, - 0.6141474695899896f, - 0.6140441594309183f, - 0.6139408387503666f, - 0.6138375075501044f, - 0.6137341658319024f, - 0.613630813597531f, - 0.6135274508487618f, - 0.6134240775873652f, - 0.6133206938151126f, - 0.613217299533776f, - 0.6131138947451263f, - 0.613010479450936f, - 0.6129070536529764f, - 0.6128036173530204f, - 0.6127001705528397f, - 0.6125967132542073f, - 0.6124932454588954f, - 0.6123897671686775f, - 0.6122862783853262f, - 0.6121827791106151f, - 0.6120792693463173f, - 0.6119757490942065f, - 0.611872218356057f, - 0.6117686771336418f, - 0.6116651254287361f, - 0.6115615632431133f, - 0.6114579905785488f, - 0.6113544074368163f, - 0.6112508138196917f, - 0.6111472097289491f, - 0.6110435951663645f, - 0.610939970133713f, - 0.6108363346327699f, - 0.6107326886653115f, - 0.6106290322331132f, - 0.6105253653379517f, - 0.6104216879816026f, - 0.6103180001658433f, - 0.6102143018924494f, - 0.6101105931631987f, - 0.6100068739798675f, - 0.6099031443442336f, - 0.6097994042580739f, - 0.6096956537231664f, - 0.6095918927412882f, - 0.6094881213142177f, - 0.6093843394437333f, - 0.6092805471316124f, - 0.6091767443796343f, - 0.6090729311895768f, - 0.6089691075632198f, - 0.6088652735023411f, - 0.6087614290087209f, - 0.6086575740841376f, - 0.6085537087303716f, - 0.6084498329492019f, - 0.608345946742409f, - 0.6082420501117723f, - 0.6081381430590724f, - 0.6080342255860901f, - 0.6079302976946053f, - 0.6078263593863994f, - 0.6077224106632526f, - 0.6076184515269469f, - 0.6075144819792629f, - 0.6074105020219827f, - 0.6073065116568872f, - 0.6072025108857592f, - 0.6070984997103797f, - 0.6069944781325315f, - 0.6068904461539972f, - 0.6067864037765592f, - 0.6066823510019996f, - 0.6065782878321023f, - 0.6064742142686494f, - 0.6063701303134252f, - 0.6062660359682123f, - 0.6061619312347949f, - 0.6060578161149566f, - 0.605953690610481f, - 0.6058495547231529f, - 0.6057454084547561f, - 0.6056412518070754f, - 0.6055370847818958f, - 0.6054329073810014f, - 0.6053287196061782f, - 0.6052245214592105f, - 0.6051203129418844f, - 0.605016094055985f, - 0.6049118648032985f, - 0.6048076251856104f, - 0.6047033752047073f, - 0.6045991148623749f, - 0.6044948441604001f, - 0.6043905631005697f, - 0.60428627168467f, - 0.6041819699144886f, - 0.604077657791812f, - 0.6039733353184283f, - 0.6038690024961244f, - 0.6037646593266885f, - 0.603660305811908f, - 0.6035559419535715f, - 0.6034515677534669f, - 0.6033471832133828f, - 0.6032427883351075f, - 0.6031383831204299f, - 0.6030339675711395f, - 0.6029295416890246f, - 0.6028251054758752f, - 0.6027206589334801f, - 0.6026162020636298f, - 0.6025117348681133f, - 0.6024072573487212f, - 0.6023027695072434f, - 0.6021982713454705f, - 0.6020937628651927f, - 0.6019892440682012f, - 0.6018847149562867f, - 0.6017801755312399f, - 0.6016756257948526f, - 0.6015710657489157f, - 0.6014664953952215f, - 0.601361914735561f, - 0.6012573237717269f, - 0.6011527225055107f, - 0.6010481109387052f, - 0.6009434890731025f, - 0.6008388569104958f, - 0.6007342144526773f, - 0.6006295617014402f, - 0.6005248986585783f, - 0.600420225325884f, - 0.6003155417051519f, - 0.6002108477981747f, - 0.6001061436067472f, - 0.6000014291326626f, - 0.599896704377716f, - 0.5997919693437012f, - 0.5996872240324133f, - 0.5995824684456463f, - 0.599477702585196f, - 0.5993729264528573f, - 0.5992681400504253f, - 0.5991633433796959f, - 0.5990585364424641f, - 0.5989537192405265f, - 0.5988488917756783f, - 0.5987440540497166f, - 0.598639206064437f, - 0.5985343478216365f, - 0.5984294793231114f, - 0.5983246005706592f, - 0.5982197115660762f, - 0.5981148123111601f, - 0.5980099028077086f, - 0.5979049830575187f, - 0.5978000530623887f, - 0.597695112824116f, - 0.5975901623444994f, - 0.5974852016253367f, - 0.5973802306684263f, - 0.5972752494755672f, - 0.5971702580485578f, - 0.5970652563891977f, - 0.5969602444992854f, - 0.596855222380621f, - 0.5967501900350032f, - 0.5966451474642325f, - 0.5965400946701079f, - 0.5964350316544305f, - 0.5963299584189995f, - 0.596224874965616f, - 0.5961197812960802f, - 0.5960146774121933f, - 0.5959095633157555f, - 0.5958044390085687f, - 0.5956993044924335f, - 0.5955941597691515f, - 0.595489004840525f, - 0.5953838397083548f, - 0.5952786643744439f, - 0.5951734788405935f, - 0.5950682831086065f, - 0.5949630771802851f, - 0.5948578610574323f, - 0.5947526347418505f, - 0.5946473982353433f, - 0.5945421515397132f, - 0.5944368946567644f, - 0.5943316275882995f, - 0.5942263503361229f, - 0.5941210629020386f, - 0.59401576528785f, - 0.5939104574953622f, - 0.5938051395263787f, - 0.593699811382705f, - 0.593594473066145f, - 0.5934891245785044f, - 0.5933837659215877f, - 0.5932783970972009f, - 0.5931730181071485f, - 0.5930676289532372f, - 0.5929622296372719f, - 0.5928568201610593f, - 0.592751400526405f, - 0.5926459707351159f, - 0.5925405307889982f, - 0.5924350806898582f, - 0.5923296204395035f, - 0.5922241500397405f, - 0.592118669492377f, - 0.5920131787992197f, - 0.5919076779620769f, - 0.5918021669827556f, - 0.5916966458630639f, - 0.5915911146048106f, - 0.5914855732098029f, - 0.59138002167985f, - 0.59127446001676f, - 0.5911688882223421f, - 0.5910633062984048f, - 0.5909577142467576f, - 0.5908521120692094f, - 0.5907464997675702f, - 0.5906408773436489f, - 0.5905352447992558f, - 0.5904296021362012f, - 0.5903239493562945f, - 0.5902182864613468f, - 0.5901126134531678f, - 0.5900069303335689f, - 0.5899012371043604f, - 0.5897955337673538f, - 0.5896898203243599f, - 0.5895840967771905f, - 0.5894783631276564f, - 0.5893726193775704f, - 0.5892668655287433f, - 0.5891611015829876f, - 0.5890553275421161f, - 0.5889495434079403f, - 0.5888437491822734f, - 0.5887379448669278f, - 0.5886321304637168f, - 0.5885263059744529f, - 0.5884204714009501f, - 0.5883146267450216f, - 0.5882087720084804f, - 0.5881029071931413f, - 0.5879970323008173f, - 0.5878911473333235f, - 0.5877852522924732f, - 0.5876793471800819f, - 0.5875734319979633f, - 0.587467506747933f, - 0.5873615714318055f, - 0.5872556260513964f, - 0.5871496706085204f, - 0.5870437051049938f, - 0.5869377295426316f, - 0.5868317439232503f, - 0.5867257482486652f, - 0.586619742520693f, - 0.5865137267411503f, - 0.586407700911853f, - 0.5863016650346186f, - 0.5861956191112632f, - 0.5860895631436045f, - 0.5859834971334591f, - 0.5858774210826452f, - 0.5857713349929796f, - 0.5856652388662809f, - 0.585559132704366f, - 0.5854530165090537f, - 0.5853468902821624f, - 0.58524075402551f, - 0.5851346077409156f, - 0.5850284514301975f, - 0.5849222850951754f, - 0.5848161087376675f, - 0.584709922359494f, - 0.5846037259624736f, - 0.5844975195484265f, - 0.5843913031191721f, - 0.5842850766765308f, - 0.5841788402223224f, - 0.5840725937583676f, - 0.5839663372864865f, - 0.5838600708085002f, - 0.583753794326229f, - 0.5836475078414947f, - 0.5835412113561175f, - 0.5834349048719197f, - 0.5833285883907221f, - 0.5832222619143471f, - 0.5831159254446162f, - 0.5830095789833512f, - 0.5829032225323744f, - 0.5827968560935087f, - 0.5826904796685761f, - 0.5825840932593999f, - 0.5824776968678022f, - 0.5823712904956069f, - 0.5822648741446366f, - 0.5821584478167152f, - 0.5820520115136659f, - 0.5819455652373129f, - 0.5818391089894794f, - 0.5817326427719904f, - 0.5816261665866694f, - 0.5815196804353412f, - 0.5814131843198307f, - 0.581306678241962f, - 0.5812001622035607f, - 0.5810936362064514f, - 0.5809871002524599f, - 0.5808805543434111f, - 0.5807739984811313f, - 0.5806674326674456f, - 0.5805608569041806f, - 0.5804542711931617f, - 0.5803476755362162f, - 0.5802410699351697f, - 0.5801344543918492f, - 0.5800278289080819f, - 0.5799211934856942f, - 0.5798145481265137f, - 0.5797078928323673f, - 0.5796012276050831f, - 0.5794945524464881f, - 0.5793878673584109f, - 0.5792811723426787f, - 0.5791744674011206f, - 0.579067752535564f, - 0.5789610277478382f, - 0.5788542930397717f, - 0.5787475484131929f, - 0.5786407938699315f, - 0.5785340294118162f, - 0.5784272550406768f, - 0.5783204707583425f, - 0.5782136765666434f, - 0.5781068724674088f, - 0.5780000584624695f, - 0.5778932345536549f, - 0.5777864007427964f, - 0.5776795570317236f, - 0.5775727034222676f, - 0.5774658399162598f, - 0.5773589665155303f, - 0.5772520832219115f, - 0.5771451900372336f, - 0.5770382869633294f, - 0.5769313740020295f, - 0.5768244511551668f, - 0.5767175184245725f, - 0.5766105758120799f, - 0.5765036233195203f, - 0.576396660948727f, - 0.576289688701533f, - 0.5761827065797704f, - 0.5760757145852732f, - 0.5759687127198739f, - 0.5758617009854067f, - 0.5757546793837045f, - 0.5756476479166017f, - 0.5755406065859316f, - 0.5754335553935291f, - 0.5753264943412277f, - 0.5752194234308626f, - 0.5751123426642678f, - 0.5750052520432783f, - 0.5748981515697296f, - 0.574791041245456f, - 0.5746839210722935f, - 0.5745767910520773f, - 0.5744696511866426f, - 0.5743625014778261f, - 0.5742553419274629f, - 0.5741481725373899f, - 0.5740409933094427f, - 0.5739338042454586f, - 0.5738266053472734f, - 0.5737193966167247f, - 0.5736121780556487f, - 0.5735049496658835f, - 0.5733977114492654f, - 0.573290463407633f, - 0.5731832055428229f, - 0.5730759378566738f, - 0.572968660351023f, - 0.5728613730277093f, - 0.5727540758885704f, - 0.5726467689354455f, - 0.5725394521701725f, - 0.5724321255945908f, - 0.5723247892105396f, - 0.5722174430198574f, - 0.5721100870243843f, - 0.572002721225959f, - 0.5718953456264219f, - 0.5717879602276122f, - 0.5716805650313708f, - 0.5715731600395368f, - 0.5714657452539517f, - 0.5713583206764549f, - 0.5712508863088878f, - 0.5711434421530912f, - 0.5710359882109058f, - 0.5709285244841735f, - 0.5708210509747347f, - 0.5707135676844317f, - 0.5706060746151056f, - 0.570498571768599f, - 0.570391059146753f, - 0.5702835367514109f, - 0.5701760045844139f, - 0.5700684626476055f, - 0.5699609109428276f, - 0.5698533494719239f, - 0.5697457782367366f, - 0.5696381972391097f, - 0.5695306064808858f, - 0.5694230059639093f, - 0.5693153956900233f, - 0.5692077756610715f, - 0.5691001458788986f, - 0.568992506345348f, - 0.568884857062265f, - 0.5687771980314933f, - 0.5686695292548782f, - 0.5685618507342641f, - 0.5684541624714963f, - 0.5683464644684203f, - 0.5682387567268808f, - 0.5681310392487242f, - 0.5680233120357954f, - 0.5679155750899408f, - 0.5678078284130059f, - 0.5677000720068377f, - 0.5675923058732818f, - 0.5674845300141854f, - 0.5673767444313945f, - 0.5672689491267564f, - 0.5671611441021185f, - 0.5670533293593272f, - 0.5669455049002307f, - 0.5668376707266757f, - 0.5667298268405108f, - 0.566621973243583f, - 0.5665141099377412f, - 0.5664062369248328f, - 0.5662983542067069f, - 0.5661904617852113f, - 0.5660825596621955f, - 0.5659746478395076f, - 0.565866726318997f, - 0.5657587951025133f, - 0.5656508541919051f, - 0.5655429035890227f, - 0.5654349432957151f, - 0.5653269733138329f, - 0.5652189936452253f, - 0.5651110042917433f, - 0.5650030052552371f, - 0.5648949965375565f, - 0.5647869781405531f, - 0.5646789500660772f, - 0.5645709123159802f, - 0.564462864892113f, - 0.5643548077963273f, - 0.5642467410304741f, - 0.5641386645964058f, - 0.5640305784959736f, - 0.5639224827310301f, - 0.5638143773034269f, - 0.563706262215017f, - 0.5635981374676522f, - 0.563490003063186f, - 0.5633818590034705f, - 0.5632737052903589f, - 0.563165541925705f, - 0.5630573689113614f, - 0.5629491862491821f, - 0.5628409939410203f, - 0.5627327919887305f, - 0.562624580394166f, - 0.5625163591591815f, - 0.562408128285631f, - 0.5622998877753694f, - 0.5621916376302508f, - 0.5620833778521305f, - 0.5619751084428636f, - 0.5618668294043047f, - 0.5617585407383099f, - 0.5616502424467338f, - 0.561541934531433f, - 0.5614336169942624f, - 0.5613252898370789f, - 0.5612169530617377f, - 0.5611086066700961f, - 0.5610002506640098f, - 0.560891885045336f, - 0.5607835098159311f, - 0.5606751249776525f, - 0.5605667305323567f, - 0.5604583264819019f, - 0.5603499128281446f, - 0.5602414895729434f, - 0.5601330567181552f, - 0.5600246142656388f, - 0.5599161622172519f, - 0.5598077005748525f, - 0.5596992293402997f, - 0.5595907485154515f, - 0.559482258102167f, - 0.5593737581023055f, - 0.5592652485177254f, - 0.5591567293502868f, - 0.5590482006018482f, - 0.5589396622742703f, - 0.5588311143694117f, - 0.5587225568891334f, - 0.5586139898352946f, - 0.5585054132097566f, - 0.5583968270143785f, - 0.5582882312510222f, - 0.5581796259215476f, - 0.5580710110278158f, - 0.5579623865716884f, - 0.5578537525550258f, - 0.5577451089796903f, - 0.5576364558475426f, - 0.5575277931604453f, - 0.5574191209202596f, - 0.557310439128848f, - 0.5572017477880724f, - 0.5570930468997958f, - 0.5569843364658799f, - 0.5568756164881878f, - 0.5567668869685829f, - 0.5566581479089274f, - 0.5565493993110854f, - 0.5564406411769193f, - 0.5563318735082936f, - 0.5562230963070711f, - 0.5561143095751165f, - 0.5560055133142932f, - 0.5558967075264659f, - 0.5557878922134983f, - 0.5556790673772558f, - 0.5555702330196022f, - 0.555461389142403f, - 0.5553525357475231f, - 0.5552436728368271f, - 0.5551348004121811f, - 0.55502591847545f, - 0.5549170270285f, - 0.5548081260731964f, - 0.5546992156114058f, - 0.5545902956449935f, - 0.5544813661758268f, - 0.5543724272057713f, - 0.5542634787366945f, - 0.5541545207704621f, - 0.5540455533089419f, - 0.5539365763540012f, - 0.5538275899075065f, - 0.5537185939713261f, - 0.5536095885473267f, - 0.553500573637377f, - 0.5533915492433441f, - 0.5532825153670969f, - 0.5531734720105029f, - 0.5530644191754313f, - 0.5529553568637499f, - 0.5528462850773279f, - 0.5527372038180345f, - 0.552628113087738f, - 0.5525190128883085f, - 0.5524099032216147f, - 0.5523007840895267f, - 0.5521916554939136f, - 0.5520825174366462f, - 0.5519733699195934f, - 0.5518642129446265f, - 0.5517550465136151f, - 0.5516458706284304f, - 0.5515366852909424f, - 0.5514274905030222f, - 0.5513182862665413f, - 0.5512090725833702f, - 0.5510998494553808f, - 0.5509906168844445f, - 0.5508813748724325f, - 0.5507721234212173f, - 0.55066286253267f, - 0.550553592208664f, - 0.5504443124510704f, - 0.5503350232617625f, - 0.5502257246426124f, - 0.5501164165954936f, - 0.5500070991222782f, - 0.54989777222484f, - 0.5497884359050518f, - 0.5496790901647876f, - 0.5495697350059203f, - 0.5494603704303245f, - 0.5493509964398733f, - 0.5492416130364415f, - 0.5491322202219027f, - 0.549022817998132f, - 0.5489134063670034f, - 0.5488039853303918f, - 0.5486945548901725f, - 0.5485851150482199f, - 0.5484756658064099f, - 0.5483662071666172f, - 0.5482567391307182f, - 0.5481472617005875f, - 0.548037774878102f, - 0.5479282786651369f, - 0.5478187730635693f, - 0.5477092580752745f, - 0.5475997337021296f, - 0.5474901999460116f, - 0.5473806568087964f, - 0.547271104292362f, - 0.5471615423985847f, - 0.5470519711293426f, - 0.5469423904865124f, - 0.5468328004719725f, - 0.5467232010875998f, - 0.5466135923352732f, - 0.54650397421687f, - 0.5463943467342692f, - 0.5462847098893485f, - 0.5461750636839873f, - 0.5460654081200635f, - 0.5459557431994568f, - 0.5458460689240461f, - 0.54573638529571f, - 0.5456266923163288f, - 0.5455169899877812f, - 0.5454072783119477f, - 0.5452975572907075f, - 0.5451878269259414f, - 0.5450780872195288f, - 0.5449683381733503f, - 0.5448585797892871f, - 0.5447488120692189f, - 0.5446390350150273f, - 0.5445292486285926f, - 0.5444194529117967f, - 0.5443096478665203f, - 0.5441998334946454f, - 0.544090009798053f, - 0.5439801767786258f, - 0.5438703344382447f, - 0.5437604827787927f, - 0.5436506218021515f, - 0.5435407515102036f, - 0.5434308719048323f, - 0.5433209829879194f, - 0.5432110847613486f, - 0.5431011772270022f, - 0.5429912603867643f, - 0.5428813342425174f, - 0.542771398796146f, - 0.5426614540495328f, - 0.5425515000045626f, - 0.5424415366631188f, - 0.5423315640270856f, - 0.542221582098348f, - 0.5421115908787898f, - 0.5420015903702963f, - 0.5418915805747515f, - 0.5417815614940413f, - 0.5416715331300501f, - 0.5415614954846638f, - 0.5414514485597677f, - 0.5413413923572468f, - 0.5412313268789878f, - 0.5411212521268759f, - 0.5410111681027979f, - 0.5409010748086392f, - 0.5407909722462872f, - 0.5406808604176278f, - 0.540570739324548f, - 0.5404606089689343f, - 0.5403504693526746f, - 0.5402403204776551f, - 0.540130162345764f, - 0.5400199949588883f, - 0.5399098183189162f, - 0.5397996324277347f, - 0.5396894372872328f, - 0.5395792328992978f, - 0.5394690192658185f, - 0.5393587963886836f, - 0.5392485642697811f, - 0.5391383229110004f, - 0.5390280723142299f, - 0.5389178124813594f, - 0.5388075434142774f, - 0.538697265114874f, - 0.5385869775850382f, - 0.5384766808266604f, - 0.5383663748416297f, - 0.5382560596318368f, - 0.538145735199172f, - 0.538035401545525f, - 0.5379250586727872f, - 0.5378147065828485f, - 0.5377043452776004f, - 0.5375939747589332f, - 0.5374835950287389f, - 0.537373206088908f, - 0.5372628079413329f, - 0.5371524005879041f, - 0.5370419840305146f, - 0.5369315582710554f, - 0.5368211233114194f, - 0.5367106791534981f, - 0.5366002257991846f, - 0.5364897632503709f, - 0.5363792915089504f, - 0.5362688105768153f, - 0.5361583204558593f, - 0.5360478211479754f, - 0.5359373126550566f, - 0.535826794978997f, - 0.5357162681216897f, - 0.5356057320850288f, - 0.5354951868709089f, - 0.5353846324812231f, - 0.5352740689178668f, - 0.5351634961827334f, - 0.5350529142777186f, - 0.5349423232047162f, - 0.534831722965622f, - 0.5347211135623304f, - 0.5346104949967373f, - 0.5344998672707374f, - 0.5343892303862271f, - 0.5342785843451013f, - 0.5341679291492564f, - 0.5340572648005886f, - 0.5339465913009935f, - 0.5338359086523682f, - 0.5337252168566085f, - 0.5336145159156117f, - 0.533503805831274f, - 0.533393086605493f, - 0.5332823582401653f, - 0.5331716207371888f, - 0.5330608740984603f, - 0.5329501183258776f, - 0.5328393534213391f, - 0.5327285793867418f, - 0.5326177962239846f, - 0.532507003934965f, - 0.5323962025215822f, - 0.5322853919857338f, - 0.5321745723293194f, - 0.5320637435542371f, - 0.5319529056623867f, - 0.5318420586556667f, - 0.5317312025359769f, - 0.5316203373052167f, - 0.5315094629652852f, - 0.5313985795180831f, - 0.5312876869655095f, - 0.5311767853094653f, - 0.5310658745518501f, - 0.5309549546945649f, - 0.5308440257395096f, - 0.5307330876885857f, - 0.5306221405436934f, - 0.5305111843067344f, - 0.5304002189796092f, - 0.5302892445642196f, - 0.5301782610624673f, - 0.5300672684762535f, - 0.5299562668074806f, - 0.5298452560580499f, - 0.5297342362298643f, - 0.5296232073248252f, - 0.5295121693448359f, - 0.5294011222917983f, - 0.5292900661676158f, - 0.5291790009741907f, - 0.5290679267134267f, - 0.5289568433872264f, - 0.5288457509974934f, - 0.5287346495461318f, - 0.5286235390350444f, - 0.5285124194661359f, - 0.5284012908413095f, - 0.52829015316247f, - 0.5281790064315212f, - 0.5280678506503681f, - 0.5279566858209147f, - 0.5278455119450666f, - 0.5277343290247277f, - 0.5276231370618041f, - 0.5275119360582002f, - 0.5274007260158219f, - 0.527289506936575f, - 0.5271782788223647f, - 0.5270670416750967f, - 0.5269557954966777f, - 0.5268445402890132f, - 0.5267332760540102f, - 0.5266220027935744f, - 0.5265107205096132f, - 0.5263994292040328f, - 0.5262881288787407f, - 0.5261768195356432f, - 0.5260655011766486f, - 0.5259541738036633f, - 0.5258428374185957f, - 0.5257314920233528f, - 0.5256201376198432f, - 0.5255087742099741f, - 0.5253974017956546f, - 0.5252860203787921f, - 0.525174629961296f, - 0.5250632305450741f, - 0.524951822132036f, - 0.5248404047240898f, - 0.524728978323145f, - 0.5246175429311114f, - 0.5245060985498976f, - 0.5243946451814138f, - 0.524283182827569f, - 0.524171711490274f, - 0.524060231171438f, - 0.5239487418729717f, - 0.523837243596785f, - 0.523725736344789f, - 0.5236142201188937f, - 0.5235026949210101f, - 0.5233911607530497f, - 0.5232796176169227f, - 0.5231680655145412f, - 0.5230565044478159f, - 0.5229449344186592f, - 0.5228333554289818f, - 0.5227217674806965f, - 0.5226101705757146f, - 0.5224985647159489f, - 0.5223869499033111f, - 0.5222753261397146f, - 0.5221636934270709f, - 0.5220520517672939f, - 0.5219404011622956f, - 0.5218287416139898f, - 0.5217170731242896f, - 0.521605395695108f, - 0.5214937093283591f, - 0.5213820140259561f, - 0.5212703097898135f, - 0.5211585966218445f, - 0.5210468745239641f, - 0.5209351434980861f, - 0.520823403546125f, - 0.520711654669996f, - 0.5205998968716131f, - 0.520488130152892f, - 0.520376354515747f, - 0.5202645699620941f, - 0.5201527764938481f, - 0.520040974112925f, - 0.5199291628212401f, - 0.5198173426207098f, - 0.5197055135132492f, - 0.5195936755007756f, - 0.5194818285852043f, - 0.5193699727684523f, - 0.5192581080524364f, - 0.5191462344390728f, - 0.519034351930279f, - 0.5189224605279715f, - 0.5188105602340682f, - 0.5186986510504858f, - 0.5185867329791425f, - 0.5184748060219552f, - 0.5183628701808426f, - 0.5182509254577218f, - 0.5181389718545114f, - 0.5180270093731302f, - 0.5179150380154957f, - 0.5178030577835273f, - 0.517691068679143f, - 0.5175790707042626f, - 0.5174670638608041f, - 0.5173550481506878f, - 0.5172430235758324f, - 0.5171309901381572f, - 0.5170189478395826f, - 0.5169068966820276f, - 0.516794836667413f, - 0.516682767797658f, - 0.5165706900746838f, - 0.5164586035004101f, - 0.516346508076758f, - 0.5162344038056477f, - 0.5161222906890006f, - 0.5160101687287372f, - 0.5158980379267794f, - 0.5157858982850476f, - 0.5156737498054642f, - 0.51556159248995f, - 0.5154494263404272f, - 0.5153372513588182f, - 0.5152250675470442f, - 0.5151128749070283f, - 0.5150006734406919f, - 0.5148884631499586f, - 0.5147762440367503f, - 0.5146640161029903f, - 0.5145517793506011f, - 0.5144395337815066f, - 0.5143272793976293f, - 0.5142150162008934f, - 0.5141027441932218f, - 0.5139904633765384f, - 0.5138781737527678f, - 0.5137658753238331f, - 0.5136535680916593f, - 0.51354125205817f, - 0.5134289272252904f, - 0.5133165935949445f, - 0.5132042511690579f, - 0.5130918999495547f, - 0.5129795399383608f, - 0.5128671711374007f, - 0.5127547935486004f, - 0.512642407173885f, - 0.5125300120151808f, - 0.512417608074413f, - 0.5123051953535082f, - 0.5121927738543919f, - 0.5120803435789912f, - 0.5119679045292321f, - 0.511855456707041f, - 0.5117430001143453f, - 0.5116305347530712f, - 0.5115180606251464f, - 0.5114055777324974f, - 0.5112930860770522f, - 0.5111805856607382f, - 0.5110680764854828f, - 0.5109555585532143f, - 0.5108430318658599f, - 0.5107304964253486f, - 0.5106179522336078f, - 0.5105053992925668f, - 0.5103928376041532f, - 0.5102802671702967f, - 0.5101676879929253f, - 0.5100551000739687f, - 0.5099425034153555f, - 0.5098298980190151f, - 0.5097172838868776f, - 0.5096046610208719f, - 0.5094920294229281f, - 0.5093793890949759f, - 0.5092667400389458f, - 0.5091540822567673f, - 0.5090414157503714f, - 0.5089287405216881f, - 0.5088160565726487f, - 0.5087033639051833f, - 0.5085906625212232f, - 0.5084779524226998f, - 0.5083652336115437f, - 0.5082525060896871f, - 0.5081397698590606f, - 0.5080270249215969f, - 0.507914271279227f, - 0.5078015089338836f, - 0.5076887378874982f, - 0.5075759581420038f, - 0.5074631696993321f, - 0.5073503725614166f, - 0.5072375667301894f, - 0.5071247522075831f, - 0.5070119289955316f, - 0.5068990970959674f, - 0.5067862565108243f, - 0.5066734072420354f, - 0.5065605492915348f, - 0.5064476826612557f, - 0.5063348073531329f, - 0.5062219233690994f, - 0.5061090307110905f, - 0.5059961293810397f, - 0.5058832193808819f, - 0.5057703007125521f, - 0.5056573733779846f, - 0.5055444373791149f, - 0.5054314927178775f, - 0.5053185393962084f, - 0.5052055774160423f, - 0.5050926067793154f, - 0.5049796274879629f, - 0.5048666395439212f, - 0.5047536429491256f, - 0.5046406377055132f, - 0.5045276238150194f, - 0.5044146012795809f, - 0.5043015701011351f, - 0.5041885302816176f, - 0.5040754818229662f, - 0.5039624247271174f, - 0.5038493589960088f, - 0.5037362846315773f, - 0.5036232016357609f, - 0.5035101100104967f, - 0.5033970097577233f, - 0.5032839008793776f, - 0.5031707833773982f, - 0.5030576572537239f, - 0.502944522510292f, - 0.5028313791490421f, - 0.5027182271719123f, - 0.502605066580841f, - 0.5024918973777682f, - 0.5023787195646321f, - 0.5022655331433727f, - 0.5021523381159287f, - 0.5020391344842405f, - 0.5019259222502473f, - 0.5018127014158886f, - 0.5016994719831049f, - 0.5015862339538367f, - 0.5014729873300234f, - 0.5013597321136064f, - 0.5012464683065255f, - 0.5011331959107221f, - 0.5010199149281364f, - 0.5009066253607102f, - 0.5007933272103839f, - 0.5006800204790997f, - 0.5005667051687981f, - 0.5004533812814213f, - 0.5003400488189114f, - 0.5002267077832095f, - 0.5001133581762586f, - 0.49999999999999994f, - 0.4998866332563768f, - 0.49977325794733085f, - 0.4996598740748055f, - 0.49954648164074283f, - 0.4994330806470866f, - 0.499319671095779f, - 0.49920625298876414f, - 0.49909282632798463f, - 0.49897939111538436f, - 0.4988659473529074f, - 0.49875249504249686f, - 0.4986390341860974f, - 0.49852556478565246f, - 0.498412086843107f, - 0.4982986003604047f, - 0.4981851053394909f, - 0.4980716017823095f, - 0.49795808969080624f, - 0.49784456906692515f, - 0.4977310399126123f, - 0.49761750222981216f, - 0.4975039560204709f, - 0.49739040128653383f, - 0.4972768380299462f, - 0.4971632662526547f, - 0.49704968595660454f, - 0.49693609714374265f, - 0.4968224998160147f, - 0.4967088939753677f, - 0.49659527962374767f, - 0.4964816567631021f, - 0.496368025395377f, - 0.49625438552251994f, - 0.49614073714647844f, - 0.49602708026919906f, - 0.49591341489263f, - 0.49579974101871827f, - 0.49568605864941223f, - 0.49557236778665914f, - 0.49545866843240777f, - 0.4953449605886056f, - 0.4952312442572017f, - 0.4951175194401439f, - 0.49500378613938156f, - 0.4948900443568626f, - 0.49477629409453655f, - 0.4946625353543527f, - 0.49454876813825954f, - 0.4944349924482072f, - 0.4943212082861445f, - 0.4942074156540219f, - 0.49409361455378825f, - 0.4939798049873944f, - 0.49386598695678974f, - 0.4937521604639251f, - 0.49363832551075026f, - 0.49352448209921607f, - 0.4934106302312736f, - 0.4932967699088729f, - 0.4931829011339657f, - 0.49306902390850227f, - 0.49295513823443476f, - 0.4928412441137138f, - 0.49272734154829156f, - 0.4926134305401195f, - 0.49249951109114903f, - 0.4923855832033328f, - 0.4922716468786223f, - 0.49215770211897053f, - 0.49204374892632907f, - 0.49192978730265124f, - 0.4918158172498891f, - 0.4917018387699962f, - 0.49158785186492465f, - 0.4914738565366285f, - 0.49135985278706024f, - 0.491245840618174f, - 0.49113182003192263f, - 0.4910177910302606f, - 0.490903753615141f, - 0.49078970778851816f, - 0.49067565355234666f, - 0.49056159090858004f, - 0.49044751985917345f, - 0.49033344040608073f, - 0.49021935255125737f, - 0.49010525629665747f, - 0.4899911516442368f, - 0.4898770385959497f, - 0.4897629171537523f, - 0.48964878731959927f, - 0.48953464909544686f, - 0.4894205024832502f, - 0.4893063474849654f, - 0.4891921841025489f, - 0.4890780123379561f, - 0.4889638321931441f, - 0.48884964367006856f, - 0.4887354467706868f, - 0.48862124149695485f, - 0.4885070278508303f, - 0.4883928058342694f, - 0.4882785754492301f, - 0.48816433669766895f, - 0.48805008958154417f, - 0.48793583410281255f, - 0.48782157026343265f, - 0.48770729806536156f, - 0.487593017510558f, - 0.48747872860097946f, - 0.48736443133858504f, - 0.48725012572533266f, - 0.4871358117631807f, - 0.4870214894540886f, - 0.4869071588000144f, - 0.486792819802918f, - 0.48667847246475776f, - 0.4865641167874934f, - 0.4864497527730847f, - 0.48633538042349056f, - 0.4862209997406714f, - 0.4861066107265864f, - 0.48599221338319637f, - 0.48587780771246064f, - 0.4857633937163403f, - 0.48564897139679514f, - 0.4855345407557864f, - 0.48542010179527406f, - 0.48530565451721985f, - 0.4851911989235839f, - 0.4850767350163279f, - 0.4849622627974135f, - 0.4848477822688013f, - 0.4847332934324538f, - 0.48461879629033183f, - 0.4845042908443981f, - 0.48438977709661385f, - 0.4842752550489421f, - 0.4841607247033442f, - 0.4840461860617835f, - 0.4839316391262218f, - 0.4838170838986222f, - 0.48370252038094796f, - 0.4835879485751613f, - 0.4834733684832262f, - 0.48335878010710515f, - 0.4832441834487624f, - 0.4831295785101607f, - 0.4830149652932646f, - 0.48290034380003716f, - 0.4827857140324432f, - 0.48267107599244646f, - 0.48255642968201085f, - 0.48244177510310154f, - 0.4823271122576824f, - 0.48221244114771883f, - 0.482097761775175f, - 0.4819830741420167f, - 0.4818683782502082f, - 0.4817536741017156f, - 0.48163896169850356f, - 0.48152424104253844f, - 0.48140951213578514f, - 0.4812947749802103f, - 0.48118002957777917f, - 0.48106527593045817f, - 0.48095051404021405f, - 0.4808357439090124f, - 0.48072096553882054f, - 0.4806061789316045f, - 0.4804913840893318f, - 0.4803765810139686f, - 0.48026176970748286f, - 0.48014695017184106f, - 0.4800321224090114f, - 0.4799172864209606f, - 0.4798024422096572f, - 0.4796875897770681f, - 0.4795727291251618f, - 0.4794578602559067f, - 0.47934298317127033f, - 0.47922809787322185f, - 0.47911320436372895f, - 0.4789983026447611f, - 0.4788833927182864f, - 0.47876847458627453f, - 0.47865354825069384f, - 0.47853861371351425f, - 0.4784236709767044f, - 0.47830872004223424f, - 0.4781937609120737f, - 0.47807879358819233f, - 0.47796381807255955f, - 0.4778488343671463f, - 0.477733842473922f, - 0.47761884239485775f, - 0.4775038341319232f, - 0.47738881768708996f, - 0.47727379306232787f, - 0.4771587602596086f, - 0.47704371928090294f, - 0.4769286701281817f, - 0.47681361280341644f, - 0.4766985473085792f, - 0.4765834736456407f, - 0.4764683918165736f, - 0.47635330182334884f, - 0.4762382036679394f, - 0.47612309735231656f, - 0.47600798287845353f, - 0.4758928602483219f, - 0.47577772946389507f, - 0.47566259052714494f, - 0.4755474434400449f, - 0.47543228820456823f, - 0.4753171248226874f, - 0.4752019532963764f, - 0.47508677362760793f, - 0.47497158581835636f, - 0.4748563898705946f, - 0.4747411857862972f, - 0.4746259735674375f, - 0.4745107532159904f, - 0.47439552473392926f, - 0.4742802881232294f, - 0.47416504338586457f, - 0.4740497905238098f, - 0.47393452953904036f, - 0.47381926043353034f, - 0.4737039832092558f, - 0.47358869786819097f, - 0.4734734044123122f, - 0.47335810284359414f, - 0.4732427931640133f, - 0.4731274753755446f, - 0.4730121494801649f, - 0.4728968154798494f, - 0.47278147337657506f, - 0.47266612317231754f, - 0.4725507648690541f, - 0.472435398468761f, - 0.47232002397341455f, - 0.47220464138499246f, - 0.47208925070547103f, - 0.4719738519368283f, - 0.47185844508104063f, - 0.4717430301400864f, - 0.4716276071159424f, - 0.4715121760105872f, - 0.4713967368259978f, - 0.4712812895641527f, - 0.47116583422703046f, - 0.4710503708166085f, - 0.4709348993348661f, - 0.47081941978378106f, - 0.4707039321653328f, - 0.47058843648149945f, - 0.4704729327342608f, - 0.4703574209255951f, - 0.47024190105748254f, - 0.4701263731319016f, - 0.47001083715083264f, - 0.4698952931162546f, - 0.46977974103014764f, - 0.4696641808944922f, - 0.4695486127112674f, - 0.46943303648245444f, - 0.46931745221003285f, - 0.46920185989598384f, - 0.46908625954228733f, - 0.46897065115092496f, - 0.4688550347238767f, - 0.46873941026312455f, - 0.4686237777706488f, - 0.4685081372484312f, - 0.4683924886984537f, - 0.468276832122697f, - 0.46816116752314374f, - 0.46804549490177494f, - 0.4679298142605734f, - 0.4678141256015209f, - 0.4676984289265994f, - 0.467582724237792f, - 0.46746701153708065f, - 0.46735129082644866f, - 0.4672355621078782f, - 0.467119825383353f, - 0.4670040806548554f, - 0.4668883279243694f, - 0.4667725671938777f, - 0.4666567984653645f, - 0.4665410217408128f, - 0.4664252370222071f, - 0.4663094443115306f, - 0.4661936436107681f, - 0.4660778349219031f, - 0.4659620182469207f, - 0.4658461935878046f, - 0.46573036094653986f, - 0.4656145203251116f, - 0.46549867172550385f, - 0.4653828151497026f, - 0.46526695059969214f, - 0.46515107807745854f, - 0.4650351975849865f, - 0.4649193091242624f, - 0.4648034126972711f, - 0.4646875083059993f, - 0.46457159595243225f, - 0.4644556756385567f, - 0.46433974736635836f, - 0.46422381113782385f, - 0.4641078669549401f, - 0.4639919148196931f, - 0.46387595473407034f, - 0.463759986700058f, - 0.463644010719644f, - 0.4635280267948148f, - 0.46341203492755845f, - 0.4632960351198616f, - 0.46318002737371283f, - 0.463064011691099f, - 0.4629479880740089f, - 0.4628319565244296f, - 0.4627159170443502f, - 0.4625998696357582f, - 0.4624838143006428f, - 0.46236775104099176f, - 0.4622516798587946f, - 0.4621356007560398f, - 0.462019513734716f, - 0.46190341879681296f, - 0.4617873159443193f, - 0.4616712051792251f, - 0.4615550865035191f, - 0.4614389599191915f, - 0.4613228254282323f, - 0.4612066830326307f, - 0.4610905327343776f, - 0.4609743745354624f, - 0.4608582084378762f, - 0.4607420344436088f, - 0.4606258525546514f, - 0.4605096627729941f, - 0.46039346510062856f, - 0.46027725953954496f, - 0.4601610460917349f, - 0.46004482475919f, - 0.4599285955439009f, - 0.45981235844786f, - 0.45969611347305817f, - 0.459579860621488f, - 0.4594635998951407f, - 0.45934733129600913f, - 0.45923105482608473f, - 0.45911477048736066f, - 0.45899847828182866f, - 0.45888217821148214f, - 0.45876587027831306f, - 0.45864955448431477f, - 0.4585332308314806f, - 0.4584168993218031f, - 0.45830055995727614f, - 0.4581842127398926f, - 0.4580678576716467f, - 0.45795149475453145f, - 0.4578351239905415f, - 0.4577187453816699f, - 0.4576023589299117f, - 0.4574859646372607f, - 0.4573695625057109f, - 0.4572531525372576f, - 0.45713673473389466f, - 0.4570203090976177f, - 0.4569038756304208f, - 0.4567874343342998f, - 0.45667098521124916f, - 0.4565545282632649f, - 0.45643806349234184f, - 0.4563215909004762f, - 0.456205110489663f, - 0.45608862226189884f, - 0.45597212621917904f, - 0.45585562236349997f, - 0.4557391106968584f, - 0.4556225912212499f, - 0.45550606393867177f, - 0.4553895288511199f, - 0.45527298596059185f, - 0.45515643526908384f, - 0.45503987677859364f, - 0.4549233104911177f, - 0.45480673640865416f, - 0.4546901545331996f, - 0.45457356486675254f, - 0.45445696741130986f, - 0.4543403621688698f, - 0.45422374914143077f, - 0.4541071283309901f, - 0.45399049973954686f, - 0.4538738633690987f, - 0.4537572192216449f, - 0.45364056729918334f, - 0.4535239076037136f, - 0.4534072401372338f, - 0.4532905649017439f, - 0.4531738818992422f, - 0.45305719113172843f, - 0.45294049260120256f, - 0.45282378630966363f, - 0.4527070722591111f, - 0.4525903504515456f, - 0.45247362088896637f, - 0.4523568835733742f, - 0.4522401385067687f, - 0.45212338569115096f, - 0.45200662512852113f, - 0.45188985682087957f, - 0.4517730807702277f, - 0.45165629697856585f, - 0.4515395054478953f, - 0.45142270618021774f, - 0.45130589917753366f, - 0.4511890844418453f, - 0.4510722619751535f, - 0.45095543177946074f, - 0.4508385938567681f, - 0.45072174820907834f, - 0.45060489483839283f, - 0.45048803374671453f, - 0.4503711649360451f, - 0.45025428840838744f, - 0.4501374041657446f, - 0.4500205122101185f, - 0.44990361254351297f, - 0.4497867051679301f, - 0.449669790085374f, - 0.44955286729784716f, - 0.4494359368073537f, - 0.4493189986158966f, - 0.4492020527254802f, - 0.44908509913810757f, - 0.4489681378557835f, - 0.44885116888051124f, - 0.4487341922142955f, - 0.44861720785914105f, - 0.44850021581705146f, - 0.4483832160900323f, - 0.44826620868008743f, - 0.4481491935892226f, - 0.448032170819442f, - 0.4479151403727516f, - 0.4477981022511559f, - 0.44768105645666106f, - 0.4475640029912719f, - 0.44744694185699485f, - 0.44732987305583494f, - 0.4472127965897989f, - 0.44709571246089236f, - 0.44697862067112126f, - 0.44686152122249256f, - 0.4467444141170121f, - 0.44662729935668716f, - 0.44651017694352374f, - 0.4463930468795294f, - 0.44627590916671045f, - 0.44615876380707475f, - 0.4460416108026288f, - 0.4459244501553803f, - 0.44580728186733726f, - 0.44569010594050645f, - 0.4455729223768965f, - 0.4454557311785145f, - 0.4453385323473693f, - 0.44522132588546826f, - 0.44510411179482046f, - 0.4449868900774336f, - 0.444869660735317f, - 0.44475242377047847f, - 0.44463517918492734f, - 0.444517926980673f, - 0.4444006671597236f, - 0.44428339972408926f, - 0.44416612467577854f, - 0.4440488420168016f, - 0.4439315517491673f, - 0.44381425387488627f, - 0.44369694839596746f, - 0.44357963531442174f, - 0.4434623146322584f, - 0.44334498635148845f, - 0.4432276504741216f, - 0.44311030700216864f, - 0.4429929559376407f, - 0.4428755972825478f, - 0.44275823103890155f, - 0.4426408572087122f, - 0.44252347579399176f, - 0.44240608679675114f, - 0.4422886902190013f, - 0.4421712860627547f, - 0.44205387433002213f, - 0.44193645502281625f, - 0.4418190281431482f, - 0.4417015936930309f, - 0.4415841516744757f, - 0.44146670208949573f, - 0.44134924494010275f, - 0.44123178022831006f, - 0.4411143079561296f, - 0.4409968281255751f, - 0.44087934073865864f, - 0.4407618457973942f, - 0.4406443433037942f, - 0.44052683325987285f, - 0.44040931566764285f, - 0.44029179052911815f, - 0.440174257846313f, - 0.44005671762124043f, - 0.4399391698559153f, - 0.43982161455235097f, - 0.4397040517125625f, - 0.4395864813385635f, - 0.4394689034323693f, - 0.4393513179959937f, - 0.4392337250314524f, - 0.4391161245407595f, - 0.43899851652593086f, - 0.4388809009889808f, - 0.4387632779319251f, - 0.4386456473567795f, - 0.4385280092655589f, - 0.43841036366027974f, - 0.43829271054295704f, - 0.4381750499156075f, - 0.43805738178024656f, - 0.43793970613889105f, - 0.4378220229935566f, - 0.4377043323462605f, - 0.4375866341990185f, - 0.4374689285538481f, - 0.43735121541276545f, - 0.4372334947777883f, - 0.4371157666509329f, - 0.4369980310342173f, - 0.4368802879296585f, - 0.4367625373392736f, - 0.4366447792650811f, - 0.4365270137090978f, - 0.43640924067334247f, - 0.4362914601598323f, - 0.4361736721705862f, - 0.43605587670762175f, - 0.43593807377295757f, - 0.4358202633686127f, - 0.435702445496605f, - 0.43558462015895394f, - 0.43546678735767774f, - 0.43534894709479616f, - 0.43523109937232757f, - 0.4351132441922921f, - 0.43499538155670836f, - 0.4348775114675966f, - 0.43475963392697586f, - 0.4346417489368662f, - 0.434523856499288f, - 0.4344059566162605f, - 0.43428804928980475f, - 0.43417013452194014f, - 0.434052212314688f, - 0.43393428267006806f, - 0.4338163455901018f, - 0.4336984010768093f, - 0.4335804491322122f, - 0.4334624897583309f, - 0.43334452295718734f, - 0.433226548730802f, - 0.4331085670811969f, - 0.4329905780103938f, - 0.43287258152041375f, - 0.4327545776132794f, - 0.4326365662910118f, - 0.432518547555634f, - 0.4324005214091673f, - 0.4322824878536349f, - 0.4321644468910588f, - 0.43204639852346133f, - 0.4319283427528659f, - 0.43181027958129464f, - 0.43169220901077127f, - 0.43157413104331815f, - 0.4314560456809593f, - 0.43133795292571725f, - 0.4312198527796163f, - 0.43110174524467926f, - 0.4309836303229307f, - 0.4308655080163937f, - 0.430747378327093f, - 0.4306292412570519f, - 0.4305110968082955f, - 0.4303929449828474f, - 0.4302747857827324f, - 0.43015661920997567f, - 0.43003844526660107f, - 0.4299202639546343f, - 0.4298020752760995f, - 0.4296838792330227f, - 0.4295656758274283f, - 0.42944746506134246f, - 0.42932924693679f, - 0.4292110214557972f, - 0.42909278862038913f, - 0.4289745484325921f, - 0.42885630089443244f, - 0.4287380460079355f, - 0.42861978377512844f, - 0.4285015141980367f, - 0.4283832372786877f, - 0.42826495301910733f, - 0.428146661421323f, - 0.428028362487361f, - 0.42791005621924894f, - 0.4277917426190133f, - 0.42767342168868216f, - 0.42755509343028203f, - 0.4274367578458409f, - 0.4273184149373868f, - 0.42720006470694716f, - 0.42708170715654936f, - 0.4269633422882223f, - 0.42684497010399336f, - 0.4267265906058915f, - 0.42660820379594444f, - 0.42648980967618144f, - 0.42637140824863085f, - 0.42625299951532086f, - 0.42613458347828137f, - 0.42601616013954047f, - 0.42589772950112775f, - 0.4257792915650729f, - 0.4256608463334045f, - 0.42554239380815295f, - 0.42542393399134704f, - 0.4253054668850173f, - 0.42518699249119296f, - 0.4250685108119047f, - 0.424950021849182f, - 0.4248315256050559f, - 0.4247130220815559f, - 0.42459451128071307f, - 0.42447599320455837f, - 0.4243574678551218f, - 0.42423893523443507f, - 0.4241203953445284f, - 0.42400184818743375f, - 0.4238832937651816f, - 0.4237647320798041f, - 0.423646163133332f, - 0.4235275869277977f, - 0.42340900346523225f, - 0.4232904127476684f, - 0.42317181477713717f, - 0.4230532095556713f, - 0.4229345970853033f, - 0.42281597736806487f, - 0.4226973504059893f, - 0.42257871620110843f, - 0.42246007475545583f, - 0.42234142607106356f, - 0.4222227701499655f, - 0.42210410699419393f, - 0.42198543660578286f, - 0.421866758986765f, - 0.4217480741391746f, - 0.42162938206504486f, - 0.4215106827664092f, - 0.4213919762453022f, - 0.4212732625037572f, - 0.42115454154380905f, - 0.4210358133674912f, - 0.4209170779768388f, - 0.4207983353738856f, - 0.42067958556066704f, - 0.420560828539217f, - 0.4204420643115712f, - 0.4203232928797638f, - 0.42020451424583033f, - 0.42008572841180647f, - 0.41996693537972674f, - 0.4198481351516274f, - 0.4197293277295433f, - 0.41961051311551095f, - 0.41949169131156544f, - 0.4193728623197435f, - 0.4192540261420805f, - 0.4191351827806134f, - 0.41901633223737783f, - 0.41889747451441056f, - 0.41877860961374863f, - 0.41865973753742797f, - 0.4185408582874862f, - 0.41842197186595953f, - 0.41830307827488583f, - 0.41818417751630144f, - 0.4180652695922446f, - 0.41794635450475187f, - 0.41782743225586166f, - 0.4177085028476109f, - 0.4175895662820382f, - 0.41747062256118067f, - 0.4173516716870769f, - 0.4172327136617653f, - 0.41711374848728344f, - 0.41699477616567066f, - 0.416875796698965f, - 0.41675681008920484f, - 0.41663781633842967f, - 0.4165188154486777f, - 0.4163998074219888f, - 0.4162807922604012f, - 0.41616176996595516f, - 0.4160427405406892f, - 0.4159237039866437f, - 0.4158046603058575f, - 0.41568560950037114f, - 0.4155665515722238f, - 0.41544748652345626f, - 0.41532841435610784f, - 0.4152093350722197f, - 0.4150902486738313f, - 0.4149711551629841f, - 0.41485205454171786f, - 0.4147329468120742f, - 0.41461383197609303f, - 0.4144947100358159f, - 0.4143755809932843f, - 0.41425644485053864f, - 0.41413730160962114f, - 0.41401815127257247f, - 0.413898993841435f, - 0.41377982931824975f, - 0.4136606577050593f, - 0.4135414790039048f, - 0.41342229321682916f, - 0.41330310034587386f, - 0.41318390039308156f, - 0.41306469336049517f, - 0.41294547925015646f, - 0.41282625806410894f, - 0.4127070298043946f, - 0.4125877944730572f, - 0.412468552072139f, - 0.412349302603684f, - 0.41223004606973473f, - 0.41211078247233535f, - 0.41199151181352867f, - 0.4118722340953591f, - 0.4117529493198697f, - 0.4116336574891052f, - 0.4115143586051087f, - 0.4113950526699253f, - 0.4112757396855984f, - 0.4111564196541732f, - 0.41103709257769383f, - 0.41091775845820455f, - 0.41079841729775085f, - 0.41067906909837687f, - 0.4105597138621284f, - 0.41044035159104975f, - 0.41032098228718694f, - 0.4102016059525846f, - 0.4100822225892885f, - 0.40996283219934476f, - 0.40984343478479823f, - 0.40972403034769556f, - 0.40960461889008193f, - 0.4094852004140042f, - 0.4093657749215078f, - 0.4092463424146398f, - 0.40912690289544595f, - 0.4090074563659735f, - 0.4088880028282684f, - 0.40876854228437787f, - 0.40864907473634915f, - 0.4085296001862286f, - 0.408410118636064f, - 0.40829063008790206f, - 0.4081711345437909f, - 0.40805163200577715f, - 0.4079321224759093f, - 0.4078126059562344f, - 0.4076930824488011f, - 0.40757355195565653f, - 0.40745401447884966f, - 0.40733447002042794f, - 0.4072149185824401f, - 0.40709536016693504f, - 0.4069757947759606f, - 0.40685622241156627f, - 0.40673664307580004f, - 0.40661705677071175f, - 0.40649746349834964f, - 0.4063778632607637f, - 0.4062582560600029f, - 0.40613864189811616f, - 0.40601902077715396f, - 0.40589939269916514f, - 0.4057797576662003f, - 0.40566011568030846f, - 0.4055404667435406f, - 0.405420810857946f, - 0.4053011480255757f, - 0.4051814782484794f, - 0.40506180152870824f, - 0.4049421178683122f, - 0.40482242726934276f, - 0.40470272973384996f, - 0.4045830252638857f, - 0.40446331386150014f, - 0.404343595528745f, - 0.4042238702676719f, - 0.4041041380803317f, - 0.40398439896877664f, - 0.40386465293505763f, - 0.4037448999812273f, - 0.4036251401093368f, - 0.403505373321439f, - 0.40338559961958514f, - 0.4032658190058285f, - 0.40314603148222056f, - 0.4030262370508143f, - 0.40290643571366275f, - 0.40278662747281785f, - 0.4026668123303333f, - 0.40254699028826135f, - 0.40242716134865586f, - 0.40230732551356924f, - 0.4021874827850557f, - 0.4020676331651679f, - 0.40194777665596026f, - 0.40182791325948564f, - 0.4017080429777987f, - 0.4015881658129526f, - 0.4014682817670021f, - 0.4013483908420007f, - 0.4012284930400034f, - 0.4011085883630639f, - 0.4009886768132375f, - 0.4008687583925781f, - 0.40074883310314113f, - 0.40062890094698084f, - 0.400508961926153f, - 0.4003890160427122f, - 0.4002690632987134f, - 0.4001491036962124f, - 0.400029137237265f, - 0.399909163923926f, - 0.3997891837582519f, - 0.3996691967422977f, - 0.3995492028781203f, - 0.3994292021677748f, - 0.3993091946133182f, - 0.39918918021680605f, - 0.3990691589802955f, - 0.3989491309058424f, - 0.3988290959955041f, - 0.3987090542513365f, - 0.39858900567539707f, - 0.3984689502697431f, - 0.3983488880364309f, - 0.39822881897751855f, - 0.39810874309506256f, - 0.3979886603911212f, - 0.39786857086775124f, - 0.39774847452701123f, - 0.3976283713709582f, - 0.3975082614016508f, - 0.39738814462114636f, - 0.39726802103150377f, - 0.3971478906347806f, - 0.39702775343303565f, - 0.3969076094283278f, - 0.39678745862271486f, - 0.3966673010182564f, - 0.3965471366170106f, - 0.39642696542103706f, - 0.39630678743239417f, - 0.39618660265314193f, - 0.3960664110853389f, - 0.39594621273104535f, - 0.39582600759232f, - 0.3957057956712233f, - 0.3955855769698148f, - 0.3954653514901538f, - 0.3953451192343013f, - 0.3952248802043166f, - 0.39510463440226073f, - 0.3949843818301933f, - 0.3948641224901756f, - 0.3947438563842674f, - 0.3946235835145303f, - 0.3945033038830243f, - 0.3943830174918112f, - 0.3942627243429512f, - 0.39414242443850594f, - 0.39402211778053714f, - 0.3939018043711054f, - 0.393781484212273f, - 0.3936611573061009f, - 0.39354082365465165f, - 0.39342048325998624f, - 0.3933001361241676f, - 0.3931797822492569f, - 0.39305942163731733f, - 0.3929390542904104f, - 0.39281868021059885f, - 0.3926982993999457f, - 0.39257791186051294f, - 0.39245751759436415f, - 0.3923371166035614f, - 0.3922167088901685f, - 0.39209629445624794f, - 0.39197587330386363f, - 0.3918554454350783f, - 0.3917350108519561f, - 0.39161456955656f, - 0.39149412155095437f, - 0.39137366683720237f, - 0.39125320541736835f, - 0.3911327372935167f, - 0.3910122624677109f, - 0.39089178094201604f, - 0.3907712927184961f, - 0.3906507977992152f, - 0.39053029618623886f, - 0.390409787881631f, - 0.39028927288745724f, - 0.39016875120578187f, - 0.3900482228386708f, - 0.3899276877881883f, - 0.3898071460564007f, - 0.38968659764537256f, - 0.38956604255717026f, - 0.3894454807938586f, - 0.38932491235750427f, - 0.3892043372501724f, - 0.3890837554739297f, - 0.38896316703084155f, - 0.38884257192297506f, - 0.38872197015239573f, - 0.3886013617211709f, - 0.3884807466313662f, - 0.388360124885049f, - 0.3882394964842863f, - 0.3881188614311443f, - 0.38799821972769094f, - 0.3878775713759925f, - 0.38775691637811704f, - 0.38763625473613117f, - 0.38751558645210316f, - 0.3873949115280999f, - 0.38727422996618993f, - 0.3871535417684402f, - 0.38703284693691914f, - 0.38691214547369523f, - 0.3867914373808358f, - 0.38667072266041f, - 0.38655000131448547f, - 0.3864292733451315f, - 0.3863085387544159f, - 0.38618779754440824f, - 0.3860670497171766f, - 0.3859462952747908f, - 0.3858255342193191f, - 0.3857047665528315f, - 0.3855839922773965f, - 0.3854632113950843f, - 0.3853424239079638f, - 0.38522162981810537f, - 0.38510082912757837f, - 0.3849800218384523f, - 0.384859207952798f, - 0.3847383874726847f, - 0.38461756040018347f, - 0.38449672673736385f, - 0.3843758864862971f, - 0.384255039649053f, - 0.3841341862277026f, - 0.3840133262243171f, - 0.3838924596409666f, - 0.38377158647972287f, - 0.38365070674265633f, - 0.383529820431839f, - 0.38340892754934136f, - 0.3832880280972358f, - 0.38316712207759296f, - 0.3830462094924854f, - 0.38292529034398415f, - 0.3828043646341619f, - 0.3826834323650899f, - 0.38256249353884064f, - 0.3824415481574868f, - 0.38232059622309994f, - 0.3821996377377534f, - 0.3820786727035189f, - 0.38195770112247f, - 0.38183672299667865f, - 0.3817157383282186f, - 0.38159474711916214f, - 0.3814737493715831f, - 0.3813527450875541f, - 0.38123173426914925f, - 0.3811107169184412f, - 0.3809896930375039f, - 0.3808686626284116f, - 0.3807476256932373f, - 0.38062658223405565f, - 0.38050553225294f, - 0.3803844757519652f, - 0.3802634127332048f, - 0.3801423431987339f, - 0.38002126715062673f, - 0.37990018459095737f, - 0.3797790955218014f, - 0.3796579999452328f, - 0.37953689786332734f, - 0.37941578927815933f, - 0.3792946741918046f, - 0.3791735526063377f, - 0.3790524245238349f, - 0.37893128994637076f, - 0.3788101488760217f, - 0.3786890013148627f, - 0.37856784726497045f, - 0.3784466867284199f, - 0.37832551970728806f, - 0.3782043462036503f, - 0.37808316621958316f, - 0.37796197975716356f, - 0.3778407868184671f, - 0.37771958740557127f, - 0.377598381520552f, - 0.3774771691654868f, - 0.3773559503424519f, - 0.3772347250535252f, - 0.3771134933007829f, - 0.37699225508630324f, - 0.3768710104121627f, - 0.37674975928043924f, - 0.3766285016932108f, - 0.3765072376525544f, - 0.37638596716054856f, - 0.3762646902192705f, - 0.376143406830799f, - 0.37602211699721144f, - 0.3759008207205869f, - 0.3757795180030029f, - 0.37565820884653883f, - 0.37553689325327244f, - 0.3754155712252832f, - 0.3752942427646492f, - 0.37517290787345015f, - 0.37505156655376426f, - 0.3749302188076715f, - 0.3748088646372503f, - 0.37468750404458095f, - 0.374566137031742f, - 0.3744447636008139f, - 0.3743233837538759f, - 0.3742019974930075f, - 0.3740806048202893f, - 0.37395920573780067f, - 0.37383780024762203f, - 0.37371638835183413f, - 0.3735949700525164f, - 0.37347354535175026f, - 0.3733521142516154f, - 0.3732306767541933f, - 0.373109232861564f, - 0.3729877825758092f, - 0.37286632589900914f, - 0.37274486283324565f, - 0.3726233933805993f, - 0.37250191754315215f, - 0.37238043532298487f, - 0.37225894672217946f, - 0.3721374517428179f, - 0.3720159503869813f, - 0.3718944426567523f, - 0.3717729285542121f, - 0.3716514080814436f, - 0.3715298812405282f, - 0.3714083480335491f, - 0.3712868084625879f, - 0.3711652625297279f, - 0.371043710237051f, - 0.3709221515866404f, - 0.37080058658057935f, - 0.37067901522095f, - 0.3705574375098363f, - 0.37043585344932056f, - 0.37031426304148696f, - 0.3701926662884181f, - 0.3700710631921984f, - 0.3699494537549105f, - 0.36982783797863916f, - 0.36970621586546726f, - 0.3695845874174796f, - 0.36946295263676f, - 0.369341311525392f, - 0.3692196640854609f, - 0.36909801031905015f, - 0.36897635022824515f, - 0.36885468381512965f, - 0.3687330110817892f, - 0.36861133203030777f, - 0.36848964666277123f, - 0.3683679549812637f, - 0.36824625698787117f, - 0.36812455268467814f, - 0.3680028420737703f, - 0.3678811251572337f, - 0.3677594019371529f, - 0.36763767241561457f, - 0.3675159365947036f, - 0.36739419447650673f, - 0.3672724460631092f, - 0.367150691356598f, - 0.3670289303590584f, - 0.3669071630725777f, - 0.36678538949924144f, - 0.3666636096411371f, - 0.36654182350035036f, - 0.3664200310789686f, - 0.36629823237907894f, - 0.3661764274027676f, - 0.3660546161521226f, - 0.36593279862923017f, - 0.3658109748361785f, - 0.3656891447750542f, - 0.36556730844794566f, - 0.3654454658569396f, - 0.36532361700412463f, - 0.36520176189158776f, - 0.36507990052141776f, - 0.36495803289570194f, - 0.36483615901652877f, - 0.364714278885987f, - 0.3645923925061646f, - 0.36447049987914965f, - 0.3643486010070316f, - 0.3642266958918982f, - 0.3641047845358392f, - 0.36398286694094273f, - 0.36386094310929856f, - 0.363739013042995f, - 0.36361707674412214f, - 0.36349513421476853f, - 0.36337318545702435f, - 0.3632512304729784f, - 0.3631292692647212f, - 0.36300730183434166f, - 0.3628853281839305f, - 0.36276334831557683f, - 0.3626413622313716f, - 0.36251936993340417f, - 0.3623973714237657f, - 0.3622753667045458f, - 0.3621533557778358f, - 0.3620313386457254f, - 0.36190931531030585f, - 0.36178728577366837f, - 0.3616652500379031f, - 0.3615432081051019f, - 0.361421159977355f, - 0.36129910565675466f, - 0.36117704514539134f, - 0.36105497844535733f, - 0.36093290555874336f, - 0.360810826487642f, - 0.3606887412341442f, - 0.36056664980034225f, - 0.3604445521883286f, - 0.3603224484001945f, - 0.360200338438033f, - 0.3600782223039356f, - 0.35995609999999556f, - 0.3598339715283046f, - 0.35971183689095615f, - 0.35958969609004215f, - 0.3594675491276562f, - 0.3593453960058906f, - 0.3592232367268391f, - 0.35910107129259405f, - 0.35897889970524954f, - 0.3588567219668982f, - 0.3587345380796343f, - 0.358612348045551f, - 0.35849015186674155f, - 0.35836794954530066f, - 0.3582457410833213f, - 0.3581235264828984f, - 0.35800130574612526f, - 0.3578790788750968f, - 0.35775684587190665f, - 0.35763460673864955f, - 0.35751236147742055f, - 0.35739011009031335f, - 0.3572678525794236f, - 0.35714558894684534f, - 0.3570233191946743f, - 0.35690104332500466f, - 0.3567787613399325f, - 0.3566564732415523f, - 0.35653417903196016f, - 0.3564118787132508f, - 0.35628957228752056f, - 0.35616725975686436f, - 0.35604494112337837f, - 0.35592261638915895f, - 0.3558002855563012f, - 0.35567794862690216f, - 0.3555556056030571f, - 0.3554332564868632f, - 0.3553109012804161f, - 0.35518853998581307f, - 0.35506617260514994f, - 0.3549437991405243f, - 0.3548214195940322f, - 0.35469903396777086f, - 0.35457664226383784f, - 0.35445424448432944f, - 0.3543318406313437f, - 0.3542094307069772f, - 0.3540870147133282f, - 0.35396459265249347f, - 0.3538421645265715f, - 0.35371973033765963f, - 0.35359729008785534f, - 0.3534748437792574f, - 0.3533523914139631f, - 0.35322993299407146f, - 0.3531074685216799f, - 0.3529849979988877f, - 0.3528625214277925f, - 0.35274003881049376f, - 0.3526175501490893f, - 0.35249505544567883f, - 0.3523725547023604f, - 0.3522500479212339f, - 0.3521275351043975f, - 0.35200501625395136f, - 0.3518824913719939f, - 0.3517599604606255f, - 0.35163742352194477f, - 0.3515148805580518f, - 0.3513923315710467f, - 0.35126977656302855f, - 0.35114721553609807f, - 0.35102464849235454f, - 0.3509020754338989f, - 0.35077949636283057f, - 0.3506569112812507f, - 0.350534320191259f, - 0.3504117230949569f, - 0.3502891199944441f, - 0.35016651089182194f, - 0.3500438957891916f, - 0.34992127468865325f, - 0.34979864759230883f, - 0.34967601450225866f, - 0.34955337542060483f, - 0.34943073034944794f, - 0.34930807929089036f, - 0.34918542224703275f, - 0.3490627592199777f, - 0.34894009021182615f, - 0.34881741522468085f, - 0.3486947342606429f, - 0.34857204732181535f, - 0.34844935441029956f, - 0.3483266555281986f, - 0.34820395067761406f, - 0.34808123986064937f, - 0.3479585230794062f, - 0.3478358003359882f, - 0.3477130716324977f, - 0.34759033697103725f, - 0.3474675963537107f, - 0.34734484978262037f, - 0.34722209725986986f, - 0.3470993387875629f, - 0.34697657436780216f, - 0.346853804002692f, - 0.34673102769433517f, - 0.34660824544483626f, - 0.34648545725629826f, - 0.34636266313082603f, - 0.3462398630705227f, - 0.3461170570774933f, - 0.3459942451538412f, - 0.3458714273016716f, - 0.3457486035230881f, - 0.3456257738201957f, - 0.3455029381950995f, - 0.34538009664990327f, - 0.3452572491867129f, - 0.3451343958076324f, - 0.3450115365147677f, - 0.3448886713102231f, - 0.3447658001961047f, - 0.34464292317451706f, - 0.34452004024756644f, - 0.3443971514173576f, - 0.3442742566859966f, - 0.34415135605558966f, - 0.34402844952824174f, - 0.34390553710605976f, - 0.34378261879114885f, - 0.3436596945856161f, - 0.3435367644915669f, - 0.34341382851110847f, - 0.34329088664634644f, - 0.34316793889938824f, - 0.3430449852723397f, - 0.3429220257673084f, - 0.34279906038640084f, - 0.3426760891317236f, - 0.3425531120053846f, - 0.34243012900949005f, - 0.34230714014614827f, - 0.3421841454174656f, - 0.34206114482555056f, - 0.34193813837250975f, - 0.3418151260604518f, - 0.34169210789148347f, - 0.3415690838677137f, - 0.3414460539912495f, - 0.3413230182641994f, - 0.341199976688672f, - 0.34107692926677485f, - 0.340953876000617f, - 0.3408308168923062f, - 0.34070775194395186f, - 0.34058468115766183f, - 0.3404616045355457f, - 0.3403385220797115f, - 0.34021543379226915f, - 0.3400923396753268f, - 0.3399692397309945f, - 0.33984613396138075f, - 0.3397230223685953f, - 0.339599904954748f, - 0.33947678172194773f, - 0.3393536526723049f, - 0.3392305178079285f, - 0.33910737713092926f, - 0.33898423064341626f, - 0.3388610783475005f, - 0.3387379202452913f, - 0.33861475633889976f, - 0.33849158663043544f, - 0.3383684111220092f, - 0.33824522981573213f, - 0.33812204271371393f, - 0.3379988498180664f, - 0.3378756511308998f, - 0.3377524466543248f, - 0.3376292363904533f, - 0.33750602034139565f, - 0.3373827985092639f, - 0.33725957089616865f, - 0.33713633750422217f, - 0.33701309833553567f, - 0.33688985339222033f, - 0.33676660267638836f, - 0.33664334619015207f, - 0.33652008393562255f, - 0.3363968159149127f, - 0.33627354213013394f, - 0.33615026258339925f, - 0.33602697727682024f, - 0.33590368621251016f, - 0.33578038939258076f, - 0.3356570868191455f, - 0.33553377849431637f, - 0.33541046442020694f, - 0.33528714459892944f, - 0.3351638190325973f, - 0.33504048772332407f, - 0.3349171506732222f, - 0.3347938078844058f, - 0.33467045935898765f, - 0.3345471050990819f, - 0.3344237451068015f, - 0.334300379384261f, - 0.3341770079335734f, - 0.33405363075685346f, - 0.3339302478562144f, - 0.33380685923377074f, - 0.3336834648916372f, - 0.3335600648319271f, - 0.33343665905675596f, - 0.33331324756823727f, - 0.33318983036848654f, - 0.3330664074596177f, - 0.3329429788437463f, - 0.3328195445229865f, - 0.3326961044994542f, - 0.3325726587752636f, - 0.3324492073525307f, - 0.3323257502333701f, - 0.33220228741989793f, - 0.33207881891422886f, - 0.33195534471847943f, - 0.3318318648347648f, - 0.3317083792652004f, - 0.331584888011903f, - 0.3314613910769877f, - 0.3313378884625714f, - 0.3312143801707695f, - 0.33109086620369904f, - 0.33096734656347565f, - 0.33084382125221623f, - 0.3307202902720377f, - 0.3305967536250559f, - 0.3304732113133885f, - 0.3303496633391515f, - 0.33022610970446264f, - 0.3301025504114382f, - 0.3299789854621962f, - 0.32985541485885295f, - 0.32973183860352673f, - 0.3296082566983341f, - 0.3294846691453935f, - 0.3293610759468216f, - 0.3292374771047367f, - 0.329113872621257f, - 0.3289902624984996f, - 0.3288666467385834f, - 0.32874302534362554f, - 0.3286193983157452f, - 0.32849576565705985f, - 0.32837212736968874f, - 0.3282484834557495f, - 0.3281248339173616f, - 0.32800117875664286f, - 0.3278775179757126f, - 0.32775385157669f, - 0.3276301795616933f, - 0.3275065019328424f, - 0.3273828186922557f, - 0.32725912984205324f, - 0.3271354353843536f, - 0.32701173532127703f, - 0.32688802965494274f, - 0.32676431838746994f, - 0.3266406015209793f, - 0.3265168790575897f, - 0.32639315099942207f, - 0.32626941734859555f, - 0.3261456781072311f, - 0.32602193327744816f, - 0.3258981828613679f, - 0.3257744268611099f, - 0.3256506652787955f, - 0.32552689811654456f, - 0.32540312537647853f, - 0.3252793470607175f, - 0.3251555631713831f, - 0.32503177371059555f, - 0.3249079786804764f, - 0.32478417808314725f, - 0.3246603719207285f, - 0.3245365601953424f, - 0.3244127429091096f, - 0.32428892006415255f, - 0.324165091662592f, - 0.3240412577065506f, - 0.32391741819814945f, - 0.3237935731395112f, - 0.32366972253275716f, - 0.32354586638001026f, - 0.32342200468339194f, - 0.32329813744502495f, - 0.32317426466703214f, - 0.32305038635153516f, - 0.3229265025006576f, - 0.32280261311652114f, - 0.32267871820124955f, - 0.32255481775696493f, - 0.32243091178579103f, - 0.32230700028985015f, - 0.3221830832712663f, - 0.32205916073216195f, - 0.32193523267466134f, - 0.32181129910088707f, - 0.3216873600129635f, - 0.32156341541301353f, - 0.32143946530316175f, - 0.32131550968553113f, - 0.3211915485622465f, - 0.32106758193543145f, - 0.3209436098072097f, - 0.3208196321797063f, - 0.3206956490550448f, - 0.3205716604353504f, - 0.32044766632274674f, - 0.32032366671935897f, - 0.32019966162731206f, - 0.32007565104873004f, - 0.31995163498573864f, - 0.319827613440462f, - 0.31970358641502605f, - 0.31957955391155507f, - 0.31945551593217525f, - 0.319331472479011f, - 0.31920742355418863f, - 0.31908336915983293f, - 0.3189593092980703f, - 0.31883524397102564f, - 0.3187111731808252f, - 0.3185870969295954f, - 0.3184630152194613f, - 0.3183389280525499f, - 0.31821483543098655f, - 0.31809073735689836f, - 0.3179666338324109f, - 0.31784252485965153f, - 0.31771841044074595f, - 0.3175942905778216f, - 0.31747016527300453f, - 0.3173460345284219f, - 0.3172218983462011f, - 0.3170977567284684f, - 0.3169736096773518f, - 0.3168494571949775f, - 0.3167252992834738f, - 0.31660113594496725f, - 0.3164769671815862f, - 0.3163527929954574f, - 0.31622861338870933f, - 0.3161044283634694f, - 0.31598023792186514f, - 0.31585604206602524f, - 0.315731840798077f, - 0.31560763412014936f, - 0.31548342203436974f, - 0.31535920454286737f, - 0.3152349816477698f, - 0.3151107533512064f, - 0.31498651965530494f, - 0.314862280562195f, - 0.3147380360740045f, - 0.31461378619286323f, - 0.3144895309208993f, - 0.31436527026024225f, - 0.31424100421302165f, - 0.31411673278136587f, - 0.31399245596740516f, - 0.31386817377326814f, - 0.3137438862010852f, - 0.31361959325298505f, - 0.31349529493109834f, - 0.3133709912375541f, - 0.3132466821744829f, - 0.3131223677440141f, - 0.31299804794827846f, - 0.31287372278940545f, - 0.31274939226952575f, - 0.3126250563907701f, - 0.3125007151552681f, - 0.3123763685651513f, - 0.3122520166225493f, - 0.3121276593295938f, - 0.31200329668841476f, - 0.311878928701144f, - 0.31175455536991153f, - 0.3116301766968495f, - 0.3115057926840881f, - 0.31138140333375913f, - 0.3112570086479943f, - 0.3111326086289244f, - 0.3110082032786816f, - 0.31088379259939736f, - 0.31075937659320285f, - 0.31063495526223084f, - 0.31051052860861234f, - 0.31038609663448025f, - 0.31026165934196587f, - 0.3101372167332021f, - 0.31001276881032097f, - 0.3098883155754544f, - 0.3097638570307352f, - 0.3096393931782965f, - 0.30951492402027f, - 0.30939044955878925f, - 0.30926596979598636f, - 0.30914148473399505f, - 0.3090169943749475f, - 0.3088924987209777f, - 0.30876799777421793f, - 0.3086434915368023f, - 0.3085189800108635f, - 0.30839446319853525f, - 0.30826994110195166f, - 0.30814541372324544f, - 0.3080208810645513f, - 0.30789634312800207f, - 0.30777179991573267f, - 0.30764725142987615f, - 0.30752269767256757f, - 0.3073981386459402f, - 0.30727357435212915f, - 0.30714900479326807f, - 0.30702442997149215f, - 0.30689984988893515f, - 0.3067752645477322f, - 0.30665067395001827f, - 0.30652607809792753f, - 0.3064014769935957f, - 0.3062768706391569f, - 0.3061522590367471f, - 0.3060276421885006f, - 0.30590302009655357f, - 0.3057783927630405f, - 0.3056537601900977f, - 0.30552912237985985f, - 0.3054044793344635f, - 0.30527983105604345f, - 0.30515517754673643f, - 0.3050305188086778f, - 0.30490585484400334f, - 0.30478118565484974f, - 0.3046565112433525f, - 0.30453183161164865f, - 0.30440714676187375f, - 0.30428245669616505f, - 0.3041577614166582f, - 0.3040330609254907f, - 0.3039083552247984f, - 0.3037836443167186f, - 0.3036589282033885f, - 0.3035342068869443f, - 0.3034094803695239f, - 0.3032847486532636f, - 0.3031600117403015f, - 0.30303526963277405f, - 0.3029105223328195f, - 0.30278576984257466f, - 0.30266101216417785f, - 0.3025362492997659f, - 0.3024114812514775f, - 0.30228670802144963f, - 0.3021619296118207f, - 0.30203714602472914f, - 0.3019123572623123f, - 0.3017875633267092f, - 0.3016627642200573f, - 0.30153795994449584f, - 0.3014131505021625f, - 0.30128833589519666f, - 0.30116351612573616f, - 0.3010386911959206f, - 0.300913861107888f, - 0.30078902586377765f, - 0.30066418546572904f, - 0.3005393399158804f, - 0.3004144892163718f, - 0.30028963336934167f, - 0.30016477237693023f, - 0.30003990624127647f, - 0.2999150349645196f, - 0.29979015854880003f, - 0.29966527699625667f, - 0.2995403903090301f, - 0.2994154984892596f, - 0.2992906015390857f, - 0.29916569946064786f, - 0.299040792256087f, - 0.2989158799275425f, - 0.2987909624771556f, - 0.2986660399070658f, - 0.29854111221941454f, - 0.2984161794163416f, - 0.2982912414999884f, - 0.29816629847249504f, - 0.29804135033600304f, - 0.29791639709265266f, - 0.29779143874458525f, - 0.29766647529394247f, - 0.29754150674286456f, - 0.2974165330934938f, - 0.2972915543479706f, - 0.2971665705084374f, - 0.2970415815770349f, - 0.29691658755590555f, - 0.2967915884471903f, - 0.2966665842530317f, - 0.296541574975571f, - 0.2964165606169509f, - 0.29629154117931267f, - 0.296166516664799f, - 0.29604148707555245f, - 0.29591645241371456f, - 0.29579141268142867f, - 0.2956663678808364f, - 0.2955413180140812f, - 0.29541626308330493f, - 0.29529120309065127f, - 0.29516613803826214f, - 0.29504106792828144f, - 0.2949159927628513f, - 0.2947909125441157f, - 0.2946658272742171f, - 0.29454073695529953f, - 0.2944156415895056f, - 0.2942905411789796f, - 0.29416543572586434f, - 0.29404032523230417f, - 0.29391520970044244f, - 0.2937900891324226f, - 0.2936649635303894f, - 0.29353983289648594f, - 0.2934146972328571f, - 0.2932895565416464f, - 0.2931644108249983f, - 0.29303926008505765f, - 0.2929141043239681f, - 0.29278894354387486f, - 0.2926637777469217f, - 0.2925386069352543f, - 0.2924134311110164f, - 0.29228825027635386f, - 0.2921630644334106f, - 0.29203787358433264f, - 0.2919126777312642f, - 0.29178747687635087f, - 0.2916622710217384f, - 0.29153706016957126f, - 0.2914118443219958f, - 0.2912866234811567f, - 0.2911613976492004f, - 0.29103616682827177f, - 0.2909109310205175f, - 0.2907856902280826f, - 0.2906604444531139f, - 0.29053519369775654f, - 0.2904099379641576f, - 0.2902846772544624f, - 0.29015941157081765f, - 0.29003414091537016f, - 0.28990886529026566f, - 0.2897835846976515f, - 0.28965829913967345f, - 0.28953300861847914f, - 0.2894077131362145f, - 0.28928241269502736f, - 0.28915710729706373f, - 0.2890317969444717f, - 0.28890648163939786f, - 0.28878116138398907f, - 0.28865583618039353f, - 0.2885305060307578f, - 0.2884051709372302f, - 0.2882798309019576f, - 0.2881544859270883f, - 0.2880291360147693f, - 0.2879037811671494f, - 0.28777842138637544f, - 0.28765305667459645f, - 0.28752768703395964f, - 0.28740231246661396f, - 0.28727693297470697f, - 0.28715154856038727f, - 0.2870261592258038f, - 0.28690076497310424f, - 0.28677536580443796f, - 0.28664996172195284f, - 0.28652455272779853f, - 0.286399138824123f, - 0.286273720013076f, - 0.2861482962968057f, - 0.2860228676774621f, - 0.28589743415719354f, - 0.28577199573815004f, - 0.2856465524224802f, - 0.2855211042123339f, - 0.285395651109861f, - 0.2852701931172103f, - 0.28514473023653236f, - 0.28501926246997605f, - 0.2848937898196921f, - 0.2847683122878296f, - 0.28464282987653944f, - 0.28451734258797085f, - 0.2843918504242749f, - 0.28426635338760103f, - 0.28414085148009993f, - 0.2840153447039226f, - 0.283889833061219f, - 0.2837643165541394f, - 0.28363879518483537f, - 0.28351326895545675f, - 0.2833877378681553f, - 0.28326220192508106f, - 0.283136661128386f, - 0.28301111548022023f, - 0.282885564982736f, - 0.28276000963808395f, - 0.2826344494484151f, - 0.28250888441588135f, - 0.2823833145426346f, - 0.28225773983082564f, - 0.28213216028260696f, - 0.2820065759001295f, - 0.281880986685546f, - 0.2817553926410075f, - 0.2816297937686669f, - 0.2815041900706755f, - 0.2813785815491862f, - 0.28125296820635054f, - 0.28112735004432127f, - 0.2810017270652512f, - 0.28087609927129203f, - 0.2807504666645972f, - 0.2806248292473186f, - 0.2804991870216097f, - 0.28037353998962267f, - 0.28024788815351115f, - 0.28012223151542737f, - 0.27999657007752526f, - 0.2798709038419571f, - 0.2797452328108771f, - 0.27961955698643765f, - 0.27949387637079265f, - 0.279368190966096f, - 0.27924250077450047f, - 0.2791168057981605f, - 0.2789911060392291f, - 0.2788654014998609f, - 0.2787396921822089f, - 0.2786139780884281f, - 0.27848825922067155f, - 0.27836253558109436f, - 0.2782368071718499f, - 0.2781110739950933f, - 0.27798533605297826f, - 0.2778595933476599f, - 0.2777338458812926f, - 0.27760809365603034f, - 0.2774823366740289f, - 0.2773565749374421f, - 0.2772308084484258f, - 0.27710503720913404f, - 0.27697926122172273f, - 0.27685348048834624f, - 0.27672769501116057f, - 0.27660190479232016f, - 0.27647610983398085f, - 0.27635031013829847f, - 0.27622450570742785f, - 0.2760986965435253f, - 0.27597288264874575f, - 0.2758470640252459f, - 0.27572124067518067f, - 0.2755954126007069f, - 0.27546957980397974f, - 0.2753437422871562f, - 0.2752179000523916f, - 0.27509205310184265f, - 0.2749662014376661f, - 0.27484034506201754f, - 0.27471448397705434f, - 0.27458861818493224f, - 0.2744627476878088f, - 0.2743368724878399f, - 0.27421099258718323f, - 0.27408510798799485f, - 0.2739592186924326f, - 0.27383332470265276f, - 0.2737074260208133f, - 0.2735815226490706f, - 0.27345561458958245f, - 0.2733297018445066f, - 0.2732037844159998f, - 0.27307786230622033f, - 0.27295193551732505f, - 0.2728260040514725f, - 0.27270006791082013f, - 0.27257412709752527f, - 0.27244818161374684f, - 0.27232223146164203f, - 0.27219627664336976f, - 0.2720703171610874f, - 0.2719443530169541f, - 0.2718183842131273f, - 0.2716924107517664f, - 0.271566432635029f, - 0.2714404498650746f, - 0.27131446244406093f, - 0.2711884703741477f, - 0.2710624736574929f, - 0.2709364722962562f, - 0.2708104662925959f, - 0.27068445564867183f, - 0.2705584403666423f, - 0.270432420448667f, - 0.27030639589690564f, - 0.2701803667135168f, - 0.2700543329006608f, - 0.2699282944604963f, - 0.2698022513951839f, - 0.26967620370688233f, - 0.2695501513977523f, - 0.2694240944699528f, - 0.2692980329256447f, - 0.2691719667669871f, - 0.26904589599614104f, - 0.26891982061526576f, - 0.268793740626522f, - 0.2686676560320706f, - 0.26854156683407104f, - 0.2684154730346847f, - 0.26828937463607133f, - 0.2681632716403924f, - 0.2680371640498079f, - 0.26791105186647934f, - 0.2677849350925669f, - 0.2676588137302324f, - 0.26753268778163597f, - 0.2674065572489397f, - 0.2672804221343038f, - 0.2671542824398906f, - 0.2670281381678605f, - 0.26690198932037573f, - 0.2667758358995975f, - 0.26664967790768707f, - 0.2665235153468068f, - 0.26639734821911765f, - 0.2662711765267824f, - 0.26614500027196203f, - 0.2660188194568194f, - 0.2658926340835157f, - 0.2657664441542136f, - 0.2656402496710757f, - 0.26551405063626343f, - 0.2653878470519401f, - 0.2652616389202673f, - 0.2651354262434083f, - 0.2650092090235251f, - 0.26488298726278103f, - 0.26475676096333817f, - 0.26463053012736015f, - 0.26450429475700904f, - 0.2643780548544483f, - 0.2642518104218415f, - 0.2641255614613508f, - 0.26399930797514043f, - 0.2638730499653728f, - 0.2637467874342122f, - 0.2636205203838212f, - 0.2634942488163643f, - 0.26336797273400414f, - 0.26324169213890536f, - 0.2631154070332309f, - 0.2629891174191454f, - 0.26286282329881205f, - 0.2627365246743952f, - 0.2626102215480594f, - 0.262483913921968f, - 0.26235760179828604f, - 0.2622312851791771f, - 0.2621049640668063f, - 0.2619786384633373f, - 0.2618523083709356f, - 0.2617259737917649f, - 0.26159963472799075f, - 0.26147329118177753f, - 0.26134694315528967f, - 0.261220590650693f, - 0.26109423367015167f, - 0.26096787221583156f, - 0.26084150628989705f, - 0.2607151358945142f, - 0.2605887610318476f, - 0.26046238170406333f, - 0.2603359979133261f, - 0.26020960966180234f, - 0.26008321695165676f, - 0.2599568197850559f, - 0.25983041816416486f, - 0.2597040120911497f, - 0.2595776015681769f, - 0.2594511865974116f, - 0.25932476718102077f, - 0.25919834332116964f, - 0.2590719150200254f, - 0.25894548227975345f, - 0.258819045102521f, - 0.2586926034904938f, - 0.25856615744583905f, - 0.25843970697072266f, - 0.25831325206731215f, - 0.2581867927377734f, - 0.2580603289842737f, - 0.25793386080898045f, - 0.25780738821405974f, - 0.2576809112016795f, - 0.25755442977400606f, - 0.25742794393320745f, - 0.25730145368145013f, - 0.25717495902090237f, - 0.2570484599537307f, - 0.2569219564821036f, - 0.2567954486081877f, - 0.2566689363341512f, - 0.25654241966216224f, - 0.2564158985943882f, - 0.2562893731329966f, - 0.25616284328015626f, - 0.25603630903803437f, - 0.2559097704088f, - 0.25578322739462034f, - 0.2556566799976646f, - 0.25553012822010074f, - 0.25540357206409675f, - 0.255277011531822f, - 0.2551504466254441f, - 0.25502387734713233f, - 0.2548973036990557f, - 0.25477072568338227f, - 0.25464414330228163f, - 0.254517556557922f, - 0.25439096545247325f, - 0.25426436998810353f, - 0.254137770166983f, - 0.25401116599128004f, - 0.25388455746316474f, - 0.2537579445848058f, - 0.25363132735837296f, - 0.2535047057860363f, - 0.2533780798699645f, - 0.25325144961232826f, - 0.25312481501529643f, - 0.25299817608103964f, - 0.2528715328117271f, - 0.25274488520952954f, - 0.2526182332766162f, - 0.2524915770151582f, - 0.2523649164273247f, - 0.25223825151528706f, - 0.25211158228121466f, - 0.2519849087272784f, - 0.25185823085564923f, - 0.2517315486684969f, - 0.25160486216799294f, - 0.2514781713563072f, - 0.2513514762356114f, - 0.2512247768080754f, - 0.2510980730758713f, - 0.25097136504116907f, - 0.2508446527061407f, - 0.25071793607295656f, - 0.2505912151437888f, - 0.2504644899208082f, - 0.2503377604061858f, - 0.250211026602094f, - 0.2500842885107034f, - 0.2499575461341865f, - 0.24983079947471415f, - 0.24970404853445896f, - 0.24957729331559195f, - 0.24945053382028587f, - 0.24932377005071185f, - 0.24919700200904282f, - 0.24907022969745005f, - 0.2489434531181062f, - 0.24881667227318394f, - 0.24868988716485482f, - 0.24856309779529207f, - 0.24843630416666737f, - 0.24830950628115417f, - 0.24818270414092422f, - 0.2480558977481511f, - 0.24792908710500677f, - 0.24780227221366494f, - 0.24767545307629768f, - 0.24754862969507846f, - 0.24742180207218079f, - 0.24729497020977692f, - 0.24716813411004102f, - 0.24704129377514544f, - 0.2469144492072645f, - 0.24678760040857073f, - 0.24666074738123853f, - 0.24653389012744065f, - 0.24640702864935157f, - 0.2462801629491442f, - 0.24615329302899322f, - 0.24602641889107163f, - 0.2458995405375538f, - 0.24577265797061423f, - 0.24564577119242612f, - 0.24551888020516452f, - 0.2453919850110028f, - 0.24526508561211616f, - 0.24513818201067852f, - 0.24501127420886393f, - 0.2448843622088478f, - 0.24475744601280383f, - 0.24463052562290757f, - 0.24450360104133292f, - 0.24437667227025556f, - 0.2442497393118495f, - 0.2441228021682906f, - 0.24399586084175298f, - 0.24386891533441266f, - 0.24374196564844391f, - 0.24361501178602285f, - 0.24348805374932397f, - 0.2433610915405235f, - 0.24323412516179602f, - 0.24310715461531796f, - 0.24298017990326407f, - 0.2428532010278104f, - 0.2427262179911332f, - 0.2425992307954074f, - 0.24247223944280974f, - 0.24234524393551535f, - 0.2422182442757011f, - 0.24209124046554223f, - 0.2419642325072158f, - 0.24183722040289718f, - 0.24171020415476357f, - 0.24158318376499047f, - 0.24145615923575522f, - 0.24132913056923347f, - 0.24120209776760226f, - 0.24107506083303873f, - 0.2409480197677187f, - 0.2408209745738199f, - 0.24069392525351832f, - 0.24056687180899178f, - 0.24043981424241645f, - 0.24031275255597032f, - 0.24018568675182964f, - 0.24005861683217256f, - 0.23993154279917547f, - 0.23980446465501667f, - 0.23967738240187272f, - 0.239550296041922f, - 0.23942320557734126f, - 0.23929611101030898f, - 0.2391690123430025f, - 0.2390419095775992f, - 0.23891480271627774f, - 0.23878769176121528f, - 0.23866057671459065f, - 0.2385334575785811f, - 0.23840633435536562f, - 0.2382792070471216f, - 0.23815207565602772f, - 0.2380249401842628f, - 0.2378978006340044f, - 0.23777065700743188f, - 0.23764350930672296f, - 0.23751635753405714f, - 0.2373892016916123f, - 0.237262041781568f, - 0.23713487780610232f, - 0.23700770976739502f, - 0.23688053766762418f, - 0.23675336150896933f, - 0.23662618129361002f, - 0.2364989970237246f, - 0.23637180870149319f, - 0.23624461632909427f, - 0.23611741990870808f, - 0.23599021944251328f, - 0.23586301493269024f, - 0.23573580638141775f, - 0.23560859379087631f, - 0.23548137716324488f, - 0.23535415650070407f, - 0.23522693180543294f, - 0.2350997030796119f, - 0.23497247032542137f, - 0.2348452335450406f, - 0.23471799274065067f, - 0.23459074791443088f, - 0.23446349906856245f, - 0.2343362462052249f, - 0.23420898932659948f, - 0.2340817284348663f, - 0.23395446353220553f, - 0.23382719462079865f, - 0.23369992170282552f, - 0.23357264478046783f, - 0.23344536385590553f, - 0.2333180789313204f, - 0.23319079000889262f, - 0.23306349709080407f, - 0.23293620017923503f, - 0.23280889927636755f, - 0.23268159438438207f, - 0.23255428550546076f, - 0.23242697264178414f, - 0.23229965579553458f, - 0.23217233496889275f, - 0.23204501016404067f, - 0.2319176813831605f, - 0.23179034862843303f, - 0.23166301190204103f, - 0.23153567120616544f, - 0.23140832654298915f, - 0.23128097791469324f, - 0.2311536253234607f, - 0.2310262687714728f, - 0.23089890826091264f, - 0.23077154379396164f, - 0.23064417537280257f, - 0.2305168029996183f, - 0.23038942667659046f, - 0.23026204640590245f, - 0.23013466218973608f, - 0.23000727403027485f, - 0.2298798819297007f, - 0.2297524858901973f, - 0.22962508591394673f, - 0.22949768200313275f, - 0.22937027415993758f, - 0.22924286238654512f, - 0.22911544668513775f, - 0.22898802705789953f, - 0.22886060350701287f, - 0.22873317603466206f, - 0.22860574464302963f, - 0.22847830933429994f, - 0.22835087011065575f, - 0.2282234269742815f, - 0.22809597992736005f, - 0.22796852897207603f, - 0.22784107411061288f, - 0.22771361534515405f, - 0.22758615267788393f, - 0.227458686110987f, - 0.2273312156466465f, - 0.22720374128704746f, - 0.22707626303437328f, - 0.2269487808908091f, - 0.22682129485853844f, - 0.2266938049397466f, - 0.22656631113661727f, - 0.2264388134513358f, - 0.226311311886086f, - 0.22618380644305344f, - 0.22605629712442205f, - 0.22592878393237706f, - 0.22580126686910384f, - 0.2256737459367865f, - 0.22554622113761089f, - 0.2254186924737613f, - 0.22529115994742374f, - 0.2251636235607826f, - 0.225036083316024f, - 0.22490853921533252f, - 0.2247809912608944f, - 0.22465343945489427f, - 0.2245258837995186f, - 0.22439832429695214f, - 0.224270760949381f, - 0.22414319375899142f, - 0.2240156227279683f, - 0.22388804785849845f, - 0.22376046915276696f, - 0.2236328866129607f, - 0.22350530024126494f, - 0.22337771003986667f, - 0.22325011601095124f, - 0.22312251815670583f, - 0.2229949164793159f, - 0.22286731098096876f, - 0.2227397016638505f, - 0.22261208853014713f, - 0.22248447158204623f, - 0.22235685082173356f, - 0.2222292262513968f, - 0.2221015978732218f, - 0.2219739656893964f, - 0.22184632970210663f, - 0.22171868991354035f, - 0.22159104632588378f, - 0.22146339894132494f, - 0.22133574776205017f, - 0.22120809279024714f, - 0.22108043402810362f, - 0.2209527714778062f, - 0.22082510514154313f, - 0.22069743502150113f, - 0.22056976111986862f, - 0.22044208343883243f, - 0.2203144019805811f, - 0.22018671674730161f, - 0.22005902774118263f, - 0.21993133496441125f, - 0.21980363841917586f, - 0.21967593810766492f, - 0.2195482340320657f, - 0.21942052619456723f, - 0.21929281459735692f, - 0.21916509924262387f, - 0.21903738013255564f, - 0.2189096572693415f, - 0.2187819306551691f, - 0.21865420029222787f, - 0.21852646618270555f, - 0.2183987283287917f, - 0.2182709867326742f, - 0.21814324139654231f, - 0.21801549232258535f, - 0.2178877395129914f, - 0.21775998296995033f, - 0.2176322226956508f, - 0.21750445869228147f, - 0.21737669096203244f, - 0.2172489195070921f, - 0.21712114432965068f, - 0.21699336543189665f, - 0.21686558281602036f, - 0.21673779648421046f, - 0.2166100064386574f, - 0.21648221268155f, - 0.21635441521507878f, - 0.21622661404143267f, - 0.21609880916280239f, - 0.21597100058137697f, - 0.2158431882993472f, - 0.2157153723189023f, - 0.21558755264223323f, - 0.2154597292715292f, - 0.2153319022089814f, - 0.2152040714567792f, - 0.21507623701711334f, - 0.2149483988921747f, - 0.2148205570841529f, - 0.2146927115952393f, - 0.2145648624276237f, - 0.21443700958349754f, - 0.21430915306505074f, - 0.21418129287447493f, - 0.2140534290139601f, - 0.21392556148569802f, - 0.2137976902918788f, - 0.21366981543469393f, - 0.21354193691633494f, - 0.2134140547389921f, - 0.21328616890485755f, - 0.21315827941612164f, - 0.21303038627497667f, - 0.21290248948361312f, - 0.2127745890442234f, - 0.2126466849589981f, - 0.21251877723012977f, - 0.21239086585980915f, - 0.2122629508502289f, - 0.21213503220357985f, - 0.2120071099220548f, - 0.21187918400784472f, - 0.21175125446314255f, - 0.2116233212901394f, - 0.21149538449102823f, - 0.21136744406800076f, - 0.21123950002324884f, - 0.2111115523589656f, - 0.2109836010773425f, - 0.2108556461805728f, - 0.21072768767084815f, - 0.21059972555036194f, - 0.2104717598213059f, - 0.21034379048587312f, - 0.21021581754625673f, - 0.2100878410046487f, - 0.20995986086324267f, - 0.20983187712423074f, - 0.2097038897898067f, - 0.20957589886216274f, - 0.20944790434349278f, - 0.20931990623598917f, - 0.2091919045418459f, - 0.20906389926325547f, - 0.20893589040241162f, - 0.20880787796150813f, - 0.20867986194273763f, - 0.20855184234829452f, - 0.2084238191803715f, - 0.20829579244116309f, - 0.20816776213286212f, - 0.2080397282576632f, - 0.20791169081775931f, - 0.2077836498153452f, - 0.20765560525261395f, - 0.20752755713176044f, - 0.20739950545497787f, - 0.2072714502244608f, - 0.2071433914424039f, - 0.20701532911100048f, - 0.20688726323244575f, - 0.20675919380893323f, - 0.20663112084265825f, - 0.20650304433581437f, - 0.20637496429059704f, - 0.20624688070920047f, - 0.20611879359381888f, - 0.2059907029466479f, - 0.2058626087698814f, - 0.2057345110657152f, - 0.20560640983634326f, - 0.20547830508396148f, - 0.20535019681076402f, - 0.20522208501894687f, - 0.2050939697107043f, - 0.20496585088823235f, - 0.20483772855372553f, - 0.20470960270938002f, - 0.2045814733573903f, - 0.20445334049995276f, - 0.20432520413926203f, - 0.2041970642775141f, - 0.2040689209169051f, - 0.20394077405962985f, - 0.20381262370788494f, - 0.20368446986386535f, - 0.20355631252976786f, - 0.2034281517077875f, - 0.20329998740012115f, - 0.203171819608964f, - 0.20304364833651303f, - 0.2029154735849636f, - 0.20278729535651233f, - 0.20265911365335598f, - 0.20253092847769003f, - 0.20240273983171178f, - 0.20227454771761683f, - 0.20214635213760257f, - 0.20201815309386476f, - 0.2018899505886009f, - 0.20176174462400684f, - 0.20163353520228025f, - 0.20150532232561705f, - 0.20137710599621506f, - 0.2012488862162703f, - 0.20112066298798068f, - 0.20099243631354238f, - 0.20086420619515347f, - 0.20073597263501017f, - 0.20060773563531067f, - 0.20047949519825137f, - 0.20035125132603052f, - 0.2002230040208451f, - 0.20009475328489218f, - 0.19996649912037015f, - 0.19983824152947574f, - 0.19970998051440705f, - 0.19958171607736225f, - 0.1994534482205382f, - 0.19932517694613366f, - 0.19919690225634562f, - 0.1990686241533729f, - 0.19894034263941265f, - 0.19881205771666383f, - 0.19868376938732366f, - 0.19855547765359122f, - 0.1984271825176639f, - 0.1982988839817408f, - 0.1981705820480195f, - 0.1980422767186988f, - 0.19791396799597763f, - 0.19778565588205366f, - 0.19765734037912633f, - 0.19752902148939344f, - 0.19740069921505457f, - 0.19727237355830762f, - 0.19714404452135226f, - 0.19701571210638655f, - 0.19688737631561026f, - 0.19675903715122153f, - 0.19663069461541985f, - 0.19650234871040478f, - 0.19637399943837464f, - 0.19624564680152948f, - 0.19611729080206775f, - 0.19598893144218965f, - 0.19586056872409374f, - 0.19573220264998034f, - 0.19560383322204808f, - 0.19547546044249742f, - 0.19534708431352713f, - 0.19521870483733775f, - 0.1950903220161286f, - 0.19496193585209906f, - 0.19483354634744984f, - 0.19470515350438003f, - 0.19457675732509044f, - 0.19444835781178024f, - 0.1943199549666504f, - 0.1941915487919002f, - 0.1940631392897307f, - 0.1939347264623413f, - 0.1938063103119332f, - 0.19367789084070589f, - 0.19354946805086068f, - 0.1934210419445972f, - 0.19329261252411642f, - 0.19316417979161937f, - 0.19303574374930585f, - 0.19290730439937745f, - 0.19277886174403408f, - 0.19265041578547742f, - 0.1925219665259075f, - 0.19239351396752613f, - 0.19226505811253344f, - 0.19213659896313134f, - 0.1920081365215201f, - 0.19187967078990134f, - 0.19175120177047666f, - 0.19162272946544653f, - 0.19149425387701313f, - 0.19136577500737698f, - 0.19123729285874042f, - 0.19110880743330405f, - 0.19098031873327037f, - 0.19085182676084006f, - 0.19072333151821572f, - 0.19059483300759816f, - 0.19046633123119008f, - 0.1903378261911924f, - 0.19020931788980755f, - 0.19008080632923782f, - 0.18995229151168438f, - 0.18982377343935022f, - 0.18969525211443697f, - 0.18956672753914636f, - 0.18943819971568154f, - 0.18930966864624393f, - 0.1891811343330367f, - 0.18905259677826142f, - 0.1889240559841214f, - 0.1887955119528183f, - 0.18866696468655553f, - 0.18853841418753486f, - 0.18840986045795985f, - 0.1882813035000323f, - 0.18815274331595597f, - 0.18802417990793274f, - 0.18789561327816645f, - 0.18776704342885914f, - 0.18763847036221468f, - 0.1875098940804353f, - 0.18738131458572502f, - 0.18725273188028604f, - 0.18712414596632213f, - 0.18699555684603697f, - 0.186866964521633f, - 0.1867383689953145f, - 0.1866097702692841f, - 0.18648116834574613f, - 0.18635256322690327f, - 0.18622395491496005f, - 0.1860953434121192f, - 0.18596672872058537f, - 0.18583811084256144f, - 0.1857094897802517f, - 0.18558086553586045f, - 0.18545223811159078f, - 0.18532360750964755f, - 0.18519497373223393f, - 0.18506633678155487f, - 0.18493769665981374f, - 0.18480905336921555f, - 0.18468040691196375f, - 0.18455175729026346f, - 0.18442310450631827f, - 0.18429444856233343f, - 0.18416578946051257f, - 0.18403712720306112f, - 0.18390846179218276f, - 0.183779793230083f, - 0.18365112151896618f, - 0.18352244666103654f, - 0.18339376865849982f, - 0.18326508751355997f, - 0.18313640322842278f, - 0.18300771580529238f, - 0.18287902524637464f, - 0.18275033155387377f, - 0.18262163472999535f, - 0.18249293477694498f, - 0.18236423169692706f, - 0.18223552549214772f, - 0.18210681616481145f, - 0.1819781037171245f, - 0.1818493881512915f, - 0.1817206694695188f, - 0.18159194767401104f, - 0.1814632227669748f, - 0.1813344947506148f, - 0.18120576362713767f, - 0.1810770293987483f, - 0.18094829206765295f, - 0.18081955163605795f, - 0.18069080810616833f, - 0.18056206148019097f, - 0.18043331176033103f, - 0.18030455894879546f, - 0.18017580304778957f, - 0.1800470440595204f, - 0.17991828198619333f, - 0.17978951683001554f, - 0.17966074859319253f, - 0.17953197727793113f, - 0.1794032028864382f, - 0.17927442542091948f, - 0.1791456448835823f, - 0.1790168612766325f, - 0.17888807460227754f, - 0.17875928486272333f, - 0.1786304920601775f, - 0.17850169619684647f, - 0.17837289727493666f, - 0.17824409529665586f, - 0.17811529026421022f, - 0.17798648217980761f, - 0.1778576710456543f, - 0.17772885686395828f, - 0.1776000396369259f, - 0.17747121936676521f, - 0.17734239605568272f, - 0.17721356970588661f, - 0.17708474031958343f, - 0.1769559078989815f, - 0.17682707244628745f, - 0.17669823396370973f, - 0.17656939245345507f, - 0.17644054791773203f, - 0.1763117003587474f, - 0.17618284977870943f, - 0.17605399617982637f, - 0.1759251395643052f, - 0.17579627993435473f, - 0.17566741729218205f, - 0.1755385516399961f, - 0.17540968298000403f, - 0.17528081131441486f, - 0.17515193664543593f, - 0.1750230589752763f, - 0.17489417830614343f, - 0.17476529464024604f, - 0.174636407979793f, - 0.17450751832699185f, - 0.17437862568405194f, - 0.17424973005318095f, - 0.17412083143658835f, - 0.17399192983648193f, - 0.1738630252550712f, - 0.1737341176945641f, - 0.17360520715717023f, - 0.17347629364509762f, - 0.17334737716055604f, - 0.17321845770575353f, - 0.17308953528289997f, - 0.17296060989420356f, - 0.17283168154187425f, - 0.17270275022812034f, - 0.17257381595515192f, - 0.17244487872517733f, - 0.17231593854040678f, - 0.17218699540304916f, - 0.17205804931531346f, - 0.17192910027941002f, - 0.17180014829754744f, - 0.17167119337193573f, - 0.17154223550478495f, - 0.17141327469830386f, - 0.17128431095470306f, - 0.17115534427619145f, - 0.17102637466497966f, - 0.17089740212327673f, - 0.17076842665329342f, - 0.1706394482572388f, - 0.1705104669373238f, - 0.17038148269575754f, - 0.17025249553475108f, - 0.17012350545651364f, - 0.1699945124632559f, - 0.16986551655718857f, - 0.16973651774052104f, - 0.1696075160154646f, - 0.16947851138422873f, - 0.1693495038490248f, - 0.16922049341206244f, - 0.16909148007555308f, - 0.16896246384170646f, - 0.1688334447127341f, - 0.16870442269084585f, - 0.16857539777825287f, - 0.16844636997716644f, - 0.16831733928979653f, - 0.16818830571835494f, - 0.16805926926505171f, - 0.16793022993209875f, - 0.1678011877217062f, - 0.16767214263608612f, - 0.1675430946774487f, - 0.1674140438480061f, - 0.16728499014996862f, - 0.16715593358554845f, - 0.16702687415695655f, - 0.16689781186640382f, - 0.16676874671610262f, - 0.16663967870826357f, - 0.16651060784509908f, - 0.16638153412881984f, - 0.16625245756163845f, - 0.16612337814576564f, - 0.16599429588341408f, - 0.16586521077679467f, - 0.1657361228281201f, - 0.16560703203960145f, - 0.16547793841345101f, - 0.16534884195188124f, - 0.1652197426571033f, - 0.16509064053133016f, - 0.16496153557677304f, - 0.164832427795645f, - 0.16470331719015743f, - 0.16457420376252344f, - 0.16444508751495449f, - 0.16431596844966384f, - 0.164186846568863f, - 0.16405772187476536f, - 0.16392859436958254f, - 0.16379946405552756f, - 0.16367033093481342f, - 0.16354119500965195f, - 0.16341205628225675f, - 0.16328291475483964f, - 0.16315377042961435f, - 0.16302462330879283f, - 0.1628954733945889f, - 0.16276632068921457f, - 0.16263716519488378f, - 0.16250800691380865f, - 0.16237884584820314f, - 0.16224968200027956f, - 0.1621205153722515f, - 0.16199134596633266f, - 0.16186217378473589f, - 0.161732998829674f, - 0.16160382110336138f, - 0.16147464060801048f, - 0.16134545734583566f, - 0.1612162713190496f, - 0.1610870825298667f, - 0.16095789098049973f, - 0.1608286966731632f, - 0.16069949961007002f, - 0.16057029979343473f, - 0.16044109722547029f, - 0.16031189190839146f, - 0.1601826838444112f, - 0.16005347303574438f, - 0.15992425948460412f, - 0.15979504319320528f, - 0.15966582416376113f, - 0.15953660239848666f, - 0.15940737789959517f, - 0.15927815066930176f, - 0.15914892070981984f, - 0.15901968802336414f, - 0.15889045261214949f, - 0.15876121447838942f, - 0.1586319736242993f, - 0.1585027300520927f, - 0.15837348376398508f, - 0.15824423476219018f, - 0.1581149830489235f, - 0.15798572862639884f, - 0.15785647149683188f, - 0.15772721166243647f, - 0.15759794912542788f, - 0.1574686838880215f, - 0.15733941595243128f, - 0.15721014532087313f, - 0.15708087199556114f, - 0.15695159597871133f, - 0.15682231727253787f, - 0.15669303587925681f, - 0.15656375180108248f, - 0.15643446504023098f, - 0.15630517559891677f, - 0.15617588347935601f, - 0.15604658868376328f, - 0.15591729121435483f, - 0.15578799107334526f, - 0.155658688262951f, - 0.1555293827853872f, - 0.15540007464286898f, - 0.1552707638376129f, - 0.1551414503718338f, - 0.15501213424774832f, - 0.15488281546757132f, - 0.15475349403351957f, - 0.1546241699478081f, - 0.15449484321265322f, - 0.1543655138302714f, - 0.15423618180287774f, - 0.1541068471326892f, - 0.15397750982192107f, - 0.15384816987279032f, - 0.15371882728751232f, - 0.15358948206830417f, - 0.1534601342173813f, - 0.15333078373696093f, - 0.1532014306292586f, - 0.15307207489649152f, - 0.1529427165408754f, - 0.15281335556462713f, - 0.15268399196996374f, - 0.15255462575910098f, - 0.15242525693425632f, - 0.15229588549764567f, - 0.15216651145148657f, - 0.15203713479799497f, - 0.1519077555393886f, - 0.1517783736778834f, - 0.15164898921569725f, - 0.15151960215504617f, - 0.15139021249814769f, - 0.1512608202472192f, - 0.15113142540447702f, - 0.15100202797213913f, - 0.15087262795242182f, - 0.15074322534754325f, - 0.1506138201597198f, - 0.15048441239116966f, - 0.1503550020441098f, - 0.15022558912075712f, - 0.15009617362333f, - 0.14996675555404507f, - 0.14983733491512075f, - 0.1497079117087737f, - 0.1495784859372225f, - 0.1494490576026839f, - 0.14931962670737653f, - 0.14919019325351723f, - 0.14906075724332474f, - 0.148931318679016f, - 0.14880187756280977f, - 0.14867243389692314f, - 0.14854298768357496f, - 0.14841353892498238f, - 0.14828408762336392f, - 0.1481546337809381f, - 0.14802517739992221f, - 0.14789571848253535f, - 0.14776625703099489f, - 0.14763679304751995f, - 0.147507326534328f, - 0.1473778574936383f, - 0.1472483859276684f, - 0.14711891183863762f, - 0.14698943522876362f, - 0.14685995610026578f, - 0.1467304744553618f, - 0.14660099029627083f, - 0.1464715036252119f, - 0.1463420144444029f, - 0.14621252275606345f, - 0.14608302856241148f, - 0.14595353186566676f, - 0.14582403266804722f, - 0.14569453097177273f, - 0.14556502677906138f, - 0.14543552009213306f, - 0.14530601091320594f, - 0.14517649924450005f, - 0.14504698508823358f, - 0.14491746844662667f, - 0.14478794932189767f, - 0.1446584277162667f, - 0.1445289036319522f, - 0.14439937707117442f, - 0.14426984803615234f, - 0.14414031652910494f, - 0.1440107825522526f, - 0.14388124610781397f, - 0.1437517071980095f, - 0.14362216582505793f, - 0.14349262199117935f, - 0.14336307569859388f, - 0.1432335269495204f, - 0.1431039757461796f, - 0.1429744220907904f, - 0.1428448659855735f, - 0.142715307432748f, - 0.1425857464345347f, - 0.1424561829931527f, - 0.14232661711082295f, - 0.14219704878976464f, - 0.1420674780321987f, - 0.14193790484034452f, - 0.14180832921642267f, - 0.14167875116265385f, - 0.14154917068125747f, - 0.14141958777445474f, - 0.1412900024444651f, - 0.1411604146935099f, - 0.14103082452380872f, - 0.14090123193758286f, - 0.14077163693705205f, - 0.14064203952443768f, - 0.14051243970195954f, - 0.1403828374718387f, - 0.14025323283629632f, - 0.14012362579755222f, - 0.1399940163578281f, - 0.1398644045193439f, - 0.13973479028432134f, - 0.13960517365498049f, - 0.1394755546335431f, - 0.13934593322222935f, - 0.1392163094232611f, - 0.1390866832388586f, - 0.13895705467124375f, - 0.13882742372263734f, - 0.1386977903952601f, - 0.1385681546913341f, - 0.13843851661307977f, - 0.1383088761627193f, - 0.13817923334247317f, - 0.13804958815456367f, - 0.1379199406012113f, - 0.13779029068463847f, - 0.13766063840706577f, - 0.13753098377071568f, - 0.1374013267778089f, - 0.13727166743056748f, - 0.1371420057312136f, - 0.13701234168196805f, - 0.13688267528505346f, - 0.1367530065426908f, - 0.13662333545710273f, - 0.1364936620305103f, - 0.1363639862651363f, - 0.13623430816320176f, - 0.1361046277269296f, - 0.13597494495854098f, - 0.13584525986025886f, - 0.13571557243430446f, - 0.13558588268290042f, - 0.13545619060826933f, - 0.13532649621263257f, - 0.13519679949821328f, - 0.13506710046723294f, - 0.13493739912191477f, - 0.13480769546448026f, - 0.13467798949715276f, - 0.13454828122215384f, - 0.13441857064170692f, - 0.13428885775803368f, - 0.13415914257335712f, - 0.13402942508990034f, - 0.13389970530988515f, - 0.1337699832355351f, - 0.13364025886907255f, - 0.1335105322127198f, - 0.1333808032687006f, - 0.13325107203923695f, - 0.1331213385265526f, - 0.13299160273286964f, - 0.13286186466041194f, - 0.1327321243114021f, - 0.1326023816880627f, - 0.13247263679261734f, - 0.13234288962728957f, - 0.1322131401943017f, - 0.1320833884958778f, - 0.13195363453424033f, - 0.1318238783116134f, - 0.13169411983021947f, - 0.13156435909228284f, - 0.13143459610002603f, - 0.13130483085567335f, - 0.1311750633614474f, - 0.13104529361957223f, - 0.13091552163227177f, - 0.13078574740176876f, - 0.13065597093028777f, - 0.13052619222005157f, - 0.13039641127328475f, - 0.13026662809221023f, - 0.13013684267905268f, - 0.13000705503603502f, - 0.12987726516538203f, - 0.12974747306931678f, - 0.12961767875006405f, - 0.129487882209847f, - 0.12935808345089006f, - 0.12922828247541773f, - 0.12909847928565327f, - 0.12896867388382166f, - 0.12883886627214625f, - 0.1287090564528521f, - 0.12857924442816263f, - 0.12844943020030294f, - 0.12831961377149656f, - 0.1281897951439687f, - 0.12805997431994287f, - 0.12793015130164442f, - 0.12780032609129696f, - 0.12767049869112587f, - 0.1275406691033553f, - 0.12741083733020936f, - 0.1272810033739136f, - 0.1271511672366918f, - 0.1270213289207695f, - 0.12689148842837064f, - 0.12676164576172083f, - 0.12663180092304405f, - 0.12650195391456598f, - 0.12637210473851068f, - 0.12624225339710352f, - 0.12611239989256987f, - 0.1259825442271339f, - 0.1258526864030215f, - 0.12572282642245686f, - 0.12559296428766603f, - 0.1254631000008732f, - 0.12533323356430454f, - 0.1252033649801843f, - 0.12507349425073871f, - 0.12494362137819212f, - 0.12481374636477077f, - 0.12468386921269917f, - 0.12455398992420315f, - 0.12442410850150859f, - 0.12429422494684012f, - 0.12416433926242412f, - 0.12403445145048526f, - 0.12390456151325004f, - 0.12377466945294319f, - 0.12364477527179125f, - 0.12351487897201906f, - 0.12338498055585323f, - 0.12325508002551865f, - 0.12312517738324155f, - 0.12299527263124826f, - 0.12286536577176377f, - 0.12273545680701485f, - 0.1226055457392266f, - 0.12247563257062591f, - 0.12234571730343788f, - 0.12221579993988949f, - 0.12208588048220638f, - 0.12195595893261424f, - 0.12182603529334014f, - 0.12169610956660941f, - 0.12156618175464914f, - 0.12143625185968476f, - 0.12130631988394346f, - 0.12117638582965069f, - 0.12104644969903373f, - 0.12091651149431812f, - 0.12078657121773118f, - 0.12065662887149854f, - 0.1205266844578476f, - 0.12039673797900405f, - 0.12026678943719535f, - 0.12013683883464728f, - 0.12000688617358692f, - 0.11987693145624143f, - 0.11974697468483667f, - 0.11961701586160028f, - 0.11948705498875821f, - 0.11935709206853817f, - 0.11922712710316616f, - 0.11909716009486998f, - 0.11896719104587569f, - 0.11883721995841118f, - 0.11870724683470256f, - 0.11857727167697776f, - 0.11844729448746302f, - 0.1183173152683859f, - 0.11818733402197397f, - 0.11805735075045357f, - 0.1179273654560528f, - 0.11779737814099804f, - 0.11766738880751747f, - 0.11753739745783755f, - 0.1174074040941865f, - 0.11727740871879087f, - 0.11714741133387897f, - 0.11701741194167738f, - 0.11688741054441448f, - 0.11675740714431695f, - 0.11662740174361325f, - 0.11649739434453006f, - 0.11636738494929594f, - 0.11623737356013768f, - 0.11610736017928387f, - 0.11597734480896181f, - 0.11584732745139883f, - 0.11571730810882364f, - 0.1155872867834632f, - 0.11545726347754626f, - 0.11532723819329986f, - 0.1151972109329524f, - 0.11506718169873228f, - 0.11493715049286667f, - 0.11480711731758446f, - 0.11467708217511288f, - 0.11454704506768092f, - 0.11441700599751584f, - 0.11428696496684672f, - 0.11415692197790088f, - 0.11402687703290748f, - 0.1138968301340939f, - 0.11376678128368935f, - 0.11363673048392128f, - 0.11350667773701854f, - 0.11337662304521f, - 0.1132465664107232f, - 0.11311650783578753f, - 0.1129864473226306f, - 0.11285638487348187f, - 0.11272632049056903f, - 0.1125962541761216f, - 0.11246618593236732f, - 0.11233611576153577f, - 0.11220604366585478f, - 0.11207596964755355f, - 0.1119458937088613f, - 0.11181581585200596f, - 0.11168573607921727f, - 0.11155565439272322f, - 0.11142557079475361f, - 0.11129548528753652f, - 0.11116539787330178f, - 0.11103530855427755f, - 0.11090521733269375f, - 0.11077512421077901f, - 0.110645029190762f, - 0.11051493227487273f, - 0.11038483346533953f, - 0.11025473276439247f, - 0.11012463017425991f, - 0.10999452569717201f, - 0.10986441933535718f, - 0.10973431109104564f, - 0.1096042009664659f, - 0.10947408896384822f, - 0.10934397508542117f, - 0.10921385933341507f, - 0.10908374171005857f, - 0.10895362221758162f, - 0.10882350085821423f, - 0.10869337763418511f, - 0.10856325254772477f, - 0.108433125601062f, - 0.10830299679642734f, - 0.10817286613604965f, - 0.10804273362215958f, - 0.107912599256986f, - 0.10778246304275962f, - 0.10765232498170943f, - 0.10752218507606617f, - 0.10739204332805888f, - 0.10726189973991794f, - 0.10713175431387377f, - 0.10700160705215549f, - 0.10687145795699401f, - 0.10674130703061854f, - 0.10661115427526005f, - 0.1064809996931478f, - 0.10635084328651281f, - 0.10622068505758443f, - 0.10609052500859374f, - 0.10596036314177013f, - 0.10583019945934431f, - 0.10570003396354707f, - 0.10556986665660831f, - 0.10543969754075795f, - 0.1053095266182273f, - 0.10517935389124593f, - 0.10504917936204518f, - 0.10491900303285467f, - 0.10478882490590585f, - 0.10465864498342838f, - 0.10452846326765373f, - 0.10439827976081212f, - 0.10426809446513374f, - 0.10413790738284973f, - 0.10400771851619126f, - 0.10387752786738817f, - 0.10374733543867216f, - 0.10361714123227315f, - 0.10348694525042286f, - 0.10335674749535127f, - 0.10322654796929018f, - 0.10309634667446964f, - 0.1029661436131215f, - 0.10283593878747585f, - 0.10270573219976417f, - 0.10257552385221796f, - 0.10244531374706743f, - 0.10231510188654457f, - 0.10218488827287962f, - 0.10205467290830467f, - 0.10192445579505002f, - 0.10179423693534781f, - 0.10166401633142841f, - 0.10153379398552398f, - 0.101403569899865f, - 0.10127334407668367f, - 0.10114311651821052f, - 0.10101288722667738f, - 0.10088265620431616f, - 0.10075242345335744f, - 0.1006221889760336f, - 0.1004919527745753f, - 0.10036171485121498f, - 0.10023147520818333f, - 0.1001012338477129f, - 0.0999709907720344f, - 0.09984074598338044f, - 0.09971049948398183f, - 0.0995802512760712f, - 0.09945000136187941f, - 0.09931974974363916f, - 0.09918949642358184f, - 0.09905924140393883f, - 0.09892898468694294f, - 0.09879872627482518f, - 0.09866846616981839f, - 0.09853820437415363f, - 0.09840794089006381f, - 0.09827767571978006f, - 0.09814740886553533f, - 0.09801714032956083f, - 0.09788687011408911f, - 0.09775659822135276f, - 0.09762632465358305f, - 0.0974960494130131f, - 0.09736577250187424f, - 0.09723549392239961f, - 0.09710521367682062f, - 0.09697493176737047f, - 0.09684464819628062f, - 0.09671436296578433f, - 0.09658407607811312f, - 0.0964537875355003f, - 0.09632349734017745f, - 0.09619320549437749f, - 0.09606291200033339f, - 0.09593261686027679f, - 0.09580232007644117f, - 0.09567202165105823f, - 0.0955417215863615f, - 0.09541141988458272f, - 0.0952811165479555f, - 0.09515081157871164f, - 0.09502050497908476f, - 0.09489019675130676f, - 0.09475988689761089f, - 0.09462957542023039f, - 0.09449926232139724f, - 0.0943689476033452f, - 0.0942386312683063f, - 0.09410831331851435f, - 0.09397799375620187f, - 0.09384767258360142f, - 0.09371734980294691f, - 0.09358702541647047f, - 0.09345669942640608f, - 0.09332637183498596f, - 0.0931960426444441f, - 0.09306571185701279f, - 0.0929353794749261f, - 0.09280504550041634f, - 0.09267470993571764f, - 0.09254437278306238f, - 0.09241403404468473f, - 0.09228369372281715f, - 0.09215335181969384f, - 0.0920230083375473f, - 0.09189266327861183f, - 0.09176231664511994f, - 0.09163196843930554f, - 0.09150161866340258f, - 0.09137126731964365f, - 0.09124091441026318f, - 0.09111055993749385f, - 0.09098020390357014f, - 0.09084984631072476f, - 0.09071948716119227f, - 0.09058912645720542f, - 0.0904587642009988f, - 0.09032840039480526f, - 0.09019803504085942f, - 0.09006766814139418f, - 0.08993729969864378f, - 0.08980692971484248f, - 0.08967655819222327f, - 0.0895461851330209f, - 0.0894158105394684f, - 0.08928543441380057f, - 0.08915505675825053f, - 0.0890246775750531f, - 0.08889429686644143f, - 0.08876391463465044f, - 0.08863353088191332f, - 0.08850314561046503f, - 0.08837275882253881f, - 0.08824237052036969f, - 0.08811198070619095f, - 0.08798158938223764f, - 0.08785119655074315f, - 0.08772080221394257f, - 0.08759040637406976f, - 0.08746000903335854f, - 0.08732961019404414f, - 0.08719920985836004f, - 0.08706880802854146f, - 0.08693840470682193f, - 0.08680799989543633f, - 0.08667759359661954f, - 0.08654718581260518f, - 0.0864167765456286f, - 0.08628636579792345f, - 0.08615595357172519f, - 0.08602553986926749f, - 0.08589512469278585f, - 0.08576470804451401f, - 0.0856342899266875f, - 0.08550387034154015f, - 0.08537344929130707f, - 0.08524302677822344f, - 0.08511260280452314f, - 0.08498217737244182f, - 0.08485175048421341f, - 0.08472132214207362f, - 0.08459089234825642f, - 0.08446046110499758f, - 0.0843300284145311f, - 0.08419959427909283f, - 0.0840691587009168f, - 0.0839387216822389f, - 0.08380828322529324f, - 0.08367784333231529f, - 0.08354740200554053f, - 0.08341695924720317f, - 0.0832865150595392f, - 0.08315606944478285f, - 0.08302562240517015f, - 0.08289517394293541f, - 0.0827647240603147f, - 0.08263427275954235f, - 0.08250382004285452f, - 0.08237336591248601f, - 0.08224291037067169f, - 0.08211245341964776f, - 0.08198199506164869f, - 0.08185153529891072f, - 0.08172107413366836f, - 0.08159061156815792f, - 0.08146014760461395f, - 0.0813296822452728f, - 0.08119921549236907f, - 0.08106874734813917f, - 0.08093827781481774f, - 0.08080780689464122f, - 0.08067733458984433f, - 0.08054686090266311f, - 0.08041638583533361f, - 0.08028590939009064f, - 0.08015543156917075f, - 0.08002495237480874f, - 0.07989447180924124f, - 0.0797639898747031f, - 0.07963350657343099f, - 0.07950302190765982f, - 0.07937253587962628f, - 0.07924204849156535f, - 0.07911155974571377f, - 0.07898106964430654f, - 0.07885057818958001f, - 0.07872008538377058f, - 0.07858959122911331f, - 0.07845909572784507f, - 0.07832859888220096f, - 0.07819810069441793f, - 0.07806760116673113f, - 0.07793710030137752f, - 0.0778065981005923f, - 0.07767609456661248f, - 0.07754558970167333f, - 0.07741508350801145f, - 0.07728457598786348f, - 0.07715406714346516f, - 0.07702355697705232f, - 0.07689304549086207f, - 0.07676253268712982f, - 0.07663201856809275f, - 0.0765015031359863f, - 0.07637098639304772f, - 0.07624046834151291f, - 0.07610994898361782f, - 0.07597942832159978f, - 0.07584890635769431f, - 0.07571838309413832f, - 0.07558785853316873f, - 0.07545733267702116f, - 0.07532680552793304f, - 0.07519627708814f, - 0.07506574735987952f, - 0.07493521634538729f, - 0.07480468404690081f, - 0.07467415046665585f, - 0.07454361560688992f, - 0.07441307946983884f, - 0.07428254205773975f, - 0.07415200337282982f, - 0.07402146341734489f, - 0.07389092219352263f, - 0.07376037970359894f, - 0.07362983594981151f, - 0.07349929093439629f, - 0.07336874465959102f, - 0.07323819712763169f, - 0.07310764834075609f, - 0.07297709830120022f, - 0.07284654701120195f, - 0.07271599447299733f, - 0.07258544068882379f, - 0.07245488566091877f, - 0.07232432939151842f, - 0.07219377188286066f, - 0.0720632131371817f, - 0.07193265315671947f, - 0.07180209194371023f, - 0.07167152950039199f, - 0.07154096582900102f, - 0.07141040093177535f, - 0.07127983481095132f, - 0.07114926746876703f, - 0.07101869890745881f, - 0.0708881291292648f, - 0.07075755813642187f, - 0.07062698593116684f, - 0.07049641251573795f, - 0.07036583789237161f, - 0.0702352620633061f, - 0.07010468503077791f, - 0.06997410679702533f, - 0.06984352736428488f, - 0.0697129467347949f, - 0.06958236491079198f, - 0.06945178189451402f, - 0.069321197688199f, - 0.06919061229408353f, - 0.06906002571440606f, - 0.06892943795140326f, - 0.06879884900731362f, - 0.06866825888437382f, - 0.06853766758482242f, - 0.06840707511089615f, - 0.06827648146483357f, - 0.06814588664887149f, - 0.06801529066524804f, - 0.06788469351620142f, - 0.06775409520396847f, - 0.06762349573078784f, - 0.06749289509889644f, - 0.06736229331053295f, - 0.06723169036793433f, - 0.0671010862733393f, - 0.06697048102898484f, - 0.06683987463710973f, - 0.06670926709995098f, - 0.0665786584197474f, - 0.06644804859873606f, - 0.06631743763915535f, - 0.0661868255432437f, - 0.06605621231323824f, - 0.06592559795137787f, - 0.06579498245989975f, - 0.06566436584104282f, - 0.06553374809704472f, - 0.06540312923014312f, - 0.06527250924257699f, - 0.06514188813658363f, - 0.06501126591440204f, - 0.06488064257826955f, - 0.06475001813042519f, - 0.06461939257310634f, - 0.0644887659085521f, - 0.06435813813899983f, - 0.06422750926668869f, - 0.0640968792938561f, - 0.06396624822274123f, - 0.06383561605558154f, - 0.06370498279461626f, - 0.06357434844208286f, - 0.06344371300022063f, - 0.06331307647126706f, - 0.06318243885746104f, - 0.06305180016104144f, - 0.06292116038424583f, - 0.06279051952931358f, - 0.06265987759848231f, - 0.0625292345939914f, - 0.0623985905180785f, - 0.06226794537298306f, - 0.06213729916094275f, - 0.06200665188419706f, - 0.06187600354498369f, - 0.06174535414554216f, - 0.06161470368811022f, - 0.06148405217492699f, - 0.061353399608231565f, - 0.06122274599026178f, - 0.06109209132325722f, - 0.060961435609455744f, - 0.06083077885109697f, - 0.060700121050418804f, - 0.0605694622096609f, - 0.060438802331061185f, - 0.060308141416859355f, - 0.06017747946929338f, - 0.06004681649060299f, - 0.05991615248302618f, - 0.05978548744880273f, - 0.059654821390170656f, - 0.05952415430936978f, - 0.0593934862086386f, - 0.05926281709021564f, - 0.05913214695634076f, - 0.05900147580925208f, - 0.05887080365118949f, - 0.05874013048439114f, - 0.058609456311096965f, - 0.05847878113354515f, - 0.058348104953975216f, - 0.05821742777462671f, - 0.05808674959773787f, - 0.057956070425548706f, - 0.057825390260297496f, - 0.05769470910422428f, - 0.057564026959567374f, - 0.05743334382856686f, - 0.05730265971346107f, - 0.05717197461649013f, - 0.05704128853989241f, - 0.05691060148590762f, - 0.056779913456775494f, - 0.05664922445473444f, - 0.05651853448202468f, - 0.056387843540884657f, - 0.05625715163355461f, - 0.05612645876227303f, - 0.05599576492928018f, - 0.05586507013681458f, - 0.05573437438711654f, - 0.055603677682424614f, - 0.055472980024979135f, - 0.055342281417018684f, - 0.0552115818607832f, - 0.05508088135851261f, - 0.05495017991244556f, - 0.05481947752482246f, - 0.054688774197881984f, - 0.054558069933864584f, - 0.05442736473500895f, - 0.054296658603555564f, - 0.054165951541743605f, - 0.05403524355181226f, - 0.053904534636002054f, - 0.05377382479655177f, - 0.05364311403570196f, - 0.05351240235569145f, - 0.05338168975876082f, - 0.05325097624714892f, - 0.053120261823096364f, - 0.052989546488842035f, - 0.05285883024662659f, - 0.05272811309868892f, - 0.05259739504726972f, - 0.05246667609460792f, - 0.05233595624294425f, - 0.05220523549451766f, - 0.052074513851568464f, - 0.05194379131633699f, - 0.051813067891062235f, - 0.051682343577985006f, - 0.05155161837934434f, - 0.05142089229738107f, - 0.051290165334334246f, - 0.05115943749244475f, - 0.05102870877395166f, - 0.050897979181095884f, - 0.050767248716116535f, - 0.0506365173812541f, - 0.05050578517874906f, - 0.05037505211084059f, - 0.05024431817976966f, - 0.05011358338777547f, - 0.049982847737099004f, - 0.049852111229979505f, - 0.04972137386865799f, - 0.04959063565537373f, - 0.04945989659236776f, - 0.049329156681879385f, - 0.04919841592614968f, - 0.049067674327417966f, - 0.04893693188792491f, - 0.04880618860991119f, - 0.048675444495616615f, - 0.048544699547281f, - 0.04841395376714552f, - 0.04828320715744958f, - 0.048152459720434374f, - 0.04802171145833933f, - 0.047890962373405684f, - 0.047760212467873334f, - 0.0476294617439822f, - 0.04749871020397355f, - 0.04736795785008689f, - 0.04723720468456308f, - 0.04710645070964296f, - 0.04697569592756609f, - 0.046844940340573814f, - 0.04671418395090569f, - 0.04658342676080309f, - 0.04645266877250561f, - 0.04632190998825465f, - 0.04619115041028983f, - 0.04606039004085257f, - 0.04592962888218253f, - 0.0457988669365207f, - 0.04566810420610811f, - 0.04553734069318445f, - 0.0454065763999912f, - 0.04527581132876808f, - 0.045145045481756615f, - 0.04501427886119655f, - 0.04488351146932942f, - 0.044752743308395f, - 0.04462197438063486f, - 0.0444912046882888f, - 0.044360434233598416f, - 0.044229663018803524f, - 0.04409889104614531f, - 0.04396811831786495f, - 0.04383734483620232f, - 0.04370657060339908f, - 0.04357579562169511f, - 0.043445019893332104f, - 0.04331424342054997f, - 0.04318346620559042f, - 0.0430526882506934f, - 0.04292190955810064f, - 0.04279113013005212f, - 0.04266034996878958f, - 0.04252956907655348f, - 0.04239878745558425f, - 0.0422680051081237f, - 0.042137222036411855f, - 0.04200643824269054f, - 0.04187565372919981f, - 0.04174486849818151f, - 0.04161408255187572f, - 0.041483295892524315f, - 0.041352508522367395f, - 0.04122172044364686f, - 0.041090931658602836f, - 0.040960142169476806f, - 0.040829351978510245f, - 0.04069856108794332f, - 0.040567769500017996f, - 0.04043697721697445f, - 0.04030618424105468f, - 0.04017539057449888f, - 0.04004459621954906f, - 0.03991380117844546f, - 0.0397830054534301f, - 0.03965220904674325f, - 0.03952141196062651f, - 0.0393906141973215f, - 0.039259815759068506f, - 0.039129016648109624f, - 0.03899821686668517f, - 0.03886741641703725f, - 0.0387366153014062f, - 0.03860581352203416f, - 0.0384750110811615f, - 0.03834420798103035f, - 0.038213404223881114f, - 0.03808259981195597f, - 0.03795179474749532f, - 0.03782098903274092f, - 0.037690182669934534f, - 0.03755937566131661f, - 0.03742856800912937f, - 0.03729775971561373f, - 0.03716695078301061f, - 0.037036141213562274f, - 0.03690533100950922f, - 0.03677452017309374f, - 0.03664370870655634f, - 0.036512896612139335f, - 0.03638208389208327f, - 0.03625127054863047f, - 0.03612045658402149f, - 0.0359896420004987f, - 0.035858826800302675f, - 0.035728010985675775f, - 0.03559719455885862f, - 0.0354663775220936f, - 0.03533555987762133f, - 0.03520474162768424f, - 0.03507392277452297f, - 0.03494310332037995f, - 0.034812283267495844f, - 0.03468146261811268f, - 0.03455064137447246f, - 0.0344198195388159f, - 0.03428899711338546f, - 0.034158174100421886f, - 0.034027350502167666f, - 0.03389652632086355f, - 0.033765701558752054f, - 0.033634876218073935f, - 0.033504050301071744f, - 0.033373223809986266f, - 0.03324239674705961f, - 0.03311156911453391f, - 0.032980740914649975f, - 0.0328499121496504f, - 0.032719082821776005f, - 0.03258825293326941f, - 0.03245742248637147f, - 0.0323265914833248f, - 0.032195759926370277f, - 0.03206492781775055f, - 0.03193409515970651f, - 0.031803261954480806f, - 0.031672428204314367f, - 0.03154159391144987f, - 0.031410759078128236f, - 0.03127992370659218f, - 0.031149087799082632f, - 0.03101825135784233f, - 0.030887414385112666f, - 0.03075657688313506f, - 0.03062573885415226f, - 0.030494900300405255f, - 0.030364061224136818f, - 0.030233221627587948f, - 0.03010238151300144f, - 0.029971540882618313f, - 0.02984069973868093f, - 0.02970985808343166f, - 0.029579015919111558f, - 0.029448173247963453f, - 0.02931733007222841f, - 0.02918648639414928f, - 0.029055642215967147f, - 0.028924797539924878f, - 0.028793952368263574f, - 0.02866310670322612f, - 0.028532260547053632f, - 0.028401413901988568f, - 0.02827056677027339f, - 0.02813971915414925f, - 0.028008871055859065f, - 0.027878022477644f, - 0.02774717342174699f, - 0.02761632389040922f, - 0.027485473885873645f, - 0.027354623410381456f, - 0.02722377246617563f, - 0.02709292105549737f, - 0.026962069180589673f, - 0.026831216843693762f, - 0.0267003640470522f, - 0.026569510792907557f, - 0.02643865708350108f, - 0.026307802921075797f, - 0.02617694830787298f, - 0.026046093246135667f, - 0.025915237738105137f, - 0.025784381786024456f, - 0.02565352539213536f, - 0.02552266855867959f, - 0.025391811287900235f, - 0.02526095358203861f, - 0.025130095443337813f, - 0.024999236874039175f, - 0.024868377876385815f, - 0.02473751845261907f, - 0.024606658604982075f, - 0.02447579833571619f, - 0.024344937647064555f, - 0.02421407654126855f, - 0.024083215020571324f, - 0.023952353087214273f, - 0.023821490743440567f, - 0.02369062799149161f, - 0.023559764833610143f, - 0.02342890127203891f, - 0.023298037309019345f, - 0.023167172946794646f, - 0.023036308187606255f, - 0.02290544303369739f, - 0.022774577487309502f, - 0.022643711550685824f, - 0.022512845226067824f, - 0.022381978515698748f, - 0.022251111421820072f, - 0.022120243946674615f, - 0.021989376092505196f, - 0.021858507861553314f, - 0.021727639256062248f, - 0.021596770278273513f, - 0.021465900930430395f, - 0.02133503121477442f, - 0.021204161133548893f, - 0.021073290688995352f, - 0.02094241988335711f, - 0.02081154871887572f, - 0.020680677197794504f, - 0.020549805322355032f, - 0.02041893309480064f, - 0.0202880605173729f, - 0.02015718759231517f, - 0.02002631432186903f, - 0.019895440708277853f, - 0.019764566753783228f, - 0.019633692460628533f, - 0.019502817831055383f, - 0.01937194286730716f, - 0.019241067571625928f, - 0.019110191946253758f, - 0.018979315993433613f, - 0.01884843971540846f, - 0.01871756311441994f, - 0.018586686192711473f, - 0.01845580895252472f, - 0.01832493139610311f, - 0.018194053525688307f, - 0.018063175343523755f, - 0.01793229685185113f, - 0.017801418052913888f, - 0.017670538948953714f, - 0.01753965954221407f, - 0.017408779834936657f, - 0.017277899829364503f, - 0.01714701952774065f, - 0.0170161389323068f, - 0.016885258045306457f, - 0.01675437686898133f, - 0.01662349540557493f, - 0.01649261365732898f, - 0.016361731626486995f, - 0.016230849315290716f, - 0.016099966725983662f, - 0.015969083860807587f, - 0.015838200722006014f, - 0.01570731731182071f, - 0.015576433632494764f, - 0.015445549686271282f, - 0.015314665475392035f, - 0.015183781002100575f, - 0.015052896268638687f, - 0.014922011277249932f, - 0.0147911260301761f, - 0.014660240529660765f, - 0.014529354777945723f, - 0.014398468777274558f, - 0.014267582529889076f, - 0.014136696038032866f, - 0.014005809303948189f, - 0.013874922329877307f, - 0.013744035118063826f, - 0.013613147670749571f, - 0.013482259990178153f, - 0.01335137207859141f, - 0.013220483938232955f, - 0.013089595571344636f, - 0.012958706980170077f, - 0.012827818166951131f, - 0.012696929133931431f, - 0.012566039883352836f, - 0.012435150417458542f, - 0.012304260738491751f, - 0.012173370848694331f, - 0.012042480750309933f, - 0.011911590445580439f, - 0.011780699936749503f, - 0.011649809226059014f, - 0.011518918315752634f, - 0.011388027208072258f, - 0.011257135905261555f, - 0.011126244409562426f, - 0.010995352723218103f, - 0.010864460848471829f, - 0.010733568787565506f, - 0.010602676542742828f, - 0.010471784116245709f, - 0.01034089151031784f, - 0.010209998727201144f, - 0.010079105769139325f, - 0.009948212638374306f, - 0.009817319337149796f, - 0.009686425867707725f, - 0.00955553223229181f, - 0.009424638433143987f, - 0.009293744472507531f, - 0.009162850352625717f, - 0.009031956075740494f, - 0.00890106164409559f, - 0.008770167059933397f, - 0.008639272325496317f, - 0.008508377443028084f, - 0.008377482414770659f, - 0.00824658724296778f, - 0.008115691929861411f, - 0.007984796477695299f, - 0.007853900888711412f, - 0.007723005165153498f, - 0.007592109309263535f, - 0.007461213323285272f, - 0.007330317209460692f, - 0.007199420970033551f, - 0.007068524607245831f, - 0.006937628123341297f, - 0.006806731520561935f, - 0.006675834801151511f, - 0.006544937967352018f, - 0.006414041021407225f, - 0.006283143965559127f, - 0.006152246802051055f, - 0.0060213495331263404f, - 0.005890452161026984f, - 0.0057595546879967655f, - 0.005628657116277689f, - 0.005497759448113538f, - 0.00536686168574632f, - 0.005235963831419821f, - 0.005105065887376052f, - 0.004974167855858802f, - 0.004843269739110086f, - 0.004712371539373252f, - 0.004581473258891648f, - 0.004450574899907293f, - 0.004319676464663985f, - 0.0041887779554037425f, - 0.004057879374370366f, - 0.003926980723805878f, - 0.0037960820059540815f, - 0.0036651832230570006f, - 0.003534284377358439f, - 0.003403385471100426f, - 0.0032724865065267665f, - 0.0031415874858794902f, - 0.0030106884114024057f, - 0.002879789285337544f, - 0.0027488901099287154f, - 0.002617990887418397f, - 0.0024870916200490684f, - 0.002356192310064541f, - 0.0022252929597068507f, - 0.0020943935712198106f, - 0.001963494146845458f, - 0.0018325946888276086f, - 0.0017016951994082998f, - 0.0015707956808309034f, - 0.0014398961353387918f, - 0.0013089965651740046f, - 0.001178096972580359f, - 0.001047197359799896f, - 0.0009162977290764331f, - 0.0007853980826520122f, - 0.0006544984227704515f, - 0.0005235987516737929f, - 0.0003926990716058553f, - 0.0002617993848086811f, - 0.00013089969352608925f, - 1.2246467991473532e-16f, - -0.00013089969352584433f, - -0.00026179938480888024f, - -0.0003926990716051663f, - -0.000523598751673548f, - -0.0006544984227702064f, - -0.0007853980826522113f, - -0.0009162977290757441f, - -0.001047197359799651f, - -0.001178096972580114f, - -0.0013089965651742036f, - -0.0014398961353381027f, - -0.0015707956808306586f, - -0.0017016951994080548f, - -0.0018325946888273635f, - -0.0019634941468452136f, - -0.0020943935712191214f, - -0.0022252929597066057f, - -0.002356192310064296f, - -0.002487091620048824f, - -0.0026179908874177085f, - -0.0027488901099284703f, - -0.002879789285337299f, - -0.0030106884114021607f, - -0.003141587485879245f, - -0.0032724865065265215f, - -0.003403385471100181f, - -0.003534284377358194f, - -0.0036651832230571997f, - -0.0037960820059533924f, - -0.0039269807238056335f, - -0.004057879374370121f, - -0.004188777955403942f, - -0.004319676464663295f, - -0.004450574899907049f, - -0.004581473258891403f, - -0.004712371539373451f, - -0.004843269739110285f, - -0.004974167855858113f, - -0.005105065887375807f, - -0.005235963831419576f, - -0.005366861685746519f, - -0.005497759448112849f, - -0.005628657116277444f, - -0.00575955468799652f, - -0.005890452161027183f, - -0.006021349533125651f, - -0.0061522468020508096f, - -0.006283143965558882f, - -0.006414041021406979f, - -0.006544937967352216f, - -0.006675834801150822f, - -0.00680673152056169f, - -0.006937628123341052f, - -0.007068524607246031f, - -0.007199420970032861f, - -0.007330317209460447f, - -0.007461213323285028f, - -0.007592109309263733f, - -0.00772300516515281f, - -0.007853900888711166f, - -0.007984796477695054f, - -0.008115691929861167f, - -0.008246587242967535f, - -0.008377482414770415f, - -0.00850837744302784f, - -0.008639272325496073f, - -0.008770167059933153f, - -0.008901061644095345f, - -0.00903195607574025f, - -0.009162850352625472f, - -0.00929374447250773f, - -0.009424638433143742f, - -0.00955553223229112f, - -0.00968642586770748f, - -0.009817319337149551f, - -0.009948212638374506f, - -0.010079105769138636f, - -0.0102099987272009f, - -0.010340891510317595f, - -0.010471784116245907f, - -0.01060267654274214f, - -0.010733568787565262f, - -0.010864460848471584f, - -0.010995352723218303f, - -0.011126244409562624f, - -0.011257135905260866f, - -0.011388027208072013f, - -0.011518918315752389f, - -0.011649809226059214f, - -0.011780699936748814f, - -0.011911590445580194f, - -0.012042480750309689f, - -0.012173370848694529f, - -0.01230426073849106f, - -0.012435150417458298f, - -0.012566039883352592f, - -0.012696929133931186f, - -0.01282781816695133f, - -0.012958706980169389f, - -0.013089595571344391f, - -0.01322048393823271f, - -0.013351372078591163f, - -0.013482259990177464f, - -0.013613147670749327f, - -0.013744035118063581f, - -0.013874922329877063f, - -0.0140058093039475f, - -0.014136696038032621f, - -0.014267582529888832f, - -0.014398468777274314f, - -0.014529354777945922f, - -0.01466024052966052f, - -0.014791126030175855f, - -0.014922011277249686f, - -0.015052896268638885f, - -0.01518378100210033f, - -0.01531466547539179f, - -0.015445549686271038f, - -0.015576433632494963f, - -0.01570731731182002f, - -0.015838200722005327f, - -0.01596908386080734f, - -0.01609996672598342f, - -0.016230849315290917f, - -0.016361731626486308f, - -0.016492613657328736f, - -0.016623495405574683f, - -0.01675437686898153f, - -0.016885258045305766f, - -0.017016138932306555f, - -0.017147019527740403f, - -0.0172778998293647f, - -0.017408779834935967f, - -0.01753965954221338f, - -0.017670538948953467f, - -0.017801418052913645f, - -0.01793229685185133f, - -0.01806317534352307f, - -0.01819405352568806f, - -0.018324931396102865f, - -0.01845580895252492f, - -0.018586686192710786f, - -0.018717563114419692f, - -0.018848439715408213f, - -0.01897931599343381f, - -0.01911019194625351f, - -0.019241067571625237f, - -0.019371942867306913f, - -0.019502817831055137f, - -0.01963369246062829f, - -0.01976456675378298f, - -0.019895440708277607f, - -0.02002631432186879f, - -0.020157187592314926f, - -0.020288060517372655f, - -0.020418933094800393f, - -0.020549805322354786f, - -0.02068067719779426f, - -0.020811548718875916f, - -0.020942419883356423f, - -0.02107329068899511f, - -0.02120416113354865f, - -0.02133503121477462f, - -0.021465900930429705f, - -0.021596770278273267f, - -0.021727639256062005f, - -0.021858507861553512f, - -0.021989376092504506f, - -0.02212024394667437f, - -0.022251111421819826f, - -0.022381978515698505f, - -0.022512845226068025f, - -0.022643711550685137f, - -0.022774577487309256f, - -0.022905443033697143f, - -0.023036308187606453f, - -0.02316717294679396f, - -0.0232980373090191f, - -0.023428901272038668f, - -0.02355976483361034f, - -0.023690627991490923f, - -0.02382149074343988f, - -0.02395235308721403f, - -0.02408321502057108f, - -0.024214076541268746f, - -0.02434493764706387f, - -0.024475798335715945f, - -0.024606658604981832f, - -0.02473751845261927f, - -0.024868377876385125f, - -0.024999236874038933f, - -0.02513009544333757f, - -0.025260953582038365f, - -0.02539181128789999f, - -0.025522668558679344f, - -0.025653525392135113f, - -0.02578438178602421f, - -0.025915237738105334f, - -0.02604609324613542f, - -0.026176948307872733f, - -0.026307802921075554f, - -0.026438657083501276f, - -0.02656951079290731f, - -0.026700364047051953f, - -0.02683121684369352f, - -0.02696206918058943f, - -0.02709292105549757f, - -0.02722377246617494f, - -0.02735462341038121f, - -0.0274854738858734f, - -0.02761632389040942f, - -0.027747173421746305f, - -0.027878022477643753f, - -0.02800887105585882f, - -0.028139719154149447f, - -0.028270566770272704f, - -0.02840141390198832f, - -0.028532260547053385f, - -0.028663106703225874f, - -0.028793952368263775f, - -0.02892479753992419f, - -0.0290556422159669f, - -0.029186486394149034f, - -0.029317330072228608f, - -0.029448173247962763f, - -0.02957901591911131f, - -0.029709858083431417f, - -0.02984069973868113f, - -0.029971540882617623f, - -0.03010238151300075f, - -0.030233221627587705f, - -0.03036406122413657f, - -0.030494900300405012f, - -0.030625738854151572f, - -0.030756576883134813f, - -0.03088741438511242f, - -0.031018251357842083f, - -0.03114908779908239f, - -0.03127992370659193f, - -0.031410759078127994f, - -0.031541593911449624f, - -0.03167242820431457f, - -0.03180326195448056f, - -0.03193409515970626f, - -0.032064927817750305f, - -0.03219575992637048f, - -0.03232659148332411f, - -0.03245742248637122f, - -0.03258825293326917f, - -0.032719082821776206f, - -0.032849912149649704f, - -0.032980740914649725f, - -0.03311156911453366f, - -0.0332423967470598f, - -0.03337322380998646f, - -0.03350405030107106f, - -0.03363487621807369f, - -0.033765701558751804f, - -0.03389652632086375f, - -0.03402735050216698f, - -0.03415817410042164f, - -0.03428899711338522f, - -0.03441981953881609f, - -0.03455064137447177f, - -0.03468146261811243f, - -0.0348122832674956f, - -0.034943103320379705f, - -0.03507392277452317f, - -0.035204741627683556f, - -0.03533555987762109f, - -0.035466377522093355f, - -0.03559719455885882f, - -0.03572801098567509f, - -0.035858826800302425f, - -0.03598964200049846f, - -0.036120456584021694f, - -0.036251270548629776f, - -0.03638208389208302f, - -0.03651289661213909f, - -0.036643708706556095f, - -0.03677452017309349f, - -0.036905331009508976f, - -0.03703614121356203f, - -0.03716695078301037f, - -0.037297759715613485f, - -0.03742856800912912f, - -0.03755937566131636f, - -0.03769018266993429f, - -0.03782098903274112f, - -0.03795179474749508f, - -0.03808259981195528f, - -0.03821340422388087f, - -0.03834420798103011f, - -0.03847501108116169f, - -0.038605813522033475f, - -0.03873661530140596f, - -0.038867416417037004f, - -0.03899821686668537f, - -0.03912901664810894f, - -0.03925981575906826f, - -0.039390614197321254f, - -0.03952141196062671f, - -0.03965220904674345f, - -0.039783005453429415f, - -0.039913801178445216f, - -0.04004459621954881f, - -0.04017539057449908f, - -0.040306184241053984f, - -0.04043697721697421f, - -0.040567769500017746f, - -0.04069856108794352f, - -0.04082935197850955f, - -0.04096014216947656f, - -0.04109093165860259f, - -0.041221720443646616f, - -0.0413525085223676f, - -0.04148329589252363f, - -0.04161408255187548f, - -0.041744868498181265f, - -0.04187565372919957f, - -0.042006438242689854f, - -0.04213722203641161f, - -0.04226800510812345f, - -0.04239878745558401f, - -0.04252956907655279f, - -0.04266034996878934f, - -0.042791130130051876f, - -0.0429219095581004f, - -0.0430526882506936f, - -0.043183466205590174f, - -0.04331424342054972f, - -0.043445019893331854f, - -0.043575795621695314f, - -0.043706570603398394f, - -0.04383734483620208f, - -0.04396811831786471f, - -0.044098891046145505f, - -0.04422966301880284f, - -0.04436043423359772f, - -0.04449120468828856f, - -0.044621974380634616f, - -0.0447527433083952f, - -0.04488351146932873f, - -0.04501427886119631f, - -0.04514504548175637f, - -0.04527581132876828f, - -0.04540657639999051f, - -0.0455373406931842f, - -0.04566810420610787f, - -0.0457988669365209f, - -0.04592962888218273f, - -0.046060390040851884f, - -0.04619115041028959f, - -0.0463219099882544f, - -0.04645266877250581f, - -0.0465834267608024f, - -0.046714183950905444f, - -0.046844940340573564f, - -0.04697569592756629f, - -0.04710645070964227f, - -0.04723720468456283f, - -0.04736795785008665f, - -0.04749871020397331f, - -0.04762946174398196f, - -0.04776021246787265f, - -0.04789096237340544f, - -0.04802171145833909f, - -0.04815245972043413f, - -0.04828320715744934f, - -0.04841395376714528f, - -0.04854469954728076f, - -0.04867544449561637f, - -0.04880618860991095f, - -0.04893693188792467f, - -0.049067674327417724f, - -0.04919841592614944f, - -0.049329156681879587f, - -0.049459896592367075f, - -0.049590635655373486f, - -0.04972137386865775f, - -0.049852111229979706f, - -0.04998284773709832f, - -0.050113583387775225f, - -0.05024431817976942f, - -0.05037505211084079f, - -0.05050578517874837f, - -0.050636517381253854f, - -0.05076724871611629f, - -0.050897979181095634f, - -0.05102870877395186f, - -0.05115943749244406f, - -0.051290165334334004f, - -0.05142089229738082f, - -0.05155161837934454f, - -0.05168234357798432f, - -0.05181306789106199f, - -0.051943791316336745f, - -0.052074513851568666f, - -0.05220523549451697f, - -0.052335956242943564f, - -0.05246667609460768f, - -0.05259739504726947f, - -0.05272811309868912f, - -0.052858830246625896f, - -0.05298954648884179f, - -0.05312026182309612f, - -0.053250976247148675f, - -0.053381689758760134f, - -0.053512402355691206f, - -0.05364311403570172f, - -0.053773824796551524f, - -0.05390453463600181f, - -0.054035243551812016f, - -0.05416595154174336f, - -0.05429665860355532f, - -0.05442736473500915f, - -0.05455806993386434f, - -0.05468877419788174f, - -0.05481947752482222f, - -0.05495017991244575f, - -0.055080881358512364f, - -0.05521158186078295f, - -0.05534228141701844f, - -0.05547298002497889f, - -0.055603677682424815f, - -0.055734374387115856f, - -0.055865070136814333f, - -0.055995764929279934f, - -0.05612645876227323f, - -0.05625715163355392f, - -0.056387843540884414f, - -0.056518534482024436f, - -0.056649224454734644f, - -0.05677991345677481f, - -0.056910601485907375f, - -0.05704128853989217f, - -0.05717197461648989f, - -0.05730265971346127f, - -0.05743334382856617f, - -0.05756402695956713f, - -0.057694709104224036f, - -0.05782539026029769f, - -0.05795607042554802f, - -0.05808674959773762f, - -0.05821742777462647f, - -0.05834810495397542f, - -0.05847878113354446f, - -0.05860945631109628f, - -0.05874013048439089f, - -0.05887080365118924f, - -0.05900147580925183f, - -0.05913214695634007f, - -0.0592628170902154f, - -0.05939348620863836f, - -0.05952415430936954f, - -0.059654821390170414f, - -0.059785487448802486f, - -0.05991615248302594f, - -0.06004681649060275f, - -0.060177479469293575f, - -0.06030814141685911f, - -0.060438802331060935f, - -0.060569462209660654f, - -0.060700121050419005f, - -0.060830778851096286f, - -0.060961435609455494f, - -0.06109209132325698f, - -0.06122274599026198f, - -0.06135339960823088f, - -0.06148405217492674f, - -0.06161470368810998f, - -0.061745354145541914f, - -0.06187600354498388f, - -0.062006651884196365f, - -0.06213729916094251f, - -0.062267945372982816f, - -0.0623985905180787f, - -0.0625292345939907f, - -0.06265987759848206f, - -0.06279051952931335f, - -0.06292116038424603f, - -0.06305180016104076f, - -0.06318243885746079f, - -0.06331307647126681f, - -0.06344371300022038f, - -0.06357434844208305f, - -0.06370498279461558f, - -0.0638356160555813f, - -0.06396624822274098f, - -0.0640968792938563f, - -0.06422750926668801f, - -0.06435813813899958f, - -0.06448876590855185f, - -0.06461939257310655f, - -0.06475001813042451f, - -0.0648806425782693f, - -0.0650112659144018f, - -0.06514188813658338f, - -0.06527250924257676f, - -0.06540312923014287f, - -0.06553374809704447f, - -0.06566436584104257f, - -0.06579498245989995f, - -0.06592559795137763f, - -0.066056212313238f, - -0.06618682554324345f, - -0.06631743763915554f, - -0.0664480485987358f, - -0.06657865841974671f, - -0.06670926709995073f, - -0.06683987463710948f, - -0.06697048102898505f, - -0.06710108627333862f, - -0.06723169036793408f, - -0.06736229331053271f, - -0.06749289509889664f, - -0.06762349573078714f, - -0.06775409520396822f, - -0.06788469351620117f, - -0.06801529066524825f, - -0.0681458866488717f, - -0.06827648146483288f, - -0.0684070751108959f, - -0.06853766758482217f, - -0.06866825888437403f, - -0.06879884900731292f, - -0.06892943795140302f, - -0.06906002571440581f, - -0.06919061229408373f, - -0.0693211976881983f, - -0.06945178189451379f, - -0.06958236491079173f, - -0.06971294673479465f, - -0.06984352736428508f, - -0.06997410679702463f, - -0.07010468503077767f, - -0.07023526206330585f, - -0.07036583789237137f, - -0.07049641251573725f, - -0.0706269859311666f, - -0.07075755813642162f, - -0.07088812912926457f, - -0.07101869890745856f, - -0.07114926746876678f, - -0.07127983481095107f, - -0.07141040093177511f, - -0.07154096582900121f, - -0.07167152950039175f, - -0.07180209194371f, - -0.07193265315671923f, - -0.07206321313718189f, - -0.07219377188285998f, - -0.07232432939151817f, - -0.07245488566091852f, - -0.07258544068882399f, - -0.07271599447299663f, - -0.07284654701120126f, - -0.07297709830119999f, - -0.07310764834075584f, - -0.07323819712763188f, - -0.07336874465959034f, - -0.07349929093439604f, - -0.07362983594981126f, - -0.07376037970359914f, - -0.07389092219352195f, - -0.07402146341734464f, - -0.07415200337282957f, - -0.07428254205773996f, - -0.07441307946983905f, - -0.07454361560688924f, - -0.0746741504666556f, - -0.07480468404690056f, - -0.07493521634538748f, - -0.07506574735987882f, - -0.07519627708813975f, - -0.07532680552793279f, - -0.07545733267702137f, - -0.07558785853316805f, - -0.07571838309413807f, - -0.07584890635769406f, - -0.07597942832159954f, - -0.07610994898361759f, - -0.07624046834151223f, - -0.07637098639304747f, - -0.07650150313598607f, - -0.07663201856809251f, - -0.07676253268712957f, - -0.07689304549086183f, - -0.07702355697705207f, - -0.07715406714346491f, - -0.07728457598786323f, - -0.07741508350801121f, - -0.07754558970167309f, - -0.07767609456661224f, - -0.0778065981005925f, - -0.07793710030137682f, - -0.0780676011667309f, - -0.0781981006944177f, - -0.07832859888220117f, - -0.07845909572784437f, - -0.07858959122911306f, - -0.07872008538377033f, - -0.07885057818958022f, - -0.07898106964430585f, - -0.07911155974571307f, - -0.0792420484915651f, - -0.07937253587962605f, - -0.07950302190766001f, - -0.07963350657343031f, - -0.07976398987470286f, - -0.07989447180924099f, - -0.08002495237480894f, - -0.08015543156917006f, - -0.08028590939009041f, - -0.08041638583533338f, - -0.0805468609026633f, - -0.08067733458984452f, - -0.08080780689464054f, - -0.0809382778148175f, - -0.08106874734813892f, - -0.08119921549236928f, - -0.08132968224527211f, - -0.0814601476046137f, - -0.08159061156815768f, - -0.08172107413366812f, - -0.08185153529891002f, - -0.08198199506164844f, - -0.08211245341964753f, - -0.08224291037067145f, - -0.08237336591248577f, - -0.08250382004285427f, - -0.08263427275954212f, - -0.08276472406031446f, - -0.08289517394293561f, - -0.08302562240516992f, - -0.08315606944478261f, - -0.08328651505953896f, - -0.08341695924720338f, - -0.08354740200553985f, - -0.08367784333231504f, - -0.08380828322529299f, - -0.08393872168223866f, - -0.08406915870091701f, - -0.08419959427909214f, - -0.08433002841453087f, - -0.08446046110499733f, - -0.08459089234825662f, - -0.08472132214207292f, - -0.08485175048421316f, - -0.08498217737244157f, - -0.08511260280452333f, - -0.08524302677822275f, - -0.08537344929130682f, - -0.0855038703415399f, - -0.08563428992668727f, - -0.0857647080445142f, - -0.08589512469278517f, - -0.08602553986926724f, - -0.08615595357172494f, - -0.08628636579792365f, - -0.0864167765456279f, - -0.08654718581260493f, - -0.0866775935966193f, - -0.08680799989543653f, - -0.08693840470682125f, - -0.08706880802854076f, - -0.08719920985835979f, - -0.08732961019404391f, - -0.08746000903335831f, - -0.08759040637406908f, - -0.08772080221394234f, - -0.0878511965507429f, - -0.08798158938223741f, - -0.0881119807061907f, - -0.08824237052036944f, - -0.08837275882253857f, - -0.0885031456104648f, - -0.08863353088191352f, - -0.0887639146346502f, - -0.0888942968664412f, - -0.08902467757505285f, - -0.08915505675825072f, - -0.0892854344137999f, - -0.08941581053946815f, - -0.08954618513302065f, - -0.08967655819222346f, - -0.08980692971484179f, - -0.08993729969864353f, - -0.09006766814139394f, - -0.09019803504085917f, - -0.09032840039480546f, - -0.09045876420099812f, - -0.09058912645720517f, - -0.09071948716119202f, - -0.09084984631072497f, - -0.09098020390356945f, - -0.0911105599374936f, - -0.09124091441026294f, - -0.09137126731964385f, - -0.0915016186634019f, - -0.09163196843930531f, - -0.09176231664511969f, - -0.09189266327861158f, - -0.09202300833754751f, - -0.09215335181969316f, - -0.0922836937228169f, - -0.0924140340446845f, - -0.09254437278306259f, - -0.09267470993571696f, - -0.0928050455004161f, - -0.09293537947492585f, - -0.093065711857013f, - -0.09319604264444341f, - -0.09332637183498571f, - -0.09345669942640583f, - -0.09358702541647022f, - -0.09371734980294666f, - -0.09384767258360119f, - -0.09397799375620164f, - -0.0941083133185141f, - -0.09423863126830649f, - -0.09436894760334495f, - -0.09449926232139699f, - -0.09462957542023015f, - -0.09475988689761108f, - -0.09489019675130697f, - -0.09502050497908408f, - -0.09515081157871139f, - -0.09528111654795525f, - -0.09541141988458292f, - -0.0955417215863608f, - -0.095672021651058f, - -0.09580232007644092f, - -0.09593261686027699f, - -0.09606291200033269f, - -0.09619320549437724f, - -0.0963234973401772f, - -0.09645378753550006f, - -0.09658407607811331f, - -0.09671436296578365f, - -0.09684464819628037f, - -0.09697493176737022f, - -0.09710521367682082f, - -0.09723549392239893f, - -0.09736577250187399f, - -0.09749604941301286f, - -0.09762632465358326f, - -0.09775659822135206f, - -0.09788687011408886f, - -0.09801714032956059f, - -0.0981474088655351f, - -0.09827767571978026f, - -0.09840794089006312f, - -0.0985382043741534f, - -0.09866846616981814f, - -0.09879872627482494f, - -0.09892898468694226f, - -0.0990592414039386f, - -0.09918949642358159f, - -0.09931974974363891f, - -0.09945000136187916f, - -0.09958025127607095f, - -0.0997104994839816f, - -0.0998407459833802f, - -0.09997099077203461f, - -0.10010123384771265f, - -0.1002314752081831f, - -0.10036171485121473f, - -0.1004919527745755f, - -0.10062218897603291f, - -0.10075242345335719f, - -0.10088265620431591f, - -0.10101288722667759f, - -0.10114311651820983f, - -0.10127334407668298f, - -0.10140356989986475f, - -0.10153379398552374f, - -0.1016640163314286f, - -0.10179423693534713f, - -0.10192445579504979f, - -0.10205467290830443f, - -0.10218488827287982f, - -0.10231510188654387f, - -0.10244531374706718f, - -0.10257552385221773f, - -0.10270573219976437f, - -0.10283593878747604f, - -0.1029661436131208f, - -0.10309634667446939f, - -0.10322654796928994f, - -0.10335674749535147f, - -0.10348694525042217f, - -0.1036171412322729f, - -0.10374733543867193f, - -0.10387752786738838f, - -0.10400771851619058f, - -0.10413790738284949f, - -0.10426809446513349f, - -0.10439827976081187f, - -0.1045284632676535f, - -0.10465864498342813f, - -0.1047888249059056f, - -0.10491900303285444f, - -0.10504917936204493f, - -0.10517935389124568f, - -0.10530952661822705f, - -0.1054396975407577f, - -0.10556986665660806f, - -0.10570003396354682f, - -0.10583019945934408f, - -0.10596036314176989f, - -0.10609052500859349f, - -0.10622068505758463f, - -0.10635084328651213f, - -0.10648099969314755f, - -0.1066111542752598f, - -0.10674130703061874f, - -0.10687145795699332f, - -0.10700160705215524f, - -0.10713175431387352f, - -0.10726189973991813f, - -0.1073920433280582f, - -0.1075221850760655f, - -0.1076523249817092f, - -0.10778246304275939f, - -0.1079125992569862f, - -0.10804273362215888f, - -0.1081728661360494f, - -0.10830299679642709f, - -0.10843312560106219f, - -0.10856325254772409f, - -0.10869337763418487f, - -0.10882350085821399f, - -0.10895362221758181f, - -0.10908374171005877f, - -0.10921385933341439f, - -0.10934397508542092f, - -0.10947408896384798f, - -0.1096042009664661f, - -0.10973431109104496f, - -0.10986441933535694f, - -0.10999452569717176f, - -0.11012463017425968f, - -0.1102547327643918f, - -0.1103848334653393f, - -0.1105149322748725f, - -0.11064502919076175f, - -0.11077512421077876f, - -0.1109052173326935f, - -0.1110353085542773f, - -0.11116539787330154f, - -0.11129548528753672f, - -0.11142557079475338f, - -0.11155565439272298f, - -0.11168573607921703f, - -0.11181581585200616f, - -0.11194589370886061f, - -0.11207596964755331f, - -0.11220604366585454f, - -0.11233611576153553f, - -0.11246618593236751f, - -0.11259625417612092f, - -0.1127263204905688f, - -0.11285638487348164f, - -0.1129864473226308f, - -0.11311650783578683f, - -0.11324656641072296f, - -0.11337662304520976f, - -0.11350667773701875f, - -0.1136367304839206f, - -0.11376678128368865f, - -0.11389683013409366f, - -0.11402687703290723f, - -0.11415692197790109f, - -0.11428696496684604f, - -0.1144170059975156f, - -0.11454704506768067f, - -0.11467708217511308f, - -0.11480711731758378f, - -0.11493715049286643f, - -0.11506718169873205f, - -0.1151972109329526f, - -0.11532723819329918f, - -0.11545726347754558f, - -0.11558728678346294f, - -0.1157173081088234f, - -0.11584732745139859f, - -0.11597734480896112f, - -0.11610736017928362f, - -0.11623737356013744f, - -0.1163673849492957f, - -0.11649739434452981f, - -0.116627401743613f, - -0.11675740714431672f, - -0.11688741054441425f, - -0.11701741194167757f, - -0.11714741133387828f, - -0.11727740871879062f, - -0.11740740409418626f, - -0.11753739745783774f, - -0.11766738880751679f, - -0.11779737814099779f, - -0.11792736545605256f, - -0.11805735075045377f, - -0.11818733402197329f, - -0.11831731526838565f, - -0.11844729448746279f, - -0.11857727167697753f, - -0.11870724683470275f, - -0.11883721995841048f, - -0.11896719104587546f, - -0.11909716009486973f, - -0.11922712710316635f, - -0.11935709206853748f, - -0.11948705498875796f, - -0.11961701586160003f, - -0.11974697468483686f, - -0.11987693145624075f, - -0.12000688617358668f, - -0.12013683883464703f, - -0.12026678943719511f, - -0.12039673797900424f, - -0.12052668445784692f, - -0.12065662887149829f, - -0.12078657121773094f, - -0.12091651149431831f, - -0.12104644969903304f, - -0.12117638582965044f, - -0.12130631988394322f, - -0.12143625185968453f, - -0.12156618175464846f, - -0.12169610956660916f, - -0.12182603529333991f, - -0.121955958932614f, - -0.12208588048220613f, - -0.12221579993988924f, - -0.12234571730343764f, - -0.12247563257062566f, - -0.1226055457392268f, - -0.12273545680701461f, - -0.12286536577176352f, - -0.12299527263124801f, - -0.12312517738324176f, - -0.12325508002551884f, - -0.12338498055585254f, - -0.12351487897201882f, - -0.12364477527179102f, - -0.12377466945294338f, - -0.12390456151324936f, - -0.12403445145048503f, - -0.12416433926242387f, - -0.12429422494684031f, - -0.12442410850150791f, - -0.1245539899242029f, - -0.12468386921269892f, - -0.12481374636477054f, - -0.12494362137819232f, - -0.12507349425073802f, - -0.12520336498018408f, - -0.12533323356430429f, - -0.1254631000008734f, - -0.12559296428766534f, - -0.12572282642245663f, - -0.12585268640302125f, - -0.1259825442271341f, - -0.12611239989256917f, - -0.12624225339710327f, - -0.12637210473851043f, - -0.12650195391456573f, - -0.1266318009230438f, - -0.12676164576172014f, - -0.1268914884283704f, - -0.12702132892076926f, - -0.12715116723669154f, - -0.1272810033739129f, - -0.1274108373302091f, - -0.12754066910335507f, - -0.12767049869112565f, - -0.1278003260912967f, - -0.12793015130164417f, - -0.12805997431994262f, - -0.12818979514396844f, - -0.12831961377149675f, - -0.1284494302003027f, - -0.12857924442816238f, - -0.12870905645285186f, - -0.12883886627214644f, - -0.128968673883821f, - -0.12909847928565302f, - -0.12922828247541748f, - -0.12935808345089025f, - -0.1294878822098472f, - -0.1296176787500634f, - -0.12974747306931655f, - -0.1298772651653818f, - -0.1300070550360352f, - -0.13013684267905198f, - -0.13026662809220999f, - -0.13039641127328452f, - -0.13052619222005177f, - -0.13065597093028708f, - -0.13078574740176852f, - -0.13091552163227152f, - -0.13104529361957243f, - -0.1311750633614476f, - -0.13130483085567266f, - -0.13143459610002578f, - -0.13156435909228262f, - -0.13169411983021967f, - -0.1318238783116127f, - -0.13195363453424008f, - -0.13208338849587759f, - -0.1322131401943019f, - -0.13234288962728888f, - -0.1324726367926171f, - -0.13260238168806246f, - -0.13273212431140186f, - -0.13286186466041172f, - -0.13299160273286942f, - -0.13312133852655236f, - -0.1332510720392367f, - -0.13338080326870036f, - -0.13351053221271955f, - -0.1336402588690723f, - -0.13376998323553485f, - -0.13389970530988535f, - -0.1340294250899001f, - -0.13415914257335687f, - -0.13428885775803343f, - -0.13441857064170668f, - -0.13454828122215404f, - -0.13467798949715207f, - -0.13480769546448002f, - -0.13493739912191452f, - -0.13506710046723314f, - -0.13519679949821262f, - -0.13532649621263232f, - -0.13545619060826908f, - -0.13558588268290062f, - -0.1357155724343038f, - -0.1358452598602582f, - -0.13597494495854073f, - -0.13610462772692936f, - -0.13623430816320195f, - -0.1363639862651356f, - -0.13649366203051005f, - -0.1366233354571025f, - -0.13675300654269099f, - -0.1368826752850528f, - -0.1370123416819678f, - -0.13714200573121335f, - -0.13727166743056768f, - -0.13740132677780909f, - -0.137530983770715f, - -0.13766063840706552f, - -0.13779029068463822f, - -0.1379199406012115f, - -0.13804958815456297f, - -0.13817923334247295f, - -0.13830887616271909f, - -0.13843851661307954f, - -0.1385681546913334f, - -0.13869779039525984f, - -0.1388274237226371f, - -0.13895705467124353f, - -0.13908668323885878f, - -0.13921630942326088f, - -0.1393459332222291f, - -0.13947555463354286f, - -0.13960517365498068f, - -0.1397347902843211f, - -0.13986440451934365f, - -0.13999401635782788f, - -0.14012362579755241f, - -0.14025323283629562f, - -0.14038283747183847f, - -0.14051243970195929f, - -0.14064203952443743f, - -0.14077163693705225f, - -0.1409012319375822f, - -0.14103082452380847f, - -0.14116041469350968f, - -0.1412900024444653f, - -0.14141958777445404f, - -0.14154917068125722f, - -0.1416787511626536f, - -0.14180832921642286f, - -0.14193790484034385f, - -0.14206747803219805f, - -0.14219704878976439f, - -0.1423266171108227f, - -0.1424561829931529f, - -0.142585746434534f, - -0.14271530743274777f, - -0.14284486598557325f, - -0.1429744220907906f, - -0.14310397574617892f, - -0.14323352694952018f, - -0.14336307569859363f, - -0.14349262199117954f, - -0.14362216582505768f, - -0.14375170719800884f, - -0.14388124610781375f, - -0.14401078255225236f, - -0.1441403165291047f, - -0.14426984803615167f, - -0.14439937707117417f, - -0.14452890363195195f, - -0.14465842771626644f, - -0.14478794932189742f, - -0.14491746844662645f, - -0.14504698508823335f, - -0.1451764992444998f, - -0.14530601091320614f, - -0.14543552009213237f, - -0.14556502677906114f, - -0.14569453097177248f, - -0.14582403266804742f, - -0.14595353186566606f, - -0.14608302856241126f, - -0.14621252275606322f, - -0.1463420144444031f, - -0.14647150362521122f, - -0.14660099029627058f, - -0.14673047445536158f, - -0.14685995610026553f, - -0.14698943522876382f, - -0.14711891183863696f, - -0.14724838592766817f, - -0.14737785749363808f, - -0.1475073265343282f, - -0.14763679304751925f, - -0.14776625703099464f, - -0.14789571848253513f, - -0.14802517739992244f, - -0.14815463378093743f, - -0.14828408762336368f, - -0.14841353892498216f, - -0.14854298768357474f, - -0.14867243389692336f, - -0.1488018775628091f, - -0.14893131867901574f, - -0.1490607572433245f, - -0.14919019325351743f, - -0.14931962670737584f, - -0.14944905760268368f, - -0.14957848593722226f, - -0.14970791170877348f, - -0.14983733491512005f, - -0.14996675555404484f, - -0.15009617362332978f, - -0.15022558912075687f, - -0.15035500204410954f, - -0.15048441239116941f, - -0.15061382015971955f, - -0.150743225347543f, - -0.150872627952422f, - -0.15100202797213888f, - -0.15113142540447677f, - -0.15126082024721896f, - -0.15139021249814788f, - -0.1515196021550464f, - -0.15164898921569656f, - -0.15177837367788316f, - -0.15190775553938834f, - -0.15203713479799516f, - -0.15216651145148588f, - -0.15229588549764542f, - -0.1524252569342561f, - -0.15255462575910117f, - -0.15268399196996307f, - -0.15281335556462688f, - -0.15294271654087516f, - -0.1530720748964913f, - -0.15320143062925878f, - -0.15333078373696027f, - -0.15346013421738106f, - -0.15358948206830392f, - -0.15371882728751252f, - -0.15384816987278965f, - -0.15397750982192082f, - -0.15410684713268896f, - -0.15423618180287793f, - -0.1543655138302707f, - -0.15449484321265297f, - -0.15462416994780784f, - -0.15475349403351935f, - -0.15488281546757107f, - -0.15501213424774762f, - -0.15514145037183358f, - -0.15527076383761268f, - -0.15540007464286873f, - -0.15552938278538653f, - -0.1556586882629508f, - -0.15578799107334504f, - -0.15591729121435458f, - -0.15604658868376303f, - -0.1561758834793558f, - -0.15630517559891652f, - -0.15643446504023073f, - -0.15656375180108267f, - -0.15669303587925656f, - -0.15682231727253762f, - -0.15695159597871108f, - -0.15708087199556134f, - -0.15721014532087244f, - -0.15733941595243103f, - -0.15746868388802124f, - -0.1575979491254281f, - -0.15772721166243667f, - -0.15785647149683119f, - -0.15798572862639862f, - -0.15811498304892324f, - -0.15824423476219038f, - -0.1583734837639844f, - -0.15850273005209245f, - -0.15863197362429904f, - -0.15876121447838962f, - -0.15889045261214882f, - -0.1590196880233639f, - -0.1591489207098196f, - -0.1592781506693015f, - -0.15940737789959536f, - -0.159536602398486f, - -0.1596658241637609f, - -0.15979504319320506f, - -0.15992425948460431f, - -0.16005347303574372f, - -0.16018268384441095f, - -0.1603118919083912f, - -0.16044109722547048f, - -0.16057029979343404f, - -0.16069949961006977f, - -0.160828696673163f, - -0.16095789098049948f, - -0.16108708252986645f, - -0.16121627131904934f, - -0.1613454573458354f, - -0.16147464060801023f, - -0.16160382110336113f, - -0.1617329988296738f, - -0.16186217378473564f, - -0.16199134596633244f, - -0.16212051537225172f, - -0.1622496820002793f, - -0.16237884584820247f, - -0.1625080069138084f, - -0.16263716519488353f, - -0.16276632068921476f, - -0.1628954733945882f, - -0.16302462330879258f, - -0.1631537704296141f, - -0.16328291475483983f, - -0.16341205628225605f, - -0.16354119500965172f, - -0.16367033093481317f, - -0.16379946405552775f, - -0.16392859436958188f, - -0.1640577218747647f, - -0.16418684656886276f, - -0.1643159684496636f, - -0.16444508751495468f, - -0.16457420376252274f, - -0.16470331719015718f, - -0.16483242779564475f, - -0.16496153557677323f, - -0.16509064053132946f, - -0.16521974265710307f, - -0.165348841951881f, - -0.1654779384134512f, - -0.16560703203960164f, - -0.16573612282811945f, - -0.16586521077679442f, - -0.16599429588341386f, - -0.16612337814576583f, - -0.16625245756163776f, - -0.16638153412881962f, - -0.16651060784509883f, - -0.16663967870826332f, - -0.16676874671610195f, - -0.16689781186640357f, - -0.1670268741569563f, - -0.1671559335855482f, - -0.1672849901499688f, - -0.16741404384800584f, - -0.1675430946774485f, - -0.16767214263608587f, - -0.1678011877217064f, - -0.1679302299320985f, - -0.16805926926505146f, - -0.1681883057183547f, - -0.16831733928979672f, - -0.16844636997716575f, - -0.16857539777825262f, - -0.1687044226908456f, - -0.16883344471273384f, - -0.16896246384170666f, - -0.16909148007555241f, - -0.1692204934120622f, - -0.16934950384902456f, - -0.16947851138422892f, - -0.1696075160154639f, - -0.1697365177405208f, - -0.16986551655718832f, - -0.1699945124632561f, - -0.17012350545651295f, - -0.1702524955347504f, - -0.1703814826957573f, - -0.17051046693732355f, - -0.170639448257239f, - -0.17076842665329273f, - -0.17089740212327648f, - -0.17102637466497944f, - -0.17115534427619164f, - -0.1712843109547024f, - -0.17141327469830364f, - -0.1715422355047847f, - -0.17167119337193593f, - -0.1718001482975472f, - -0.17192910027940933f, - -0.1720580493153132f, - -0.1721869954030489f, - -0.17231593854040653f, - -0.17244487872517708f, - -0.17257381595515167f, - -0.17270275022812012f, - -0.172831681541874f, - -0.1729606098942033f, - -0.17308953528289972f, - -0.17321845770575328f, - -0.1733473771605558f, - -0.1734762936450978f, - -0.17360520715716957f, - -0.17373411769456384f, - -0.17386302525507097f, - -0.17399192983648212f, - -0.1741208314365877f, - -0.1742497300531807f, - -0.17437862568405169f, - -0.17450751832699204f, - -0.17463640797979232f, - -0.17476529464024582f, - -0.17489417830614318f, - -0.1750230589752761f, - -0.17515193664543613f, - -0.1752808113144142f, - -0.17540968298000378f, - -0.17553855163999585f, - -0.17566741729218227f, - -0.17579627993435404f, - -0.17592513956430494f, - -0.17605399617982612f, - -0.17618284977870963f, - -0.17631170035874671f, - -0.17644054791773134f, - -0.17656939245345485f, - -0.1766982339637095f, - -0.17682707244628765f, - -0.17695590789898083f, - -0.17708474031958318f, - -0.1772135697058864f, - -0.17734239605568292f, - -0.17747121936676455f, - -0.17760003963692564f, - -0.17772885686395806f, - -0.17785767104565406f, - -0.1779864821798074f, - -0.17811529026420997f, - -0.1782440952966556f, - -0.1783728972749364f, - -0.17850169619684622f, - -0.17863049206017728f, - -0.1787592848627231f, - -0.1788880746022773f, - -0.1790168612766327f, - -0.17914564488358206f, - -0.17927442542091923f, - -0.179403202886438f, - -0.17953197727793133f, - -0.17966074859319273f, - -0.17978951683001487f, - -0.17991828198619308f, - -0.18004704405952016f, - -0.18017580304778977f, - -0.1803045589487948f, - -0.18043331176033078f, - -0.18056206148019072f, - -0.18069080810616853f, - -0.18081955163605726f, - -0.18094829206765273f, - -0.18107702939874806f, - -0.18120576362713745f, - -0.181334494750615f, - -0.18146322276697413f, - -0.18159194767401082f, - -0.18172066946951854f, - -0.1818493881512917f, - -0.18197810371712383f, - -0.1821068161648112f, - -0.18223552549214747f, - -0.18236423169692725f, - -0.1824929347769443f, - -0.1826216347299951f, - -0.18275033155387355f, - -0.1828790252463744f, - -0.18300771580529215f, - -0.18313640322842212f, - -0.18326508751355972f, - -0.18339376865849957f, - -0.18352244666103631f, - -0.1836511215189655f, - -0.18377979323008278f, - -0.1839084617921825f, - -0.18403712720306087f, - -0.18416578946051235f, - -0.1842944485623332f, - -0.18442310450631805f, - -0.18455175729026324f, - -0.18468040691196394f, - -0.18480905336921488f, - -0.1849376966598135f, - -0.18506633678155465f, - -0.18519497373223412f, - -0.18532360750964685f, - -0.18545223811159053f, - -0.1855808655358602f, - -0.1857094897802519f, - -0.18583811084256163f, - -0.1859667287205847f, - -0.18609534341211897f, - -0.1862239549149598f, - -0.18635256322690347f, - -0.18648116834574546f, - -0.18660977026928388f, - -0.1867383689953143f, - -0.1868669645216332f, - -0.18699555684603628f, - -0.1871241459663219f, - -0.18725273188028582f, - -0.18738131458572477f, - -0.1875098940804355f, - -0.187638470362214f, - -0.1877670434288589f, - -0.1878956132781662f, - -0.18802417990793294f, - -0.18815274331595527f, - -0.18828130350003208f, - -0.1884098604579596f, - -0.18853841418753506f, - -0.18866696468655486f, - -0.18879551195281807f, - -0.18892405598412118f, - -0.1890525967782612f, - -0.18918113433303646f, - -0.18930966864624368f, - -0.18943819971568132f, - -0.18956672753914613f, - -0.18969525211443672f, - -0.18982377343934997f, - -0.18995229151168416f, - -0.19008080632923757f, - -0.19020931788980774f, - -0.1903378261911922f, - -0.1904663312311894f, - -0.1905948330075979f, - -0.19072333151821547f, - -0.19085182676084025f, - -0.19098031873326968f, - -0.19110880743330383f, - -0.19123729285874017f, - -0.19136577500737717f, - -0.19149425387701244f, - -0.19162272946544628f, - -0.19175120177047641f, - -0.19187967078990154f, - -0.1920081365215203f, - -0.19213659896313068f, - -0.1922650581125332f, - -0.19239351396752588f, - -0.1925219665259077f, - -0.19265041578547673f, - -0.19277886174403383f, - -0.1929073043993772f, - -0.19303574374930604f, - -0.1931641797916187f, - -0.19329261252411617f, - -0.19342104194459697f, - -0.19354946805086046f, - -0.19367789084070608f, - -0.19380631031193252f, - -0.19393472646234106f, - -0.19406313928973046f, - -0.19419154879189995f, - -0.19431995496664972f, - -0.19444835781178f, - -0.1945767573250902f, - -0.19470515350437978f, - -0.19483354634744918f, - -0.1949619358520988f, - -0.19509032201612836f, - -0.1952187048373375f, - -0.19534708431352732f, - -0.1954754604424972f, - -0.19560383322204783f, - -0.1957322026499801f, - -0.19586056872409394f, - -0.19598893144218943f, - -0.1961172908020675f, - -0.19624564680152923f, - -0.19637399943837483f, - -0.19650234871040412f, - -0.19663069461541963f, - -0.19675903715122128f, - -0.19688737631561f, - -0.19701571210638674f, - -0.1971440445213516f, - -0.19727237355830737f, - -0.19740069921505432f, - -0.19752902148939364f, - -0.19765734037912566f, - -0.1977856558820534f, - -0.19791396799597738f, - -0.198042276718699f, - -0.19817058204801882f, - -0.19829888398174014f, - -0.19842718251766364f, - -0.198555477653591f, - -0.19868376938732388f, - -0.19881205771666316f, - -0.19894034263941243f, - -0.19906862415337268f, - -0.19919690225634581f, - -0.199325176946133f, - -0.19945344822053798f, - -0.199581716077362f, - -0.19970998051440725f, - -0.19983824152947552f, - -0.19996649912036948f, - -0.20009475328489196f, - -0.20022300402084486f, - -0.2003512513260303f, - -0.20047949519825115f, - -0.20060773563531042f, - -0.20073597263500995f, - -0.20086420619515322f, - -0.20099243631354216f, - -0.20112066298798043f, - -0.20124888621627005f, - -0.2013771059962148f, - -0.20150532232561724f, - -0.20163353520227958f, - -0.20176174462400662f, - -0.20188995058860065f, - -0.20201815309386495f, - -0.2021463521376019f, - -0.20227454771761658f, - -0.20240273983171153f, - -0.20253092847769022f, - -0.20265911365335532f, - -0.2027872953565121f, - -0.20291547358496337f, - -0.2030436483365128f, - -0.2031718196089642f, - -0.20329998740012045f, - -0.20342815170778725f, - -0.2035563125297676f, - -0.20368446986386554f, - -0.20381262370788428f, - -0.2039407740596296f, - -0.20406892091690487f, - -0.2041970642775143f, - -0.20432520413926133f, - -0.2044533404999521f, - -0.20458147335739005f, - -0.20470960270937977f, - -0.20483772855372573f, - -0.2049658508882317f, - -0.20509396971070404f, - -0.20522208501894662f, - -0.20535019681076422f, - -0.2054783050839608f, - -0.205606409836343f, - -0.20573451106571494f, - -0.2058626087698812f, - -0.20599070294664765f, - -0.20611879359381866f, - -0.20624688070920025f, - -0.20637496429059682f, - -0.20650304433581457f, - -0.206631120842658f, - -0.206759193808933f, - -0.20688726323244552f, - -0.20701532911100068f, - -0.20714339144240365f, - -0.20727145022446058f, - -0.20739950545497765f, - -0.20752755713176022f, - -0.20765560525261414f, - -0.20778364981534453f, - -0.20791169081775907f, - -0.20803972825766295f, - -0.2081677621328623f, - -0.20829579244116242f, - -0.20842381918037128f, - -0.2085518423482943f, - -0.20867986194273783f, - -0.20880787796150746f, - -0.20893589040241137f, - -0.20906389926325525f, - -0.2091919045418457f, - -0.20931990623598937f, - -0.20944790434349211f, - -0.2095758988621625f, - -0.20970388978980645f, - -0.20983187712423093f, - -0.209959860863242f, - -0.21008784100464845f, - -0.2102158175462565f, - -0.21034379048587332f, - -0.21047175982130523f, - -0.21059972555036127f, - -0.2107276876708479f, - -0.21085564618057256f, - -0.21098360107734224f, - -0.21111155235896492f, - -0.2112395000232486f, - -0.21136744406800054f, - -0.21149538449102798f, - -0.21162332129013914f, - -0.2117512544631423f, - -0.2118791840078445f, - -0.21200710992205454f, - -0.2121350322035796f, - -0.21226295085022864f, - -0.21239086585980893f, - -0.21251877723012952f, - -0.2126466849589983f, - -0.2127745890442227f, - -0.21290248948361287f, - -0.21303038627497642f, - -0.21315827941612184f, - -0.21328616890485685f, - -0.21341405473899186f, - -0.2135419369163347f, - -0.21366981543469413f, - -0.213797690291879f, - -0.21392556148569736f, - -0.21405342901395988f, - -0.2141812928744747f, - -0.21430915306505094f, - -0.21443700958349687f, - -0.21456486242762346f, - -0.2146927115952391f, - -0.2148205570841531f, - -0.21494839889217404f, - -0.2150762370171131f, - -0.21520407145677894f, - -0.21533190220898116f, - -0.2154597292715294f, - -0.21558755264223253f, - -0.21571537231890206f, - -0.21584318829934698f, - -0.21597100058137716f, - -0.21609880916280172f, - -0.21622661404143245f, - -0.21635441521507853f, - -0.21648221268155018f, - -0.21661000643865674f, - -0.21673779648421024f, - -0.2168655828160201f, - -0.2169933654318964f, - -0.21712114432965043f, - -0.21724891950709188f, - -0.21737669096203222f, - -0.21750445869228124f, - -0.21763222269565055f, - -0.2177599829699501f, - -0.21788773951299117f, - -0.21801549232258513f, - -0.2181432413965425f, - -0.21827098673267395f, - -0.218398728328791f, - -0.2185264661827053f, - -0.21865420029222762f, - -0.2187819306551693f, - -0.21890965726934083f, - -0.21903738013255541f, - -0.21916509924262365f, - -0.2192928145973571f, - -0.21942052619456656f, - -0.21954823403206547f, - -0.21967593810766467f, - -0.21980363841917605f, - -0.21993133496441145f, - -0.22005902774118197f, - -0.2201867167473014f, - -0.2203144019805809f, - -0.22044208343883262f, - -0.22056976111986795f, - -0.22069743502150088f, - -0.2208251051415429f, - -0.2209527714778064f, - -0.22108043402810296f, - -0.2212080927902469f, - -0.22133574776204992f, - -0.22146339894132472f, - -0.22159104632588397f, - -0.22171868991353968f, - -0.22184632970210638f, - -0.22197396568939617f, - -0.2221015978732216f, - -0.22222922625139613f, - -0.22235685082173334f, - -0.22248447158204598f, - -0.22261208853014688f, - -0.22273970166384982f, - -0.22286731098096854f, - -0.22299491647931569f, - -0.22312251815670558f, - -0.22325011601095143f, - -0.22337771003986642f, - -0.22350530024126472f, - -0.2236328866129605f, - -0.22376046915276715f, - -0.22388804785849778f, - -0.22401562272796807f, - -0.22414319375899117f, - -0.2242707609493812f, - -0.22439832429695147f, - -0.22452588379951793f, - -0.22465343945489405f, - -0.22478099126089415f, - -0.22490853921533271f, - -0.22503608331602334f, - -0.22516362356078234f, - -0.2252911599474235f, - -0.2254186924737615f, - -0.22554622113761022f, - -0.22567374593678624f, - -0.2258012668691036f, - -0.22592878393237725f, - -0.22605629712442224f, - -0.22618380644305278f, - -0.22631131188608575f, - -0.22643881345133554f, - -0.22656631113661746f, - -0.22669380493974595f, - -0.22682129485853822f, - -0.22694878089080886f, - -0.22707626303437348f, - -0.2272037412870468f, - -0.22733121564664627f, - -0.22745868611098677f, - -0.22758615267788412f, - -0.2277136153451538f, - -0.22784107411061222f, - -0.2279685289720758f, - -0.2280959799273598f, - -0.22822342697428125f, - -0.2283508701106555f, - -0.22847830933429972f, - -0.22860574464302938f, - -0.2287331760346618f, - -0.22886060350701262f, - -0.22898802705789928f, - -0.2291154466851375f, - -0.2292428623865449f, - -0.22937027415993777f, - -0.2294976820031321f, - -0.22962508591394648f, - -0.2297524858901971f, - -0.2298798819297009f, - -0.23000727403027418f, - -0.23013466218973583f, - -0.23026204640590223f, - -0.23038942667659065f, - -0.23051680299961763f, - -0.23064417537280232f, - -0.2307715437939614f, - -0.23089890826091242f, - -0.231026268771473f, - -0.23115362532346004f, - -0.23128097791469301f, - -0.2314083265429889f, - -0.23153567120616564f, - -0.23166301190204036f, - -0.2317903486284328f, - -0.23191768138316024f, - -0.23204501016404086f, - -0.23217233496889209f, - -0.2322996557955339f, - -0.2324269726417839f, - -0.2325542855054605f, - -0.23268159438438227f, - -0.2328088992763669f, - -0.23293620017923478f, - -0.23306349709080382f, - -0.23319079000889237f, - -0.23331807893131973f, - -0.23344536385590528f, - -0.23357264478046758f, - -0.2336999217028253f, - -0.2338271946207984f, - -0.23395446353220528f, - -0.23408172843486608f, - -0.23420898932659923f, - -0.23433624620522508f, - -0.23446349906856223f, - -0.23459074791443066f, - -0.23471799274065042f, - -0.2348452335450408f, - -0.23497247032542112f, - -0.23509970307961164f, - -0.2352269318054327f, - -0.23535415650070382f, - -0.23548137716324508f, - -0.23560859379087565f, - -0.2357358063814175f, - -0.23586301493269002f, - -0.23599021944251347f, - -0.2361174199087074f, - -0.23624461632909402f, - -0.23637180870149296f, - -0.2364989970237248f, - -0.23662618129360935f, - -0.23675336150896908f, - -0.23688053766762393f, - -0.23700770976739477f, - -0.2371348778061025f, - -0.23726204178156735f, - -0.23738920169161204f, - -0.23751635753405692f, - -0.23764350930672315f, - -0.23777065700743122f, - -0.23789780063400415f, - -0.23802494018426254f, - -0.23815207565602792f, - -0.2382792070471209f, - -0.23840633435536496f, - -0.23853345757858088f, - -0.23866057671459043f, - -0.23878769176121503f, - -0.23891480271627707f, - -0.23904190957759894f, - -0.23916901234300225f, - -0.23929611101030873f, - -0.239423205577341f, - -0.23955029604192177f, - -0.23967738240187247f, - -0.23980446465501642f, - -0.23993154279917567f, - -0.2400586168321723f, - -0.24018568675182939f, - -0.24031275255597007f, - -0.24043981424241664f, - -0.2405668718089911f, - -0.24069392525351807f, - -0.24082097457381965f, - -0.2409480197677189f, - -0.24107506083303806f, - -0.24120209776760204f, - -0.24132913056923322f, - -0.24145615923575497f, - -0.24158318376499066f, - -0.2417102041547629f, - -0.24183722040289696f, - -0.24196423250721558f, - -0.24209124046554242f, - -0.24221824427570043f, - -0.2423452439355151f, - -0.24247223944280952f, - -0.2425992307954076f, - -0.24272621799113253f, - -0.24285320102781016f, - -0.24298017990326382f, - -0.24310715461531773f, - -0.2432341251617962f, - -0.24336109154052282f, - -0.24348805374932372f, - -0.24361501178602263f, - -0.2437419656484441f, - -0.243868915334412f, - -0.24399586084175276f, - -0.24412280216829035f, - -0.2442497393118497f, - -0.2443766722702549f, - -0.2445036010413327f, - -0.24463052562290732f, - -0.24475744601280358f, - -0.24488436220884754f, - -0.2450112742088637f, - -0.24513818201067827f, - -0.2452650856121159f, - -0.24539198501100298f, - -0.24551888020516427f, - -0.2456457711924259f, - -0.24577265797061398f, - -0.245899540537554f, - -0.24602641889107138f, - -0.24615329302899255f, - -0.24628016294914398f, - -0.24640702864935132f, - -0.24653389012744084f, - -0.24666074738123786f, - -0.2467876004085705f, - -0.24691444920726427f, - -0.24704129377514564f, - -0.24716813411004035f, - -0.2472949702097767f, - -0.24742180207218054f, - -0.24754862969507865f, - -0.24767545307629787f, - -0.24780227221366427f, - -0.24792908710500652f, - -0.24805589774815087f, - -0.24818270414092442f, - -0.2483095062811535f, - -0.24843630416666715f, - -0.24856309779529184f, - -0.24868988716485502f, - -0.24881667227318327f, - -0.24894345311810595f, - -0.24907022969744982f, - -0.24919700200904257f, - -0.24932377005071205f, - -0.2494505338202852f, - -0.2495772933155917f, - -0.24970404853445874f, - -0.2498307994747139f, - -0.24995754613418583f, - -0.25008428851070313f, - -0.25021102660209377f, - -0.2503377604061856f, - -0.25046448992080755f, - -0.2505912151437885f, - -0.25071793607295634f, - -0.2508446527061405f, - -0.25097136504116924f, - -0.25109807307587106f, - -0.2512247768080752f, - -0.2513514762356111f, - -0.2514781713563074f, - -0.25160486216799227f, - -0.2517315486684967f, - -0.251858230855649f, - -0.2519849087272786f, - -0.252111582281214f, - -0.2522382515152864f, - -0.2523649164273245f, - -0.25249157701515795f, - -0.2526182332766164f, - -0.25274488520952887f, - -0.25287153281172686f, - -0.2529981760810394f, - -0.2531248150152966f, - -0.2532514496123276f, - -0.2533780798699643f, - -0.253504705786036f, - -0.2536313273583731f, - -0.25375794458480594f, - -0.2538845574631641f, - -0.2540111659912798f, - -0.2541377701669828f, - -0.25426436998810376f, - -0.2543909654524726f, - -0.25451755655792174f, - -0.2546441433022814f, - -0.25477072568338244f, - -0.25489730369905506f, - -0.2550238773471321f, - -0.2551504466254439f, - -0.25527701153182175f, - -0.25540357206409653f, - -0.2555301282201001f, - -0.2556566799976644f, - -0.25578322739462006f, - -0.2559097704087997f, - -0.25603630903803415f, - -0.25616284328015604f, - -0.2562893731329964f, - -0.25641589859438796f, - -0.256542419662162f, - -0.25666893633415094f, - -0.2567954486081875f, - -0.25692195648210336f, - -0.25704845995373093f, - -0.2571749590209017f, - -0.2573014536814499f, - -0.2574279439332072f, - -0.2575544297740062f, - -0.25768091120167885f, - -0.2578073882140595f, - -0.25793386080898023f, - -0.25806032898427395f, - -0.25818679273777273f, - -0.2583132520673115f, - -0.25843970697072244f, - -0.25856615744583883f, - -0.25869260349049394f, - -0.25881904510252035f, - -0.25894548227975317f, - -0.25907191502002513f, - -0.25919834332116987f, - -0.2593247671810201f, - -0.2594511865974114f, - -0.25957760156817666f, - -0.2597040120911499f, - -0.2598304181641642f, - -0.25995681978505525f, - -0.26008321695165654f, - -0.26020960966180207f, - -0.2603359979133263f, - -0.26046238170406266f, - -0.26058876103184736f, - -0.260715135894514f, - -0.26084150628989683f, - -0.2609678722158309f, - -0.2610942336701514f, - -0.26122059065069275f, - -0.26134694315528945f, - -0.2614732911817773f, - -0.26159963472799047f, - -0.26172597379176465f, - -0.26185230837093537f, - -0.2619786384633375f, - -0.26210496406680606f, - -0.2622312851791768f, - -0.2623576017982858f, - -0.2624839139219682f, - -0.2626102215480592f, - -0.26273652467439496f, - -0.2628628232988118f, - -0.26298911741914516f, - -0.26311540703323105f, - -0.2632416921389047f, - -0.2633679727340039f, - -0.2634942488163641f, - -0.26362052038382144f, - -0.26374678743421154f, - -0.2638730499653726f, - -0.2639993079751402f, - -0.264125561461351f, - -0.2642518104218408f, - -0.2643780548544481f, - -0.2645042947570088f, - -0.2646305301273599f, - -0.26475676096333833f, - -0.26488298726278037f, - -0.2650092090235248f, - -0.2651354262434081f, - -0.26526163892026744f, - -0.2653878470519394f, - -0.2655140506362632f, - -0.26564024967107547f, - -0.2657664441542138f, - -0.26589263408351504f, - -0.2660188194568187f, - -0.26614500027196175f, - -0.26627117652678217f, - -0.2663973482191174f, - -0.26652351534680613f, - -0.2666496779076868f, - -0.2667758358995973f, - -0.2669019893203755f, - -0.2670281381678602f, - -0.26715428243989037f, - -0.2672804221343036f, - -0.26740655724893947f, - -0.2675326877816362f, - -0.26765881373023215f, - -0.2677849350925667f, - -0.2679110518664791f, - -0.26803716404980804f, - -0.2681632716403917f, - -0.26828937463607105f, - -0.26841547303468444f, - -0.2685415668340712f, - -0.26866765603206993f, - -0.2687937406265218f, - -0.26891982061526554f, - -0.26904589599614076f, - -0.2691719667669873f, - -0.269298032925644f, - -0.2694240944699526f, - -0.26955015139775207f, - -0.2696762037068825f, - -0.2698022513951832f, - -0.2699282944604961f, - -0.27005433290066055f, - -0.270180366713517f, - -0.27030639589690497f, - -0.2704324204486668f, - -0.27055844036664206f, - -0.2706844556486716f, - -0.2708104662925961f, - -0.27093647229625556f, - -0.27106247365749264f, - -0.2711884703741475f, - -0.27131446244406116f, - -0.27144044986507393f, - -0.2715664326350288f, - -0.27169241075176614f, - -0.2718183842131275f, - -0.2719443530169534f, - -0.27207031716108715f, - -0.27219627664336954f, - -0.2723222314616418f, - -0.2724481816137466f, - -0.27257412709752504f, - -0.27270006791081985f, - -0.2728260040514723f, - -0.2729519355173252f, - -0.27307786230622005f, - -0.2732037844159995f, - -0.2733297018445064f, - -0.2734556145895826f, - -0.2735815226490708f, - -0.27370742602081266f, - -0.27383332470265254f, - -0.2739592186924324f, - -0.27408510798799507f, - -0.27421099258718257f, - -0.27433687248783967f, - -0.2744627476878086f, - -0.27458861818493246f, - -0.27471448397705367f, - -0.27484034506201727f, - -0.27496620143766587f, - -0.2750920531018428f, - -0.2752179000523918f, - -0.2753437422871555f, - -0.2754695798039795f, - -0.27559541260070664f, - -0.27572124067518083f, - -0.2758470640252452f, - -0.27597288264874553f, - -0.27609869654352504f, - -0.276224505707428f, - -0.2763503101382978f, - -0.2764761098339806f, - -0.2766019047923199f, - -0.2767276950111603f, - -0.2768534804883464f, - -0.27697926122172206f, - -0.2771050372091338f, - -0.27723080844842557f, - -0.27735657493744187f, - -0.2774823366740282f, - -0.2776080936560301f, - -0.27773384588129235f, - -0.2778595933476597f, - -0.277985336052978f, - -0.2781110739950931f, - -0.2782368071718497f, - -0.2783625355810941f, - -0.2784882592206717f, - -0.2786139780884278f, - -0.2787396921822087f, - -0.27886540149986067f, - -0.2789911060392293f, - -0.27911680579815984f, - -0.2792425007745002f, - -0.2793681909660958f, - -0.2794938763707928f, - -0.279619556986437f, - -0.27974523281087643f, - -0.2798709038419569f, - -0.279996570077525f, - -0.28012223151542753f, - -0.2802478881535105f, - -0.2803735399896224f, - -0.2804991870216095f, - -0.28062482924731874f, - -0.2807504666645965f, - -0.2808760992712918f, - -0.28100172706525095f, - -0.28112735004432143f, - -0.28125296820635076f, - -0.28137858154918555f, - -0.28150419007067523f, - -0.2816297937686667f, - -0.28175539264100774f, - -0.28188098668554534f, - -0.2820065759001293f, - -0.28213216028260674f, - -0.2822577398308258f, - -0.28238331454263393f, - -0.2825088844158811f, - -0.28263444944841487f, - -0.2827600096380837f, - -0.2828855649827357f, - -0.28301111548022f, - -0.28313666112838576f, - -0.28326220192508084f, - -0.283387737868155f, - -0.2835132689554565f, - -0.28363879518483515f, - -0.2837643165541392f, - -0.2838898330612188f, - -0.28401534470392237f, - -0.2841408514800997f, - -0.28426635338760076f, - -0.2843918504242747f, - -0.28451734258797107f, - -0.28464282987653877f, - -0.2847683122878294f, - -0.2848937898196919f, - -0.2850192624699762f, - -0.2851447302365317f, - -0.2852701931172101f, - -0.28539565110986076f, - -0.28552110421233406f, - -0.28564655242247955f, - -0.2857719957381494f, - -0.28589743415719326f, - -0.2860228676774619f, - -0.2861482962968059f, - -0.28627372001307533f, - -0.28639913882412277f, - -0.2865245527277983f, - -0.28664996172195306f, - -0.2867753658044373f, - -0.28690076497310396f, - -0.28702615922580355f, - -0.28715154856038744f, - -0.28727693297470713f, - -0.28740231246661335f, - -0.28752768703395937f, - -0.28765305667459623f, - -0.28777842138637566f, - -0.2879037811671487f, - -0.2880291360147691f, - -0.28815448592708803f, - -0.28827983090195736f, - -0.2884051709372296f, - -0.2885305060307576f, - -0.2886558361803933f, - -0.28878116138398885f, - -0.2889064816393976f, - -0.28903179694447145f, - -0.2891571072970635f, - -0.2892824126950271f, - -0.2894077131362147f, - -0.2895330086184789f, - -0.2896582991396732f, - -0.28978358469765125f, - -0.2899088652902658f, - -0.2900341409153695f, - -0.29015941157081737f, - -0.2902846772544621f, - -0.29040993796415737f, - -0.29053519369775677f, - -0.29066044445311323f, - -0.29078569022808237f, - -0.2909109310205173f, - -0.291036166828272f, - -0.29116139764919974f, - -0.29128662348115647f, - -0.2914118443219956f, - -0.2915370601695715f, - -0.29166227102173775f, - -0.29178747687635065f, - -0.291912677731264f, - -0.2920378735843324f, - -0.29216306443341084f, - -0.2922882502763532f, - -0.2924134311110162f, - -0.2925386069352541f, - -0.2926637777469219f, - -0.2927889435438742f, - -0.2929141043239678f, - -0.29303926008505743f, - -0.2931644108249985f, - -0.29328955654164574f, - -0.2934146972328565f, - -0.29353983289648566f, - -0.2936649635303891f, - -0.2937900891324224f, - -0.29391520970044177f, - -0.2940403252323039f, - -0.29416543572586407f, - -0.2942905411789794f, - -0.2944156415895054f, - -0.2945407369552993f, - -0.29466582727421686f, - -0.2947909125441155f, - -0.29491599276285146f, - -0.2950410679282808f, - -0.2951661380382619f, - -0.295291203090651f, - -0.2954162630833051f, - -0.2955413180140805f, - -0.29566636788083617f, - -0.29579141268142845f, - -0.2959164524137148f, - -0.2960414870755518f, - -0.29616651666479876f, - -0.29629154117931245f, - -0.29641656061695065f, - -0.29654157497557115f, - -0.29666658425303105f, - -0.29679158844719006f, - -0.29691658755590533f, - -0.2970415815770351f, - -0.29716657050843676f, - -0.2972915543479704f, - -0.29741653309349353f, - -0.2975415067428648f, - -0.2976664752939418f, - -0.297791438744585f, - -0.2979163970926524f, - -0.2980413503360028f, - -0.2981662984724952f, - -0.29829124149998776f, - -0.29841617941634135f, - -0.2985411122194143f, - -0.29866603990706597f, - -0.2987909624771549f, - -0.29891587992754226f, - -0.2990407922560867f, - -0.29916569946064764f, - -0.29929060153908504f, - -0.2994154984892593f, - -0.2995403903090299f, - -0.29966527699625645f, - -0.2997901585487998f, - -0.2999150349645194f, - -0.30003990624127624f, - -0.30016477237692996f, - -0.30028963336934184f, - -0.30041448921637154f, - -0.30053933991588017f, - -0.30066418546572876f, - -0.3007890258637778f, - -0.30091386110788815f, - -0.3010386911959199f, - -0.30116351612573594f, - -0.30128833589519644f, - -0.30141315050216266f, - -0.30153795994449517f, - -0.30166276422005706f, - -0.301787563326709f, - -0.30191235726231247f, - -0.30203714602472853f, - -0.3021619296118205f, - -0.3022867080214494f, - -0.30241148125147727f, - -0.3025362492997661f, - -0.3026610121641772f, - -0.30278576984257444f, - -0.3029105223328193f, - -0.3030352696327742f, - -0.3031600117403008f, - -0.3032847486532634f, - -0.30340948036952364f, - -0.3035342068869445f, - -0.30365892820338786f, - -0.3037836443167184f, - -0.3039083552247982f, - -0.3040330609254905f, - -0.3041577614166584f, - -0.3042824566961644f, - -0.3044071467618735f, - -0.30453183161164843f, - -0.3046565112433523f, - -0.30478118565484913f, - -0.30490585484400307f, - -0.3050305188086776f, - -0.30515517754673616f, - -0.3052798310560432f, - -0.30540447933446324f, - -0.30552912237985963f, - -0.30565376019009743f, - -0.3057783927630407f, - -0.3059030200965533f, - -0.30602764218850037f, - -0.30615225903674687f, - -0.3062768706391571f, - -0.30640147699359505f, - -0.3065260780979273f, - -0.30665067395001805f, - -0.30677526454773235f, - -0.3068998498889345f, - -0.3070244299714915f, - -0.30714900479326784f, - -0.30727357435212893f, - -0.3073981386459404f, - -0.3075226976725669f, - -0.3076472514298759f, - -0.30777179991573245f, - -0.3078963431280023f, - -0.3080208810645506f, - -0.3081454137232452f, - -0.3082699411019514f, - -0.3083944631985354f, - -0.30851898001086364f, - -0.30864349153680165f, - -0.30876799777421765f, - -0.30889249872097746f, - -0.30901699437494773f, - -0.30914148473399444f, - -0.30926596979598614f, - -0.309390449558789f, - -0.30951492402027014f, - -0.30963939317829586f, - -0.309763857030735f, - -0.30988831557545415f, - -0.31001276881032075f, - -0.3101372167332019f, - -0.3102616593419656f, - -0.31038609663448f, - -0.3105105286086121f, - -0.3106349552622306f, - -0.31075937659320263f, - -0.31088379259939714f, - -0.3110082032786814f, - -0.31113260862892456f, - -0.3112570086479941f, - -0.31138140333375885f, - -0.31150579268408785f, - -0.3116301766968492f, - -0.31175455536991176f, - -0.3118789287011433f, - -0.31200329668841453f, - -0.3121276593295936f, - -0.3122520166225495f, - -0.3123763685651506f, - -0.3125007151552679f, - -0.3126250563907698f, - -0.3127493922695259f, - -0.3128737227894048f, - -0.3129980479482778f, - -0.31312236774401386f, - -0.3132466821744827f, - -0.31337099123755424f, - -0.31349529493109773f, - -0.31361959325298483f, - -0.31374388620108495f, - -0.3138681737732683f, - -0.3139924559674045f, - -0.31411673278136565f, - -0.31424100421302137f, - -0.31436527026024247f, - -0.31448953092089954f, - -0.3146137861928626f, - -0.3147380360740043f, - -0.3148622805621948f, - -0.31498651965530516f, - -0.31511075335120575f, - -0.3152349816477696f, - -0.31535920454286714f, - -0.3154834220343695f, - -0.3156076341201487f, - -0.31573184079807676f, - -0.315856042066025f, - -0.3159802379218649f, - -0.3161044283634692f, - -0.31622861338870906f, - -0.3163527929954571f, - -0.3164769671815859f, - -0.3166011359449674f, - -0.31672529928347354f, - -0.31684945719497726f, - -0.3169736096773515f, - -0.3170977567284686f, - -0.31722189834620046f, - -0.31734603452842164f, - -0.31747016527300426f, - -0.3175942905778214f, - -0.3177184104407461f, - -0.31784252485965087f, - -0.3179666338324107f, - -0.31809073735689813f, - -0.3182148354309867f, - -0.3183389280525492f, - -0.3184630152194611f, - -0.31858709692959514f, - -0.3187111731808254f, - -0.318835243971025f, - -0.31895930929806965f, - -0.3190833691598327f, - -0.3192074235541884f, - -0.31933147247901117f, - -0.3194555159321746f, - -0.31957955391155485f, - -0.31970358641502583f, - -0.31982761344046223f, - -0.31995163498573803f, - -0.3200756510487298f, - -0.32019966162731184f, - -0.32032366671935913f, - -0.3204476663227465f, - -0.32057166043534974f, - -0.32069564905504455f, - -0.3208196321797061f, - -0.3209436098072095f, - -0.3210675819354308f, - -0.32119154856224624f, - -0.3213155096855309f, - -0.32143946530316153f, - -0.3215634154130133f, - -0.3216873600129633f, - -0.3218112991008868f, - -0.3219352326746611f, - -0.3220591607321622f, - -0.32218308327126566f, - -0.32230700028984993f, - -0.3224309117857908f, - -0.3225548177569651f, - -0.32267871820124894f, - -0.3228026131165209f, - -0.32292650250065735f, - -0.3230503863515354f, - -0.3231742646670315f, - -0.3232981374450247f, - -0.3234220046833917f, - -0.32354586638001004f, - -0.32366972253275733f, - -0.32379357313951057f, - -0.3239174181981492f, - -0.3240412577065504f, - -0.3241650916625922f, - -0.3242889200641519f, - -0.3244127429091094f, - -0.32453656019534216f, - -0.32466037192072866f, - -0.3247841780831466f, - -0.32490797868047616f, - -0.32503177371059533f, - -0.3251555631713829f, - -0.32527934706071765f, - -0.32540312537647786f, - -0.3255268981165443f, - -0.32565066527879527f, - -0.3257744268611101f, - -0.32589818286136724f, - -0.32602193327744794f, - -0.3261456781072309f, - -0.32626941734859527f, - -0.3263931509994214f, - -0.32651687905758947f, - -0.326640601520979f, - -0.3267643183874697f, - -0.3268880296549425f, - -0.3270117353212768f, - -0.32713543538435336f, - -0.327259129842053f, - -0.3273828186922559f, - -0.3275065019328422f, - -0.32763017956169305f, - -0.32775385157668974f, - -0.32787751797571274f, - -0.32800117875664303f, - -0.3281248339173609f, - -0.32824848345574925f, - -0.3283721273696885f, - -0.32849576565706007f, - -0.32861939831574455f, - -0.3287430253436253f, - -0.3288666467385831f, - -0.32899026249849983f, - -0.3291138726212564f, - -0.3292374771047365f, - -0.3293610759468214f, - -0.32948466914539326f, - -0.3296082566983343f, - -0.32973183860352606f, - -0.3298554148588527f, - -0.32997898546219595f, - -0.3301025504114384f, - -0.330226109704462f, - -0.3303496633391513f, - -0.33047321131338825f, - -0.3305967536250561f, - -0.33072029027203703f, - -0.330843821252216f, - -0.33096734656347543f, - -0.3310908662036988f, - -0.33121438017076926f, - -0.33133788846257073f, - -0.33146139107698747f, - -0.3315848880119028f, - -0.3317083792652002f, - -0.3318318648347642f, - -0.3319553447184792f, - -0.33207881891422864f, - -0.33220228741989766f, - -0.33232575023336985f, - -0.3324492073525305f, - -0.3325726587752633f, - -0.33269610449945397f, - -0.33281954452298673f, - -0.3329429788437461f, - -0.3330664074596174f, - -0.3331898303684863f, - -0.33331324756823744f, - -0.3334366590567553f, - -0.3335600648319269f, - -0.3336834648916369f, - -0.33380685923377096f, - -0.3339302478562146f, - -0.33405363075685285f, - -0.3341770079335732f, - -0.33430037938426077f, - -0.33442374510680173f, - -0.33454710509908125f, - -0.33467045935898737f, - -0.3347938078844056f, - -0.3349171506732224f, - -0.33504048772332345f, - -0.33516381903259707f, - -0.3352871445989292f, - -0.3354104644202067f, - -0.33553377849431654f, - -0.33565708681914486f, - -0.33578038939258054f, - -0.33590368621250993f, - -0.33602697727682046f, - -0.33615026258339864f, - -0.3362735421301337f, - -0.3363968159149125f, - -0.3365200839356227f, - -0.3366433461901514f, - -0.33676660267638814f, - -0.3368898533922201f, - -0.33701309833553544f, - -0.33713633750422195f, - -0.3372595708961684f, - -0.33738279850926367f, - -0.3375060203413954f, - -0.33762923639045306f, - -0.3377524466543246f, - -0.33787565113089957f, - -0.33799884981806616f, - -0.33812204271371415f, - -0.3382452298157319f, - -0.338368411122009f, - -0.3384915866304352f, - -0.33861475633889954f, - -0.3387379202452915f, - -0.3388610783474999f, - -0.33898423064341604f, - -0.33910737713092903f, - -0.3392305178079287f, - -0.3393536526723043f, - -0.3394767817219475f, - -0.3395999049547478f, - -0.3397230223685955f, - -0.3398461339613801f, - -0.33996923973099386f, - -0.3400923396753266f, - -0.34021543379226893f, - -0.3403385220797117f, - -0.340461604535545f, - -0.3405846811576616f, - -0.34070775194395164f, - -0.3408308168923064f, - -0.3409538760006164f, - -0.34107692926677463f, - -0.3411999766886718f, - -0.3413230182641996f, - -0.34144605399124967f, - -0.34156908386771306f, - -0.34169210789148324f, - -0.3418151260604515f, - -0.34193813837250997f, - -0.3420611448255499f, - -0.3421841454174654f, - -0.342307140146148f, - -0.3424301290094898f, - -0.3425531120053839f, - -0.34267608913172337f, - -0.3427990603864006f, - -0.3429220257673082f, - -0.34304498527233984f, - -0.343167938899388f, - -0.3432908866463462f, - -0.34341382851110824f, - -0.3435367644915671f, - -0.3436596945856159f, - -0.34378261879114863f, - -0.34390553710605953f, - -0.34402844952824196f, - -0.344151356055589f, - -0.34427425668599637f, - -0.3443971514173574f, - -0.3445200402475662f, - -0.3446429231745172f, - -0.34476580019610403f, - -0.3448886713102228f, - -0.34501153651476746f, - -0.3451343958076326f, - -0.34525724918671225f, - -0.34538009664990305f, - -0.34550293819509925f, - -0.3456257738201959f, - -0.34574860352308745f, - -0.3458714273016709f, - -0.345994245153841f, - -0.3461170570774931f, - -0.3462398630705229f, - -0.34636266313082537f, - -0.34648545725629804f, - -0.34660824544483604f, - -0.34673102769433534f, - -0.34685380400269133f, - -0.34697657436780194f, - -0.34709933878756266f, - -0.34722209725987f, - -0.34734484978262015f, - -0.34746759635371005f, - -0.34759033697103703f, - -0.3477130716324975f, - -0.34783580033598793f, - -0.34795852307940595f, - -0.3480812398606491f, - -0.34820395067761384f, - -0.34832665552819836f, - -0.34844935441029934f, - -0.3485720473218151f, - -0.3486947342606427f, - -0.34881741522468057f, - -0.3489400902118263f, - -0.34906275921997704f, - -0.34918542224703253f, - -0.34930807929089014f, - -0.34943073034944816f, - -0.34955337542060416f, - -0.3496760145022584f, - -0.3497986475923086f, - -0.3499212746886534f, - -0.35004389578919093f, - -0.3501665108918217f, - -0.3502891199944439f, - -0.35041172309495666f, - -0.35053432019125924f, - -0.3506569112812501f, - -0.35077949636283035f, - -0.3509020754338987f, - -0.3510246484923547f, - -0.35114721553609746f, - -0.3512697765630283f, - -0.3513923315710465f, - -0.35151488055805197f, - -0.35163742352194416f, - -0.35175996046062485f, - -0.3518824913719937f, - -0.3520050162539511f, - -0.35212753510439765f, - -0.3522500479212332f, - -0.3523725547023602f, - -0.3524950554456786f, - -0.3526175501490895f, - -0.3527400388104931f, - -0.3528625214277923f, - -0.3529849979988875f, - -0.3531074685216797f, - -0.3532299329940708f, - -0.35335239141396285f, - -0.35347484377925714f, - -0.3535972900878551f, - -0.3537197303376594f, - -0.3538421645265713f, - -0.35396459265249325f, - -0.354087014713328f, - -0.3542094307069774f, - -0.3543318406313435f, - -0.35445424448432916f, - -0.3545766422638376f, - -0.354699033967771f, - -0.35482141959403235f, - -0.35494379914052365f, - -0.3550661726051497f, - -0.35518853998581285f, - -0.35531090128041626f, - -0.3554332564868625f, - -0.3555556056030569f, - -0.3556779486269019f, - -0.3558002855563014f, - -0.3559226163891583f, - -0.35604494112337814f, - -0.35616725975686414f, - -0.35628957228752034f, - -0.356411878713251f, - -0.35653417903195955f, - -0.3566564732415521f, - -0.3567787613399323f, - -0.3569010433250049f, - -0.3570233191946736f, - -0.3571455889468451f, - -0.3572678525794234f, - -0.3573901100903135f, - -0.3575123614774199f, - -0.35763460673864933f, - -0.3577568458719064f, - -0.35787907887509657f, - -0.358001305746125f, - -0.3581235264828978f, - -0.3582457410833211f, - -0.35836794954530043f, - -0.3584901518667413f, - -0.35861234804555037f, - -0.35873453807963407f, - -0.358856721966898f, - -0.3589788997052493f, - -0.3591010712925938f, - -0.35922323672683887f, - -0.3593453960058904f, - -0.359467549127656f, - -0.3595896960900423f, - -0.3597118368909555f, - -0.3598339715283044f, - -0.35995609999999534f, - -0.3600782223039358f, - -0.3602003384380324f, - -0.3603224484001943f, - -0.3604445521883284f, - -0.3605666498003425f, - -0.3606887412341444f, - -0.3608108264876414f, - -0.36093290555874313f, - -0.3610549784453571f, - -0.3611770451453915f, - -0.36129910565675405f, - -0.3614211599773548f, - -0.36154320810510165f, - -0.3616652500379033f, - -0.36178728577366775f, - -0.3619093153103056f, - -0.3620313386457252f, - -0.36215335577783553f, - -0.362275366704546f, - -0.3623973714237651f, - -0.36251936993340395f, - -0.3626413622313714f, - -0.362763348315577f, - -0.3628853281839298f, - -0.36300730183434143f, - -0.363129269264721f, - -0.36325123047297864f, - -0.36337318545702374f, - -0.3634951342147683f, - -0.3636170767441219f, - -0.3637390130429948f, - -0.36386094310929834f, - -0.3639828669409425f, - -0.364104784535839f, - -0.364226695891898f, - -0.3643486010070313f, - -0.3644704998791494f, - -0.3645923925061644f, - -0.3647142788859868f, - -0.36483615901652894f, - -0.36495803289570167f, - -0.36507990052141714f, - -0.36520176189158754f, - -0.3653236170041244f, - -0.36544546585693977f, - -0.365567308447945f, - -0.365689144775054f, - -0.36581097483617825f, - -0.36593279862923034f, - -0.3660546161521219f, - -0.3661764274027674f, - -0.3662982323790787f, - -0.36642003107896876f, - -0.3665418235003506f, - -0.3666636096411364f, - -0.3667853894992412f, - -0.3669071630725775f, - -0.3670289303590586f, - -0.36715069135659734f, - -0.367272446063109f, - -0.3673941944765065f, - -0.3675159365947038f, - -0.3676376724156139f, - -0.3677594019371527f, - -0.3678811251572334f, - -0.36800284207377054f, - -0.3681245526846783f, - -0.36824625698787056f, - -0.36836795498126346f, - -0.368489646662771f, - -0.36861133203030755f, - -0.3687330110817885f, - -0.3688546838151294f, - -0.36897635022824493f, - -0.36909801031904993f, - -0.36921966408546025f, - -0.3693413115253918f, - -0.36946295263675977f, - -0.3695845874174794f, - -0.3697062158654674f, - -0.3698278379786389f, - -0.3699494537549103f, - -0.3700710631921981f, - -0.3701926662884183f, - -0.37031426304148674f, - -0.37043585344932034f, - -0.37055743750983605f, - -0.37067901522095015f, - -0.3708005865805787f, - -0.37092215158664016f, - -0.3710437102370508f, - -0.37116526252972765f, - -0.37128680846258805f, - -0.37140834803354844f, - -0.371529881240528f, - -0.37165140808144337f, - -0.3717729285542123f, - -0.3718944426567517f, - -0.3720159503869811f, - -0.3721374517428177f, - -0.37225894672217963f, - -0.37238043532298426f, - -0.37250191754315154f, - -0.3726233933805991f, - -0.3727448628332454f, - -0.3728663258990093f, - -0.37298778257580856f, - -0.3731092328615638f, - -0.3732306767541931f, - -0.3733521142516156f, - -0.3734735453517496f, - -0.3735949700525162f, - -0.3737163883518339f, - -0.3738378002476222f, - -0.37395920573780045f, - -0.3740806048202887f, - -0.37420199749300725f, - -0.3743233837538757f, - -0.3744447636008137f, - -0.3745661370317418f, - -0.37468750404458073f, - -0.3748088646372501f, - -0.3749302188076713f, - -0.37505156655376404f, - -0.3751729078734499f, - -0.37529424276464896f, - -0.37541557122528296f, - -0.3755368932532726f, - -0.37565820884653817f, - -0.3757795180030027f, - -0.3759008207205866f, - -0.3760221169972116f, - -0.37614340683079833f, - -0.3762646902192703f, - -0.37638596716054834f, - -0.3765072376525546f, - -0.3766285016932102f, - -0.376749759280439f, - -0.3768710104121625f, - -0.376992255086303f, - -0.3771134933007831f, - -0.3772347250535245f, - -0.3773559503424517f, - -0.37747716916548657f, - -0.37759838152055214f, - -0.37771958740557066f, - -0.3778407868184669f, - -0.37796197975716334f, - -0.3780831662195833f, - -0.3782043462036496f, - -0.37832551970728745f, - -0.3784466867284197f, - -0.37856784726497017f, - -0.37868900131486294f, - -0.3788101488760211f, - -0.37893128994637054f, - -0.37905242452383464f, - -0.37917355260633795f, - -0.37929467419180396f, - -0.37941578927815905f, - -0.3795368978633271f, - -0.3796579999452326f, - -0.37977909552180117f, - -0.37990018459095715f, - -0.3800212671506265f, - -0.3801423431987337f, - -0.38026341273320496f, - -0.380384475751965f, - -0.38050553225293976f, - -0.38062658223405543f, - -0.3807476256932375f, - -0.3808686626284114f, - -0.3809896930375037f, - -0.38111071691844095f, - -0.38123173426914897f, - -0.3813527450875543f, - -0.3814737493715825f, - -0.38159474711916186f, - -0.38171573832821837f, - -0.3818367229966788f, - -0.38195770112246935f, - -0.3820786727035187f, - -0.3821996377377532f, - -0.38232059622310016f, - -0.38244154815748616f, - -0.38256249353884036f, - -0.38268343236508967f, - -0.3828043646341617f, - -0.3829252903439843f, - -0.38304620949248475f, - -0.38316712207759274f, - -0.38328802809723556f, - -0.3834089275493415f, - -0.38352982043183836f, - -0.3836507067426561f, - -0.38377158647972265f, - -0.38389245964096674f, - -0.38401332622431644f, - -0.3841341862277024f, - -0.3842550396490528f, - -0.3843758864862969f, - -0.3844967267373636f, - -0.38461756040018286f, - -0.38473838747268446f, - -0.38485920795279777f, - -0.3849800218384521f, - -0.38510082912757776f, - -0.38522162981810515f, - -0.3853424239079636f, - -0.3854632113950841f, - -0.38558399227739626f, - -0.38570476655283126f, - -0.38582553421931887f, - -0.3859462952747906f, - -0.3860670497171768f, - -0.38618779754440763f, - -0.3863085387544157f, - -0.3864292733451313f, - -0.3865500013144857f, - -0.3866707226604094f, - -0.3867914373808356f, - -0.386912145473695f, - -0.38703284693691936f, - -0.3871535417684404f, - -0.38727422996618927f, - -0.3873949115280997f, - -0.38751558645210293f, - -0.38763625473613134f, - -0.3877569163781164f, - -0.38787757137599227f, - -0.3879982197276907f, - -0.38811886143114455f, - -0.3882394964842857f, - -0.3883601248850488f, - -0.388480746631366f, - -0.38860136172117066f, - -0.3887219701523959f, - -0.38884257192297444f, - -0.38896316703084133f, - -0.3890837554739295f, - -0.38920433725017256f, - -0.38932491235750366f, - -0.3894454807938584f, - -0.38956604255717003f, - -0.3896865976453727f, - -0.3898071460564001f, - -0.3899276877881881f, - -0.3900482228386706f, - -0.39016875120578165f, - -0.390289272887457f, - -0.3904097878816307f, - -0.39053029618623863f, - -0.39065079779921497f, - -0.39077129271849587f, - -0.3908917809420158f, - -0.3910122624677107f, - -0.3911327372935165f, - -0.3912532054173685f, - -0.39137366683720215f, - -0.39149412155095376f, - -0.39161456955655977f, - -0.3917350108519559f, - -0.39185544543507844f, - -0.391975873303863f, - -0.3920962944562477f, - -0.3922167088901683f, - -0.3923371166035616f, - -0.39245751759436354f, - -0.3925779118605127f, - -0.3926982993999455f, - -0.392818680210599f, - -0.39293905429041054f, - -0.3930594216373167f, - -0.3931797822492567f, - -0.39330013612416737f, - -0.39342048325998646f, - -0.393540823654651f, - -0.3936611573061007f, - -0.39378148421227277f, - -0.39390180437110556f, - -0.3940221177805365f, - -0.3941424244385057f, - -0.39426272434295095f, - -0.394383017491811f, - -0.3945033038830245f, - -0.3946235835145297f, - -0.3947438563842672f, - -0.3948641224901754f, - -0.3949843818301931f, - -0.3951046344022601f, - -0.3952248802043164f, - -0.3953451192343011f, - -0.3954653514901536f, - -0.39558557696981417f, - -0.3957057956712231f, - -0.3958260075923198f, - -0.39594621273104513f, - -0.39606641108533913f, - -0.3961866026531417f, - -0.39630678743239395f, - -0.39642696542103684f, - -0.39654713661701074f, - -0.3966673010182562f, - -0.39678745862271464f, - -0.3969076094283276f, - -0.3970277534330358f, - -0.39714789063478f, - -0.39726802103150316f, - -0.39738814462114613f, - -0.3975082614016506f, - -0.39762837137095836f, - -0.3977484745270106f, - -0.397868570867751f, - -0.39798866039112096f, - -0.3981087430950627f, - -0.3982288189775179f, - -0.3983488880364307f, - -0.3984689502697429f, - -0.3985890056753973f, - -0.3987090542513359f, - -0.3988290959955034f, - -0.39894913090584216f, - -0.39906915898029527f, - -0.3991891802168062f, - -0.39930919461331754f, - -0.39942920216777456f, - -0.39954920287812007f, - -0.3996691967422979f, - -0.39978918375825123f, - -0.3999091639239258f, - -0.4000291372372648f, - -0.4001491036962126f, - -0.4002690632987132f, - -0.4003890160427116f, - -0.40050896192615276f, - -0.4006289009469806f, - -0.4007488331031409f, - -0.40086875839257785f, - -0.4009886768132373f, - -0.4011085883630637f, - -0.4012284930400032f, - -0.40134839084200047f, - -0.4014682817670019f, - -0.40158816581295237f, - -0.4017080429777985f, - -0.40182791325948586f, - -0.40194777665595965f, - -0.4020676331651677f, - -0.4021874827850555f, - -0.4023073255135694f, - -0.4024271613486552f, - -0.40254699028826113f, - -0.4026668123303331f, - -0.402786627472818f, - -0.4029064357136621f, - -0.40302623705081403f, - -0.40314603148222034f, - -0.40326581900582825f, - -0.4033855996195853f, - -0.4035053733214383f, - -0.4036251401093366f, - -0.4037448999812271f, - -0.4038646529350578f, - -0.403984398968776f, - -0.40410413808033147f, - -0.4042238702676717f, - -0.40434359552874516f, - -0.4044633138614995f, - -0.40458302526388507f, - -0.40470272973384974f, - -0.40482242726934253f, - -0.40494211786831236f, - -0.40506180152870763f, - -0.40518147824847917f, - -0.4053011480255755f, - -0.4054208108579462f, - -0.40554046674354f, - -0.40566011568030824f, - -0.40577975766620006f, - -0.4058993926991649f, - -0.40601902077715374f, - -0.40613864189811594f, - -0.40625825606000265f, - -0.40637786326076347f, - -0.4064974634983498f, - -0.4066170567707115f, - -0.4067366430757998f, - -0.406856222411566f, - -0.4069757947759608f, - -0.4070953601669348f, - -0.40721491858243986f, - -0.4073344700204277f, - -0.40745401447884944f, - -0.4075735519556567f, - -0.4076930824488005f, - -0.4078126059562342f, - -0.4079321224759091f, - -0.4080516320057773f, - -0.4081711345437902f, - -0.40829063008790184f, - -0.4084101186360638f, - -0.40852960018622875f, - -0.40864907473634854f, - -0.40876854228437765f, - -0.4088880028282682f, - -0.4090074563659733f, - -0.4091269028954461f, - -0.4092463424146392f, - -0.40936577492150755f, - -0.409485200414004f, - -0.4096046188900821f, - -0.40972403034769495f, - -0.409843434784798f, - -0.40996283219934454f, - -0.4100822225892887f, - -0.410201605952584f, - -0.41032098228718633f, - -0.4104403515910495f, - -0.4105597138621282f, - -0.41067906909837665f, - -0.41079841729775024f, - -0.41091775845820433f, - -0.4110370925776936f, - -0.411156419654173f, - -0.41127573968559816f, - -0.41139505266992504f, - -0.4115143586051085f, - -0.41163365748910496f, - -0.4117529493198699f, - -0.4118722340953589f, - -0.41199151181352844f, - -0.4121107824723351f, - -0.4122300460697349f, - -0.4123493026036834f, - -0.4124685520721388f, - -0.412587794473057f, - -0.4127070298043948f, - -0.41282625806410833f, - -0.41294547925015623f, - -0.41306469336049495f, - -0.4131839003930818f, - -0.41330310034587403f, - -0.41342229321682855f, - -0.41354147900390453f, - -0.41366065770505905f, - -0.4137798293182499f, - -0.4138989938414344f, - -0.41401815127257224f, - -0.4141373016096209f, - -0.41425644485053886f, - -0.41437558099328364f, - -0.41449471003581567f, - -0.4146138319760928f, - -0.41473294681207395f, - -0.41485205454171803f, - -0.4149711551629835f, - -0.4150902486738311f, - -0.41520933507221947f, - -0.415328414356108f, - -0.4154474865234556f, - -0.41556655157222355f, - -0.4156856095003709f, - -0.41580466030585767f, - -0.4159237039866431f, - -0.41604274054068896f, - -0.41616176996595494f, - -0.416280792260401f, - -0.41639980742198857f, - -0.41651881544867747f, - -0.41663781633842945f, - -0.4167568100892046f, - -0.4168757966989648f, - -0.41699477616567043f, - -0.4171137484872832f, - -0.41723271366176506f, - -0.41735167168707704f, - -0.41747062256118045f, - -0.4175895662820376f, - -0.4177085028476107f, - -0.41782743225586144f, - -0.41794635450475204f, - -0.41806526959224394f, - -0.4181841775163012f, - -0.4183030782748856f, - -0.41842197186595975f, - -0.4185408582874856f, - -0.41865973753742775f, - -0.4187786096137484f, - -0.41889747451441073f, - -0.419016332237378f, - -0.4191351827806128f, - -0.4192540261420803f, - -0.4193728623197433f, - -0.4194916913115656f, - -0.41961051311551034f, - -0.4197293277295431f, - -0.41984813515162717f, - -0.4199669353797269f, - -0.42008572841180586f, - -0.4202045142458301f, - -0.42032329287976355f, - -0.420442064311571f, - -0.42056082853921717f, - -0.4206795855606664f, - -0.4207983353738854f, - -0.4209170779768386f, - -0.42103581336749096f, - -0.4211545415438084f, - -0.42127326250375696f, - -0.421391976245302f, - -0.42151068276640896f, - -0.42162938206504424f, - -0.42174807413917437f, - -0.4218667589867648f, - -0.42198543660578264f, - -0.4221041069941941f, - -0.4222227701499653f, - -0.42234142607106334f, - -0.4224600747554556f, - -0.4225787162011086f, - -0.42269735040598866f, - -0.42281597736806464f, - -0.42293459708530307f, - -0.42305320955567144f, - -0.42317181477713656f, - -0.4232904127476677f, - -0.423409003465232f, - -0.42352758692779746f, - -0.42364616313333214f, - -0.4237647320798034f, - -0.42388329376518136f, - -0.4240018481874335f, - -0.4241203953445286f, - -0.42423893523443446f, - -0.4243574678551216f, - -0.42447599320455814f, - -0.42459451128071324f, - -0.4247130220815561f, - -0.4248315256050552f, - -0.4249500218491818f, - -0.4250685108119045f, - -0.4251869924911931f, - -0.4253054668850167f, - -0.4254239339913468f, - -0.42554239380815273f, - -0.42566084633340473f, - -0.42577929156507227f, - -0.42589772950112753f, - -0.42601616013954025f, - -0.42613458347828115f, - -0.42625299951532064f, - -0.4263714082486302f, - -0.4264898096761812f, - -0.4266082037959442f, - -0.4267265906058913f, - -0.42684497010399314f, - -0.4269633422882221f, - -0.42708170715654914f, - -0.42720006470694694f, - -0.4273184149373866f, - -0.4274367578458407f, - -0.4275550934302818f, - -0.42767342168868194f, - -0.4277917426190135f, - -0.4279100562192483f, - -0.42802836248736076f, - -0.4281466614213228f, - -0.4282649530191075f, - -0.4283832372786871f, - -0.4285015141980365f, - -0.4286197837751282f, - -0.4287380460079357f, - -0.42885630089443183f, - -0.42897454843259186f, - -0.4290927886203889f, - -0.429211021455797f, - -0.42932924693679014f, - -0.42944746506134185f, - -0.42956567582742805f, - -0.4296838792330225f, - -0.4298020752760997f, - -0.4299202639546337f, - -0.43003844526660084f, - -0.43015661920997544f, - -0.43027478578273265f, - -0.43039294498284675f, - -0.43051109680829486f, - -0.43062924125705165f, - -0.43074737832709276f, - -0.43086550801639384f, - -0.4309836303229301f, - -0.43110174524467904f, - -0.43121985277961605f, - -0.431337952925717f, - -0.43145604568095863f, - -0.43157413104331793f, - -0.43169220901077104f, - -0.4318102795812944f, - -0.4319283427528657f, - -0.4320463985234611f, - -0.4321644468910586f, - -0.43228248785363466f, - -0.43240052140916746f, - -0.4325185475556338f, - -0.4326365662910116f, - -0.4327545776132792f, - -0.4328725815204139f, - -0.4329905780103936f, - -0.43310856708119666f, - -0.4332265487308018f, - -0.4333445229571871f, - -0.43346248975833107f, - -0.4335804491322116f, - -0.43369840107680907f, - -0.43381634559010157f, - -0.4339342826700682f, - -0.4340522123146874f, - -0.4341701345219399f, - -0.4342880492898045f, - -0.4344059566162607f, - -0.4345238564992874f, - -0.43464174893686597f, - -0.43475963392697564f, - -0.4348775114675964f, - -0.4349953815567085f, - -0.43511324419229147f, - -0.43523109937232735f, - -0.43534894709479593f, - -0.4354667873576779f, - -0.43558462015895333f, - -0.43570244549660475f, - -0.4358202633686125f, - -0.43593807377295773f, - -0.4360558767076211f, - -0.4361736721705856f, - -0.43629146015983206f, - -0.43640924067334225f, - -0.4365270137090976f, - -0.43664477926508044f, - -0.4367625373392734f, - -0.4368802879296583f, - -0.4369980310342171f, - -0.43711576665093266f, - -0.43723349477778806f, - -0.4373512154127652f, - -0.4374689285538479f, - -0.43758663419901866f, - -0.43770433234626027f, - -0.4378220229935564f, - -0.4379397061388908f, - -0.4380573817802467f, - -0.4381750499156069f, - -0.4382927105429568f, - -0.4384103636602795f, - -0.4385280092655591f, - -0.4386456473567789f, - -0.4387632779319249f, - -0.4388809009889806f, - -0.43899851652593064f, - -0.43911612454075966f, - -0.4392337250314518f, - -0.4393513179959935f, - -0.43946890343236905f, - -0.43958648133856365f, - -0.4397040517125619f, - -0.43982161455235075f, - -0.4399391698559151f, - -0.4400567176212406f, - -0.44017425784631237f, - -0.44029179052911793f, - -0.44040931566764263f, - -0.44052683325987263f, - -0.44064434330379443f, - -0.4407618457973936f, - -0.4408793407386584f, - -0.4409968281255749f, - -0.4411143079561298f, - -0.44123178022830944f, - -0.4413492449401025f, - -0.4414667020894955f, - -0.44158415167447584f, - -0.44170159369303025f, - -0.441819028143148f, - -0.44193645502281603f, - -0.4420538743300219f, - -0.44217128606275447f, - -0.4422886902190011f, - -0.4424060867967509f, - -0.44252347579399154f, - -0.4426408572087124f, - -0.44275823103890133f, - -0.44287559728254755f, - -0.4429929559376405f, - -0.44311030700216886f, - -0.4432276504741214f, - -0.44334498635148784f, - -0.44346231463225816f, - -0.4435796353144215f, - -0.4436969483959676f, - -0.44381425387488566f, - -0.4439315517491671f, - -0.4440488420168014f, - -0.4441661246757787f, - -0.44428339972408865f, - -0.4444006671597234f, - -0.4445179269806728f, - -0.44463517918492756f, - -0.44475242377047863f, - -0.4448696607353163f, - -0.44498689007743336f, - -0.44510411179482023f, - -0.4452213258854684f, - -0.4453385323473687f, - -0.4454557311785143f, - -0.4455729223768963f, - -0.4456901059405066f, - -0.44580728186733665f, - -0.44592445015538007f, - -0.44604161080262855f, - -0.44615876380707453f, - -0.4462759091667106f, - -0.4463930468795288f, - -0.4465101769435235f, - -0.44662729935668694f, - -0.4467444141170119f, - -0.44686152122249195f, - -0.44697862067112104f, - -0.44709571246089214f, - -0.4472127965897987f, - -0.4473298730558347f, - -0.44744694185699463f, - -0.4475640029912717f, - -0.44768105645666084f, - -0.44779810225115607f, - -0.44791514037275143f, - -0.4480321708194418f, - -0.4481491935892224f, - -0.44826620868008765f, - -0.4483832160900317f, - -0.44850021581705124f, - -0.44861720785914083f, - -0.4487341922142957f, - -0.44885116888051063f, - -0.4489681378557829f, - -0.44908509913810735f, - -0.44920205272547997f, - -0.44931899861589675f, - -0.4494359368073531f, - -0.44955286729784694f, - -0.4496697900853738f, - -0.4497867051679303f, - -0.4499036125435123f, - -0.4500205122101183f, - -0.4501374041657444f, - -0.4502542884083876f, - -0.4503711649360453f, - -0.4504880337467139f, - -0.4506048948383926f, - -0.4507217482090781f, - -0.4508385938567683f, - -0.4509554317794601f, - -0.45107226197515327f, - -0.4511890844418451f, - -0.45130589917753383f, - -0.4514227061802171f, - -0.45153950544789506f, - -0.45165629697856563f, - -0.4517730807702275f, - -0.45188985682087934f, - -0.4520066251285205f, - -0.45212338569115074f, - -0.4522401385067685f, - -0.452356883573374f, - -0.45247362088896614f, - -0.4525903504515454f, - -0.4527070722591109f, - -0.45282378630966347f, - -0.45294049260120234f, - -0.45305719113172827f, - -0.45317388189924196f, - -0.4532905649017437f, - -0.453407240137234f, - -0.453523907603713f, - -0.4536405672991831f, - -0.4537572192216447f, - -0.4538738633690989f, - -0.45399049973954625f, - -0.4541071283309899f, - -0.45422374914143054f, - -0.45434036216886997f, - -0.45445696741130925f, - -0.45457356486675193f, - -0.4546901545331994f, - -0.45480673640865393f, - -0.4549233104911179f, - -0.45503987677859303f, - -0.4551564352690836f, - -0.4552729859605917f, - -0.45538952885112005f, - -0.45550606393867116f, - -0.45562259122124965f, - -0.4557391106968582f, - -0.45585562236350013f, - -0.4559721262191792f, - -0.4560886222618983f, - -0.4562051104896628f, - -0.45632159090047597f, - -0.456438063492342f, - -0.4565545282632643f, - -0.45667098521124894f, - -0.4567874343342996f, - -0.45690387563042056f, - -0.4570203090976171f, - -0.45713673473389443f, - -0.4572531525372574f, - -0.4573695625057107f, - -0.4574859646372605f, - -0.45760235892991147f, - -0.4577187453816697f, - -0.45783512399054127f, - -0.4579514947545317f, - -0.4580678576716465f, - -0.4581842127398924f, - -0.4583005599572759f, - -0.45841689932180324f, - -0.45853323083148f, - -0.45864955448431455f, - -0.45876587027831284f, - -0.4588821782114819f, - -0.4589984782818288f, - -0.45911477048736005f, - -0.4592310548260845f, - -0.4593473312960089f, - -0.45946359989514085f, - -0.45957986062148737f, - -0.45969611347305794f, - -0.4598123584478598f, - -0.4599285955439011f, - -0.4600448247591894f, - -0.4601610460917347f, - -0.46027725953954474f, - -0.46039346510062834f, - -0.4605096627729943f, - -0.4606258525546508f, - -0.46074203444360856f, - -0.460858208437876f, - -0.4609743745354626f, - -0.461090532734377f, - -0.46120668303263046f, - -0.46132282542823205f, - -0.46143895991919165f, - -0.4615550865035185f, - -0.4616712051792245f, - -0.4617873159443191f, - -0.46190341879681274f, - -0.4620195137347158f, - -0.4621356007560392f, - -0.4622516798587944f, - -0.46236775104099154f, - -0.46248381430064256f, - -0.462599869635758f, - -0.46271591704435f, - -0.4628319565244294f, - -0.46294798807400867f, - -0.46306401169109923f, - -0.4631800273737126f, - -0.4632960351198614f, - -0.4634120349275582f, - -0.463528026794815f, - -0.46364401071964345f, - -0.4637599867000578f, - -0.4638759547340701f, - -0.46399191481969326f, - -0.4641078669549395f, - -0.4642238111378236f, - -0.46433974736635814f, - -0.46445567563855655f, - -0.4645715959524324f, - -0.4646875083059987f, - -0.4648034126972709f, - -0.46491930912426216f, - -0.4650351975849867f, - -0.4651510780774579f, - -0.4652669505996919f, - -0.46538281514970237f, - -0.4654986717255041f, - -0.46561452032511097f, - -0.46573036094653963f, - -0.4658461935878044f, - -0.46596201824692046f, - -0.46607783492190324f, - -0.4661936436107675f, - -0.4663094443115304f, - -0.4664252370222069f, - -0.46654102174081297f, - -0.4666567984653639f, - -0.4667725671938775f, - -0.4668883279243692f, - -0.46700408065485555f, - -0.4671198253833524f, - -0.467235562107878f, - -0.46735129082644844f, - -0.4674670115370804f, - -0.4675827242377918f, - -0.4676984289265992f, - -0.4678141256015207f, - -0.4679298142605732f, - -0.4680454949017751f, - -0.4681611675231435f, - -0.4682768321226968f, - -0.46839248869845346f, - -0.4685081372484314f, - -0.46862377777064895f, - -0.46873941026312393f, - -0.4688550347238765f, - -0.46897065115092473f, - -0.46908625954228755f, - -0.46920185989598323f, - -0.4693174522100326f, - -0.4694330364824542f, - -0.4695486127112676f, - -0.4696641808944916f, - -0.46977974103014747f, - -0.4698952931162544f, - -0.4700108371508324f, - -0.47012637313190175f, - -0.4702419010574819f, - -0.4703574209255949f, - -0.47047293273426055f, - -0.4705884364814996f, - -0.4707039321653322f, - -0.47081941978378083f, - -0.4709348993348659f, - -0.47105037081660867f, - -0.47116583422702984f, - -0.4712812895641525f, - -0.47139673682599764f, - -0.471512176010587f, - -0.4716276071159426f, - -0.4717430301400858f, - -0.4718584450810404f, - -0.47197385193682806f, - -0.4720892507054708f, - -0.47220464138499185f, - -0.4723200239734143f, - -0.47243539846876076f, - -0.4725507648690539f, - -0.4726661231723174f, - -0.47278147337657483f, - -0.4728968154798492f, - -0.4730121494801647f, - -0.47312747537554484f, - -0.4732427931640131f, - -0.4733581028435939f, - -0.473473404412312f, - -0.47358869786819113f, - -0.47370398320925516f, - -0.4738192604335302f, - -0.47393452953904014f, - -0.47404979052380997f, - -0.47416504338586396f, - -0.4742802881232288f, - -0.4743955247339291f, - -0.4745107532159902f, - -0.4746259735674377f, - -0.4747411857862966f, - -0.47485638987059436f, - -0.47497158581835613f, - -0.4750867736276081f, - -0.47520195329637577f, - -0.4753171248226872f, - -0.475432288204568f, - -0.47554744344004507f, - -0.47566259052714516f, - -0.47577772946389446f, - -0.47589286024832167f, - -0.4760079828784533f, - -0.4761230973523168f, - -0.4762382036679388f, - -0.4763533018233486f, - -0.47646839181657336f, - -0.4765834736456409f, - -0.4766985473085786f, - -0.4768136128034162f, - -0.47692867012818146f, - -0.4770437192809028f, - -0.4771587602596084f, - -0.47727379306232764f, - -0.47738881768708974f, - -0.47750383413192304f, - -0.4776188423948575f, - -0.47773384247392175f, - -0.4778488343671461f, - -0.4779638180725594f, - -0.4780787935881921f, - -0.4781937609120735f, - -0.478308720042234f, - -0.4784236709767042f, - -0.478538613713514f, - -0.478653548250694f, - -0.4787684745862739f, - -0.4788833927182862f, - -0.4789983026447609f, - -0.4791132043637291f, - -0.47922809787322124f, - -0.4793429831712701f, - -0.4794578602559065f, - -0.47957272912516197f, - -0.4796875897770675f, - -0.47980244220965657f, - -0.4799172864209604f, - -0.48003212240901116f, - -0.4801469501718412f, - -0.48026176970748224f, - -0.48037658101396835f, - -0.48049138408933156f, - -0.4806061789316047f, - -0.48072096553881993f, - -0.4808357439090122f, - -0.48095051404021383f, - -0.48106527593045834f, - -0.48118002957777933f, - -0.4812947749802097f, - -0.4814095121357849f, - -0.4815242410425382f, - -0.48163896169850373f, - -0.481753674101715f, - -0.48186837825020795f, - -0.48198307414201647f, - -0.4820977617751748f, - -0.4822124411477182f, - -0.48232711225768216f, - -0.4824417751031013f, - -0.4825564296820106f, - -0.48267107599244624f, - -0.48278571403244297f, - -0.48290034380003694f, - -0.4830149652932644f, - -0.48312957851016086f, - -0.4832441834487622f, - -0.4833587801071049f, - -0.483473368483226f, - -0.48358794857516146f, - -0.48370252038094735f, - -0.483817083898622f, - -0.48393163912622156f, - -0.4840461860617833f, - -0.48416072470334437f, - -0.4842752550489415f, - -0.4843897770966137f, - -0.4845042908443979f, - -0.484618796290332f, - -0.4847332934324532f, - -0.4848477822688011f, - -0.4849622627974133f, - -0.4850767350163281f, - -0.4851911989235833f, - -0.48530565451721924f, - -0.48542010179527384f, - -0.48553454075578617f, - -0.4856489713967953f, - -0.4857633937163397f, - -0.4858778077124604f, - -0.48599221338319615f, - -0.48610661072658656f, - -0.4862209997406708f, - -0.48633538042349034f, - -0.4864497527730845f, - -0.48656411678749356f, - -0.48667847246475715f, - -0.4867928198029174f, - -0.4869071588000142f, - -0.48702148945408835f, - -0.4871358117631805f, - -0.4872501257253321f, - -0.4873644313385848f, - -0.4874787286009793f, - -0.4875930175105578f, - -0.48770729806536134f, - -0.4878215702634324f, - -0.4879358341028124f, - -0.48805008958154394f, - -0.4881643366976691f, - -0.48827857544922953f, - -0.4883928058342692f, - -0.48850702785083006f, - -0.488621241496955f, - -0.4887354467706862f, - -0.48884964367006833f, - -0.4889638321931439f, - -0.4890780123379563f, - -0.4891921841025483f, - -0.48930634748496515f, - -0.48942050248325f, - -0.48953464909544664f, - -0.48964878731959943f, - -0.4897629171537517f, - -0.4898770385959495f, - -0.48999115164423657f, - -0.49010525629665763f, - -0.4902193525512568f, - -0.4903334404060805f, - -0.49044751985917323f, - -0.4905615909085802f, - -0.49067565355234605f, - -0.49078970778851794f, - -0.49090375361514077f, - -0.4910177910302604f, - -0.4911318200319228f, - -0.4912458406181734f, - -0.49135985278706f, - -0.49147385653662834f, - -0.4915878518649248f, - -0.49170183876999557f, - -0.4918158172498889f, - -0.4919297873026511f, - -0.49204374892632885f, - -0.4921577021189699f, - -0.4922716468786221f, - -0.4923855832033326f, - -0.4924995110911488f, - -0.4926134305401193f, - -0.4927273415482914f, - -0.49284124411371355f, - -0.4929551382344346f, - -0.49306902390850244f, - -0.49318290113396546f, - -0.49329676990887267f, - -0.49341063023127335f, - -0.49352448209921623f, - -0.49363832551075043f, - -0.4937521604639245f, - -0.4938659869567895f, - -0.4939798049873942f, - -0.4940936145537884f, - -0.49420741565402126f, - -0.49432120828614434f, - -0.494434992448207f, - -0.4945487681382597f, - -0.49466253535435206f, - -0.49477629409453633f, - -0.49489004435686246f, - -0.49500378613938134f, - -0.4951175194401441f, - -0.49523124425720116f, - -0.4953449605886054f, - -0.49545866843240755f, - -0.4955723677866593f, - -0.4956860586494116f, - -0.49579974101871804f, - -0.49591341489262986f, - -0.4960270802691992f, - -0.49614073714647783f, - -0.4962543855225197f, - -0.49636802539537683f, - -0.49648165676310185f, - -0.49659527962374744f, - -0.4967088939753671f, - -0.49682249981601445f, - -0.4969360971437425f, - -0.4970496859566043f, - -0.4971632662526541f, - -0.497276838029946f, - -0.49739040128653367f, - -0.49750395602047076f, - -0.49761750222981194f, - -0.4977310399126121f, - -0.497844569066925f, - -0.497958089690806f, - -0.4980716017823097f, - -0.4981851053394907f, - -0.49829860036040446f, - -0.4984120868431068f, - -0.49852556478565263f, - -0.4986390341860968f, - -0.49875249504249664f, - -0.4988659473529072f, - -0.49897939111538453f, - -0.4990928263279848f, - -0.49920625298876353f, - -0.4993196710957788f, - -0.49943308064708636f, - -0.499546481640743f, - -0.49965987407480494f, - -0.49977325794733063f, - -0.49988663325637656f, - -0.5000000000000001f, - -0.500113358176258f, - -0.5002267077832093f, - -0.5003400488189111f, - -0.5004533812814215f, - -0.5005667051687983f, - -0.500680020479099f, - -0.5007933272103837f, - -0.50090662536071f, - -0.5010199149281366f, - -0.5011331959107215f, - -0.5012464683065253f, - -0.5013597321136062f, - -0.5014729873300237f, - -0.5015862339538361f, - -0.5016994719831047f, - -0.5018127014158884f, - -0.5019259222502471f, - -0.5020391344842403f, - -0.5021523381159285f, - -0.5022655331433725f, - -0.5023787195646319f, - -0.502491897377768f, - -0.5026050665808408f, - -0.5027182271719121f, - -0.5028313791490419f, - -0.5029445225102922f, - -0.5030576572537236f, - -0.503170783377398f, - -0.5032839008793774f, - -0.5033970097577231f, - -0.503510110010497f, - -0.5036232016357604f, - -0.503736284631577f, - -0.5038493589960086f, - -0.5039624247271175f, - -0.5040754818229657f, - -0.5041885302816174f, - -0.5043015701011349f, - -0.5044146012795812f, - -0.5045276238150187f, - -0.5046406377055126f, - -0.5047536429491254f, - -0.504866639543921f, - -0.504979627487963f, - -0.5050926067793149f, - -0.5052055774160421f, - -0.5053185393962082f, - -0.5054314927178777f, - -0.5055444373791144f, - -0.5056573733779843f, - -0.5057703007125519f, - -0.505883219380882f, - -0.5059961293810399f, - -0.5061090307110899f, - -0.5062219233690992f, - -0.5063348073531326f, - -0.506447682661256f, - -0.5065605492915343f, - -0.5066734072420351f, - -0.5067862565108241f, - -0.5068990970959671f, - -0.507011928995531f, - -0.5071247522075829f, - -0.5072375667301892f, - -0.5073503725614164f, - -0.5074631696993324f, - -0.5075759581420036f, - -0.507688737887498f, - -0.5078015089338834f, - -0.5079142712792272f, - -0.5080270249215967f, - -0.5081397698590604f, - -0.5082525060896869f, - -0.5083652336115438f, - -0.5084779524226992f, - -0.508590662521223f, - -0.5087033639051831f, - -0.5088160565726485f, - -0.5089287405216883f, - -0.5090414157503709f, - -0.5091540822567671f, - -0.5092667400389456f, - -0.509379389094976f, - -0.5094920294229276f, - -0.5096046610208717f, - -0.5097172838868774f, - -0.5098298980190153f, - -0.5099425034153549f, - -0.5100551000739681f, - -0.5101676879929251f, - -0.5102802671702965f, - -0.5103928376041534f, - -0.5105053992925662f, - -0.5106179522336076f, - -0.5107304964253484f, - -0.5108430318658601f, - -0.5109555585532136f, - -0.5110680764854826f, - -0.511180585660738f, - -0.5112930860770523f, - -0.5114055777324973f, - -0.5115180606251458f, - -0.511630534753071f, - -0.5117430001143451f, - -0.5118554567070408f, - -0.5119679045292316f, - -0.512080343578991f, - -0.5121927738543917f, - -0.5123051953535079f, - -0.5124176080744127f, - -0.5125300120151806f, - -0.5126424071738848f, - -0.5127547935486002f, - -0.5128671711374008f, - -0.5129795399383602f, - -0.5130918999495545f, - -0.5132042511690577f, - -0.5133165935949447f, - -0.5134289272252899f, - -0.5135412520581698f, - -0.5136535680916591f, - -0.5137658753238332f, - -0.5138781737527672f, - -0.5139904633765382f, - -0.5141027441932216f, - -0.5142150162008933f, - -0.5143272793976296f, - -0.5144395337815061f, - -0.5145517793506009f, - -0.5146640161029901f, - -0.5147762440367504f, - -0.5148884631499581f, - -0.5150006734406918f, - -0.5151128749070281f, - -0.5152250675470443f, - -0.5153372513588176f, - -0.515449426340427f, - -0.5155615924899498f, - -0.515673749805464f, - -0.5157858982850477f, - -0.5158980379267787f, - -0.516010168728737f, - -0.5161222906890004f, - -0.5162344038056478f, - -0.5163465080767574f, - -0.5164586035004098f, - -0.5165706900746836f, - -0.5166827677976578f, - -0.5167948366674123f, - -0.5169068966820274f, - -0.5170189478395824f, - -0.517130990138157f, - -0.5172430235758322f, - -0.5173550481506876f, - -0.517467063860804f, - -0.5175790707042623f, - -0.5176910686791432f, - -0.5178030577835271f, - -0.5179150380154954f, - -0.51802700937313f, - -0.5181389718545116f, - -0.518250925457722f, - -0.5183628701808419f, - -0.518474806021955f, - -0.5185867329791423f, - -0.518698651050486f, - -0.5188105602340677f, - -0.5189224605279713f, - -0.5190343519302789f, - -0.5191462344390729f, - -0.5192581080524359f, - -0.5193699727684521f, - -0.5194818285852042f, - -0.5195936755007754f, - -0.5197055135132495f, - -0.5198173426207091f, - -0.5199291628212399f, - -0.5200409741129248f, - -0.5201527764938483f, - -0.5202645699620936f, - -0.5203763545157468f, - -0.5204881301528917f, - -0.5205998968716132f, - -0.5207116546699955f, - -0.5208234035461248f, - -0.5209351434980859f, - -0.521046874523964f, - -0.5211585966218443f, - -0.5212703097898128f, - -0.5213820140259559f, - -0.5214937093283589f, - -0.5216053956951078f, - -0.521717073124289f, - -0.5218287416139896f, - -0.5219404011622953f, - -0.5220520517672936f, - -0.5221636934270707f, - -0.5222753261397144f, - -0.522386949903311f, - -0.5224985647159487f, - -0.5226101705757148f, - -0.5227217674806963f, - -0.5228333554289816f, - -0.522944934418659f, - -0.5230565044478162f, - -0.5231680655145406f, - -0.5232796176169225f, - -0.5233911607530495f, - -0.5235026949210102f, - -0.5236142201188938f, - -0.5237257363447885f, - -0.5238372435967849f, - -0.5239487418729715f, - -0.5240602311714381f, - -0.5241717114902734f, - -0.5242831828275688f, - -0.5243946451814135f, - -0.5245060985498977f, - -0.5246175429311108f, - -0.5247289783231448f, - -0.5248404047240895f, - -0.5249518221320357f, - -0.5250632305450742f, - -0.5251746299612954f, - -0.5252860203787919f, - -0.5253974017956544f, - -0.5255087742099743f, - -0.5256201376198426f, - -0.5257314920233526f, - -0.5258428374185955f, - -0.5259541738036635f, - -0.526065501176648f, - -0.5261768195356431f, - -0.5262881288787404f, - -0.5263994292040326f, - -0.526510720509613f, - -0.5266220027935742f, - -0.52673327605401f, - -0.526844540289013f, - -0.5269557954966775f, - -0.5270670416750964f, - -0.5271782788223645f, - -0.5272895069365747f, - -0.527400726015822f, - -0.5275119360582f, - -0.5276231370618035f, - -0.5277343290247275f, - -0.5278455119450663f, - -0.5279566858209149f, - -0.5280678506503675f, - -0.5281790064315209f, - -0.5282901531624699f, - -0.5284012908413096f, - -0.5285124194661353f, - -0.5286235390350442f, - -0.5287346495461316f, - -0.5288457509974935f, - -0.5289568433872258f, - -0.5290679267134261f, - -0.5291790009741905f, - -0.5292900661676155f, - -0.5294011222917984f, - -0.5295121693448352f, - -0.5296232073248249f, - -0.529734236229864f, - -0.5298452560580501f, - -0.5299562668074801f, - -0.5300672684762533f, - -0.5301782610624672f, - -0.5302892445642198f, - -0.5304002189796094f, - -0.5305111843067338f, - -0.5306221405436932f, - -0.5307330876885855f, - -0.5308440257395097f, - -0.5309549546945642f, - -0.5310658745518498f, - -0.5311767853094651f, - -0.5312876869655093f, - -0.5313985795180826f, - -0.5315094629652851f, - -0.5316203373052165f, - -0.5317312025359767f, - -0.5318420586556668f, - -0.5319529056623865f, - -0.5320637435542369f, - -0.5321745723293192f, - -0.532285391985734f, - -0.5323962025215819f, - -0.5325070039349649f, - -0.5326177962239844f, - -0.532728579386742f, - -0.5328393534213385f, - -0.5329501183258775f, - -0.53306087409846f, - -0.5331716207371886f, - -0.5332823582401655f, - -0.5333930866054925f, - -0.5335038058312738f, - -0.5336145159156115f, - -0.5337252168566086f, - -0.5338359086523676f, - -0.5339465913009933f, - -0.5340572648005883f, - -0.5341679291492565f, - -0.5342785843451008f, - -0.5343892303862265f, - -0.5344998672707372f, - -0.5346104949967371f, - -0.5347211135623305f, - -0.5348317229656214f, - -0.534942323204716f, - -0.5350529142777184f, - -0.5351634961827336f, - -0.5352740689178662f, - -0.5353846324812229f, - -0.5354951868709087f, - -0.535605732085029f, - -0.5357162681216895f, - -0.5358267949789964f, - -0.5359373126550564f, - -0.5360478211479752f, - -0.5361583204558591f, - -0.5362688105768151f, - -0.5363792915089503f, - -0.5364897632503707f, - -0.5366002257991844f, - -0.5367106791534979f, - -0.5368211233114192f, - -0.5369315582710552f, - -0.5370419840305144f, - -0.5371524005879044f, - -0.5372628079413322f, - -0.5373732060889078f, - -0.5374835950287387f, - -0.5375939747589333f, - -0.5377043452775998f, - -0.5378147065828482f, - -0.537925058672787f, - -0.5380354015455252f, - -0.5381457351991714f, - -0.5382560596318365f, - -0.5383663748416296f, - -0.5384766808266602f, - -0.5385869775850384f, - -0.5386972651148735f, - -0.5388075434142772f, - -0.5389178124813592f, - -0.5390280723142301f, - -0.5391383229109998f, - -0.5392485642697809f, - -0.5393587963886833f, - -0.5394690192658186f, - -0.5395792328992972f, - -0.5396894372872322f, - -0.5397996324277345f, - -0.5399098183189159f, - -0.5400199949588884f, - -0.5401301623457635f, - -0.5402403204776549f, - -0.5403504693526744f, - -0.5404606089689346f, - -0.5405707393245475f, - -0.5406808604176275f, - -0.540790972246287f, - -0.5409010748086391f, - -0.5410111681027977f, - -0.5411212521268757f, - -0.5412313268789876f, - -0.5413413923572465f, - -0.5414514485597675f, - -0.5415614954846636f, - -0.5416715331300499f, - -0.5417815614940411f, - -0.5418915805747517f, - -0.542001590370296f, - -0.5421115908787896f, - -0.5422215820983478f, - -0.5423315640270858f, - -0.5424415366631189f, - -0.5425515000045621f, - -0.5426614540495326f, - -0.5427713987961458f, - -0.5428813342425176f, - -0.5429912603867637f, - -0.543101177227002f, - -0.5432110847613484f, - -0.5433209829879195f, - -0.5434308719048317f, - -0.5435407515102034f, - -0.5436506218021513f, - -0.5437604827787925f, - -0.5438703344382448f, - -0.5439801767786252f, - -0.5440900097980529f, - -0.5441998334946452f, - -0.5443096478665205f, - -0.5444194529117962f, - -0.5445292486285924f, - -0.5446390350150271f, - -0.544748812069219f, - -0.5448585797892865f, - -0.5449683381733501f, - -0.5450780872195286f, - -0.5451878269259411f, - -0.5452975572907074f, - -0.5454072783119471f, - -0.545516989987781f, - -0.5456266923163285f, - -0.5457363852957098f, - -0.5458460689240455f, - -0.5459557431994567f, - -0.5460654081200633f, - -0.546175063683987f, - -0.5462847098893483f, - -0.546394346734269f, - -0.5465039742168698f, - -0.546613592335273f, - -0.5467232010876f, - -0.5468328004719718f, - -0.5469423904865122f, - -0.5470519711293423f, - -0.5471615423985849f, - -0.5472711042923615f, - -0.5473806568087962f, - -0.5474901999460113f, - -0.5475997337021297f, - -0.5477092580752747f, - -0.5478187730635686f, - -0.5479282786651367f, - -0.5480377748781018f, - -0.5481472617005877f, - -0.5482567391307176f, - -0.5483662071666171f, - -0.5484756658064097f, - -0.54858511504822f, - -0.5486945548901719f, - -0.5488039853303915f, - -0.5489134063670031f, - -0.5490228179981318f, - -0.5491322202219029f, - -0.5492416130364409f, - -0.5493509964398731f, - -0.5494603704303243f, - -0.5495697350059204f, - -0.549679090164787f, - -0.5497884359050516f, - -0.5498977722248398f, - -0.5500070991222783f, - -0.550116416595493f, - -0.5502257246426122f, - -0.5503350232617623f, - -0.5504443124510702f, - -0.5505535922086637f, - -0.5506628625326699f, - -0.5507721234212171f, - -0.5508813748724323f, - -0.5509906168844443f, - -0.5510998494553807f, - -0.5512090725833699f, - -0.5513182862665411f, - -0.5514274905030223f, - -0.5515366852909421f, - -0.5516458706284298f, - -0.551755046513615f, - -0.5518642129446264f, - -0.5519733699195936f, - -0.5520825174366455f, - -0.5521916554939135f, - -0.5523007840895264f, - -0.5524099032216148f, - -0.552519012888308f, - -0.5526281130877378f, - -0.5527372038180343f, - -0.552846285077328f, - -0.5529553568637501f, - -0.5530644191754307f, - -0.5531734720105027f, - -0.5532825153670967f, - -0.5533915492433443f, - -0.5535005736373764f, - -0.5536095885473264f, - -0.5537185939713258f, - -0.5538275899075067f, - -0.5539365763540006f, - -0.5540455533089418f, - -0.554154520770462f, - -0.5542634787366942f, - -0.5543724272057715f, - -0.5544813661758262f, - -0.5545902956449933f, - -0.5546992156114056f, - -0.5548081260731962f, - -0.5549170270284994f, - -0.5550259184754498f, - -0.5551348004121809f, - -0.5552436728368269f, - -0.5553525357475225f, - -0.5554613891424028f, - -0.555570233019602f, - -0.5556790673772556f, - -0.5557878922134984f, - -0.5558967075264657f, - -0.5560055133142929f, - -0.5561143095751163f, - -0.5562230963070713f, - -0.5563318735082934f, - -0.5564406411769192f, - -0.5565493993110852f, - -0.5566581479089276f, - -0.5567668869685823f, - -0.5568756164881876f, - -0.5569843364658796f, - -0.5570930468997956f, - -0.5572017477880726f, - -0.5573104391288475f, - -0.5574191209202594f, - -0.5575277931604451f, - -0.5576364558475428f, - -0.5577451089796897f, - -0.5578537525550256f, - -0.5579623865716882f, - -0.558071011027816f, - -0.558179625921547f, - -0.5582882312510217f, - -0.5583968270143784f, - -0.5585054132097563f, - -0.5586139898352949f, - -0.5587225568891329f, - -0.5588311143694116f, - -0.55893966227427f, - -0.5590482006018485f, - -0.5591567293502862f, - -0.5592652485177252f, - -0.5593737581023053f, - -0.5594822581021671f, - -0.5595907485154513f, - -0.5596992293402991f, - -0.5598077005748523f, - -0.5599161622172517f, - -0.5600246142656385f, - -0.5601330567181549f, - -0.5602414895729432f, - -0.5603499128281444f, - -0.5604583264819016f, - -0.5605667305323565f, - -0.5606751249776523f, - -0.5607835098159308f, - -0.5608918850453358f, - -0.5610002506640099f, - -0.5611086066700955f, - -0.5612169530617376f, - -0.5613252898370786f, - -0.5614336169942625f, - -0.5615419345314324f, - -0.5616502424467336f, - -0.5617585407383097f, - -0.5618668294043049f, - -0.561975108442863f, - -0.5620833778521303f, - -0.5621916376302507f, - -0.5622998877753692f, - -0.5624081282856311f, - -0.562516359159181f, - -0.5626245803941657f, - -0.5627327919887303f, - -0.5628409939410205f, - -0.5629491862491816f, - -0.5630573689113612f, - -0.5631655419257048f, - -0.5632737052903591f, - -0.5633818590034699f, - -0.5634900030631854f, - -0.5635981374676521f, - -0.5637062622150169f, - -0.5638143773034271f, - -0.5639224827310295f, - -0.5640305784959734f, - -0.5641386645964056f, - -0.5642467410304743f, - -0.5643548077963267f, - -0.5644628648921127f, - -0.56457091231598f, - -0.5646789500660769f, - -0.5647869781405529f, - -0.5648949965375563f, - -0.5650030052552368f, - -0.5651110042917432f, - -0.5652189936452255f, - -0.5653269733138326f, - -0.565434943295715f, - -0.5655429035890226f, - -0.5656508541919053f, - -0.5657587951025131f, - -0.5658667263189968f, - -0.5659746478395073f, - -0.5660825596621953f, - -0.5661904617852115f, - -0.5662983542067063f, - -0.5664062369248326f, - -0.566514109937741f, - -0.5666219732435832f, - -0.5667298268405102f, - -0.5668376707266756f, - -0.5669455049002304f, - -0.5670533293593274f, - -0.5671611441021179f, - -0.5672689491267562f, - -0.5673767444313943f, - -0.5674845300141852f, - -0.5675923058732819f, - -0.5677000720068371f, - -0.5678078284130057f, - -0.5679155750899406f, - -0.5680233120357955f, - -0.5681310392487237f, - -0.5682387567268807f, - -0.5683464644684202f, - -0.5684541624714965f, - -0.5685618507342636f, - -0.5686695292548777f, - -0.5687771980314931f, - -0.5688848570622648f, - -0.5689925063453478f, - -0.569100145878898f, - -0.5692077756610713f, - -0.5693153956900231f, - -0.569423005963909f, - -0.5695306064808856f, - -0.5696381972391096f, - -0.5697457782367364f, - -0.5698533494719237f, - -0.5699609109428274f, - -0.5700684626476052f, - -0.5701760045844136f, - -0.5702835367514106f, - -0.5703910591467533f, - -0.5704985717685984f, - -0.5706060746151055f, - -0.5707135676844315f, - -0.5708210509747348f, - -0.5709285244841729f, - -0.5710359882109057f, - -0.5711434421530911f, - -0.5712508863088879f, - -0.5713583206764551f, - -0.5714657452539511f, - -0.5715731600395366f, - -0.5716805650313705f, - -0.5717879602276125f, - -0.5718953456264213f, - -0.5720027212259587f, - -0.572110087024384f, - -0.5722174430198576f, - -0.5723247892105391f, - -0.5724321255945907f, - -0.5725394521701724f, - -0.5726467689354453f, - -0.5727540758885705f, - -0.5728613730277087f, - -0.5729686603510228f, - -0.5730759378566735f, - -0.573183205542823f, - -0.5732904634076323f, - -0.5733977114492653f, - -0.5735049496658833f, - -0.5736121780556489f, - -0.5737193966167241f, - -0.5738266053472731f, - -0.5739338042454584f, - -0.5740409933094425f, - -0.5741481725373897f, - -0.5742553419274626f, - -0.5743625014778259f, - -0.5744696511866425f, - -0.5745767910520772f, - -0.5746839210722933f, - -0.5747910412454558f, - -0.5748981515697293f, - -0.5750052520432785f, - -0.5751123426642676f, - -0.5752194234308621f, - -0.5753264943412275f, - -0.5754335553935289f, - -0.5755406065859318f, - -0.5756476479166012f, - -0.5757546793837043f, - -0.5758617009854066f, - -0.575968712719874f, - -0.5760757145852726f, - -0.5761827065797702f, - -0.5762896887015327f, - -0.5763966609487272f, - -0.5765036233195205f, - -0.5766105758120793f, - -0.5767175184245724f, - -0.5768244511551666f, - -0.5769313740020297f, - -0.5770382869633288f, - -0.5771451900372334f, - -0.5772520832219112f, - -0.5773589665155305f, - -0.5774658399162592f, - -0.5775727034222674f, - -0.5776795570317234f, - -0.5777864007427962f, - -0.5778932345536552f, - -0.5780000584624689f, - -0.5781068724674086f, - -0.5782136765666431f, - -0.5783204707583423f, - -0.5784272550406763f, - -0.578534029411816f, - -0.5786407938699314f, - -0.5787475484131926f, - -0.5788542930397711f, - -0.578961027747838f, - -0.5790677525355638f, - -0.5791744674011203f, - -0.5792811723426788f, - -0.5793878673584107f, - -0.579494552446488f, - -0.5796012276050829f, - -0.5797078928323675f, - -0.5798145481265131f, - -0.5799211934856939f, - -0.5800278289080817f, - -0.5801344543918494f, - -0.5802410699351691f, - -0.5803476755362157f, - -0.5804542711931616f, - -0.5805608569041804f, - -0.5806674326674457f, - -0.5807739984811308f, - -0.5808805543434109f, - -0.5809871002524597f, - -0.5810936362064516f, - -0.5812001622035602f, - -0.5813066782419618f, - -0.5814131843198305f, - -0.5815196804353414f, - -0.5816261665866697f, - -0.5817326427719899f, - -0.5818391089894792f, - -0.5819455652373127f, - -0.582052011513666f, - -0.5821584478167147f, - -0.5822648741446363f, - -0.5823712904956068f, - -0.5824776968678024f, - -0.5825840932593993f, - -0.5826904796685759f, - -0.5827968560935085f, - -0.5829032225323746f, - -0.5830095789833509f, - -0.5831159254446157f, - -0.5832222619143469f, - -0.583328588390722f, - -0.5834349048719195f, - -0.5835412113561173f, - -0.5836475078414944f, - -0.5837537943262288f, - -0.5838600708085f, - -0.5839663372864863f, - -0.5840725937583675f, - -0.5841788402223222f, - -0.5842850766765306f, - -0.5843913031191722f, - -0.584497519548426f, - -0.5846037259624733f, - -0.5847099223594938f, - -0.5848161087376677f, - -0.5849222850951749f, - -0.5850284514301974f, - -0.5851346077409154f, - -0.5852407540255101f, - -0.5853468902821618f, - -0.5854530165090535f, - -0.5855591327043658f, - -0.5856652388662806f, - -0.5857713349929797f, - -0.5858774210826446f, - -0.5859834971334589f, - -0.5860895631436043f, - -0.5861956191112633f, - -0.586301665034618f, - -0.5864077009118528f, - -0.5865137267411501f, - -0.5866197425206932f, - -0.5867257482486646f, - -0.5868317439232498f, - -0.5869377295426313f, - -0.5870437051049936f, - -0.5871496706085205f, - -0.5872556260513958f, - -0.5873615714318052f, - -0.5874675067479328f, - -0.5875734319979631f, - -0.5876793471800813f, - -0.587785252292473f, - -0.5878911473333233f, - -0.5879970323008171f, - -0.5881029071931411f, - -0.5882087720084802f, - -0.5883146267450213f, - -0.5884204714009499f, - -0.5885263059744531f, - -0.5886321304637165f, - -0.5887379448669275f, - -0.5888437491822732f, - -0.5889495434079404f, - -0.5890553275421159f, - -0.5891611015829874f, - -0.5892668655287431f, - -0.5893726193775701f, - -0.5894783631276567f, - -0.5895840967771899f, - -0.5896898203243597f, - -0.5897955337673536f, - -0.5899012371043605f, - -0.5900069303335683f, - -0.5901126134531676f, - -0.5902182864613466f, - -0.5903239493562946f, - -0.5904296021362007f, - -0.5905352447992556f, - -0.5906408773436487f, - -0.59074649976757f, - -0.5908521120692095f, - -0.590957714246757f, - -0.5910633062984045f, - -0.5911688882223419f, - -0.5912744600167602f, - -0.5913800216798495f, - -0.5914855732098027f, - -0.5915911146048104f, - -0.5916966458630641f, - -0.591802166982755f, - -0.5919076779620763f, - -0.5920131787992196f, - -0.5921186694923768f, - -0.5922241500397403f, - -0.592329620439503f, - -0.5924350806898581f, - -0.592540530788998f, - -0.5926459707351157f, - -0.5927514005264048f, - -0.5928568201610591f, - -0.5929622296372717f, - -0.5930676289532371f, - -0.5931730181071487f, - -0.5932783970972006f, - -0.5933837659215875f, - -0.5934891245785042f, - -0.5935944730661451f, - -0.5936998113827043f, - -0.5938051395263785f, - -0.593910457495362f, - -0.5940157652878502f, - -0.594121062902038f, - -0.5942263503361227f, - -0.5943316275882994f, - -0.5944368946567642f, - -0.5945421515397133f, - -0.5946473982353427f, - -0.5947526347418503f, - -0.5948578610574321f, - -0.5949630771802852f, - -0.595068283108606f, - -0.5951734788405932f, - -0.5952786643744437f, - -0.5953838397083551f, - -0.5954890048405245f, - -0.5955941597691514f, - -0.5956993044924332f, - -0.5958044390085685f, - -0.5959095633157556f, - -0.5960146774121927f, - -0.59611978129608f, - -0.5962248749656158f, - -0.5963299584189996f, - -0.5964350316544299f, - -0.5965400946701077f, - -0.5966451474642323f, - -0.5967501900350034f, - -0.5968552223806205f, - -0.5969602444992853f, - -0.5970652563891976f, - -0.5971702580485576f, - -0.5972752494755671f, - -0.597380230668426f, - -0.5974852016253366f, - -0.5975901623444991f, - -0.5976951128241161f, - -0.5978000530623885f, - -0.5979049830575185f, - -0.5980099028077084f, - -0.5981148123111603f, - -0.598219711566076f, - -0.5983246005706586f, - -0.5984294793231112f, - -0.5985343478216363f, - -0.5986392060644371f, - -0.5987440540497161f, - -0.5988488917756782f, - -0.5989537192405263f, - -0.5990585364424643f, - -0.5991633433796953f, - -0.5992681400504252f, - -0.5993729264528572f, - -0.5994777025851961f, - -0.5995824684456466f, - -0.5996872240324127f, - -0.5997919693437009f, - -0.5998967043777158f, - -0.6000014291326627f, - -0.6001061436067465f, - -0.6002108477981745f, - -0.6003155417051517f, - -0.6004202253258842f, - -0.6005248986585777f, - -0.60062956170144f, - -0.600734214452677f, - -0.6008388569104957f, - -0.6009434890731027f, - -0.6010481109387047f, - -0.6011527225055104f, - -0.6012573237717267f, - -0.6013619147355608f, - -0.6014664953952209f, - -0.6015710657489155f, - -0.6016756257948523f, - -0.6017801755312396f, - -0.6018847149562861f, - -0.6019892440682011f, - -0.6020937628651925f, - -0.6021982713454703f, - -0.6023027695072435f, - -0.6024072573487211f, - -0.602511734868113f, - -0.6026162020636296f, - -0.6027206589334803f, - -0.6028251054758746f, - -0.6029295416890244f, - -0.6030339675711393f, - -0.6031383831204301f, - -0.6032427883351069f, - -0.6033471832133822f, - -0.6034515677534666f, - -0.6035559419535714f, - -0.6036603058119081f, - -0.603764659326688f, - -0.6038690024961242f, - -0.6039733353184281f, - -0.6040776577918122f, - -0.604181969914488f, - -0.6042862716846698f, - -0.6043905631005695f, - -0.6044948441604002f, - -0.6045991148623752f, - -0.6047033752047068f, - -0.6048076251856103f, - -0.6049118648032984f, - -0.6050160940559851f, - -0.6051203129418838f, - -0.6052245214592102f, - -0.605328719606178f, - -0.6054329073810016f, - -0.6055370847818953f, - -0.6056412518070752f, - -0.605745408454756f, - -0.6058495547231527f, - -0.6059536906104808f, - -0.606057816114956f, - -0.6061619312347947f, - -0.606266035968212f, - -0.606370130313425f, - -0.6064742142686493f, - -0.6065782878321021f, - -0.6066823510019994f, - -0.606786403776559f, - -0.6068904461539971f, - -0.6069944781325314f, - -0.6070984997103795f, - -0.6072025108857589f, - -0.6073065116568874f, - -0.6074105020219821f, - -0.6075144819792627f, - -0.6076184515269467f, - -0.6077224106632528f, - -0.6078263593863988f, - -0.607930297694605f, - -0.60803422558609f, - -0.6081381430590727f, - -0.6082420501117718f, - -0.6083459467424085f, - -0.6084498329492017f, - -0.6085537087303714f, - -0.6086575740841378f, - -0.6087614290087203f, - -0.6088652735023409f, - -0.6089691075632195f, - -0.6090729311895771f, - -0.6091767443796338f, - -0.6092805471316122f, - -0.609384339443733f, - -0.6094881213142179f, - -0.6095918927412877f, - -0.6096956537231659f, - -0.6097994042580737f, - -0.6099031443442335f, - -0.6100068739798676f, - -0.6101105931631982f, - -0.6102143018924492f, - -0.610318000165843f, - -0.6104216879816025f, - -0.6105253653379511f, - -0.6106290322331129f, - -0.6107326886653114f, - -0.6108363346327698f, - -0.6109399701337129f, - -0.6110435951663644f, - -0.6111472097289489f, - -0.6112508138196915f, - -0.6113544074368165f, - -0.6114579905785485f, - -0.6115615632431132f, - -0.611665125428736f, - -0.611768677133642f, - -0.6118722183560568f, - -0.6119757490942063f, - -0.6120792693463171f, - -0.612182779110615f, - -0.6122862783853263f, - -0.612389767168677f, - -0.6124932454588952f, - -0.6125967132542071f, - -0.6127001705528398f, - -0.6128036173530198f, - -0.6129070536529763f, - -0.6130104794509358f, - -0.6131138947451265f, - -0.6132172995337755f, - -0.6133206938151123f, - -0.613424077587365f, - -0.6135274508487616f, - -0.6136308135975312f, - -0.6137341658319019f, - -0.6138375075501041f, - -0.6139408387503665f, - -0.6140441594309185f, - -0.614147469589989f, - -0.6142507692258092f, - -0.6143540583366084f, - -0.6144573369206169f, - -0.6145606049760641f, - -0.6146638625011821f, - -0.6147671094942009f, - -0.6148703459533514f, - -0.6149735718768642f, - -0.6150767872629711f, - -0.6151799921099037f, - -0.6152831864158933f, - -0.6153863701791714f, - -0.6154895433979704f, - -0.6155927060705225f, - -0.6156958581950598f, - -0.615798999769815f, - -0.6159021307930209f, - -0.6160052512629097f, - -0.6161083611777151f, - -0.6162114605356703f, - -0.6163145493350087f, - -0.6164176275739632f, - -0.6165206952507688f, - -0.6166237523636589f, - -0.6167267989108676f, - -0.6168298348906284f, - -0.6169328603011774f, - -0.6170358751407485f, - -0.6171388794075766f, - -0.6172418730998966f, - -0.6173448562159434f, - -0.6174478287539533f, - -0.6175507907121617f, - -0.617653742088804f, - -0.6177566828821157f, - -0.6178596130903341f, - -0.6179625327116951f, - -0.6180654417444349f, - -0.6181683401867898f, - -0.6182712280369977f, - -0.6183741052932953f, - -0.6184769719539196f, - -0.6185798280171081f, - -0.6186826734810976f, - -0.6187855083441274f, - -0.6188883326044347f, - -0.6189911462602575f, - -0.6190939493098337f, - -0.6191967417514029f, - -0.6192995235832033f, - -0.6194022948034736f, - -0.6195050554104523f, - -0.6196078054023799f, - -0.6197105447774952f, - -0.6198132735340374f, - -0.6199159916702468f, - -0.6200186991843629f, - -0.6201213960746265f, - -0.6202240823392772f, - -0.620326757976556f, - -0.6204294229847032f, - -0.6205320773619597f, - -0.6206347211065671f, - -0.6207373542167662f, - -0.6208399766907985f, - -0.6209425885269049f, - -0.6210451897233283f, - -0.6211477802783103f, - -0.6212503601900928f, - -0.6213529294569177f, - -0.6214554880770286f, - -0.6215580360486676f, - -0.6216605733700775f, - -0.6217631000395007f, - -0.6218656160551821f, - -0.621968121415364f, - -0.6220706161182902f, - -0.6221731001622044f, - -0.62227557354535f, - -0.6223780362659724f, - -0.6224804883223153f, - -0.6225829297126232f, - -0.6226853604351401f, - -0.6227877804881123f, - -0.6228901898697842f, - -0.6229925885784009f, - -0.6230949766122071f, - -0.6231973539694501f, - -0.6232997206483747f, - -0.623402076647227f, - -0.6235044219642532f, - -0.6236067565976988f, - -0.6237090805458118f, - -0.6238113938068381f, - -0.6239136963790246f, - -0.6240159882606183f, - -0.624118269449867f, - -0.6242205399450178f, - -0.6243227997443179f, - -0.6244250488460156f, - -0.6245272872483589f, - -0.6246295149495957f, - -0.6247317319479748f, - -0.6248339382417445f, - -0.6249361338291531f, - -0.6250383187084498f, - -0.6251404928778843f, - -0.6252426563357052f, - -0.6253448090801614f, - -0.625446951109504f, - -0.625549082421982f, - -0.6256512030158455f, - -0.625753312889344f, - -0.6258554120407293f, - -0.625957500468251f, - -0.6260595781701602f, - -0.6261616451447076f, - -0.6262637013901438f, - -0.6263657469047211f, - -0.6264677816866908f, - -0.6265698057343042f, - -0.6266718190458126f, - -0.6267738216194693f, - -0.6268758134535259f, - -0.6269777945462349f, - -0.6270797648958487f, - -0.6271817245006195f, - -0.6272836733588015f, - -0.6273856114686472f, - -0.6274875388284101f, - -0.6275894554363428f, - -0.6276913612907004f, - -0.627793256389736f, - -0.6278951407317039f, - -0.6279970143148574f, - -0.6280988771374525f, - -0.6282007291977431f, - -0.6283025704939837f, - -0.6284044010244293f, - -0.6285062207873352f, - -0.6286080297809572f, - -0.6287098280035501f, - -0.6288116154533703f, - -0.6289133921286729f, - -0.6290151580277149f, - -0.6291169131487516f, - -0.6292186574900405f, - -0.6293203910498373f, - -0.6294221138263991f, - -0.6295238258179835f, - -0.6296255270228471f, - -0.6297272174392474f, - -0.6298288970654414f, - -0.629930565899688f, - -0.6300322239402446f, - -0.6301338711853691f, - -0.6302355076333195f, - -0.6303371332823553f, - -0.6304387481307345f, - -0.6305403521767162f, - -0.6306419454185587f, - -0.6307435278545224f, - -0.6308450994828663f, - -0.6309466603018496f, - -0.6310482103097326f, - -0.6311497495047741f, - -0.6312512778852359f, - -0.6313527954493777f, - -0.6314543021954598f, - -0.6315557981217425f, - -0.6316572832264877f, - -0.6317587575079561f, - -0.6318602209644089f, - -0.6319616735941075f, - -0.6320631153953128f, - -0.6321645463662882f, - -0.6322659665052947f, - -0.6323673758105948f, - -0.63246877428045f, - -0.6325701619131244f, - -0.6326715387068799f, - -0.6327729046599792f, - -0.6328742597706857f, - -0.632975604037263f, - -0.6330769374579746f, - -0.6331782600310834f, - -0.633279571754854f, - -0.63338087262755f, - -0.6334821626474358f, - -0.6335834418127764f, - -0.6336847101218357f, - -0.6337859675728785f, - -0.6338872141641698f, - -0.6339884498939754f, - -0.6340896747605602f, - -0.634190888762189f, - -0.634292091897129f, - -0.6343932841636453f, - -0.6344944655600041f, - -0.6345956360844716f, - -0.6346967957353137f, - -0.6347979445107983f, - -0.6348990824091917f, - -0.6350002094287608f, - -0.6351013255677721f, - -0.6352024308244946f, - -0.6353035251971949f, - -0.6354046086841411f, - -0.6355056812836002f, - -0.6356067429938418f, - -0.6357077938131336f, - -0.6358088337397441f, - -0.6359098627719421f, - -0.6360108809079955f, - -0.6361118881461751f, - -0.6362128844847494f, - -0.6363138699219878f, - -0.6364148444561591f, - -0.6365158080855349f, - -0.6366167608083841f, - -0.6367177026229772f, - -0.6368186335275837f, - -0.6369195535204757f, - -0.6370204625999233f, - -0.6371213607641972f, - -0.6372222480115685f, - -0.6373231243403087f, - -0.6374239897486896f, - -0.6375248442349825f, - -0.6376256877974595f, - -0.6377265204343925f, - -0.6378273421440541f, - -0.6379281529247162f, - -0.6380289527746521f, - -0.6381297416921342f, - -0.6382305196754349f, - -0.6383312867228288f, - -0.6384320428325885f, - -0.6385327880029876f, - -0.6386335222322993f, - -0.6387342455187988f, - -0.6388349578607595f, - -0.6389356592564559f, - -0.6390363497041616f, - -0.6391370292021528f, - -0.6392376977487036f, - -0.6393383553420893f, - -0.6394390019805849f, - -0.6395396376624654f, - -0.6396402623860075f, - -0.6397408761494866f, - -0.6398414789511786f, - -0.639942070789359f, - -0.6400426516623057f, - -0.6401432215682944f, - -0.6402437805056019f, - -0.6403443284725046f, - -0.6404448654672809f, - -0.6405453914882073f, - -0.6406459065335616f, - -0.6407464106016214f, - -0.6408469036906638f, - -0.6409473857989684f, - -0.6410478569248126f, - -0.641148317066475f, - -0.6412487662222336f, - -0.6413492043903684f, - -0.6414496315691579f, - -0.641550047756881f, - -0.6416504529518172f, - -0.6417508471522466f, - -0.6418512303564486f, - -0.641951602562703f, - -0.6420519637692903f, - -0.6421523139744904f, - -0.6422526531765844f, - -0.6423529813738523f, - -0.6424532985645758f, - -0.6425536047470353f, - -0.6426538999195123f, - -0.6427541840802887f, - -0.6428544572276458f, - -0.6429547193598655f, - -0.6430549704752291f, - -0.6431552105720201f, - -0.6432554396485204f, - -0.6433556577030125f, - -0.6434558647337785f, - -0.6435560607391029f, - -0.6436562457172679f, - -0.6437564196665572f, - -0.6438565825852534f, - -0.6439567344716416f, - -0.6440568753240051f, - -0.6441570051406282f, - -0.644257123919795f, - -0.6443572316597893f, - -0.6444573283588972f, - -0.644557414015403f, - -0.6446574886275915f, - -0.6447575521937475f, - -0.6448576047121577f, - -0.6449576461811071f, - -0.6450576765988814f, - -0.6451576959637659f, - -0.6452577042740485f, - -0.6453577015280145f, - -0.6454576877239507f, - -0.6455576628601438f, - -0.64565762693488f, - -0.6457575799464479f, - -0.6458575218931342f, - -0.6459574527732259f, - -0.6460573725850113f, - -0.6461572813267784f, - -0.646257178996815f, - -0.6463570655934092f, - -0.6464569411148496f, - -0.6465568055594254f, - -0.6466566589254247f, - -0.646756501211137f, - -0.6468563324148515f, - -0.6469561525348573f, - -0.647055961569444f, - -0.6471557595169021f, - -0.647255546375521f, - -0.6473553221435903f, - -0.6474550868194017f, - -0.6475548404012451f, - -0.6476545828874114f, - -0.6477543142761906f, - -0.6478540345658753f, - -0.6479537437547561f, - -0.6480534418411247f, - -0.6481531288232725f, - -0.648252804699491f, - -0.6483524694680733f, - -0.6484521231273114f, - -0.6485517656754975f, - -0.6486513971109236f, - -0.648751017431884f, - -0.6488506266366709f, - -0.6489502247235777f, - -0.6490498116908976f, - -0.6491493875369236f, - -0.649248952259951f, - -0.6493485058582731f, - -0.6494480483301839f, - -0.6495475796739771f, - -0.6496470998879488f, - -0.6497466089703928f, - -0.6498461069196043f, - -0.6499455937338777f, - -0.6500450694115095f, - -0.6501445339507947f, - -0.650243987350029f, - -0.6503434296075079f, - -0.6504428607215278f, - -0.6505422806903853f, - -0.6506416895123762f, - -0.650741087185798f, - -0.6508404737089467f, - -0.65093984908012f, - -0.6510392132976146f, - -0.6511385663597284f, - -0.6512379082647585f, - -0.6513372390110029f, - -0.6514365585967601f, - -0.6515358670203278f, - -0.6516351642800046f, - -0.6517344503740881f, - -0.6518337253008785f, - -0.6519329890586741f, - -0.6520322416457742f, - -0.6521314830604772f, - -0.6522307133010842f, - -0.6523299323658941f, - -0.6524291402532068f, - -0.6525283369613217f, - -0.6526275224885406f, - -0.6527266968331633f, - -0.6528258599934903f, - -0.6529250119678225f, - -0.6530241527544605f, - -0.6531232823517066f, - -0.6532224007578618f, - -0.6533215079712275f, - -0.653420603990105f, - -0.6535196888127978f, - -0.6536187624376072f, - -0.6537178248628357f, - -0.653816876086786f, - -0.6539159161077599f, - -0.654014944924062f, - -0.6541139625339947f, - -0.6542129689358613f, - -0.6543119641279649f, - -0.6544109481086103f, - -0.6545099208761009f, - -0.6546088824287406f, - -0.6547078327648339f, - -0.6548067718826857f, - -0.6549056997806003f, - -0.6550046164568825f, - -0.6551035219098377f, - -0.6552024161377707f, - -0.6553012991389875f, - -0.6554001709117938f, - -0.6554990314544952f, - -0.6555978807653975f, - -0.6556967188428072f, - -0.6557955456850311f, - -0.6558943612903755f, - -0.6559931656571466f, - -0.6560919587836527f, - -0.6561907406682003f, - -0.6562895113090967f, - -0.6563882707046499f, - -0.6564870188531665f, - -0.6565857557529562f, - -0.6566844814023264f, - -0.6567831957995853f, - -0.6568818989430409f, - -0.6569805908310034f, - -0.6570792714617809f, - -0.6571779408336826f, - -0.6572765989450172f, - -0.6573752457940955f, - -0.6574738813792266f, - -0.6575725056987203f, - -0.6576711187508867f, - -0.6577697205340356f, - -0.6578683110464787f, - -0.657966890286526f, - -0.6580654582524884f, - -0.6581640149426763f, - -0.6582625603554023f, - -0.6583610944889771f, - -0.6584596173417124f, - -0.6585581289119198f, - -0.6586566291979116f, - -0.6587551181980003f, - -0.6588535959104979f, - -0.6589520623337168f, - -0.6590505174659703f, - -0.6591489613055715f, - -0.659247393850833f, - -0.6593458151000688f, - -0.659444225051592f, - -0.6595426237037166f, - -0.6596410110547565f, - -0.659739387103026f, - -0.6598377518468395f, - -0.6599361052845106f, - -0.6600344474143555f, - -0.6601327782346885f, - -0.6602310977438247f, - -0.6603294059400787f, - -0.6604277028217674f, - -0.6605259883872059f, - -0.66062426263471f, - -0.6607225255625951f, - -0.660820777169179f, - -0.6609190174527773f, - -0.6610172464117069f, - -0.6611154640442845f, - -0.6612136703488266f, - -0.6613118653236517f, - -0.6614100489670767f, - -0.6615082212774192f, - -0.6616063822529963f, - -0.6617045318921275f, - -0.6618026701931303f, - -0.6619007971543233f, - -0.6619989127740241f, - -0.6620970170505531f, - -0.6621951099822285f, - -0.6622931915673698f, - -0.662391261804296f, - -0.6624893206913263f, - -0.6625873682267817f, - -0.6626854044089815f, - -0.662783429236246f, - -0.6628814427068949f, - -0.6629794448192499f, - -0.6630774355716313f, - -0.6631754149623597f, - -0.6632733829897564f, - -0.6633713396521432f, - -0.6634692849478414f, - -0.6635672188751723f, - -0.6636651414324585f, - -0.6637630526180215f, - -0.6638609524301838f, - -0.6639588408672685f, - -0.6640567179275978f, - -0.6641545836094942f, - -0.6642524379112813f, - -0.6643502808312828f, - -0.6644481123678215f, - -0.6645459325192214f, - -0.6646437412838057f, - -0.6647415386598996f, - -0.6648393246458268f, - -0.664937099239912f, - -0.6650348624404788f, - -0.6651326142458536f, - -0.6652303546543608f, - -0.6653280836643255f, - -0.6654258012740726f, - -0.665523507481929f, - -0.66562120228622f, - -0.6657188856852714f, - -0.6658165576774097f, - -0.6659142182609603f, - -0.6660118674342514f, - -0.6661095051956092f, - -0.6662071315433605f, - -0.6663047464758319f, - -0.6664023499913523f, - -0.6664999420882483f, - -0.6665975227648478f, - -0.6666950920194783f, - -0.6667926498504692f, - -0.6668901962561481f, - -0.6669877312348437f, - -0.6670852547848843f, - -0.6671827669045994f, - -0.6672802675923184f, - -0.6673777568463701f, - -0.6674752346650841f, - -0.6675727010467902f, - -0.6676701559898187f, - -0.6677675994924992f, - -0.6678650315531627f, - -0.6679624521701388f, - -0.6680598613417592f, - -0.6681572590663539f, - -0.6682546453422549f, - -0.668352020167793f, - -0.6684493835412997f, - -0.6685467354611065f, - -0.6686440759255461f, - -0.6687414049329501f, - -0.6688387224816501f, - -0.66893602856998f, - -0.6690333231962717f, - -0.6691306063588582f, - -0.6692278780560725f, - -0.6693251382862473f, - -0.6694223870477173f, - -0.6695196243388155f, - -0.6696168501578759f, - -0.6697140645032318f, - -0.6698112673732188f, - -0.6699084587661707f, - -0.6700056386804221f, - -0.6701028071143073f, - -0.6701999640661624f, - -0.6702971095343224f, - -0.6703942435171224f, - -0.6704913660128983f, - -0.6705884770199849f, - -0.6706855765367199f, - -0.6707826645614388f, - -0.6708797410924778f, - -0.6709768061281731f, - -0.6710738596668628f, - -0.6711709017068832f, - -0.6712679322465716f, - -0.6713649512842645f, - -0.6714619588183011f, - -0.6715589548470184f, - -0.6716559393687545f, - -0.6717529123818471f, - -0.6718498738846351f, - -0.6719468238754573f, - -0.672043762352652f, - -0.6721406893145586f, - -0.6722376047595158f, - -0.6723345086858635f, - -0.6724314010919408f, - -0.672528281976088f, - -0.6726251513366445f, - -0.6727220091719507f, - -0.6728188554803474f, - -0.6729156902601746f, - -0.6730125135097734f, - -0.6731093252274839f, - -0.6732061254116487f, - -0.6733029140606084f, - -0.6733996911727045f, - -0.6734964567462781f, - -0.6735932107796726f, - -0.6736899532712295f, - -0.6737866842192909f, - -0.6738834036221989f, - -0.6739801114782975f, - -0.674076807785929f, - -0.6741734925434365f, - -0.6742701657491633f, - -0.6743668274014524f, - -0.6744634774986487f, - -0.6745601160390955f, - -0.674656743021137f, - -0.6747533584431168f, - -0.6748499623033808f, - -0.6749465546002729f, - -0.6750431353321382f, - -0.6751397044973217f, - -0.6752362620941682f, - -0.6753328081210244f, - -0.6754293425762353f, - -0.675525865458147f, - -0.6756223767651047f, - -0.6757188764954563f, - -0.6758153646475474f, - -0.6759118412197246f, - -0.6760083062103349f, - -0.6761047596177259f, - -0.6762012014402444f, - -0.6762976316762378f, - -0.6763940503240542f, - -0.676490457382041f, - -0.6765868528485466f, - -0.6766832367219195f, - -0.6767796090005082f, - -0.6768759696826605f, - -0.6769723187667261f, - -0.6770686562510543f, - -0.6771649821339938f, - -0.6772612964138938f, - -0.677357599089105f, - -0.6774538901579767f, - -0.677550169618859f, - -0.6776464374701023f, - -0.6777426937100564f, - -0.6778389383370731f, - -0.6779351713495027f, - -0.6780313927456962f, - -0.6781276025240044f, - -0.67822380068278f, - -0.678319987220374f, - -0.6784161621351382f, - -0.6785123254254242f, - -0.6786084770895855f, - -0.6787046171259737f, - -0.6788007455329418f, - -0.6788968623088424f, - -0.6789929674520281f, - -0.6790890609608534f, - -0.679185142833671f, - -0.6792812130688348f, - -0.6793772716646979f, - -0.6794733186196155f, - -0.6795693539319414f, - -0.6796653776000301f, - -0.6797613896222358f, - -0.6798573899969136f, - -0.6799533787224191f, - -0.6800493557971072f, - -0.680145321219333f, - -0.6802412749874525f, - -0.6803372170998218f, - -0.6804331475547963f, - -0.6805290663507331f, - -0.6806249734859877f, - -0.6807208689589177f, - -0.6808167527678792f, - -0.6809126249112298f, - -0.6810084853873267f, - -0.6811043341945264f, - -0.681200171331188f, - -0.6812959967956688f, - -0.6813918105863266f, - -0.6814876127015193f, - -0.6815834031396064f, - -0.6816791818989462f, - -0.6817749489778971f, - -0.681870704374818f, - -0.6819664480880693f, - -0.6820621801160096f, - -0.6821579004569988f, - -0.6822536091093966f, - -0.6823493060715625f, - -0.682444991341858f, - -0.682540664918643f, - -0.6826363268002781f, - -0.6827319769851234f, - -0.6828276154715416f, - -0.6829232422578929f, - -0.6830188573425391f, - -0.6831144607238409f, - -0.6832100524001616f, - -0.6833056323698627f, - -0.6834012006313065f, - -0.6834967571828552f, - -0.683592302022871f, - -0.6836878351497181f, - -0.6837833565617588f, - -0.6838788662573564f, - -0.6839743642348738f, - -0.6840698504926759f, - -0.6841653250291257f, - -0.6842607878425875f, - -0.6843562389314254f, - -0.6844516782940043f, - -0.6845471059286887f, - -0.684642521833843f, - -0.684737926007833f, - -0.6848333184490233f, - -0.6849286991557797f, - -0.6850240681264682f, - -0.6851194253594544f, - -0.685214770853104f, - -0.6853101046057836f, - -0.68540542661586f, - -0.6855007368816997f, - -0.6855960354016694f, - -0.6856913221741355f, - -0.6857865971974668f, - -0.6858818604700301f, - -0.6859771119901928f, - -0.6860723517563225f, - -0.6861675797667885f, - -0.6862627960199583f, - -0.6863580005142006f, - -0.6864531932478832f, - -0.6865483742193765f, - -0.6866435434270489f, - -0.6867387008692698f, - -0.6868338465444084f, - -0.6869289804508341f, - -0.6870241025869178f, - -0.6871192129510292f, - -0.6872143115415386f, - -0.6873093983568156f, - -0.6874044733952325f, - -0.6874995366551594f, - -0.6875945881349675f, - -0.6876896278330275f, - -0.6877846557477121f, - -0.6878796718773925f, - -0.6879746762204405f, - -0.688069668775228f, - -0.6881646495401276f, - -0.6882596185135121f, - -0.6883545756937541f, - -0.688449521079226f, - -0.6885444546683014f, - -0.6886393764593539f, - -0.6887342864507564f, - -0.6888291846408833f, - -0.6889240710281078f, - -0.6890189456108049f, - -0.6891138083873481f, - -0.6892086593561129f, - -0.6893034985154733f, - -0.6893983258638039f, - -0.689493141399481f, - -0.6895879451208795f, - -0.689682737026375f, - -0.6897775171143422f, - -0.6898722853831588f, - -0.6899670418312001f, - -0.6900617864568426f, - -0.6901565192584628f, - -0.6902512402344368f, - -0.690345949383143f, - -0.6904406467029578f, - -0.6905353321922587f, - -0.6906300058494226f, - -0.6907246676728285f, - -0.6908193176608538f, - -0.6909139558118769f, - -0.6910085821242752f, - -0.6911031965964288f, - -0.691197799226716f, - -0.6912923900135155f, - -0.6913869689552067f, - -0.6914815360501683f, - -0.6915760912967812f, - -0.6916706346934247f, - -0.6917651662384786f, - -0.6918596859303228f, - -0.6919541937673387f, - -0.6920486897479066f, - -0.6921431738704069f, - -0.6922376461332205f, - -0.6923321065347297f, - -0.6924265550733151f, - -0.6925209917473584f, - -0.6926154165552418f, - -0.6927098294953469f, - -0.6928042305660566f, - -0.6928986197657525f, - -0.6929929970928181f, - -0.6930873625456356f, - -0.6931817161225888f, - -0.6932760578220603f, - -0.693370387642434f, - -0.6934647055820932f, - -0.6935590116394219f, - -0.6936533058128047f, - -0.6937475881006255f, - -0.6938418585012689f, - -0.6939361170131187f, - -0.6940303636345614f, - -0.6941245983639812f, - -0.6942188211997636f, - -0.6943130321402934f, - -0.6944072311839576f, - -0.6945014183291415f, - -0.6945955935742313f, - -0.6946897569176131f, - -0.694783908357673f, - -0.6948780478927991f, - -0.6949721755213775f, - -0.6950662912417954f, - -0.6951603950524395f, - -0.6952544869516988f, - -0.6953485669379602f, - -0.6954426350096118f, - -0.695536691165041f, - -0.6956307354026376f, - -0.6957247677207896f, - -0.6958187881178856f, - -0.6959127965923145f, - -0.6960067931424652f, - -0.6961007777667281f, - -0.6961947504634922f, - -0.6962887112311471f, - -0.6963826600680829f, - -0.6964765969726904f, - -0.6965705219433596f, - -0.6966644349784806f, - -0.6967583360764449f, - -0.6968522252356435f, - -0.6969461024544676f, - -0.6970399677313082f, - -0.6971338210645576f, - -0.6972276624526069f, - -0.6973214918938486f, - -0.6974153093866753f, - -0.6975091149294791f, - -0.6976029085206523f, - -0.6976966901585882f, - -0.69779045984168f, - -0.6978842175683209f, - -0.6979779633369034f, - -0.698071697145823f, - -0.6981654189934725f, - -0.6982591288782461f, - -0.6983528267985384f, - -0.6984465127527428f, - -0.6985401867392557f, - -0.6986338487564712f, - -0.6987274988027844f, - -0.69882113687659f, - -0.698914762976285f, - -0.6990083771002642f, - -0.6991019792469237f, - -0.6991955694146591f, - -0.699289147601868f, - -0.6993827138069462f, - -0.6994762680282905f, - -0.699569810264298f, - -0.6996633405133651f, - -0.6997568587738906f, - -0.6998503650442713f, - -0.699943859322905f, - -0.7000373416081893f, - -0.7001308118985234f, - -0.7002242701923053f, - -0.7003177164879334f, - -0.7004111507838063f, - -0.7005045730783235f, - -0.7005979833698842f, - -0.7006913816568878f, - -0.7007847679377336f, - -0.7008781422108217f, - -0.7009715044745526f, - -0.7010648547273257f, - -0.7011581929675422f, - -0.7012515191936023f, - -0.7013448334039073f, - -0.7014381355968579f, - -0.7015314257708556f, - -0.701624703924302f, - -0.701717970055598f, - -0.7018112241631468f, - -0.7019044662453499f, - -0.7019976963006096f, - -0.7020909143273277f, - -0.7021841203239083f, - -0.7022773142887538f, - -0.7023704962202673f, - -0.7024636661168513f, - -0.7025568239769109f, - -0.7026499697988491f, - -0.7027431035810698f, - -0.7028362253219774f, - -0.7029293350199755f, - -0.70302243267347f, - -0.7031155182808649f, - -0.7032085918405655f, - -0.7033016533509762f, - -0.7033947028105036f, - -0.703487740217553f, - -0.70358076557053f, - -0.7036737788678399f, - -0.7037667801078904f, - -0.7038597692890872f, - -0.7039527464098371f, - -0.7040457114685468f, - -0.7041386644636228f, - -0.7042316053934736f, - -0.7043245342565062f, - -0.7044174510511282f, - -0.7045103557757468f, - -0.7046032484287714f, - -0.7046961290086098f, - -0.70478899751367f, - -0.7048818539423615f, - -0.7049746982930924f, - -0.7050675305642728f, - -0.7051603507543112f, - -0.7052531588616178f, - -0.7053459548846016f, - -0.7054387388216732f, - -0.7055315106712429f, - -0.7056242704317206f, - -0.7057170181015169f, - -0.7058097536790428f, - -0.7059024771627094f, - -0.7059951885509279f, - -0.7060878878421095f, - -0.7061805750346652f, - -0.7062732501270084f, - -0.70636591311755f, - -0.7064585640047026f, - -0.706551202786878f, - -0.70664382946249f, - -0.706736444029951f, - -0.7068290464876739f, - -0.7069216368340713f, - -0.7070142150675581f, - -0.7071067811865475f, - -0.7071993351894531f, - -0.7072918770746891f, - -0.7073844068406693f, - -0.7074769244858095f, - -0.7075694300085237f, - -0.7076619234072268f, - -0.7077544046803333f, - -0.7078468738262601f, - -0.707939330843422f, - -0.7080317757302346f, - -0.7081242084851134f, - -0.7082166291064758f, - -0.7083090375927377f, - -0.7084014339423155f, - -0.7084938181536258f, - -0.708586190225086f, - -0.7086785501551135f, - -0.7087708979421254f, - -0.7088632335845394f, - -0.7089555570807732f, - -0.7090478684292455f, - -0.7091401676283737f, - -0.709232454676577f, - -0.7093247295722737f, - -0.7094169923138829f, - -0.7095092428998233f, - -0.7096014813285149f, - -0.7096937075983768f, - -0.7097859217078281f, - -0.70987812365529f, - -0.7099703134391822f, - -0.7100624910579246f, - -0.7101546565099377f, - -0.7102468097936431f, - -0.7103389509074612f, - -0.7104310798498135f, - -0.710523196619121f, - -0.7106153012138049f, - -0.7107073936322883f, - -0.7107994738729925f, - -0.7108915419343397f, - -0.7109835978147517f, - -0.7110756415126526f, - -0.7111676730264643f, - -0.7112596923546102f, - -0.7113516994955128f, - -0.7114436944475968f, - -0.7115356772092852f, - -0.7116276477790021f, - -0.7117196061551716f, - -0.7118115523362172f, - -0.7119034863205648f, - -0.7119954081066384f, - -0.7120873176928633f, - -0.7121792150776635f, - -0.7122711002594659f, - -0.7123629732366955f, - -0.712454834007778f, - -0.7125466825711387f, - -0.7126385189252052f, - -0.7127303430684032f, - -0.712822154999159f, - -0.7129139547159001f, - -0.7130057422170528f, - -0.7130975175010451f, - -0.7131892805663038f, - -0.7132810314112572f, - -0.7133727700343324f, - -0.7134644964339579f, - -0.7135562106085624f, - -0.713647912556574f, - -0.7137396022764211f, - -0.7138312797665329f, - -0.7139229450253389f, - -0.7140145980512682f, - -0.7141062388427502f, - -0.714197867398214f, - -0.714289483716091f, - -0.7143810877948107f, - -0.7144726796328035f, - -0.7145642592284992f, - -0.71465582658033f, - -0.7147473816867264f, - -0.7148389245461194f, - -0.7149304551569406f, - -0.715021973517621f, - -0.7151134796265937f, - -0.7152049734822901f, - -0.7152964550831423f, - -0.7153879244275826f, - -0.7154793815140447f, - -0.7155708263409608f, - -0.7156622589067642f, - -0.7157536792098874f, - -0.7158450872487653f, - -0.7159364830218311f, - -0.7160278665275187f, - -0.7161192377642622f, - -0.7162105967304955f, - -0.7163019434246541f, - -0.7163932778451727f, - -0.7164845999904855f, - -0.7165759098590284f, - -0.716667207449237f, - -0.7167584927595465f, - -0.7168497657883925f, - -0.7169410265342117f, - -0.7170322749954401f, - -0.717123511170514f, - -0.7172147350578706f, - -0.7173059466559465f, - -0.7173971459631785f, - -0.7174883329780042f, - -0.7175795076988614f, - -0.7176706701241876f, - -0.7177618202524205f, - -0.7178529580819984f, - -0.7179440836113603f, - -0.7180351968389442f, - -0.7181262977631884f, - -0.7182173863825331f, - -0.7183084626954168f, - -0.7183995267002792f, - -0.7184905783955597f, - -0.7185816177796978f, - -0.7186726448511344f, - -0.7187636596083096f, - -0.7188546620496634f, - -0.7189456521736364f, - -0.7190366299786705f, - -0.719127595463206f, - -0.7192185486256846f, - -0.719309489464547f, - -0.7194004179782363f, - -0.7194913341651937f, - -0.7195822380238616f, - -0.7196731295526821f, - -0.7197640087500974f, - -0.7198548756145515f, - -0.7199457301444868f, - -0.7200365723383465f, - -0.7201274021945734f, - -0.7202182197116125f, - -0.7203090248879069f, - -0.7203998177219008f, - -0.7204905982120382f, - -0.7205813663567637f, - -0.7206721221545226f, - -0.720762865603759f, - -0.7208535967029188f, - -0.7209443154504466f, - -0.7210350218447886f, - -0.7211257158843901f, - -0.7212163975676975f, - -0.7213070668931565f, - -0.7213977238592141f, - -0.7214883684643163f, - -0.7215790007069105f, - -0.7216696205854435f, - -0.7217602280983618f, - -0.7218508232441143f, - -0.7219414060211479f, - -0.7220319764279106f, - -0.7221225344628498f, - -0.7222130801244151f, - -0.7223036134110543f, - -0.7223941343212164f, - -0.7224846428533493f, - -0.7225751390059039f, - -0.7226656227773286f, - -0.7227560941660731f, - -0.7228465531705872f, - -0.7229369997893202f, - -0.7230274340207238f, - -0.7231178558632475f, - -0.7232082653153421f, - -0.7232986623754579f, - -0.7233890470420471f, - -0.7234794193135605f, - -0.7235697791884494f, - -0.7236601266651651f, - -0.7237504617421606f, - -0.7238407844178875f, - -0.723931094690798f, - -0.724021392559345f, - -0.7241116780219802f, - -0.7242019510771581f, - -0.7242922117233312f, - -0.724382459958953f, - -0.7244726957824763f, - -0.7245629191923565f, - -0.7246531301870467f, - -0.724743328765001f, - -0.7248335149246745f, - -0.7249236886645212f, - -0.7250138499829967f, - -0.7251039988785554f, - -0.7251941353496532f, - -0.7252842593947452f, - -0.7253743710122873f, - -0.7254644702007359f, - -0.7255545569585468f, - -0.725644631284176f, - -0.7257346931760805f, - -0.7258247426327175f, - -0.7259147796525436f, - -0.7260048042340159f, - -0.7260948163755916f, - -0.7261848160757293f, - -0.7262748033328864f, - -0.7263647781455209f, - -0.7264547405120906f, - -0.7265446904310552f, - -0.7266346279008729f, - -0.7267245529200024f, - -0.7268144654869024f, - -0.7269043656000336f, - -0.7269942532578548f, - -0.727084128458826f, - -0.727173991201407f, - -0.7272638414840575f, - -0.7273536793052392f, - -0.727443504663412f, - -0.7275333175570371f, - -0.7276231179845746f, - -0.7277129059444871f, - -0.7278026814352356f, - -0.7278924444552819f, - -0.727982195003087f, - -0.7280719330771146f, - -0.7281616586758263f, - -0.7282513717976847f, - -0.7283410724411523f, - -0.7284307606046924f, - -0.7285204362867684f, - -0.7286100994858438f, - -0.7286997502003815f, - -0.7287893884288458f, - -0.7288790141697011f, - -0.7289686274214113f, - -0.7290582281824411f, - -0.7291478164512554f, - -0.7292373922263183f, - -0.7293269555060956f, - -0.7294165062890529f, - -0.7295060445736553f, - -0.7295955703583682f, - -0.7296850836416586f, - -0.7297745844219923f, - -0.7298640726978357f, - -0.7299535484676547f, - -0.7300430117299175f, - -0.7301324624830906f, - -0.7302219007256411f, - -0.7303113264560367f, - -0.7304007396727443f, - -0.7304901403742332f, - -0.7305795285589709f, - -0.7306689042254259f, - -0.7307582673720658f, - -0.7308476179973609f, - -0.7309369560997795f, - -0.7310262816777908f, - -0.7311155947298638f, - -0.7312048952544691f, - -0.731294183250076f, - -0.7313834587151548f, - -0.7314727216481755f, - -0.7315619720476082f, - -0.7316512099119247f, - -0.7317404352395953f, - -0.7318296480290913f, - -0.7319188482788835f, - -0.7320080359874445f, - -0.7320972111532456f, - -0.7321863737747586f, - -0.7322755238504555f, - -0.7323646613788096f, - -0.7324537863582932f, - -0.7325428987873785f, - -0.7326319986645398f, - -0.7327210859882491f, - -0.7328101607569811f, - -0.7328992229692085f, - -0.7329882726234062f, - -0.7330773097180474f, - -0.7331663342516069f, - -0.7332553462225598f, - -0.7333443456293804f, - -0.7334333324705434f, - -0.7335223067445245f, - -0.7336112684497993f, - -0.7337002175848432f, - -0.7337891541481321f, - -0.7338780781381414f, - -0.7339669895533487f, - -0.73405588839223f, - -0.7341447746532619f, - -0.7342336483349209f, - -0.7343225094356853f, - -0.7344113579540318f, - -0.7345001938884381f, - -0.7345890172373821f, - -0.7346778279993411f, - -0.7347666261727946f, - -0.7348554117562205f, - -0.7349441847480974f, - -0.7350329451469038f, - -0.7351216929511196f, - -0.7352104281592239f, - -0.7352991507696962f, - -0.7353878607810155f, - -0.7354765581916631f, - -0.7355652430001187f, - -0.7356539152048626f, - -0.7357425748043752f, - -0.735831221797137f, - -0.7359198561816302f, - -0.7360084779563357f, - -0.7360970871197343f, - -0.7361856836703081f, - -0.7362742676065396f, - -0.7363628389269102f, - -0.7364513976299024f, - -0.7365399437139988f, - -0.7366284771776825f, - -0.736716998019436f, - -0.7368055062377431f, - -0.7368940018310868f, - -0.7369824847979506f, - -0.7370709551368186f, - -0.7371594128461754f, - -0.7372478579245046f, - -0.7373362903702905f, - -0.7374247101820186f, - -0.7375131173581737f, - -0.7376015118972408f, - -0.7376898937977047f, - -0.737778263058052f, - -0.7378666196767683f, - -0.7379549636523393f, - -0.7380432949832513f, - -0.7381316136679903f, - -0.7382199197050441f, - -0.738308213092899f, - -0.7383964938300421f, - -0.7384847619149603f, - -0.738573017346142f, - -0.7386612601220748f, - -0.7387494902412464f, - -0.738837707702145f, - -0.7389259125032585f, - -0.7390141046430767f, - -0.7391022841200879f, - -0.7391904509327812f, - -0.7392786050796452f, - -0.7393667465591706f, - -0.7394548753698466f, - -0.739542991510163f, - -0.7396310949786095f, - -0.7397191857736775f, - -0.7398072638938572f, - -0.7398953293376392f, - -0.7399833821035144f, - -0.7400714221899743f, - -0.7401594495955106f, - -0.7402474643186143f, - -0.740335466357778f, - -0.7404234557114934f, - -0.740511432378253f, - -0.740599396356549f, - -0.7406873476448748f, - -0.7407752862417226f, - -0.740863212145586f, - -0.7409511253549589f, - -0.7410390258683343f, - -0.7411269136842061f, - -0.7412147888010681f, - -0.7413026512174153f, - -0.741390500931742f, - -0.7414783379425427f, - -0.7415661622483118f, - -0.7416539738475457f, - -0.7417417727387391f, - -0.7418295589203876f, - -0.7419173323909865f, - -0.7420050931490327f, - -0.7420928411930223f, - -0.7421805765214515f, - -0.7422682991328171f, - -0.7423560090256153f, - -0.7424437061983443f, - -0.7425313906495011f, - -0.7426190623775831f, - -0.7427067213810876f, - -0.7427943676585136f, - -0.7428820012083587f, - -0.7429696220291214f, - -0.7430572301192999f, - -0.743144825477394f, - -0.7432324081019024f, - -0.7433199779913241f, - -0.7434075351441589f, - -0.7434950795589058f, - -0.743582611234066f, - -0.7436701301681391f, - -0.743757636359625f, - -0.7438451298070248f, - -0.7439326105088395f, - -0.74402007846357f, - -0.7441075336697172f, - -0.744194976125783f, - -0.7442824058302687f, - -0.7443698227816767f, - -0.7444572269785087f, - -0.7445446184192674f, - -0.744631997102455f, - -0.7447193630265745f, - -0.7448067161901292f, - -0.744894056591622f, - -0.7449813842295562f, - -0.7450686991024354f, - -0.7451560012087644f, - -0.7452432905470463f, - -0.7453305671157858f, - -0.7454178309134869f, - -0.7455050819386555f, - -0.7455923201897958f, - -0.7456795456654132f, - -0.7457667583640124f, - -0.7458539582841003f, - -0.7459411454241821f, - -0.7460283197827638f, - -0.7461154813583514f, - -0.7462026301494522f, - -0.7462897661545727f, - -0.7463768893722196f, - -0.7464639998009001f, - -0.7465510974391211f, - -0.7466381822853912f, - -0.7467252543382179f, - -0.7468123135961091f, - -0.7468993600575724f, - -0.7469863937211176f, - -0.7470734145852527f, - -0.7471604226484867f, - -0.7472474179093281f, - -0.7473344003662875f, - -0.7474213700178738f, - -0.7475083268625969f, - -0.7475952708989664f, - -0.747682202125493f, - -0.7477691205406873f, - -0.7478560261430598f, - -0.747942918931121f, - -0.7480297989033823f, - -0.7481166660583554f, - -0.7482035203945513f, - -0.7482903619104823f, - -0.74837719060466f, - -0.7484640064755965f, - -0.7485508095218045f, - -0.7486375997417969f, - -0.7487243771340862f, - -0.748811141697185f, - -0.7488978934296079f, - -0.7489846323298676f, - -0.749071358396478f, - -0.7491580716279524f, - -0.7492447720228064f, - -0.7493314595795535f, - -0.7494181342967084f, - -0.7495047961727862f, - -0.7495914452063012f, - -0.7496780813957699f, - -0.749764704739707f, - -0.7498513152366286f, - -0.74993791288505f, - -0.7500244976834883f, - -0.7501110696304595f, - -0.7501976287244801f, - -0.7502841749640666f, - -0.750370708347737f, - -0.7504572288740079f, - -0.750543736541397f, - -0.750630231348422f, - -0.7507167132936002f, - -0.7508031823754509f, - -0.7508896385924918f, - -0.7509760819432417f, - -0.7510625124262187f, - -0.7511489300399431f, - -0.7512353347829335f, - -0.7513217266537093f, - -0.7514081056507897f, - -0.7514944717726959f, - -0.7515808250179473f, - -0.7516671653850641f, - -0.7517534928725673f, - -0.7518398074789773f, - -0.7519261092028154f, - -0.7520123980426027f, - -0.7520986739968609f, - -0.7521849370641113f, - -0.7522711872428759f, - -0.7523574245316773f, - -0.7524436489290375f, - -0.7525298604334787f, - -0.7526160590435241f, - -0.7527022447576969f, - -0.7527884175745201f, - -0.7528745774925172f, - -0.7529607245102112f, - -0.7530468586261272f, - -0.7531329798387887f, - -0.75321908814672f, - -0.7533051835484452f, - -0.7533912660424902f, - -0.7534773356273793f, - -0.7535633923016379f, - -0.7536494360637913f, - -0.7537354669123647f, - -0.7538214848458851f, - -0.7539074898628779f, - -0.7539934819618697f, - -0.7540794611413861f, - -0.7541654273999554f, - -0.7542513807361038f, - -0.7543373211483586f, - -0.7544232486352466f, - -0.7545091631952965f, - -0.7545950648270359f, - -0.7546809535289927f, - -0.7547668292996952f, - -0.7548526921376714f, - -0.7549385420414512f, - -0.7550243790095631f, - -0.7551102030405359f, - -0.7551960141328994f, - -0.7552818122851835f, - -0.7553675974959179f, - -0.7554533697636322f, - -0.755539129086857f, - -0.7556248754641235f, - -0.7557106088939615f, - -0.7557963293749025f, - -0.7558820369054777f, - -0.7559677314842181f, - -0.7560534131096557f, - -0.7561390817803226f, - -0.7562247374947506f, - -0.7563103802514716f, - -0.7563960100490189f, - -0.756481626885925f, - -0.7565672307607229f, - -0.756652821671945f, - -0.756738399618126f, - -0.7568239645977993f, - -0.7569095166094978f, - -0.7569950556517562f, - -0.757080581723109f, - -0.757166094822091f, - -0.7572515949472359f, - -0.7573370820970794f, - -0.7574225562701566f, - -0.7575080174650035f, - -0.7575934656801545f, - -0.7576789009141462f, - -0.7577643231655152f, - -0.7578497324327967f, - -0.7579351287145277f, - -0.7580205120092451f, - -0.7581058823154865f, - -0.7581912396317871f, - -0.7582765839566868f, - -0.7583619152887215f, - -0.7584472336264304f, - -0.7585325389683496f, - -0.7586178313130197f, - -0.7587031106589778f, - -0.7587883770047636f, - -0.7588736303489151f, - -0.7589588706899718f, - -0.7590440980264733f, - -0.7591293123569598f, - -0.7592145136799702f, - -0.7592997019940448f, - -0.7593848772977243f, - -0.7594700395895496f, - -0.7595551888680605f, - -0.7596403251317982f, - -0.7597254483793043f, - -0.7598105586091207f, - -0.7598956558197879f, - -0.7599807400098488f, - -0.7600658111778439f, - -0.7601508693223179f, - -0.7602359144418114f, - -0.7603209465348686f, - -0.7604059656000306f, - -0.7604909716358429f, - -0.7605759646408473f, - -0.7606609446135887f, - -0.7607459115526091f, - -0.760830865456455f, - -0.760915806323669f, - -0.7610007341527961f, - -0.7610856489423818f, - -0.7611705506909702f, - -0.7612554393971066f, - -0.7613403150593369f, - -0.761425177676207f, - -0.7615100272462618f, - -0.7615948637680481f, - -0.7616796872401121f, - -0.7617644976610011f, - -0.7618492950292606f, - -0.7619340793434383f, - -0.7620188506020813f, - -0.7621036088037378f, - -0.7621883539469544f, - -0.7622730860302793f, - -0.7623578050522608f, - -0.7624425110114479f, - -0.7625272039063881f, - -0.7626118837356305f, - -0.7626965504977243f, - -0.7627812041912194f, - -0.762865844814664f, - -0.7629504723666091f, - -0.7630350868456028f, - -0.7631196882501976f, - -0.7632042765789421f, - -0.7632888518303881f, - -0.7633734140030847f, - -0.7634579630955851f, - -0.7635424991064391f, - -0.7636270220341993f, - -0.7637115318774155f, - -0.7637960286346421f, - -0.7638805123044297f, - -0.7639649828853314f, - -0.7640494403758991f, - -0.764133884774686f, - -0.7642183160802453f, - -0.7643027342911307f, - -0.7643871394058946f, - -0.7644715314230915f, - -0.7645559103412752f, - -0.7646402761590005f, - -0.7647246288748207f, - -0.764808968487291f, - -0.7648932949949662f, - -0.7649776083964014f, - -0.7650619086901526f, - -0.7651461958747741f, - -0.7652304699488223f, - -0.765314730910853f, - -0.7653989787594231f, - -0.765483213493088f, - -0.7655674351104048f, - -0.7656516436099305f, - -0.7657358389902227f, - -0.7658200212498375f, - -0.7659041903873332f, - -0.7659883464012676f, - -0.766072489290199f, - -0.7661566190526847f, - -0.7662407356872845f, - -0.766324839192555f, - -0.7664089295670576f, - -0.7664930068093496f, - -0.7665770709179917f, - -0.7666611218915416f, - -0.7667451597285614f, - -0.7668291844276095f, - -0.7669131959872473f, - -0.766997194406034f, - -0.7670811796825311f, - -0.7671651518152993f, - -0.7672491108029006f, - -0.767333056643895f, - -0.7674169893368448f, - -0.7675009088803117f, - -0.7675848152728586f, - -0.7676687085130465f, - -0.7677525885994384f, - -0.7678364555305972f, - -0.7679203093050863f, - -0.7680041499214677f, - -0.7680879773783056f, - -0.7681717916741635f, - -0.7682555928076058f, - -0.7683393807771954f, - -0.7684231555814974f, - -0.7685069172190763f, - -0.7685906656884973f, - -0.7686744009883243f, - -0.7687581231171231f, - -0.7688418320734591f, - -0.7689255278558982f, - -0.7690092104630065f, - -0.7690928798933493f, - -0.7691765361454939f, - -0.7692601792180052f, - -0.7693438091094522f, - -0.7694274258184004f, - -0.7695110293434182f, - -0.7695946196830711f, - -0.7696781968359293f, - -0.769761760800559f, - -0.7698453115755294f, - -0.7699288491594073f, - -0.7700123735507635f, - -0.7700958847481651f, - -0.7701793827501824f, - -0.7702628675553833f, - -0.7703463391623383f, - -0.7704297975696167f, - -0.7705132427757894f, - -0.7705966747794252f, - -0.7706800935790951f, - -0.7707634991733698f, - -0.7708468915608209f, - -0.7709302707400181f, - -0.7710136367095339f, - -0.7710969894679383f, - -0.7711803290138052f, - -0.771263655345705f, - -0.7713469684622108f, - -0.7714302683618937f, - -0.7715135550433285f, - -0.7715968285050864f, - -0.771680088745741f, - -0.7717633357638659f, - -0.771846569558035f, - -0.7719297901268212f, - -0.7720129974687988f, - -0.7720961915825431f, - -0.7721793724666269f, - -0.7722625401196259f, - -0.7723456945401149f, - -0.7724288357266696f, - -0.7725119636778645f, - -0.7725950783922754f, - -0.7726781798684784f, - -0.7727612681050502f, - -0.7728443431005652f, - -0.7729274048536023f, - -0.7730104533627367f, - -0.7730934886265463f, - -0.7731765106436073f, - -0.7732595194124975f, - -0.773342514931795f, - -0.7734254972000778f, - -0.7735084662159232f, - -0.7735914219779099f, - -0.7736743644846167f, - -0.7737572937346228f, - -0.7738402097265061f, - -0.7739231124588465f, - -0.7740060019302235f, - -0.7740888781392172f, - -0.7741717410844067f, - -0.7742545907643731f, - -0.774337427177695f, - -0.7744202503229556f, - -0.7745030601987337f, - -0.7745858568036117f, - -0.7746686401361692f, - -0.77475141019499f, - -0.7748341669786541f, - -0.7749169104857447f, - -0.7749996407148422f, - -0.7750823576645314f, - -0.7751650613333931f, - -0.7752477517200117f, - -0.7753304288229688f, - -0.7754130926408485f, - -0.7754957431722342f, - -0.77557838041571f, - -0.7756610043698604f, - -0.7757436150332684f, - -0.7758262124045191f, - -0.7759087964821973f, - -0.7759913672648885f, - -0.7760739247511766f, - -0.7761564689396477f, - -0.7762389998288874f, - -0.7763215174174821f, - -0.7764040217040168f, - -0.7764865126870784f, - -0.7765689903652533f, - -0.7766514547371288f, - -0.7767339058012911f, - -0.7768163435563277f, - -0.776898768000826f, - -0.7769811791333745f, - -0.7770635769525598f, - -0.7771459614569711f, - -0.7772283326451953f, - -0.7773106905158231f, - -0.7773930350674417f, - -0.7774753662986411f, - -0.7775576842080092f, - -0.7776399887941374f, - -0.7777222800556141f, - -0.77780455799103f, - -0.7778868225989739f, - -0.7779690738780384f, - -0.7780513118268124f, - -0.7781335364438879f, - -0.778215747727855f, - -0.7782979456773055f, - -0.7783801302908309f, - -0.7784623015670236f, - -0.7785444595044746f, - -0.7786266041017765f, - -0.778708735357522f, - -0.7787908532703043f, - -0.778872957838715f, - -0.7789550490613482f, - -0.7790371269367969f, - -0.7791191914636555f, - -0.7792012426405167f, - -0.7792832804659752f, - -0.7793653049386251f, - -0.7794473160570616f, - -0.7795293138198784f, - -0.779611298225671f, - -0.7796932692730347f, - -0.7797752269605648f, - -0.7798571712868576f, - -0.7799391022505079f, - -0.780021019850113f, - -0.7801029240842675f, - -0.7801848149515703f, - -0.7802666924506165f, - -0.7803485565800042f, - -0.7804304073383292f, - -0.7805122447241911f, - -0.780594068736186f, - -0.7806758793729129f, - -0.7807576766329686f, - -0.7808394605149533f, - -0.7809212310174644f, - -0.7810029881391017f, - -0.7810847318784633f, - -0.7811664622341489f, - -0.7812481792047583f, - -0.7813298827888917f, - -0.7814115729851482f, - -0.7814932497921284f, - -0.781574913208433f, - -0.7816565632326631f, - -0.7817381998634186f, - -0.7818198230993012f, - -0.7819014329389125f, - -0.7819830293808544f, - -0.7820646124237278f, - -0.782146182066136f, - -0.7822277383066795f, - -0.7823092811439631f, - -0.7823908105765881f, - -0.7824723266031578f, - -0.7825538292222757f, - -0.7826353184325456f, - -0.7827167942325702f, - -0.782798256620954f, - -0.7828797055963013f, - -0.7829611411572167f, - -0.783042563302304f, - -0.7831239720301685f, - -0.7832053673394159f, - -0.7832867492286504f, - -0.7833681176964781f, - -0.7834494727415046f, - -0.7835308143623366f, - -0.7836121425575788f, - -0.7836934573258396f, - -0.7837747586657243f, - -0.7838560465758407f, - -0.7839373210547945f, - -0.7840185821011952f, - -0.7840998297136488f, - -0.784181063890764f, - -0.7842622846311481f, - -0.7843434919334099f, - -0.7844246857961578f, - -0.7845058662180011f, - -0.784587033197548f, - -0.7846681867334078f, - -0.7847493268241903f, - -0.7848304534685057f, - -0.7849115666649626f, - -0.7849926664121726f, - -0.7850737527087441f, - -0.7851548255532902f, - -0.7852358849444198f, - -0.7853169308807453f, - -0.7853979633608761f, - -0.7854789823834262f, - -0.7855599879470055f, - -0.7856409800502273f, - -0.785721958691702f, - -0.7858029238700444f, - -0.7858838755838653f, - -0.785964813831779f, - -0.7860457386123972f, - -0.7861266499243341f, - -0.7862075477662034f, - -0.7862884321366186f, - -0.7863693030341945f, - -0.7864501604575443f, - -0.7865310044052831f, - -0.7866118348760257f, - -0.7866926518683875f, - -0.7867734553809828f, - -0.7868542454124273f, - -0.786935021961337f, - -0.7870157850263282f, - -0.787096534606016f, - -0.7871772706990173f, - -0.7872579933039489f, - -0.7873387024194278f, - -0.7874193980440704f, - -0.7875000801764942f, - -0.7875807488153169f, - -0.7876614039591567f, - -0.7877420456066307f, - -0.7878226737563576f, - -0.7879032884069558f, - -0.7879838895570446f, - -0.7880644772052416f, - -0.7881450513501674f, - -0.7882256119904396f, - -0.7883061591246799f, - -0.7883866927515066f, - -0.7884672128695409f, - -0.7885477194774014f, - -0.7886282125737109f, - -0.7887086921570884f, - -0.7887891582261561f, - -0.7888696107795342f, - -0.7889500498158446f, - -0.7890304753337091f, - -0.7891108873317499f, - -0.7891912858085885f, - -0.7892716707628477f, - -0.7893520421931498f, - -0.7894324000981187f, - -0.789512744476376f, - -0.7895930753265457f, - -0.7896733926472514f, - -0.7897536964371175f, - -0.7898339866947667f, - -0.789914263418824f, - -0.7899945266079137f, - -0.7900747762606607f, - -0.7901550123756904f, - -0.7902352349516268f, - -0.7903154439870961f, - -0.7903956394807237f, - -0.790475821431136f, - -0.7905559898369583f, - -0.7906361446968171f, - -0.7907162860093393f, - -0.790796413773152f, - -0.7908765279868814f, - -0.7909566286491555f, - -0.7910367157586006f, - -0.7911167893138462f, - -0.7911968493135189f, - -0.7912768957562477f, - -0.7913569286406598f, - -0.7914369479653857f, - -0.7915169537290527f, - -0.7915969459302912f, - -0.7916769245677288f, - -0.7917568896399971f, - -0.7918368411457247f, - -0.7919167790835423f, - -0.7919967034520794f, - -0.7920766142499669f, - -0.7921565114758357f, - -0.7922363951283171f, - -0.7923162652060415f, - -0.7923961217076406f, - -0.7924759646317463f, - -0.7925557939769909f, - -0.7926356097420056f, - -0.7927154119254234f, - -0.7927952005258766f, - -0.7928749755419988f, - -0.792954736972422f, - -0.7930344848157801f, - -0.7931142190707064f, - -0.7931939397358354f, - -0.7932736468098f, - -0.7933533402912349f, - -0.7934330201787748f, - -0.7935126864710548f, - -0.7935923391667086f, - -0.7936719782643722f, - -0.7937516037626813f, - -0.79383121566027f, - -0.7939108139557766f, - -0.793990398647835f, - -0.7940699697350833f, - -0.794149527216156f, - -0.7942290710896921f, - -0.7943086013543271f, - -0.7943881180086995f, - -0.7944676210514449f, - -0.7945471104812033f, - -0.7946265862966111f, - -0.7947060484963077f, - -0.7947854970789301f, - -0.7948649320431179f, - -0.7949443533875098f, - -0.7950237611107455f, - -0.7951031552114632f, - -0.7951825356883032f, - -0.7952619025399054f, - -0.7953412557649101f, - -0.7954205953619568f, - -0.7954999213296865f, - -0.79557923366674f, - -0.7956585323717587f, - -0.7957378174433829f, - -0.7958170888802552f, - -0.7958963466810155f, - -0.795975590844308f, - -0.7960548213687734f, - -0.7961340382530548f, - -0.7962132414957936f, - -0.7962924310956347f, - -0.7963716070512197f, - -0.7964507693611922f, - -0.7965299180241959f, - -0.7966090530388753f, - -0.7966881744038732f, - -0.7967672821178344f, - -0.7968463761794041f, - -0.7969254565872259f, - -0.7970045233399452f, - -0.7970835764362074f, - -0.7971626158746584f, - -0.7972416416539427f, - -0.797320653772707f, - -0.7973996522295972f, - -0.7974786370232604f, - -0.797557608152342f, - -0.7976365656154895f, - -0.7977155094113498f, - -0.7977944395385711f, - -0.7978733559957996f, - -0.7979522587816836f, - -0.7980311478948713f, - -0.7981100233340115f, - -0.7981888850977514f, - -0.7982677331847404f, - -0.7983465675936275f, - -0.7984253883230624f, - -0.7985041953716935f, - -0.7985829887381714f, - -0.7986617684211444f, - -0.798740534419265f, - -0.7988192867311816f, - -0.7988980253555461f, - -0.7989767502910078f, - -0.7990554615362198f, - -0.7991341590898318f, - -0.7992128429504963f, - -0.7992915131168636f, - -0.799370169587588f, - -0.7994488123613198f, - -0.7995274414367127f, - -0.7996060568124185f, - -0.7996846584870905f, - -0.7997632464593819f, - -0.7998418207279466f, - -0.7999203812914374f, - -0.7999989281485085f, - -0.8000774612978141f, - -0.8001559807380085f, - -0.800234486467747f, - -0.8003129784856831f, - -0.8003914567904725f, - -0.8004699213807707f, - -0.8005483722552335f, - -0.8006268094125156f, - -0.8007052328512737f, - -0.8007836425701639f, - -0.8008620385678433f, - -0.8009404208429676f, - -0.801018789394194f, - -0.80109714422018f, - -0.8011754853195833f, - -0.8012538126910606f, - -0.8013321263332708f, - -0.8014104262448704f, - -0.8014887124245199f, - -0.8015669848708764f, - -0.8016452435825997f, - -0.8017234885583472f, - -0.8018017197967805f, - -0.8018799372965573f, - -0.8019581410563386f, - -0.8020363310747827f, - -0.802114507350552f, - -0.8021926698823054f, - -0.8022708186687048f, - -0.8023489537084098f, - -0.8024270750000821f, - -0.8025051825423835f, - -0.8025832763339759f, - -0.80266135637352f, - -0.8027394226596787f, - -0.8028174751911143f, - -0.8028955139664898f, - -0.8029735389844671f, - -0.8030515502437098f, - -0.803129547742881f, - -0.803207531480645f, - -0.8032855014556645f, - -0.8033634576666038f, - -0.8034414001121273f, - -0.8035193287909f, - -0.8035972437015857f, - -0.8036751448428496f, - -0.803753032213357f, - -0.8038309058117739f, - -0.8039087656367648f, - -0.8039866116869964f, - -0.8040644439611344f, - -0.8041422624578454f, - -0.8042200671757965f, - -0.8042978581136536f, - -0.8043756352700847f, - -0.8044533986437554f, - -0.8045311482333357f, - -0.8046088840374915f, - -0.804686606054892f, - -0.8047643142842038f, - -0.8048420087240976f, - -0.8049196893732404f, - -0.8049973562303024f, - -0.8050750092939511f, - -0.8051526485628581f, - -0.8052302740356915f, - -0.8053078857111221f, - -0.8053854835878191f, - -0.8054630676644535f, - -0.8055406379396959f, - -0.8056181944122176f, - -0.8056957370806885f, - -0.8057732659437807f, - -0.8058507810001657f, - -0.8059282822485159f, - -0.806005769687502f, - -0.8060832433157977f, - -0.8061607031320737f, - -0.8062381491350048f, - -0.8063155813232625f, - -0.8063929996955211f, - -0.8064704042504526f, - -0.8065477949867326f, - -0.8066251719030334f, - -0.8067025349980298f, - -0.8067798842703963f, - -0.8068572197188079f, - -0.8069345413419384f, - -0.8070118491384637f, - -0.8070891431070595f, - -0.8071664232464003f, - -0.8072436895551626f, - -0.8073209420320222f, - -0.8073981806756562f, - -0.80747540548474f, - -0.8075526164579507f, - -0.8076298135939657f, - -0.8077069968914624f, - -0.807784166349117f, - -0.8078613219656091f, - -0.8079384637396152f, - -0.8080155916698145f, - -0.8080927057548845f, - -0.8081698059935042f, - -0.8082468923843527f, - -0.8083239649261095f, - -0.808401023617453f, - -0.8084780684570635f, - -0.8085550994436206f, - -0.808632116575805f, - -0.8087091198522961f, - -0.8087861092717749f, - -0.8088630848329222f, - -0.8089400465344196f, - -0.8090169943749473f, - -0.8090939283531879f, - -0.8091708484678216f, - -0.8092477547175325f, - -0.8093246471010012f, - -0.8094015256169113f, - -0.8094783902639437f, - -0.8095552410407837f, - -0.8096320779461129f, - -0.8097089009786157f, - -0.8097857101369746f, - -0.8098625054198743f, - -0.8099392868259986f, - -0.8100160543540326f, - -0.8100928080026598f, - -0.8101695477705657f, - -0.8102462736564352f, - -0.8103229856589537f, - -0.8103996837768073f, - -0.8104763680086806f, - -0.8105530383532605f, - -0.810629694809233f, - -0.8107063373752852f, - -0.8107829660501027f, - -0.8108595808323733f, - -0.810936181720784f, - -0.8110127687140227f, - -0.8110893418107763f, - -0.8111659010097331f, - -0.8112424463095814f, - -0.8113189777090101f, - -0.8113954952067066f, - -0.8114719988013607f, - -0.8115484884916612f, - -0.8116249642762982f, - -0.8117014261539601f, - -0.8117778741233379f, - -0.8118543081831201f, - -0.8119307283319992f, - -0.812007134568664f, - -0.8120835268918065f, - -0.8121599053001161f, - -0.8122362697922861f, - -0.8123126203670066f, - -0.8123889570229703f, - -0.8124652797588677f, - -0.8125415885733931f, - -0.8126178834652373f, - -0.8126941644330942f, - -0.8127704314756555f, - -0.8128466845916151f, - -0.8129229237796665f, - -0.8129991490385036f, - -0.8130753603668194f, - -0.8131515577633085f, - -0.8132277412266654f, - -0.8133039107555853f, - -0.8133800663487618f, - -0.8134562080048906f, - -0.813532335722667f, - -0.8136084495007871f, - -0.8136845493379459f, - -0.8137606352328396f, - -0.8138367071841647f, - -0.8139127651906177f, - -0.8139888092508959f, - -0.8140648393636952f, - -0.8141408555277134f, - -0.8142168577416481f, - -0.8142928460041973f, - -0.8143688203140581f, - -0.8144447806699296f, - -0.8145207270705089f, - -0.8145966595144967f, - -0.8146725780005901f, - -0.8147484825274897f, - -0.814824373093893f, - -0.8149002496985018f, - -0.8149761123400145f, - -0.8150519610171322f, - -0.8151277957285538f, - -0.8152036164729818f, - -0.8152794232491155f, - -0.8153552160556571f, - -0.8154309948913069f, - -0.8155067597547668f, - -0.8155825106447387f, - -0.8156582475599252f, - -0.8157339704990274f, - -0.8158096794607484f, - -0.8158853744437911f, - -0.8159610554468586f, - -0.8160367224686536f, - -0.8161123755078796f, - -0.8161880145632406f, - -0.816263639633441f, - -0.8163392507171839f, - -0.8164148478131743f, - -0.816490430920117f, - -0.8165660000367171f, - -0.8166415551616789f, - -0.8167170962937083f, - -0.8167926234315108f, - -0.816868136573793f, - -0.8169436357192599f, - -0.8170191208666182f, - -0.8170945920145746f, - -0.8171700491618364f, - -0.8172454923071097f, - -0.8173209214491023f, - -0.8173963365865222f, - -0.8174717377180758f, - -0.8175471248424729f, - -0.8176224979584205f, - -0.8176978570646278f, - -0.8177732021598023f, - -0.817848533242655f, - -0.8179238503118935f, - -0.8179991533662283f, - -0.8180744424043681f, - -0.8181497174250233f, - -0.8182249784269041f, - -0.8183002254087215f, - -0.8183754583691851f, - -0.8184506773070064f, - -0.8185258822208963f, - -0.818601073109567f, - -0.8186762499717288f, - -0.8187514128060943f, - -0.8188265616113756f, - -0.8189016963862854f, - -0.8189768171295354f, - -0.8190519238398395f, - -0.819127016515909f, - -0.8192020951564595f, - -0.8192771597602028f, - -0.8193522103258538f, - -0.8194272468521251f, - -0.819502269337733f, - -0.8195772777813902f, - -0.8196522721818128f, - -0.8197272525377141f, - -0.8198022188478113f, - -0.8198771711108186f, - -0.819952109325452f, - -0.8200270334904282f, - -0.820101943604462f, - -0.8201768396662706f, - -0.8202517216745707f, - -0.8203265896280797f, - -0.8204014435255136f, - -0.8204762833655904f, - -0.8205511091470278f, - -0.8206259208685441f, - -0.8207007185288565f, - -0.8207755021266837f, - -0.8208502716607444f, - -0.8209250271297581f, - -0.8209997685324427f, - -0.821074495867518f, - -0.8211492091337037f, - -0.82122390832972f, - -0.821298593454286f, - -0.8213732645061226f, - -0.8214479214839501f, - -0.8215225643864899f, - -0.821597193212462f, - -0.8216718079605887f, - -0.8217464086295899f, - -0.8218209952181894f, - -0.8218955677251076f, - -0.821970126149068f, - -0.8220446704887912f, - -0.822119200743002f, - -0.8221937169104221f, - -0.8222682189897753f, - -0.8223427069797838f, - -0.8224171808791731f, - -0.8224916406866659f, - -0.8225660864009869f, - -0.8226405180208599f, - -0.8227149355450097f, - -0.8227893389721616f, - -0.8228637283010407f, - -0.8229381035303718f, - -0.8230124646588808f, - -0.8230868116852934f, - -0.8231611446083366f, - -0.8232354634267353f, - -0.8233097681392167f, - -0.8233840587445078f, - -0.8234583352413359f, - -0.8235325976284275f, - -0.8236068459045104f, - -0.8236810800683125f, - -0.8237553001185619f, - -0.8238295060539873f, - -0.8239036978733161f, - -0.8239778755752777f, - -0.8240520391586009f, - -0.8241261886220157f, - -0.8242003239642502f, - -0.824274445184035f, - -0.8243485522800998f, - -0.8244226452511754f, - -0.8244967240959911f, - -0.8245707888132787f, - -0.8246448394017677f, - -0.8247188758601911f, - -0.8247928981872789f, - -0.8248669063817636f, - -0.8249409004423759f, - -0.8250148803678495f, - -0.8250888461569157f, - -0.8251627978083079f, - -0.8252367353207575f, - -0.8253106586929995f, - -0.8253845679237659f, - -0.8254584630117912f, - -0.8255323439558082f, - -0.8256062107545515f, - -0.8256800634067555f, - -0.8257539019111552f, - -0.8258277262664844f, - -0.8259015364714785f, - -0.825975332524873f, - -0.8260491144254037f, - -0.8261228821718056f, - -0.826196635762815f, - -0.8262703751971684f, - -0.8263441004736025f, - -0.8264178115908533f, - -0.8264915085476581f, - -0.8265651913427542f, - -0.8266388599748795f, - -0.8267125144427708f, - -0.8267861547451666f, - -0.8268597808808049f, - -0.8269333928484248f, - -0.8270069906467639f, - -0.8270805742745616f, - -0.8271541437305576f, - -0.8272276990134899f, - -0.8273012401221f, - -0.8273747670551264f, - -0.8274482798113102f, - -0.8275217783893902f, - -0.8275952627881091f, - -0.8276687330062062f, - -0.8277421890424238f, - -0.8278156308955016f, - -0.8278890585641832f, - -0.8279624720472089f, - -0.8280358713433218f, - -0.8281092564512633f, - -0.8281826273697763f, - -0.8282559840976039f, - -0.8283293266334893f, - -0.8284026549761752f, - -0.8284759691244052f, - -0.8285492690769234f, - -0.8286225548324742f, - -0.8286958263898009f, - -0.8287690837476483f, - -0.8288423269047617f, - -0.828915555859886f, - -0.8289887706117658f, - -0.8290619711591474f, - -0.829135157500775f, - -0.8292083296353969f, - -0.8292814875617576f, - -0.8293546312786044f, - -0.8294277607846827f, - -0.8295008760787415f, - -0.8295739771595262f, - -0.829647064025785f, - -0.829720136676266f, - -0.8297931951097162f, - -0.829866239324884f, - -0.8299392693205182f, - -0.8300122850953676f, - -0.8300852866481803f, - -0.8301582739777058f, - -0.8302312470826936f, - -0.8303042059618937f, - -0.8303771506140551f, - -0.8304500810379284f, - -0.830522997232264f, - -0.8305958991958127f, - -0.8306687869273247f, - -0.8307416604255514f, - -0.8308145196892442f, - -0.8308873647171552f, - -0.8309601955080351f, - -0.8310330120606366f, - -0.8311058143737119f, - -0.8311786024460142f, - -0.8312513762762951f, - -0.8313241358633083f, - -0.831396881205807f, - -0.8314696123025452f, - -0.8315423291522759f, - -0.8316150317537537f, - -0.8316877201057318f, - -0.8317603942069665f, - -0.8318330540562109f, - -0.8319056996522213f, - -0.8319783309937512f, - -0.8320509480795582f, - -0.8321235509083964f, - -0.8321961394790229f, - -0.8322687137901925f, - -0.8323412738406634f, - -0.832413819629191f, - -0.8324863511545332f, - -0.8325588684154461f, - -0.8326313714106878f, - -0.8327038601390159f, - -0.8327763345991888f, - -0.8328487947899637f, - -0.8329212407100994f, - -0.8329936723583548f, - -0.8330660897334886f, - -0.8331384928342606f, - -0.8332108816594289f, - -0.833283256207754f, - -0.8333556164779956f, - -0.8334279624689144f, - -0.8335002941792696f, - -0.8335726116078226f, - -0.833644914753334f, - -0.8337172036145656f, - -0.8337894781902775f, - -0.8338617384792321f, - -0.833933984480191f, - -0.8340062161919168f, - -0.834078433613171f, - -0.8341506367427172f, - -0.8342228255793164f, - -0.8342950001217339f, - -0.8343671603687315f, - -0.8344393063190737f, - -0.8345114379715228f, - -0.834583555324845f, - -0.8346556583778028f, - -0.8347277471291619f, - -0.8347998215776856f, - -0.8348718817221409f, - -0.8349439275612915f, - -0.835015959093904f, - -0.8350879763187432f, - -0.8351599792345754f, - -0.8352319678401671f, - -0.8353039421342852f, - -0.8353759021156952f, - -0.835447847783165f, - -0.8355197791354616f, - -0.835591696171353f, - -0.835663598889606f, - -0.8357354872889888f, - -0.83580736136827f, - -0.8358792211262183f, - -0.8359510665616016f, - -0.836022897673189f, - -0.83609471445975f, - -0.8361665169200544f, - -0.836238305052871f, - -0.8363100788569702f, - -0.836381838331122f, - -0.836453583474097f, - -0.8365253142846665f, - -0.8365970307616f, - -0.8366687329036695f, - -0.8367404207096463f, - -0.8368120941783025f, - -0.8368837533084091f, - -0.8369553980987392f, - -0.8370270285480637f, - -0.837098644655157f, - -0.8371702464187908f, - -0.8372418338377391f, - -0.8373134069107738f, - -0.8373849656366704f, - -0.8374565100142014f, - -0.8375280400421419f, - -0.8375995557192651f, - -0.8376710570443463f, - -0.8377425440161601f, - -0.8378140166334823f, - -0.8378854748950872f, - -0.8379569187997509f, - -0.8380283483462491f, - -0.8380997635333585f, - -0.8381711643598543f, - -0.8382425508245137f, - -0.8383139229261135f, - -0.8383852806634311f, - -0.838456624035243f, - -0.8385279530403276f, - -0.8385992676774613f, - -0.8386705679454242f, - -0.8387418538429928f, - -0.8388131253689465f, - -0.8388843825220638f, - -0.8389556253011243f, - -0.8390268537049065f, - -0.8390980677321901f, - -0.839169267381755f, - -0.8392404526523818f, - -0.8393116235428495f, - -0.8393827800519394f, - -0.8394539221784326f, - -0.8395250499211092f, - -0.8395961632787509f, - -0.8396672622501391f, - -0.8397383468340561f, - -0.8398094170292829f, - -0.8398804728346022f, - -0.8399515142487965f, - -0.8400225412706491f, - -0.8400935538989414f, - -0.8401645521324586f, - -0.8402355359699826f, - -0.8403065054102983f, - -0.8403774604521884f, - -0.8404484010944379f, - -0.840519327335831f, - -0.8405902391751531f, - -0.8406611366111879f, - -0.8407320196427214f, - -0.8408028882685388f, - -0.8408737424874263f, - -0.840944582298169f, - -0.8410154076995534f, - -0.8410862186903661f, - -0.8411570152693941f, - -0.8412277974354234f, - -0.8412985651872421f, - -0.8413693185236363f, - -0.8414400574433955f, - -0.841510781945306f, - -0.8415814920281572f, - -0.8416521876907359f, - -0.8417228689318328f, - -0.8417935357502352f, - -0.8418641881447332f, - -0.8419348261141154f, - -0.8420054496571717f, - -0.8420760587726922f, - -0.8421466534594669f, - -0.8422172337162867f, - -0.8422877995419412f, - -0.8423583509352218f, - -0.8424288878949197f, - -0.8424994104198267f, - -0.8425699185087333f, - -0.8426404121604321f, - -0.842710891373715f, - -0.8427813561473749f, - -0.8428518064802036f, - -0.8429222423709942f, - -0.84299266381854f, - -0.8430630708216347f, - -0.8431334633790709f, - -0.843203841489643f, - -0.8432742051521451f, - -0.843344554365372f, - -0.8434148891281174f, - -0.8434852094391764f, - -0.8435555152973443f, - -0.8436258067014167f, - -0.8436960836501884f, - -0.8437663461424562f, - -0.8438365941770146f, - -0.8439068277526619f, - -0.8439770468681932f, - -0.8440472515224062f, - -0.8441174417140968f, - -0.8441876174420639f, - -0.8442577787051039f, - -0.8443279255020153f, - -0.8443980578315948f, - -0.8444681756926428f, - -0.8445382790839563f, - -0.8446083680043349f, - -0.8446784424525768f, - -0.8447485024274819f, - -0.8448185479278496f, - -0.8448885789524802f, - -0.8449585955001727f, - -0.845028597569728f, - -0.8450985851599466f, - -0.8451685582696297f, - -0.8452385168975773f, - -0.8453084610425915f, - -0.8453783907034734f, - -0.8454483058790255f, - -0.8455182065680489f, - -0.8455880927693461f, - -0.8456579644817199f, - -0.8457278217039729f, - -0.8457976644349087f, - -0.8458674926733294f, - -0.8459373064180392f, - -0.8460071056678418f, - -0.8460768904215417f, - -0.8461466606779422f, - -0.8462164164358487f, - -0.8462861576940646f, - -0.8463558844513966f, - -0.846425596706649f, - -0.8464952944586277f, - -0.8465649777061374f, - -0.8466346464479858f, - -0.8467043006829779f, - -0.8467739404099208f, - -0.8468435656276203f, - -0.8469131763348848f, - -0.8469827725305206f, - -0.8470523542133357f, - -0.8471219213821372f, - -0.8471914740357334f, - -0.8472610121729325f, - -0.8473305357925436f, - -0.8474000448933744f, - -0.8474695394742343f, - -0.8475390195339327f, - -0.8476084850712794f, - -0.8476779360850832f, - -0.8477473725741547f, - -0.8478167945373039f, - -0.8478862019733417f, - -0.8479555948810782f, - -0.8480249732593247f, - -0.8480943371068923f, - -0.8481636864225931f, - -0.8482330212052377f, - -0.8483023414536387f, - -0.8483716471666083f, - -0.8484409383429593f, - -0.8485102149815036f, - -0.8485794770810546f, - -0.8486487246404261f, - -0.8487179576584303f, - -0.8487871761338817f, - -0.8488563800655942f, - -0.8489255694523823f, - -0.8489947442930592f, - -0.8490639045864415f, - -0.8491330503313428f, - -0.849202181526579f, - -0.8492712981709644f, - -0.8493404002633165f, - -0.8494094878024497f, - -0.8494785607871814f, - -0.8495476192163269f, - -0.8496166630887035f, - -0.8496856924031282f, - -0.8497547071584184f, - -0.849823707353391f, - -0.8498926929868638f, - -0.8499616640576549f, - -0.8500306205645831f, - -0.8500995625064658f, - -0.850168489882122f, - -0.850237402690371f, - -0.8503063009300321f, - -0.8503751845999241f, - -0.8504440536988676f, - -0.8505129082256809f, - -0.8505817481791863f, - -0.8506505735582027f, - -0.8507193843615519f, - -0.8507881805880533f, - -0.85085696223653f, - -0.850925729305802f, - -0.8509944817946921f, - -0.8510632197020207f, - -0.8511319430266119f, - -0.8512006517672867f, - -0.8512693459228683f, - -0.8513380254921801f, - -0.8514066904740443f, - -0.8514753408672849f, - -0.8515439766707257f, - -0.8516125978831908f, - -0.8516812045035037f, - -0.8517497965304893f, - -0.8518183739629722f, - -0.851886936799778f, - -0.8519554850397306f, - -0.8520240186816563f, - -0.8520925377243805f, - -0.8521610421667298f, - -0.8522295320075294f, - -0.8522980072456062f, - -0.8523664678797869f, - -0.8524349139088989f, - -0.8525033453317685f, - -0.8525717621472236f, - -0.8526401643540918f, - -0.8527085519512018f, - -0.8527769249373806f, - -0.8528452833114575f, - -0.85291362707226f, - -0.8529819562186189f, - -0.853050270749362f, - -0.8531185706633195f, - -0.85318685595932f, - -0.8532551266361951f, - -0.8533233826927736f, - -0.8533916241278869f, - -0.8534598509403645f, - -0.853528063129039f, - -0.8535962606927402f, - -0.8536644436303006f, - -0.8537326119405508f, - -0.8538007656223234f, - -0.8538689046744506f, - -0.8539370290957653f, - -0.8540051388850992f, - -0.8540732340412858f, - -0.8541413145631582f, - -0.8542093804495504f, - -0.8542774316992952f, - -0.854345468311227f, - -0.85441349028418f, - -0.8544814976169888f, - -0.8545494903084883f, - -0.8546174683575127f, - -0.8546854317628977f, - -0.8547533805234787f, - -0.854821314638092f, - -0.8548892341055724f, - -0.8549571389247568f, - -0.8550250290944816f, - -0.855092904613584f, - -0.8551607654809f, - -0.8552286116952674f, - -0.8552964432555235f, - -0.8553642601605066f, - -0.8554320624090538f, - -0.8554998500000041f, - -0.8555676229321946f, - -0.855635381204466f, - -0.8557031248156559f, - -0.8557708537646044f, - -0.8558385680501496f, - -0.855906267671133f, - -0.8559739526263932f, - -0.8560416229147716f, - -0.8561092785351075f, - -0.8561769194862422f, - -0.8562445457670168f, - -0.8563121573762728f, - -0.8563797543128508f, - -0.8564473365755932f, - -0.8565149041633419f, - -0.8565824570749394f, - -0.8566499953092276f, - -0.8567175188650495f, - -0.8567850277412482f, - -0.8568525219366674f, - -0.8569200014501496f, - -0.8569874662805391f, - -0.85705491642668f, - -0.8571223518874167f, - -0.8571897726615931f, - -0.8572571787480544f, - -0.8573245701456454f, - -0.8573919468532121f, - -0.8574593088695989f, - -0.8575266561936521f, - -0.8575939888242178f, - -0.8576613067601421f, - -0.857728610000272f, - -0.8577958985434535f, - -0.8578631723885345f, - -0.8579304315343609f, - -0.857997675979782f, - -0.8580649057236444f, - -0.8581321207647967f, - -0.8581993211020862f, - -0.858266506734363f, - -0.8583336776604747f, - -0.8584008338792711f, - -0.8584679753896003f, - -0.8585351021903135f, - -0.8586022142802593f, - -0.8586693116582885f, - -0.8587363943232506f, - -0.8588034622739965f, - -0.8588705155093772f, - -0.858937554028244f, - -0.8590045778294475f, - -0.8590715869118396f, - -0.8591385812742721f, - -0.8592055609155976f, - -0.8592725258346675f, - -0.8593394760303349f, - -0.8594064115014524f, - -0.8594733322468737f, - -0.8595402382654512f, - -0.8596071295560395f, - -0.8596740061174908f, - -0.8597408679486612f, - -0.8598077150484037f, - -0.8598745474155732f, - -0.8599413650490247f, - -0.8600081679476137f, - -0.8600749561101946f, - -0.8601417295356235f, - -0.8602084882227566f, - -0.8602752321704493f, - -0.8603419613775584f, - -0.8604086758429402f, - -0.8604753755654524f, - -0.860542060543951f, - -0.8606087307772939f, - -0.8606753862643387f, - -0.8607420270039438f, - -0.8608086529949662f, - -0.8608752642362649f, - -0.8609418607266986f, - -0.8610084424651266f, - -0.861075009450407f, - -0.8611415616813999f, - -0.8612080991569646f, - -0.8612746218759617f, - -0.8613411298372504f, - -0.8614076230396915f, - -0.8614741014821459f, - -0.8615405651634745f, - -0.8616070140825379f, - -0.8616734482381979f, - -0.8617398676293162f, - -0.861806272254755f, - -0.8618726621133759f, - -0.8619390372040419f, - -0.8620053975256144f, - -0.8620717430769583f, - -0.8621380738569353f, - -0.8622043898644098f, - -0.8622706910982442f, - -0.862336977557304f, - -0.8624032492404522f, - -0.8624695061465543f, - -0.8625357482744733f, - -0.8626019756230764f, - -0.8626681881912271f, - -0.8627343859777921f, - -0.8628005689816358f, - -0.862866737201625f, - -0.8629328906366256f, - -0.8629990292855049f, - -0.8630651531471284f, - -0.8631312622203636f, - -0.863197356504078f, - -0.8632634359971388f, - -0.8633295006984143f, - -0.8633955506067716f, - -0.8634615857210793f, - -0.8635276060402062f, - -0.8635936115630212f, - -0.8636596022883926f, - -0.8637255782151899f, - -0.8637915393422828f, - -0.8638574856685416f, - -0.8639234171928352f, - -0.8639893339140345f, - -0.86405523583101f, - -0.8641211229426329f, - -0.8641869952477733f, - -0.8642528527453035f, - -0.8643186954340937f, - -0.8643845233130174f, - -0.8644503363809454f, - -0.8645161346367508f, - -0.864581918079305f, - -0.8646476867074825f, - -0.8647134405201549f, - -0.8647791795161966f, - -0.86484490369448f, - -0.8649106130538803f, - -0.8649763075932705f, - -0.8650419873115258f, - -0.86510765220752f, - -0.8651733022801282f, - -0.8652389375282257f, - -0.8653045579506881f, - -0.8653701635463902f, - -0.8654357543142084f, - -0.8655013302530188f, - -0.8655668913616981f, - -0.8656324376391221f, - -0.8656979690841683f, - -0.8657634856957135f, - -0.8658289874726358f, - -0.8658944744138118f, - -0.86595994651812f, - -0.8660254037844385f, - -0.866090846211646f, - -0.8661562737986204f, - -0.866221686544241f, - -0.8662870844473872f, - -0.8663524675069382f, - -0.8664178357217741f, - -0.866483189090774f, - -0.8665485276128185f, - -0.8666138512867883f, - -0.8666791601115641f, - -0.8667444540860263f, - -0.8668097332090569f, - -0.8668749974795359f, - -0.866940246896347f, - -0.8670054814583708f, - -0.8670707011644903f, - -0.8671359060135866f, - -0.8672010960045443f, - -0.8672662711362452f, - -0.8673314314075732f, - -0.867396576817411f, - -0.8674617073646429f, - -0.8675268230481527f, - -0.8675919238668252f, - -0.867657009819544f, - -0.8677220809051944f, - -0.8677871371226614f, - -0.8678521784708306f, - -0.8679172049485868f, - -0.8679822165548161f, - -0.8680472132884047f, - -0.8681121951482393f, - -0.8681771621332054f, - -0.8682421142421909f, - -0.8683070514740814f, - -0.8683719738277661f, - -0.8684368813021311f, - -0.8685017738960649f, - -0.8685666516084554f, - -0.8686315144381913f, - -0.8686963623841605f, - -0.8687611954452522f, - -0.8688260136203556f, - -0.8688908169083603f, - -0.8689556053081552f, - -0.8690203788186306f, - -0.869085137438677f, - -0.869149881167184f, - -0.8692146100030425f, - -0.8692793239451435f, - -0.8693440229923786f, - -0.8694087071436378f, - -0.8694733763978145f, - -0.8695380307537995f, - -0.8696026702104857f, - -0.8696672947667641f, - -0.8697319044215293f, - -0.8697964991736727f, - -0.8698610790220888f, - -0.8699256439656696f, - -0.8699901940033097f, - -0.8700547291339027f, - -0.8701192493563435f, - -0.8701837546695256f, - -0.8702482450723442f, - -0.8703127205636941f, - -0.8703771811424712f, - -0.87044162680757f, - -0.8705060575578871f, - -0.8705704733923172f, - -0.8706348743097583f, - -0.8706992603091056f, - -0.8707636313892567f, - -0.8708279875491075f, - -0.8708923287875567f, - -0.8709566551035008f, - -0.8710209664958383f, - -0.871085262963466f, - -0.8711495445052839f, - -0.8712138111201894f, - -0.8712780628070819f, - -0.8713422995648598f, - -0.8714065213924227f, - -0.8714707282886704f, - -0.8715349202525026f, - -0.8715990972828198f, - -0.8716632593785215f, - -0.8717274065385088f, - -0.8717915387616824f, - -0.8718556560469439f, - -0.871919758393194f, - -0.8719838457993345f, - -0.8720479182642674f, - -0.8721119757868953f, - -0.8721760183661196f, - -0.8722400460008435f, - -0.8723040586899699f, - -0.8723680564324022f, - -0.8724320392270433f, - -0.872496007072797f, - -0.8725599599685673f, - -0.8726238979132588f, - -0.8726878209057752f, - -0.8727517289450216f, - -0.8728156220299029f, - -0.8728795001593247f, - -0.8729433633321917f, - -0.8730072115474103f, - -0.8730710448038855f, - -0.873134863100525f, - -0.8731986664362341f, - -0.8732624548099204f, - -0.8733262282204896f, - -0.8733899866668506f, - -0.8734537301479097f, - -0.8735174586625756f, - -0.8735811722097554f, - -0.8736448707883578f, - -0.8737085543972914f, - -0.8737722230354654f, - -0.873835876701788f, - -0.8738995153951689f, - -0.8739631391145176f, - -0.8740267478587446f, - -0.8740903416267589f, - -0.8741539204174713f, - -0.8742174842297925f, - -0.8742810330626337f, - -0.8743445669149053f, - -0.8744080857855188f, - -0.874471589673386f, - -0.8745350785774187f, - -0.8745985524965297f, - -0.8746620114296302f, - -0.8747254553756335f, - -0.8747888843334525f, - -0.8748522983020006f, - -0.8749156972801906f, - -0.8749790812669365f, - -0.8750424502611521f, - -0.8751058042617522f, - -0.8751691432676504f, - -0.8752324672777622f, - -0.8752957762910012f, - -0.8753590703062843f, - -0.8754223493225259f, - -0.8754856133386426f, - -0.8755488623535489f, - -0.8756120963661628f, - -0.8756753153753996f, - -0.8757385193801768f, - -0.8758017083794103f, - -0.8758648823720189f, - -0.8759280413569189f, - -0.8759911853330291f, - -0.8760543142992666f, - -0.87611742825455f, - -0.8761805271977979f, - -0.8762436111279298f, - -0.8763066800438636f, - -0.8763697339445192f, - -0.8764327728288162f, - -0.8764957966956748f, - -0.8765588055440143f, - -0.8766217993727554f, - -0.8766847781808189f, - -0.876747741967126f, - -0.876810690730597f, - -0.8768736244701536f, - -0.8769365431847176f, - -0.8769994468732113f, - -0.8770623355345559f, - -0.8771252091676744f, - -0.8771880677714894f, - -0.8772509113449243f, - -0.8773137398869013f, - -0.8773765533963445f, - -0.8774393518721778f, - -0.8775021353133245f, - -0.8775649037187092f, - -0.8776276570872563f, - -0.8776903954178911f, - -0.8777531187095372f, - -0.8778158269611216f, - -0.8778785201715685f, - -0.8779411983398046f, - -0.8780038614647546f, - -0.8780665095453465f, - -0.8781291425805055f, - -0.8781917605691593f, - -0.8782543635102341f, - -0.8783169514026576f, - -0.8783795242453576f, - -0.878442082037262f, - -0.8785046247772984f, - -0.8785671524643953f, - -0.8786296650974814f, - -0.878692162675486f, - -0.8787546451973374f, - -0.8788171126619653f, - -0.8788795650682993f, - -0.87894200241527f, - -0.8790044247018064f, - -0.8790668319268399f, - -0.8791292240892998f, - -0.879191601188119f, - -0.879253963222227f, - -0.8793163101905564f, - -0.8793786420920376f, - -0.8794409589256041f, - -0.879503260690187f, - -0.8795655473847196f, - -0.8796278190081332f, - -0.8796900755593627f, - -0.8797523170373399f, - -0.879814543440999f, - -0.8798767547692738f, - -0.8799389510210978f, - -0.8800011321954055f, - -0.8800632982911317f, - -0.8801254493072114f, - -0.8801875852425789f, - -0.8802497060961698f, - -0.88031181186692f, - -0.8803739025537654f, - -0.8804359781556415f, - -0.8804980386714848f, - -0.8805600841002322f, - -0.880622114440821f, - -0.8806841296921871f, - -0.8807461298532687f, - -0.8808081149230034f, - -0.8808700849003293f, - -0.8809320397841839f, - -0.8809939795735059f, - -0.8810559042672341f, - -0.881117813864308f, - -0.8811797083636657f, - -0.8812415877642474f, - -0.8813034520649919f, - -0.8813653012648407f, - -0.8814271353627326f, - -0.8814889543576092f, - -0.8815507582484099f, - -0.8816125470340773f, - -0.8816743207135516f, - -0.8817360792857748f, - -0.8817978227496878f, - -0.8818595511042342f, - -0.8819212643483549f, - -0.8819829624809935f, - -0.8820446455010919f, - -0.8821063134075935f, - -0.8821679661994418f, - -0.8822296038755807f, - -0.8822912264349534f, - -0.8823528338765041f, - -0.8824144261991775f, - -0.8824760034019185f, - -0.8825375654836711f, - -0.8825991124433811f, - -0.8826606442799936f, - -0.8827221609924545f, - -0.8827836625797101f, - -0.8828451490407055f, - -0.882906620374388f, - -0.8829680765797041f, - -0.8830295176556011f, - -0.8830909436010255f, - -0.883152354414925f, - -0.8832137500962477f, - -0.8832751306439417f, - -0.8833364960569546f, - -0.8833978463342352f, - -0.8834591814747325f, - -0.8835205014773958f, - -0.8835818063411734f, - -0.8836430960650161f, - -0.8837043706478721f, - -0.8837656300886934f, - -0.8838268743864289f, - -0.8838881035400301f, - -0.8839493175484466f, - -0.8840105164106312f, - -0.884071700125534f, - -0.8841328686921075f, - -0.8841940221093028f, - -0.8842551603760722f, - -0.8843162834913685f, - -0.8843773914541446f, - -0.8844384842633525f, - -0.884499561917946f, - -0.8845606244168784f, - -0.884621671759104f, - -0.8846827039435757f, - -0.8847437209692484f, - -0.8848047228350764f, - -0.8848657095400149f, - -0.8849266810830181f, - -0.8849876374630418f, - -0.8850485786790413f, - -0.885109504729973f, - -0.885170415614792f, - -0.8852313113324551f, - -0.8852921918819188f, - -0.8853530572621404f, - -0.8854139074720762f, - -0.8854747425106838f, - -0.8855355623769209f, - -0.8855963670697454f, - -0.885657156588116f, - -0.8857179309309898f, - -0.8857786900973267f, - -0.8858394340860842f, - -0.8859001628962231f, - -0.8859608765267017f, - -0.8860215749764804f, - -0.886082258244518f, - -0.8861429263297763f, - -0.8862035792312145f, - -0.8862642169477942f, - -0.8863248394784753f, - -0.8863854468222204f, - -0.8864460389779899f, - -0.8865066159447466f, - -0.8865671777214513f, - -0.886627724307067f, - -0.8866882557005563f, - -0.8867487719008822f, - -0.8868092729070071f, - -0.8868697587178945f, - -0.8869302293325084f, - -0.8869906847498128f, - -0.887051124968771f, - -0.8871115499883482f, - -0.8871719598075078f, - -0.8872323544252165f, - -0.887292733840438f, - -0.8873530980521387f, - -0.8874134470592829f, - -0.8874737808608384f, - -0.8875340994557699f, - -0.8875944028430444f, - -0.8876546910216285f, - -0.8877149639904898f, - -0.8877752217485946f, - -0.8878354642949108f, - -0.8878956916284065f, - -0.8879559037480491f, - -0.8880161006528072f, - -0.8880762823416493f, - -0.8881364488135446f, - -0.8881966000674614f, - -0.8882567361023694f, - -0.8883168569172383f, - -0.8883769625110381f, - -0.8884370528827379f, - -0.8884971280313096f, - -0.8885571879557228f, - -0.8886172326549489f, - -0.8886772621279584f, - -0.8887372763737231f, - -0.8887972753912147f, - -0.8888572591794055f, - -0.8889172277372669f, - -0.8889771810637717f, - -0.8890371191578927f, - -0.8890970420186033f, - -0.8891569496448758f, - -0.8892168420356842f, - -0.8892767191900023f, - -0.8893365811068045f, - -0.8893964277850641f, - -0.8894562592237567f, - -0.8895160754218557f, - -0.889575876378338f, - -0.8896356620921775f, - -0.8896954325623507f, - -0.8897551877878322f, - -0.8898149277675997f, - -0.8898746525006285f, - -0.8899343619858959f, - -0.8899940562223776f, - -0.8900537352090524f, - -0.8901133989448966f, - -0.8901730474288885f, - -0.8902326806600053f, - -0.8902922986372257f, - -0.890351901359528f, - -0.890411488825891f, - -0.8904710610352942f, - -0.8905306179867158f, - -0.890590159679136f, - -0.8906496861115343f, - -0.8907091972828913f, - -0.8907686931921864f, - -0.8908281738384007f, - -0.8908876392205148f, - -0.8909470893375103f, - -0.8910065241883678f, - -0.8910659437720692f, - -0.8911253480875964f, - -0.8911847371339318f, - -0.8912441109100572f, - -0.8913034694149554f, - -0.8913628126476095f, - -0.8914221406070031f, - -0.8914814532921187f, - -0.8915407507019408f, - -0.8916000328354523f, - -0.8916592996916389f, - -0.8917185512694839f, - -0.8917777875679727f, - -0.8918370085860894f, - -0.8918962143228205f, - -0.8919554047771507f, - -0.8920145799480663f, - -0.8920737398345523f, - -0.8921328844355967f, - -0.8921920137501845f, - -0.8922511277773038f, - -0.8923102265159405f, - -0.8923693099650827f, - -0.8924283781237178f, - -0.892487430990834f, - -0.892546468565419f, - -0.8926054908464612f, - -0.8926644978329497f, - -0.8927234895238734f, - -0.892782465918221f, - -0.8928414270149821f, - -0.8929003728131466f, - -0.8929593033117049f, - -0.8930182185096464f, - -0.8930771184059619f, - -0.8931360029996424f, - -0.8931948722896786f, - -0.8932537262750624f, - -0.8933125649547846f, - -0.8933713883278374f, - -0.8934301963932126f, - -0.8934889891499033f, - -0.8935477665969012f, - -0.8936065287331998f, - -0.8936652755577912f, - -0.8937240070696704f, - -0.8937827232678297f, - -0.8938414241512639f, - -0.893900109718966f, - -0.8939587799699321f, - -0.8940174349031556f, - -0.8940760745176322f, - -0.894134698812356f, - -0.8941933077863241f, - -0.8942519014385311f, - -0.8943104797679737f, - -0.8943690427736475f, - -0.8944275904545493f, - -0.8944861228096761f, - -0.8945446398380252f, - -0.8946031415385931f, - -0.894661627910378f, - -0.8947200989523775f, - -0.8947785546635902f, - -0.8948369950430137f, - -0.8948954200896471f, - -0.8949538298024892f, - -0.8950122241805396f, - -0.895070603222797f, - -0.8951289669282614f, - -0.8951873152959328f, - -0.8952456483248117f, - -0.895303966013898f, - -0.8953622683621927f, - -0.8954205553686967f, - -0.8954788270324119f, - -0.895537083352339f, - -0.8955953243274799f, - -0.895653549956837f, - -0.8957117602394129f, - -0.8957699551742093f, - -0.8958281347602296f, - -0.8958862989964772f, - -0.8959444478819547f, - -0.8960025814156662f, - -0.8960606995966155f, - -0.8961188024238071f, - -0.8961768898962444f, - -0.8962349620129336f, - -0.8962930187728785f, - -0.896351060175085f, - -0.8964090862185579f, - -0.8964670969023032f, - -0.8965250922253271f, - -0.896583072186636f, - -0.8966410367852359f, - -0.8966989860201338f, - -0.8967569198903368f, - -0.8968148383948528f, - -0.8968727415326883f, - -0.8969306293028517f, - -0.8969885017043511f, - -0.8970463587361952f, - -0.8971042003973919f, - -0.897162026686951f, - -0.8972198376038802f, - -0.8972776331471908f, - -0.8973354133158912f, - -0.897393178108992f, - -0.8974509275255024f, - -0.8975086615644343f, - -0.8975663802247974f, - -0.8976240835056035f, - -0.8976817714058627f, - -0.897739443924588f, - -0.89779710106079f, - -0.8978547428134818f, - -0.8979123691816746f, - -0.8979699801643816f, - -0.8980275757606155f, - -0.8980851559693895f, - -0.8981427207897175f, - -0.8982002702206122f, - -0.8982578042610879f, - -0.8983153229101588f, - -0.8983728261668397f, - -0.8984303140301445f, - -0.8984877864990887f, - -0.8985452435726874f, - -0.8986026852499565f, - -0.8986601115299109f, - -0.898717522411567f, - -0.8987749178939413f, - -0.8988322979760505f, - -0.8988896626569107f, - -0.8989470119355395f, - -0.899004345810954f, - -0.8990616642821723f, - -0.8991189673482115f, - -0.8991762550080902f, - -0.8992335272608266f, - -0.8992907841054398f, - -0.8993480255409481f, - -0.8994052515663712f, - -0.8994624621807277f, - -0.8995196573830385f, - -0.8995768371723227f, - -0.8996340015476012f, - -0.8996911505078933f, - -0.8997482840522214f, - -0.8998054021796054f, - -0.8998625048890673f, - -0.8999195921796278f, - -0.8999766640503093f, - -0.9000337205001339f, - -0.9000907615281241f, - -0.9001477871333019f, - -0.9002047973146905f, - -0.9002617920713132f, - -0.9003187714021936f, - -0.9003757353063548f, - -0.9004326837828209f, - -0.9004896168306163f, - -0.9005465344487659f, - -0.9006034366362934f, - -0.9006603233922243f, - -0.900717194715584f, - -0.9007740506053978f, - -0.900830891060692f, - -0.9008877160804919f, - -0.9009445256638241f, - -0.9010013198097153f, - -0.9010580985171928f, - -0.9011148617852827f, - -0.9011716096130129f, - -0.901228341999411f, - -0.9012850589435054f, - -0.9013417604443233f, - -0.9013984465008942f, - -0.9014551171122454f, - -0.9015117722774074f, - -0.9015684119954085f, - -0.9016250362652787f, - -0.9016816450860468f, - -0.9017382384567442f, - -0.9017948163764f, - -0.9018513788440459f, - -0.9019079258587112f, - -0.9019644574194285f, - -0.9020209735252283f, - -0.9020774741751426f, - -0.9021339593682028f, - -0.9021904291034414f, - -0.9022468833798907f, - -0.9023033221965837f, - -0.9023597455525527f, - -0.9024161534468313f, - -0.9024725458784528f, - -0.9025289228464516f, - -0.9025852843498606f, - -0.9026416303877146f, - -0.9026979609590482f, - -0.9027542760628965f, - -0.9028105756982937f, - -0.9028668598642756f, - -0.9029231285598779f, - -0.9029793817841366f, - -0.9030356195360871f, - -0.9030918418147663f, - -0.9031480486192108f, - -0.9032042399484579f, - -0.9032604158015439f, - -0.9033165761775067f, - -0.9033727210753845f, - -0.9034288504942138f, - -0.9034849644330347f, - -0.9035410628908845f, - -0.9035971458668026f, - -0.9036532133598271f, - -0.9037092653689985f, - -0.9037653018933555f, - -0.9038213229319385f, - -0.9038773284837867f, - -0.9039333185479417f, - -0.9039892931234431f, - -0.9040452522093326f, - -0.9041011958046506f, - -0.9041571239084389f, - -0.904213036519739f, - -0.9042689336375935f, - -0.9043248152610438f, - -0.9043806813891326f, - -0.9044365320209028f, - -0.9044923671553977f, - -0.9045481867916599f, - -0.9046039909287333f, - -0.9046597795656617f, - -0.9047155527014895f, - -0.9047713103352605f, - -0.9048270524660198f, - -0.9048827790928112f, - -0.9049384902146814f, - -0.9049941858306748f, - -0.9050498659398376f, - -0.9051055305412148f, - -0.9051611796338539f, - -0.9052168132168004f, - -0.9052724312891014f, - -0.9053280338498038f, - -0.9053836208979553f, - -0.9054391924326026f, - -0.9054947484527941f, - -0.905550288957578f, - -0.905605813946002f, - -0.9056613234171151f, - -0.905716817369966f, - -0.9057722958036044f, - -0.9058277587170788f, - -0.9058832061094392f, - -0.9059386379797356f, - -0.9059940543270186f, - -0.906049455150338f, - -0.9061048404487446f, - -0.9061602102212896f, - -0.9062155644670246f, - -0.9062709031850004f, - -0.906326226374269f, - -0.9063815340338826f, - -0.9064368261628939f, - -0.9064921027603546f, - -0.9065473638253181f, - -0.9066026093568375f, - -0.9066578393539664f, - -0.9067130538157577f, - -0.9067682527412664f, - -0.9068234361295451f, - -0.90687860397965f, - -0.9069337562906348f, - -0.906988893061555f, - -0.9070440142914646f, - -0.907099119979421f, - -0.9071542101244787f, - -0.9072092847256944f, - -0.9072643437821234f, - -0.9073193872928237f, - -0.907374415256851f, - -0.9074294276732632f, - -0.907484424541117f, - -0.9075394058594703f, - -0.9075943716273811f, - -0.9076493218439079f, - -0.9077042565081085f, - -0.9077591756190417f, - -0.9078140791757668f, - -0.9078689671773429f, - -0.9079238396228299f, - -0.9079786965112867f, - -0.908033537841774f, - -0.9080883636133519f, - -0.9081431738250814f, - -0.9081979684760225f, - -0.9082527475652368f, - -0.9083075110917856f, - -0.9083622590547311f, - -0.9084169914531343f, - -0.9084717082860577f, - -0.9085264095525638f, - -0.9085810952517157f, - -0.9086357653825757f, - -0.9086904199442076f, - -0.908745058935674f, - -0.9087996823560401f, - -0.9088542902043687f, - -0.908908882479725f, - -0.9089634591811724f, - -0.9090180203077772f, - -0.9090725658586034f, - -0.9091270958327172f, - -0.9091816102291831f, - -0.9092361090470685f, - -0.9092905922854384f, - -0.90934505994336f, - -0.9093995120198993f, - -0.9094539485141238f, - -0.9095083694251004f, - -0.9095627747518973f, - -0.9096171644935813f, - -0.909671538649221f, - -0.9097258972178847f, - -0.9097802401986411f, - -0.9098345675905587f, - -0.9098888793927067f, - -0.9099431756041545f, - -0.9099974562239723f, - -0.9100517212512291f, - -0.9101059706849955f, - -0.9101602045243421f, - -0.9102144227683397f, - -0.9102686254160588f, - -0.910322812466571f, - -0.9103769839189476f, - -0.9104311397722609f, - -0.9104852800255823f, - -0.9105394046779843f, - -0.9105935137285397f, - -0.9106476071763212f, - -0.9107016850204023f, - -0.9107557472598558f, - -0.9108097938937558f, - -0.9108638249211755f, - -0.9109178403411903f, - -0.9109718401528737f, - -0.911025824355301f, - -0.9110797929475463f, - -0.9111337459286861f, - -0.911187683297795f, - -0.9112416050539495f, - -0.9112955111962244f, - -0.9113494017236978f, - -0.9114032766354451f, - -0.9114571359305438f, - -0.9115109796080703f, - -0.9115648076671024f, - -0.9116186201067178f, - -0.9116724169259949f, - -0.9117261981240109f, - -0.9117799636998449f, - -0.9118337136525756f, - -0.9118874479812823f, - -0.9119411666850435f, - -0.9119948697629396f, - -0.9120485572140492f, - -0.912102229037454f, - -0.9121558852322331f, - -0.912209525797468f, - -0.9122631507322382f, - -0.9123167600356266f, - -0.9123703537067134f, - -0.9124239317445807f, - -0.9124774941483105f, - -0.9125310409169852f, - -0.9125845720496868f, - -0.9126380875454982f, - -0.9126915874035029f, - -0.9127450716227835f, - -0.9127985402024239f, - -0.9128519931415079f, - -0.91290543043912f, - -0.9129588520943437f, - -0.9130122581062642f, - -0.9130656484739663f, - -0.9131190231965356f, - -0.9131723822730564f, - -0.9132257257026158f, - -0.9132790534842988f, - -0.9133323656171923f, - -0.9133856621003821f, - -0.9134389429329554f, - -0.9134922081139991f, - -0.913545457642601f, - -0.9135986915178479f, - -0.913651909738828f, - -0.9137051123046296f, - -0.9137582992143412f, - -0.9138114704670508f, - -0.9138646260618478f, - -0.9139177659978214f, - -0.9139708902740612f, - -0.9140239988896565f, - -0.9140770918436978f, - -0.9141301691352743f, - -0.9141832307634781f, - -0.9142362767273988f, - -0.9142893070261283f, - -0.9143423216587568f, - -0.9143953206243775f, - -0.9144483039220809f, - -0.91450127155096f, - -0.9145542235101065f, - -0.9146071597986135f, - -0.914660080415574f, - -0.9147129853600814f, - -0.9147658746312286f, - -0.9148187482281096f, - -0.9148716061498186f, - -0.9149244483954497f, - -0.914977274964098f, - -0.9150300858548575f, - -0.9150828810668236f, - -0.9151356605990918f, - -0.915188424450758f, - -0.9152411726209175f, - -0.9152939051086668f, - -0.9153466219131022f, - -0.915399323033321f, - -0.9154520084684193f, - -0.9155046782174948f, - -0.9155573322796449f, - -0.9156099706539679f, - -0.915662593339561f, - -0.9157152003355229f, - -0.9157677916409523f, - -0.9158203672549483f, - -0.9158729271766095f, - -0.9159254714050358f, - -0.9159779999393258f, - -0.916030512778581f, - -0.9160830099219005f, - -0.9161354913683855f, - -0.9161879571171356f, - -0.9162404071672533f, - -0.9162928415178389f, - -0.9163452601679944f, - -0.9163976631168208f, - -0.9164500503634215f, - -0.9165024219068978f, - -0.9165547777463531f, - -0.9166071178808896f, - -0.9166594423096107f, - -0.9167117510316198f, - -0.9167640440460213f, - -0.916816321351918f, - -0.9168685829484149f, - -0.9169208288346162f, - -0.9169730590096272f, - -0.9170252734725522f, - -0.917077472222497f, - -0.9171296552585669f, - -0.9171818225798685f, - -0.9172339741855068f, - -0.9172861100745888f, - -0.9173382302462212f, - -0.9173903346995108f, - -0.9174424234335652f, - -0.9174944964474911f, - -0.9175465537403968f, - -0.9175985953113902f, - -0.9176506211595798f, - -0.9177026312840737f, - -0.9177546256839813f, - -0.9178066043584105f, - -0.9178585673064723f, - -0.9179105145272751f, - -0.9179624460199296f, - -0.9180143617835449f, - -0.9180662618172328f, - -0.918118146120103f, - -0.9181700146912671f, - -0.9182218675298354f, - -0.9182737046349208f, - -0.9183255260056339f, - -0.9183773316410877f, - -0.9184291215403936f, - -0.9184808957026646f, - -0.9185326541270136f, - -0.9185843968125541f, - -0.9186361237583988f, - -0.9186878349636617f, - -0.9187395304274567f, - -0.9187912101488984f, - -0.9188428741271005f, - -0.9188945223611784f, - -0.9189461548502468f, - -0.9189977715934214f, - -0.9190493725898172f, - -0.9191009578385503f, - -0.9191525273387366f, - -0.9192040810894933f, - -0.9192556190899358f, - -0.9193071413391818f, - -0.9193586478363482f, - -0.9194101385805529f, - -0.9194616135709129f, - -0.9195130728065466f, - -0.9195645162865722f, - -0.9196159440101086f, - -0.9196673559762739f, - -0.9197187521841875f, - -0.9197701326329691f, - -0.9198214973217373f, - -0.9198728462496133f, - -0.9199241794157162f, - -0.9199754968191673f, - -0.9200267984590861f, - -0.9200780843345948f, - -0.9201293544448138f, - -0.9201806087888653f, - -0.9202318473658704f, - -0.9202830701749513f, - -0.9203342772152303f, - -0.9203854684858306f, - -0.9204366439858742f, - -0.9204878037144846f, - -0.920538947670785f, - -0.9205900758538997f, - -0.9206411882629518f, - -0.9206922848970659f, - -0.9207433657553663f, - -0.9207944308369783f, - -0.9208454801410262f, - -0.9208965136666358f, - -0.9209475314129318f, - -0.9209985333790415f, - -0.9210495195640896f, - -0.9211004899672034f, - -0.9211514445875085f, - -0.9212023834241331f, - -0.9212533064762034f, - -0.9213042137428475f, - -0.9213551052231922f, - -0.9214059809163667f, - -0.9214568408214984f, - -0.921507684937716f, - -0.9215585132641487f, - -0.9216093257999249f, - -0.9216601225441743f, - -0.9217109034960265f, - -0.9217616686546117f, - -0.9218124180190594f, - -0.9218631515885004f, - -0.9219138693620653f, - -0.9219645713388855f, - -0.9220152575180915f, - -0.9220659278988151f, - -0.9221165824801882f, - -0.9221672212613431f, - -0.9222178442414114f, - -0.9222684514195262f, - -0.9223190427948201f, - -0.9223696183664268f, - -0.922420178133479f, - -0.9224707220951106f, - -0.9225212502504555f, - -0.9225717625986485f, - -0.9226222591388231f, - -0.922672739870115f, - -0.922723204791658f, - -0.922773653902589f, - -0.9228240872020422f, - -0.9228745046891546f, - -0.9229249063630607f, - -0.9229752922228988f, - -0.923025662267804f, - -0.9230760164969144f, - -0.9231263549093659f, - -0.9231766775042974f, - -0.9232269842808456f, - -0.9232772752381491f, - -0.9233275503753456f, - -0.9233778096915741f, - -0.9234280531859732f, - -0.9234782808576825f, - -0.9235284927058405f, - -0.9235786887295873f, - -0.9236288689280627f, - -0.9236790333004075f, - -0.9237291818457611f, - -0.9237793145632648f, - -0.9238294314520595f, - -0.9238795325112865f, - -0.9239296177400876f, - -0.923979687137604f, - -0.9240297407029782f, - -0.9240797784353523f, - -0.9241298003338694f, - -0.9241798063976716f, - -0.9242297966259027f, - -0.9242797710177058f, - -0.924329729572225f, - -0.9243796722886038f, - -0.9244295991659865f, - -0.9244795102035179f, - -0.924529405400343f, - -0.9245792847556061f, - -0.9246291482684533f, - -0.9246789959380292f, - -0.924728827763481f, - -0.9247786437439537f, - -0.9248284438785946f, - -0.9248782281665493f, - -0.9249279966069661f, - -0.9249777491989912f, - -0.9250274859417729f, - -0.9250772068344577f, - -0.9251269118761952f, - -0.9251766010661328f, - -0.9252262744034194f, - -0.9252759318872036f, - -0.9253255735166346f, - -0.9253751992908619f, - -0.9254248092090355f, - -0.9254744032703047f, - -0.92552398147382f, - -0.9255735438187319f, - -0.9256230903041915f, - -0.9256726209293492f, - -0.9257221356933566f, - -0.9257716345953654f, - -0.9258211176345276f, - -0.9258705848099947f, - -0.9259200361209196f, - -0.9259694715664547f, - -0.9260188911457534f, - -0.9260682948579683f, - -0.9261176827022531f, - -0.9261670546777617f, - -0.9262164107836482f, - -0.9262657510190666f, - -0.9263150753831715f, - -0.9263643838751182f, - -0.9264136764940607f, - -0.926462953239156f, - -0.9265122141095583f, - -0.9265614591044246f, - -0.9266106882229099f, - -0.9266599014641721f, - -0.9267090988273669f, - -0.926758280311652f, - -0.9268074459161836f, - -0.9268565956401207f, - -0.9269057294826202f, - -0.9269548474428406f, - -0.9270039495199399f, - -0.927053035713077f, - -0.9271021060214106f, - -0.9271511604441006f, - -0.9272001989803056f, - -0.9272492216291855f, - -0.9272982283899007f, - -0.9273472192616116f, - -0.927396194243478f, - -0.9274451533346612f, - -0.9274940965343222f, - -0.9275430238416229f, - -0.927591935255724f, - -0.9276408307757883f, - -0.9276897104009769f, - -0.9277385741304536f, - -0.9277874219633802f, - -0.9278362538989202f, - -0.927885069936236f, - -0.9279338700744925f, - -0.9279826543128525f, - -0.9280314226504804f, - -0.928080175086541f, - -0.9281289116201981f, - -0.9281776322506171f, - -0.9282263369769631f, - -0.9282750257984019f, - -0.9283236987140987f, - -0.9283723557232196f, - -0.9284209968249311f, - -0.9284696220183999f, - -0.9285182313027922f, - -0.9285668246772755f, - -0.9286154021410171f, - -0.928663963693185f, - -0.9287125093329465f, - -0.92876103905947f, - -0.928809552871924f, - -0.9288580507694776f, - -0.9289065327512991f, - -0.9289549988165582f, - -0.9290034489644242f, - -0.9290518831940675f, - -0.9291003015046575f, - -0.9291487038953647f, - -0.92919709036536f, - -0.9292454609138144f, - -0.9292938155398988f, - -0.9293421542427848f, - -0.9293904770216435f, - -0.929438783875648f, - -0.9294870748039699f, - -0.9295353498057821f, - -0.9295836088802566f, - -0.9296318520265677f, - -0.9296800792438878f, - -0.9297282905313914f, - -0.9297764858882511f, - -0.9298246653136427f, - -0.9298728288067394f, - -0.9299209763667168f, - -0.9299691079927491f, - -0.9300172236840121f, - -0.9300653234396812f, - -0.9301134072589324f, - -0.9301614751409415f, - -0.930209527084885f, - -0.9302575630899396f, - -0.930305583155282f, - -0.93035358728009f, - -0.9304015754635403f, - -0.930449547704811f, - -0.9304975040030801f, - -0.9305454443575261f, - -0.9305933687673269f, - -0.9306412772316619f, - -0.9306891697497099f, - -0.9307370463206509f, - -0.9307849069436636f, - -0.9308327516179284f, - -0.9308805803426256f, - -0.9309283931169358f, - -0.9309761899400391f, - -0.9310239708111172f, - -0.9310717357293505f, - -0.9311194846939218f, - -0.9311672177040119f, - -0.9312149347588037f, - -0.9312626358574785f, - -0.9313103209992203f, - -0.931357990183211f, - -0.9314056434086344f, - -0.9314532806746731f, - -0.9315009019805123f, - -0.9315485073253347f, - -0.9315960967083254f, - -0.9316436701286684f, - -0.9316912275855489f, - -0.9317387690781518f, - -0.931786294605663f, - -0.9318338041672675f, - -0.9318812977621513f, - -0.931928775389501f, - -0.9319762370485032f, - -0.932023682738344f, - -0.9320711124582108f, - -0.932118526207291f, - -0.9321659239847723f, - -0.9322133057898421f, - -0.9322606716216887f, - -0.9323080214795004f, - -0.9323553553624665f, - -0.9324026732697752f, - -0.9324499752006159f, - -0.9324972611541782f, - -0.9325445311296519f, - -0.9325917851262272f, - -0.932639023143094f, - -0.9326862451794431f, - -0.9327334512344653f, - -0.9327806413073522f, - -0.9328278153972944f, - -0.9328749735034844f, - -0.9329221156251131f, - -0.932969241761374f, - -0.9330163519114587f, - -0.9330634460745606f, - -0.9331105242498717f, - -0.9331575864365869f, - -0.9332046326338984f, - -0.9332516628410011f, - -0.9332986770570884f, - -0.9333456752813549f, - -0.9333926575129954f, - -0.9334396237512053f, - -0.9334865739951791f, - -0.9335335082441125f, - -0.9335804264972016f, - -0.9336273287536425f, - -0.9336742150126311f, - -0.9337210852733644f, - -0.933767939535039f, - -0.9338147777968525f, - -0.9338616000580019f, - -0.9339084063176852f, - -0.9339551965750998f, - -0.934001970829445f, - -0.9340487290799184f, - -0.9340954713257194f, - -0.9341421975660466f, - -0.9341889078001f, - -0.9342356020270786f, - -0.9342822802461824f, - -0.9343289424566118f, - -0.9343755886575675f, - -0.9344222188482497f, - -0.9344688330278595f, - -0.9345154311955988f, - -0.9345620133506681f, - -0.9346085794922699f, - -0.9346551296196063f, - -0.9347016637318797f, - -0.9347481818282921f, - -0.9347946839080475f, - -0.9348411699703483f, - -0.9348876400143984f, - -0.9349340940394008f, - -0.9349805320445607f, - -0.9350269540290814f, - -0.9350733599921683f, - -0.9351197499330254f, - -0.9351661238508583f, - -0.9352124817448723f, - -0.9352588236142733f, - -0.9353051494582667f, - -0.9353514592760591f, - -0.935397753066857f, - -0.9354440308298674f, - -0.9354902925642967f, - -0.9355365382693529f, - -0.9355827679442426f, - -0.935628981588175f, - -0.9356751792003573f, - -0.9357213607799983f, - -0.9357675263263062f, - -0.9358136758384908f, - -0.9358598093157607f, - -0.9359059267573259f, - -0.9359520281623952f, - -0.93599811353018f, - -0.9360441828598897f, - -0.9360902361507355f, - -0.9361362734019277f, - -0.9361822946126778f, - -0.9362282997821971f, - -0.9362742889096974f, - -0.9363202619943911f, - -0.9363662190354898f, - -0.9364121600322063f, - -0.9364580849837534f, - -0.9365039938893445f, - -0.9365498867481923f, - -0.9365957635595109f, - -0.9366416243225141f, - -0.9366874690364164f, - -0.9367332977004317f, - -0.9367791103137749f, - -0.9368249068756612f, - -0.9368706873853062f, - -0.9369164518419247f, - -0.936962200244733f, - -0.937007932592947f, - -0.9370536488857836f, - -0.9370993491224587f, - -0.9371450333021898f, - -0.9371907014241937f, - -0.9372363534876886f, - -0.9372819894918915f, - -0.9373276094360209f, - -0.9373732133192944f, - -0.9374188011409317f, - -0.9374643729001508f, - -0.9375099285961715f, - -0.9375554682282122f, - -0.9376009917954938f, - -0.9376464992972355f, - -0.9376919907326581f, - -0.9377374661009811f, - -0.9377829254014265f, - -0.9378283686332146f, - -0.9378737957955672f, - -0.9379192068877055f, - -0.9379646019088514f, - -0.9380099808582274f, - -0.9380553437350561f, - -0.9381006905385595f, - -0.9381460212679611f, - -0.938191335922484f, - -0.9382366345013522f, - -0.9382819170037888f, - -0.9383271834290182f, - -0.9383724337762649f, - -0.9384176680447537f, - -0.938462886233709f, - -0.9385080883423562f, - -0.938553274369921f, - -0.9385984443156289f, - -0.9386435981787065f, - -0.9386887359583791f, - -0.938733857653874f, - -0.9387789632644177f, - -0.9388240527892379f, - -0.9388691262275611f, - -0.938914183578616f, - -0.9389592248416293f, - -0.9390042500158307f, - -0.9390492591004475f, - -0.9390942520947092f, - -0.9391392289978441f, - -0.9391841898090826f, - -0.9392291345276534f, - -0.9392740631527872f, - -0.9393189756837129f, - -0.9393638721196624f, - -0.9394087524598654f, - -0.9394536167035535f, - -0.9394984648499575f, - -0.939543296898309f, - -0.9395881128478399f, - -0.9396329126977827f, - -0.9396776964473691f, - -0.939722464095832f, - -0.9397672156424044f, - -0.9398119510863198f, - -0.9398566704268109f, - -0.9399013736631119f, - -0.9399460607944568f, - -0.9399907318200802f, - -0.940035386739216f, - -0.9400800255510995f, - -0.9401246482549657f, - -0.9401692548500503f, - -0.9402138453355884f, - -0.9402584197108164f, - -0.9403029779749702f, - -0.940347520127287f, - -0.9403920461670027f, - -0.9404365560933547f, - -0.9404810499055808f, - -0.9405255276029177f, - -0.940569989184604f, - -0.9406144346498775f, - -0.9406588639979772f, - -0.9407032772281406f, - -0.9407476743396083f, - -0.9407920553316184f, - -0.940836420203411f, - -0.9408807689542251f, - -0.9409251015833021f, - -0.9409694180898814f, - -0.9410137184732043f, - -0.941058002732511f, - -0.9411022708670429f, - -0.9411465228760418f, - -0.9411907587587496f, - -0.9412349785144076f, - -0.9412791821422587f, - -0.9413233696415452f, - -0.9413675410115104f, - -0.9414116962513968f, - -0.9414558353604481f, - -0.941499958337908f, - -0.9415440651830208f, - -0.9415881558950301f, - -0.941632230473181f, - -0.9416762889167175f, - -0.9417203312248857f, - -0.9417643573969302f, - -0.9418083674320972f, - -0.9418523613296317f, - -0.9418963390887809f, - -0.9419403007087905f, - -0.941984246188908f, - -0.9420281755283791f, - -0.9420720887264526f, - -0.9421159857823752f, - -0.9421598666953948f, - -0.9422037314647599f, - -0.9422475800897183f, - -0.942291412569519f, - -0.9423352289034109f, - -0.9423790290906436f, - -0.9424228131304658f, - -0.9424665810221279f, - -0.9425103327648796f, - -0.9425540683579717f, - -0.9425977878006542f, - -0.9426414910921783f, - -0.9426851782317951f, - -0.9427288492187563f, - -0.942772504052313f, - -0.9428161427317177f, - -0.9428597652562224f, - -0.9429033716250801f, - -0.9429469618375429f, - -0.9429905358928643f, - -0.9430340937902977f, - -0.9430776355290968f, - -0.9431211611085153f, - -0.9431646705278076f, - -0.9432081637862276f, - -0.9432516408830312f, - -0.9432951018174723f, - -0.943338546588807f, - -0.9433819751962901f, - -0.9434253876391784f, - -0.9434687839167273f, - -0.9435121640281937f, - -0.9435555279728336f, - -0.9435988757499049f, - -0.9436422073586642f, - -0.9436855227983695f, - -0.9437288220682779f, - -0.943772105167648f, - -0.9438153720957381f, - -0.9438586228518069f, - -0.943901857435113f, - -0.9439450758449158f, - -0.9439882780804747f, - -0.9440314641410499f, - -0.9440746340259005f, - -0.9441177877342875f, - -0.9441609252654711f, - -0.9442040466187124f, - -0.9442471517932728f, - -0.944290240788413f, - -0.944333313603395f, - -0.9443763702374809f, - -0.944419410689933f, - -0.9444624349600134f, - -0.9445054430469851f, - -0.9445484349501113f, - -0.9445914106686555f, - -0.9446343702018807f, - -0.9446773135490513f, - -0.9447202407094313f, - -0.9447631516822854f, - -0.9448060464668779f, - -0.9448489250624744f, - -0.9448917874683391f, - -0.9449346336837391f, - -0.944977463707939f, - -0.9450202775402057f, - -0.9450630751798046f, - -0.9451058566260037f, - -0.9451486218780689f, - -0.9451913709352681f, - -0.9452341037968682f, - -0.9452768204621375f, - -0.9453195209303437f, - -0.9453622052007555f, - -0.9454048732726411f, - -0.9454475251452696f, - -0.9454901608179103f, - -0.9455327802898327f, - -0.9455753835603061f, - -0.9456179706286008f, - -0.9456605414939869f, - -0.9457030961557356f, - -0.9457456346131168f, - -0.9457881568654021f, - -0.9458306629118629f, - -0.945873152751771f, - -0.945915626384398f, - -0.9459580838090161f, - -0.9460005250248982f, - -0.9460429500313171f, - -0.9460853588275453f, - -0.9461277514128565f, - -0.9461701277865243f, - -0.9462124879478225f, - -0.9462548318960258f, - -0.9462971596304077f, - -0.9463394711502439f, - -0.9463817664548083f, - -0.9464240455433773f, - -0.9464663084152257f, - -0.94650855506963f, - -0.9465507855058652f, - -0.9465929997232091f, - -0.9466351977209374f, - -0.9466773794983275f, - -0.946719545054656f, - -0.9467616943892014f, - -0.9468038275012407f, - -0.9468459443900524f, - -0.9468880450549144f, - -0.9469301294951056f, - -0.9469721977099048f, - -0.9470142496985915f, - -0.9470562854604446f, - -0.9470983049947442f, - -0.9471403083007701f, - -0.9471822953778031f, - -0.947224266225123f, - -0.947266220842011f, - -0.9473081592277482f, - -0.9473500813816164f, - -0.9473919873028964f, - -0.9474338769908711f, - -0.9474757504448217f, - -0.9475176076640318f, - -0.9475594486477835f, - -0.9476012733953599f, - -0.9476430819060446f, - -0.9476848741791213f, - -0.9477266502138735f, - -0.9477684100095856f, - -0.9478101535655422f, - -0.9478518808810278f, - -0.9478935919553273f, - -0.9479352867877263f, - -0.9479769653775105f, - -0.9480186277239652f, - -0.9480602738263768f, - -0.9481019036840319f, - -0.9481435172962172f, - -0.9481851146622191f, - -0.9482266957813253f, - -0.9482682606528233f, - -0.9483098092760012f, - -0.9483513416501462f, - -0.9483928577745473f, - -0.948434357648493f, - -0.9484758412712725f, - -0.9485173086421744f, - -0.9485587597604884f, - -0.9486001946255045f, - -0.9486416132365126f, - -0.9486830155928029f, - -0.9487244016936658f, - -0.9487657715383925f, - -0.9488071251262743f, - -0.948848462456602f, - -0.948889783528668f, - -0.9489310883417633f, - -0.9489723768951813f, - -0.9490136491882138f, - -0.9490549052201541f, - -0.9490961449902944f, - -0.9491373684979292f, - -0.9491785757423513f, - -0.9492197667228552f, - -0.9492609414387344f, - -0.9493020998892844f, - -0.9493432420737989f, - -0.9493843679915739f, - -0.9494254776419039f, - -0.9494665710240848f, - -0.9495076481374126f, - -0.9495487089811836f, - -0.9495897535546937f, - -0.9496307818572399f, - -0.9496717938881193f, - -0.949712789646629f, - -0.9497537691320669f, - -0.9497947323437302f, - -0.9498356792809175f, - -0.949876609942927f, - -0.9499175243290577f, - -0.949958422438608f, - -0.9499993042708773f, - -0.9500401698251651f, - -0.9500810191007717f, - -0.9501218520969964f, - -0.9501626688131398f, - -0.9502034692485026f, - -0.9502442534023859f, - -0.9502850212740904f, - -0.9503257728629181f, - -0.9503665081681698f, - -0.9504072271891487f, - -0.9504479299251564f, - -0.9504886163754956f, - -0.9505292865394688f, - -0.9505699404163799f, - -0.9506105780055317f, - -0.9506511993062283f, - -0.9506918043177729f, - -0.9507323930394708f, - -0.9507729654706256f, - -0.950813521610543f, - -0.9508540614585271f, - -0.9508945850138839f, - -0.9509350922759188f, - -0.9509755832439382f, - -0.9510160579172474f, - -0.9510565162951535f, - -0.9510969583769632f, - -0.9511373841619836f, - -0.9511777936495217f, - -0.9512181868388853f, - -0.9512585637293821f, - -0.9512989243203208f, - -0.9513392686110091f, - -0.9513795966007561f, - -0.9514199082888708f, - -0.9514602036746626f, - -0.9515004827574406f, - -0.9515407455365149f, - -0.9515809920111956f, - -0.951621222180793f, - -0.9516614360446182f, - -0.9517016336019816f, - -0.9517418148521947f, - -0.9517819797945685f, - -0.9518221284284157f, - -0.9518622607530477f, - -0.9519023767677772f, - -0.9519424764719161f, - -0.9519825598647784f, - -0.9520226269456765f, - -0.9520626777139244f, - -0.9521027121688349f, - -0.9521427303097232f, - -0.9521827321359028f, - -0.9522227176466888f, - -0.9522626868413954f, - -0.9523026397193383f, - -0.9523425762798327f, - -0.9523824965221945f, - -0.9524224004457393f, - -0.9524622880497836f, - -0.9525021593336439f, - -0.9525420142966373f, - -0.9525818529380804f, - -0.9526216752572908f, - -0.9526614812535861f, - -0.9527012709262846f, - -0.952741044274704f, - -0.9527808012981631f, - -0.9528205419959802f, - -0.9528602663674751f, - -0.9528999744119666f, - -0.9529396661287746f, - -0.9529793415172186f, - -0.9530190005766195f, - -0.953058643306297f, - -0.9530982697055721f, - -0.9531378797737657f, - -0.9531774735101998f, - -0.9532170509141948f, - -0.9532566119850734f, - -0.9532961567221577f, - -0.9533356851247696f, - -0.9533751971922321f, - -0.9534146929238682f, - -0.9534541723190013f, - -0.9534936353769543f, - -0.9535330820970519f, - -0.9535725124786175f, - -0.953611926520976f, - -0.9536513242234512f, - -0.9536907055853693f, - -0.9537300706060543f, - -0.9537694192848326f, - -0.9538087516210293f, - -0.9538480676139707f, - -0.9538873672629832f, - -0.9539266505673936f, - -0.9539659175265283f, - -0.9540051681397147f, - -0.9540444024062803f, - -0.954083620325553f, - -0.9541228218968605f, - -0.9541620071195314f, - -0.9542011759928936f, - -0.9542403285162769f, - -0.9542794646890097f, - -0.9543185845104221f, - -0.9543576879798427f, - -0.9543967750966027f, - -0.9544358458600315f, - -0.9544749002694602f, - -0.9545139383242189f, - -0.9545529600236397f, - -0.9545919653670529f, - -0.9546309543537912f, - -0.9546699269831856f, - -0.9547088832545688f, - -0.9547478231672731f, - -0.9547867467206315f, - -0.9548256539139771f, - -0.954864544746643f, - -0.9549034192179627f, - -0.9549422773272703f, - -0.9549811190739004f, - -0.9550199444571866f, - -0.9550587534764641f, - -0.9550975461310679f, - -0.9551363224203335f, - -0.955175082343596f, - -0.9552138259001915f, - -0.9552525530894562f, - -0.9552912639107268f, - -0.9553299583633393f, - -0.9553686364466312f, - -0.9554072981599395f, - -0.9554459435026021f, - -0.9554845724739564f, - -0.9555231850733407f, - -0.9555617813000933f, - -0.9556003611535532f, - -0.9556389246330588f, - -0.9556774717379499f, - -0.9557160024675652f, - -0.9557545168212455f, - -0.95579301479833f, - -0.9558314963981598f, - -0.9558699616200746f, - -0.9559084104634163f, - -0.9559468429275255f, - -0.955985259011744f, - -0.9560236587154131f, - -0.956062042037875f, - -0.9561004089784723f, - -0.9561387595365475f, - -0.9561770937114431f, - -0.9562154115025026f, - -0.9562537129090694f, - -0.9562919979304872f, - -0.9563302665661f, - -0.9563685188152519f, - -0.9564067546772875f, - -0.9564449741515522f, - -0.9564831772373903f, - -0.9565213639341476f, - -0.9565595342411697f, - -0.9565976881578027f, - -0.9566358256833929f, - -0.9566739468172865f, - -0.9567120515588303f, - -0.9567501399073718f, - -0.9567882118622583f, - -0.9568262674228369f, - -0.956864306588456f, - -0.9569023293584638f, - -0.9569403357322088f, - -0.9569783257090395f, - -0.9570162992883054f, - -0.957054256469355f, - -0.957092197251539f, - -0.9571301216342066f, - -0.9571680296167083f, - -0.957205921198394f, - -0.9572437963786152f, - -0.9572816551567225f, - -0.9573194975320674f, - -0.9573573235040008f, - -0.9573951330718756f, - -0.9574329262350433f, - -0.9574707029928566f, - -0.9575084633446679f, - -0.9575462072898303f, - -0.9575839348276972f, - -0.9576216459576223f, - -0.957659340678959f, - -0.9576970189910615f, - -0.9577346808932844f, - -0.9577723263849826f, - -0.9578099554655104f, - -0.9578475681342233f, - -0.9578851643904771f, - -0.9579227442336276f, - -0.9579603076630302f, - -0.957997854678042f, - -0.9580353852780192f, - -0.9580728994623192f, - -0.9581103972302987f, - -0.9581478785813153f, - -0.958185343514727f, - -0.9582227920298918f, - -0.9582602241261677f, - -0.9582976398029136f, - -0.9583350390594886f, - -0.9583724218952511f, - -0.9584097883095615f, - -0.9584471383017789f, - -0.9584844718712637f, - -0.9585217890173756f, - -0.9585590897394761f, - -0.9585963740369253f, - -0.958633641909085f, - -0.9586708933553155f, - -0.9587081283749799f, - -0.9587453469674392f, - -0.9587825491320562f, - -0.958819734868193f, - -0.9588569041752127f, - -0.9588940570524785f, - -0.9589311934993539f, - -0.9589683135152021f, - -0.9590054170993872f, - -0.9590425042512737f, - -0.9590795749702262f, - -0.959116629255609f, - -0.9591536671067875f, - -0.9591906885231272f, - -0.9592276935039936f, - -0.9592646820487525f, - -0.9593016541567704f, - -0.9593386098274131f, - -0.9593755490600485f, - -0.9594124718540428f, - -0.9594493782087637f, - -0.9594862681235784f, - -0.9595231415978556f, - -0.9595599986309626f, - -0.9595968392222683f, - -0.9596336633711415f, - -0.9596704710769514f, - -0.9597072623390667f, - -0.9597440371568573f, - -0.9597807955296934f, - -0.9598175374569446f, - -0.9598542629379816f, - -0.9598909719721752f, - -0.9599276645588964f, - -0.9599643406975163f, - -0.9600010003874067f, - -0.9600376436279391f, - -0.9600742704184861f, - -0.9601108807584197f, - -0.9601474746471126f, - -0.9601840520839381f, - -0.9602206130682693f, - -0.9602571575994796f, - -0.960293685676943f, - -0.9603301973000334f, - -0.9603666924681257f, - -0.9604031711805938f, - -0.960439633436813f, - -0.9604760792361586f, - -0.9605125085780064f, - -0.9605489214617315f, - -0.9605853178867106f, - -0.9606216978523194f, - -0.9606580613579353f, - -0.9606944084029346f, - -0.9607307389866951f, - -0.9607670531085934f, - -0.9608033507680084f, - -0.9608396319643171f, - -0.9608758966968987f, - -0.9609121449651309f, - -0.9609483767683935f, - -0.960984592106065f, - -0.9610207909775255f, - -0.9610569733821541f, - -0.961093139319331f, - -0.9611292887884367f, - -0.961165421788852f, - -0.9612015383199571f, - -0.9612376383811336f, - -0.9612737219717629f, - -0.9613097890912269f, - -0.961345839738907f, - -0.961381873914186f, - -0.9614178916164462f, - -0.9614538928450707f, - -0.9614898775994426f, - -0.961525845878945f, - -0.9615617976829618f, - -0.961597733010877f, - -0.9616336518620751f, - -0.9616695542359401f, - -0.9617054401318571f, - -0.9617413095492111f, - -0.961777162487388f, - -0.9618129989457727f, - -0.9618488189237515f, - -0.9618846224207107f, - -0.961920409436037f, - -0.9619561799691168f, - -0.9619919340193374f, - -0.9620276715860857f, - -0.9620633926687502f, - -0.9620990972667182f, - -0.9621347853793782f, - -0.9621704570061183f, - -0.9622061121463279f, - -0.9622417507993956f, - -0.9622773729647109f, - -0.9623129786416633f, - -0.9623485678296428f, - -0.9623841405280396f, - -0.9624196967362443f, - -0.9624552364536473f, - -0.9624907596796398f, - -0.9625262664136133f, - -0.9625617566549594f, - -0.9625972304030695f, - -0.9626326876573362f, - -0.962668128417152f, - -0.9627035526819095f, - -0.9627389604510017f, - -0.9627743517238218f, - -0.9628097264997635f, - -0.9628450847782208f, - -0.9628804265585875f, - -0.9629157518402583f, - -0.9629510606226278f, - -0.9629863529050913f, - -0.9630216286870436f, - -0.9630568879678804f, - -0.9630921307469975f, - -0.9631273570237913f, - -0.9631625667976581f, - -0.9631977600679944f, - -0.9632329368341975f, - -0.9632680970956641f, - -0.9633032408517924f, - -0.9633383681019798f, - -0.9633734788456247f, - -0.9634085730821248f, - -0.9634436508108798f, - -0.963478712031288f, - -0.9635137567427489f, - -0.9635487849446613f, - -0.9635837966364261f, - -0.9636187918174428f, - -0.9636537704871119f, - -0.9636887326448338f, - -0.9637236782900096f, - -0.9637586074220406f, - -0.9637935200403285f, - -0.9638284161442744f, - -0.9638632957332809f, - -0.9638981588067502f, - -0.9639330053640852f, - -0.9639678354046883f, - -0.9640026489279633f, - -0.9640374459333128f, - -0.9640722264201416f, - -0.964106990387853f, - -0.9641417378358519f, - -0.964176468763542f, - -0.9642111831703294f, - -0.9642458810556183f, - -0.9642805624188145f, - -0.964315227259324f, - -0.9643498755765526f, - -0.9643845073699066f, - -0.9644191226387924f, - -0.9644537213826174f, - -0.9644883036007882f, - -0.9645228692927125f, - -0.964557418457798f, - -0.9645919510954529f, - -0.9646264672050852f, - -0.9646609667861035f, - -0.9646954498379168f, - -0.9647299163599343f, - -0.964764366351565f, - -0.9647987998122194f, - -0.9648332167413067f, - -0.9648676171382378f, - -0.9649020010024226f, - -0.9649363683332723f, - -0.9649707191301982f, - -0.9650050533926116f, - -0.9650393711199239f, - -0.9650736723115473f, - -0.965107956966894f, - -0.965142225085377f, - -0.9651764766664083f, - -0.9652107117094015f, - -0.9652449302137699f, - -0.9652791321789275f, - -0.9653133176042876f, - -0.965347486489265f, - -0.9653816388332738f, - -0.9654157746357293f, - -0.9654498938960461f, - -0.96548399661364f, - -0.9655180827879261f, - -0.965552152418321f, - -0.9655862055042406f, - -0.9656202420451014f, - -0.9656542620403202f, - -0.9656882654893141f, - -0.9657222523915003f, - -0.965756222746297f, - -0.9657901765531215f, - -0.9658241138113922f, - -0.9658580345205277f, - -0.9658919386799466f, - -0.9659258262890683f, - -0.9659596973473118f, - -0.9659935518540967f, - -0.9660273898088433f, - -0.9660612112109715f, - -0.9660950160599019f, - -0.966128804355055f, - -0.9661625760958521f, - -0.9661963312817148f, - -0.9662300699120641f, - -0.9662637919863221f, - -0.9662974975039111f, - -0.9663311864642539f, - -0.9663648588667725f, - -0.9663985147108904f, - -0.9664321539960308f, - -0.9664657767216176f, - -0.9664993828870742f, - -0.9665329724918251f, - -0.9665665455352943f, - -0.9666001020169073f, - -0.9666336419360885f, - -0.9666671652922635f, - -0.9667006720848574f, - -0.9667341623132969f, - -0.9667676359770075f, - -0.9668010930754161f, - -0.9668345336079486f, - -0.9668679575740331f, - -0.9669013649730961f, - -0.9669347558045657f, - -0.9669681300678692f, - -0.967001487762435f, - -0.9670348288876917f, - -0.967068153443068f, - -0.9671014614279925f, - -0.9671347528418947f, - -0.9671680276842043f, - -0.9672012859543512f, - -0.9672345276517651f, - -0.9672677527758767f, - -0.9673009613261168f, - -0.9673341533019163f, - -0.9673673287027064f, - -0.9674004875279185f, - -0.9674336297769847f, - -0.9674667554493369f, - -0.9674998645444078f, - -0.9675329570616299f, - -0.967566033000436f, - -0.9675990923602596f, - -0.9676321351405344f, - -0.9676651613406937f, - -0.9676981709601721f, - -0.9677311639984034f, - -0.9677641404548231f, - -0.9677971003288653f, - -0.967830043619966f, - -0.96786297032756f, - -0.9678958804510839f, - -0.9679287739899731f, - -0.9679616509436645f, - -0.9679945113115941f, - -0.9680273550931996f, - -0.9680601822879178f, - -0.9680929928951865f, - -0.9681257869144431f, - -0.9681585643451258f, - -0.9681913251866731f, - -0.9682240694385238f, - -0.9682567971001165f, - -0.9682895081708905f, - -0.9683222026502855f, - -0.9683548805377412f, - -0.9683875418326976f, - -0.9684201865345949f, - -0.9684528146428741f, - -0.9684854261569761f, - -0.9685180210763418f, - -0.9685505994004128f, - -0.968583161128631f, - -0.9686157062604386f, - -0.9686482347952775f, - -0.9686807467325906f, - -0.9687132420718209f, - -0.9687457208124116f, - -0.9687781829538059f, - -0.9688106284954479f, - -0.9688430574367813f, - -0.968875469777251f, - -0.968907865516301f, - -0.9689402446533766f, - -0.968972607187923f, - -0.9690049531193854f, - -0.9690372824472097f, - -0.9690695951708419f, - -0.9691018912897287f, - -0.9691341708033159f, - -0.9691664337110513f, - -0.9691986800123815f, - -0.9692309097067544f, - -0.9692631227936174f, - -0.9692953192724185f, - -0.9693274991426062f, - -0.9693596624036294f, - -0.9693918090549363f, - -0.9694239390959765f, - -0.9694560525261994f, - -0.969488149345055f, - -0.9695202295519928f, - -0.9695522931464634f, - -0.9695843401279175f, - -0.969616370495806f, - -0.9696483842495798f, - -0.9696803813886906f, - -0.9697123619125897f, - -0.9697443258207299f, - -0.9697762731125628f, - -0.9698082037875414f, - -0.9698401178451181f, - -0.9698720152847468f, - -0.9699038961058803f, - -0.9699357603079728f, - -0.9699676078904778f, - -0.9699994388528501f, - -0.970031253194544f, - -0.9700630509150145f, - -0.9700948320137166f, - -0.9701265964901058f, - -0.9701583443436379f, - -0.9701900755737689f, - -0.9702217901799551f, - -0.970253488161653f, - -0.9702851695183194f, - -0.9703168342494117f, - -0.9703484823543873f, - -0.9703801138327036f, - -0.9704117286838189f, - -0.9704433269071913f, - -0.9704749085022796f, - -0.9705064734685425f, - -0.970538021805439f, - -0.9705695535124288f, - -0.9706010685889717f, - -0.9706325670345273f, - -0.9706640488485561f, - -0.9706955140305186f, - -0.970726962579876f, - -0.9707583944960889f, - -0.970789809778619f, - -0.9708212084269279f, - -0.970852590440478f, - -0.970883955818731f, - -0.9709153045611498f, - -0.9709466366671969f, - -0.9709779521363361f, - -0.9710092509680301f, - -0.9710405331617432f, - -0.9710717987169386f, - -0.9711030476330816f, - -0.971134279909636f, - -0.971165495546067f, - -0.9711966945418395f, - -0.971227876896419f, - -0.9712590426092712f, - -0.9712901916798623f, - -0.9713213241076581f, - -0.9713524398921256f, - -0.9713835390327313f, - -0.9714146215289428f, - -0.971445687380227f, - -0.9714767365860517f, - -0.971507769145885f, - -0.9715387850591954f, - -0.9715697843254509f, - -0.9716007669441207f, - -0.9716317329146739f, - -0.9716626822365797f, - -0.9716936149093083f, - -0.971724530932329f, - -0.9717554303051125f, - -0.971786313027129f, - -0.97181717909785f, - -0.9718480285167459f, - -0.9718788612832884f, - -0.9719096773969492f, - -0.9719404768572004f, - -0.9719712596635139f, - -0.9720020258153628f, - -0.972032775312219f, - -0.9720635081535567f, - -0.9720942243388486f, - -0.9721249238675688f, - -0.9721556067391905f, - -0.9721862729531892f, - -0.9722169225090384f, - -0.9722475554062134f, - -0.972278171644189f, - -0.9723087712224411f, - -0.9723393541404448f, - -0.9723699203976767f, - -0.9724004699936124f, - -0.9724310029277288f, - -0.9724615191995027f, - -0.9724920188084114f, - -0.9725225017539318f, - -0.9725529680355419f, - -0.9725834176527197f, - -0.9726138506049435f, - -0.9726442668916917f, - -0.972674666512443f, - -0.9727050494666767f, - -0.9727354157538725f, - -0.9727657653735093f, - -0.9727960983250676f, - -0.9728264146080277f, - -0.9728567142218701f, - -0.9728869971660754f, - -0.9729172634401247f, - -0.9729475130434997f, - -0.972977745975682f, - -0.9730079622361534f, - -0.9730381618243961f, - -0.973068344739893f, - -0.9730985109821264f, - -0.97312866055058f, - -0.9731587934447368f, - -0.9731889096640807f, - -0.9732190092080951f, - -0.9732490920762653f, - -0.9732791582680749f, - -0.9733092077830092f, - -0.973339240620553f, - -0.973369256780192f, - -0.9733992562614118f, - -0.9734292390636984f, - -0.9734592051865377f, - -0.9734891546294167f, - -0.9735190873918219f, - -0.9735490034732407f, - -0.9735789028731603f, - -0.9736087855910683f, - -0.9736386516264528f, - -0.9736685009788023f, - -0.9736983336476048f, - -0.9737281496323494f, - -0.9737579489325253f, - -0.9737877315476221f, - -0.9738174974771289f, - -0.9738472467205361f, - -0.9738769792773335f, - -0.9739066951470123f, - -0.9739363943290629f, - -0.9739660768229766f, - -0.9739957426282444f, - -0.9740253917443586f, - -0.9740550241708107f, - -0.9740846399070932f, - -0.9741142389526984f, - -0.9741438213071195f, - -0.9741733869698492f, - -0.9742029359403812f, - -0.9742324682182093f, - -0.9742619838028269f, - -0.9742914826937288f, - -0.9743209648904092f, - -0.9743504303923634f, - -0.9743798791990859f, - -0.9744093113100725f, - -0.9744387267248187f, - -0.9744681254428208f, - -0.9744975074635748f, - -0.9745268727865771f, - -0.9745562214113247f, - -0.974585553337315f, - -0.974614868564045f, - -0.9746441670910124f, - -0.9746734489177155f, - -0.9747027140436524f, - -0.9747319624683215f, - -0.9747611941912216f, - -0.9747904092118522f, - -0.9748196075297126f, - -0.9748487891443022f, - -0.9748779540551213f, - -0.9749071022616697f, - -0.9749362337634486f, - -0.9749653485599584f, - -0.9749944466507006f, - -0.9750235280351759f, - -0.9750525927128869f, - -0.9750816406833349f, - -0.9751106719460226f, - -0.975139686500452f, - -0.9751686843461267f, - -0.9751976654825493f, - -0.9752266299092235f, - -0.9752555776256527f, - -0.9752845086313411f, - -0.9753134229257928f, - -0.9753423205085128f, - -0.9753712013790053f, - -0.9754000655367759f, - -0.9754289129813299f, - -0.975457743712173f, - -0.9754865577288113f, - -0.9755153550307508f, - -0.9755441356174983f, - -0.9755728994885606f, - -0.975601646643445f, - -0.9756303770816586f, - -0.9756590908027092f, - -0.9756877878061048f, - -0.975716468091354f, - -0.975745131657965f, - -0.9757737785054467f, - -0.9758024086333084f, - -0.9758310220410595f, - -0.9758596187282096f, - -0.9758881986942689f, - -0.9759167619387472f, - -0.9759453084611559f, - -0.9759738382610051f, - -0.9760023513378066f, - -0.9760308476910708f, - -0.9760593273203108f, - -0.9760877902250376f, - -0.9761162364047641f, - -0.9761446658590021f, - -0.9761730785872653f, - -0.9762014745890665f, - -0.9762298538639193f, - -0.976258216411337f, - -0.976286562230834f, - -0.9763148913219245f, - -0.9763432036841233f, - -0.9763714993169449f, - -0.9763997782199045f, - -0.9764280403925178f, - -0.9764562858343007f, - -0.9764845145447686f, - -0.9765127265234382f, - -0.9765409217698261f, - -0.9765691002834493f, - -0.9765972620638246f, - -0.9766254071104696f, - -0.9766535354229021f, - -0.9766816470006404f, - -0.9767097418432024f, - -0.9767378199501067f, - -0.9767658813208723f, - -0.9767939259550187f, - -0.9768219538520648f, - -0.9768499650115308f, - -0.9768779594329363f, - -0.9769059371158021f, - -0.9769338980596487f, - -0.9769618422639966f, - -0.9769897697283676f, - -0.9770176804522824f, - -0.9770455744352636f, - -0.9770734516768327f, - -0.9771013121765122f, - -0.9771291559338244f, - -0.9771569829482929f, - -0.9771847932194403f, - -0.9772125867467905f, - -0.9772403635298668f, - -0.9772681235681934f, - -0.9772958668612948f, - -0.9773235934086957f, - -0.9773513032099207f, - -0.9773789962644952f, - -0.9774066725719446f, - -0.977434332131795f, - -0.9774619749435719f, - -0.9774896010068019f, - -0.9775172103210117f, - -0.9775448028857284f, - -0.9775723787004789f, - -0.9775999377647908f, - -0.9776274800781916f, - -0.97765500564021f, - -0.9776825144503738f, - -0.9777100065082119f, - -0.9777374818132532f, - -0.977764940365027f, - -0.9777923821630625f, - -0.9778198072068898f, - -0.9778472154960388f, - -0.9778746070300401f, - -0.977901981808424f, - -0.9779293398307217f, - -0.9779566810964646f, - -0.9779840056051837f, - -0.9780113133564111f, - -0.9780386043496788f, - -0.9780658785845195f, - -0.9780931360604654f, - -0.9781203767770497f, - -0.9781476007338056f, - -0.9781748079302667f, - -0.9782019983659664f, - -0.9782291720404396f, - -0.9782563289532199f, - -0.9782834691038426f, - -0.978310592491842f, - -0.9783376991167538f, - -0.9783647889781135f, - -0.9783918620754569f, - -0.97841891840832f, - -0.9784459579762392f, - -0.9784729807787513f, - -0.9784999868153934f, - -0.9785269760857024f, - -0.978553948589216f, - -0.978580904325472f, - -0.9786078432940087f, - -0.9786347654943645f, - -0.9786616709260779f, - -0.9786885595886877f, - -0.9787154314817338f, - -0.9787422866047552f, - -0.9787691249572921f, - -0.9787959465388841f, - -0.9788227513490724f, - -0.978849539387397f, - -0.9788763106533995f, - -0.9789030651466206f, - -0.9789298028666022f, - -0.9789565238128861f, - -0.9789832279850147f, - -0.9790099153825298f, - -0.9790365860049747f, - -0.979063239851892f, - -0.9790898769228253f, - -0.9791164972173182f, - -0.9791431007349143f, - -0.9791696874751579f, - -0.9791962574375934f, - -0.9792228106217657f, - -0.9792493470272197f, - -0.9792758666535005f, - -0.979302369500154f, - -0.9793288555667261f, - -0.9793553248527627f, - -0.9793817773578104f, - -0.9794082130814159f, - -0.9794346320231264f, - -0.979461034182489f, - -0.9794874195590513f, - -0.9795137881523613f, - -0.9795401399619674f, - -0.9795664749874177f, - -0.9795927932282611f, - -0.9796190946840464f, - -0.9796453793543235f, - -0.9796716472386415f, - -0.9796978983365507f, - -0.9797241326476007f, - -0.9797503501713428f, - -0.9797765509073271f, - -0.979802734855105f, - -0.9798289020142276f, - -0.9798550523842469f, - -0.9798811859647144f, - -0.9799073027551827f, - -0.9799334027552039f, - -0.979959485964331f, - -0.979985552382117f, - -0.9800116020081157f, - -0.98003763484188f, - -0.9800636508829642f, - -0.9800896501309225f, - -0.9801156325853098f, - -0.9801415982456801f, - -0.980167547111589f, - -0.9801934791825918f, - -0.9802193944582444f, - -0.9802452929381023f, - -0.9802711746217218f, - -0.9802970395086597f, - -0.9803228875984725f, - -0.9803487188907177f, - -0.9803745333849524f, - -0.9804003310807342f, - -0.9804261119776212f, - -0.9804518760751719f, - -0.9804776233729443f, - -0.9805033538704978f, - -0.9805290675673908f, - -0.9805547644631836f, - -0.9805804445574351f, - -0.9806061078497058f, - -0.9806317543395554f, - -0.9806573840265452f, - -0.9806829969102355f, - -0.9807085929901878f, - -0.9807341722659629f, - -0.9807597347371233f, - -0.9807852804032303f, - -0.9808108092638469f, - -0.9808363213185349f, - -0.9808618165668576f, - -0.980887295008378f, - -0.9809127566426599f, - -0.9809382014692665f, - -0.980963629487762f, - -0.9809890406977106f, - -0.9810144350986774f, - -0.9810398126902266f, - -0.9810651734719236f, - -0.981090517443334f, - -0.9811158446040236f, - -0.981141154953558f, - -0.9811664484915039f, - -0.9811917252174277f, - -0.9812169851308965f, - -0.9812422282314773f, - -0.9812674545187375f, - -0.981292663992245f, - -0.981317856651568f, - -0.9813430324962745f, - -0.9813681915259332f, - -0.9813933337401132f, - -0.9814184591383835f, - -0.9814435677203137f, - -0.9814686594854733f, - -0.9814937344334329f, - -0.9815187925637622f, - -0.9815438338760324f, - -0.9815688583698141f, - -0.9815938660446787f, - -0.9816188569001972f, - -0.9816438309359422f, - -0.9816687881514853f, - -0.9816937285463989f, - -0.9817186521202556f, - -0.9817435588726284f, - -0.9817684488030906f, - -0.9817933219112157f, - -0.9818181781965774f, - -0.9818430176587498f, - -0.9818678402973074f, - -0.981892646111825f, - -0.9819174351018772f, - -0.9819422072670395f, - -0.9819669626068872f, - -0.9819917011209965f, - -0.9820164228089433f, - -0.982041127670304f, - -0.982065815704655f, - -0.9820904869115739f, - -0.9821151412906374f, - -0.9821397788414236f, - -0.9821643995635095f, - -0.9821890034564742f, - -0.9822135905198954f, - -0.9822381607533525f, - -0.9822627141564235f, - -0.9822872507286887f, - -0.9823117704697271f, - -0.9823362733791186f, - -0.9823607594564436f, - -0.9823852287012823f, - -0.9824096811132155f, - -0.9824341166918242f, - -0.9824585354366899f, - -0.9824829373473938f, - -0.9825073224235181f, - -0.9825316906646447f, - -0.9825560420703566f, - -0.9825803766402359f, - -0.9826046943738659f, - -0.9826289952708299f, - -0.9826532793307118f, - -0.9826775465530949f, - -0.9827017969375639f, - -0.982726030483703f, - -0.9827502471910973f, - -0.9827744470593314f, - -0.9827986300879907f, - -0.9828227962766612f, - -0.9828469456249287f, - -0.9828710781323792f, - -0.9828951937985995f, - -0.9829192926231757f, - -0.9829433746056958f, - -0.9829674397457465f, - -0.9829914880429159f, - -0.9830155194967914f, - -0.983039534106962f, - -0.9830635318730154f, - -0.983087512794541f, - -0.9831114768711273f, - -0.9831354241023644f, - -0.9831593544878415f, - -0.9831832680271488f, - -0.9832071647198762f, - -0.9832310445656145f, - -0.9832549075639545f, - -0.9832787537144875f, - -0.9833025830168044f, - -0.9833263954704973f, - -0.9833501910751581f, - -0.9833739698303791f, - -0.9833977317357527f, - -0.9834214767908718f, - -0.9834452049953296f, - -0.9834689163487195f, - -0.9834926108506354f, - -0.983516288500671f, - -0.9835399492984206f, - -0.9835635932434789f, - -0.9835872203354409f, - -0.9836108305739015f, - -0.9836344239584562f, - -0.9836580004887008f, - -0.9836815601642315f, - -0.9837051029846442f, - -0.9837286289495358f, - -0.983752138058503f, - -0.9837756303111433f, - -0.9837991057070539f, - -0.9838225642458327f, - -0.9838460059270773f, - -0.9838694307503867f, - -0.983892838715359f, - -0.9839162298215935f, - -0.9839396040686891f, - -0.9839629614562455f, - -0.9839863019838623f, - -0.9840096256511398f, - -0.9840329324576779f, - -0.9840562224030779f, - -0.9840794954869401f, - -0.9841027517088663f, - -0.9841259910684574f, - -0.9841492135653157f, - -0.984172419199043f, - -0.984195607969242f, - -0.984218779875515f, - -0.984241934917465f, - -0.9842650730946954f, - -0.9842881944068098f, - -0.9843112988534118f, - -0.9843343864341056f, - -0.9843574571484957f, - -0.9843805109961868f, - -0.9844035479767836f, - -0.9844265680898916f, - -0.9844495713351162f, - -0.9844725577120637f, - -0.9844955272203396f, - -0.9845184798595507f, - -0.9845414156293035f, - -0.9845643345292054f, - -0.9845872365588633f, - -0.9846101217178848f, - -0.984632990005878f, - -0.9846558414224507f, - -0.9846786759672118f, - -0.9847014936397697f, - -0.9847242944397336f, - -0.9847470783667126f, - -0.9847698454203166f, - -0.9847925956001554f, - -0.9848153289058391f, - -0.984838045336978f, - -0.9848607448931833f, - -0.9848834275740657f, - -0.9849060933792367f, - -0.9849287423083078f, - -0.9849513743608911f, - -0.9849739895365985f, - -0.984996587835043f, - -0.9850191692558368f, - -0.9850417337985933f, - -0.9850642814629258f, - -0.9850868122484481f, - -0.9851093261547739f, - -0.9851318231815175f, - -0.9851543033282935f, - -0.9851767665947168f, - -0.9851992129804021f, - -0.9852216424849654f, - -0.9852440551080216f, - -0.9852664508491874f, - -0.9852888297080785f, - -0.985311191684312f, - -0.985333536777504f, - -0.9853558649872725f, - -0.9853781763132342f, - -0.985400470755007f, - -0.9854227483122092f, - -0.9854450089844587f, - -0.9854672527713741f, - -0.9854894796725745f, - -0.985511689687679f, - -0.9855338828163067f, - -0.9855560590580776f, - -0.9855782184126118f, - -0.9856003608795296f, - -0.9856224864584513f, - -0.9856445951489979f, - -0.9856666869507908f, - -0.9856887618634514f, - -0.9857108198866011f, - -0.9857328610198623f, - -0.9857548852628574f, - -0.9857768926152087f, - -0.9857988830765393f, - -0.9858208566464723f, - -0.9858428133246313f, - -0.9858647531106401f, - -0.9858866760041226f, - -0.9859085820047033f, - -0.9859304711120067f, - -0.9859523433256581f, - -0.9859741986452822f, - -0.985996037070505f, - -0.9860178586009518f, - -0.9860396632362493f, - -0.9860614509760233f, - -0.9860832218199009f, - -0.9861049757675087f, - -0.9861267128184743f, - -0.986148432972425f, - -0.986170136228989f, - -0.9861918225877937f, - -0.9862134920484682f, - -0.9862351446106409f, - -0.9862567802739409f, - -0.9862783990379974f, - -0.98630000090244f, - -0.9863215858668984f, - -0.9863431539310031f, - -0.9863647050943842f, - -0.9863862393566726f, - -0.9864077567174991f, - -0.9864292571764954f, - -0.9864507407332929f, - -0.9864722073875233f, - -0.986493657138819f, - -0.9865150899868124f, - -0.9865365059311363f, - -0.9865579049714236f, - -0.9865792871073078f, - -0.9866006523384223f, - -0.9866220006644014f, - -0.986643332084879f, - -0.9866646465994895f, - -0.9866859442078679f, - -0.9867072249096495f, - -0.986728488704469f, - -0.9867497355919627f, - -0.9867709655717659f, - -0.9867921786435155f, - -0.9868133748068476f, - -0.9868345540613993f, - -0.9868557164068071f, - -0.9868768618427093f, - -0.9868979903687428f, - -0.986919101984546f, - -0.9869401966897567f, - -0.9869612744840142f, - -0.9869823353669567f, - -0.9870033793382236f, - -0.9870244063974541f, - -0.9870454165442881f, - -0.9870664097783656f, - -0.9870873860993268f, - -0.9871083455068124f, - -0.987129288000463f, - -0.9871502135799199f, - -0.987171122244825f, - -0.9871920139948192f, - -0.987212888829545f, - -0.9872337467486447f, - -0.987254587751761f, - -0.9872754118385365f, - -0.9872962190086146f, - -0.9873170092616387f, - -0.9873377825972527f, - -0.9873585390151003f, - -0.9873792785148262f, - -0.9874000010960748f, - -0.9874207067584914f, - -0.9874413955017208f, - -0.9874620673254086f, - -0.9874827222292007f, - -0.9875033602127431f, - -0.9875239812756824f, - -0.9875445854176649f, - -0.9875651726383379f, - -0.9875857429373481f, - -0.9876062963143437f, - -0.9876268327689721f, - -0.9876473523008817f, - -0.9876678549097205f, - -0.9876883405951377f, - -0.9877088093567818f, - -0.9877292611943025f, - -0.9877496961073491f, - -0.9877701140955714f, - -0.9877905151586196f, - -0.9878108992961444f, - -0.9878312665077962f, - -0.9878516167932261f, - -0.9878719501520854f, - -0.9878922665840258f, - -0.987912566088699f, - -0.9879328486657574f, - -0.9879531143148532f, - -0.9879733630356394f, - -0.9879935948277689f, - -0.9880138096908953f, - -0.9880340076246715f, - -0.9880541886287523f, - -0.9880743527027914f, - -0.9880944998464434f, - -0.988114630059363f, - -0.9881347433412055f, - -0.9881548396916261f, - -0.9881749191102804f, - -0.9881949815968245f, - -0.9882150271509147f, - -0.9882350557722072f, - -0.988255067460359f, - -0.9882750622150274f, - -0.9882950400358693f, - -0.9883150009225429f, - -0.9883349448747059f, - -0.9883548718920167f, - -0.9883747819741335f, - -0.9883946751207158f, - -0.9884145513314222f, - -0.9884344106059124f, - -0.9884542529438458f, - -0.9884740783448828f, - -0.9884938868086834f, - -0.9885136783349086f, - -0.9885334529232186f, - -0.988553210573275f, - -0.9885729512847393f, - -0.9885926750572733f, - -0.9886123818905387f, - -0.9886320717841981f, - -0.988651744737914f, - -0.9886714007513494f, - -0.9886910398241674f, - -0.9887106619560316f, - -0.9887302671466055f, - -0.9887498553955536f, - -0.98876942670254f, - -0.9887889810672296f, - -0.9888085184892867f, - -0.9888280389683773f, - -0.9888475425041665f, - -0.9888670290963203f, - -0.9888864987445045f, - -0.9889059514483859f, - -0.9889253872076309f, - -0.9889448060219067f, - -0.9889642078908802f, - -0.9889835928142193f, - -0.9890029607915917f, - -0.9890223118226655f, - -0.9890416459071093f, - -0.9890609630445917f, - -0.9890802632347816f, - -0.9890995464773484f, - -0.9891188127719618f, - -0.9891380621182915f, - -0.9891572945160076f, - -0.9891765099647809f, - -0.989195708464282f, - -0.9892148900141816f, - -0.9892340546141515f, - -0.989253202263863f, - -0.9892723329629883f, - -0.9892914467111994f, - -0.9893105435081687f, - -0.9893296233535691f, - -0.989348686247074f, - -0.9893677321883562f, - -0.9893867611770895f, - -0.989405773212948f, - -0.9894247682956061f, - -0.9894437464247379f, - -0.9894627076000185f, - -0.9894816518211227f, - -0.9895005790877264f, - -0.9895194893995048f, - -0.9895383827561343f, - -0.9895572591572906f, - -0.9895761186026509f, - -0.9895949610918917f, - -0.9896137866246902f, - -0.9896325952007237f, - -0.9896513868196702f, - -0.9896701614812075f, - -0.989688919185014f, - -0.9897076599307681f, - -0.9897263837181489f, - -0.9897450905468355f, - -0.9897637804165075f, - -0.9897824533268443f, - -0.9898011092775262f, - -0.9898197482682335f, - -0.989838370298647f, - -0.9898569753684473f, - -0.9898755634773158f, - -0.9898941346249338f, - -0.9899126888109834f, - -0.9899312260351465f, - -0.9899497462971054f, - -0.9899682495965428f, - -0.9899867359331418f, - -0.9900052053065855f, - -0.9900236577165575f, - -0.9900420931627416f, - -0.9900605116448218f, - -0.9900789131624828f, - -0.990097297715409f, - -0.9901156653032855f, - -0.9901340159257974f, - -0.9901523495826308f, - -0.9901706662734708f, - -0.9901889659980042f, - -0.990207248755917f, - -0.9902255145468963f, - -0.9902437633706288f, - -0.990261995226802f, - -0.9902802101151033f, - -0.990298408035221f, - -0.9903165889868428f, - -0.9903347529696576f, - -0.9903528999833537f, - -0.9903710300276205f, - -0.9903891431021473f, - -0.9904072392066238f, - -0.9904253183407397f, - -0.9904433805041852f, - -0.9904614256966512f, - -0.9904794539178282f, - -0.9904974651674073f, - -0.9905154594450799f, - -0.9905334367505377f, - -0.9905513970834728f, - -0.9905693404435773f, - -0.9905872668305437f, - -0.9906051762440647f, - -0.990623068683834f, - -0.9906409441495444f, - -0.9906588026408899f, - -0.9906766441575645f, - -0.9906944686992625f, - -0.9907122762656784f, - -0.990730066856507f, - -0.9907478404714436f, - -0.9907655971101836f, - -0.9907833367724228f, - -0.9908010594578571f, - -0.9908187651661832f, - -0.9908364538970971f, - -0.9908541256502963f, - -0.9908717804254775f, - -0.9908894182223388f, - -0.9909070390405772f, - -0.9909246428798915f, - -0.9909422297399796f, - -0.9909597996205404f, - -0.9909773525212727f, - -0.9909948884418758f, - -0.9910124073820491f, - -0.9910299093414928f, - -0.9910473943199065f, - -0.9910648623169909f, - -0.9910823133324467f, - -0.9910997473659748f, - -0.9911171644172765f, - -0.9911345644860532f, - -0.991151947572007f, - -0.9911693136748401f, - -0.9911866627942545f, - -0.9912039949299535f, - -0.9912213100816395f, - -0.9912386082490164f, - -0.9912558894317876f, - -0.9912731536296568f, - -0.9912904008423282f, - -0.9913076310695066f, - -0.9913248443108964f, - -0.991342040566203f, - -0.9913592198351313f, - -0.9913763821173874f, - -0.991393527412677f, - -0.9914106557207062f, - -0.9914277670411819f, - -0.9914448613738104f, - -0.9914619387182991f, - -0.9914789990743554f, - -0.991496042441687f, - -0.9915130688200017f, - -0.9915300782090077f, - -0.9915470706084138f, - -0.9915640460179288f, - -0.9915810044372617f, - -0.9915979458661219f, - -0.9916148703042192f, - -0.9916317777512638f, - -0.9916486682069655f, - -0.9916655416710353f, - -0.9916823981431839f, - -0.9916992376231227f, - -0.9917160601105628f, - -0.9917328656052162f, - -0.9917496541067948f, - -0.9917664256150112f, - -0.9917831801295777f, - -0.9917999176502075f, - -0.9918166381766134f, - -0.9918333417085092f, - -0.9918500282456088f, - -0.9918666977876262f, - -0.9918833503342753f, - -0.9918999858852715f, - -0.9919166044403293f, - -0.9919332059991641f, - -0.9919497905614912f, - -0.9919663581270269f, - -0.991982908695487f, - -0.991999442266588f, - -0.9920159588400465f, - -0.9920324584155794f, - -0.9920489409929042f, - -0.9920654065717386f, - -0.9920818551518f, - -0.992098286732807f, - -0.9921147013144778f, - -0.9921310988965314f, - -0.9921474794786864f, - -0.9921638430606625f, - -0.9921801896421791f, - -0.9921965192229564f, - -0.9922128318027144f, - -0.9922291273811734f, - -0.9922454059580544f, - -0.9922616675330784f, - -0.992277912105967f, - -0.9922941396764415f, - -0.992310350244224f, - -0.9923265438090367f, - -0.9923427203706023f, - -0.9923588799286434f, - -0.9923750224828831f, - -0.9923911480330451f, - -0.9924072565788528f, - -0.9924233481200302f, - -0.9924394226563017f, - -0.9924554801873917f, - -0.9924715207130254f, - -0.9924875442329275f, - -0.9925035507468237f, - -0.9925195402544397f, - -0.9925355127555016f, - -0.9925514682497356f, - -0.9925674067368684f, - -0.9925833282166268f, - -0.9925992326887378f, - -0.9926151201529293f, - -0.992630990608929f, - -0.9926468440564647f, - -0.992662680495265f, - -0.9926784999250583f, - -0.9926943023455739f, - -0.9927100877565406f, - -0.9927258561576882f, - -0.9927416075487464f, - -0.9927573419294455f, - -0.9927730592995158f, - -0.9927887596586877f, - -0.9928044430066925f, - -0.9928201093432615f, - -0.992835758668126f, - -0.9928513909810182f, - -0.9928670062816698f, - -0.9928826045698137f, - -0.9928981858451823f, - -0.9929137501075087f, - -0.9929292973565262f, - -0.9929448275919686f, - -0.9929603408135695f, - -0.9929758370210633f, - -0.9929913162141845f, - -0.9930067783926675f, - -0.9930222235562478f, - -0.9930376517046605f, - -0.9930530628376414f, - -0.9930684569549262f, - -0.9930838340562514f, - -0.9930991941413534f, - -0.9931145372099691f, - -0.9931298632618353f, - -0.9931451722966897f, - -0.9931604643142699f, - -0.9931757393143139f, - -0.9931909972965598f, - -0.9932062382607463f, - -0.9932214622066122f, - -0.9932366691338969f, - -0.9932518590423394f, - -0.9932670319316796f, - -0.9932821878016577f, - -0.9932973266520139f, - -0.9933124484824886f, - -0.993327553292823f, - -0.9933426410827579f, - -0.9933577118520353f, - -0.9933727656003964f, - -0.9933878023275837f, - -0.9934028220333393f, - -0.993417824717406f, - -0.9934328103795266f, - -0.9934477790194444f, - -0.9934627306369028f, - -0.9934776652316459f, - -0.9934925828034175f, - -0.993507483351962f, - -0.9935223668770244f, - -0.9935372333783493f, - -0.9935520828556822f, - -0.9935669153087685f, - -0.9935817307373542f, - -0.9935965291411853f, - -0.9936113105200084f, - -0.99362607487357f, - -0.9936408222016174f, - -0.9936555525038976f, - -0.9936702657801585f, - -0.9936849620301478f, - -0.9936996412536138f, - -0.9937143034503048f, - -0.9937289486199696f, - -0.9937435767623574f, - -0.9937581878772176f, - -0.9937727819642996f, - -0.9937873590233535f, - -0.9938019190541294f, - -0.9938164620563781f, - -0.99383098802985f, - -0.9938454969742966f, - -0.9938599888894689f, - -0.993874463775119f, - -0.9938889216309986f, - -0.9939033624568601f, - -0.9939177862524557f, - -0.9939321930175389f, - -0.9939465827518623f, - -0.9939609554551797f, - -0.9939753111272445f, - -0.993989649767811f, - -0.9940039713766333f, - -0.9940182759534661f, - -0.9940325634980642f, - -0.9940468340101831f, - -0.9940610874895779f, - -0.9940753239360046f, - -0.9940895433492192f, - -0.9941037457289779f, - -0.9941179310750375f, - -0.994132099387155f, - -0.9941462506650875f, - -0.9941603849085927f, - -0.9941745021174282f, - -0.9941886022913521f, - -0.994202685430123f, - -0.9942167515334995f, - -0.9942308006012405f, - -0.9942448326331054f, - -0.9942588476288536f, - -0.9942728455882451f, - -0.9942868265110401f, - -0.9943007903969988f, - -0.9943147372458823f, - -0.9943286670574512f, - -0.994342579831467f, - -0.9943564755676914f, - -0.9943703542658863f, - -0.9943842159258137f, - -0.9943980605472363f, - -0.9944118881299167f, - -0.9944256986736181f, - -0.9944394921781038f, - -0.9944532686431374f, - -0.9944670280684829f, - -0.9944807704539047f, - -0.994494495799167f, - -0.994508204104035f, - -0.9945218953682733f, - -0.9945355695916478f, - -0.9945492267739239f, - -0.9945628669148678f, - -0.9945764900142456f, - -0.9945900960718239f, - -0.9946036850873696f, - -0.9946172570606501f, - -0.9946308119914323f, - -0.9946443498794844f, - -0.9946578707245742f, - -0.9946713745264703f, - -0.9946848612849409f, - -0.9946983309997551f, - -0.9947117836706822f, - -0.9947252192974918f, - -0.9947386378799533f, - -0.9947520394178371f, - -0.9947654239109133f, - -0.9947787913589529f, - -0.9947921417617265f, - -0.9948054751190055f, - -0.9948187914305615f, - -0.9948320906961662f, - -0.9948453729155919f, - -0.9948586380886109f, - -0.9948718862149959f, - -0.9948851172945198f, - -0.9948983313269562f, - -0.9949115283120782f, - -0.9949247082496602f, - -0.9949378711394758f, - -0.9949510169813002f, - -0.9949641457749074f, - -0.9949772575200729f, - -0.9949903522165718f, - -0.99500342986418f, - -0.995016490462673f, - -0.9950295340118275f, - -0.9950425605114196f, - -0.9950555699612262f, - -0.9950685623610246f, - -0.9950815377105919f, - -0.9950944960097059f, - -0.9951074372581445f, - -0.9951203614556862f, - -0.9951332686021092f, - -0.9951461586971925f, - -0.9951590317407152f, - -0.9951718877324567f, - -0.9951847266721969f, - -0.9951975485597155f, - -0.9952103533947932f, - -0.9952231411772101f, - -0.9952359119067475f, - -0.9952486655831865f, - -0.9952614022063083f, - -0.9952741217758949f, - -0.9952868242917284f, - -0.995299509753591f, - -0.9953121781612654f, - -0.9953248295145345f, - -0.9953374638131817f, - -0.9953500810569901f, - -0.9953626812457439f, - -0.9953752643792271f, - -0.995387830457224f, - -0.9954003794795193f, - -0.995412911445898f, - -0.9954254263561456f, - -0.9954379242100472f, - -0.995450405007389f, - -0.9954628687479571f, - -0.9954753154315379f, - -0.9954877450579179f, - -0.9955001576268845f, - -0.9955125531382248f, - -0.9955249315917265f, - -0.9955372929871774f, - -0.9955496373243657f, - -0.99556196460308f, - -0.995574274823109f, - -0.9955865679842417f, - -0.9955988440862675f, - -0.9956111031289762f, - -0.9956233451121576f, - -0.9956355700356019f, - -0.9956477778990998f, - -0.9956599687024418f, - -0.9956721424454195f, - -0.9956842991278237f, - -0.9956964387494468f, - -0.9957085613100801f, - -0.9957206668095163f, - -0.995732755247548f, - -0.9957448266239679f, - -0.9957568809385691f, - -0.9957689181911452f, - -0.99578093838149f, - -0.9957929415093975f, - -0.9958049275746618f, - -0.9958168965770777f, - -0.9958288485164402f, - -0.9958407833925442f, - -0.9958527012051857f, - -0.99586460195416f, - -0.9958764856392636f, - -0.9958883522602925f, - -0.9959002018170436f, - -0.9959120343093137f, - -0.9959238497369003f, - -0.9959356480996007f, - -0.9959474293972129f, - -0.9959591936295349f, - -0.9959709407963652f, - -0.9959826708975025f, - -0.9959943839327459f, - -0.9960060799018944f, - -0.996017758804748f, - -0.9960294206411062f, - -0.9960410654107695f, - -0.9960526931135383f, - -0.9960643037492132f, - -0.9960758973175954f, - -0.9960874738184862f, - -0.9960990332516871f, - -0.9961105756170004f, - -0.9961221009142279f, - -0.9961336091431725f, - -0.9961451003036367f, - -0.9961565743954238f, - -0.996168031418337f, - -0.9961794713721802f, - -0.9961908942567572f, - -0.9962023000718725f, - -0.9962136888173304f, - -0.9962250604929359f, - -0.9962364150984943f, - -0.9962477526338107f, - -0.996259073098691f, - -0.9962703764929413f, - -0.9962816628163678f, - -0.9962929320687772f, - -0.9963041842499764f, - -0.9963154193597724f, - -0.996326637397973f, - -0.9963378383643859f, - -0.996349022258819f, - -0.9963601890810808f, - -0.99637133883098f, - -0.9963824715083254f, - -0.9963935871129264f, - -0.9964046856445924f, - -0.9964157671031333f, - -0.9964268314883593f, - -0.9964378788000807f, - -0.9964489090381082f, - -0.996459922202253f, - -0.996470918292326f, - -0.9964818973081393f, - -0.9964928592495043f, - -0.9965038041162335f, - -0.9965147319081391f, - -0.9965256426250341f, - -0.9965365362667313f, - -0.9965474128330444f, - -0.9965582723237866f, - -0.9965691147387721f, - -0.996579940077815f, - -0.99659074834073f, - -0.9966015395273317f, - -0.9966123136374353f, - -0.9966230706708561f, - -0.9966338106274099f, - -0.9966445335069125f, - -0.9966552393091803f, - -0.9966659280340299f, - -0.9966765996812781f, - -0.9966872542507419f, - -0.9966978917422389f, - -0.9967085121555869f, - -0.9967191154906038f, - -0.9967297017471077f, - -0.9967402709249177f, - -0.9967508230238523f, - -0.996761358043731f, - -0.9967718759843729f, - -0.9967823768455981f, - -0.9967928606272266f, - -0.9968033273290787f, - -0.9968137769509751f, - -0.9968242094927366f, - -0.9968346249541847f, - -0.9968450233351408f, - -0.9968554046354268f, - -0.9968657688548646f, - -0.9968761159932769f, - -0.9968864460504862f, - -0.9968967590263156f, - -0.9969070549205883f, - -0.996917333733128f, - -0.9969275954637584f, - -0.9969378401123039f, - -0.9969480676785888f, - -0.996958278162438f, - -0.9969684715636763f, - -0.9969786478821292f, - -0.9969888071176224f, - -0.9969989492699818f, - -0.9970090743390334f, - -0.9970191823246038f, - -0.99702927322652f, - -0.9970393470446091f, - -0.9970494037786981f, - -0.997059443428615f, - -0.9970694659941877f, - -0.9970794714752446f, - -0.9970894598716139f, - -0.9970994311831248f, - -0.9971093854096064f, - -0.997119322550888f, - -0.9971292426067994f, - -0.9971391455771705f, - -0.9971490314618319f, - -0.9971589002606139f, - -0.9971687519733476f, - -0.9971785865998642f, - -0.997188404139995f, - -0.997198204593572f, - -0.9972079879604271f, - -0.9972177542403927f, - -0.9972275034333015f, - -0.9972372355389866f, - -0.9972469505572809f, - -0.9972566484880182f, - -0.9972663293310322f, - -0.9972759930861571f, - -0.9972856397532273f, - -0.9972952693320775f, - -0.9973048818225426f, - -0.9973144772244581f, - -0.9973240555376593f, - -0.9973336167619824f, - -0.9973431608972635f, - -0.9973526879433389f, - -0.9973621979000453f, - -0.99737169076722f, - -0.9973811665447002f, - -0.9973906252323237f, - -0.9974000668299281f, - -0.9974094913373519f, - -0.9974188987544336f, - -0.9974282890810118f, - -0.9974376623169258f, - -0.9974470184620149f, - -0.9974563575161188f, - -0.9974656794790775f, - -0.9974749843507313f, - -0.9974842721309207f, - -0.9974935428194865f, - -0.99750279641627f, - -0.9975120329211127f, - -0.997521252333856f, - -0.9975304546543422f, - -0.9975396398824136f, - -0.9975488080179128f, - -0.9975579590606825f, - -0.9975670930105662f, - -0.9975762098674072f, - -0.9975853096310495f, - -0.997594392301337f, - -0.9976034578781139f, - -0.9976125063612252f, - -0.9976215377505158f, - -0.9976305520458307f, - -0.9976395492470157f, - -0.9976485293539165f, - -0.9976574923663794f, - -0.9976664382842505f, - -0.9976753671073768f, - -0.9976842788356053f, - -0.9976931734687831f, - -0.997702051006758f, - -0.9977109114493777f, - -0.9977197547964906f, - -0.9977285810479449f, - -0.9977373902035896f, - -0.9977461822632737f, - -0.9977549572268465f, - -0.9977637150941576f, - -0.9977724558650571f, - -0.997781179539395f, - -0.9977898861170221f, - -0.997798575597789f, - -0.9978072479815469f, - -0.9978159032681471f, - -0.9978245414574415f, - -0.9978331625492818f, - -0.9978417665435205f, - -0.99785035344001f, - -0.9978589232386035f, - -0.9978674759391538f, - -0.9978760115415145f, - -0.9978845300455393f, - -0.9978930314510823f, - -0.9979015157579979f, - -0.9979099829661404f, - -0.9979184330753651f, - -0.997926866085527f, - -0.9979352819964817f, - -0.9979436808080849f, - -0.9979520625201928f, - -0.9979604271326616f, - -0.9979687746453482f, - -0.9979771050581093f, - -0.9979854183708025f, - -0.9979937145832851f, - -0.998001993695415f, - -0.9980102557070504f, - -0.9980185006180496f, - -0.9980267284282716f, - -0.9980349391375751f, - -0.9980431327458196f, - -0.9980513092528646f, - -0.9980594686585701f, - -0.9980676109627962f, - -0.9980757361654035f, - -0.9980838442662525f, - -0.9980919352652047f, - -0.9981000091621212f, - -0.9981080659568636f, - -0.998116105649294f, - -0.9981241282392745f, - -0.9981321337266679f, - -0.9981401221113367f, - -0.9981480933931443f, - -0.9981560475719538f, - -0.9981639846476291f, - -0.9981719046200342f, - -0.9981798074890336f, - -0.9981876932544914f, - -0.9981955619162729f, - -0.9982034134742431f, - -0.9982112479282674f, - -0.9982190652782118f, - -0.998226865523942f, - -0.9982346486653247f, - -0.9982424147022264f, - -0.9982501636345139f, - -0.9982578954620546f, - -0.9982656101847158f, - -0.9982733078023657f, - -0.998280988314872f, - -0.9982886517221033f, - -0.9982962980239283f, - -0.9983039272202159f, - -0.9983115393108354f, - -0.9983191342956564f, - -0.9983267121745487f, - -0.9983342729473825f, - -0.9983418166140283f, - -0.9983493431743568f, - -0.9983568526282389f, - -0.9983643449755463f, - -0.9983718202161501f, - -0.9983792783499226f, - -0.9983867193767358f, - -0.9983941432964624f, - -0.998401550108975f, - -0.9984089398141468f, - -0.9984163124118512f, - -0.9984236679019618f, - -0.9984310062843526f, - -0.9984383275588977f, - -0.998445631725472f, - -0.9984529187839499f, - -0.9984601887342069f, - -0.9984674415761184f, - -0.9984746773095601f, - -0.9984818959344077f, - -0.9984890974505379f, - -0.9984962818578271f, - -0.9985034491561524f, - -0.9985105993453908f, - -0.9985177324254197f, - -0.9985248483961172f, - -0.9985319472573612f, - -0.9985390290090299f, - -0.9985460936510022f, - -0.998553141183157f, - -0.9985601716053734f, - -0.998567184917531f, - -0.9985741811195098f, - -0.9985811602111896f, - -0.9985881221924512f, - -0.9985950670631749f, - -0.9986019948232421f, - -0.9986089054725338f, - -0.9986157990109317f, - -0.9986226754383176f, - -0.9986295347545739f, - -0.9986363769595828f, - -0.9986432020532272f, - -0.9986500100353901f, - -0.998656800905955f, - -0.9986635746648053f, - -0.998670331311825f, - -0.9986770708468985f, - -0.9986837932699101f, - -0.9986904985807449f, - -0.9986971867792875f, - -0.9987038578654238f, - -0.9987105118390394f, - -0.99871714870002f, - -0.9987237684482522f, - -0.9987303710836224f, - -0.9987369566060175f, - -0.9987435250153247f, - -0.9987500763114313f, - -0.9987566104942253f, - -0.9987631275635945f, - -0.9987696275194275f, - -0.9987761103616126f, - -0.998782576090039f, - -0.9987890247045957f, - -0.9987954562051724f, - -0.9988018705916587f, - -0.9988082678639448f, - -0.9988146480219211f, - -0.9988210110654783f, - -0.9988273569945072f, - -0.9988336858088992f, - -0.9988399975085459f, - -0.9988462920933391f, - -0.9988525695631708f, - -0.9988588299179337f, - -0.9988650731575204f, - -0.9988712992818238f, - -0.9988775082907375f, - -0.998883700184155f, - -0.99888987496197f, - -0.9988960326240769f, - -0.9989021731703701f, - -0.9989082966007445f, - -0.998914402915095f, - -0.9989204921133172f, - -0.9989265641953066f, - -0.9989326191609592f, - -0.9989386570101713f, - -0.9989446777428392f, - -0.9989506813588601f, - -0.9989566678581309f, - -0.9989626372405491f, - -0.9989685895060123f, - -0.9989745246544187f, - -0.9989804426856664f, - -0.9989863435996542f, - -0.9989922273962809f, - -0.9989980940754456f, - -0.9990039436370479f, - -0.9990097760809875f, - -0.9990155914071644f, - -0.9990213896154793f, - -0.9990271707058322f, - -0.9990329346781247f, - -0.9990386815322577f, - -0.9990444112681328f, - -0.9990501238856517f, - -0.9990558193847169f, - -0.9990614977652303f, - -0.999067159027095f, - -0.9990728031702136f, - -0.9990784301944899f, - -0.9990840400998271f, - -0.9990896328861292f, - -0.9990952085533004f, - -0.999100767101245f, - -0.9991063085298679f, - -0.9991118328390742f, - -0.9991173400287692f, - -0.9991228300988584f, - -0.9991283030492478f, - -0.9991337588798437f, - -0.9991391975905526f, - -0.9991446191812813f, - -0.9991500236519367f, - -0.9991554110024267f, - -0.9991607812326584f, - -0.9991661343425401f, - -0.9991714703319801f, - -0.9991767892008868f, - -0.9991820909491692f, - -0.9991873755767364f, - -0.9991926430834979f, - -0.9991978934693634f, - -0.9992031267342429f, - -0.9992083428780468f, - -0.9992135419006857f, - -0.9992187238020704f, - -0.9992238885821124f, - -0.9992290362407229f, - -0.9992341667778138f, - -0.9992392801932973f, - -0.9992443764870856f, - -0.9992494556590916f, - -0.999254517709228f, - -0.9992595626374082f, - -0.9992645904435459f, - -0.9992696011275547f, - -0.9992745946893489f, - -0.9992795711288428f, - -0.9992845304459512f, - -0.9992894726405892f, - -0.9992943977126721f, - -0.9992993056621154f, - -0.9993041964888351f, - -0.9993090701927473f, - -0.9993139267737686f, - -0.9993187662318158f, - -0.9993235885668059f, - -0.9993283937786562f, - -0.9993331818672846f, - -0.9993379528326087f, - -0.9993427066745472f, - -0.9993474433930183f, - -0.9993521629879409f, - -0.9993568654592342f, - -0.9993615508068177f, - -0.9993662190306107f, - -0.9993708701305338f, - -0.999375504106507f, - -0.999380120958451f, - -0.9993847206862865f, - -0.9993893032899348f, - -0.9993938687693175f, - -0.9993984171243561f, - -0.9994029483549729f, - -0.9994074624610901f, - -0.9994119594426306f, - -0.9994164392995171f, - -0.9994209020316729f, - -0.9994253476390215f, - -0.9994297761214869f, - -0.9994341874789929f, - -0.9994385817114643f, - -0.9994429588188255f, - -0.9994473188010017f, - -0.999451661657918f, - -0.9994559873895001f, - -0.999460295995674f, - -0.9994645874763657f, - -0.9994688618315016f, - -0.9994731190610087f, - -0.9994773591648138f, - -0.9994815821428444f, - -0.9994857879950282f, - -0.999489976721293f, - -0.999494148321567f, - -0.9994983027957789f, - -0.9995024401438574f, - -0.9995065603657316f, - -0.9995106634613309f, - -0.9995147494305849f, - -0.9995188182734238f, - -0.9995228699897779f, - -0.9995269045795775f, - -0.9995309220427536f, - -0.9995349223792375f, - -0.9995389055889605f, - -0.9995428716718544f, - -0.9995468206278512f, - -0.9995507524568833f, - -0.9995546671588833f, - -0.999558564733784f, - -0.9995624451815189f, - -0.9995663085020212f, - -0.999570154695225f, - -0.9995739837610641f, - -0.9995777956994731f, - -0.9995815905103866f, - -0.9995853681937397f, - -0.9995891287494675f, - -0.9995928721775056f, - -0.9995965984777899f, - -0.9996003076502565f, - -0.9996039996948419f, - -0.9996076746114829f, - -0.9996113324001163f, - -0.9996149730606797f, - -0.9996185965931106f, - -0.9996222029973468f, - -0.9996257922733267f, - -0.9996293644209887f, - -0.9996329194402717f, - -0.9996364573311145f, - -0.9996399780934567f, - -0.999643481727238f, - -0.9996469682323983f, - -0.9996504376088778f, - -0.9996538898566173f, - -0.9996573249755573f, - -0.9996607429656391f, - -0.9996641438268041f, - -0.9996675275589942f, - -0.9996708941621513f, - -0.9996742436362176f, - -0.9996775759811358f, - -0.9996808911968489f, - -0.9996841892832999f, - -0.9996874702404326f, - -0.9996907340681903f, - -0.9996939807665175f, - -0.9996972103353584f, - -0.9997004227746578f, - -0.9997036180843604f, - -0.9997067962644115f, - -0.9997099573147569f, - -0.9997131012353422f, - -0.9997162280261135f, - -0.9997193376870174f, - -0.9997224302180006f, - -0.99972550561901f, - -0.9997285638899929f, - -0.999731605030897f, - -0.99973462904167f, - -0.9997376359222604f, - -0.9997406256726165f, - -0.9997435982926869f, - -0.9997465537824209f, - -0.9997494921417679f, - -0.9997524133706773f, - -0.9997553174690993f, - -0.999758204436984f, - -0.999761074274282f, - -0.9997639269809441f, - -0.9997667625569213f, - -0.9997695810021652f, - -0.9997723823166274f, - -0.99977516650026f, - -0.9997779335530151f, - -0.9997806834748455f, - -0.9997834162657039f, - -0.9997861319255437f, - -0.9997888304543181f, - -0.9997915118519811f, - -0.9997941761184866f, - -0.999796823253789f, - -0.9997994532578429f, - -0.9998020661306034f, - -0.9998046618720255f, - -0.9998072404820648f, - -0.9998098019606773f, - -0.9998123463078188f, - -0.9998148735234459f, - -0.9998173836075153f, - -0.9998198765599838f, - -0.999822352380809f, - -0.9998248110699482f, - -0.9998272526273595f, - -0.9998296770530009f, - -0.9998320843468308f, - -0.999834474508808f, - -0.9998368475388918f, - -0.9998392034370412f, - -0.999841542203216f, - -0.9998438638373761f, - -0.9998461683394817f, - -0.9998484557094933f, - -0.9998507259473718f, - -0.9998529790530782f, - -0.9998552150265739f, - -0.9998574338678207f, - -0.9998596355767804f, - -0.9998618201534154f, - -0.9998639875976882f, - -0.9998661379095618f, - -0.9998682710889991f, - -0.9998703871359639f, - -0.9998724860504196f, - -0.9998745678323304f, - -0.9998766324816606f, - -0.9998786799983749f, - -0.999880710382438f, - -0.9998827236338154f, - -0.9998847197524724f, - -0.9998866987383749f, - -0.9998886605914888f, - -0.9998906053117809f, - -0.9998925328992174f, - -0.9998944433537655f, - -0.9998963366753925f, - -0.9998982128640659f, - -0.9999000719197535f, - -0.9999019138424236f, - -0.9999037386320444f, - -0.999905546288585f, - -0.9999073368120139f, - -0.999909110202301f, - -0.9999108664594155f, - -0.9999126055833274f, - -0.999914327574007f, - -0.9999160324314248f, - -0.9999177201555514f, - -0.999919390746358f, - -0.9999210442038161f, - -0.9999226805278972f, - -0.9999242997185733f, - -0.9999259017758166f, - -0.9999274866995999f, - -0.9999290544898957f, - -0.9999306051466773f, - -0.9999321386699181f, - -0.999933655059592f, - -0.9999351543156727f, - -0.9999366364381348f, - -0.9999381014269527f, - -0.9999395492821014f, - -0.999940980003556f, - -0.9999423935912921f, - -0.9999437900452854f, - -0.9999451693655121f, - -0.9999465315519485f, - -0.9999478766045711f, - -0.999949204523357f, - -0.9999505153082835f, - -0.999951808959328f, - -0.9999530854764684f, - -0.9999543448596829f, - -0.9999555871089498f, - -0.9999568122242479f, - -0.9999580202055561f, - -0.9999592110528538f, - -0.9999603847661206f, - -0.9999615413453363f, - -0.9999626807904812f, - -0.9999638031015358f, - -0.9999649082784806f, - -0.999965996321297f, - -0.9999670672299661f, - -0.9999681210044697f, - -0.9999691576447897f, - -0.9999701771509083f, - -0.9999711795228081f, - -0.9999721647604719f, - -0.9999731328638829f, - -0.9999740838330242f, - -0.9999750176678799f, - -0.9999759343684338f, - -0.9999768339346702f, - -0.9999777163665737f, - -0.9999785816641292f, - -0.9999794298273218f, - -0.9999802608561371f, - -0.9999810747505607f, - -0.9999818715105789f, - -0.9999826511361778f, - -0.9999834136273441f, - -0.9999841589840648f, - -0.999984887206327f, - -0.9999855982941185f, - -0.9999862922474267f, - -0.9999869690662402f, - -0.9999876287505469f, - -0.999988271300336f, - -0.999988896715596f, - -0.9999895049963164f, - -0.9999900961424869f, - -0.9999906701540973f, - -0.9999912270311376f, - -0.9999917667735985f, - -0.9999922893814706f, - -0.999992794854745f, - -0.999993283193413f, - -0.9999937543974662f, - -0.9999942084668966f, - -0.9999946454016965f, - -0.9999950652018582f, - -0.9999954678673746f, - -0.9999958533982388f, - -0.9999962217944444f, - -0.9999965730559848f, - -0.999996907182854f, - -0.9999972241750464f, - -0.9999975240325565f, - -0.9999978067553793f, - -0.9999980723435097f, - -0.9999983207969434f, - -0.999998552115676f, - -0.9999987662997035f, - -0.9999989633490224f, - -0.9999991432636292f, - -0.9999993060435208f, - -0.9999994516886945f, - -0.9999995801991477f, - -0.9999996915748783f, - -0.9999997858158843f, - -0.9999998629221643f, - -0.9999999228937166f, - -0.9999999657305405f, - -0.9999999914326351f, - -1.0f, - -0.9999999914326351f, - -0.9999999657305405f, - -0.9999999228937166f, - -0.9999998629221643f, - -0.9999997858158843f, - -0.9999996915748783f, - -0.9999995801991477f, - -0.9999994516886945f, - -0.9999993060435208f, - -0.9999991432636292f, - -0.9999989633490224f, - -0.9999987662997035f, - -0.999998552115676f, - -0.9999983207969434f, - -0.9999980723435097f, - -0.9999978067553793f, - -0.9999975240325565f, - -0.9999972241750464f, - -0.999996907182854f, - -0.9999965730559848f, - -0.9999962217944444f, - -0.9999958533982388f, - -0.9999954678673746f, - -0.9999950652018582f, - -0.9999946454016965f, - -0.9999942084668966f, - -0.9999937543974662f, - -0.999993283193413f, - -0.999992794854745f, - -0.9999922893814706f, - -0.9999917667735985f, - -0.9999912270311376f, - -0.9999906701540973f, - -0.9999900961424869f, - -0.9999895049963164f, - -0.999988896715596f, - -0.999988271300336f, - -0.9999876287505469f, - -0.9999869690662402f, - -0.9999862922474267f, - -0.9999855982941185f, - -0.999984887206327f, - -0.9999841589840648f, - -0.9999834136273441f, - -0.9999826511361778f, - -0.9999818715105789f, - -0.9999810747505607f, - -0.9999802608561371f, - -0.9999794298273218f, - -0.9999785816641292f, - -0.9999777163665737f, - -0.9999768339346702f, - -0.9999759343684338f, - -0.9999750176678799f, - -0.9999740838330242f, - -0.9999731328638829f, - -0.9999721647604719f, - -0.9999711795228081f, - -0.9999701771509083f, - -0.9999691576447897f, - -0.9999681210044697f, - -0.9999670672299661f, - -0.999965996321297f, - -0.9999649082784806f, - -0.9999638031015358f, - -0.9999626807904812f, - -0.9999615413453363f, - -0.9999603847661206f, - -0.9999592110528538f, - -0.9999580202055561f, - -0.9999568122242479f, - -0.9999555871089498f, - -0.9999543448596829f, - -0.9999530854764684f, - -0.999951808959328f, - -0.9999505153082835f, - -0.999949204523357f, - -0.9999478766045711f, - -0.9999465315519485f, - -0.9999451693655121f, - -0.9999437900452854f, - -0.9999423935912921f, - -0.999940980003556f, - -0.9999395492821014f, - -0.9999381014269527f, - -0.9999366364381348f, - -0.9999351543156727f, - -0.999933655059592f, - -0.9999321386699181f, - -0.9999306051466773f, - -0.9999290544898957f, - -0.9999274866995999f, - -0.9999259017758166f, - -0.9999242997185733f, - -0.9999226805278972f, - -0.9999210442038161f, - -0.999919390746358f, - -0.9999177201555515f, - -0.9999160324314248f, - -0.999914327574007f, - -0.9999126055833274f, - -0.9999108664594155f, - -0.999909110202301f, - -0.9999073368120139f, - -0.999905546288585f, - -0.9999037386320444f, - -0.9999019138424236f, - -0.9999000719197535f, - -0.9998982128640659f, - -0.9998963366753925f, - -0.9998944433537655f, - -0.9998925328992174f, - -0.9998906053117809f, - -0.9998886605914888f, - -0.9998866987383749f, - -0.9998847197524724f, - -0.9998827236338154f, - -0.999880710382438f, - -0.9998786799983749f, - -0.9998766324816606f, - -0.9998745678323304f, - -0.9998724860504196f, - -0.9998703871359639f, - -0.9998682710889991f, - -0.9998661379095618f, - -0.9998639875976882f, - -0.9998618201534154f, - -0.9998596355767804f, - -0.9998574338678207f, - -0.9998552150265739f, - -0.9998529790530782f, - -0.9998507259473718f, - -0.9998484557094933f, - -0.9998461683394817f, - -0.9998438638373761f, - -0.9998415422032161f, - -0.9998392034370412f, - -0.9998368475388918f, - -0.9998344745088081f, - -0.9998320843468308f, - -0.9998296770530009f, - -0.9998272526273595f, - -0.9998248110699482f, - -0.999822352380809f, - -0.9998198765599838f, - -0.9998173836075153f, - -0.9998148735234459f, - -0.9998123463078188f, - -0.9998098019606773f, - -0.9998072404820648f, - -0.9998046618720255f, - -0.9998020661306034f, - -0.9997994532578429f, - -0.999796823253789f, - -0.9997941761184866f, - -0.9997915118519811f, - -0.9997888304543181f, - -0.9997861319255437f, - -0.9997834162657039f, - -0.9997806834748455f, - -0.9997779335530151f, - -0.99977516650026f, - -0.9997723823166274f, - -0.9997695810021652f, - -0.9997667625569213f, - -0.9997639269809441f, - -0.999761074274282f, - -0.999758204436984f, - -0.9997553174690993f, - -0.9997524133706773f, - -0.9997494921417679f, - -0.9997465537824209f, - -0.9997435982926869f, - -0.9997406256726165f, - -0.9997376359222604f, - -0.9997346290416701f, - -0.999731605030897f, - -0.9997285638899929f, - -0.99972550561901f, - -0.9997224302180006f, - -0.9997193376870174f, - -0.9997162280261135f, - -0.9997131012353422f, - -0.9997099573147569f, - -0.9997067962644115f, - -0.9997036180843604f, - -0.9997004227746578f, - -0.9996972103353584f, - -0.9996939807665175f, - -0.9996907340681904f, - -0.9996874702404326f, - -0.9996841892832999f, - -0.9996808911968489f, - -0.9996775759811358f, - -0.9996742436362176f, - -0.9996708941621513f, - -0.9996675275589942f, - -0.9996641438268042f, - -0.9996607429656391f, - -0.9996573249755573f, - -0.9996538898566173f, - -0.9996504376088778f, - -0.9996469682323983f, - -0.999643481727238f, - -0.9996399780934567f, - -0.9996364573311145f, - -0.9996329194402717f, - -0.9996293644209887f, - -0.9996257922733267f, - -0.9996222029973468f, - -0.9996185965931106f, - -0.9996149730606797f, - -0.9996113324001163f, - -0.9996076746114829f, - -0.9996039996948419f, - -0.9996003076502565f, - -0.9995965984777899f, - -0.9995928721775056f, - -0.9995891287494675f, - -0.9995853681937397f, - -0.9995815905103868f, - -0.9995777956994731f, - -0.9995739837610642f, - -0.999570154695225f, - -0.9995663085020213f, - -0.9995624451815189f, - -0.999558564733784f, - -0.9995546671588833f, - -0.9995507524568833f, - -0.9995468206278513f, - -0.9995428716718544f, - -0.9995389055889605f, - -0.9995349223792375f, - -0.9995309220427537f, - -0.9995269045795775f, - -0.9995228699897779f, - -0.9995188182734238f, - -0.9995147494305849f, - -0.9995106634613309f, - -0.9995065603657316f, - -0.9995024401438574f, - -0.9994983027957789f, - -0.999494148321567f, - -0.999489976721293f, - -0.9994857879950282f, - -0.9994815821428444f, - -0.9994773591648138f, - -0.9994731190610087f, - -0.9994688618315016f, - -0.9994645874763657f, - -0.999460295995674f, - -0.9994559873895001f, - -0.999451661657918f, - -0.9994473188010017f, - -0.9994429588188255f, - -0.9994385817114643f, - -0.9994341874789929f, - -0.9994297761214869f, - -0.9994253476390216f, - -0.9994209020316729f, - -0.9994164392995171f, - -0.9994119594426306f, - -0.9994074624610901f, - -0.9994029483549729f, - -0.9993984171243561f, - -0.9993938687693175f, - -0.9993893032899348f, - -0.9993847206862865f, - -0.999380120958451f, - -0.999375504106507f, - -0.9993708701305338f, - -0.9993662190306108f, - -0.9993615508068177f, - -0.9993568654592342f, - -0.9993521629879409f, - -0.9993474433930183f, - -0.9993427066745472f, - -0.9993379528326088f, - -0.9993331818672846f, - -0.9993283937786562f, - -0.9993235885668059f, - -0.9993187662318158f, - -0.9993139267737687f, - -0.9993090701927474f, - -0.9993041964888351f, - -0.9992993056621154f, - -0.9992943977126721f, - -0.9992894726405892f, - -0.9992845304459512f, - -0.9992795711288428f, - -0.9992745946893489f, - -0.9992696011275547f, - -0.9992645904435459f, - -0.9992595626374082f, - -0.999254517709228f, - -0.9992494556590916f, - -0.9992443764870856f, - -0.9992392801932973f, - -0.999234166777814f, - -0.9992290362407229f, - -0.9992238885821124f, - -0.9992187238020706f, - -0.9992135419006857f, - -0.9992083428780468f, - -0.9992031267342429f, - -0.9991978934693634f, - -0.9991926430834979f, - -0.9991873755767364f, - -0.9991820909491692f, - -0.9991767892008868f, - -0.9991714703319801f, - -0.9991661343425401f, - -0.9991607812326584f, - -0.9991554110024267f, - -0.9991500236519368f, - -0.9991446191812813f, - -0.9991391975905526f, - -0.9991337588798438f, - -0.9991283030492478f, - -0.9991228300988584f, - -0.9991173400287692f, - -0.9991118328390742f, - -0.9991063085298679f, - -0.999100767101245f, - -0.9990952085533004f, - -0.9990896328861292f, - -0.9990840400998271f, - -0.9990784301944899f, - -0.9990728031702137f, - -0.999067159027095f, - -0.9990614977652303f, - -0.9990558193847169f, - -0.9990501238856518f, - -0.9990444112681328f, - -0.9990386815322577f, - -0.9990329346781247f, - -0.9990271707058322f, - -0.9990213896154793f, - -0.9990155914071644f, - -0.9990097760809875f, - -0.9990039436370479f, - -0.9989980940754456f, - -0.9989922273962809f, - -0.9989863435996542f, - -0.9989804426856664f, - -0.9989745246544187f, - -0.9989685895060123f, - -0.9989626372405491f, - -0.998956667858131f, - -0.9989506813588601f, - -0.9989446777428392f, - -0.9989386570101713f, - -0.9989326191609592f, - -0.9989265641953067f, - -0.9989204921133172f, - -0.9989144029150951f, - -0.9989082966007445f, - -0.9989021731703701f, - -0.9988960326240769f, - -0.99888987496197f, - -0.998883700184155f, - -0.9988775082907375f, - -0.9988712992818239f, - -0.9988650731575204f, - -0.9988588299179337f, - -0.9988525695631708f, - -0.9988462920933391f, - -0.9988399975085459f, - -0.9988336858088993f, - -0.9988273569945072f, - -0.9988210110654783f, - -0.9988146480219211f, - -0.9988082678639448f, - -0.9988018705916587f, - -0.9987954562051724f, - -0.9987890247045957f, - -0.9987825760900391f, - -0.9987761103616127f, - -0.9987696275194275f, - -0.9987631275635946f, - -0.9987566104942254f, - -0.9987500763114314f, - -0.9987435250153247f, - -0.9987369566060175f, - -0.9987303710836224f, - -0.9987237684482522f, - -0.99871714870002f, - -0.9987105118390394f, - -0.9987038578654238f, - -0.9986971867792876f, - -0.9986904985807449f, - -0.9986837932699102f, - -0.9986770708468985f, - -0.998670331311825f, - -0.9986635746648053f, - -0.998656800905955f, - -0.9986500100353901f, - -0.9986432020532272f, - -0.9986363769595828f, - -0.9986295347545739f, - -0.9986226754383176f, - -0.9986157990109317f, - -0.9986089054725338f, - -0.9986019948232421f, - -0.9985950670631749f, - -0.9985881221924512f, - -0.9985811602111896f, - -0.9985741811195098f, - -0.998567184917531f, - -0.9985601716053734f, - -0.998553141183157f, - -0.9985460936510022f, - -0.9985390290090299f, - -0.9985319472573612f, - -0.9985248483961172f, - -0.9985177324254199f, - -0.9985105993453908f, - -0.9985034491561524f, - -0.9984962818578272f, - -0.9984890974505379f, - -0.9984818959344077f, - -0.9984746773095601f, - -0.9984674415761184f, - -0.998460188734207f, - -0.9984529187839499f, - -0.998445631725472f, - -0.9984383275588977f, - -0.9984310062843526f, - -0.9984236679019618f, - -0.9984163124118512f, - -0.9984089398141468f, - -0.998401550108975f, - -0.9983941432964625f, - -0.9983867193767358f, - -0.9983792783499226f, - -0.9983718202161501f, - -0.9983643449755463f, - -0.9983568526282389f, - -0.9983493431743568f, - -0.9983418166140283f, - -0.9983342729473826f, - -0.9983267121745487f, - -0.9983191342956564f, - -0.9983115393108355f, - -0.998303927220216f, - -0.9982962980239283f, - -0.9982886517221033f, - -0.998280988314872f, - -0.9982733078023657f, - -0.9982656101847159f, - -0.9982578954620546f, - -0.9982501636345139f, - -0.9982424147022264f, - -0.9982346486653247f, - -0.9982268655239421f, - -0.9982190652782118f, - -0.9982112479282675f, - -0.9982034134742431f, - -0.9981955619162729f, - -0.9981876932544914f, - -0.9981798074890336f, - -0.9981719046200344f, - -0.9981639846476292f, - -0.9981560475719538f, - -0.9981480933931443f, - -0.9981401221113367f, - -0.9981321337266679f, - -0.9981241282392745f, - -0.9981161056492941f, - -0.9981080659568636f, - -0.9981000091621212f, - -0.9980919352652047f, - -0.9980838442662526f, - -0.9980757361654035f, - -0.9980676109627962f, - -0.9980594686585701f, - -0.9980513092528646f, - -0.9980431327458196f, - -0.9980349391375751f, - -0.9980267284282716f, - -0.9980185006180496f, - -0.9980102557070504f, - -0.9980019936954151f, - -0.9979937145832851f, - -0.9979854183708025f, - -0.9979771050581093f, - -0.9979687746453482f, - -0.9979604271326616f, - -0.9979520625201928f, - -0.9979436808080849f, - -0.9979352819964817f, - -0.997926866085527f, - -0.9979184330753651f, - -0.9979099829661405f, - -0.9979015157579979f, - -0.9978930314510824f, - -0.9978845300455393f, - -0.9978760115415145f, - -0.9978674759391538f, - -0.9978589232386036f, - -0.9978503534400102f, - -0.9978417665435205f, - -0.9978331625492818f, - -0.9978245414574415f, - -0.9978159032681472f, - -0.997807247981547f, - -0.9977985755977891f, - -0.9977898861170222f, - -0.9977811795393952f, - -0.9977724558650571f, - -0.9977637150941576f, - -0.9977549572268465f, - -0.9977461822632737f, - -0.9977373902035898f, - -0.9977285810479449f, - -0.9977197547964906f, - -0.9977109114493777f, - -0.997702051006758f, - -0.9976931734687832f, - -0.9976842788356053f, - -0.9976753671073769f, - -0.9976664382842506f, - -0.9976574923663794f, - -0.9976485293539166f, - -0.9976395492470157f, - -0.9976305520458307f, - -0.9976215377505158f, - -0.9976125063612252f, - -0.997603457878114f, - -0.997594392301337f, - -0.9975853096310495f, - -0.9975762098674072f, - -0.9975670930105662f, - -0.9975579590606826f, - -0.9975488080179128f, - -0.9975396398824137f, - -0.9975304546543423f, - -0.997521252333856f, - -0.9975120329211127f, - -0.9975027964162702f, - -0.9974935428194867f, - -0.9974842721309207f, - -0.9974749843507313f, - -0.9974656794790776f, - -0.9974563575161188f, - -0.9974470184620149f, - -0.9974376623169258f, - -0.9974282890810118f, - -0.9974188987544336f, - -0.9974094913373519f, - -0.9974000668299281f, - -0.9973906252323237f, - -0.9973811665447003f, - -0.99737169076722f, - -0.9973621979000453f, - -0.9973526879433389f, - -0.9973431608972635f, - -0.9973336167619825f, - -0.9973240555376595f, - -0.9973144772244581f, - -0.9973048818225427f, - -0.9972952693320775f, - -0.9972856397532273f, - -0.9972759930861571f, - -0.9972663293310322f, - -0.9972566484880182f, - -0.997246950557281f, - -0.9972372355389866f, - -0.9972275034333016f, - -0.9972177542403927f, - -0.9972079879604271f, - -0.997198204593572f, - -0.997188404139995f, - -0.9971785865998642f, - -0.9971687519733476f, - -0.9971589002606139f, - -0.9971490314618319f, - -0.9971391455771706f, - -0.9971292426067994f, - -0.997119322550888f, - -0.9971093854096064f, - -0.9970994311831248f, - -0.997089459871614f, - -0.9970794714752446f, - -0.9970694659941877f, - -0.997059443428615f, - -0.9970494037786981f, - -0.9970393470446091f, - -0.99702927322652f, - -0.9970191823246038f, - -0.9970090743390334f, - -0.9969989492699818f, - -0.9969888071176224f, - -0.9969786478821293f, - -0.9969684715636763f, - -0.996958278162438f, - -0.9969480676785889f, - -0.9969378401123039f, - -0.9969275954637584f, - -0.9969173337331281f, - -0.9969070549205883f, - -0.9968967590263156f, - -0.9968864460504862f, - -0.996876115993277f, - -0.9968657688548647f, - -0.9968554046354268f, - -0.9968450233351409f, - -0.9968346249541847f, - -0.9968242094927366f, - -0.9968137769509751f, - -0.9968033273290787f, - -0.9967928606272266f, - -0.9967823768455981f, - -0.996771875984373f, - -0.996761358043731f, - -0.9967508230238523f, - -0.9967402709249177f, - -0.9967297017471078f, - -0.9967191154906038f, - -0.9967085121555869f, - -0.996697891742239f, - -0.9966872542507419f, - -0.9966765996812781f, - -0.9966659280340299f, - -0.9966552393091803f, - -0.9966445335069125f, - -0.9966338106274099f, - -0.9966230706708561f, - -0.9966123136374353f, - -0.9966015395273317f, - -0.9965907483407301f, - -0.9965799400778151f, - -0.9965691147387722f, - -0.9965582723237866f, - -0.9965474128330444f, - -0.9965365362667313f, - -0.9965256426250341f, - -0.9965147319081391f, - -0.9965038041162335f, - -0.9964928592495044f, - -0.9964818973081393f, - -0.996470918292326f, - -0.996459922202253f, - -0.9964489090381083f, - -0.9964378788000807f, - -0.9964268314883593f, - -0.9964157671031334f, - -0.9964046856445924f, - -0.9963935871129264f, - -0.9963824715083254f, - -0.99637133883098f, - -0.9963601890810808f, - -0.996349022258819f, - -0.9963378383643859f, - -0.996326637397973f, - -0.9963154193597725f, - -0.9963041842499764f, - -0.9962929320687772f, - -0.9962816628163678f, - -0.9962703764929413f, - -0.996259073098691f, - -0.9962477526338107f, - -0.9962364150984943f, - -0.996225060492936f, - -0.9962136888173305f, - -0.9962023000718726f, - -0.9961908942567572f, - -0.9961794713721802f, - -0.996168031418337f, - -0.9961565743954238f, - -0.9961451003036367f, - -0.9961336091431725f, - -0.9961221009142279f, - -0.9961105756170004f, - -0.9960990332516872f, - -0.9960874738184862f, - -0.9960758973175954f, - -0.9960643037492132f, - -0.9960526931135383f, - -0.9960410654107696f, - -0.9960294206411062f, - -0.996017758804748f, - -0.9960060799018945f, - -0.9959943839327459f, - -0.9959826708975025f, - -0.9959709407963652f, - -0.9959591936295349f, - -0.9959474293972129f, - -0.9959356480996007f, - -0.9959238497369003f, - -0.9959120343093137f, - -0.9959002018170436f, - -0.9958883522602925f, - -0.9958764856392636f, - -0.9958646019541602f, - -0.9958527012051858f, - -0.9958407833925443f, - -0.9958288485164402f, - -0.9958168965770777f, - -0.9958049275746618f, - -0.9957929415093975f, - -0.99578093838149f, - -0.9957689181911453f, - -0.9957568809385691f, - -0.9957448266239679f, - -0.995732755247548f, - -0.9957206668095164f, - -0.9957085613100801f, - -0.9956964387494468f, - -0.9956842991278239f, - -0.9956721424454195f, - -0.9956599687024418f, - -0.9956477778990999f, - -0.9956355700356019f, - -0.9956233451121577f, - -0.9956111031289762f, - -0.9955988440862675f, - -0.9955865679842417f, - -0.995574274823109f, - -0.99556196460308f, - -0.9955496373243657f, - -0.9955372929871774f, - -0.9955249315917265f, - -0.9955125531382248f, - -0.9955001576268845f, - -0.9954877450579179f, - -0.9954753154315379f, - -0.9954628687479571f, - -0.9954504050073891f, - -0.9954379242100473f, - -0.9954254263561456f, - -0.9954129114458982f, - -0.9954003794795194f, - -0.995387830457224f, - -0.9953752643792272f, - -0.9953626812457439f, - -0.9953500810569902f, - -0.9953374638131817f, - -0.9953248295145345f, - -0.9953121781612654f, - -0.995299509753591f, - -0.9952868242917284f, - -0.9952741217758949f, - -0.9952614022063083f, - -0.9952486655831865f, - -0.9952359119067475f, - -0.9952231411772101f, - -0.9952103533947932f, - -0.9951975485597157f, - -0.9951847266721969f, - -0.9951718877324568f, - -0.9951590317407152f, - -0.9951461586971925f, - -0.9951332686021093f, - -0.9951203614556862f, - -0.9951074372581447f, - -0.995094496009706f, - -0.995081537710592f, - -0.9950685623610246f, - -0.9950555699612263f, - -0.9950425605114197f, - -0.9950295340118276f, - -0.9950164904626732f, - -0.99500342986418f, - -0.9949903522165718f, - -0.994977257520073f, - -0.9949641457749074f, - -0.9949510169813002f, - -0.994937871139476f, - -0.9949247082496603f, - -0.9949115283120783f, - -0.9948983313269562f, - -0.9948851172945198f, - -0.9948718862149959f, - -0.9948586380886109f, - -0.9948453729155919f, - -0.9948320906961663f, - -0.9948187914305615f, - -0.9948054751190055f, - -0.9947921417617265f, - -0.9947787913589529f, - -0.9947654239109133f, - -0.9947520394178371f, - -0.9947386378799533f, - -0.9947252192974918f, - -0.9947117836706824f, - -0.9946983309997552f, - -0.9946848612849409f, - -0.9946713745264703f, - -0.9946578707245742f, - -0.9946443498794845f, - -0.9946308119914324f, - -0.9946172570606501f, - -0.9946036850873697f, - -0.994590096071824f, - -0.9945764900142456f, - -0.9945628669148678f, - -0.994549226773924f, - -0.9945355695916478f, - -0.9945218953682733f, - -0.994508204104035f, - -0.994494495799167f, - -0.9944807704539047f, - -0.994467028068483f, - -0.9944532686431375f, - -0.9944394921781038f, - -0.9944256986736181f, - -0.9944118881299167f, - -0.9943980605472363f, - -0.9943842159258137f, - -0.9943703542658863f, - -0.9943564755676915f, - -0.994342579831467f, - -0.9943286670574512f, - -0.9943147372458823f, - -0.9943007903969988f, - -0.9942868265110402f, - -0.9942728455882452f, - -0.9942588476288537f, - -0.9942448326331054f, - -0.9942308006012406f, - -0.9942167515334995f, - -0.9942026854301231f, - -0.9941886022913522f, - -0.9941745021174282f, - -0.9941603849085927f, - -0.9941462506650877f, - -0.994132099387155f, - -0.9941179310750375f, - -0.994103745728978f, - -0.9940895433492192f, - -0.9940753239360046f, - -0.9940610874895779f, - -0.9940468340101831f, - -0.9940325634980642f, - -0.9940182759534663f, - -0.9940039713766333f, - -0.993989649767811f, - -0.9939753111272445f, - -0.9939609554551798f, - -0.9939465827518624f, - -0.993932193017539f, - -0.9939177862524559f, - -0.9939033624568602f, - -0.9938889216309986f, - -0.993874463775119f, - -0.993859988889469f, - -0.9938454969742966f, - -0.99383098802985f, - -0.9938164620563781f, - -0.9938019190541295f, - -0.9937873590233535f, - -0.9937727819642996f, - -0.9937581878772176f, - -0.9937435767623575f, - -0.9937289486199696f, - -0.9937143034503048f, - -0.9936996412536138f, - -0.9936849620301478f, - -0.9936702657801585f, - -0.9936555525038976f, - -0.9936408222016174f, - -0.99362607487357f, - -0.9936113105200084f, - -0.9935965291411853f, - -0.9935817307373542f, - -0.9935669153087685f, - -0.9935520828556822f, - -0.9935372333783494f, - -0.9935223668770244f, - -0.9935074833519622f, - -0.9934925828034176f, - -0.9934776652316459f, - -0.9934627306369028f, - -0.9934477790194444f, - -0.9934328103795266f, - -0.993417824717406f, - -0.9934028220333393f, - -0.9933878023275838f, - -0.9933727656003964f, - -0.9933577118520353f, - -0.9933426410827579f, - -0.993327553292823f, - -0.9933124484824887f, - -0.9932973266520139f, - -0.9932821878016578f, - -0.9932670319316798f, - -0.9932518590423395f, - -0.993236669133897f, - -0.9932214622066123f, - -0.9932062382607464f, - -0.9931909972965598f, - -0.9931757393143139f, - -0.9931604643142699f, - -0.9931451722966897f, - -0.9931298632618353f, - -0.9931145372099691f, - -0.9930991941413535f, - -0.9930838340562514f, - -0.9930684569549263f, - -0.9930530628376415f, - -0.9930376517046605f, - -0.9930222235562478f, - -0.9930067783926675f, - -0.9929913162141845f, - -0.9929758370210633f, - -0.9929603408135695f, - -0.9929448275919686f, - -0.9929292973565262f, - -0.9929137501075087f, - -0.9928981858451823f, - -0.9928826045698137f, - -0.9928670062816698f, - -0.9928513909810182f, - -0.9928357586681261f, - -0.9928201093432616f, - -0.9928044430066926f, - -0.9927887596586877f, - -0.9927730592995158f, - -0.9927573419294456f, - -0.9927416075487465f, - -0.9927258561576883f, - -0.9927100877565407f, - -0.9926943023455739f, - -0.9926784999250583f, - -0.992662680495265f, - -0.9926468440564647f, - -0.992630990608929f, - -0.9926151201529294f, - -0.992599232688738f, - -0.9925833282166268f, - -0.9925674067368684f, - -0.9925514682497356f, - -0.9925355127555017f, - -0.9925195402544397f, - -0.9925035507468238f, - -0.9924875442329275f, - -0.9924715207130254f, - -0.9924554801873917f, - -0.9924394226563018f, - -0.9924233481200302f, - -0.9924072565788528f, - -0.9923911480330451f, - -0.9923750224828832f, - -0.9923588799286435f, - -0.9923427203706023f, - -0.9923265438090367f, - -0.9923103502442241f, - -0.9922941396764415f, - -0.992277912105967f, - -0.9922616675330785f, - -0.9922454059580544f, - -0.9922291273811734f, - -0.9922128318027144f, - -0.9921965192229564f, - -0.9921801896421792f, - -0.9921638430606625f, - -0.9921474794786865f, - -0.9921310988965314f, - -0.9921147013144779f, - -0.992098286732807f, - -0.9920818551518f, - -0.9920654065717386f, - -0.9920489409929042f, - -0.9920324584155794f, - -0.9920159588400465f, - -0.991999442266588f, - -0.991982908695487f, - -0.991966358127027f, - -0.9919497905614914f, - -0.9919332059991642f, - -0.9919166044403294f, - -0.9918999858852715f, - -0.9918833503342753f, - -0.9918666977876262f, - -0.9918500282456089f, - -0.9918333417085093f, - -0.9918166381766134f, - -0.9917999176502075f, - -0.9917831801295778f, - -0.9917664256150113f, - -0.9917496541067949f, - -0.9917328656052162f, - -0.9917160601105629f, - -0.9916992376231227f, - -0.991682398143184f, - -0.9916655416710354f, - -0.9916486682069656f, - -0.9916317777512638f, - -0.9916148703042192f, - -0.9915979458661219f, - -0.9915810044372617f, - -0.9915640460179289f, - -0.9915470706084138f, - -0.9915300782090078f, - -0.9915130688200017f, - -0.9914960424416871f, - -0.9914789990743554f, - -0.9914619387182992f, - -0.9914448613738105f, - -0.9914277670411819f, - -0.9914106557207062f, - -0.991393527412677f, - -0.9913763821173874f, - -0.9913592198351313f, - -0.991342040566203f, - -0.9913248443108965f, - -0.9913076310695066f, - -0.9912904008423282f, - -0.9912731536296568f, - -0.9912558894317876f, - -0.9912386082490166f, - -0.9912213100816396f, - -0.9912039949299536f, - -0.9911866627942546f, - -0.9911693136748401f, - -0.9911519475720071f, - -0.9911345644860533f, - -0.9911171644172765f, - -0.9910997473659748f, - -0.9910823133324467f, - -0.991064862316991f, - -0.9910473943199066f, - -0.9910299093414928f, - -0.9910124073820492f, - -0.9909948884418758f, - -0.9909773525212727f, - -0.9909597996205405f, - -0.9909422297399796f, - -0.9909246428798915f, - -0.9909070390405772f, - -0.9908894182223388f, - -0.9908717804254776f, - -0.9908541256502963f, - -0.9908364538970971f, - -0.9908187651661832f, - -0.9908010594578572f, - -0.9907833367724228f, - -0.9907655971101837f, - -0.9907478404714437f, - -0.990730066856507f, - -0.9907122762656784f, - -0.9906944686992626f, - -0.9906766441575645f, - -0.99065880264089f, - -0.9906409441495445f, - -0.9906230686838341f, - -0.9906051762440649f, - -0.9905872668305437f, - -0.9905693404435773f, - -0.9905513970834728f, - -0.9905334367505377f, - -0.99051545944508f, - -0.9904974651674073f, - -0.9904794539178283f, - -0.9904614256966512f, - -0.9904433805041853f, - -0.9904253183407397f, - -0.9904072392066238f, - -0.9903891431021473f, - -0.9903710300276206f, - -0.9903528999833537f, - -0.9903347529696576f, - -0.9903165889868428f, - -0.990298408035221f, - -0.9902802101151034f, - -0.9902619952268021f, - -0.9902437633706288f, - -0.9902255145468963f, - -0.990207248755917f, - -0.9901889659980043f, - -0.990170666273471f, - -0.9901523495826308f, - -0.9901340159257975f, - -0.9901156653032855f, - -0.990097297715409f, - -0.9900789131624829f, - -0.9900605116448219f, - -0.9900420931627416f, - -0.9900236577165575f, - -0.9900052053065856f, - -0.9899867359331418f, - -0.9899682495965428f, - -0.9899497462971054f, - -0.9899312260351465f, - -0.9899126888109835f, - -0.9898941346249338f, - -0.9898755634773158f, - -0.9898569753684473f, - -0.9898383702986471f, - -0.9898197482682336f, - -0.9898011092775263f, - -0.9897824533268443f, - -0.9897637804165075f, - -0.9897450905468356f, - -0.9897263837181489f, - -0.9897076599307681f, - -0.989688919185014f, - -0.9896701614812075f, - -0.9896513868196702f, - -0.9896325952007238f, - -0.9896137866246904f, - -0.9895949610918917f, - -0.989576118602651f, - -0.9895572591572906f, - -0.9895383827561344f, - -0.9895194893995048f, - -0.9895005790877265f, - -0.9894816518211228f, - -0.9894627076000185f, - -0.9894437464247379f, - -0.9894247682956061f, - -0.9894057732129481f, - -0.9893867611770896f, - -0.9893677321883562f, - -0.989348686247074f, - -0.9893296233535692f, - -0.9893105435081687f, - -0.9892914467111994f, - -0.9892723329629883f, - -0.989253202263863f, - -0.9892340546141515f, - -0.9892148900141817f, - -0.989195708464282f, - -0.9891765099647809f, - -0.9891572945160078f, - -0.9891380621182916f, - -0.9891188127719619f, - -0.9890995464773484f, - -0.9890802632347816f, - -0.9890609630445917f, - -0.9890416459071094f, - -0.9890223118226655f, - -0.9890029607915918f, - -0.9889835928142193f, - -0.9889642078908804f, - -0.9889448060219067f, - -0.988925387207631f, - -0.988905951448386f, - -0.9888864987445045f, - -0.9888670290963204f, - -0.9888475425041665f, - -0.9888280389683773f, - -0.9888085184892867f, - -0.9887889810672296f, - -0.9887694267025401f, - -0.9887498553955537f, - -0.9887302671466055f, - -0.9887106619560316f, - -0.9886910398241674f, - -0.9886714007513494f, - -0.988651744737914f, - -0.9886320717841981f, - -0.9886123818905388f, - -0.9885926750572733f, - -0.9885729512847394f, - -0.9885532105732752f, - -0.9885334529232187f, - -0.9885136783349086f, - -0.9884938868086836f, - -0.9884740783448829f, - -0.9884542529438458f, - -0.9884344106059124f, - -0.9884145513314222f, - -0.9883946751207159f, - -0.9883747819741336f, - -0.9883548718920168f, - -0.9883349448747059f, - -0.988315000922543f, - -0.9882950400358694f, - -0.9882750622150274f, - -0.9882550674603591f, - -0.9882350557722073f, - -0.9882150271509147f, - -0.9881949815968245f, - -0.9881749191102805f, - -0.9881548396916262f, - -0.9881347433412057f, - -0.9881146300593631f, - -0.9880944998464434f, - -0.9880743527027914f, - -0.9880541886287524f, - -0.9880340076246716f, - -0.9880138096908953f, - -0.987993594827769f, - -0.9879733630356395f, - -0.9879531143148532f, - -0.9879328486657574f, - -0.9879125660886992f, - -0.9878922665840258f, - -0.9878719501520854f, - -0.9878516167932261f, - -0.9878312665077962f, - -0.9878108992961445f, - -0.9877905151586197f, - -0.9877701140955714f, - -0.9877496961073491f, - -0.9877292611943026f, - -0.987708809356782f, - -0.9876883405951378f, - -0.9876678549097205f, - -0.9876473523008819f, - -0.9876268327689722f, - -0.9876062963143438f, - -0.9875857429373481f, - -0.9875651726383379f, - -0.987544585417665f, - -0.9875239812756824f, - -0.9875033602127432f, - -0.9874827222292007f, - -0.9874620673254088f, - -0.9874413955017208f, - -0.9874207067584914f, - -0.987400001096075f, - -0.9873792785148262f, - -0.9873585390151004f, - -0.9873377825972527f, - -0.9873170092616387f, - -0.9872962190086146f, - -0.9872754118385366f, - -0.9872545877517611f, - -0.9872337467486448f, - -0.987212888829545f, - -0.9871920139948193f, - -0.987171122244825f, - -0.98715021357992f, - -0.9871292880004631f, - -0.9871083455068124f, - -0.9870873860993269f, - -0.9870664097783656f, - -0.9870454165442881f, - -0.9870244063974541f, - -0.9870033793382236f, - -0.9869823353669567f, - -0.9869612744840143f, - -0.9869401966897569f, - -0.986919101984546f, - -0.9868979903687428f, - -0.9868768618427093f, - -0.9868557164068072f, - -0.9868345540613993f, - -0.9868133748068477f, - -0.9867921786435156f, - -0.986770965571766f, - -0.9867497355919628f, - -0.986728488704469f, - -0.9867072249096495f, - -0.986685944207868f, - -0.9866646465994896f, - -0.986643332084879f, - -0.9866220006644015f, - -0.9866006523384224f, - -0.9865792871073078f, - -0.9865579049714237f, - -0.9865365059311364f, - -0.9865150899868125f, - -0.9864936571388191f, - -0.9864722073875234f, - -0.986450740733293f, - -0.9864292571764954f, - -0.9864077567174993f, - -0.9863862393566726f, - -0.9863647050943842f, - -0.9863431539310031f, - -0.9863215858668984f, - -0.98630000090244f, - -0.9862783990379975f, - -0.986256780273941f, - -0.986235144610641f, - -0.9862134920484683f, - -0.9861918225877937f, - -0.986170136228989f, - -0.986148432972425f, - -0.9861267128184744f, - -0.9861049757675087f, - -0.9860832218199009f, - -0.9860614509760234f, - -0.9860396632362493f, - -0.9860178586009518f, - -0.9859960370705051f, - -0.9859741986452822f, - -0.9859523433256582f, - -0.9859304711120068f, - -0.9859085820047033f, - -0.9858866760041227f, - -0.9858647531106401f, - -0.9858428133246313f, - -0.9858208566464723f, - -0.9857988830765394f, - -0.9857768926152088f, - -0.9857548852628574f, - -0.9857328610198625f, - -0.9857108198866013f, - -0.9856887618634514f, - -0.9856666869507908f, - -0.985644595148998f, - -0.9856224864584514f, - -0.9856003608795296f, - -0.9855782184126118f, - -0.9855560590580777f, - -0.9855338828163068f, - -0.985511689687679f, - -0.9854894796725746f, - -0.9854672527713743f, - -0.9854450089844587f, - -0.9854227483122093f, - -0.9854004707550071f, - -0.9853781763132342f, - -0.9853558649872726f, - -0.9853335367775041f, - -0.985311191684312f, - -0.9852888297080786f, - -0.9852664508491874f, - -0.9852440551080216f, - -0.9852216424849654f, - -0.9851992129804023f, - -0.9851767665947169f, - -0.9851543033282936f, - -0.9851318231815176f, - -0.985109326154774f, - -0.9850868122484482f, - -0.9850642814629259f, - -0.9850417337985934f, - -0.9850191692558369f, - -0.9849965878350431f, - -0.9849739895365985f, - -0.9849513743608911f, - -0.984928742308308f, - -0.9849060933792368f, - -0.9848834275740658f, - -0.9848607448931834f, - -0.984838045336978f, - -0.9848153289058392f, - -0.9847925956001554f, - -0.9847698454203168f, - -0.9847470783667127f, - -0.9847242944397337f, - -0.9847014936397698f, - -0.9846786759672118f, - -0.9846558414224507f, - -0.984632990005878f, - -0.9846101217178848f, - -0.9845872365588633f, - -0.9845643345292054f, - -0.9845414156293036f, - -0.9845184798595508f, - -0.9844955272203397f, - -0.9844725577120638f, - -0.9844495713351163f, - -0.9844265680898917f, - -0.9844035479767836f, - -0.9843805109961868f, - -0.9843574571484958f, - -0.9843343864341058f, - -0.984311298853412f, - -0.9842881944068099f, - -0.9842650730946955f, - -0.984241934917465f, - -0.984218779875515f, - -0.984195607969242f, - -0.9841724191990431f, - -0.9841492135653157f, - -0.9841259910684576f, - -0.9841027517088663f, - -0.9840794954869402f, - -0.9840562224030779f, - -0.984032932457678f, - -0.9840096256511398f, - -0.9839863019838624f, - -0.9839629614562456f, - -0.9839396040686891f, - -0.9839162298215937f, - -0.9838928387153592f, - -0.9838694307503868f, - -0.9838460059270774f, - -0.9838225642458327f, - -0.983799105707054f, - -0.9837756303111435f, - -0.9837521380585031f, - -0.9837286289495358f, - -0.9837051029846443f, - -0.9836815601642316f, - -0.9836580004887009f, - -0.9836344239584562f, - -0.9836108305739015f, - -0.983587220335441f, - -0.983563593243479f, - -0.9835399492984206f, - -0.983516288500671f, - -0.9834926108506354f, - -0.9834689163487196f, - -0.9834452049953297f, - -0.9834214767908719f, - -0.9833977317357527f, - -0.9833739698303792f, - -0.9833501910751581f, - -0.9833263954704974f, - -0.9833025830168045f, - -0.9832787537144876f, - -0.9832549075639546f, - -0.9832310445656146f, - -0.9832071647198763f, - -0.9831832680271488f, - -0.9831593544878415f, - -0.9831354241023645f, - -0.9831114768711274f, - -0.9830875127945411f, - -0.9830635318730154f, - -0.983039534106962f, - -0.9830155194967916f, - -0.982991488042916f, - -0.9829674397457466f, - -0.9829433746056959f, - -0.9829192926231758f, - -0.9828951937985995f, - -0.9828710781323793f, - -0.9828469456249288f, - -0.9828227962766612f, - -0.9827986300879908f, - -0.9827744470593314f, - -0.9827502471910973f, - -0.9827260304837031f, - -0.982701796937564f, - -0.982677546553095f, - -0.9826532793307118f, - -0.98262899527083f, - -0.982604694373866f, - -0.982580376640236f, - -0.9825560420703566f, - -0.9825316906646449f, - -0.9825073224235181f, - -0.9824829373473939f, - -0.9824585354366899f, - -0.9824341166918242f, - -0.9824096811132156f, - -0.9823852287012824f, - -0.9823607594564437f, - -0.9823362733791187f, - -0.9823117704697271f, - -0.9822872507286887f, - -0.9822627141564235f, - -0.9822381607533525f, - -0.9822135905198955f, - -0.9821890034564743f, - -0.9821643995635095f, - -0.9821397788414236f, - -0.9821151412906375f, - -0.982090486911574f, - -0.982065815704655f, - -0.982041127670304f, - -0.9820164228089433f, - -0.9819917011209967f, - -0.9819669626068873f, - -0.9819422072670395f, - -0.9819174351018773f, - -0.9818926461118251f, - -0.9818678402973076f, - -0.9818430176587499f, - -0.9818181781965775f, - -0.9817933219112158f, - -0.9817684488030906f, - -0.9817435588726284f, - -0.9817186521202557f, - -0.981693728546399f, - -0.9816687881514853f, - -0.9816438309359423f, - -0.9816188569001973f, - -0.9815938660446788f, - -0.9815688583698141f, - -0.9815438338760325f, - -0.9815187925637623f, - -0.981493734433433f, - -0.9814686594854735f, - -0.9814435677203137f, - -0.9814184591383837f, - -0.9813933337401132f, - -0.9813681915259334f, - -0.9813430324962746f, - -0.9813178566515681f, - -0.9812926639922451f, - -0.9812674545187376f, - -0.9812422282314773f, - -0.9812169851308966f, - -0.9811917252174278f, - -0.9811664484915039f, - -0.9811411549535581f, - -0.9811158446040237f, - -0.9810905174433341f, - -0.9810651734719237f, - -0.9810398126902267f, - -0.9810144350986774f, - -0.9809890406977106f, - -0.980963629487762f, - -0.9809382014692665f, - -0.9809127566426599f, - -0.9808872950083781f, - -0.9808618165668577f, - -0.9808363213185349f, - -0.9808108092638469f, - -0.9807852804032304f, - -0.9807597347371233f, - -0.9807341722659629f, - -0.9807085929901879f, - -0.9806829969102356f, - -0.9806573840265453f, - -0.9806317543395555f, - -0.9806061078497058f, - -0.9805804445574351f, - -0.9805547644631836f, - -0.9805290675673909f, - -0.9805033538704979f, - -0.9804776233729444f, - -0.9804518760751719f, - -0.9804261119776213f, - -0.9804003310807342f, - -0.9803745333849524f, - -0.9803487188907178f, - -0.9803228875984725f, - -0.9802970395086597f, - -0.9802711746217219f, - -0.9802452929381023f, - -0.9802193944582445f, - -0.9801934791825919f, - -0.9801675471115892f, - -0.9801415982456803f, - -0.9801156325853098f, - -0.9800896501309226f, - -0.9800636508829643f, - -0.98003763484188f, - -0.9800116020081157f, - -0.9799855523821172f, - -0.9799594859643311f, - -0.979933402755204f, - -0.9799073027551828f, - -0.9798811859647144f, - -0.979855052384247f, - -0.9798289020142276f, - -0.9798027348551052f, - -0.9797765509073272f, - -0.9797503501713428f, - -0.9797241326476008f, - -0.9796978983365507f, - -0.9796716472386416f, - -0.9796453793543236f, - -0.9796190946840465f, - -0.9795927932282612f, - -0.9795664749874177f, - -0.9795401399619674f, - -0.9795137881523613f, - -0.9794874195590514f, - -0.979461034182489f, - -0.9794346320231265f, - -0.9794082130814159f, - -0.9793817773578104f, - -0.9793553248527628f, - -0.9793288555667262f, - -0.9793023695001541f, - -0.9792758666535006f, - -0.9792493470272198f, - -0.9792228106217659f, - -0.9791962574375935f, - -0.979169687475158f, - -0.9791431007349144f, - -0.9791164972173183f, - -0.9790898769228253f, - -0.9790632398518921f, - -0.9790365860049747f, - -0.9790099153825299f, - -0.9789832279850147f, - -0.9789565238128862f, - -0.9789298028666024f, - -0.9789030651466207f, - -0.9788763106533996f, - -0.9788495393873972f, - -0.9788227513490725f, - -0.9787959465388841f, - -0.9787691249572922f, - -0.9787422866047553f, - -0.9787154314817338f, - -0.9786885595886877f, - -0.9786616709260779f, - -0.9786347654943645f, - -0.9786078432940089f, - -0.9785809043254721f, - -0.978553948589216f, - -0.9785269760857024f, - -0.9784999868153934f, - -0.9784729807787513f, - -0.9784459579762393f, - -0.9784189184083201f, - -0.978391862075457f, - -0.9783647889781135f, - -0.978337699116754f, - -0.9783105924918422f, - -0.9782834691038426f, - -0.97825632895322f, - -0.9782291720404396f, - -0.9782019983659666f, - -0.9781748079302668f, - -0.9781476007338056f, - -0.9781203767770498f, - -0.9780931360604654f, - -0.9780658785845195f, - -0.9780386043496789f, - -0.9780113133564111f, - -0.9779840056051837f, - -0.9779566810964646f, - -0.9779293398307218f, - -0.9779019818084241f, - -0.9778746070300401f, - -0.9778472154960388f, - -0.9778198072068899f, - -0.9777923821630626f, - -0.977764940365027f, - -0.9777374818132533f, - -0.9777100065082119f, - -0.9776825144503739f, - -0.9776550056402101f, - -0.9776274800781917f, - -0.9775999377647909f, - -0.9775723787004789f, - -0.9775448028857285f, - -0.9775172103210118f, - -0.9774896010068019f, - -0.9774619749435719f, - -0.977434332131795f, - -0.9774066725719447f, - -0.9773789962644953f, - -0.9773513032099208f, - -0.9773235934086958f, - -0.9772958668612949f, - -0.9772681235681935f, - -0.9772403635298669f, - -0.9772125867467906f, - -0.9771847932194404f, - -0.977156982948293f, - -0.9771291559338245f, - -0.9771013121765123f, - -0.9770734516768327f, - -0.9770455744352636f, - -0.9770176804522824f, - -0.9769897697283677f, - -0.9769618422639967f, - -0.9769338980596487f, - -0.9769059371158022f, - -0.9768779594329364f, - -0.9768499650115308f, - -0.9768219538520649f, - -0.9767939259550188f, - -0.9767658813208724f, - -0.9767378199501068f, - -0.9767097418432024f, - -0.9766816470006405f, - -0.9766535354229022f, - -0.9766254071104697f, - -0.9765972620638247f, - -0.9765691002834493f, - -0.9765409217698262f, - -0.9765127265234383f, - -0.9764845145447687f, - -0.9764562858343008f, - -0.976428040392518f, - -0.9763997782199046f, - -0.976371499316945f, - -0.9763432036841234f, - -0.9763148913219246f, - -0.9762865622308341f, - -0.9762582164113371f, - -0.9762298538639194f, - -0.9762014745890666f, - -0.9761730785872654f, - -0.9761446658590022f, - -0.9761162364047641f, - -0.9760877902250377f, - -0.9760593273203109f, - -0.976030847691071f, - -0.9760023513378066f, - -0.9759738382610053f, - -0.975945308461156f, - -0.9759167619387473f, - -0.975888198694269f, - -0.9758596187282097f, - -0.9758310220410596f, - -0.9758024086333085f, - -0.9757737785054468f, - -0.9757451316579651f, - -0.9757164680913541f, - -0.9756877878061049f, - -0.9756590908027092f, - -0.9756303770816586f, - -0.9756016466434451f, - -0.9755728994885606f, - -0.9755441356174984f, - -0.9755153550307509f, - -0.9754865577288114f, - -0.9754577437121731f, - -0.9754289129813299f, - -0.975400065536776f, - -0.9753712013790055f, - -0.9753423205085129f, - -0.9753134229257929f, - -0.9752845086313411f, - -0.9752555776256527f, - -0.9752266299092236f, - -0.9751976654825494f, - -0.9751686843461268f, - -0.9751396865004521f, - -0.9751106719460226f, - -0.9750816406833349f, - -0.9750525927128869f, - -0.975023528035176f, - -0.9749944466507007f, - -0.9749653485599585f, - -0.9749362337634487f, - -0.9749071022616698f, - -0.9748779540551215f, - -0.9748487891443023f, - -0.9748196075297126f, - -0.9747904092118522f, - -0.9747611941912218f, - -0.9747319624683215f, - -0.9747027140436525f, - -0.9746734489177156f, - -0.9746441670910125f, - -0.9746148685640451f, - -0.9745855533373151f, - -0.9745562214113248f, - -0.9745268727865771f, - -0.9744975074635748f, - -0.9744681254428209f, - -0.9744387267248188f, - -0.9744093113100726f, - -0.974379879199086f, - -0.9743504303923635f, - -0.9743209648904093f, - -0.9742914826937288f, - -0.974261983802827f, - -0.9742324682182093f, - -0.9742029359403813f, - -0.9741733869698493f, - -0.9741438213071196f, - -0.9741142389526984f, - -0.9740846399070933f, - -0.9740550241708108f, - -0.9740253917443588f, - -0.9739957426282445f, - -0.9739660768229768f, - -0.973936394329063f, - -0.9739066951470124f, - -0.9738769792773336f, - -0.9738472467205362f, - -0.973817497477129f, - -0.9737877315476221f, - -0.9737579489325254f, - -0.9737281496323495f, - -0.9736983336476049f, - -0.9736685009788023f, - -0.9736386516264529f, - -0.9736087855910683f, - -0.9735789028731603f, - -0.9735490034732408f, - -0.9735190873918219f, - -0.9734891546294168f, - -0.9734592051865378f, - -0.9734292390636985f, - -0.9733992562614119f, - -0.9733692567801921f, - -0.973339240620553f, - -0.9733092077830093f, - -0.973279158268075f, - -0.9732490920762653f, - -0.9732190092080952f, - -0.9731889096640808f, - -0.9731587934447369f, - -0.9731286605505801f, - -0.9730985109821264f, - -0.9730683447398931f, - -0.9730381618243962f, - -0.9730079622361534f, - -0.9729777459756821f, - -0.9729475130434998f, - -0.9729172634401249f, - -0.9728869971660754f, - -0.9728567142218703f, - -0.9728264146080278f, - -0.9727960983250677f, - -0.9727657653735095f, - -0.9727354157538725f, - -0.9727050494666768f, - -0.972674666512443f, - -0.9726442668916917f, - -0.9726138506049437f, - -0.9725834176527198f, - -0.972552968035542f, - -0.972522501753932f, - -0.9724920188084114f, - -0.9724615191995027f, - -0.9724310029277289f, - -0.9724004699936125f, - -0.9723699203976768f, - -0.9723393541404449f, - -0.9723087712224411f, - -0.9722781716441891f, - -0.9722475554062135f, - -0.9722169225090385f, - -0.9721862729531893f, - -0.9721556067391907f, - -0.9721249238675689f, - -0.9720942243388487f, - -0.9720635081535568f, - -0.9720327753122191f, - -0.9720020258153629f, - -0.971971259663514f, - -0.9719404768572005f, - -0.9719096773969493f, - -0.9718788612832885f, - -0.971848028516746f, - -0.9718171790978501f, - -0.9717863130271291f, - -0.9717554303051125f, - -0.971724530932329f, - -0.9716936149093083f, - -0.9716626822365798f, - -0.971631732914674f, - -0.9716007669441208f, - -0.971569784325451f, - -0.9715387850591954f, - -0.9715077691458851f, - -0.9714767365860518f, - -0.9714456873802271f, - -0.9714146215289429f, - -0.9713835390327314f, - -0.9713524398921257f, - -0.9713213241076583f, - -0.9712901916798624f, - -0.9712590426092713f, - -0.9712278768964191f, - -0.9711966945418397f, - -0.9711654955460671f, - -0.9711342799096361f, - -0.9711030476330816f, - -0.9710717987169387f, - -0.9710405331617433f, - -0.9710092509680301f, - -0.9709779521363361f, - -0.9709466366671969f, - -0.9709153045611499f, - -0.970883955818731f, - -0.970852590440478f, - -0.970821208426928f, - -0.9707898097786191f, - -0.970758394496089f, - -0.9707269625798761f, - -0.9706955140305187f, - -0.9706640488485562f, - -0.9706325670345274f, - -0.9706010685889718f, - -0.9705695535124289f, - -0.9705380218054391f, - -0.9705064734685426f, - -0.9704749085022797f, - -0.9704433269071914f, - -0.9704117286838189f, - -0.9703801138327037f, - -0.9703484823543874f, - -0.9703168342494117f, - -0.9702851695183196f, - -0.9702534881616531f, - -0.9702217901799552f, - -0.9701900755737689f, - -0.970158344343638f, - -0.9701265964901059f, - -0.9700948320137167f, - -0.9700630509150147f, - -0.970031253194544f, - -0.9699994388528502f, - -0.9699676078904778f, - -0.9699357603079729f, - -0.9699038961058805f, - -0.9698720152847469f, - -0.9698401178451181f, - -0.9698082037875415f, - -0.9697762731125629f, - -0.9697443258207299f, - -0.9697123619125898f, - -0.9696803813886907f, - -0.9696483842495799f, - -0.9696163704958061f, - -0.9695843401279176f, - -0.9695522931464635f, - -0.9695202295519929f, - -0.9694881493450551f, - -0.9694560525261995f, - -0.9694239390959766f, - -0.9693918090549364f, - -0.9693596624036294f, - -0.9693274991426063f, - -0.9692953192724186f, - -0.9692631227936175f, - -0.9692309097067545f, - -0.9691986800123816f, - -0.9691664337110514f, - -0.969134170803316f, - -0.9691018912897287f, - -0.969069595170842f, - -0.9690372824472098f, - -0.9690049531193855f, - -0.9689726071879231f, - -0.9689402446533767f, - -0.9689078655163011f, - -0.9688754697772511f, - -0.9688430574367815f, - -0.968810628495448f, - -0.968778182953806f, - -0.9687457208124117f, - -0.968713242071821f, - -0.9686807467325907f, - -0.9686482347952776f, - -0.9686157062604387f, - -0.9685831611286311f, - -0.9685505994004129f, - -0.9685180210763419f, - -0.9684854261569762f, - -0.9684528146428742f, - -0.968420186534595f, - -0.9683875418326977f, - -0.9683548805377413f, - -0.9683222026502856f, - -0.9682895081708907f, - -0.9682567971001166f, - -0.9682240694385239f, - -0.9681913251866732f, - -0.9681585643451259f, - -0.9681257869144432f, - -0.9680929928951866f, - -0.9680601822879179f, - -0.9680273550931997f, - -0.9679945113115942f, - -0.9679616509436646f, - -0.9679287739899732f, - -0.967895880451084f, - -0.9678629703275601f, - -0.9678300436199662f, - -0.9677971003288655f, - -0.9677641404548232f, - -0.9677311639984035f, - -0.9676981709601722f, - -0.9676651613406938f, - -0.9676321351405345f, - -0.9675990923602596f, - -0.9675660330004361f, - -0.96753295706163f, - -0.967499864544408f, - -0.9674667554493369f, - -0.9674336297769847f, - -0.9674004875279185f, - -0.9673673287027064f, - -0.9673341533019164f, - -0.9673009613261169f, - -0.9672677527758768f, - -0.9672345276517652f, - -0.9672012859543513f, - -0.9671680276842043f, - -0.9671347528418948f, - -0.9671014614279926f, - -0.967068153443068f, - -0.9670348288876918f, - -0.9670014877624351f, - -0.9669681300678693f, - -0.9669347558045658f, - -0.9669013649730962f, - -0.9668679575740332f, - -0.9668345336079487f, - -0.9668010930754162f, - -0.9667676359770075f, - -0.966734162313297f, - -0.9667006720848575f, - -0.9666671652922636f, - -0.9666336419360886f, - -0.9666001020169074f, - -0.9665665455352944f, - -0.9665329724918252f, - -0.9664993828870743f, - -0.9664657767216177f, - -0.9664321539960309f, - -0.9663985147108904f, - -0.9663648588667726f, - -0.966331186464254f, - -0.9662974975039113f, - -0.9662637919863222f, - -0.9662300699120642f, - -0.9661963312817148f, - -0.9661625760958522f, - -0.9661288043550551f, - -0.9660950160599019f, - -0.9660612112109717f, - -0.9660273898088433f, - -0.9659935518540969f, - -0.9659596973473119f, - -0.9659258262890684f, - -0.9658919386799466f, - -0.9658580345205278f, - -0.9658241138113923f, - -0.9657901765531216f, - -0.9657562227462971f, - -0.9657222523915004f, - -0.9656882654893142f, - -0.9656542620403203f, - -0.9656202420451016f, - -0.9655862055042406f, - -0.9655521524183212f, - -0.9655180827879262f, - -0.9654839966136401f, - -0.9654498938960462f, - -0.9654157746357294f, - -0.9653816388332738f, - -0.9653474864892652f, - -0.9653133176042877f, - -0.9652791321789276f, - -0.96524493021377f, - -0.9652107117094015f, - -0.9651764766664084f, - -0.9651422250853771f, - -0.9651079569668941f, - -0.9650736723115474f, - -0.965039371119924f, - -0.9650050533926117f, - -0.9649707191301982f, - -0.9649363683332725f, - -0.9649020010024227f, - -0.9648676171382378f, - -0.9648332167413067f, - -0.9647987998122195f, - -0.9647643663515652f, - -0.9647299163599344f, - -0.9646954498379169f, - -0.9646609667861036f, - -0.9646264672050853f, - -0.964591951095453f, - -0.9645574184577981f, - -0.9645228692927126f, - -0.9644883036007883f, - -0.9644537213826175f, - -0.9644191226387925f, - -0.9643845073699066f, - -0.9643498755765527f, - -0.9643152272593241f, - -0.9642805624188147f, - -0.9642458810556184f, - -0.9642111831703294f, - -0.9641764687635421f, - -0.964141737835852f, - -0.9641069903878531f, - -0.9640722264201417f, - -0.9640374459333129f, - -0.9640026489279634f, - -0.9639678354046884f, - -0.9639330053640853f, - -0.9638981588067503f, - -0.963863295733281f, - -0.9638284161442745f, - -0.9637935200403285f, - -0.9637586074220407f, - -0.9637236782900097f, - -0.9636887326448339f, - -0.963653770487112f, - -0.9636187918174428f, - -0.9635837966364262f, - -0.9635487849446615f, - -0.9635137567427489f, - -0.963478712031288f, - -0.9634436508108799f, - -0.9634085730821249f, - -0.9633734788456249f, - -0.9633383681019799f, - -0.9633032408517925f, - -0.9632680970956642f, - -0.9632329368341976f, - -0.9631977600679945f, - -0.9631625667976582f, - -0.9631273570237914f, - -0.9630921307469976f, - -0.9630568879678804f, - -0.9630216286870437f, - -0.9629863529050914f, - -0.9629510606226279f, - -0.9629157518402585f, - -0.9628804265585876f, - -0.962845084778221f, - -0.9628097264997636f, - -0.9627743517238219f, - -0.9627389604510018f, - -0.9627035526819097f, - -0.9626681284171521f, - -0.9626326876573363f, - -0.9625972304030697f, - -0.9625617566549595f, - -0.9625262664136134f, - -0.9624907596796399f, - -0.9624552364536474f, - -0.9624196967362444f, - -0.9623841405280397f, - -0.962348567829643f, - -0.9623129786416634f, - -0.962277372964711f, - -0.9622417507993957f, - -0.962206112146328f, - -0.9621704570061184f, - -0.9621347853793784f, - -0.9620990972667183f, - -0.9620633926687503f, - -0.9620276715860858f, - -0.9619919340193375f, - -0.9619561799691168f, - -0.9619204094360371f, - -0.9618846224207108f, - -0.9618488189237516f, - -0.9618129989457728f, - -0.9617771624873881f, - -0.9617413095492112f, - -0.9617054401318572f, - -0.9616695542359401f, - -0.9616336518620752f, - -0.9615977330108771f, - -0.9615617976829619f, - -0.9615258458789451f, - -0.9614898775994427f, - -0.9614538928450708f, - -0.9614178916164463f, - -0.9613818739141861f, - -0.9613458397389071f, - -0.961309789091227f, - -0.961273721971763f, - -0.9612376383811337f, - -0.9612015383199572f, - -0.9611654217888521f, - -0.9611292887884368f, - -0.9610931393193312f, - -0.9610569733821542f, - -0.9610207909775256f, - -0.9609845921060651f, - -0.9609483767683936f, - -0.9609121449651309f, - -0.9608758966968988f, - -0.9608396319643172f, - -0.9608033507680084f, - -0.9607670531085936f, - -0.9607307389866953f, - -0.9606944084029347f, - -0.9606580613579354f, - -0.9606216978523194f, - -0.9605853178867108f, - -0.9605489214617317f, - -0.9605125085780065f, - -0.9604760792361587f, - -0.9604396334368132f, - -0.9604031711805938f, - -0.9603666924681258f, - -0.9603301973000336f, - -0.9602936856769431f, - -0.9602571575994797f, - -0.9602206130682694f, - -0.9601840520839382f, - -0.9601474746471127f, - -0.9601108807584198f, - -0.9600742704184863f, - -0.9600376436279392f, - -0.9600010003874068f, - -0.9599643406975165f, - -0.9599276645588966f, - -0.9598909719721753f, - -0.9598542629379817f, - -0.9598175374569448f, - -0.9597807955296935f, - -0.9597440371568574f, - -0.9597072623390668f, - -0.9596704710769514f, - -0.9596336633711415f, - -0.9595968392222685f, - -0.9595599986309628f, - -0.9595231415978557f, - -0.9594862681235785f, - -0.9594493782087639f, - -0.9594124718540429f, - -0.9593755490600486f, - -0.9593386098274133f, - -0.9593016541567705f, - -0.9592646820487526f, - -0.9592276935039937f, - -0.9591906885231272f, - -0.9591536671067876f, - -0.9591166292556091f, - -0.9590795749702263f, - -0.9590425042512738f, - -0.9590054170993874f, - -0.9589683135152022f, - -0.958931193499354f, - -0.9588940570524785f, - -0.9588569041752129f, - -0.9588197348681932f, - -0.9587825491320563f, - -0.9587453469674393f, - -0.95870812837498f, - -0.9586708933553156f, - -0.9586336419090851f, - -0.9585963740369254f, - -0.9585590897394762f, - -0.9585217890173757f, - -0.9584844718712638f, - -0.958447138301779f, - -0.9584097883095616f, - -0.9583724218952512f, - -0.9583350390594887f, - -0.9582976398029137f, - -0.9582602241261678f, - -0.9582227920298919f, - -0.9581853435147271f, - -0.9581478785813154f, - -0.9581103972302988f, - -0.9580728994623193f, - -0.9580353852780193f, - -0.957997854678042f, - -0.9579603076630303f, - -0.9579227442336276f, - -0.9578851643904772f, - -0.9578475681342234f, - -0.9578099554655105f, - -0.9577723263849827f, - -0.9577346808932845f, - -0.9576970189910616f, - -0.9576593406789591f, - -0.9576216459576224f, - -0.9575839348276973f, - -0.9575462072898304f, - -0.957508463344668f, - -0.9574707029928567f, - -0.9574329262350434f, - -0.9573951330718757f, - -0.9573573235040009f, - -0.9573194975320675f, - -0.9572816551567226f, - -0.9572437963786153f, - -0.9572059211983941f, - -0.9571680296167084f, - -0.9571301216342067f, - -0.9570921972515392f, - -0.9570542564693552f, - -0.9570162992883056f, - -0.9569783257090396f, - -0.9569403357322089f, - -0.9569023293584639f, - -0.9568643065884561f, - -0.956826267422837f, - -0.9567882118622584f, - -0.9567501399073719f, - -0.9567120515588304f, - -0.9566739468172866f, - -0.956635825683393f, - -0.9565976881578028f, - -0.9565595342411698f, - -0.9565213639341477f, - -0.9564831772373904f, - -0.9564449741515523f, - -0.9564067546772876f, - -0.956368518815252f, - -0.9563302665661f, - -0.9562919979304874f, - -0.9562537129090695f, - -0.9562154115025027f, - -0.9561770937114432f, - -0.9561387595365476f, - -0.9561004089784724f, - -0.9560620420378751f, - -0.9560236587154132f, - -0.9559852590117441f, - -0.9559468429275256f, - -0.9559084104634165f, - -0.9558699616200748f, - -0.9558314963981599f, - -0.9557930147983301f, - -0.9557545168212456f, - -0.9557160024675653f, - -0.9556774717379499f, - -0.9556389246330589f, - -0.9556003611535533f, - -0.9555617813000934f, - -0.9555231850733408f, - -0.9554845724739565f, - -0.9554459435026023f, - -0.9554072981599395f, - -0.9553686364466313f, - -0.9553299583633394f, - -0.9552912639107269f, - -0.9552525530894563f, - -0.9552138259001917f, - -0.9551750823435962f, - -0.9551363224203336f, - -0.955097546131068f, - -0.9550587534764642f, - -0.9550199444571867f, - -0.9549811190739005f, - -0.9549422773272704f, - -0.9549034192179628f, - -0.9548645447466431f, - -0.9548256539139772f, - -0.9547867467206316f, - -0.9547478231672732f, - -0.9547088832545689f, - -0.9546699269831858f, - -0.9546309543537913f, - -0.954591965367053f, - -0.9545529600236398f, - -0.9545139383242189f, - -0.9544749002694604f, - -0.9544358458600316f, - -0.9543967750966028f, - -0.9543576879798428f, - -0.9543185845104222f, - -0.9542794646890098f, - -0.954240328516277f, - -0.9542011759928937f, - -0.9541620071195315f, - -0.9541228218968606f, - -0.9540836203255532f, - -0.9540444024062804f, - -0.9540051681397148f, - -0.9539659175265284f, - -0.9539266505673937f, - -0.9538873672629833f, - -0.9538480676139709f, - -0.9538087516210294f, - -0.9537694192848327f, - -0.9537300706060544f, - -0.9536907055853694f, - -0.9536513242234513f, - -0.9536119265209761f, - -0.9535725124786176f, - -0.953533082097052f, - -0.9534936353769544f, - -0.9534541723190014f, - -0.9534146929238683f, - -0.9533751971922322f, - -0.9533356851247697f, - -0.9532961567221578f, - -0.9532566119850735f, - -0.9532170509141951f, - -0.9531774735101999f, - -0.9531378797737659f, - -0.9530982697055722f, - -0.9530586433062971f, - -0.9530190005766196f, - -0.9529793415172187f, - -0.9529396661287747f, - -0.9528999744119667f, - -0.9528602663674752f, - -0.9528205419959803f, - -0.9527808012981632f, - -0.9527410442747041f, - -0.9527012709262848f, - -0.9526614812535862f, - -0.9526216752572909f, - -0.9525818529380805f, - -0.9525420142966374f, - -0.952502159333644f, - -0.9524622880497837f, - -0.9524224004457394f, - -0.9523824965221946f, - -0.9523425762798328f, - -0.9523026397193384f, - -0.9522626868413956f, - -0.9522227176466889f, - -0.9521827321359029f, - -0.9521427303097233f, - -0.952102712168835f, - -0.9520626777139245f, - -0.9520226269456766f, - -0.9519825598647785f, - -0.9519424764719162f, - -0.9519023767677773f, - -0.9518622607530478f, - -0.9518221284284158f, - -0.9517819797945686f, - -0.9517418148521948f, - -0.9517016336019817f, - -0.9516614360446183f, - -0.9516212221807931f, - -0.9515809920111957f, - -0.951540745536515f, - -0.9515004827574407f, - -0.9514602036746627f, - -0.9514199082888709f, - -0.9513795966007563f, - -0.9513392686110093f, - -0.9512989243203209f, - -0.9512585637293822f, - -0.9512181868388854f, - -0.9511777936495218f, - -0.9511373841619837f, - -0.9510969583769633f, - -0.9510565162951536f, - -0.9510160579172475f, - -0.9509755832439383f, - -0.9509350922759189f, - -0.950894585013884f, - -0.9508540614585272f, - -0.9508135216105431f, - -0.9507729654706257f, - -0.9507323930394709f, - -0.950691804317773f, - -0.9506511993062284f, - -0.9506105780055318f, - -0.9505699404163801f, - -0.9505292865394689f, - -0.9504886163754958f, - -0.9504479299251565f, - -0.9504072271891488f, - -0.9503665081681699f, - -0.9503257728629182f, - -0.9502850212740905f, - -0.950244253402386f, - -0.9502034692485027f, - -0.9501626688131399f, - -0.9501218520969965f, - -0.9500810191007718f, - -0.9500401698251654f, - -0.9499993042708774f, - -0.9499584224386081f, - -0.9499175243290578f, - -0.9498766099429271f, - -0.9498356792809176f, - -0.9497947323437304f, - -0.949753769132067f, - -0.9497127896466291f, - -0.9496717938881194f, - -0.94963078185724f, - -0.9495897535546938f, - -0.9495487089811837f, - -0.9495076481374127f, - -0.9494665710240849f, - -0.949425477641904f, - -0.949384367991574f, - -0.949343242073799f, - -0.9493020998892845f, - -0.9492609414387345f, - -0.9492197667228555f, - -0.9491785757423514f, - -0.9491373684979293f, - -0.9490961449902945f, - -0.9490549052201542f, - -0.949013649188214f, - -0.9489723768951814f, - -0.9489310883417634f, - -0.9488897835286682f, - -0.9488484624566021f, - -0.9488071251262744f, - -0.9487657715383926f, - -0.9487244016936659f, - -0.948683015592803f, - -0.9486416132365127f, - -0.9486001946255046f, - -0.9485587597604885f, - -0.9485173086421745f, - -0.9484758412712726f, - -0.9484343576484932f, - -0.9483928577745474f, - -0.9483513416501463f, - -0.9483098092760013f, - -0.9482682606528234f, - -0.9482266957813255f, - -0.9481851146622192f, - -0.9481435172962173f, - -0.948101903684032f, - -0.948060273826377f, - -0.9480186277239653f, - -0.9479769653775106f, - -0.9479352867877264f, - -0.9478935919553274f, - -0.9478518808810279f, - -0.9478101535655423f, - -0.9477684100095857f, - -0.9477266502138736f, - -0.9476848741791215f, - -0.9476430819060447f, - -0.94760127339536f, - -0.9475594486477836f, - -0.9475176076640319f, - -0.9474757504448218f, - -0.9474338769908712f, - -0.9473919873028965f, - -0.9473500813816165f, - -0.9473081592277484f, - -0.9472662208420111f, - -0.9472242662251231f, - -0.9471822953778032f, - -0.9471403083007702f, - -0.9470983049947443f, - -0.9470562854604447f, - -0.9470142496985916f, - -0.9469721977099049f, - -0.9469301294951057f, - -0.9468880450549145f, - -0.9468459443900525f, - -0.9468038275012408f, - -0.9467616943892015f, - -0.9467195450546562f, - -0.9466773794983276f, - -0.9466351977209375f, - -0.9465929997232092f, - -0.9465507855058654f, - -0.9465085550696302f, - -0.9464663084152259f, - -0.9464240455433774f, - -0.9463817664548084f, - -0.946339471150244f, - -0.9462971596304078f, - -0.9462548318960259f, - -0.9462124879478226f, - -0.9461701277865244f, - -0.9461277514128567f, - -0.9460853588275454f, - -0.9460429500313172f, - -0.9460005250248983f, - -0.9459580838090162f, - -0.9459156263843981f, - -0.9458731527517711f, - -0.945830662911863f, - -0.9457881568654022f, - -0.9457456346131169f, - -0.9457030961557357f, - -0.9456605414939872f, - -0.9456179706286009f, - -0.9455753835603062f, - -0.9455327802898328f, - -0.9454901608179104f, - -0.9454475251452698f, - -0.9454048732726412f, - -0.9453622052007556f, - -0.9453195209303438f, - -0.9452768204621376f, - -0.9452341037968683f, - -0.9451913709352682f, - -0.945148621878069f, - -0.9451058566260038f, - -0.9450630751798047f, - -0.9450202775402058f, - -0.9449774637079391f, - -0.9449346336837392f, - -0.9448917874683394f, - -0.9448489250624745f, - -0.944806046466878f, - -0.9447631516822855f, - -0.9447202407094314f, - -0.9446773135490514f, - -0.9446343702018809f, - -0.9445914106686556f, - -0.9445484349501114f, - -0.9445054430469852f, - -0.9444624349600135f, - -0.9444194106899331f, - -0.944376370237481f, - -0.9443333136033951f, - -0.9442902407884131f, - -0.9442471517932729f, - -0.9442040466187126f, - -0.9441609252654712f, - -0.9441177877342876f, - -0.9440746340259006f, - -0.94403146414105f, - -0.9439882780804748f, - -0.9439450758449159f, - -0.9439018574351131f, - -0.9438586228518071f, - -0.9438153720957382f, - -0.9437721051676481f, - -0.943728822068278f, - -0.9436855227983696f, - -0.9436422073586643f, - -0.9435988757499051f, - -0.9435555279728337f, - -0.9435121640281938f, - -0.9434687839167274f, - -0.9434253876391785f, - -0.9433819751962902f, - -0.9433385465888072f, - -0.9432951018174724f, - -0.9432516408830313f, - -0.9432081637862277f, - -0.9431646705278077f, - -0.9431211611085154f, - -0.943077635529097f, - -0.9430340937902978f, - -0.9429905358928644f, - -0.9429469618375431f, - -0.9429033716250802f, - -0.9428597652562225f, - -0.9428161427317178f, - -0.9427725040523132f, - -0.9427288492187564f, - -0.9426851782317952f, - -0.9426414910921784f, - -0.9425977878006544f, - -0.9425540683579718f, - -0.9425103327648797f, - -0.942466581022128f, - -0.942422813130466f, - -0.9423790290906437f, - -0.942335228903411f, - -0.9422914125695191f, - -0.9422475800897184f, - -0.94220373146476f, - -0.9421598666953949f, - -0.9421159857823753f, - -0.9420720887264528f, - -0.9420281755283793f, - -0.9419842461889081f, - -0.9419403007087906f, - -0.941896339088781f, - -0.9418523613296318f, - -0.9418083674320974f, - -0.9417643573969304f, - -0.9417203312248859f, - -0.9416762889167176f, - -0.9416322304731812f, - -0.9415881558950302f, - -0.9415440651830209f, - -0.9414999583379081f, - -0.9414558353604482f, - -0.9414116962513969f, - -0.9413675410115105f, - -0.9413233696415453f, - -0.9412791821422588f, - -0.9412349785144077f, - -0.9411907587587497f, - -0.941146522876042f, - -0.9411022708670431f, - -0.9410580027325111f, - -0.9410137184732044f, - -0.9409694180898815f, - -0.9409251015833023f, - -0.9408807689542253f, - -0.9408364202034111f, - -0.9407920553316185f, - -0.9407476743396084f, - -0.9407032772281408f, - -0.9406588639979773f, - -0.9406144346498777f, - -0.9405699891846041f, - -0.940525527602918f, - -0.9404810499055809f, - -0.9404365560933549f, - -0.9403920461670028f, - -0.9403475201272871f, - -0.9403029779749704f, - -0.9402584197108165f, - -0.9402138453355886f, - -0.9401692548500504f, - -0.9401246482549658f, - -0.9400800255510996f, - -0.9400353867392162f, - -0.9399907318200803f, - -0.939946060794457f, - -0.939901373663112f, - -0.939856670426811f, - -0.9398119510863199f, - -0.9397672156424045f, - -0.9397224640958322f, - -0.9396776964473692f, - -0.9396329126977828f, - -0.93958811284784f, - -0.9395432968983091f, - -0.9394984648499576f, - -0.9394536167035537f, - -0.9394087524598655f, - -0.9393638721196625f, - -0.939318975683713f, - -0.9392740631527873f, - -0.9392291345276536f, - -0.9391841898090828f, - -0.9391392289978442f, - -0.9390942520947093f, - -0.9390492591004476f, - -0.9390042500158308f, - -0.9389592248416294f, - -0.9389141835786161f, - -0.9388691262275612f, - -0.938824052789238f, - -0.9387789632644178f, - -0.9387338576538741f, - -0.9386887359583792f, - -0.9386435981787066f, - -0.9385984443156291f, - -0.9385532743699211f, - -0.9385080883423564f, - -0.9384628862337091f, - -0.9384176680447538f, - -0.938372433776265f, - -0.9383271834290183f, - -0.9382819170037889f, - -0.9382366345013523f, - -0.9381913359224842f, - -0.9381460212679612f, - -0.9381006905385596f, - -0.9380553437350562f, - -0.9380099808582275f, - -0.9379646019088516f, - -0.9379192068877056f, - -0.9378737957955673f, - -0.9378283686332147f, - -0.9377829254014266f, - -0.9377374661009812f, - -0.9376919907326582f, - -0.9376464992972356f, - -0.937600991795494f, - -0.9375554682282123f, - -0.9375099285961717f, - -0.9374643729001509f, - -0.9374188011409318f, - -0.9373732133192945f, - -0.937327609436021f, - -0.9372819894918916f, - -0.9372363534876887f, - -0.9371907014241939f, - -0.9371450333021899f, - -0.9370993491224588f, - -0.9370536488857837f, - -0.9370079325929471f, - -0.9369622002447331f, - -0.9369164518419248f, - -0.9368706873853063f, - -0.9368249068756614f, - -0.936779110313775f, - -0.9367332977004318f, - -0.9366874690364165f, - -0.9366416243225142f, - -0.936595763559511f, - -0.9365498867481924f, - -0.9365039938893446f, - -0.9364580849837535f, - -0.9364121600322064f, - -0.93636621903549f, - -0.9363202619943913f, - -0.9362742889096975f, - -0.9362282997821972f, - -0.9361822946126779f, - -0.9361362734019278f, - -0.9360902361507356f, - -0.9360441828598898f, - -0.9359981135301801f, - -0.9359520281623953f, - -0.935905926757326f, - -0.9358598093157608f, - -0.935813675838491f, - -0.9357675263263063f, - -0.9357213607799986f, - -0.9356751792003574f, - -0.9356289815881751f, - -0.9355827679442428f, - -0.935536538269353f, - -0.9354902925642968f, - -0.9354440308298675f, - -0.9353977530668571f, - -0.9353514592760592f, - -0.9353051494582668f, - -0.9352588236142734f, - -0.9352124817448724f, - -0.9351661238508584f, - -0.9351197499330256f, - -0.9350733599921685f, - -0.9350269540290816f, - -0.9349805320445609f, - -0.934934094039401f, - -0.9348876400143985f, - -0.9348411699703484f, - -0.9347946839080477f, - -0.9347481818282922f, - -0.9347016637318799f, - -0.9346551296196064f, - -0.93460857949227f, - -0.9345620133506682f, - -0.9345154311955989f, - -0.9344688330278597f, - -0.9344222188482498f, - -0.9343755886575678f, - -0.9343289424566119f, - -0.9342822802461825f, - -0.9342356020270787f, - -0.9341889078001001f, - -0.9341421975660467f, - -0.9340954713257195f, - -0.9340487290799186f, - -0.9340019708294451f, - -0.9339551965751f, - -0.9339084063176855f, - -0.933861600058002f, - -0.9338147777968527f, - -0.9337679395350391f, - -0.9337210852733645f, - -0.9336742150126313f, - -0.9336273287536427f, - -0.9335804264972017f, - -0.9335335082441126f, - -0.9334865739951792f, - -0.9334396237512054f, - -0.9333926575129956f, - -0.933345675281355f, - -0.9332986770570885f, - -0.9332516628410013f, - -0.9332046326338985f, - -0.933157586436587f, - -0.9331105242498718f, - -0.9330634460745607f, - -0.9330163519114588f, - -0.9329692417613742f, - -0.9329221156251132f, - -0.9328749735034846f, - -0.9328278153972945f, - -0.9327806413073523f, - -0.9327334512344655f, - -0.9326862451794432f, - -0.9326390231430941f, - -0.9325917851262273f, - -0.932544531129652f, - -0.9324972611541783f, - -0.932449975200616f, - -0.9324026732697753f, - -0.9323553553624667f, - -0.9323080214795006f, - -0.9322606716216888f, - -0.9322133057898422f, - -0.9321659239847725f, - -0.9321185262072912f, - -0.9320711124582111f, - -0.9320236827383442f, - -0.9319762370485034f, - -0.9319287753895011f, - -0.9318812977621516f, - -0.9318338041672676f, - -0.9317862946056632f, - -0.931738769078152f, - -0.931691227585549f, - -0.9316436701286687f, - -0.9315960967083255f, - -0.9315485073253348f, - -0.9315009019805124f, - -0.9314532806746733f, - -0.9314056434086345f, - -0.9313579901832111f, - -0.9313103209992204f, - -0.9312626358574786f, - -0.9312149347588038f, - -0.9311672177040121f, - -0.9311194846939219f, - -0.9310717357293506f, - -0.9310239708111173f, - -0.9309761899400392f, - -0.9309283931169359f, - -0.9308805803426257f, - -0.9308327516179286f, - -0.9307849069436638f, - -0.930737046320651f, - -0.93068916974971f, - -0.930641277231662f, - -0.9305933687673271f, - -0.9305454443575262f, - -0.9304975040030802f, - -0.9304495477048111f, - -0.9304015754635405f, - -0.9303535872800902f, - -0.9303055831552822f, - -0.9302575630899397f, - -0.9302095270848851f, - -0.9301614751409417f, - -0.9301134072589327f, - -0.9300653234396813f, - -0.9300172236840122f, - -0.9299691079927493f, - -0.929920976366717f, - -0.9298728288067396f, - -0.9298246653136428f, - -0.9297764858882512f, - -0.9297282905313915f, - -0.9296800792438881f, - -0.9296318520265678f, - -0.9295836088802567f, - -0.9295353498057822f, - -0.92948707480397f, - -0.9294387838756482f, - -0.9293904770216436f, - -0.9293421542427849f, - -0.9292938155398989f, - -0.9292454609138147f, - -0.9291970903653601f, - -0.9291487038953649f, - -0.9291003015046576f, - -0.9290518831940676f, - -0.9290034489644243f, - -0.9289549988165583f, - -0.9289065327512993f, - -0.9288580507694778f, - -0.9288095528719241f, - -0.9287610390594702f, - -0.9287125093329467f, - -0.9286639636931852f, - -0.9286154021410172f, - -0.9285668246772757f, - -0.9285182313027923f, - -0.9284696220184f, - -0.9284209968249312f, - -0.9283723557232197f, - -0.9283236987140988f, - -0.928275025798402f, - -0.9282263369769632f, - -0.9281776322506172f, - -0.9281289116201983f, - -0.9280801750865411f, - -0.9280314226504806f, - -0.9279826543128527f, - -0.9279338700744927f, - -0.9278850699362361f, - -0.9278362538989203f, - -0.9277874219633803f, - -0.9277385741304537f, - -0.927689710400977f, - -0.9276408307757884f, - -0.9275919352557241f, - -0.927543023841623f, - -0.9274940965343224f, - -0.9274451533346614f, - -0.9273961942434782f, - -0.9273472192616117f, - -0.9272982283899008f, - -0.9272492216291858f, - -0.9272001989803057f, - -0.9271511604441007f, - -0.9271021060214109f, - -0.9270530357130771f, - -0.92700394951994f, - -0.9269548474428407f, - -0.9269057294826203f, - -0.9268565956401209f, - -0.9268074459161838f, - -0.9267582803116521f, - -0.9267090988273671f, - -0.9266599014641722f, - -0.92661068822291f, - -0.9265614591044248f, - -0.9265122141095585f, - -0.9264629532391561f, - -0.9264136764940609f, - -0.9263643838751183f, - -0.9263150753831717f, - -0.9262657510190667f, - -0.9262164107836485f, - -0.9261670546777618f, - -0.9261176827022533f, - -0.9260682948579685f, - -0.9260188911457535f, - -0.9259694715664548f, - -0.9259200361209197f, - -0.9258705848099948f, - -0.9258211176345277f, - -0.9257716345953655f, - -0.9257221356933568f, - -0.9256726209293493f, - -0.9256230903041917f, - -0.925573543818732f, - -0.9255239814738201f, - -0.9254744032703048f, - -0.9254248092090357f, - -0.9253751992908621f, - -0.9253255735166348f, - -0.9252759318872038f, - -0.9252262744034196f, - -0.9251766010661329f, - -0.9251269118761954f, - -0.9250772068344579f, - -0.925027485941773f, - -0.9249777491989913f, - -0.9249279966069662f, - -0.9248782281665495f, - -0.9248284438785948f, - -0.9247786437439539f, - -0.9247288277634811f, - -0.9246789959380294f, - -0.9246291482684534f, - -0.9245792847556062f, - -0.9245294054003431f, - -0.924479510203518f, - -0.9244295991659868f, - -0.924379672288604f, - -0.9243297295722251f, - -0.9242797710177059f, - -0.9242297966259028f, - -0.9241798063976718f, - -0.9241298003338695f, - -0.9240797784353524f, - -0.9240297407029783f, - -0.9239796871376041f, - -0.9239296177400877f, - -0.9238795325112866f, - -0.9238294314520596f, - -0.923779314563265f, - -0.9237291818457612f, - -0.9236790333004076f, - -0.923628868928063f, - -0.9235786887295874f, - -0.9235284927058406f, - -0.9234782808576826f, - -0.9234280531859733f, - -0.9233778096915742f, - -0.9233275503753458f, - -0.9232772752381493f, - -0.9232269842808457f, - -0.9231766775042975f, - -0.923126354909366f, - -0.9230760164969145f, - -0.9230256622678042f, - -0.9229752922228989f, - -0.9229249063630609f, - -0.9228745046891547f, - -0.9228240872020425f, - -0.9227736539025891f, - -0.9227232047916583f, - -0.9226727398701151f, - -0.9226222591388233f, - -0.9225717625986486f, - -0.9225212502504557f, - -0.9224707220951107f, - -0.9224201781334791f, - -0.922369618366427f, - -0.9223190427948202f, - -0.9222684514195263f, - -0.9222178442414116f, - -0.9221672212613432f, - -0.9221165824801884f, - -0.9220659278988153f, - -0.9220152575180917f, - -0.9219645713388857f, - -0.9219138693620654f, - -0.9218631515885005f, - -0.9218124180190596f, - -0.9217616686546118f, - -0.9217109034960267f, - -0.9216601225441744f, - -0.921609325799925f, - -0.9215585132641488f, - -0.9215076849377161f, - -0.9214568408214985f, - -0.9214059809163668f, - -0.9213551052231923f, - -0.9213042137428478f, - -0.9212533064762036f, - -0.9212023834241333f, - -0.9211514445875086f, - -0.9211004899672035f, - -0.9210495195640898f, - -0.9209985333790416f, - -0.9209475314129321f, - -0.920896513666636f, - -0.9208454801410263f, - -0.9207944308369785f, - -0.9207433657553665f, - -0.920692284897066f, - -0.9206411882629519f, - -0.9205900758538998f, - -0.9205389476707851f, - -0.9204878037144847f, - -0.9204366439858743f, - -0.9203854684858308f, - -0.9203342772152305f, - -0.9202830701749514f, - -0.9202318473658705f, - -0.9201806087888654f, - -0.920129354444814f, - -0.9200780843345949f, - -0.9200267984590862f, - -0.9199754968191675f, - -0.9199241794157165f, - -0.9198728462496135f, - -0.9198214973217375f, - -0.9197701326329693f, - -0.9197187521841876f, - -0.919667355976274f, - -0.9196159440101088f, - -0.9195645162865724f, - -0.9195130728065468f, - -0.919461613570913f, - -0.9194101385805531f, - -0.9193586478363484f, - -0.9193071413391819f, - -0.919255619089936f, - -0.9192040810894934f, - -0.9191525273387369f, - -0.9191009578385504f, - -0.9190493725898173f, - -0.9189977715934216f, - -0.9189461548502469f, - -0.9188945223611785f, - -0.9188428741271008f, - -0.9187912101488985f, - -0.9187395304274568f, - -0.9186878349636618f, - -0.9186361237583989f, - -0.9185843968125542f, - -0.9185326541270138f, - -0.9184808957026648f, - -0.9184291215403937f, - -0.9183773316410878f, - -0.9183255260056341f, - -0.918273704634921f, - -0.9182218675298356f, - -0.9181700146912672f, - -0.9181181461201031f, - -0.9180662618172329f, - -0.918014361783545f, - -0.9179624460199298f, - -0.9179105145272752f, - -0.9178585673064724f, - -0.9178066043584107f, - -0.9177546256839815f, - -0.9177026312840739f, - -0.9176506211595801f, - -0.9175985953113903f, - -0.9175465537403971f, - -0.9174944964474914f, - -0.9174424234335653f, - -0.9173903346995109f, - -0.9173382302462213f, - -0.9172861100745889f, - -0.917233974185507f, - -0.9171818225798686f, - -0.9171296552585672f, - -0.9170774722224971f, - -0.9170252734725525f, - -0.9169730590096273f, - -0.9169208288346163f, - -0.916868582948415f, - -0.9168163213519182f, - -0.9167640440460214f, - -0.9167117510316201f, - -0.9166594423096108f, - -0.9166071178808897f, - -0.9165547777463533f, - -0.916502421906898f, - -0.9164500503634216f, - -0.9163976631168209f, - -0.9163452601679946f, - -0.916292841517839f, - -0.9162404071672535f, - -0.9161879571171357f, - -0.9161354913683857f, - -0.9160830099219007f, - -0.9160305127785812f, - -0.9159779999393259f, - -0.9159254714050359f, - -0.9158729271766096f, - -0.9158203672549485f, - -0.9157677916409525f, - -0.9157152003355231f, - -0.9156625933395611f, - -0.915609970653968f, - -0.9155573322796451f, - -0.9155046782174949f, - -0.9154520084684195f, - -0.9153993230333212f, - -0.9153466219131023f, - -0.9152939051086669f, - -0.9152411726209176f, - -0.9151884244507582f, - -0.9151356605990919f, - -0.9150828810668237f, - -0.9150300858548576f, - -0.9149772749640981f, - -0.9149244483954498f, - -0.9148716061498187f, - -0.9148187482281097f, - -0.9147658746312287f, - -0.9147129853600815f, - -0.9146600804155741f, - -0.9146071597986137f, - -0.9145542235101067f, - -0.9145012715509602f, - -0.914448303922081f, - -0.9143953206243776f, - -0.9143423216587571f, - -0.9142893070261285f, - -0.914236276727399f, - -0.9141832307634783f, - -0.9141301691352745f, - -0.9140770918436979f, - -0.9140239988896566f, - -0.9139708902740614f, - -0.9139177659978215f, - -0.913864626061848f, - -0.913811470467051f, - -0.9137582992143413f, - -0.9137051123046297f, - -0.9136519097388281f, - -0.913598691517848f, - -0.9135454576426011f, - -0.9134922081139992f, - -0.9134389429329555f, - -0.9133856621003823f, - -0.9133323656171924f, - -0.9132790534842989f, - -0.913225725702616f, - -0.9131723822730565f, - -0.9131190231965358f, - -0.9130656484739665f, - -0.9130122581062644f, - -0.9129588520943439f, - -0.9129054304391201f, - -0.912851993141508f, - -0.912798540202424f, - -0.9127450716227836f, - -0.9126915874035031f, - -0.9126380875454984f, - -0.9125845720496869f, - -0.9125310409169853f, - -0.9124774941483106f, - -0.9124239317445809f, - -0.9123703537067136f, - -0.9123167600356268f, - -0.9122631507322384f, - -0.9122095257974681f, - -0.9121558852322332f, - -0.9121022290374542f, - -0.9120485572140494f, - -0.9119948697629398f, - -0.9119411666850437f, - -0.9118874479812824f, - -0.9118337136525757f, - -0.911779963699845f, - -0.9117261981240111f, - -0.911672416925995f, - -0.911618620106718f, - -0.9115648076671026f, - -0.9115109796080704f, - -0.9114571359305439f, - -0.9114032766354452f, - -0.911349401723698f, - -0.9112955111962247f, - -0.9112416050539496f, - -0.9111876832977951f, - -0.9111337459286862f, - -0.9110797929475464f, - -0.9110258243553011f, - -0.9109718401528738f, - -0.9109178403411905f, - -0.9108638249211757f, - -0.910809793893756f, - -0.9107557472598559f, - -0.9107016850204025f, - -0.9106476071763213f, - -0.9105935137285398f, - -0.9105394046779844f, - -0.9104852800255824f, - -0.9104311397722611f, - -0.9103769839189477f, - -0.9103228124665711f, - -0.910268625416059f, - -0.9102144227683399f, - -0.9101602045243422f, - -0.9101059706849958f, - -0.9100517212512292f, - -0.9099974562239724f, - -0.9099431756041547f, - -0.9098888793927068f, - -0.9098345675905588f, - -0.9097802401986412f, - -0.9097258972178848f, - -0.9096715386492211f, - -0.9096171644935814f, - -0.9095627747518974f, - -0.9095083694251006f, - -0.9094539485141239f, - -0.9093995120198995f, - -0.9093450599433602f, - -0.9092905922854385f, - -0.9092361090470686f, - -0.9091816102291833f, - -0.9091270958327174f, - -0.9090725658586036f, - -0.9090180203077773f, - -0.9089634591811725f, - -0.9089088824797251f, - -0.9088542902043688f, - -0.9087996823560403f, - -0.9087450589356743f, - -0.9086904199442079f, - -0.9086357653825758f, - -0.9085810952517159f, - -0.908526409552564f, - -0.9084717082860578f, - -0.9084169914531344f, - -0.9083622590547312f, - -0.9083075110917859f, - -0.908252747565237f, - -0.9081979684760226f, - -0.9081431738250815f, - -0.908088363613352f, - -0.9080335378417741f, - -0.9079786965112869f, - -0.90792383962283f, - -0.907868967177343f, - -0.907814079175767f, - -0.9077591756190418f, - -0.9077042565081086f, - -0.9076493218439081f, - -0.9075943716273813f, - -0.9075394058594705f, - -0.9074844245411171f, - -0.9074294276732634f, - -0.9073744152568511f, - -0.9073193872928238f, - -0.9072643437821235f, - -0.9072092847256945f, - -0.9071542101244788f, - -0.9070991199794212f, - -0.9070440142914649f, - -0.9069888930615551f, - -0.9069337562906349f, - -0.9068786039796503f, - -0.9068234361295453f, - -0.9067682527412665f, - -0.906713053815758f, - -0.9066578393539665f, - -0.9066026093568376f, - -0.9065473638253183f, - -0.9064921027603547f, - -0.906436826162894f, - -0.9063815340338828f, - -0.9063262263742692f, - -0.9062709031850005f, - -0.9062155644670248f, - -0.9061602102212898f, - -0.9061048404487447f, - -0.9060494551503381f, - -0.9059940543270188f, - -0.9059386379797358f, - -0.9058832061094394f, - -0.9058277587170789f, - -0.9057722958036045f, - -0.9057168173699662f, - -0.9056613234171152f, - -0.9056058139460023f, - -0.9055502889575782f, - -0.9054947484527943f, - -0.9054391924326028f, - -0.9053836208979554f, - -0.9053280338498039f, - -0.9052724312891015f, - -0.9052168132168006f, - -0.9051611796338541f, - -0.9051055305412149f, - -0.9050498659398378f, - -0.9049941858306749f, - -0.9049384902146816f, - -0.9048827790928113f, - -0.9048270524660199f, - -0.9047713103352606f, - -0.9047155527014897f, - -0.9046597795656619f, - -0.9046039909287334f, - -0.90454818679166f, - -0.9044923671553979f, - -0.9044365320209029f, - -0.9043806813891327f, - -0.9043248152610439f, - -0.9042689336375938f, - -0.9042130365197393f, - -0.904157123908439f, - -0.9041011958046508f, - -0.9040452522093329f, - -0.9039892931234433f, - -0.9039333185479419f, - -0.9038773284837868f, - -0.9038213229319387f, - -0.9037653018933556f, - -0.9037092653689986f, - -0.9036532133598272f, - -0.9035971458668028f, - -0.9035410628908846f, - -0.9034849644330349f, - -0.9034288504942141f, - -0.9033727210753846f, - -0.9033165761775068f, - -0.903260415801544f, - -0.903204239948458f, - -0.903148048619211f, - -0.9030918418147665f, - -0.9030356195360874f, - -0.9029793817841367f, - -0.902923128559878f, - -0.9028668598642758f, - -0.9028105756982938f, - -0.9027542760628966f, - -0.9026979609590483f, - -0.9026416303877148f, - -0.9025852843498607f, - -0.9025289228464517f, - -0.902472545878453f, - -0.9024161534468315f, - -0.9023597455525529f, - -0.9023033221965838f, - -0.9022468833798908f, - -0.9021904291034415f, - -0.9021339593682031f, - -0.9020774741751428f, - -0.9020209735252284f, - -0.9019644574194287f, - -0.9019079258587113f, - -0.901851378844046f, - -0.9017948163764002f, - -0.9017382384567443f, - -0.9016816450860469f, - -0.9016250362652788f, - -0.9015684119954086f, - -0.9015117722774076f, - -0.9014551171122456f, - -0.9013984465008943f, - -0.9013417604443236f, - -0.9012850589435055f, - -0.9012283419994112f, - -0.901171609613013f, - -0.9011148617852828f, - -0.9010580985171929f, - -0.9010013198097155f, - -0.9009445256638243f, - -0.900887716080492f, - -0.9008308910606921f, - -0.900774050605398f, - -0.9007171947155841f, - -0.9006603233922245f, - -0.9006034366362935f, - -0.900546534448766f, - -0.9004896168306166f, - -0.9004326837828212f, - -0.900375735306355f, - -0.9003187714021939f, - -0.9002617920713133f, - -0.9002047973146907f, - -0.900147787133302f, - -0.9000907615281242f, - -0.900033720500134f, - -0.8999766640503095f, - -0.899919592179628f, - -0.8998625048890674f, - -0.8998054021796056f, - -0.8997482840522216f, - -0.8996911505078935f, - -0.8996340015476013f, - -0.8995768371723228f, - -0.8995196573830386f, - -0.8994624621807278f, - -0.8994052515663714f, - -0.8993480255409482f, - -0.8992907841054399f, - -0.8992335272608267f, - -0.8991762550080903f, - -0.8991189673482117f, - -0.8990616642821725f, - -0.8990043458109541f, - -0.8989470119355396f, - -0.898889662656911f, - -0.8988322979760507f, - -0.8987749178939415f, - -0.8987175224115672f, - -0.898660111529911f, - -0.8986026852499566f, - -0.8985452435726875f, - -0.8984877864990889f, - -0.8984303140301447f, - -0.8983728261668399f, - -0.8983153229101589f, - -0.898257804261088f, - -0.8982002702206123f, - -0.8981427207897177f, - -0.8980851559693898f, - -0.8980275757606156f, - -0.8979699801643817f, - -0.8979123691816747f, - -0.8978547428134819f, - -0.8977971010607902f, - -0.8977394439245882f, - -0.8976817714058628f, - -0.8976240835056037f, - -0.8975663802247976f, - -0.8975086615644344f, - -0.8974509275255025f, - -0.8973931781089921f, - -0.8973354133158913f, - -0.897277633147191f, - -0.8972198376038805f, - -0.8971620266869511f, - -0.8971042003973921f, - -0.8970463587361954f, - -0.8969885017043512f, - -0.8969306293028518f, - -0.8968727415326884f, - -0.8968148383948529f, - -0.896756919890337f, - -0.896698986020134f, - -0.896641036785236f, - -0.8965830721866361f, - -0.8965250922253272f, - -0.8964670969023033f, - -0.896409086218558f, - -0.8963510601750851f, - -0.8962930187728786f, - -0.8962349620129337f, - -0.8961768898962446f, - -0.8961188024238073f, - -0.8960606995966156f, - -0.8960025814156664f, - -0.8959444478819549f, - -0.8958862989964774f, - -0.8958281347602298f, - -0.8957699551742095f, - -0.895711760239413f, - -0.8956535499568372f, - -0.8955953243274801f, - -0.8955370833523391f, - -0.8954788270324121f, - -0.8954205553686969f, - -0.8953622683621928f, - -0.8953039660138982f, - -0.8952456483248119f, - -0.8951873152959329f, - -0.8951289669282615f, - -0.8950706032227972f, - -0.8950122241805398f, - -0.8949538298024894f, - -0.8948954200896473f, - -0.8948369950430138f, - -0.8947785546635904f, - -0.8947200989523776f, - -0.8946616279103781f, - -0.8946031415385933f, - -0.8945446398380253f, - -0.8944861228096763f, - -0.8944275904545496f, - -0.8943690427736477f, - -0.894310479767974f, - -0.8942519014385313f, - -0.8941933077863243f, - -0.8941346988123562f, - -0.8940760745176323f, - -0.8940174349031557f, - -0.8939587799699322f, - -0.8939001097189662f, - -0.8938414241512641f, - -0.8937827232678298f, - -0.8937240070696705f, - -0.8936652755577914f, - -0.8936065287332f, - -0.8935477665969013f, - -0.8934889891499035f, - -0.8934301963932129f, - -0.8933713883278375f, - -0.8933125649547848f, - -0.8932537262750626f, - -0.8931948722896788f, - -0.8931360029996425f, - -0.893077118405962f, - -0.8930182185096466f, - -0.892959303311705f, - -0.8929003728131468f, - -0.8928414270149823f, - -0.8927824659182211f, - -0.8927234895238736f, - -0.8926644978329498f, - -0.8926054908464615f, - -0.8925464685654191f, - -0.8924874309908343f, - -0.8924283781237179f, - -0.8923693099650828f, - -0.8923102265159407f, - -0.892251127777304f, - -0.8921920137501848f, - -0.8921328844355968f, - -0.8920737398345525f, - -0.8920145799480665f, - -0.8919554047771509f, - -0.8918962143228207f, - -0.8918370085860895f, - -0.8917777875679729f, - -0.891718551269484f, - -0.891659299691639f, - -0.8916000328354525f, - -0.891540750701941f, - -0.8914814532921189f, - -0.8914221406070033f, - -0.8913628126476097f, - -0.8913034694149556f, - -0.8912441109100573f, - -0.891184737133932f, - -0.8911253480875965f, - -0.8910659437720694f, - -0.891006524188368f, - -0.8909470893375105f, - -0.890887639220515f, - -0.8908281738384008f, - -0.8907686931921867f, - -0.8907091972828914f, - -0.8906496861115345f, - -0.8905901596791361f, - -0.8905306179867161f, - -0.8904710610352944f, - -0.8904114888258912f, - -0.8903519013595281f, - -0.8902922986372258f, - -0.8902326806600055f, - -0.8901730474288886f, - -0.8901133989448967f, - -0.8900537352090526f, - -0.8899940562223778f, - -0.889934361985896f, - -0.8898746525006287f, - -0.8898149277676f, - -0.8897551877878324f, - -0.8896954325623508f, - -0.8896356620921777f, - -0.8895758763783381f, - -0.889516075421856f, - -0.8894562592237568f, - -0.8893964277850643f, - -0.8893365811068046f, - -0.8892767191900025f, - -0.8892168420356844f, - -0.889156949644876f, - -0.8890970420186034f, - -0.8890371191578929f, - -0.8889771810637719f, - -0.888917227737267f, - -0.8888572591794056f, - -0.8887972753912149f, - -0.8887372763737232f, - -0.8886772621279585f, - -0.8886172326549491f, - -0.8885571879557229f, - -0.8884971280313099f, - -0.8884370528827381f, - -0.8883769625110383f, - -0.8883168569172384f, - -0.8882567361023697f, - -0.8881966000674616f, - -0.8881364488135448f, - -0.8880762823416495f, - -0.8880161006528074f, - -0.8879559037480493f, - -0.8878956916284068f, - -0.887835464294911f, - -0.8877752217485948f, - -0.88771496399049f, - -0.8876546910216288f, - -0.8875944028430445f, - -0.88753409945577f, - -0.8874737808608385f, - -0.8874134470592832f, - -0.8873530980521389f, - -0.8872927338404383f, - -0.8872323544252168f, - -0.8871719598075081f, - -0.8871115499883484f, - -0.8870511249687711f, - -0.8869906847498129f, - -0.8869302293325085f, - -0.8868697587178948f, - -0.8868092729070072f, - -0.8867487719008823f, - -0.8866882557005564f, - -0.8866277243070673f, - -0.8865671777214515f, - -0.8865066159447467f, - -0.8864460389779901f, - -0.8863854468222205f, - -0.8863248394784754f, - -0.8862642169477944f, - -0.8862035792312147f, - -0.8861429263297764f, - -0.8860822582445181f, - -0.8860215749764806f, - -0.8859608765267019f, - -0.8859001628962233f, - -0.8858394340860843f, - -0.8857786900973269f, - -0.88571793093099f, - -0.8856571565881161f, - -0.8855963670697456f, - -0.8855355623769211f, - -0.8854747425106839f, - -0.8854139074720763f, - -0.8853530572621405f, - -0.885292191881919f, - -0.8852313113324553f, - -0.8851704156147921f, - -0.8851095047299732f, - -0.8850485786790415f, - -0.8849876374630419f, - -0.8849266810830183f, - -0.8848657095400151f, - -0.8848047228350765f, - -0.8847437209692485f, - -0.884682703943576f, - -0.8846216717591041f, - -0.8845606244168787f, - -0.8844995619179462f, - -0.8844384842633527f, - -0.8843773914541447f, - -0.8843162834913687f, - -0.8842551603760724f, - -0.8841940221093029f, - -0.8841328686921077f, - -0.8840717001255342f, - -0.8840105164106313f, - -0.8839493175484467f, - -0.8838881035400302f, - -0.883826874386429f, - -0.8837656300886936f, - -0.8837043706478723f, - -0.8836430960650162f, - -0.8835818063411737f, - -0.8835205014773959f, - -0.8834591814747327f, - -0.8833978463342355f, - -0.8833364960569547f, - -0.8832751306439419f, - -0.8832137500962478f, - -0.8831523544149252f, - -0.8830909436010256f, - -0.8830295176556012f, - -0.8829680765797042f, - -0.8829066203743883f, - -0.8828451490407058f, - -0.8827836625797102f, - -0.8827221609924547f, - -0.8826606442799938f, - -0.8825991124433812f, - -0.8825375654836713f, - -0.8824760034019187f, - -0.8824144261991776f, - -0.8823528338765043f, - -0.8822912264349535f, - -0.8822296038755809f, - -0.8821679661994419f, - -0.8821063134075937f, - -0.882044645501092f, - -0.8819829624809936f, - -0.881921264348355f, - -0.8818595511042343f, - -0.881797822749688f, - -0.881736079285775f, - -0.8816743207135517f, - -0.8816125470340775f, - -0.8815507582484101f, - -0.8814889543576094f, - -0.8814271353627329f, - -0.8813653012648408f, - -0.881303452064992f, - -0.8812415877642477f, - -0.8811797083636658f, - -0.8811178138643081f, - -0.8810559042672343f, - -0.8809939795735061f, - -0.880932039784184f, - -0.8808700849003295f, - -0.8808081149230035f, - -0.8807461298532689f, - -0.8806841296921873f, - -0.8806221144408211f, - -0.8805600841002325f, - -0.880498038671485f, - -0.8804359781556416f, - -0.8803739025537656f, - -0.8803118118669201f, - -0.88024970609617f, - -0.880187585242579f, - -0.8801254493072116f, - -0.8800632982911318f, - -0.8800011321954058f, - -0.879938951021098f, - -0.879876754769274f, - -0.8798145434409991f, - -0.8797523170373401f, - -0.8796900755593628f, - -0.8796278190081334f, - -0.8795655473847197f, - -0.8795032606901872f, - -0.8794409589256044f, - -0.8793786420920379f, - -0.8793163101905567f, - -0.8792539632222273f, - -0.8791916011881191f, - -0.8791292240893f, - -0.8790668319268401f, - -0.8790044247018065f, - -0.8789420024152701f, - -0.8788795650682995f, - -0.8788171126619654f, - -0.8787546451973375f, - -0.8786921626754861f, - -0.8786296650974815f, - -0.8785671524643954f, - -0.8785046247772985f, - -0.8784420820372623f, - -0.8783795242453578f, - -0.8783169514026579f, - -0.8782543635102342f, - -0.8781917605691595f, - -0.8781291425805057f, - -0.8780665095453466f, - -0.8780038614647547f, - -0.8779411983398048f, - -0.8778785201715686f, - -0.8778158269611218f, - -0.8777531187095374f, - -0.8776903954178913f, - -0.8776276570872565f, - -0.8775649037187094f, - -0.8775021353133248f, - -0.877439351872178f, - -0.8773765533963447f, - -0.8773137398869015f, - -0.8772509113449245f, - -0.8771880677714896f, - -0.8771252091676747f, - -0.8770623355345561f, - -0.8769994468732115f, - -0.8769365431847178f, - -0.8768736244701538f, - -0.8768106907305971f, - -0.8767477419671262f, - -0.8766847781808191f, - -0.8766217993727556f, - -0.8765588055440144f, - -0.876495796695675f, - -0.8764327728288164f, - -0.8763697339445193f, - -0.8763066800438638f, - -0.8762436111279299f, - -0.8761805271977982f, - -0.8761174282545502f, - -0.8760543142992667f, - -0.8759911853330293f, - -0.8759280413569192f, - -0.8758648823720191f, - -0.8758017083794104f, - -0.875738519380177f, - -0.8756753153753998f, - -0.875612096366163f, - -0.875548862353549f, - -0.8754856133386427f, - -0.8754223493225262f, - -0.8753590703062846f, - -0.8752957762910013f, - -0.8752324672777623f, - -0.8751691432676506f, - -0.8751058042617524f, - -0.8750424502611522f, - -0.8749790812669366f, - -0.8749156972801907f, - -0.8748522983020008f, - -0.8747888843334526f, - -0.8747254553756337f, - -0.8746620114296304f, - -0.8745985524965298f, - -0.874535078577419f, - -0.8744715896733861f, - -0.874408085785519f, - -0.8743445669149054f, - -0.8742810330626339f, - -0.8742174842297927f, - -0.8741539204174715f, - -0.874090341626759f, - -0.8740267478587448f, - -0.8739631391145178f, - -0.873899515395169f, - -0.8738358767017881f, - -0.8737722230354655f, - -0.8737085543972916f, - -0.8736448707883581f, - -0.8735811722097556f, - -0.8735174586625758f, - -0.87345373014791f, - -0.8733899866668507f, - -0.8733262282204897f, - -0.8732624548099205f, - -0.8731986664362342f, - -0.8731348631005252f, - -0.8730710448038856f, - -0.8730072115474106f, - -0.8729433633321918f, - -0.8728795001593248f, - -0.872815622029903f, - -0.8727517289450217f, - -0.8726878209057755f, - -0.872623897913259f, - -0.8725599599685674f, - -0.8724960070727971f, - -0.8724320392270434f, - -0.8723680564324025f, - -0.8723040586899701f, - -0.8722400460008437f, - -0.8721760183661198f, - -0.8721119757868955f, - -0.8720479182642676f, - -0.8719838457993347f, - -0.8719197583931942f, - -0.8718556560469441f, - -0.8717915387616826f, - -0.8717274065385089f, - -0.8716632593785216f, - -0.8715990972828199f, - -0.8715349202525028f, - -0.8714707282886706f, - -0.8714065213924229f, - -0.87134229956486f, - -0.8712780628070821f, - -0.8712138111201895f, - -0.8711495445052841f, - -0.8710852629634662f, - -0.8710209664958385f, - -0.870956655103501f, - -0.8708923287875568f, - -0.8708279875491076f, - -0.8707636313892569f, - -0.8706992603091058f, - -0.8706348743097585f, - -0.8705704733923174f, - -0.8705060575578872f, - -0.8704416268075702f, - -0.8703771811424714f, - -0.8703127205636944f, - -0.8702482450723443f, - -0.8701837546695258f, - -0.8701192493563437f, - -0.8700547291339029f, - -0.8699901940033098f, - -0.8699256439656698f, - -0.8698610790220889f, - -0.869796499173673f, - -0.8697319044215295f, - -0.8696672947667643f, - -0.8696026702104859f, - -0.8695380307537997f, - -0.8694733763978147f, - -0.8694087071436379f, - -0.8693440229923787f, - -0.8692793239451436f, - -0.8692146100030427f, - -0.8691498811671842f, - -0.8690851374386772f, - -0.8690203788186308f, - -0.8689556053081554f, - -0.8688908169083606f, - -0.8688260136203557f, - -0.8687611954452524f, - -0.8686963623841607f, - -0.8686315144381915f, - -0.8685666516084555f, - -0.8685017738960651f, - -0.8684368813021314f, - -0.8683719738277663f, - -0.8683070514740816f, - -0.8682421142421911f, - -0.8681771621332056f, - -0.8681121951482395f, - -0.868047213288405f, - -0.8679822165548163f, - -0.867917204948587f, - -0.8678521784708308f, - -0.8677871371226615f, - -0.8677220809051945f, - -0.8676570098195442f, - -0.8675919238668254f, - -0.8675268230481529f, - -0.867461707364643f, - -0.8673965768174112f, - -0.8673314314075734f, - -0.8672662711362453f, - -0.8672010960045445f, - -0.8671359060135868f, - -0.8670707011644904f, - -0.867005481458371f, - -0.8669402468963472f, - -0.8668749974795361f, - -0.8668097332090571f, - -0.8667444540860265f, - -0.8666791601115643f, - -0.8666138512867884f, - -0.8665485276128188f, - -0.8664831890907742f, - -0.8664178357217742f, - -0.8663524675069383f, - -0.8662870844473873f, - -0.8662216865442413f, - -0.8661562737986206f, - -0.8660908462116461f, - -0.8660254037844386f, - -0.8659599465181201f, - -0.8658944744138121f, - -0.8658289874726359f, - -0.8657634856957137f, - -0.8656979690841684f, - -0.8656324376391223f, - -0.8655668913616983f, - -0.865501330253019f, - -0.8654357543142086f, - -0.8653701635463904f, - -0.8653045579506883f, - -0.8652389375282258f, - -0.8651733022801283f, - -0.8651076522075202f, - -0.865041987311526f, - -0.8649763075932707f, - -0.8649106130538805f, - -0.8648449036944801f, - -0.8647791795161969f, - -0.8647134405201551f, - -0.8646476867074826f, - -0.8645819180793052f, - -0.864516134636751f, - -0.8644503363809456f, - -0.8643845233130175f, - -0.8643186954340938f, - -0.8642528527453037f, - -0.8641869952477734f, - -0.864121122942633f, - -0.8640552358310102f, - -0.8639893339140347f, - -0.8639234171928354f, - -0.8638574856685418f, - -0.863791539342283f, - -0.8637255782151901f, - -0.8636596022883928f, - -0.8635936115630214f, - -0.8635276060402064f, - -0.8634615857210796f, - -0.8633955506067718f, - -0.8633295006984145f, - -0.863263435997139f, - -0.8631973565040781f, - -0.8631312622203638f, - -0.8630651531471286f, - -0.862999029285505f, - -0.8629328906366258f, - -0.8628667372016251f, - -0.862800568981636f, - -0.8627343859777922f, - -0.8626681881912274f, - -0.8626019756230766f, - -0.8625357482744735f, - -0.8624695061465544f, - -0.8624032492404524f, - -0.8623369775573041f, - -0.8622706910982443f, - -0.8622043898644101f, - -0.8621380738569355f, - -0.8620717430769586f, - -0.8620053975256147f, - -0.8619390372040421f, - -0.8618726621133761f, - -0.8618062722547553f, - -0.8617398676293164f, - -0.8616734482381981f, - -0.8616070140825381f, - -0.8615405651634747f, - -0.861474101482146f, - -0.8614076230396918f, - -0.8613411298372506f, - -0.8612746218759619f, - -0.8612080991569648f, - -0.8611415616814f, - -0.8610750094504073f, - -0.8610084424651268f, - -0.8609418607266989f, - -0.8608752642362651f, - -0.8608086529949663f, - -0.8607420270039439f, - -0.8606753862643389f, - -0.860608730777294f, - -0.8605420605439512f, - -0.8604753755654526f, - -0.8604086758429405f, - -0.8603419613775585f, - -0.8602752321704495f, - -0.8602084882227569f, - -0.8601417295356236f, - -0.8600749561101948f, - -0.8600081679476139f, - -0.859941365049025f, - -0.8598745474155735f, - -0.8598077150484039f, - -0.8597408679486614f, - -0.859674006117491f, - -0.8596071295560397f, - -0.8595402382654515f, - -0.8594733322468739f, - -0.8594064115014526f, - -0.859339476030335f, - -0.8592725258346677f, - -0.8592055609155979f, - -0.8591385812742723f, - -0.8590715869118398f, - -0.8590045778294477f, - -0.8589375540282442f, - -0.8588705155093773f, - -0.8588034622739967f, - -0.8587363943232508f, - -0.8586693116582886f, - -0.8586022142802594f, - -0.8585351021903137f, - -0.8584679753896005f, - -0.8584008338792714f, - -0.858333677660475f, - -0.8582665067343632f, - -0.8581993211020864f, - -0.858132120764797f, - -0.8580649057236446f, - -0.8579976759797823f, - -0.8579304315343611f, - -0.8578631723885347f, - -0.8577958985434537f, - -0.8577286100002722f, - -0.8576613067601422f, - -0.8575939888242179f, - -0.8575266561936523f, - -0.8574593088695991f, - -0.8573919468532123f, - -0.8573245701456457f, - -0.8572571787480545f, - -0.8571897726615934f, - -0.8571223518874169f, - -0.8570549164266801f, - -0.8569874662805393f, - -0.8569200014501498f, - -0.8568525219366676f, - -0.8567850277412484f, - -0.8567175188650498f, - -0.8566499953092278f, - -0.8565824570749396f, - -0.8565149041633421f, - -0.8564473365755935f, - -0.8563797543128511f, - -0.856312157376273f, - -0.856244545767017f, - -0.8561769194862424f, - -0.8561092785351078f, - -0.8560416229147718f, - -0.8559739526263934f, - -0.8559062676711331f, - -0.8558385680501497f, - -0.8557708537646046f, - -0.8557031248156561f, - -0.8556353812044662f, - -0.8555676229321948f, - -0.8554998500000043f, - -0.8554320624090539f, - -0.8553642601605068f, - -0.8552964432555237f, - -0.8552286116952675f, - -0.8551607654809003f, - -0.8550929046135842f, - -0.8550250290944817f, - -0.854957138924757f, - -0.8548892341055726f, - -0.8548213146380921f, - -0.8547533805234788f, - -0.8546854317628979f, - -0.8546174683575128f, - -0.8545494903084885f, - -0.8544814976169889f, - -0.8544134902841802f, - -0.8543454683112273f, - -0.8542774316992954f, - -0.8542093804495506f, - -0.8541413145631583f, - -0.854073234041286f, - -0.8540051388850994f, - -0.8539370290957655f, - -0.8538689046744509f, - -0.8538007656223237f, - -0.8537326119405511f, - -0.8536644436303007f, - -0.8535962606927403f, - -0.8535280631290391f, - -0.8534598509403646f, - -0.8533916241278872f, - -0.8533233826927737f, - -0.8532551266361953f, - -0.8531868559593202f, - -0.8531185706633198f, - -0.8530502707493621f, - -0.8529819562186192f, - -0.8529136270722603f, - -0.8528452833114577f, - -0.8527769249373807f, - -0.852708551951202f, - -0.8526401643540921f, - -0.8525717621472239f, - -0.8525033453317687f, - -0.8524349139088991f, - -0.8523664678797871f, - -0.8522980072456064f, - -0.8522295320075296f, - -0.85216104216673f, - -0.8520925377243808f, - -0.8520240186816564f, - -0.8519554850397308f, - -0.8518869367997781f, - -0.8518183739629724f, - -0.8517497965304895f, - -0.8516812045035039f, - -0.851612597883191f, - -0.8515439766707258f, - -0.8514753408672852f, - -0.8514066904740445f, - -0.8513380254921802f, - -0.8512693459228684f, - -0.8512006517672869f, - -0.851131943026612f, - -0.8510632197020208f, - -0.8509944817946923f, - -0.8509257293058022f, - -0.8508569622365302f, - -0.8507881805880535f, - -0.850719384361552f, - -0.850650573558203f, - -0.8505817481791864f, - -0.850512908225681f, - -0.8504440536988677f, - -0.8503751845999243f, - -0.8503063009300323f, - -0.8502374026903712f, - -0.8501684898821222f, - -0.8500995625064659f, - -0.8500306205645833f, - -0.8499616640576552f, - -0.849892692986864f, - -0.8498237073533911f, - -0.8497547071584186f, - -0.8496856924031283f, - -0.8496166630887038f, - -0.8495476192163272f, - -0.8494785607871815f, - -0.8494094878024498f, - -0.8493404002633166f, - -0.8492712981709646f, - -0.8492021815265792f, - -0.849133050331343f, - -0.8490639045864418f, - -0.8489947442930594f, - -0.8489255694523825f, - -0.8488563800655944f, - -0.8487871761338819f, - -0.8487179576584305f, - -0.8486487246404262f, - -0.8485794770810549f, - -0.8485102149815038f, - -0.8484409383429595f, - -0.8483716471666084f, - -0.8483023414536389f, - -0.8482330212052379f, - -0.8481636864225932f, - -0.8480943371068925f, - -0.8480249732593249f, - -0.8479555948810784f, - -0.847886201973342f, - -0.8478167945373041f, - -0.8477473725741548f, - -0.8476779360850835f, - -0.8476084850712796f, - -0.8475390195339328f, - -0.8474695394742345f, - -0.8474000448933746f, - -0.8473305357925438f, - -0.8472610121729327f, - -0.8471914740357336f, - -0.8471219213821374f, - -0.8470523542133359f, - -0.8469827725305208f, - -0.846913176334885f, - -0.8468435656276204f, - -0.846773940409921f, - -0.846704300682978f, - -0.846634646447986f, - -0.8465649777061376f, - -0.8464952944586279f, - -0.8464255967066491f, - -0.8463558844513969f, - -0.8462861576940647f, - -0.8462164164358489f, - -0.8461466606779423f, - -0.8460768904215419f, - -0.846007105667842f, - -0.8459373064180394f, - -0.8458674926733296f, - -0.8457976644349088f, - -0.8457278217039731f, - -0.8456579644817201f, - -0.8455880927693463f, - -0.8455182065680491f, - -0.8454483058790258f, - -0.8453783907034736f, - -0.8453084610425916f, - -0.8452385168975776f, - -0.8451685582696299f, - -0.8450985851599467f, - -0.8450285975697281f, - -0.8449585955001729f, - -0.8448885789524804f, - -0.8448185479278497f, - -0.8447485024274821f, - -0.8446784424525771f, - -0.844608368004335f, - -0.8445382790839564f, - -0.844468175692643f, - -0.844398057831595f, - -0.8443279255020155f, - -0.844257778705104f, - -0.8441876174420642f, - -0.844117441714097f, - -0.8440472515224064f, - -0.8439770468681934f, - -0.843906827752662f, - -0.8438365941770147f, - -0.8437663461424564f, - -0.8436960836501887f, - -0.843625806701417f, - -0.8435555152973444f, - -0.8434852094391766f, - -0.8434148891281176f, - -0.8433445543653723f, - -0.8432742051521454f, - -0.8432038414896432f, - -0.8431334633790711f, - -0.8430630708216349f, - -0.8429926638185402f, - -0.8429222423709944f, - -0.8428518064802039f, - -0.8427813561473751f, - -0.8427108913737152f, - -0.8426404121604323f, - -0.8425699185087335f, - -0.8424994104198268f, - -0.8424288878949199f, - -0.842358350935222f, - -0.8422877995419413f, - -0.8422172337162869f, - -0.842146653459467f, - -0.8420760587726923f, - -0.842005449657172f, - -0.8419348261141155f, - -0.8418641881447334f, - -0.8417935357502354f, - -0.841722868931833f, - -0.8416521876907361f, - -0.8415814920281575f, - -0.8415107819453063f, - -0.8414400574433957f, - -0.8413693185236365f, - -0.8412985651872423f, - -0.8412277974354235f, - -0.8411570152693942f, - -0.8410862186903663f, - -0.8410154076995536f, - -0.8409445822981693f, - -0.8408737424874265f, - -0.840802888268539f, - -0.8407320196427216f, - -0.8406611366111881f, - -0.8405902391751532f, - -0.8405193273358312f, - -0.8404484010944381f, - -0.8403774604521886f, - -0.8403065054102984f, - -0.8402355359699828f, - -0.8401645521324588f, - -0.8400935538989416f, - -0.8400225412706493f, - -0.8399515142487968f, - -0.8398804728346024f, - -0.8398094170292831f, - -0.8397383468340563f, - -0.8396672622501393f, - -0.8395961632787511f, - -0.8395250499211094f, - -0.8394539221784328f, - -0.8393827800519397f, - -0.8393116235428497f, - -0.8392404526523819f, - -0.8391692673817552f, - -0.8390980677321903f, - -0.8390268537049066f, - -0.8389556253011246f, - -0.838884382522064f, - -0.8388131253689466f, - -0.838741853842993f, - -0.8386705679454243f, - -0.8385992676774615f, - -0.8385279530403278f, - -0.8384566240352432f, - -0.8383852806634313f, - -0.8383139229261136f, - -0.8382425508245139f, - -0.8381711643598545f, - -0.8380997635333587f, - -0.8380283483462493f, - -0.8379569187997511f, - -0.8378854748950875f, - -0.8378140166334825f, - -0.8377425440161603f, - -0.8376710570443464f, - -0.8375995557192653f, - -0.8375280400421421f, - -0.8374565100142016f, - -0.8373849656366706f, - -0.8373134069107739f, - -0.8372418338377393f, - -0.837170246418791f, - -0.8370986446551573f, - -0.8370270285480638f, - -0.8369553980987394f, - -0.8368837533084094f, - -0.8368120941783027f, - -0.8367404207096465f, - -0.8366687329036697f, - -0.8365970307616002f, - -0.8365253142846666f, - -0.8364535834740973f, - -0.8363818383311222f, - -0.8363100788569704f, - -0.8362383050528712f, - -0.8361665169200546f, - -0.8360947144597501f, - -0.8360228976731892f, - -0.8359510665616017f, - -0.8358792211262185f, - -0.8358073613682702f, - -0.835735487288989f, - -0.8356635988896062f, - -0.8355916961713532f, - -0.8355197791354618f, - -0.8354478477831653f, - -0.8353759021156955f, - -0.8353039421342853f, - -0.8352319678401673f, - -0.8351599792345756f, - -0.8350879763187433f, - -0.8350159590939042f, - -0.8349439275612918f, - -0.8348718817221411f, - -0.8347998215776858f, - -0.8347277471291621f, - -0.834655658377803f, - -0.8345835553248452f, - -0.834511437971523f, - -0.8344393063190739f, - -0.8343671603687317f, - -0.8342950001217341f, - -0.8342228255793166f, - -0.8341506367427173f, - -0.8340784336131712f, - -0.8340062161919171f, - -0.8339339844801912f, - -0.8338617384792323f, - -0.8337894781902777f, - -0.8337172036145657f, - -0.8336449147533342f, - -0.8335726116078228f, - -0.8335002941792699f, - -0.8334279624689146f, - -0.8333556164779958f, - -0.8332832562077542f, - -0.8332108816594291f, - -0.8331384928342608f, - -0.8330660897334888f, - -0.832993672358355f, - -0.8329212407100997f, - -0.8328487947899639f, - -0.832776334599189f, - -0.8327038601390161f, - -0.832631371410688f, - -0.8325588684154464f, - -0.8324863511545334f, - -0.8324138196291913f, - -0.8323412738406636f, - -0.8322687137901926f, - -0.8321961394790232f, - -0.8321235509083966f, - -0.8320509480795584f, - -0.8319783309937513f, - -0.8319056996522214f, - -0.8318330540562111f, - -0.8317603942069666f, - -0.831687720105732f, - -0.831615031753754f, - -0.8315423291522761f, - -0.8314696123025455f, - -0.8313968812058072f, - -0.8313241358633086f, - -0.8312513762762953f, - -0.8311786024460144f, - -0.8311058143737121f, - -0.8310330120606368f, - -0.8309601955080353f, - -0.8308873647171554f, - -0.8308145196892445f, - -0.8307416604255516f, - -0.8306687869273249f, - -0.8305958991958129f, - -0.8305229972322641f, - -0.8304500810379286f, - -0.8303771506140554f, - -0.8303042059618939f, - -0.8302312470826938f, - -0.830158273977706f, - -0.8300852866481805f, - -0.8300122850953678f, - -0.8299392693205183f, - -0.8298662393248842f, - -0.8297931951097164f, - -0.8297201366762662f, - -0.8296470640257853f, - -0.8295739771595264f, - -0.8295008760787416f, - -0.8294277607846829f, - -0.8293546312786045f, - -0.8292814875617577f, - -0.8292083296353971f, - -0.8291351575007753f, - -0.8290619711591476f, - -0.8289887706117659f, - -0.8289155558598862f, - -0.8288423269047618f, - -0.8287690837476486f, - -0.8286958263898011f, - -0.8286225548324744f, - -0.8285492690769236f, - -0.8284759691244055f, - -0.8284026549761754f, - -0.8283293266334896f, - -0.8282559840976041f, - -0.8281826273697765f, - -0.8281092564512634f, - -0.828035871343322f, - -0.8279624720472091f, - -0.8278890585641834f, - -0.8278156308955018f, - -0.827742189042424f, - -0.8276687330062065f, - -0.8275952627881094f, - -0.8275217783893903f, - -0.8274482798113104f, - -0.8273747670551266f, - -0.8273012401221003f, - -0.8272276990134901f, - -0.8271541437305578f, - -0.8270805742745618f, - -0.8270069906467641f, - -0.826933392848425f, - -0.8268597808808051f, - -0.8267861547451668f, - -0.826712514442771f, - -0.8266388599748797f, - -0.8265651913427544f, - -0.8264915085476583f, - -0.8264178115908535f, - -0.8263441004736027f, - -0.8262703751971686f, - -0.8261966357628152f, - -0.8261228821718059f, - -0.826049114425404f, - -0.8259753325248732f, - -0.8259015364714787f, - -0.8258277262664846f, - -0.8257539019111554f, - -0.8256800634067557f, - -0.8256062107545518f, - -0.8255323439558084f, - -0.8254584630117914f, - -0.8253845679237661f, - -0.8253106586929997f, - -0.8252367353207577f, - -0.8251627978083081f, - -0.8250888461569159f, - -0.8250148803678498f, - -0.824940900442376f, - -0.8248669063817639f, - -0.8247928981872791f, - -0.8247188758601913f, - -0.8246448394017679f, - -0.8245707888132789f, - -0.8244967240959913f, - -0.8244226452511756f, - -0.8243485522801f, - -0.8242744451840351f, - -0.8242003239642505f, - -0.8241261886220158f, - -0.8240520391586011f, - -0.8239778755752779f, - -0.8239036978733163f, - -0.8238295060539875f, - -0.8237553001185621f, - -0.8236810800683128f, - -0.8236068459045106f, - -0.8235325976284277f, - -0.8234583352413362f, - -0.823384058744508f, - -0.823309768139217f, - -0.8232354634267355f, - -0.8231611446083368f, - -0.8230868116852936f, - -0.823012464658881f, - -0.822938103530372f, - -0.8228637283010409f, - -0.8227893389721618f, - -0.82271493554501f, - -0.8226405180208601f, - -0.8225660864009872f, - -0.822491640686666f, - -0.8224171808791734f, - -0.8223427069797841f, - -0.8222682189897755f, - -0.8221937169104223f, - -0.8221192007430023f, - -0.8220446704887914f, - -0.8219701261490682f, - -0.8218955677251079f, - -0.8218209952181896f, - -0.8217464086295901f, - -0.8216718079605889f, - -0.8215971932124622f, - -0.8215225643864901f, - -0.8214479214839503f, - -0.8213732645061228f, - -0.8212985934542862f, - -0.8212239083297203f, - -0.8211492091337039f, - -0.8210744958675182f, - -0.8209997685324429f, - -0.8209250271297583f, - -0.8208502716607446f, - -0.8207755021266839f, - -0.8207007185288566f, - -0.8206259208685444f, - -0.820551109147028f, - -0.8204762833655906f, - -0.8204014435255138f, - -0.8203265896280798f, - -0.8202517216745709f, - -0.8201768396662709f, - -0.8201019436044622f, - -0.8200270334904284f, - -0.8199521093254523f, - -0.8198771711108188f, - -0.8198022188478116f, - -0.8197272525377143f, - -0.819652272181813f, - -0.8195772777813904f, - -0.8195022693377331f, - -0.8194272468521253f, - -0.819352210325854f, - -0.819277159760203f, - -0.8192020951564597f, - -0.8191270165159092f, - -0.8190519238398396f, - -0.8189768171295356f, - -0.8189016963862856f, - -0.8188265616113758f, - -0.8187514128060945f, - -0.818676249971729f, - -0.8186010731095672f, - -0.8185258822208965f, - -0.8184506773070066f, - -0.8183754583691853f, - -0.8183002254087217f, - -0.8182249784269043f, - -0.8181497174250235f, - -0.8180744424043683f, - -0.8179991533662285f, - -0.8179238503118937f, - -0.8178485332426553f, - -0.8177732021598025f, - -0.817697857064628f, - -0.8176224979584206f, - -0.817547124842473f, - -0.8174717377180759f, - -0.8173963365865224f, - -0.8173209214491025f, - -0.81724549230711f, - -0.8171700491618367f, - -0.8170945920145748f, - -0.8170191208666184f, - -0.8169436357192601f, - -0.8168681365737932f, - -0.816792623431511f, - -0.8167170962937085f, - -0.816641555161679f, - -0.8165660000367172f, - -0.8164904309201171f, - -0.8164148478131745f, - -0.8163392507171842f, - -0.8162636396334412f, - -0.8161880145632407f, - -0.8161123755078797f, - -0.8160367224686537f, - -0.8159610554468588f, - -0.8158853744437913f, - -0.8158096794607487f, - -0.8157339704990276f, - -0.8156582475599253f, - -0.815582510644739f, - -0.8155067597547669f, - -0.8154309948913071f, - -0.8153552160556573f, - -0.8152794232491157f, - -0.815203616472982f, - -0.815127795728554f, - -0.8150519610171324f, - -0.8149761123400148f, - -0.814900249698502f, - -0.8148243730938931f, - -0.8147484825274899f, - -0.8146725780005903f, - -0.8145966595144969f, - -0.8145207270705092f, - -0.8144447806699299f, - -0.8143688203140583f, - -0.8142928460041975f, - -0.8142168577416482f, - -0.8141408555277136f, - -0.8140648393636954f, - -0.8139888092508961f, - -0.813912765190618f, - -0.8138367071841649f, - -0.8137606352328398f, - -0.813684549337946f, - -0.8136084495007874f, - -0.8135323357226673f, - -0.8134562080048907f, - -0.8133800663487619f, - -0.8133039107555855f, - -0.8132277412266656f, - -0.8131515577633087f, - -0.8130753603668196f, - -0.8129991490385038f, - -0.8129229237796666f, - -0.8128466845916154f, - -0.8127704314756558f, - -0.8126941644330944f, - -0.8126178834652374f, - -0.8125415885733933f, - -0.812465279758868f, - -0.8123889570229705f, - -0.8123126203670068f, - -0.8122362697922864f, - -0.8121599053001163f, - -0.8120835268918067f, - -0.8120071345686642f, - -0.8119307283319994f, - -0.8118543081831203f, - -0.8117778741233381f, - -0.8117014261539603f, - -0.8116249642762984f, - -0.8115484884916614f, - -0.8114719988013609f, - -0.8113954952067068f, - -0.8113189777090103f, - -0.8112424463095815f, - -0.8111659010097333f, - -0.8110893418107765f, - -0.811012768714023f, - -0.8109361817207841f, - -0.8108595808323735f, - -0.8107829660501029f, - -0.8107063373752854f, - -0.8106296948092332f, - -0.8105530383532608f, - -0.8104763680086808f, - -0.8103996837768075f, - -0.8103229856589539f, - -0.8102462736564354f, - -0.8101695477705659f, - -0.81009280800266f, - -0.8100160543540328f, - -0.8099392868259988f, - -0.8098625054198745f, - -0.8097857101369749f, - -0.8097089009786158f, - -0.8096320779461131f, - -0.8095552410407839f, - -0.809478390263944f, - -0.8094015256169114f, - -0.8093246471010014f, - -0.8092477547175327f, - -0.8091708484678218f, - -0.8090939283531882f, - -0.8090169943749476f, - -0.8089400465344199f, - -0.8088630848329225f, - -0.8087861092717751f, - -0.8087091198522963f, - -0.8086321165758052f, - -0.8085550994436208f, - -0.8084780684570637f, - -0.8084010236174533f, - -0.8083239649261097f, - -0.8082468923843529f, - -0.8081698059935044f, - -0.8080927057548847f, - -0.8080155916698147f, - -0.8079384637396154f, - -0.8078613219656093f, - -0.8077841663491172f, - -0.8077069968914626f, - -0.8076298135939659f, - -0.807552616457951f, - -0.8074754054847402f, - -0.8073981806756564f, - -0.8073209420320224f, - -0.8072436895551627f, - -0.8071664232464005f, - -0.8070891431070597f, - -0.8070118491384639f, - -0.8069345413419386f, - -0.8068572197188081f, - -0.8067798842703965f, - -0.80670253499803f, - -0.8066251719030336f, - -0.8065477949867328f, - -0.8064704042504528f, - -0.8063929996955214f, - -0.8063155813232628f, - -0.806238149135005f, - -0.8061607031320739f, - -0.806083243315798f, - -0.8060057696875023f, - -0.8059282822485161f, - -0.805850781000166f, - -0.805773265943781f, - -0.8056957370806888f, - -0.8056181944122177f, - -0.8055406379396961f, - -0.8054630676644537f, - -0.8053854835878194f, - -0.8053078857111223f, - -0.8052302740356916f, - -0.8051526485628583f, - -0.8050750092939514f, - -0.8049973562303027f, - -0.8049196893732407f, - -0.8048420087240978f, - -0.804764314284204f, - -0.8046866060548922f, - -0.8046088840374918f, - -0.8045311482333359f, - -0.8044533986437558f, - -0.8043756352700849f, - -0.8042978581136538f, - -0.8042200671757967f, - -0.8041422624578457f, - -0.8040644439611346f, - -0.8039866116869965f, - -0.803908765636765f, - -0.8038309058117741f, - -0.8037530322133573f, - -0.8036751448428497f, - -0.8035972437015859f, - -0.8035193287909003f, - -0.8034414001121275f, - -0.803363457666604f, - -0.8032855014556647f, - -0.8032075314806453f, - -0.8031295477428813f, - -0.80305155024371f, - -0.8029735389844673f, - -0.8028955139664901f, - -0.8028174751911145f, - -0.8027394226596789f, - -0.8026613563735202f, - -0.8025832763339761f, - -0.8025051825423837f, - -0.8024270750000824f, - -0.80234895370841f, - -0.802270818668705f, - -0.8021926698823056f, - -0.8021145073505522f, - -0.8020363310747829f, - -0.8019581410563388f, - -0.8018799372965575f, - -0.8018017197967806f, - -0.8017234885583474f, - -0.8016452435825999f, - -0.8015669848708766f, - -0.8014887124245201f, - -0.8014104262448706f, - -0.8013321263332709f, - -0.8012538126910608f, - -0.8011754853195835f, - -0.8010971442201802f, - -0.8010187893941942f, - -0.8009404208429677f, - -0.8008620385678435f, - -0.8007836425701641f, - -0.8007052328512739f, - -0.8006268094125158f, - -0.8005483722552337f, - -0.8004699213807709f, - -0.8003914567904727f, - -0.8003129784856833f, - -0.8002344864677471f, - -0.8001559807380088f, - -0.8000774612978143f, - -0.7999989281485087f, - -0.7999203812914376f, - -0.7998418207279469f, - -0.7997632464593821f, - -0.7996846584870907f, - -0.7996060568124187f, - -0.7995274414367131f, - -0.79944881236132f, - -0.7993701695875882f, - -0.7992915131168639f, - -0.7992128429504965f, - -0.799134159089832f, - -0.79905546153622f, - -0.798976750291008f, - -0.7988980253555463f, - -0.7988192867311819f, - -0.7987405344192651f, - -0.7986617684211447f, - -0.7985829887381716f, - -0.7985041953716937f, - -0.7984253883230626f, - -0.7983465675936278f, - -0.7982677331847406f, - -0.7981888850977517f, - -0.7981100233340117f, - -0.7980311478948716f, - -0.7979522587816839f, - -0.7978733559957998f, - -0.7977944395385713f, - -0.79771550941135f, - -0.7976365656154897f, - -0.7975576081523422f, - -0.7974786370232606f, - -0.7973996522295974f, - -0.7973206537727072f, - -0.797241641653943f, - -0.7971626158746585f, - -0.7970835764362076f, - -0.7970045233399454f, - -0.796925456587226f, - -0.7968463761794043f, - -0.7967672821178347f, - -0.7966881744038734f, - -0.7966090530388754f, - -0.7965299180241961f, - -0.7964507693611924f, - -0.7963716070512198f, - -0.796292431095635f, - -0.7962132414957939f, - -0.7961340382530551f, - -0.7960548213687736f, - -0.7959755908443082f, - -0.7958963466810157f, - -0.7958170888802554f, - -0.7957378174433831f, - -0.795658532371759f, - -0.7955792336667402f, - -0.7954999213296867f, - -0.7954205953619571f, - -0.7953412557649103f, - -0.7952619025399056f, - -0.7951825356883034f, - -0.7951031552114635f, - -0.7950237611107457f, - -0.79494435338751f, - -0.7948649320431181f, - -0.7947854970789304f, - -0.7947060484963079f, - -0.7946265862966113f, - -0.7945471104812035f, - -0.7944676210514451f, - -0.7943881180086997f, - -0.7943086013543273f, - -0.7942290710896923f, - -0.7941495272161562f, - -0.7940699697350835f, - -0.7939903986478354f, - -0.7939108139557768f, - -0.7938312156602703f, - -0.7937516037626815f, - -0.7936719782643723f, - -0.7935923391667088f, - -0.793512686471055f, - -0.793433020178775f, - -0.7933533402912352f, - -0.7932736468098002f, - -0.7931939397358356f, - -0.7931142190707066f, - -0.7930344848157802f, - -0.7929547369724222f, - -0.792874975541999f, - -0.7927952005258768f, - -0.7927154119254236f, - -0.7926356097420059f, - -0.7925557939769912f, - -0.7924759646317465f, - -0.7923961217076408f, - -0.7923162652060416f, - -0.7922363951283173f, - -0.7921565114758359f, - -0.7920766142499671f, - -0.7919967034520796f, - -0.7919167790835425f, - -0.7918368411457248f, - -0.7917568896399974f, - -0.791676924567729f, - -0.7915969459302914f, - -0.791516953729053f, - -0.7914369479653859f, - -0.79135692864066f, - -0.7912768957562479f, - -0.7911968493135191f, - -0.7911167893138464f, - -0.7910367157586008f, - -0.7909566286491558f, - -0.7908765279868816f, - -0.7907964137731522f, - -0.7907162860093395f, - -0.7906361446968173f, - -0.7905559898369585f, - -0.7904758214311363f, - -0.7903956394807239f, - -0.7903154439870963f, - -0.7902352349516271f, - -0.7901550123756906f, - -0.7900747762606609f, - -0.7899945266079139f, - -0.7899142634188242f, - -0.7898339866947669f, - -0.7897536964371177f, - -0.7896733926472517f, - -0.7895930753265459f, - -0.7895127444763762f, - -0.7894324000981189f, - -0.78935204219315f, - -0.7892716707628479f, - -0.7891912858085888f, - -0.7891108873317503f, - -0.7890304753337093f, - -0.7889500498158448f, - -0.7888696107795344f, - -0.7887891582261564f, - -0.7887086921570886f, - -0.7886282125737111f, - -0.7885477194774017f, - -0.7884672128695411f, - -0.7883866927515069f, - -0.7883061591246802f, - -0.7882256119904398f, - -0.7881450513501677f, - -0.788064477205242f, - -0.7879838895570448f, - -0.787903288406956f, - -0.7878226737563578f, - -0.787742045606631f, - -0.787661403959157f, - -0.7875807488153171f, - -0.7875000801764944f, - -0.7874193980440706f, - -0.787338702419428f, - -0.7872579933039491f, - -0.7871772706990176f, - -0.7870965346060163f, - -0.7870157850263284f, - -0.7869350219613372f, - -0.7868542454124275f, - -0.7867734553809829f, - -0.7866926518683878f, - -0.7866118348760259f, - -0.7865310044052835f, - -0.7864501604575446f, - -0.7863693030341947f, - -0.7862884321366188f, - -0.7862075477662036f, - -0.7861266499243345f, - -0.7860457386123975f, - -0.7859648138317792f, - -0.7858838755838655f, - -0.7858029238700446f, - -0.7857219586917022f, - -0.7856409800502275f, - -0.7855599879470058f, - -0.7854789823834264f, - -0.7853979633608763f, - -0.7853169308807455f, - -0.78523588494442f, - -0.7851548255532904f, - -0.7850737527087444f, - -0.7849926664121728f, - -0.7849115666649629f, - -0.7848304534685059f, - -0.7847493268241905f, - -0.784668186733408f, - -0.7845870331975481f, - -0.7845058662180013f, - -0.784424685796158f, - -0.7843434919334101f, - -0.7842622846311483f, - -0.7841810638907643f, - -0.784099829713649f, - -0.7840185821011955f, - -0.7839373210547947f, - -0.783856046575841f, - -0.7837747586657245f, - -0.7836934573258398f, - -0.783612142557579f, - -0.7835308143623368f, - -0.7834494727415048f, - -0.7833681176964783f, - -0.7832867492286506f, - -0.7832053673394161f, - -0.7831239720301688f, - -0.7830425633023043f, - -0.7829611411572169f, - -0.7828797055963015f, - -0.7827982566209543f, - -0.7827167942325705f, - -0.7826353184325457f, - -0.7825538292222759f, - -0.782472326603158f, - -0.7823908105765883f, - -0.7823092811439634f, - -0.7822277383066797f, - -0.7821461820661362f, - -0.782064612423728f, - -0.7819830293808546f, - -0.7819014329389127f, - -0.7818198230993014f, - -0.7817381998634189f, - -0.7816565632326633f, - -0.7815749132084332f, - -0.7814932497921286f, - -0.7814115729851484f, - -0.7813298827888919f, - -0.7812481792047585f, - -0.7811664622341491f, - -0.7810847318784635f, - -0.781002988139102f, - -0.7809212310174647f, - -0.7808394605149536f, - -0.7807576766329688f, - -0.7806758793729132f, - -0.7805940687361863f, - -0.7805122447241913f, - -0.7804304073383295f, - -0.7803485565800045f, - -0.7802666924506168f, - -0.7801848149515705f, - -0.7801029240842677f, - -0.7800210198501133f, - -0.7799391022505082f, - -0.7798571712868578f, - -0.779775226960565f, - -0.779693269273035f, - -0.7796112982256713f, - -0.7795293138198787f, - -0.7794473160570619f, - -0.7793653049386253f, - -0.7792832804659754f, - -0.7792012426405169f, - -0.7791191914636557f, - -0.7790371269367972f, - -0.7789550490613484f, - -0.7788729578387152f, - -0.7787908532703045f, - -0.7787087353575223f, - -0.7786266041017768f, - -0.7785444595044748f, - -0.7784623015670239f, - -0.7783801302908311f, - -0.7782979456773057f, - -0.7782157477278552f, - -0.7781335364438882f, - -0.7780513118268126f, - -0.7779690738780386f, - -0.7778868225989741f, - -0.7778045579910302f, - -0.7777222800556143f, - -0.7776399887941376f, - -0.7775576842080094f, - -0.7774753662986414f, - -0.777393035067442f, - -0.7773106905158234f, - -0.7772283326451955f, - -0.7771459614569713f, - -0.77706357695256f, - -0.7769811791333747f, - -0.7768987680008262f, - -0.7768163435563279f, - -0.7767339058012913f, - -0.776651454737129f, - -0.7765689903652535f, - -0.7764865126870786f, - -0.776404021704017f, - -0.7763215174174823f, - -0.7762389998288877f, - -0.776156468939648f, - -0.7760739247511769f, - -0.7759913672648887f, - -0.7759087964821976f, - -0.7758262124045193f, - -0.7757436150332686f, - -0.7756610043698606f, - -0.7755783804157103f, - -0.7754957431722345f, - -0.7754130926408487f, - -0.775330428822969f, - -0.7752477517200119f, - -0.7751650613333934f, - -0.7750823576645316f, - -0.7749996407148424f, - -0.774916910485745f, - -0.7748341669786544f, - -0.7747514101949903f, - -0.7746686401361694f, - -0.7745858568036119f, - -0.7745030601987339f, - -0.7744202503229558f, - -0.7743374271776953f, - -0.7742545907643733f, - -0.7741717410844069f, - -0.7740888781392175f, - -0.7740060019302237f, - -0.7739231124588467f, - -0.7738402097265064f, - -0.773757293734623f, - -0.7736743644846169f, - -0.7735914219779102f, - -0.7735084662159234f, - -0.773425497200078f, - -0.7733425149317952f, - -0.7732595194124977f, - -0.7731765106436075f, - -0.7730934886265465f, - -0.7730104533627369f, - -0.7729274048536026f, - -0.7728443431005654f, - -0.7727612681050504f, - -0.7726781798684786f, - -0.7725950783922756f, - -0.7725119636778647f, - -0.7724288357266699f, - -0.7723456945401151f, - -0.7722625401196261f, - -0.7721793724666272f, - -0.7720961915825433f, - -0.7720129974687991f, - -0.7719297901268214f, - -0.7718465695580352f, - -0.7717633357638661f, - -0.7716800887457412f, - -0.7715968285050866f, - -0.7715135550433287f, - -0.771430268361894f, - -0.7713469684622111f, - -0.7712636553457052f, - -0.7711803290138054f, - -0.7710969894679385f, - -0.7710136367095342f, - -0.7709302707400183f, - -0.7708468915608211f, - -0.7707634991733701f, - -0.7706800935790954f, - -0.7705966747794254f, - -0.7705132427757896f, - -0.7704297975696169f, - -0.7703463391623385f, - -0.7702628675553836f, - -0.7701793827501826f, - -0.7700958847481654f, - -0.7700123735507637f, - -0.7699288491594075f, - -0.7698453115755297f, - -0.7697617608005592f, - -0.7696781968359295f, - -0.7695946196830713f, - -0.7695110293434184f, - -0.7694274258184007f, - -0.7693438091094524f, - -0.7692601792180054f, - -0.7691765361454941f, - -0.7690928798933495f, - -0.7690092104630067f, - -0.7689255278558984f, - -0.7688418320734595f, - -0.7687581231171233f, - -0.7686744009883245f, - -0.7685906656884975f, - -0.7685069172190765f, - -0.7684231555814977f, - -0.7683393807771957f, - -0.768255592807606f, - -0.7681717916741637f, - -0.7680879773783058f, - -0.7680041499214679f, - -0.7679203093050865f, - -0.7678364555305974f, - -0.7677525885994386f, - -0.7676687085130467f, - -0.7675848152728588f, - -0.7675009088803121f, - -0.767416989336845f, - -0.7673330566438952f, - -0.7672491108029008f, - -0.7671651518152995f, - -0.7670811796825313f, - -0.7669971944060342f, - -0.7669131959872475f, - -0.7668291844276097f, - -0.7667451597285616f, - -0.7666611218915418f, - -0.766577070917992f, - -0.7664930068093498f, - -0.7664089295670579f, - -0.7663248391925552f, - -0.7662407356872847f, - -0.7661566190526851f, - -0.7660724892901992f, - -0.7659883464012678f, - -0.7659041903873334f, - -0.7658200212498377f, - -0.7657358389902229f, - -0.7656516436099308f, - -0.765567435110405f, - -0.7654832134930882f, - -0.7653989787594234f, - -0.7653147309108532f, - -0.7652304699488225f, - -0.7651461958747743f, - -0.7650619086901529f, - -0.7649776083964017f, - -0.7648932949949664f, - -0.7648089684872912f, - -0.764724628874821f, - -0.7646402761590008f, - -0.7645559103412755f, - -0.7644715314230918f, - -0.7643871394058949f, - -0.7643027342911309f, - -0.7642183160802455f, - -0.7641338847746862f, - -0.7640494403758993f, - -0.7639649828853317f, - -0.7638805123044299f, - -0.7637960286346424f, - -0.7637115318774157f, - -0.7636270220341995f, - -0.7635424991064393f, - -0.7634579630955853f, - -0.7633734140030849f, - -0.7632888518303883f, - -0.7632042765789423f, - -0.7631196882501978f, - -0.7630350868456031f, - -0.7629504723666093f, - -0.7628658448146642f, - -0.7627812041912196f, - -0.7626965504977246f, - -0.7626118837356307f, - -0.7625272039063883f, - -0.7624425110114482f, - -0.762357805052261f, - -0.7622730860302795f, - -0.7621883539469546f, - -0.7621036088037381f, - -0.7620188506020816f, - -0.7619340793434385f, - -0.7618492950292608f, - -0.7617644976610014f, - -0.7616796872401124f, - -0.7615948637680483f, - -0.761510027246262f, - -0.7614251776762072f, - -0.7613403150593371f, - -0.7612554393971068f, - -0.7611705506909704f, - -0.7610856489423822f, - -0.7610007341527963f, - -0.7609158063236692f, - -0.7608308654564552f, - -0.7607459115526093f, - -0.7606609446135889f, - -0.7605759646408475f, - -0.7604909716358431f, - -0.7604059656000308f, - -0.7603209465348688f, - -0.7602359144418117f, - -0.760150869322318f, - -0.7600658111778441f, - -0.7599807400098489f, - -0.759895655819788f, - -0.759810558609121f, - -0.7597254483793046f, - -0.7596403251317985f, - -0.7595551888680606f, - -0.7594700395895498f, - -0.7593848772977245f, - -0.7592997019940451f, - -0.7592145136799704f, - -0.7591293123569601f, - -0.7590440980264735f, - -0.758958870689972f, - -0.7588736303489152f, - -0.7587883770047639f, - -0.7587031106589781f, - -0.7586178313130201f, - -0.7585325389683498f, - -0.7584472336264306f, - -0.7583619152887218f, - -0.7582765839566871f, - -0.7581912396317873f, - -0.7581058823154867f, - -0.7580205120092454f, - -0.7579351287145281f, - -0.757849732432797f, - -0.7577643231655155f, - -0.7576789009141465f, - -0.7575934656801547f, - -0.7575080174650036f, - -0.7574225562701568f, - -0.7573370820970796f, - -0.7572515949472362f, - -0.7571660948220912f, - -0.7570805817231091f, - -0.7569950556517565f, - -0.756909516609498f, - -0.7568239645977995f, - -0.7567383996181263f, - -0.7566528216719455f, - -0.7565672307607231f, - -0.7564816268859256f, - -0.7563960100490191f, - -0.756310380251472f, - -0.7562247374947509f, - -0.7561390817803232f, - -0.756053413109656f, - -0.7559677314842185f, - -0.755882036905478f, - -0.755796329374903f, - -0.7557106088939616f, - -0.7556248754641237f, - -0.755539129086857f, - -0.7554533697636328f, - -0.7553675974959178f, - -0.7552818122851838f, - -0.7551960141328994f, - -0.7551102030405364f, - -0.755024379009563f, - -0.7549385420414514f, - -0.7548526921376713f, - -0.7547668292996953f, - -0.7546809535289926f, - -0.7545950648270361f, - -0.7545091631952965f, - -0.7544232486352468f, - -0.7543373211483585f, - -0.754251380736104f, - -0.7541654273999554f, - -0.7540794611413864f, - -0.7539934819618695f, - -0.7539074898628783f, - -0.7538214848458851f, - -0.7537354669123649f, - -0.7536494360637913f, - -0.7535633923016382f, - -0.7534773356273798f, - -0.7533912660424904f, - -0.7533051835484458f, - -0.7532190881467202f, - -0.7531329798387892f, - -0.7530468586261274f, - -0.7529607245102117f, - -0.7528745774925174f, - -0.7527884175745206f, - -0.7527022447576972f, - -0.7526160590435246f, - -0.7525298604334786f, - -0.752443648929038f, - -0.7523574245316775f, - -0.7522711872428764f, - -0.7521849370641112f, - -0.7520986739968615f, - -0.7520123980426029f, - -0.7519261092028158f, - -0.7518398074789772f, - -0.7517534928725679f, - -0.7516671653850644f, - -0.7515808250179477f, - -0.7514944717726959f, - -0.75140810565079f, - -0.7513217266537092f, - -0.7512353347829337f, - -0.751148930039943f, - -0.7510625124262189f, - -0.7509760819432416f, - -0.750889638592492f, - -0.7508031823754507f, - -0.7507167132936003f, - -0.7506302313484219f, - -0.7505437365413973f, - -0.7504572288740079f, - -0.7503707083477372f, - -0.7502841749640671f, - -0.7501976287244804f, - -0.7501110696304595f, - -0.7500244976834886f, - -0.7499379128850505f, - -0.7498513152366288f, - -0.7497647047397069f, - -0.74967808139577f, - -0.7495914452063016f, - -0.7495047961727864f, - -0.749418134296709f, - -0.7493314595795537f, - -0.7492447720228068f, - -0.7491580716279527f, - -0.7490713583964785f, - -0.7489846323298678f, - -0.7488978934296083f, - -0.7488111416971853f, - -0.7487243771340867f, - -0.7486375997417971f, - -0.7485508095218051f, - -0.7484640064755965f, - -0.7483771906046606f, - -0.7482903619104825f, - -0.7482035203945518f, - -0.7481166660583554f, - -0.7480297989033825f, - -0.7479429189311212f, - -0.74785602614306f, - -0.7477691205406872f, - -0.7476822021254933f, - -0.7475952708989667f, - -0.7475083268625972f, - -0.7474213700178738f, - -0.7473344003662877f, - -0.747247417909328f, - -0.7471604226484869f, - -0.7470734145852527f, - -0.7469863937211179f, - -0.7468993600575724f, - -0.7468123135961093f, - -0.7467252543382179f, - -0.7466381822853915f, - -0.7465510974391216f, - -0.7464639998009003f, - -0.7463768893722195f, - -0.7462897661545729f, - -0.7462026301494528f, - -0.7461154813583516f, - -0.7460283197827638f, - -0.7459411454241823f, - -0.7458539582841008f, - -0.7457667583640126f, - -0.7456795456654132f, - -0.745592320189796f, - -0.745505081938656f, - -0.7454178309134872f, - -0.7453305671157864f, - -0.7452432905470465f, - -0.7451560012087648f, - -0.7450686991024358f, - -0.7449813842295564f, - -0.7448940565916223f, - -0.7448067161901297f, - -0.7447193630265747f, - -0.7446319971024553f, - -0.7445446184192677f, - -0.7444572269785092f, - -0.7443698227816767f, - -0.744282405830269f, - -0.7441949761257832f, - -0.7441075336697177f, - -0.74402007846357f, - -0.7439326105088399f, - -0.7438451298070248f, - -0.7437576363596256f, - -0.743670130168139f, - -0.7435826112340663f, - -0.7434950795589057f, - -0.7434075351441591f, - -0.7433199779913241f, - -0.7432324081019026f, - -0.743144825477394f, - -0.7430572301193001f, - -0.7429696220291214f, - -0.7428820012083589f, - -0.7427943676585135f, - -0.7427067213810878f, - -0.7426190623775831f, - -0.7425313906495014f, - -0.7424437061983449f, - -0.7423560090256155f, - -0.742268299132817f, - -0.7421805765214518f, - -0.7420928411930229f, - -0.7420050931490331f, - -0.741917332390987f, - -0.7418295589203878f, - -0.7417417727387396f, - -0.7416539738475459f, - -0.7415661622483124f, - -0.7414783379425429f, - -0.7413905009317425f, - -0.7413026512174156f, - -0.7412147888010686f, - -0.7411269136842065f, - -0.7410390258683348f, - -0.7409511253549591f, - -0.7408632121455866f, - -0.7407752862417226f, - -0.7406873476448753f, - -0.7405993963565493f, - -0.7405114323782532f, - -0.7404234557114933f, - -0.7403354663577786f, - -0.7402474643186145f, - -0.7401594495955108f, - -0.7400714221899742f, - -0.739983382103515f, - -0.7398953293376391f, - -0.7398072638938574f, - -0.7397191857736775f, - -0.7396310949786097f, - -0.7395429915101629f, - -0.7394548753698468f, - -0.7393667465591706f, - -0.7392786050796454f, - -0.7391904509327811f, - -0.7391022841200882f, - -0.7390141046430767f, - -0.7389259125032588f, - -0.7388377077021449f, - -0.7387494902412466f, - -0.7386612601220747f, - -0.7385730173461423f, - -0.7384847619149608f, - -0.7383964938300424f, - -0.7383082130928995f, - -0.7382199197050443f, - -0.7381316136679907f, - -0.7380432949832515f, - -0.7379549636523398f, - -0.7378666196767685f, - -0.7377782630580526f, - -0.7376898937977049f, - -0.7376015118972413f, - -0.737513117358174f, - -0.7374247101820192f, - -0.7373362903702907f, - -0.7372478579245052f, - -0.7371594128461756f, - -0.7370709551368192f, - -0.7369824847979506f, - -0.7368940018310873f, - -0.7368055062377433f, - -0.7367169980194365f, - -0.7366284771776824f, - -0.736539943713999f, - -0.7364513976299026f, - -0.7363628389269106f, - -0.7362742676065395f, - -0.7361856836703085f, - -0.7360970871197345f, - -0.736008477956336f, - -0.7359198561816302f, - -0.7358312217971373f, - -0.7357425748043751f, - -0.7356539152048628f, - -0.7355652430001186f, - -0.7354765581916635f, - -0.735387860781016f, - -0.7352991507696964f, - -0.7352104281592239f, - -0.7351216929511198f, - -0.7350329451469042f, - -0.7349441847480976f, - -0.7348554117562205f, - -0.7347666261727949f, - -0.7346778279993417f, - -0.7345890172373823f, - -0.7345001938884381f, - -0.7344113579540321f, - -0.7343225094356858f, - -0.7342336483349212f, - -0.7341447746532619f, - -0.7340558883922302f, - -0.7339669895533493f, - -0.7338780781381417f, - -0.7337891541481326f, - -0.7337002175848434f, - -0.7336112684497998f, - -0.7335223067445248f, - -0.7334333324705437f, - -0.7333443456293807f, - -0.7332553462225604f, - -0.7331663342516073f, - -0.7330773097180476f, - -0.7329882726234064f, - -0.7328992229692091f, - -0.732810160756981f, - -0.7327210859882495f, - -0.73263199866454f, - -0.7325428987873791f, - -0.7324537863582931f, - -0.7323646613788098f, - -0.7322755238504554f, - -0.7321863737747588f, - -0.7320972111532454f, - -0.7320080359874447f, - -0.7319188482788834f, - -0.7318296480290917f, - -0.7317404352395953f, - -0.7316512099119249f, - -0.7315619720476081f, - -0.7314727216481757f, - -0.7313834587151546f, - -0.7312941832500763f, - -0.7312048952544696f, - -0.731115594729864f, - -0.7310262816777908f, - -0.7309369560997798f, - -0.7308476179973614f, - -0.7307582673720661f, - -0.7306689042254257f, - -0.7305795285589711f, - -0.7304901403742338f, - -0.7304007396727445f, - -0.7303113264560366f, - -0.7302219007256413f, - -0.7301324624830912f, - -0.7300430117299177f, - -0.7299535484676553f, - -0.7298640726978359f, - -0.7297745844219928f, - -0.7296850836416588f, - -0.7295955703583686f, - -0.7295060445736555f, - -0.7294165062890534f, - -0.7293269555060958f, - -0.7292373922263186f, - -0.7291478164512556f, - -0.7290582281824418f, - -0.7289686274214116f, - -0.7288790141697015f, - -0.7287893884288458f, - -0.728699750200382f, - -0.7286100994858437f, - -0.7285204362867688f, - -0.7284307606046924f, - -0.7283410724411529f, - -0.7282513717976847f, - -0.7281616586758266f, - -0.7280719330771146f, - -0.7279821950030873f, - -0.7278924444552818f, - -0.7278026814352359f, - -0.7277129059444871f, - -0.7276231179845748f, - -0.727533317557037f, - -0.7274435046634123f, - -0.7273536793052391f, - -0.7272638414840578f, - -0.7271739912014069f, - -0.7270841284588262f, - -0.7269942532578548f, - -0.7269043656000338f, - -0.726814465486903f, - -0.7267245529200026f, - -0.7266346279008734f, - -0.7265446904310554f, - -0.7264547405120911f, - -0.7263647781455211f, - -0.726274803332887f, - -0.7261848160757295f, - -0.7260948163755921f, - -0.7260048042340163f, - -0.7259147796525441f, - -0.7258247426327178f, - -0.7257346931760811f, - -0.725644631284176f, - -0.7255545569585473f, - -0.7254644702007361f, - -0.7253743710122879f, - -0.7252842593947452f, - -0.7251941353496537f, - -0.7251039988785556f, - -0.7250138499829969f, - -0.7249236886645212f, - -0.7248335149246751f, - -0.7247433287650012f, - -0.7246531301870469f, - -0.7245629191923564f, - -0.7244726957824766f, - -0.7243824599589529f, - -0.7242922117233315f, - -0.724201951077158f, - -0.7241116780219804f, - -0.7240213925593448f, - -0.7239310946907983f, - -0.7238407844178875f, - -0.7237504617421608f, - -0.7236601266651657f, - -0.7235697791884497f, - -0.7234794193135604f, - -0.7233890470420474f, - -0.7232986623754585f, - -0.7232082653153423f, - -0.7231178558632474f, - -0.723027434020724f, - -0.7229369997893208f, - -0.7228465531705874f, - -0.722756094166073f, - -0.7226656227773288f, - -0.7225751390059044f, - -0.7224846428533496f, - -0.7223941343212169f, - -0.7223036134110545f, - -0.7222130801244157f, - -0.72212253446285f, - -0.7220319764279112f, - -0.7219414060211481f, - -0.7218508232441149f, - -0.721760228098362f, - -0.7216696205854439f, - -0.7215790007069107f, - -0.7214883684643169f, - -0.7213977238592141f, - -0.7213070668931567f, - -0.7212163975676977f, - -0.7211257158843907f, - -0.7210350218447886f, - -0.7209443154504468f, - -0.720853596702919f, - -0.7207628656037596f, - -0.7206721221545225f, - -0.720581366356764f, - -0.7204905982120384f, - -0.720399817721901f, - -0.7203090248879068f, - -0.7202182197116127f, - -0.7201274021945733f, - -0.7200365723383467f, - -0.7199457301444867f, - -0.7198548756145517f, - -0.7197640087500974f, - -0.7196731295526824f, - -0.7195822380238615f, - -0.719491334165194f, - -0.7194004179782368f, - -0.7193094894645473f, - -0.7192185486256846f, - -0.7191275954632063f, - -0.719036629978671f, - -0.7189456521736366f, - -0.7188546620496634f, - -0.7187636596083098f, - -0.718672644851135f, - -0.718581617779698f, - -0.7184905783955596f, - -0.7183995267002794f, - -0.7183084626954174f, - -0.7182173863825333f, - -0.7181262977631889f, - -0.7180351968389445f, - -0.7179440836113609f, - -0.7178529580819987f, - -0.7177618202524207f, - -0.7176706701241878f, - -0.7175795076988619f, - -0.7174883329780044f, - -0.7173971459631787f, - -0.7173059466559468f, - -0.7172147350578713f, - -0.7171235111705143f, - -0.7170322749954404f, - -0.7169410265342115f, - -0.7168497657883931f, - -0.7167584927595464f, - -0.7166672074492372f, - -0.7165759098590283f, - -0.7164845999904861f, - -0.7163932778451726f, - -0.7163019434246545f, - -0.7162105967304954f, - -0.7161192377642625f, - -0.7160278665275186f, - -0.7159364830218313f, - -0.7158450872487653f, - -0.7157536792098876f, - -0.715662258906764f, - -0.715570826340961f, - -0.7154793815140446f, - -0.7153879244275828f, - -0.7152964550831423f, - -0.7152049734822903f, - -0.7151134796265942f, - -0.7150219735176212f, - -0.7149304551569405f, - -0.7148389245461196f, - -0.7147473816867269f, - -0.7146558265803302f, - -0.7145642592284998f, - -0.7144726796328037f, - -0.7143810877948112f, - -0.7142894837160914f, - -0.7141978673982146f, - -0.7141062388427504f, - -0.7140145980512688f, - -0.7139229450253392f, - -0.7138312797665335f, - -0.7137396022764211f, - -0.7136479125565746f, - -0.7135562106085627f, - -0.7134644964339586f, - -0.7133727700343323f, - -0.7132810314112578f, - -0.713189280566304f, - -0.7130975175010454f, - -0.7130057422170528f, - -0.7129139547159007f, - -0.7128221549991594f, - -0.7127303430684035f, - -0.7126385189252052f, - -0.7125466825711391f, - -0.712454834007778f, - -0.7123629732366957f, - -0.7122711002594658f, - -0.7121792150776637f, - -0.7120873176928632f, - -0.7119954081066387f, - -0.7119034863205648f, - -0.7118115523362174f, - -0.7117196061551715f, - -0.7116276477790024f, - -0.7115356772092852f, - -0.711443694447597f, - -0.7113516994955134f, - -0.7112596923546105f, - -0.7111676730264643f, - -0.7110756415126528f, - -0.7109835978147523f, - -0.7108915419343399f, - -0.710799473872993f, - -0.7107073936322885f, - -0.7106153012138055f, - -0.7105231966191212f, - -0.710431079849814f, - -0.7103389509074615f, - -0.7102468097936436f, - -0.7101546565099379f, - -0.7100624910579252f, - -0.7099703134391824f, - -0.7098781236552906f, - -0.7097859217078284f, - -0.7096937075983774f, - -0.7096014813285152f, - -0.709509242899824f, - -0.7094169923138828f, - -0.7093247295722739f, - -0.7092324546765774f, - -0.7091401676283743f, - -0.7090478684292454f, - -0.7089555570807735f, - -0.7088632335845396f, - -0.7087708979421258f, - -0.7086785501551134f, - -0.7085861902250862f, - -0.708493818153626f, - -0.7084014339423157f, - -0.7083090375927376f, - -0.7082166291064761f, - -0.7081242084851134f, - -0.7080317757302348f, - -0.7079393308434219f, - -0.7078468738262604f, - -0.707754404680334f, - -0.707661923407227f, - -0.7075694300085236f, - -0.7074769244858097f, - -0.7073844068406699f, - -0.7072918770746893f, - -0.707199335189453f, - -0.7071067811865477f, - -0.7070142150675587f, - -0.7069216368340716f, - -0.7068290464876738f, - -0.7067364440299512f, - -0.7066438294624906f, - -0.7065512027868783f, - -0.7064585640047025f, - -0.7063659131175503f, - -0.7062732501270089f, - -0.7061805750346655f, - -0.7060878878421101f, - -0.7059951885509281f, - -0.7059024771627099f, - -0.705809753679043f, - -0.7057170181015172f, - -0.7056242704317209f, - -0.7055315106712434f, - -0.7054387388216734f, - -0.7053459548846019f, - -0.705253158861618f, - -0.7051603507543117f, - -0.7050675305642727f, - -0.7049746982930927f, - -0.7048818539423617f, - -0.7047889975136705f, - -0.7046961290086097f, - -0.7046032484287716f, - -0.7045103557757467f, - -0.7044174510511284f, - -0.7043245342565062f, - -0.704231605393474f, - -0.7041386644636227f, - -0.704045711468547f, - -0.703952746409837f, - -0.7038597692890874f, - -0.7037667801078903f, - -0.7036737788678401f, - -0.7035807655705298f, - -0.7034877402175532f, - -0.7033947028105036f, - -0.7033016533509765f, - -0.7032085918405655f, - -0.7031155182808653f, - -0.7030224326734705f, - -0.7029293350199758f, - -0.7028362253219773f, - -0.7027431035810701f, - -0.7026499697988496f, - -0.7025568239769111f, - -0.7024636661168518f, - -0.7023704962202675f, - -0.7022773142887544f, - -0.7021841203239086f, - -0.7020909143273283f, - -0.7019976963006098f, - -0.7019044662453504f, - -0.7018112241631471f, - -0.7017179700555987f, - -0.7016247039243023f, - -0.7015314257708563f, - -0.7014381355968581f, - -0.7013448334039076f, - -0.7012515191936023f, - -0.7011581929675428f, - -0.7010648547273259f, - -0.7009715044745528f, - -0.7008781422108217f, - -0.7007847679377343f, - -0.7006913816568878f, - -0.7005979833698845f, - -0.7005045730783234f, - -0.7004111507838069f, - -0.7003177164879333f, - -0.7002242701923056f, - -0.7001308118985234f, - -0.7000373416081895f, - -0.699943859322905f, - -0.6998503650442716f, - -0.6997568587738905f, - -0.6996633405133654f, - -0.699569810264298f, - -0.6994762680282908f, - -0.6993827138069462f, - -0.6992891476018682f, - -0.6991955694146597f, - -0.699101979246924f, - -0.6990083771002641f, - -0.6989147629762852f, - -0.6988211368765906f, - -0.6987274988027846f, - -0.6986338487564717f, - -0.698540186739256f, - -0.6984465127527435f, - -0.6983528267985386f, - -0.6982591288782467f, - -0.6981654189934727f, - -0.6980716971458235f, - -0.6979779633369038f, - -0.6978842175683214f, - -0.6977904598416802f, - -0.6976966901585887f, - -0.6976029085206522f, - -0.6975091149294796f, - -0.6974153093866756f, - -0.6973214918938493f, - -0.6972276624526068f, - -0.6971338210645581f, - -0.6970399677313085f, - -0.6969461024544679f, - -0.6968522252356435f, - -0.6967583360764451f, - -0.696664434978481f, - -0.6965705219433598f, - -0.6964765969726904f, - -0.6963826600680832f, - -0.6962887112311473f, - -0.6961947504634924f, - -0.6961007777667281f, - -0.6960067931424655f, - -0.6959127965923145f, - -0.6958187881178859f, - -0.6957247677207895f, - -0.695630735402638f, - -0.6955366911650417f, - -0.695442635009612f, - -0.6953485669379601f, - -0.695254486951699f, - -0.6951603950524401f, - -0.6950662912417956f, - -0.6949721755213774f, - -0.6948780478927994f, - -0.6947839083576737f, - -0.6946897569176134f, - -0.6945955935742312f, - -0.6945014183291418f, - -0.6944072311839582f, - -0.6943130321402937f, - -0.6942188211997642f, - -0.6941245983639815f, - -0.6940303636345619f, - -0.693936117013119f, - -0.6938418585012694f, - -0.6937475881006259f, - -0.6936533058128054f, - -0.6935590116394221f, - -0.6934647055820934f, - -0.6933703876424342f, - -0.6932760578220608f, - -0.6931817161225887f, - -0.693087362545636f, - -0.6929929970928184f, - -0.6928986197657531f, - -0.6928042305660564f, - -0.6927098294953471f, - -0.6926154165552421f, - -0.6925209917473589f, - -0.6924265550733151f, - -0.6923321065347299f, - -0.6922376461332205f, - -0.6921431738704072f, - -0.6920486897479065f, - -0.691954193767339f, - -0.6918596859303228f, - -0.691765166238479f, - -0.6916706346934246f, - -0.6915760912967814f, - -0.6914815360501682f, - -0.6913869689552069f, - -0.6912923900135154f, - -0.6911977992267162f, - -0.6911031965964294f, - -0.6910085821242755f, - -0.6909139558118768f, - -0.6908193176608541f, - -0.690724667672829f, - -0.6906300058494228f, - -0.6905353321922586f, - -0.690440646702958f, - -0.6903459493831435f, - -0.6902512402344371f, - -0.6901565192584627f, - -0.6900617864568428f, - -0.6899670418312007f, - -0.689872285383159f, - -0.6897775171143428f, - -0.6896827370263752f, - -0.6895879451208802f, - -0.6894931413994814f, - -0.6893983258638046f, - -0.6893034985154736f, - -0.6892086593561134f, - -0.6891138083873485f, - -0.6890189456108052f, - -0.6889240710281078f, - -0.6888291846408838f, - -0.6887342864507566f, - -0.6886393764593541f, - -0.6885444546683013f, - -0.6884495210792266f, - -0.688354575693754f, - -0.6882596185135124f, - -0.6881646495401275f, - -0.6880696687752286f, - -0.6879746762204404f, - -0.6878796718773927f, - -0.6877846557477121f, - -0.6876896278330278f, - -0.6875945881349674f, - -0.6874995366551597f, - -0.6874044733952325f, - -0.6873093983568159f, - -0.6872143115415384f, - -0.6871192129510295f, - -0.6870241025869178f, - -0.6869289804508343f, - -0.6868338465444084f, - -0.68673870086927f, - -0.6866435434270496f, - -0.6865483742193769f, - -0.6864531932478839f, - -0.6863580005142008f, - -0.686262796019959f, - -0.6861675797667888f, - -0.6860723517563232f, - -0.6859771119901932f, - -0.6858818604700306f, - -0.685786597197467f, - -0.6856913221741361f, - -0.6855960354016696f, - -0.6855007368817002f, - -0.6854054266158602f, - -0.6853101046057842f, - -0.6852147708531039f, - -0.685119425359455f, - -0.6850240681264685f, - -0.6849286991557804f, - -0.6848333184490233f, - -0.6847379260078336f, - -0.6846425218338432f, - -0.684547105928689f, - -0.6844516782940042f, - -0.6843562389314256f, - -0.6842607878425877f, - -0.6841653250291261f, - -0.6840698504926758f, - -0.683974364234874f, - -0.6838788662573564f, - -0.683783356561759f, - -0.683687835149718f, - -0.6835923020228714f, - -0.6834967571828552f, - -0.6834012006313067f, - -0.6833056323698627f, - -0.683210052400162f, - -0.6831144607238415f, - -0.6830188573425393f, - -0.6829232422578929f, - -0.6828276154715418f, - -0.6827319769851241f, - -0.6826363268002784f, - -0.682540664918643f, - -0.6824449913418583f, - -0.6823493060715631f, - -0.6822536091093968f, - -0.6821579004569986f, - -0.6820621801160098f, - -0.6819664480880698f, - -0.6818707043748183f, - -0.6817749489778978f, - -0.6816791818989464f, - -0.6815834031396071f, - -0.6814876127015196f, - -0.6813918105863273f, - -0.681295996795669f, - -0.6812001713311886f, - -0.6811043341945267f, - -0.6810084853873273f, - -0.6809126249112302f, - -0.6808167527678798f, - -0.6807208689589177f, - -0.680624973485988f, - -0.6805290663507333f, - -0.6804331475547969f, - -0.6803372170998218f, - -0.6802412749874528f, - -0.6801453212193334f, - -0.6800493557971076f, - -0.6799533787224191f, - -0.6798573899969139f, - -0.679761389622236f, - -0.6796653776000303f, - -0.6795693539319414f, - -0.6794733186196158f, - -0.6793772716646977f, - -0.679281213068835f, - -0.679185142833671f, - -0.6790890609608536f, - -0.6789929674520288f, - -0.6788968623088427f, - -0.6788007455329417f, - -0.678704617125974f, - -0.678608477089586f, - -0.6785123254254245f, - -0.6784161621351382f, - -0.6783199872203742f, - -0.6782238006827807f, - -0.6781276025240047f, - -0.6780313927456961f, - -0.6779351713495029f, - -0.6778389383370736f, - -0.6777426937100566f, - -0.6776464374701023f, - -0.6775501696188594f, - -0.6774538901579773f, - -0.6773575990891052f, - -0.6772612964138943f, - -0.6771649821339941f, - -0.6770686562510548f, - -0.6769723187667264f, - -0.6768759696826608f, - -0.6767796090005084f, - -0.6766832367219202f, - -0.6765868528485469f, - -0.6764904573820413f, - -0.6763940503240545f, - -0.6762976316762384f, - -0.6762012014402444f, - -0.6761047596177262f, - -0.6760083062103348f, - -0.6759118412197251f, - -0.6758153646475474f, - -0.6757188764954566f, - -0.6756223767651047f, - -0.6755258654581473f, - -0.6754293425762352f, - -0.6753328081210246f, - -0.6752362620941681f, - -0.675139704497322f, - -0.6750431353321381f, - -0.6749465546002732f, - -0.6748499623033807f, - -0.6747533584431171f, - -0.674656743021137f, - -0.6745601160390958f, - -0.6744634774986487f, - -0.6743668274014527f, - -0.6742701657491633f, - -0.6741734925434368f, - -0.6740768077859296f, - -0.6739801114782978f, - -0.6738834036221996f, - -0.6737866842192912f, - -0.67368995327123f, - -0.6735932107796729f, - -0.6734964567462787f, - -0.6733996911727047f, - -0.6733029140606089f, - -0.6732061254116489f, - -0.6731093252274846f, - -0.6730125135097736f, - -0.6729156902601753f, - -0.6728188554803476f, - -0.6727220091719512f, - -0.6726251513366444f, - -0.6725282819760886f, - -0.6724314010919411f, - -0.6723345086858639f, - -0.6722376047595157f, - -0.6721406893145592f, - -0.6720437623526522f, - -0.6719468238754576f, - -0.671849873884635f, - -0.6717529123818478f, - -0.6716559393687545f, - -0.6715589548470187f, - -0.6714619588183011f, - -0.6713649512842648f, - -0.6712679322465714f, - -0.6711709017068835f, - -0.6710738596668628f, - -0.6709768061281735f, - -0.6708797410924778f, - -0.670782664561439f, - -0.6706855765367199f, - -0.6705884770199853f, - -0.6704913660128982f, - -0.6703942435171227f, - -0.6702971095343223f, - -0.6701999640661628f, - -0.6701028071143078f, - -0.6700056386804224f, - -0.6699084587661706f, - -0.669811267373219f, - -0.6697140645032325f, - -0.6696168501578762f, - -0.6695196243388162f, - -0.6694223870477176f, - -0.6693251382862478f, - -0.6692278780560728f, - -0.6691306063588588f, - -0.669033323196272f, - -0.6689360285699806f, - -0.6688387224816504f, - -0.6687414049329508f, - -0.6686440759255464f, - -0.6685467354611072f, - -0.6684493835412996f, - -0.6683520201677937f, - -0.6682546453422552f, - -0.6681572590663545f, - -0.6680598613417591f, - -0.667962452170139f, - -0.6678650315531629f, - -0.6677675994924999f, - -0.6676701559898187f, - -0.6675727010467905f, - -0.6674752346650844f, - -0.6673777568463705f, - -0.6672802675923183f, - -0.6671827669045998f, - -0.6670852547848847f, - -0.666987731234844f, - -0.6668901962561481f, - -0.6667926498504695f, - -0.6666950920194783f, - -0.6665975227648482f, - -0.6664999420882483f, - -0.6664023499913525f, - -0.6663047464758325f, - -0.6662071315433608f, - -0.6661095051956092f, - -0.6660118674342518f, - -0.665914218260961f, - -0.6658165576774099f, - -0.6657188856852714f, - -0.6656212022862202f, - -0.6655235074819297f, - -0.6654258012740728f, - -0.6653280836643254f, - -0.665230354654361f, - -0.6651326142458542f, - -0.665034862440479f, - -0.6649370992399126f, - -0.6648393246458272f, - -0.6647415386599003f, - -0.664643741283806f, - -0.664545932519222f, - -0.6644481123678219f, - -0.6643502808312833f, - -0.6642524379112816f, - -0.6641545836094945f, - -0.664056717927598f, - -0.6639588408672691f, - -0.6638609524301841f, - -0.6637630526180217f, - -0.6636651414324588f, - -0.6635672188751729f, - -0.6634692849478413f, - -0.6633713396521435f, - -0.6632733829897564f, - -0.6631754149623602f, - -0.6630774355716312f, - -0.6629794448192502f, - -0.6628814427068948f, - -0.6627834292362463f, - -0.6626854044089815f, - -0.662587368226782f, - -0.6624893206913263f, - -0.6623912618042963f, - -0.6622931915673697f, - -0.6621951099822289f, - -0.662097017050553f, - -0.6619989127740243f, - -0.6619007971543232f, - -0.6618026701931307f, - -0.6617045318921282f, - -0.6616063822529966f, - -0.6615082212774192f, - -0.661410048967077f, - -0.6613118653236523f, - -0.6612136703488268f, - -0.6611154640442845f, - -0.6610172464117071f, - -0.6609190174527779f, - -0.6608207771691792f, - -0.6607225255625957f, - -0.6606242626347102f, - -0.6605259883872064f, - -0.6604277028217677f, - -0.6603294059400793f, - -0.6602310977438249f, - -0.6601327782346891f, - -0.6600344474143558f, - -0.6599361052845112f, - -0.6598377518468397f, - -0.6597393871030266f, - -0.6596410110547567f, - -0.659542623703717f, - -0.6594442250515918f, - -0.6593458151000694f, - -0.6592473938508333f, - -0.6591489613055718f, - -0.6590505174659702f, - -0.6589520623337175f, - -0.6588535959104979f, - -0.6587551181980005f, - -0.6586566291979115f, - -0.6585581289119204f, - -0.6584596173417124f, - -0.6583610944889774f, - -0.6582625603554022f, - -0.6581640149426766f, - -0.6580654582524883f, - -0.6579668902865263f, - -0.6578683110464787f, - -0.6577697205340359f, - -0.6576711187508867f, - -0.6575725056987205f, - -0.6574738813792265f, - -0.6573752457940958f, - -0.6572765989450178f, - -0.6571779408336829f, - -0.6570792714617815f, - -0.6569805908310037f, - -0.6568818989430415f, - -0.6567831957995856f, - -0.6566844814023269f, - -0.6565857557529565f, - -0.6564870188531672f, - -0.6563882707046501f, - -0.6562895113090974f, - -0.6561907406682005f, - -0.6560919587836532f, - -0.6559931656571468f, - -0.6558943612903761f, - -0.6557955456850314f, - -0.6556967188428078f, - -0.6555978807653974f, - -0.6554990314544958f, - -0.655400170911794f, - -0.655301299138988f, - -0.6552024161377707f, - -0.6551035219098383f, - -0.6550046164568827f, - -0.6549056997806006f, - -0.6548067718826857f, - -0.6547078327648341f, - -0.6546088824287408f, - -0.6545099208761012f, - -0.6544109481086102f, - -0.6543119641279651f, - -0.6542129689358612f, - -0.6541139625339949f, - -0.6540149449240619f, - -0.6539159161077601f, - -0.6538168760867858f, - -0.653717824862836f, - -0.6536187624376072f, - -0.6535196888127981f, - -0.6534206039901057f, - -0.6533215079712278f, - -0.6532224007578616f, - -0.6531232823517068f, - -0.653024152754461f, - -0.6529250119678228f, - -0.6528258599934902f, - -0.6527266968331635f, - -0.6526275224885413f, - -0.6525283369613221f, - -0.6524291402532068f, - -0.6523299323658943f, - -0.6522307133010848f, - -0.6521314830604775f, - -0.6520322416457748f, - -0.6519329890586745f, - -0.6518337253008791f, - -0.6517344503740883f, - -0.6516351642800051f, - -0.6515358670203282f, - -0.6514365585967608f, - -0.6513372390110033f, - -0.6512379082647588f, - -0.6511385663597287f, - -0.6510392132976152f, - -0.6509398490801199f, - -0.6508404737089469f, - -0.6507410871857983f, - -0.6506416895123769f, - -0.6505422806903852f, - -0.650442860721528f, - -0.6503434296075081f, - -0.6502439873500293f, - -0.6501445339507946f, - -0.6500450694115099f, - -0.6499455937338776f, - -0.6498461069196046f, - -0.6497466089703928f, - -0.6496470998879491f, - -0.6495475796739771f, - -0.6494480483301841f, - -0.6493485058582731f, - -0.6492489522599514f, - -0.6491493875369236f, - -0.6490498116908978f, - -0.6489502247235776f, - -0.6488506266366711f, - -0.6487510174318846f, - -0.6486513971109239f, - -0.6485517656754974f, - -0.6484521231273117f, - -0.648352469468074f, - -0.6482528046994912f, - -0.6481531288232725f, - -0.6480534418411249f, - -0.6479537437547568f, - -0.6478540345658755f, - -0.6477543142761912f, - -0.6476545828874116f, - -0.6475548404012458f, - -0.647455086819402f, - -0.6473553221435909f, - -0.6472555463755212f, - -0.6471557595169026f, - -0.6470559615694443f, - -0.6469561525348575f, - -0.6468563324148519f, - -0.6467565012111377f, - -0.6466566589254249f, - -0.6465568055594257f, - -0.6464569411148496f, - -0.6463570655934098f, - -0.646257178996815f, - -0.6461572813267786f, - -0.6460573725850112f, - -0.6459574527732266f, - -0.6458575218931342f, - -0.6457575799464482f, - -0.6456576269348799f, - -0.645557662860144f, - -0.6454576877239506f, - -0.6453577015280147f, - -0.6452577042740484f, - -0.6451576959637663f, - -0.6450576765988814f, - -0.6449576461811073f, - -0.6448576047121577f, - -0.6447575521937478f, - -0.6446574886275914f, - -0.6445574140154032f, - -0.6444573283588972f, - -0.6443572316597896f, - -0.644257123919795f, - -0.6441570051406285f, - -0.6440568753240058f, - -0.6439567344716418f, - -0.6438565825852539f, - -0.6437564196665574f, - -0.6436562457172685f, - -0.6435560607391031f, - -0.6434558647337791f, - -0.6433556577030127f, - -0.643255439648521f, - -0.6431552105720204f, - -0.6430549704752296f, - -0.6429547193598657f, - -0.6428544572276464f, - -0.642754184080289f, - -0.6426538999195129f, - -0.6425536047470352f, - -0.6424532985645764f, - -0.6423529813738527f, - -0.6422526531765846f, - -0.6421523139744904f, - -0.642051963769291f, - -0.6419516025627032f, - -0.641851230356449f, - -0.6417508471522466f, - -0.6416504529518174f, - -0.6415500477568812f, - -0.6414496315691582f, - -0.6413492043903684f, - -0.6412487662222338f, - -0.641148317066475f, - -0.6410478569248129f, - -0.6409473857989683f, - -0.6408469036906641f, - -0.6407464106016213f, - -0.6406459065335619f, - -0.6405453914882073f, - -0.6404448654672811f, - -0.6403443284725052f, - -0.6402437805056022f, - -0.6401432215682943f, - -0.6400426516623059f, - -0.6399420707893596f, - -0.6398414789511788f, - -0.6397408761494865f, - -0.6396402623860078f, - -0.6395396376624659f, - -0.6394390019805852f, - -0.6393383553420899f, - -0.639237697748704f, - -0.6391370292021534f, - -0.6390363497041619f, - -0.6389356592564565f, - -0.6388349578607598f, - -0.6387342455187994f, - -0.6386335222322996f, - -0.6385327880029883f, - -0.6384320428325888f, - -0.6383312867228295f, - -0.6382305196754352f, - -0.6381297416921348f, - -0.6380289527746523f, - -0.6379281529247168f, - -0.637827342144054f, - -0.6377265204343928f, - -0.6376256877974599f, - -0.6375248442349831f, - -0.6374239897486896f, - -0.637323124340309f, - -0.6372222480115688f, - -0.6371213607641976f, - -0.6370204625999232f, - -0.636919553520476f, - -0.6368186335275836f, - -0.6367177026229774f, - -0.636616760808384f, - -0.6365158080855351f, - -0.6364148444561591f, - -0.636313869921988f, - -0.6362128844847493f, - -0.6361118881461755f, - -0.6360108809079962f, - -0.6359098627719423f, - -0.6358088337397441f, - -0.6357077938131339f, - -0.6356067429938425f, - -0.6355056812836004f, - -0.635404608684141f, - -0.6353035251971952f, - -0.6352024308244951f, - -0.6351013255677724f, - -0.6350002094287607f, - -0.6348990824091919f, - -0.634797944510799f, - -0.634696795735314f, - -0.6345956360844722f, - -0.6344944655600043f, - -0.6343932841636459f, - -0.6342920918971293f, - -0.6341908887621897f, - -0.6340896747605606f, - -0.6339884498939761f, - -0.6338872141641702f, - -0.6337859675728788f, - -0.633684710121836f, - -0.633583441812777f, - -0.6334821626474362f, - -0.6333808726275503f, - -0.6332795717548543f, - -0.6331782600310839f, - -0.6330769374579744f, - -0.6329756040372634f, - -0.6328742597706857f, - -0.6327729046599798f, - -0.6326715387068799f, - -0.6325701619131247f, - -0.63246877428045f, - -0.6323673758105951f, - -0.6322659665052947f, - -0.6321645463662884f, - -0.6320631153953127f, - -0.6319616735941077f, - -0.6318602209644089f, - -0.6317587575079564f, - -0.6316572832264876f, - -0.6315557981217427f, - -0.6314543021954597f, - -0.631352795449378f, - -0.6312512778852366f, - -0.6311497495047744f, - -0.6310482103097325f, - -0.63094666030185f, - -0.6308450994828668f, - -0.6307435278545227f, - -0.6306419454185593f, - -0.6305403521767166f, - -0.6304387481307352f, - -0.6303371332823555f, - -0.63023550763332f, - -0.6301338711853695f, - -0.6300322239402452f, - -0.6299305658996883f, - -0.629828897065442f, - -0.6297272174392478f, - -0.6296255270228477f, - -0.6295238258179837f, - -0.6294221138263997f, - -0.6293203910498372f, - -0.6292186574900411f, - -0.629116913148752f, - -0.6290151580277151f, - -0.6289133921286728f, - -0.6288116154533708f, - -0.6287098280035504f, - -0.6286080297809575f, - -0.6285062207873352f, - -0.62840440102443f, - -0.6283025704939836f, - -0.6282007291977433f, - -0.6280988771374525f, - -0.6279970143148578f, - -0.6278951407317038f, - -0.6277932563897364f, - -0.6276913612907002f, - -0.627589455436343f, - -0.62748753882841f, - -0.6273856114686476f, - -0.6272836733588014f, - -0.6271817245006197f, - -0.6270797648958486f, - -0.6269777945462351f, - -0.6268758134535258f, - -0.6267738216194696f, - -0.6266718190458131f, - -0.6265698057343044f, - -0.6264677816866907f, - -0.6263657469047215f, - -0.6262637013901443f, - -0.6261616451447078f, - -0.6260595781701608f, - -0.6259575004682514f, - -0.6258554120407299f, - -0.6257533128893443f, - -0.6256512030158462f, - -0.6255490824219824f, - -0.6254469511095047f, - -0.6253448090801618f, - -0.6252426563357059f, - -0.6251404928778845f, - -0.6250383187084505f, - -0.624936133829153f, - -0.6248339382417452f, - -0.6247317319479752f, - -0.6246295149495964f, - -0.6245272872483589f, - -0.6244250488460158f, - -0.6243227997443183f, - -0.6242205399450181f, - -0.6241182694498669f, - -0.6240159882606185f, - -0.6239136963790248f, - -0.6238113938068385f, - -0.6237090805458118f, - -0.623606756597699f, - -0.623504421964253f, - -0.6234020766472274f, - -0.6232997206483747f, - -0.6231973539694504f, - -0.6230949766122071f, - -0.6229925885784011f, - -0.6228901898697841f, - -0.6227877804881126f, - -0.6226853604351408f, - -0.6225829297126235f, - -0.6224804883223153f, - -0.6223780362659727f, - -0.6222755735453506f, - -0.6221731001622047f, - -0.6220706161182901f, - -0.6219681214153643f, - -0.6218656160551826f, - -0.6217631000395011f, - -0.6216605733700774f, - -0.6215580360486678f, - -0.6214554880770291f, - -0.6213529294569179f, - -0.6212503601900935f, - -0.6211477802783106f, - -0.621045189723329f, - -0.6209425885269051f, - -0.6208399766907992f, - -0.6207373542167666f, - -0.6206347211065677f, - -0.62053207736196f, - -0.6204294229847034f, - -0.6203267579765563f, - -0.6202240823392777f, - -0.6201213960746265f, - -0.6200186991843633f, - -0.6199159916702471f, - -0.619813273534038f, - -0.6197105447774951f, - -0.6196078054023803f, - -0.6195050554104523f, - -0.619402294803474f, - -0.6192995235832033f, - -0.6191967417514033f, - -0.6190939493098336f, - -0.6189911462602579f, - -0.6188883326044347f, - -0.6187855083441277f, - -0.6186826734810975f, - -0.6185798280171084f, - -0.6184769719539196f, - -0.6183741052932956f, - -0.6182712280369976f, - -0.61816834018679f, - -0.6180654417444349f, - -0.6179625327116953f, - -0.6178596130903348f, - -0.6177566828821159f, - -0.617653742088804f, - -0.617550790712162f, - -0.617447828753954f, - -0.6173448562159436f, - -0.6172418730998966f, - -0.6171388794075768f, - -0.6170358751407491f, - -0.6169328603011777f, - -0.616829834890629f, - -0.6167267989108678f, - -0.6166237523636595f, - -0.6165206952507691f, - -0.6164176275739639f, - -0.6163145493350091f, - -0.616211460535671f, - -0.6161083611777153f, - -0.6160052512629101f, - -0.6159021307930211f, - -0.6157989997698157f, - -0.61569585819506f, - -0.6155927060705229f, - -0.6154895433979702f, - -0.6153863701791721f, - -0.6152831864158933f, - -0.6151799921099039f, - -0.615076787262971f, - -0.6149735718768649f, - -0.6148703459533513f, - -0.6147671094942012f, - -0.6146638625011821f, - -0.6145606049760644f, - -0.6144573369206168f, - -0.6143540583366087f, - -0.6142507692258091f, - -0.6141474695899892f, - -0.6140441594309184f, - -0.6139408387503668f, - -0.613837507550104f, - -0.6137341658319022f, - -0.6136308135975311f, - -0.6135274508487619f, - -0.6134240775873648f, - -0.6133206938151127f, - -0.6132172995337761f, - -0.6131138947451268f, - -0.6130104794509365f, - -0.6129070536529765f, - -0.6128036173530205f, - -0.6127001705528401f, - -0.6125967132542077f, - -0.6124932454588955f, - -0.6123897671686777f, - -0.6122862783853267f, - -0.6121827791106156f, - -0.6120792693463174f, - -0.6119757490942069f, - -0.6118722183560567f, - -0.6117686771336427f, - -0.6116651254287362f, - -0.6115615632431138f, - -0.6114579905785485f, - -0.6113544074368171f, - -0.6112508138196918f, - -0.6111472097289495f, - -0.6110435951663643f, - -0.6109399701337135f, - -0.61083633463277f, - -0.6107326886653116f, - -0.6106290322331129f, - -0.6105253653379514f, - -0.6104216879816027f, - -0.6103180001658433f, - -0.6102143018924492f, - -0.6101105931631985f, - -0.6100068739798676f, - -0.6099031443442338f, - -0.6097994042580737f, - -0.6096956537231661f, - -0.6095918927412883f, - -0.6094881213142181f, - -0.6093843394437329f, - -0.6092805471316125f, - -0.6091767443796343f, - -0.6090729311895774f, - -0.6089691075632195f, - -0.6088652735023412f, - -0.608761429008721f, - -0.608657574084138f, - -0.6085537087303714f, - -0.608449832949202f, - -0.6083459467424092f, - -0.6082420501117721f, - -0.6081381430590732f, - -0.6080342255860902f, - -0.6079302976946057f, - -0.6078263593863991f, - -0.6077224106632535f, - -0.607618451526947f, - -0.6075144819792634f, - -0.6074105020219824f, - -0.607306511656888f, - -0.6072025108857593f, - -0.6070984997103802f, - -0.6069944781325316f, - -0.6068904461539973f, - -0.6067864037765593f, - -0.6066823510020001f, - -0.606578287832102f, - -0.6064742142686496f, - -0.6063701303134253f, - -0.6062660359682127f, - -0.6061619312347947f, - -0.6060578161149563f, - -0.6059536906104811f, - -0.605849554723153f, - -0.6057454084547559f, - -0.6056412518070755f, - -0.6055370847818952f, - -0.6054329073810019f, - -0.605328719606178f, - -0.6052245214592106f, - -0.6051203129418838f, - -0.6050160940559854f, - -0.6049118648032983f, - -0.6048076251856105f, - -0.6047033752047074f, - -0.6045991148623754f, - -0.6044948441604002f, - -0.6043905631005698f, - -0.6042862716846704f, - -0.6041819699144884f, - -0.6040776577918121f, - -0.6039733353184285f, - -0.6038690024961249f, - -0.6037646593266882f, - -0.6036603058119081f, - -0.6035559419535717f, - -0.6034515677534673f, - -0.6033471832133825f, - -0.6032427883351076f, - -0.6031383831204303f, - -0.6030339675711399f, - -0.6029295416890247f, - -0.6028251054758753f, - -0.6027206589334806f, - -0.6026162020636302f, - -0.6025117348681134f, - -0.6024072573487214f, - -0.6023027695072438f, - -0.602198271345471f, - -0.6020937628651928f, - -0.6019892440682013f, - -0.601884714956286f, - -0.6017801755312403f, - -0.6016756257948523f, - -0.6015710657489158f, - -0.6014664953952208f, - -0.6013619147355614f, - -0.6012573237717266f, - -0.6011527225055108f, - -0.6010481109387047f, - -0.6009434890731029f, - -0.6008388569104955f, - -0.6007342144526774f, - -0.60062956170144f, - -0.600524898658578f, - -0.6004202253258841f, - -0.600315541705152f, - -0.6002108477981745f, - -0.6001061436067469f, - -0.6000014291326627f, - -0.5998967043777161f, - -0.5997919693437016f, - -0.5996872240324129f, - -0.5995824684456464f, - -0.5994777025851964f, - -0.5993729264528579f, - -0.5992681400504254f, - -0.599163343379696f, - -0.5990585364424645f, - -0.598953719240527f, - -0.5988488917756785f, - -0.5987440540497168f, - -0.5986392060644374f, - -0.598534347821637f, - -0.5984294793231115f, - -0.5983246005706593f, - -0.598219711566076f, - -0.5981148123111609f, - -0.5980099028077087f, - -0.5979049830575192f, - -0.5978000530623885f, - -0.5976951128241168f, - -0.5975901623444995f, - -0.5974852016253368f, - -0.5973802306684259f, - -0.5972752494755676f, - -0.597170258048558f, - -0.5970652563891978f, - -0.5969602444992852f, - -0.5968552223806207f, - -0.5967501900350033f, - -0.5966451474642326f, - -0.5965400946701077f, - -0.5964350316544302f, - -0.5963299584189996f, - -0.5962248749656162f, - -0.5961197812960799f, - -0.596014677412193f, - -0.5959095633157556f, - -0.5958044390085688f, - -0.5956993044924332f, - -0.5955941597691516f, - -0.5954890048405251f, - -0.5953838397083554f, - -0.5952786643744437f, - -0.5951734788405935f, - -0.5950682831086066f, - -0.5949630771802855f, - -0.594857861057432f, - -0.5947526347418506f, - -0.5946473982353434f, - -0.5945421515397137f, - -0.5944368946567649f, - -0.5943316275882996f, - -0.5942263503361234f, - -0.5941210629020384f, - -0.5940157652878508f, - -0.5939104574953622f, - -0.5938051395263791f, - -0.5936998113827047f, - -0.5935944730661458f, - -0.5934891245785046f, - -0.5933837659215881f, - -0.5932783970972005f, - -0.5931730181071494f, - -0.5930676289532373f, - -0.5929622296372724f, - -0.5928568201610591f, - -0.5927514005264051f, - -0.592645970735116f, - -0.5925405307889983f, - -0.592435080689858f, - -0.5923296204395033f, - -0.5922241500397406f, - -0.5921186694923771f, - -0.5920131787992194f, - -0.5919076779620767f, - -0.5918021669827549f, - -0.5916966458630645f, - -0.5915911146048103f, - -0.591485573209803f, - -0.5913800216798495f, - -0.5912744600167604f, - -0.5911688882223419f, - -0.5910633062984049f, - -0.5909577142467577f, - -0.5908521120692098f, - -0.5907464997675699f, - -0.590640877343649f, - -0.5905352447992562f, - -0.5904296021362009f, - -0.5903239493562946f, - -0.5902182864613468f, - -0.5901126134531682f, - -0.5900069303335687f, - -0.5899012371043605f, - -0.5897955337673539f, - -0.5896898203243603f, - -0.5895840967771901f, - -0.5894783631276573f, - -0.5893726193775705f, - -0.5892668655287437f, - -0.5891611015829877f, - -0.5890553275421162f, - -0.5889495434079407f, - -0.5888437491822739f, - -0.5887379448669279f, - -0.5886321304637169f, - -0.5885263059744533f, - -0.5884204714009506f, - -0.5883146267450213f, - -0.5882087720084805f, - -0.5881029071931414f, - -0.5879970323008178f, - -0.5878911473333231f, - -0.5877852522924734f, - -0.5876793471800812f, - -0.5875734319979637f, - -0.5874675067479328f, - -0.5873615714318056f, - -0.5872556260513957f, - -0.5871496706085209f, - -0.5870437051049935f, - -0.5869377295426317f, - -0.5868317439232497f, - -0.586725748248665f, - -0.5866197425206932f, - -0.5865137267411504f, - -0.5864077009118528f, - -0.5863016650346183f, - -0.5861956191112632f, - -0.5860895631436045f, - -0.5859834971334595f, - -0.585877421082645f, - -0.5857713349929797f, - -0.585665238866281f, - -0.5855591327043664f, - -0.5854530165090538f, - -0.5853468902821625f, - -0.5852407540255105f, - -0.5851346077409161f, - -0.5850284514301977f, - -0.5849222850951755f, - -0.584816108737668f, - -0.5847099223594945f, - -0.5846037259624737f, - -0.5844975195484267f, - -0.5843913031191725f, - -0.5842850766765313f, - -0.5841788402223225f, - -0.5840725937583677f, - -0.5839663372864862f, - -0.5838600708085007f, - -0.5837537943262291f, - -0.5836475078414948f, - -0.5835412113561173f, - -0.5834349048719202f, - -0.5833285883907222f, - -0.5832222619143472f, - -0.5831159254446157f, - -0.5830095789833516f, - -0.5829032225323745f, - -0.5827968560935088f, - -0.5826904796685758f, - -0.5825840932593995f, - -0.5824776968678023f, - -0.582371290495607f, - -0.5822648741446363f, - -0.582158447816715f, - -0.5820520115136659f, - -0.581945565237313f, - -0.5818391089894792f, - -0.5817326427719902f, - -0.5816261665866695f, - -0.5815196804353416f, - -0.5814131843198305f, - -0.5813066782419621f, - -0.5812001622035609f, - -0.5810936362064518f, - -0.5809871002524604f, - -0.5808805543434112f, - -0.5807739984811314f, - -0.580667432667446f, - -0.580560856904181f, - -0.5804542711931618f, - -0.5803476755362164f, - -0.5802410699351694f, - -0.5801344543918501f, - -0.580027828908082f, - -0.5799211934856946f, - -0.5798145481265135f, - -0.5797078928323681f, - -0.5796012276050833f, - -0.5794945524464886f, - -0.5793878673584106f, - -0.5792811723426795f, - -0.5791744674011207f, - -0.5790677525355644f, - -0.578961027747838f, - -0.5788542930397714f, - -0.578747548413193f, - -0.5786407938699316f, - -0.5785340294118159f, - -0.5784272550406766f, - -0.5783204707583426f, - -0.5782136765666435f, - -0.5781068724674086f, - -0.5780000584624693f, - -0.577893234553655f, - -0.5777864007427965f, - -0.5776795570317232f, - -0.5775727034222677f, - -0.5774658399162599f, - -0.5773589665155309f, - -0.5772520832219111f, - -0.5771451900372337f, - -0.5770382869633295f, - -0.57693137400203f, - -0.5768244511551666f, - -0.5767175184245726f, - -0.57661057581208f, - -0.5765036233195209f, - -0.5763966609487271f, - -0.5762896887015331f, - -0.5761827065797709f, - -0.576075714585273f, - -0.5759687127198747f, - -0.5758617009854068f, - -0.575754679383705f, - -0.5756476479166014f, - -0.5755406065859324f, - -0.5754335553935293f, - -0.5753264943412282f, - -0.5752194234308624f, - -0.5751123426642679f, - -0.5750052520432788f, - -0.57489815156973f, - -0.5747910412454561f, - -0.5746839210722936f, - -0.5745767910520774f, - -0.5744696511866431f, - -0.5743625014778259f, - -0.574255341927463f, - -0.57414817253739f, - -0.5740409933094431f, - -0.5739338042454583f, - -0.5738266053472735f, - -0.573719396616724f, - -0.5736121780556492f, - -0.5735049496658832f, - -0.5733977114492655f, - -0.5732904634076323f, - -0.5731832055428233f, - -0.5730759378566735f, - -0.572968660351023f, - -0.5728613730277087f, - -0.5727540758885709f, - -0.5726467689354453f, - -0.5725394521701727f, - -0.5724321255945913f, - -0.5723247892105393f, - -0.5722174430198574f, - -0.5721100870243844f, - -0.5720027212259594f, - -0.5718953456264216f, - -0.5717879602276124f, - -0.5716805650313709f, - -0.5715731600395373f, - -0.5714657452539513f, - -0.571358320676455f, - -0.5712508863088882f, - -0.5711434421530918f, - -0.571035988210906f, - -0.5709285244841735f, - -0.5708210509747351f, - -0.5707135676844322f, - -0.5706060746151057f, - -0.5704985717685991f, - -0.5703910591467536f, - -0.5702835367514113f, - -0.570176004584414f, - -0.5700684626476056f, - -0.5699609109428273f, - -0.5698533494719243f, - -0.5697457782367367f, - -0.5696381972391098f, - -0.5695306064808856f, - -0.5694230059639097f, - -0.569315395690023f, - -0.5692077756610716f, - -0.5691001458788979f, - -0.5689925063453485f, - -0.5688848570622648f, - -0.5687771980314934f, - -0.5686695292548776f, - -0.5685618507342639f, - -0.5684541624714964f, - -0.5683464644684204f, - -0.5682387567268806f, - -0.568131039248724f, - -0.5680233120357955f, - -0.567915575089941f, - -0.5678078284130057f, - -0.5677000720068375f, - -0.5675923058732819f, - -0.5674845300141855f, - -0.5673767444313942f, - -0.5672689491267565f, - -0.5671611441021186f, - -0.5670533293593276f, - -0.5669455049002311f, - -0.5668376707266758f, - -0.5667298268405109f, - -0.5666219732435835f, - -0.5665141099377417f, - -0.5664062369248329f, - -0.566298354206707f, - -0.5661904617852118f, - -0.566082559662196f, - -0.5659746478395077f, - -0.5658667263189975f, - -0.565758795102513f, - -0.565650854191906f, - -0.5655429035890228f, - -0.5654349432957156f, - -0.5653269733138326f, - -0.5652189936452262f, - -0.5651110042917434f, - -0.5650030052552372f, - -0.5648949965375563f, - -0.5647869781405536f, - -0.5646789500660773f, - -0.5645709123159803f, - -0.5644628648921126f, - -0.5643548077963271f, - -0.5642467410304742f, - -0.5641386645964059f, - -0.5640305784959734f, - -0.5639224827310299f, - -0.563814377303427f, - -0.5637062622150171f, - -0.563598137467652f, - -0.5634900030631858f, - -0.5633818590034706f, - -0.5632737052903594f, - -0.5631655419257048f, - -0.5630573689113615f, - -0.5629491862491822f, - -0.5628409939410207f, - -0.5627327919887302f, - -0.5626245803941661f, - -0.5625163591591816f, - -0.5624081282856315f, - -0.5622998877753692f, - -0.5621916376302509f, - -0.5620833778521309f, - -0.5619751084428634f, - -0.5618668294043055f, - -0.56175854073831f, - -0.5616502424467342f, - -0.5615419345314326f, - -0.5614336169942632f, - -0.561325289837079f, - -0.5612169530617382f, - -0.5611086066700959f, - -0.5610002506640106f, - -0.5608918850453362f, - -0.5607835098159315f, - -0.5606751249776522f, - -0.5605667305323568f, - -0.560458326481902f, - -0.5603499128281451f, - -0.5602414895729431f, - -0.5601330567181553f, - -0.5600246142656389f, - -0.559916162217252f, - -0.5598077005748522f, - -0.5596992293402995f, - -0.5595907485154517f, - -0.5594822581021675f, - -0.5593737581023053f, - -0.5592652485177255f, - -0.5591567293502862f, - -0.5590482006018487f, - -0.5589396622742699f, - -0.5588311143694118f, - -0.5587225568891327f, - -0.5586139898352951f, - -0.5585054132097562f, - -0.5583968270143786f, - -0.5582882312510223f, - -0.5581796259215474f, - -0.5580710110278159f, - -0.5579623865716885f, - -0.5578537525550262f, - -0.55774510897969f, - -0.5576364558475427f, - -0.5575277931604454f, - -0.55741912092026f, - -0.5573104391288478f, - -0.5572017477880725f, - -0.5570930468997959f, - -0.5569843364658803f, - -0.556875616488188f, - -0.556766886968583f, - -0.5566581479089279f, - -0.5565493993110858f, - -0.5564406411769194f, - -0.5563318735082937f, - -0.5562230963070716f, - -0.556114309575117f, - -0.5560055133142933f, - -0.555896707526466f, - -0.5557878922134988f, - -0.5556790673772563f, - -0.5555702330196022f, - -0.5554613891424031f, - -0.5553525357475224f, - -0.5552436728368275f, - -0.5551348004121809f, - -0.5550259184754501f, - -0.5549170270284994f, - -0.5548081260731969f, - -0.5546992156114054f, - -0.5545902956449936f, - -0.5544813661758262f, - -0.5543724272057718f, - -0.5542634787366941f, - -0.5541545207704622f, - -0.5540455533089417f, - -0.553936576354001f, - -0.5538275899075066f, - -0.5537185939713262f, - -0.5536095885473264f, - -0.5535005736373767f, - -0.5533915492433442f, - -0.553282515367097f, - -0.5531734720105034f, - -0.553064419175431f, - -0.55295535686375f, - -0.5528462850773284f, - -0.5527372038180349f, - -0.5526281130877381f, - -0.5525190128883086f, - -0.5524099032216151f, - -0.5523007840895271f, - -0.5521916554939137f, - -0.5520825174366462f, - -0.5519733699195939f, - -0.5518642129446271f, - -0.5517550465136152f, - -0.5516458706284305f, - -0.551536685290942f, - -0.551427490503023f, - -0.5513182862665413f, - -0.5512090725833706f, - -0.5510998494553806f, - -0.550990616884445f, - -0.5508813748724326f, - -0.5507721234212173f, - -0.5506628625326698f, - -0.5505535922086644f, - -0.5504443124510705f, - -0.5503350232617626f, - -0.5502257246426122f, - -0.5501164165954933f, - -0.5500070991222782f, - -0.5498977722248402f, - -0.5497884359050516f, - -0.5496790901647873f, - -0.5495697350059204f, - -0.5494603704303246f, - -0.549350996439873f, - -0.5492416130364413f, - -0.5491322202219028f, - -0.5490228179981321f, - -0.5489134063670031f, - -0.5488039853303919f, - -0.5486945548901726f, - -0.5485851150482204f, - -0.5484756658064097f, - -0.5483662071666173f, - -0.5482567391307183f, - -0.548147261700588f, - -0.5480377748781025f, - -0.547928278665137f, - -0.5478187730635694f, - -0.5477092580752749f, - -0.5475997337021304f, - -0.5474901999460116f, - -0.5473806568087969f, - -0.5472711042923617f, - -0.5471615423985856f, - -0.5470519711293427f, - -0.5469423904865128f, - -0.5468328004719721f, - -0.5467232010876006f, - -0.5466135923352733f, - -0.5465039742168705f, - -0.5463943467342689f, - -0.5462847098893486f, - -0.5461750636839874f, - -0.546065408120064f, - -0.5459557431994566f, - -0.5458460689240459f, - -0.5457363852957101f, - -0.5456266923163289f, - -0.545516989987781f, - -0.5454072783119475f, - -0.5452975572907076f, - -0.5451878269259415f, - -0.5450780872195284f, - -0.5449683381733504f, - -0.5448585797892864f, - -0.5447488120692193f, - -0.544639035015027f, - -0.5445292486285928f, - -0.5444194529117968f, - -0.5443096478665208f, - -0.5441998334946452f, - -0.5440900097980531f, - -0.5439801767786259f, - -0.5438703344382452f, - -0.5437604827787925f, - -0.5436506218021515f, - -0.5435407515102041f, - -0.543430871904832f, - -0.5433209829879195f, - -0.5432110847613487f, - -0.5431011772270027f, - -0.542991260386764f, - -0.5428813342425175f, - -0.542771398796146f, - -0.5426614540495333f, - -0.5425515000045624f, - -0.5424415366631196f, - -0.542331564027086f, - -0.5422215820983485f, - -0.5421115908787899f, - -0.5420015903702964f, - -0.541891580574752f, - -0.5417815614940418f, - -0.5416715331300502f, - -0.5415614954846639f, - -0.5414514485597678f, - -0.5413413923572472f, - -0.5412313268789876f, - -0.541121252126876f, - -0.541011168102798f, - -0.5409010748086398f, - -0.540790972246287f, - -0.5406808604176278f, - -0.5405707393245474f, - -0.5404606089689349f, - -0.5403504693526743f, - -0.5402403204776552f, - -0.5401301623457635f, - -0.5400199949588887f, - -0.5399098183189158f, - -0.5397996324277348f, - -0.5396894372872322f, - -0.5395792328992975f, - -0.5394690192658186f, - -0.5393587963886837f, - -0.5392485642697815f, - -0.5391383229110002f, - -0.53902807231423f, - -0.5389178124813595f, - -0.5388075434142778f, - -0.5386972651148737f, - -0.5385869775850383f, - -0.5384766808266606f, - -0.5383663748416303f, - -0.5382560596318369f, - -0.5381457351991721f, - -0.5380354015455255f, - -0.5379250586727876f, - -0.5378147065828486f, - -0.5377043452776005f, - -0.5375939747589337f, - -0.5374835950287393f, - -0.5373732060889082f, - -0.537262807941333f, - -0.5371524005879047f, - -0.5370419840305152f, - -0.5369315582710555f, - -0.5368211233114195f, - -0.5367106791534978f, - -0.5366002257991851f, - -0.536489763250371f, - -0.5363792915089505f, - -0.536268810576815f, - -0.5361583204558599f, - -0.5360478211479752f, - -0.5359373126550566f, - -0.5358267949789963f, - -0.5357162681216902f, - -0.5356057320850289f, - -0.5354951868709089f, - -0.5353846324812229f, - -0.5352740689178664f, - -0.5351634961827335f, - -0.5350529142777187f, - -0.5349423232047159f, - -0.5348317229656218f, - -0.5347211135623304f, - -0.5346104949967374f, - -0.5344998672707372f, - -0.5343892303862269f, - -0.5342785843451014f, - -0.5341679291492568f, - -0.5340572648005883f, - -0.5339465913009936f, - -0.5338359086523683f, - -0.5337252168566089f, - -0.5336145159156122f, - -0.5335038058312741f, - -0.5333930866054931f, - -0.5332823582401658f, - -0.5331716207371893f, - -0.5330608740984604f, - -0.5329501183258781f, - -0.5328393534213388f, - -0.5327285793867427f, - -0.5326177962239848f, - -0.5325070039349655f, - -0.5323962025215818f, - -0.5322853919857347f, - -0.5321745723293195f, - -0.5320637435542376f, - -0.5319529056623865f, - -0.5318420586556675f, - -0.531731202535977f, - -0.5316203373052169f, - -0.531509462965285f, - -0.5313985795180829f, - -0.5312876869655097f, - -0.5311767853094654f, - -0.5310658745518498f, - -0.5309549546945646f, - -0.5308440257395097f, - -0.5307330876885858f, - -0.530622140543693f, - -0.5305111843067342f, - -0.5304002189796093f, - -0.5302892445642201f, - -0.5301782610624671f, - -0.5300672684762536f, - -0.5299562668074808f, - -0.5298452560580504f, - -0.5297342362298639f, - -0.5296232073248253f, - -0.5295121693448359f, - -0.5294011222917987f, - -0.5292900661676155f, - -0.5291790009741908f, - -0.5290679267134268f, - -0.528956843387226f, - -0.5288457509974935f, - -0.5287346495461319f, - -0.5286235390350449f, - -0.5285124194661356f, - -0.5284012908413103f, - -0.5282901531624701f, - -0.5281790064315216f, - -0.5280678506503679f, - -0.5279566858209156f, - -0.5278455119450667f, - -0.5277343290247282f, - -0.5276231370618039f, - -0.5275119360582003f, - -0.5274007260158223f, - -0.5272895069365754f, - -0.5271782788223645f, - -0.5270670416750968f, - -0.5269557954966778f, - -0.5268445402890137f, - -0.5267332760540099f, - -0.5266220027935745f, - -0.5265107205096133f, - -0.5263994292040333f, - -0.5262881288787404f, - -0.5261768195356433f, - -0.526065501176648f, - -0.5259541738036638f, - -0.5258428374185955f, - -0.5257314920233529f, - -0.5256201376198425f, - -0.5255087742099747f, - -0.5253974017956543f, - -0.5252860203787922f, - -0.5251746299612954f, - -0.5250632305450745f, - -0.5249518221320356f, - -0.5248404047240899f, - -0.5247289783231456f, - -0.5246175429311112f, - -0.5245060985498977f, - -0.5243946451814139f, - -0.5242831828275696f, - -0.5241717114902738f, - -0.5240602311714381f, - -0.5239487418729718f, - -0.5238372435967855f, - -0.5237257363447887f, - -0.5236142201188938f, - -0.5235026949210105f, - -0.5233911607530501f, - -0.5232796176169228f, - -0.5231680655145413f, - -0.5230565044478164f, - -0.5229449344186596f, - -0.5228333554289819f, - -0.5227217674806965f, - -0.522610170575715f, - -0.5224985647159495f, - -0.5223869499033112f, - -0.5222753261397146f, - -0.5221636934270707f, - -0.5220520517672943f, - -0.5219404011622957f, - -0.52182874161399f, - -0.5217170731242889f, - -0.5216053956951084f, - -0.5214937093283588f, - -0.5213820140259562f, - -0.5212703097898128f, - -0.5211585966218449f, - -0.5210468745239639f, - -0.5209351434980861f, - -0.5208234035461248f, - -0.5207116546699957f, - -0.5205998968716132f, - -0.5204881301528921f, - -0.5203763545157467f, - -0.5202645699620939f, - -0.5201527764938482f, - -0.5200409741129252f, - -0.5199291628212398f, - -0.5198173426207094f, - -0.5197055135132493f, - -0.5195936755007757f, - -0.5194818285852049f, - -0.5193699727684524f, - -0.5192581080524366f, - -0.5191462344390733f, - -0.5190343519302796f, - -0.5189224605279716f, - -0.5188105602340684f, - -0.5186986510504863f, - -0.5185867329791429f, - -0.5184748060219553f, - -0.5183628701808427f, - -0.5182509254577223f, - -0.5181389718545123f, - -0.5180270093731303f, - -0.5179150380154962f, - -0.5178030577835271f, - -0.5176910686791439f, - -0.5175790707042627f, - -0.5174670638608047f, - -0.5173550481506874f, - -0.517243023575833f, - -0.5171309901381573f, - -0.5170189478395827f, - -0.5169068966820273f, - -0.5167948366674127f, - -0.5166827677976581f, - -0.5165706900746839f, - -0.5164586035004097f, - -0.5163465080767576f, - -0.5162344038056477f, - -0.5161222906890007f, - -0.516010168728737f, - -0.515898037926779f, - -0.5157858982850476f, - -0.5156737498054643f, - -0.5155615924899497f, - -0.5154494263404273f, - -0.5153372513588184f, - -0.5152250675470447f, - -0.515112874907028f, - -0.515000673440692f, - -0.5148884631499587f, - -0.5147762440367507f, - -0.5146640161029901f, - -0.5145517793506013f, - -0.5144395337815068f, - -0.5143272793976298f, - -0.5142150162008939f, - -0.5141027441932219f, - -0.513990463376539f, - -0.5138781737527676f, - -0.513765875323834f, - -0.5136535680916594f, - -0.5135412520581705f, - -0.5134289272252902f, - -0.5133165935949454f, - -0.513204251169058f, - -0.5130918999495552f, - -0.5129795399383604f, - -0.5128671711374014f, - -0.5127547935486005f, - -0.5126424071738854f, - -0.5125300120151806f, - -0.5124176080744131f, - -0.5123051953535083f, - -0.5121927738543924f, - -0.5120803435789909f, - -0.5119679045292319f, - -0.5118554567070411f, - -0.5117430001143454f, - -0.5116305347530709f, - -0.5115180606251462f, - -0.5114055777324975f, - -0.5112930860770526f, - -0.511180585660738f, - -0.5110680764854829f, - -0.5109555585532136f, - -0.5108430318658604f, - -0.5107304964253483f, - -0.510617952233608f, - -0.5105053992925669f, - -0.5103928376041538f, - -0.5102802671702964f, - -0.5101676879929254f, - -0.5100551000739688f, - -0.5099425034153552f, - -0.5098298980190152f, - -0.5097172838868778f, - -0.5096046610208723f, - -0.5094920294229279f, - -0.509379389094976f, - -0.5092667400389459f, - -0.5091540822567677f, - -0.5090414157503712f, - -0.5089287405216882f, - -0.5088160565726488f, - -0.5087033639051838f, - -0.5085906625212233f, - -0.5084779524226999f, - -0.5083652336115442f, - -0.5082525060896875f, - -0.5081397698590607f, - -0.508027024921597f, - -0.5079142712792275f, - -0.5078015089338841f, - -0.5076887378874984f, - -0.507575958142004f, - -0.5074631696993327f, - -0.507350372561417f, - -0.507237566730189f, - -0.5071247522075832f, - -0.5070119289955309f, - -0.5068990970959678f, - -0.5067862565108241f, - -0.5066734072420355f, - -0.5065605492915342f, - -0.5064476826612563f, - -0.5063348073531326f, - -0.5062219233690995f, - -0.5061090307110898f, - -0.5059961293810402f, - -0.505883219380882f, - -0.5057703007125522f, - -0.5056573733779843f, - -0.5055444373791147f, - -0.5054314927178776f, - -0.5053185393962085f, - -0.505205577416042f, - -0.5050926067793151f, - -0.504979627487963f, - -0.5048666395439213f, - -0.5047536429491262f, - -0.5046406377055129f, - -0.5045276238150194f, - -0.5044146012795814f, - -0.5043015701011355f, - -0.5041885302816177f, - -0.5040754818229664f, - -0.5039624247271178f, - -0.5038493589960094f, - -0.5037362846315774f, - -0.503623201635761f, - -0.5035101100104973f, - -0.5033970097577237f, - -0.5032839008793777f, - -0.5031707833773987f, - -0.5030576572537235f, - -0.5029445225102929f, - -0.5028313791490422f, - -0.5027182271719124f, - -0.5026050665808408f, - -0.5024918973777687f, - -0.5023787195646322f, - -0.5022655331433729f, - -0.5021523381159284f, - -0.502039134484241f, - -0.501925922250247f, - -0.5018127014158887f, - -0.5016994719831046f, - -0.5015862339538364f, - -0.5014729873300235f, - -0.5013597321136065f, - -0.5012464683065252f, - -0.5011331959107218f, - -0.5010199149281365f, - -0.5009066253607103f, - -0.5007933272103836f, - -0.5006800204790993f, - -0.5005667051687982f, - -0.5004533812814218f, - -0.5003400488189111f, - -0.5002267077832097f, - -0.5001133581762587f, - -0.5000000000000004f, - -0.4998866332563765f, - -0.49977325794733096f, - -0.4996598740748056f, - -0.49954648164074333f, - -0.4994330806470871f, - -0.49931967109577907f, - -0.49920625298876425f, - -0.4990928263279851f, - -0.4989793911153852f, - -0.4988659473529075f, - -0.4987524950424973f, - -0.4986390341860971f, - -0.4985255647856533f, - -0.4984120868431071f, - -0.4982986003604052f, - -0.4981851053394906f, - -0.4980716017823104f, - -0.4979580896908063f, - -0.49784456906692565f, - -0.497731039912612f, - -0.49761750222981227f, - -0.49750395602047104f, - -0.49739040128653395f, - -0.49727683802994593f, - -0.4971632662526544f, - -0.49704968595660465f, - -0.49693609714374276f, - -0.4968224998160144f, - -0.49670889397536744f, - -0.4965952796237478f, - -0.4964816567631022f, - -0.4963680253953767f, - -0.49625438552252005f, - -0.4961407371464778f, - -0.49602708026919956f, - -0.49591341489262974f, - -0.4957997410187184f, - -0.49568605864941234f, - -0.49557236778665964f, - -0.4954586684324075f, - -0.4953449605886057f, - -0.49523124425720183f, - -0.4951175194401444f, - -0.4950037861393813f, - -0.49489004435686273f, - -0.49477629409453705f, - -0.4946625353543524f, - -0.49454876813825965f, - -0.4944349924482073f, - -0.494321208286145f, - -0.4942074156540216f, - -0.49409361455378914f, - -0.4939798049873945f, - -0.4938659869567902f, - -0.49375216046392484f, - -0.49363832551075115f, - -0.49352448209921657f, - -0.49341063023127407f, - -0.49329676990887295f, - -0.4931829011339658f, - -0.49306902390850277f, - -0.49295513823443526f, - -0.4928412441137139f, - -0.4927273415482917f, - -0.49261343054011963f, - -0.49249951109114953f, - -0.49238558320333253f, - -0.4922716468786224f, - -0.49215770211896986f, - -0.4920437489263295f, - -0.49192978730265097f, - -0.4918158172498892f, - -0.4917018387699955f, - -0.49158785186492515f, - -0.49147385653662823f, - -0.49135985278706035f, - -0.49124584061817334f, - -0.4911318200319231f, - -0.49101779103026033f, - -0.49090375361514105f, - -0.4907897077885179f, - -0.4906756535523464f, - -0.49056159090858015f, - -0.49044751985917356f, - -0.49033344040608123f, - -0.4902193525512571f, - -0.4901052562966576f, - -0.4899911516442369f, - -0.4898770385959502f, - -0.48976291715375203f, - -0.4896487873195993f, - -0.48953464909544697f, - -0.48942050248325064f, - -0.4893063474849655f, - -0.489192184102549f, - -0.4890780123379566f, - -0.4889638321931446f, - -0.48884964367006867f, - -0.4887354467706869f, - -0.48862124149695535f, - -0.4885070278508308f, - -0.4883928058342695f, - -0.4882785754492302f, - -0.48816433669766945f, - -0.48805008958154467f, - -0.48793583410281266f, - -0.48782157026343276f, - -0.4877072980653612f, - -0.4875930175105585f, - -0.48747872860097957f, - -0.4873644313385851f, - -0.487250125725332f, - -0.4871358117631812f, - -0.4870214894540883f, - -0.4869071588000145f, - -0.48679281980291733f, - -0.4866784724647575f, - -0.4865641167874935f, - -0.48644975277308483f, - -0.4863353804234902f, - -0.4862209997406711f, - -0.4861066107265865f, - -0.4859922133831964f, - -0.48587780771246036f, - -0.48576339371634003f, - -0.4856489713967952f, - -0.4855345407557865f, - -0.4854201017952738f, - -0.4853056545172195f, - -0.48519119892358403f, - -0.4850767350163284f, - -0.484962262797414f, - -0.48484778226880143f, - -0.4847332934324539f, - -0.48461879629033233f, - -0.4845042908443986f, - -0.48438977709661396f, - -0.4842752550489422f, - -0.4841607247033447f, - -0.484046186061784f, - -0.4839316391262219f, - -0.48381708389862266f, - -0.4837025203809477f, - -0.4835879485751622f, - -0.4834733684832263f, - -0.48335878010710565f, - -0.48324418344876213f, - -0.4831295785101616f, - -0.4830149652932647f, - -0.48290034380003766f, - -0.4827857140324429f, - -0.48267107599244696f, - -0.48255642968201096f, - -0.48244177510310166f, - -0.4823271122576821f, - -0.48221244114771855f, - -0.4820977617751751f, - -0.4819830741420168f, - -0.4818683782502079f, - -0.4817536741017153f, - -0.4816389616985037f, - -0.48152424104253855f, - -0.48140951213578487f, - -0.48129477498021f, - -0.4811800295777792f, - -0.48106527593045867f, - -0.4809505140402138f, - -0.4808357439090125f, - -0.48072096553882065f, - -0.48060617893160495f, - -0.48049138408933145f, - -0.4803765810139687f, - -0.48026176970748297f, - -0.48014695017184156f, - -0.4800321224090111f, - -0.4799172864209607f, - -0.4798024422096573f, - -0.4796875897770678f, - -0.4795727291251619f, - -0.4794578602559068f, - -0.47934298317127083f, - -0.4792280978732215f, - -0.47911320436372984f, - -0.47899830264476123f, - -0.47888339271828695f, - -0.47876847458627425f, - -0.4786535482506947f, - -0.47853861371351436f, - -0.4784236709767049f, - -0.47830872004223435f, - -0.47819376091207383f, - -0.47807879358819244f, - -0.47796381807256005f, - -0.47784883436714604f, - -0.4777338424739221f, - -0.47761884239485786f, - -0.4775038341319237f, - -0.4773888176870897f, - -0.477273793062328f, - -0.47715876025960874f, - -0.47704371928090306f, - -0.4769286701281814f, - -0.47681361280341655f, - -0.4766985473085785f, - -0.47658347364564124f, - -0.4764683918165733f, - -0.47635330182334895f, - -0.47623820366793873f, - -0.47612309735231706f, - -0.47600798287845325f, - -0.475892860248322f, - -0.47577772946389435f, - -0.47566259052714543f, - -0.475547443440045f, - -0.47543228820456834f, - -0.4753171248226879f, - -0.4752019532963761f, - -0.47508677362760804f, - -0.47497158581835647f, - -0.4748563898705951f, - -0.4747411857862969f, - -0.47462597356743763f, - -0.4745107532159905f, - -0.47439552473392976f, - -0.47428028812322914f, - -0.4741650433858647f, - -0.4740497905238103f, - -0.47393452953904086f, - -0.47381926043353045f, - -0.4737039832092559f, - -0.47358869786819147f, - -0.47347340441231267f, - -0.47335810284359425f, - -0.4732427931640134f, - -0.4731274753755451f, - -0.4730121494801654f, - -0.4728968154798495f, - -0.47278147337657517f, - -0.47266612317231727f, - -0.4725507648690546f, - -0.4724353984687607f, - -0.47232002397341466f, - -0.4722046413849918f, - -0.47208925070547153f, - -0.47197385193682795f, - -0.47185844508104074f, - -0.47174303014008573f, - -0.4716276071159429f, - -0.4715121760105869f, - -0.4713967368259979f, - -0.47128128956415244f, - -0.4711658342270302f, - -0.4710503708166086f, - -0.4709348993348662f, - -0.4708194197837807f, - -0.4707039321653325f, - -0.47058843648149956f, - -0.4704729327342609f, - -0.47035742092559485f, - -0.4702419010574822f, - -0.4701263731319017f, - -0.47001083715083275f, - -0.4698952931162551f, - -0.46977974103014775f, - -0.46966418089449224f, - -0.4695486127112679f, - -0.46943303648245494f, - -0.46931745221003296f, - -0.46920185989598395f, - -0.46908625954228783f, - -0.46897065115092545f, - -0.4688550347238768f, - -0.46873941026312466f, - -0.4686237777706493f, - -0.4685081372484321f, - -0.4683924886984538f, - -0.4682768321226975f, - -0.46816116752314346f, - -0.4680454949017758f, - -0.4679298142605735f, - -0.467814125601521f, - -0.4676984289265991f, - -0.4675827242377925f, - -0.4674670115370807f, - -0.4673512908264488f, - -0.4672355621078779f, - -0.4671198253833527f, - -0.4670040806548555f, - -0.4668883279243695f, - -0.4667725671938774f, - -0.46665679846536423f, - -0.4665410217408129f, - -0.46642523702220723f, - -0.4663094443115303f, - -0.4661936436107678f, - -0.4660778349219032f, - -0.4659620182469208f, - -0.4658461935878043f, - -0.46573036094653997f, - -0.4656145203251117f, - -0.46549867172550435f, - -0.4653828151497023f, - -0.46526695059969225f, - -0.46515107807745865f, - -0.465035197584987f, - -0.4649193091242621f, - -0.4648034126972712f, - -0.4646875083059994f, - -0.46457159595243275f, - -0.4644556756385573f, - -0.46433974736635847f, - -0.46422381113782435f, - -0.46410786695493983f, - -0.463991914819694f, - -0.46387595473407045f, - -0.4637599867000585f, - -0.46364401071964373f, - -0.4635280267948157f, - -0.46341203492755856f, - -0.4632960351198621f, - -0.46318002737371256f, - -0.46306401169109995f, - -0.462947988074009f, - -0.4628319565244301f, - -0.46271591704434994f, - -0.4625998696357583f, - -0.4624838143006429f, - -0.46236775104099226f, - -0.46225167985879434f, - -0.46213560075603954f, - -0.4620195137347161f, - -0.46190341879681307f, - -0.461787315944319f, - -0.46167120517922483f, - -0.46155508650351845f, - -0.461438959919192f, - -0.461322825428232f, - -0.4612066830326308f, - -0.4610905327343769f, - -0.4609743745354629f, - -0.46085820843787595f, - -0.4607420344436089f, - -0.4606258525546515f, - -0.46050966277299465f, - -0.4603934651006283f, - -0.46027725953954507f, - -0.4601610460917354f, - -0.46004482475918973f, - -0.45992859554390103f, - -0.4598123584478601f, - -0.45969611347305867f, - -0.4595798606214877f, - -0.4594635998951408f, - -0.45934733129600924f, - -0.4592310548260852f, - -0.4591147704873604f, - -0.45899847828182955f, - -0.45888217821148225f, - -0.45876587027831356f, - -0.4586495544843149f, - -0.45853323083148073f, - -0.4584168993218036f, - -0.45830055995727664f, - -0.4581842127398927f, - -0.4580678576716468f, - -0.45795149475453195f, - -0.457835123990542f, - -0.45771874538167f, - -0.4576023589299118f, - -0.4574859646372608f, - -0.4573695625057114f, - -0.4572531525372573f, - -0.45713673473389477f, - -0.45702030909761704f, - -0.4569038756304213f, - -0.4567874343342995f, - -0.45667098521124927f, - -0.45655452826326426f, - -0.45643806349234234f, - -0.4563215909004759f, - -0.4562051104896631f, - -0.45608862226189817f, - -0.45597212621917954f, - -0.4558556223635001f, - -0.4557391106968585f, - -0.4556225912212496f, - -0.4555060639386715f, - -0.45538952885112f, - -0.45527298596059196f, - -0.45515643526908434f, - -0.45503987677859337f, - -0.45492331049111784f, - -0.45480673640865427f, - -0.4546901545332001f, - -0.45457356486675227f, - -0.45445696741131f, - -0.4543403621688703f, - -0.45422374914143127f, - -0.4541071283309902f, - -0.45399049973954697f, - -0.4538738633690992f, - -0.4537572192216454f, - -0.45364056729918345f, - -0.4535239076037137f, - -0.4534072401372343f, - -0.4532905649017444f, - -0.4531738818992423f, - -0.45305719113172893f, - -0.4529404926012023f, - -0.45282378630966413f, - -0.4527070722591112f, - -0.4525903504515457f, - -0.45247362088896603f, - -0.4523568835733747f, - -0.4522401385067688f, - -0.45212338569115107f, - -0.45200662512852047f, - -0.45188985682088006f, - -0.45177308077022743f, - -0.4516562969785659f, - -0.451539505447895f, - -0.45142270618021746f, - -0.4513058991775338f, - -0.4511890844418454f, - -0.4510722619751532f, - -0.45095543177946046f, - -0.4508385938567682f, - -0.45072174820907845f, - -0.45060489483839256f, - -0.45048803374671426f, - -0.45037116493604523f, - -0.45025428840838794f, - -0.45013740416574427f, - -0.45002051221011863f, - -0.4499036125435131f, - -0.4497867051679306f, - -0.4496697900853745f, - -0.44955286729784727f, - -0.44943593680735383f, - -0.4493189986158971f, - -0.4492020527254807f, - -0.4490850991381077f, - -0.4489681378557836f, - -0.44885116888051096f, - -0.44873419221429645f, - -0.44861720785914116f, - -0.448500215817052f, - -0.448383216090032f, - -0.4482662086800884f, - -0.4481491935892227f, - -0.4480321708194425f, - -0.4479151403727513f, - -0.4477981022511568f, - -0.4476810564566612f, - -0.4475640029912724f, - -0.4474469418569946f, - -0.44732987305583505f, - -0.447212796589799f, - -0.44709571246089247f, - -0.44697862067112093f, - -0.4468615212224923f, - -0.4467444141170122f, - -0.44662729935668727f, - -0.44651017694352346f, - -0.44639304687952913f, - -0.44627590916671056f, - -0.44615876380707487f, - -0.4460416108026285f, - -0.4459244501553804f, - -0.44580728186733737f, - -0.44569010594050695f, - -0.4455729223768962f, - -0.4454557311785146f, - -0.4453385323473694f, - -0.44522132588546875f, - -0.4451041117948202f, - -0.4449868900774337f, - -0.4448696607353171f, - -0.44475242377047897f, - -0.44463517918492745f, - -0.4445179269806731f, - -0.44440066715972415f, - -0.444283399724089f, - -0.4441661246757786f, - -0.4440488420168017f, - -0.4439315517491679f, - -0.443814253874886f, - -0.44369694839596835f, - -0.44357963531442185f, - -0.4434623146322589f, - -0.44334498635148817f, - -0.4432276504741217f, - -0.44311030700216913f, - -0.4429929559376412f, - -0.4428755972825479f, - -0.44275823103890166f, - -0.4426408572087127f, - -0.44252347579399226f, - -0.4424060867967508f, - -0.4422886902190014f, - -0.4421712860627548f, - -0.44205387433002263f, - -0.441936455022816f, - -0.44181902814314833f, - -0.4417015936930302f, - -0.4415841516744762f, - -0.44146670208949546f, - -0.44134924494010286f, - -0.4412317802283094f, - -0.44111430795613016f, - -0.4409968281255748f, - -0.44087934073865875f, - -0.4407618457973935f, - -0.44064434330379476f, - -0.4405268332598726f, - -0.44040931566764296f, - -0.4402917905291179f, - -0.4401742578463127f, - -0.44005671762124055f, - -0.4399391698559154f, - -0.43982161455235147f, - -0.4397040517125622f, - -0.4395864813385636f, - -0.4394689034323694f, - -0.4393513179959942f, - -0.43923372503145214f, - -0.4391161245407596f, - -0.43899851652593097f, - -0.4388809009889813f, - -0.4387632779319252f, - -0.43864564735677963f, - -0.43852800926555946f, - -0.43841036366028024f, - -0.43829271054295715f, - -0.43817504991560763f, - -0.43805738178024706f, - -0.43793970613889155f, - -0.4378220229935567f, - -0.4377043323462606f, - -0.437586634199019f, - -0.4374689285538486f, - -0.43735121541276556f, - -0.4372334947777884f, - -0.43711576665093255f, - -0.4369980310342178f, - -0.4368802879296582f, - -0.4367625373392737f, - -0.4366447792650804f, - -0.4365270137090983f, - -0.4364092406733422f, - -0.4362914601598324f, - -0.43617367217058556f, - -0.4360558767076214f, - -0.4359380737729577f, - -0.4358202633686128f, - -0.4357024454966047f, - -0.43558462015895366f, - -0.43546678735767785f, - -0.43534894709479627f, - -0.4352310993723273f, - -0.4351132441922918f, - -0.43499538155670847f, - -0.43487751146759673f, - -0.4347596339269756f, - -0.4346417489368663f, - -0.4345238564992881f, - -0.434405956616261f, - -0.43428804928980524f, - -0.43417013452194025f, - -0.4340522123146881f, - -0.43393428267006856f, - -0.4338163455901023f, - -0.4336984010768094f, - -0.43358044913221233f, - -0.4334624897583314f, - -0.43334452295718784f, - -0.43322654873080213f, - -0.4331085670811974f, - -0.4329905780103935f, - -0.4328725815204147f, - -0.4327545776132795f, - -0.4326365662910123f, - -0.4325185475556337f, - -0.43240052140916824f, - -0.432282487853635f, - -0.43216444689105893f, - -0.43204639852346105f, - -0.43192834275286646f, - -0.43181027958129475f, - -0.4316922090107714f, - -0.4315741310433179f, - -0.43145604568095897f, - -0.43133795292571736f, - -0.4312198527796164f, - -0.431101745244679f, - -0.4309836303229304f, - -0.4308655080163938f, - -0.43074737832709303f, - -0.4306292412570516f, - -0.4305110968082952f, - -0.4303929449828475f, - -0.430274785782733f, - -0.4301566192099754f, - -0.4300384452666012f, - -0.4299202639546344f, - -0.4298020752761f, - -0.42968387923302237f, - -0.4295656758274284f, - -0.42944746506134257f, - -0.4293292469367905f, - -0.4292110214557969f, - -0.42909278862038924f, - -0.4289745484325926f, - -0.42885630089443216f, - -0.4287380460079364f, - -0.42861978377512855f, - -0.4285015141980372f, - -0.42838323727868743f, - -0.4282649530191082f, - -0.4281466614213231f, - -0.4280283624873615f, - -0.42791005621924866f, - -0.4277917426190142f, - -0.4276734216886823f, - -0.42755509343028253f, - -0.427436757845841f, - -0.4273184149373869f, - -0.42720006470694727f, - -0.42708170715654986f, - -0.426963342288222f, - -0.42684497010399347f, - -0.42672659060589163f, - -0.42660820379594494f, - -0.42648980967618116f, - -0.4263714082486305f, - -0.426252999515321f, - -0.4261345834782815f, - -0.42601616013954013f, - -0.42589772950112786f, - -0.4257792915650722f, - -0.42566084633340506f, - -0.4255423938081527f, - -0.42542393399134715f, - -0.42530546688501664f, - -0.42518699249119346f, - -0.42506851081190444f, - -0.4249500218491821f, - -0.424831525605056f, - -0.4247130220815564f, - -0.4245945112807132f, - -0.4244759932045585f, - -0.4243574678551223f, - -0.4242389352344348f, - -0.4241203953445285f, - -0.42400184818743386f, - -0.4238832937651821f, - -0.42376473207980375f, - -0.4236461631333321f, - -0.4235275869277978f, - -0.4234090034652328f, - -0.42329041274766804f, - -0.4231718147771373f, - -0.42305320955567177f, - -0.4229345970853038f, - -0.422815977368065f, - -0.42269735040598944f, - -0.42257871620110893f, - -0.4224600747554563f, - -0.4223414260710637f, - -0.4222227701499656f, - -0.42210410699419443f, - -0.4219854366057834f, - -0.4218667589867651f, - -0.4217480741391747f, - -0.42162938206504413f, - -0.4215106827664097f, - -0.42139197624530195f, - -0.4212732625037573f, - -0.4211545415438083f, - -0.4210358133674917f, - -0.4209170779768385f, - -0.4207983353738857f, - -0.4206795855606663f, - -0.4205608285392175f, - -0.4204420643115709f, - -0.42032329287976394f, - -0.42020451424583005f, - -0.4200857284118062f, - -0.41996693537972685f, - -0.4198481351516275f, - -0.41972932772954297f, - -0.4196105131155107f, - -0.41949169131156555f, - -0.41937286231974363f, - -0.419254026142081f, - -0.4191351827806131f, - -0.41901633223737794f, - -0.41889747451441106f, - -0.41877860961374913f, - -0.4186597375374281f, - -0.41854085828748633f, - -0.4184219718659601f, - -0.41830307827488633f, - -0.41818417751630155f, - -0.4180652695922447f, - -0.41794635450475237f, - -0.4178274322558622f, - -0.417708502847611f, - -0.4175895662820383f, - -0.4174706225611804f, - -0.41735167168707776f, - -0.4172327136617654f, - -0.41711374848728394f, - -0.4169947761656704f, - -0.4168757966989655f, - -0.4167568100892049f, - -0.4166378163384298f, - -0.4165188154486774f, - -0.4163998074219893f, - -0.4162807922604013f, - -0.4161617699659553f, - -0.4160427405406889f, - -0.4159237039866434f, - -0.4158046603058576f, - -0.41568560950037126f, - -0.4155665515722235f, - -0.4154474865234559f, - -0.41532841435610796f, - -0.4152093350722198f, - -0.41509024867383104f, - -0.41497115516298383f, - -0.414852054541718f, - -0.4147329468120743f, - -0.41461383197609275f, - -0.414494710035816f, - -0.4143755809932844f, - -0.4142564448505392f, - -0.41413730160962087f, - -0.4140181512725726f, - -0.41389899384143514f, - -0.41377982931825025f, - -0.413660657705059f, - -0.4135414790039049f, - -0.4134222932168293f, - -0.41330310034587436f, - -0.4131839003930825f, - -0.4130646933604953f, - -0.412945479250157f, - -0.41282625806410866f, - -0.4127070298043955f, - -0.4125877944730573f, - -0.4124685520721395f, - -0.41234930260368374f, - -0.4122300460697356f, - -0.41211078247233546f, - -0.41199151181352917f, - -0.41187223409535884f, - -0.4117529493198706f, - -0.4116336574891053f, - -0.4115143586051092f, - -0.411395052669925f, - -0.4112757396855985f, - -0.4111564196541733f, - -0.41103709257769394f, - -0.4109177584582042f, - -0.4107984172977506f, - -0.410679069098377f, - -0.41055971386212853f, - -0.41044035159104947f, - -0.41032098228718666f, - -0.41020160595258387f, - -0.41008222258928906f, - -0.4099628321993445f, - -0.40984343478479834f, - -0.40972403034769483f, - -0.40960461889008243f, - -0.4094852004140039f, - -0.4093657749215079f, - -0.4092463424146399f, - -0.40912690289544645f, - -0.40900745636597324f, - -0.40888800282826854f, - -0.40876854228437837f, - -0.40864907473634887f, - -0.4085296001862287f, - -0.40841011863606413f, - -0.4082906300879026f, - -0.40817113454379056f, - -0.40805163200577727f, - -0.40793212247590943f, - -0.4078126059562349f, - -0.4076930824488008f, - -0.4075735519556574f, - -0.40745401447884977f, - -0.40733447002042844f, - -0.4072149185824402f, - -0.40709536016693515f, - -0.40697579477596113f, - -0.40685622241156677f, - -0.40673664307580015f, - -0.40661705677071186f, - -0.40649746349835014f, - -0.4063778632607642f, - -0.40625825606000254f, - -0.40613864189811627f, - -0.40601902077715407f, - -0.40589939269916564f, - -0.4057797576662f, - -0.4056601156803086f, - -0.4055404667435399f, - -0.4054208108579465f, - -0.40530114802557543f, - -0.4051814782484795f, - -0.4050618015287075f, - -0.4049421178683127f, - -0.4048224272693425f, - -0.4047027297338501f, - -0.40458302526388495f, - -0.40446331386149986f, - -0.4043435955287451f, - -0.40422387026767204f, - -0.4041041380803314f, - -0.40398439896877636f, - -0.40386465293505774f, - -0.4037448999812274f, - -0.4036251401093373f, - -0.40350537332143865f, - -0.40338559961958526f, - -0.4032658190058286f, - -0.40314603148222106f, - -0.4030262370508144f, - -0.40290643571366286f, - -0.40278662747281835f, - -0.40266681233033386f, - -0.40254699028826146f, - -0.40242716134865597f, - -0.4023073255135698f, - -0.4021874827850562f, - -0.402067633165168f, - -0.4019477766559604f, - -0.4018279132594862f, - -0.4017080429777992f, - -0.4015881658129527f, - -0.4014682817670022f, - -0.40134839084200036f, - -0.4012284930400039f, - -0.401108588363064f, - -0.40098867681323763f, - -0.4008687583925778f, - -0.4007488331031417f, - -0.40062890094698095f, - -0.4005089619261531f, - -0.40038901604271154f, - -0.400269063298714f, - -0.40014910369621254f, - -0.40002913723726513f, - -0.39990916392392567f, - -0.3997891837582516f, - -0.39966919674229784f, - -0.3995492028781204f, - -0.39942920216777444f, - -0.3993091946133179f, - -0.39918918021680616f, - -0.3990691589802956f, - -0.3989491309058421f, - -0.39882909599550376f, - -0.3987090542513366f, - -0.3985890056753976f, - -0.3984689502697428f, - -0.39834888803643104f, - -0.39822881897751866f, - -0.39810874309506306f, - -0.3979886603911217f, - -0.39786857086775135f, - -0.39774847452701134f, - -0.3976283713709587f, - -0.3975082614016513f, - -0.39738814462114647f, - -0.39726802103150394f, - -0.39714789063478034f, - -0.3970277534330366f, - -0.3969076094283279f, - -0.39678745862271536f, - -0.39666730101825615f, - -0.39654713661701146f, - -0.39642696542103717f, - -0.39630678743239467f, - -0.39618660265314165f, - -0.39606641108533985f, - -0.39594621273104547f, - -0.3958260075923205f, - -0.39570579567122305f, - -0.3955855769698145f, - -0.39546535149015394f, - -0.39534511923430143f, - -0.3952248802043163f, - -0.39510463440226046f, - -0.3949843818301934f, - -0.3948641224901757f, - -0.3947438563842671f, - -0.39462358351453003f, - -0.3945033038830244f, - -0.3943830174918113f, - -0.3942627243429509f, - -0.39414242443850606f, - -0.39402211778053725f, - -0.3939018043711059f, - -0.3937814842122727f, - -0.393661157306101f, - -0.39354082365465176f, - -0.3934204832599868f, - -0.3933001361241673f, - -0.39317978224925704f, - -0.39305942163731744f, - -0.39293905429041087f, - -0.39281868021059896f, - -0.3926982993999458f, - -0.3925779118605135f, - -0.39245751759436387f, - -0.3923371166035623f, - -0.39221670889016863f, - -0.39209629445624844f, - -0.39197587330386335f, - -0.3918554454350792f, - -0.3917350108519562f, - -0.3916145695565605f, - -0.3914941215509541f, - -0.3913736668372025f, - -0.39125320541736885f, - -0.3911327372935172f, - -0.39101226246771104f, - -0.39089178094201615f, - -0.3907712927184962f, - -0.39065079779921574f, - -0.3905302961862386f, - -0.3904097878816311f, - -0.39028927288745735f, - -0.3901687512057824f, - -0.39004822283867047f, - -0.3899276877881884f, - -0.38980714605640004f, - -0.38968659764537306f, - -0.3895660425571699f, - -0.3894454807938587f, - -0.3893249123575036f, - -0.3892043372501729f, - -0.38908375547392937f, - -0.38896316703084166f, - -0.38884257192297433f, - -0.38872197015239623f, - -0.38860136172117055f, - -0.38848074663136634f, - -0.3883601248850495f, - -0.388239496484286f, - -0.38811886143114444f, - -0.38799821972769105f, - -0.387877571375993f, - -0.3877569163781167f, - -0.3876362547361313f, - -0.38751558645210327f, - -0.38739491152810046f, - -0.38727422996618965f, - -0.3871535417684403f, - -0.3870328469369197f, - -0.3869121454736958f, - -0.38679143738083593f, - -0.38667072266041014f, - -0.386550001314486f, - -0.386429273345132f, - -0.386308538754416f, - -0.38618779754440835f, - -0.38606704971717715f, - -0.3859462952747913f, - -0.3858255342193192f, - -0.3857047665528316f, - -0.38558399227739615f, - -0.3854632113950849f, - -0.3853424239079639f, - -0.3852216298181055f, - -0.3851008291275777f, - -0.3849800218384528f, - -0.3848592079527977f, - -0.3847383874726848f, - -0.38461756040018275f, - -0.3844967267373644f, - -0.38437588648629684f, - -0.3842550396490531f, - -0.3841341862277023f, - -0.3840133262243168f, - -0.3838924596409667f, - -0.383771586479723f, - -0.38365070674265606f, - -0.3835298204318387f, - -0.38340892754934147f, - -0.3832880280972359f, - -0.3831671220775926f, - -0.38304620949248513f, - -0.38292529034398426f, - -0.382804364634162f, - -0.3826834323650904f, - -0.38256249353884075f, - -0.38244154815748693f, - -0.3823205962231005f, - -0.38219963773775395f, - -0.38207867270351903f, - -0.38195770112247013f, - -0.38183672299667915f, - -0.38171573832821915f, - -0.38159474711916225f, - -0.38147374937158324f, - -0.3813527450875546f, - -0.38123173426914975f, - -0.3811107169184413f, - -0.38098969303750446f, - -0.38086866262841135f, - -0.3807476256932382f, - -0.38062658223405577f, - -0.3805055322529405f, - -0.3803844757519649f, - -0.3802634127332057f, - -0.380142343198734f, - -0.38002126715062684f, - -0.3799001845909571f, - -0.3797790955218019f, - -0.3796579999452329f, - -0.37953689786332745f, - -0.379415789278159f, - -0.3792946741918043f, - -0.37917355260633784f, - -0.37905242452383503f, - -0.37893128994637043f, - -0.37881014887602144f, - -0.3786890013148628f, - -0.37856784726497056f, - -0.37844668672841963f, - -0.3783255197072878f, - -0.3782043462036504f, - -0.37808316621958366f, - -0.3779619797571632f, - -0.3778407868184672f, - -0.3777195874055714f, - -0.3775983815205525f, - -0.3774771691654865f, - -0.377355950342452f, - -0.3772347250535253f, - -0.3771134933007834f, - -0.37699225508630296f, - -0.3768710104121628f, - -0.37674975928043974f, - -0.37662850169321055f, - -0.37650723765255534f, - -0.3763859671605487f, - -0.376264690219271f, - -0.37614340683079867f, - -0.37602211699721233f, - -0.375900820720587f, - -0.3757795180030034f, - -0.3756582088465385f, - -0.37553689325327333f, - -0.37541557122528335f, - -0.37529424276464973f, - -0.37517290787344987f, - -0.37505156655376437f, - -0.37493021880767163f, - -0.3748088646372509f, - -0.3746875040445807f, - -0.37456613703174213f, - -0.374444763600814f, - -0.374323383753876f, - -0.3742019974930072f, - -0.37408060482028904f, - -0.3739592057378008f, - -0.3738378002476226f, - -0.3737163883518338f, - -0.3735949700525165f, - -0.37347354535174954f, - -0.3733521142516159f, - -0.373230676754193f, - -0.3731092328615641f, - -0.3729877825758085f, - -0.37286632589900964f, - -0.37274486283324537f, - -0.3726233933805994f, - -0.37250191754315226f, - -0.3723804353229846f, - -0.3722589467221796f, - -0.37213745174281804f, - -0.3720159503869819f, - -0.37189444265675203f, - -0.37177292855421223f, - -0.3716514080814437f, - -0.37152988124052877f, - -0.37140834803354883f, - -0.371286808462588f, - -0.37116526252972804f, - -0.3710437102370515f, - -0.3709221515866405f, - -0.37080058658057946f, - -0.3706790152209505f, - -0.3705574375098368f, - -0.3704358534493207f, - -0.37031426304148707f, - -0.3701926662884187f, - -0.3700710631921989f, - -0.3699494537549106f, - -0.3698278379786393f, - -0.36970621586546776f, - -0.3695845874174802f, - -0.3694629526367597f, - -0.3693413115253921f, - -0.3692196640854602f, - -0.3690980103190507f, - -0.3689763502282448f, - -0.36885468381512976f, - -0.36873301108178846f, - -0.3686113320303083f, - -0.3684896466627709f, - -0.3683679549812638f, - -0.3682462569878705f, - -0.3681245526846787f, - -0.36800284207377043f, - -0.3678811251572338f, - -0.3677594019371526f, - -0.36763767241561424f, - -0.3675159365947037f, - -0.36739419447650684f, - -0.36727244606310894f, - -0.36715069135659767f, - -0.36702893035905854f, - -0.3669071630725778f, - -0.366785389499242f, - -0.36666360964113676f, - -0.36654182350035047f, - -0.3664200310789691f, - -0.36629823237907944f, - -0.36617642740276773f, - -0.3660546161521227f, - -0.36593279862923067f, - -0.365810974836179f, - -0.3656891447750543f, - -0.36556730844794577f, - -0.3654454658569401f, - -0.36532361700412513f, - -0.3652017618915879f, - -0.36507990052141787f, - -0.3649580328957016f, - -0.3648361590165297f, - -0.3647142788859871f, - -0.3645923925061647f, - -0.36447049987914937f, - -0.3643486010070321f, - -0.3642266958918983f, - -0.36410478453583933f, - -0.36398286694094245f, - -0.3638609431092991f, - -0.3637390130429951f, - -0.36361707674412225f, - -0.3634951342147682f, - -0.3633731854570241f, - -0.3632512304729785f, - -0.36312926926472133f, - -0.3630073018343414f, - -0.36288532818393016f, - -0.36276334831557694f, - -0.3626413622313717f, - -0.3625193699334039f, - -0.36239737142376544f, - -0.3622753667045459f, - -0.3621533557778359f, - -0.3620313386457251f, - -0.36190931531030596f, - -0.36178728577366853f, - -0.3616652500379036f, - -0.36154320810510154f, - -0.36142115997735513f, - -0.36129910565675477f, - -0.36117704514539184f, - -0.36105497844535783f, - -0.36093290555874347f, - -0.3608108264876421f, - -0.36068874123414474f, - -0.3605666498003432f, - -0.3604445521883287f, - -0.36032244840019506f, - -0.36020033843803273f, - -0.36007822230393655f, - -0.35995609999999567f, - -0.35983397152830515f, - -0.35971183689095587f, - -0.3595896960900431f, - -0.3594675491276563f, - -0.3593453960058911f, - -0.35922323672683876f, - -0.35910107129259417f, - -0.35897889970524965f, - -0.3588567219668987f, - -0.358734538079634f, - -0.3586123480455507f, - -0.35849015186674166f, - -0.35836794954530077f, - -0.358245741083321f, - -0.35812352648289814f, - -0.3580013057461254f, - -0.3578790788750969f, - -0.3577568458719063f, - -0.35763460673864966f, - -0.3575123614774198f, - -0.3573901100903139f, - -0.3572678525794233f, - -0.35714558894684545f, - -0.3570233191946744f, - -0.3569010433250052f, - -0.35677876133993225f, - -0.3566564732415524f, - -0.3565341790319603f, - -0.3564118787132513f, - -0.3562895722875203f, - -0.3561672597568645f, - -0.3560449411233789f, - -0.3559226163891587f, - -0.35580028555630133f, - -0.3556779486269023f, - -0.3555556056030576f, - -0.3554332564868629f, - -0.35531090128041704f, - -0.3551885399858132f, - -0.3550661726051505f, - -0.35494379914052404f, - -0.3548214195940331f, - -0.35469903396777136f, - -0.35457664226383834f, - -0.35445424448432955f, - -0.3543318406313438f, - -0.35420943070697775f, - -0.35408701471332876f, - -0.35396459265249364f, - -0.35384216452657163f, - -0.35371973033765974f, - -0.35359729008785584f, - -0.3534748437792571f, - -0.3533523914139632f, - -0.35322993299407074f, - -0.35310746852168046f, - -0.3529849979988874f, - -0.3528625214277926f, - -0.35274003881049304f, - -0.35261755014908985f, - -0.35249505544567855f, - -0.3523725547023605f, - -0.35225004792123316f, - -0.352127535104398f, - -0.35200501625395103f, - -0.35188249137199407f, - -0.3517599604606248f, - -0.3516374235219445f, - -0.3515148805580519f, - -0.3513923315710468f, - -0.3512697765630291f, - -0.3511472155360978f, - -0.35102464849235465f, - -0.350902075433899f, - -0.35077949636283107f, - -0.3506569112812504f, - -0.3505343201912592f, - -0.350411723094957f, - -0.3502891199944447f, - -0.35016651089182205f, - -0.3500438957891917f, - -0.3499212746886538f, - -0.34979864759230933f, - -0.34967601450225877f, - -0.34955337542060494f, - -0.3494307303494485f, - -0.34930807929089086f, - -0.34918542224703286f, - -0.3490627592199778f, - -0.34894009021182665f, - -0.34881741522468135f, - -0.348694734260643f, - -0.3485720473218155f, - -0.34844935441029923f, - -0.34832665552819914f, - -0.34820395067761417f, - -0.3480812398606495f, - -0.3479585230794059f, - -0.3478358003359887f, - -0.3477130716324974f, - -0.34759033697103736f, - -0.34746759635371f, - -0.34734484978262087f, - -0.34722209725986997f, - -0.34709933878756305f, - -0.3469765743678019f, - -0.34685380400269167f, - -0.3467310276943353f, - -0.34660824544483637f, - -0.346485457256298f, - -0.34636266313082575f, - -0.34623986307052285f, - -0.3461170570774934f, - -0.34599424515384086f, - -0.34587142730167125f, - -0.3457486035230882f, - -0.3456257738201962f, - -0.34550293819509914f, - -0.34538009664990343f, - -0.345257249186713f, - -0.34513439580763294f, - -0.34501153651476824f, - -0.3448886713102232f, - -0.3447658001961048f, - -0.34464292317451756f, - -0.34452004024756694f, - -0.3443971514173577f, - -0.34427425668599715f, - -0.34415135605558933f, - -0.3440284495282427f, - -0.34390553710605987f, - -0.3437826187911494f, - -0.3436596945856158f, - -0.34353676449156784f, - -0.3434138285111086f, - -0.343290886646347f, - -0.3431679388993879f, - -0.3430449852723406f, - -0.3429220257673085f, - -0.34279906038640096f, - -0.3426760891317233f, - -0.34255311200538424f, - -0.34243012900949016f, - -0.3423071401461484f, - -0.34218414541746534f, - -0.3420611448255503f, - -0.34193813837250986f, - -0.3418151260604519f, - -0.3416921078914832f, - -0.3415690838677134f, - -0.3414460539912496f, - -0.3413230182642f, - -0.34119997668867175f, - -0.34107692926677496f, - -0.3409538760006171f, - -0.34083081689230676f, - -0.3407077519439516f, - -0.34058468115766194f, - -0.3404616045355458f, - -0.34033852207971205f, - -0.3402154337922688f, - -0.3400923396753269f, - -0.33996923973099463f, - -0.33984613396138047f, - -0.3397230223685954f, - -0.3395999049547481f, - -0.3394767817219483f, - -0.3393536526723046f, - -0.33923051780792945f, - -0.33910737713092937f, - -0.3389842306434168f, - -0.33886107834750023f, - -0.33873792024529226f, - -0.33861475633889987f, - -0.338491586630436f, - -0.3383684111220093f, - -0.33824522981573224f, - -0.3381220427137145f, - -0.3379988498180669f, - -0.3378756511308995f, - -0.3377524466543249f, - -0.3376292363904534f, - -0.33750602034139615f, - -0.3373827985092636f, - -0.33725957089616876f, - -0.3371363375042223f, - -0.3370130983355358f, - -0.33688985339222f, - -0.33676660267638847f, - -0.33664334619015135f, - -0.33652008393562305f, - -0.33639681591491244f, - -0.33627354213013405f, - -0.33615026258339853f, - -0.3360269772768208f, - -0.3359036862125099f, - -0.33578038939258087f, - -0.3356570868191448f, - -0.33553377849431687f, - -0.33541046442020667f, - -0.33528714459892955f, - -0.33516381903259784f, - -0.3350404877233238f, - -0.3349171506732223f, - -0.33479380788440594f, - -0.33467045935898815f, - -0.3345471050990816f, - -0.3344237451068016f, - -0.3343003793842611f, - -0.33417700793357397f, - -0.3340536307568532f, - -0.3339302478562145f, - -0.3338068592337713f, - -0.3336834648916377f, - -0.33356006483192724f, - -0.33343665905675607f, - -0.33331324756823777f, - -0.33318983036848704f, - -0.3330664074596178f, - -0.3329429788437464f, - -0.33281954452298707f, - -0.33269610449945475f, - -0.3325726587752637f, - -0.3324492073525308f, - -0.33232575023336974f, - -0.33220228741989843f, - -0.33207881891422897f, - -0.33195534471847954f, - -0.33183186483476407f, - -0.33170837926520097f, - -0.33158488801190267f, - -0.3314613910769878f, - -0.3313378884625707f, - -0.33121438017077f, - -0.33109086620369876f, - -0.33096734656347576f, - -0.3308438212522159f, - -0.33072029027203736f, - -0.33059675362505603f, - -0.33047321131338864f, - -0.33034966333915117f, - -0.3302261097044623f, - -0.3301025504114383f, - -0.3299789854621963f, - -0.32985541485885267f, - -0.3297318386035264f, - -0.3296082566983342f, - -0.3294846691453936f, - -0.3293610759468222f, - -0.3292374771047369f, - -0.3291138726212572f, - -0.32899026249850016f, - -0.3288666467385839f, - -0.32874302534362565f, - -0.3286193983157453f, - -0.3284957656570604f, - -0.32837212736968924f, - -0.3282484834557496f, - -0.3281248339173617f, - -0.3280011787566434f, - -0.3278775179757135f, - -0.3277538515766901f, - -0.3276301795616938f, - -0.32750650193284214f, - -0.32738281869225666f, - -0.32725912984205335f, - -0.3271354353843541f, - -0.3270117353212767f, - -0.3268880296549433f, - -0.32676431838747005f, - -0.3266406015209794f, - -0.3265168790575894f, - -0.32639315099942173f, - -0.32626941734859566f, - -0.3261456781072312f, - -0.32602193327744783f, - -0.32589818286136757f, - -0.32577442686111f, - -0.3256506652787956f, - -0.3255268981165442f, - -0.32540312537647825f, - -0.3252793470607176f, - -0.3251555631713832f, - -0.3250317737105953f, - -0.32490797868047655f, - -0.32478417808314736f, - -0.32466037192072905f, - -0.3245365601953421f, - -0.3244127429091097f, - -0.32428892006415266f, - -0.32416509166259255f, - -0.32404125770655035f, - -0.32391741819814956f, - -0.3237935731395113f, - -0.32366972253275766f, - -0.3235458663800108f, - -0.32342200468339205f, - -0.3232981374450255f, - -0.3231742646670318f, - -0.32305038635153616f, - -0.3229265025006577f, - -0.3228026131165217f, - -0.32267871820124927f, - -0.3225548177569659f, - -0.32243091178579114f, - -0.3223070002898507f, - -0.322183083271266f, - -0.32205916073216295f, - -0.32193523267466145f, - -0.32181129910088757f, - -0.3216873600129632f, - -0.32156341541301364f, - -0.32143946530316186f, - -0.3213155096855317f, - -0.3211915485622462f, - -0.32106758193543117f, - -0.3209436098072098f, - -0.32081963217970644f, - -0.3206956490550445f, - -0.32057166043535007f, - -0.3204476663227469f, - -0.32032366671935947f, - -0.3201996616273118f, - -0.32007565104873015f, - -0.3199516349857379f, - -0.31982761344046257f, - -0.3197035864150258f, - -0.31957955391155524f, - -0.31945551593217536f, - -0.3193314724790115f, - -0.31920742355418835f, - -0.31908336915983304f, - -0.3189593092980704f, - -0.31883524397102536f, - -0.31871117318082537f, - -0.3185870969295955f, - -0.31846301521946185f, - -0.3183389280525496f, - -0.31821483543098666f, - -0.31809073735689847f, - -0.31796663383241147f, - -0.3178425248596512f, - -0.31771841044074606f, - -0.31759429057782174f, - -0.31747016527300503f, - -0.317346034528422f, - -0.31722189834620124f, - -0.31709775672846896f, - -0.3169736096773523f, - -0.3168494571949776f, - -0.3167252992834739f, - -0.31660113594496775f, - -0.3164769671815867f, - -0.3163527929954575f, - -0.31622861338870945f, - -0.3161044283634695f, - -0.31598023792186564f, - -0.3158560420660249f, - -0.3157318407980771f, - -0.31560763412014864f, - -0.3154834220343703f, - -0.3153592045428671f, - -0.3152349816477699f, - -0.3151107533512057f, - -0.3149865196553055f, - -0.31486228056219473f, - -0.31473803607400463f, - -0.3146137861928625f, - -0.3144895309208999f, - -0.31436527026024236f, - -0.31424100421302176f, - -0.31411673278136554f, - -0.3139924559674049f, - -0.31386817377326826f, - -0.3137438862010853f, - -0.3136195932529848f, - -0.31349529493109807f, - -0.3133709912375542f, - -0.31324668217448304f, - -0.3131223677440146f, - -0.3129980479482782f, - -0.31287372278940556f, - -0.31274939226952625f, - -0.3126250563907706f, - -0.3125007151552682f, - -0.3123763685651514f, - -0.3122520166225498f, - -0.31212765932959435f, - -0.31200329668841487f, - -0.3118789287011441f, - -0.3117545553699121f, - -0.31163017669685f, - -0.31150579268408823f, - -0.31138140333375963f, - -0.31125700864799405f, - -0.31113260862892533f, - -0.3110082032786817f, - -0.31088379259939747f, - -0.3107593765932026f, - -0.3106349552622314f, - -0.31051052860861245f, - -0.31038609663448036f, - -0.31026165934196553f, - -0.31013721673320266f, - -0.3100127688103207f, - -0.30988831557545454f, - -0.30976385703073495f, - -0.3096393931782962f, - -0.3095149240202701f, - -0.3093904495587894f, - -0.3092659697959861f, - -0.3091414847339948f, - -0.3090169943749477f, - -0.3088924987209778f, - -0.3087679977742176f, - -0.30864349153680204f, - -0.3085189800108636f, - -0.3083944631985358f, - -0.30826994110195133f, - -0.30814541372324555f, - -0.3080208810645514f, - -0.3078963431280026f, - -0.30777179991573234f, - -0.30764725142987626f, - -0.3075226976725677f, - -0.30739813864594073f, - -0.3072735743521297f, - -0.3071490047932682f, - -0.30702442997149226f, - -0.3068998498889349f, - -0.30677526454773313f, - -0.30665067395001844f, - -0.3065260780979281f, - -0.3064014769935954f, - -0.30627687063915787f, - -0.3061522590367472f, - -0.30602764218850115f, - -0.30590302009655324f, - -0.3057783927630414f, - -0.3056537601900978f, - -0.3055291223798604f, - -0.3054044793344632f, - -0.30527983105604356f, - -0.30515517754673654f, - -0.305030518808678f, - -0.304905854844003f, - -0.30478118565484946f, - -0.30465651124335263f, - -0.30453183161164876f, - -0.3044071467618734f, - -0.3042824566961647f, - -0.3041577614166583f, - -0.3040330609254908f, - -0.30390835522479814f, - -0.3037836443167187f, - -0.3036589282033878f, - -0.3035342068869449f, - -0.3034094803695236f, - -0.3032847486532637f, - -0.3031600117403016f, - -0.30303526963277455f, - -0.30291052233281923f, - -0.30278576984257477f, - -0.30266101216417796f, - -0.3025362492997664f, - -0.3024114812514772f, - -0.30228670802144975f, - -0.30216192961182126f, - -0.30203714602472886f, - -0.3019123572623124f, - -0.3017875633267093f, - -0.30166276422005783f, - -0.3015379599444955f, - -0.30141315050216344f, - -0.30128833589519677f, - -0.3011635161257367f, - -0.3010386911959203f, - -0.3009138611078889f, - -0.30078902586377815f, - -0.30066418546572954f, - -0.3005393399158805f, - -0.3004144892163719f, - -0.3002896333693422f, - -0.30016477237693073f, - -0.3000399062412762f, - -0.2999150349645197f, - -0.29979015854880015f, - -0.2996652769962572f, - -0.29954039030902985f, - -0.2994154984892597f, - -0.299290601539085f, - -0.2991656994606484f, - -0.29904079225608665f, - -0.2989158799275426f, - -0.2987909624771548f, - -0.29866603990706636f, - -0.29854111221941426f, - -0.2984161794163417f, - -0.2982912414999877f, - -0.29816629847249554f, - -0.29804135033600276f, - -0.2979163970926528f, - -0.29779143874458497f, - -0.29766647529394213f, - -0.29754150674286467f, - -0.2974165330934939f, - -0.29729155434797117f, - -0.29716657050843714f, - -0.29704158157703503f, - -0.29691658755590566f, - -0.29679158844719083f, - -0.29666658425303144f, - -0.2965415749755711f, - -0.296416560616951f, - -0.2962915411793132f, - -0.2961665166647991f, - -0.29604148707555256f, - -0.2959164524137151f, - -0.2957914126814292f, - -0.2956663678808365f, - -0.2955413180140813f, - -0.2954162630833055f, - -0.29529120309065177f, - -0.29516613803826225f, - -0.29504106792828155f, - -0.29491599276285185f, - -0.29479091254411627f, - -0.2946658272742172f, - -0.2945407369552997f, - -0.29441564158950534f, - -0.2942905411789802f, - -0.29416543572586445f, - -0.2940403252323043f, - -0.2939152097004417f, - -0.29379008913242316f, - -0.29366496353038907f, - -0.29353983289648605f, - -0.2934146972328564f, - -0.29328955654164607f, - -0.29316441082499844f, - -0.29303926008505776f, - -0.29291410432396775f, - -0.2927889435438745f, - -0.29266377774692187f, - -0.2925386069352544f, - -0.29241343111101614f, - -0.2922882502763535f, - -0.2921630644334107f, - -0.2920378735843328f, - -0.2919126777312639f, - -0.291787476876351f, - -0.29166227102173853f, - -0.2915370601695718f, - -0.29141184432199635f, - -0.2912866234811568f, - -0.2911613976492005f, - -0.2910361668282723f, - -0.29091093102051807f, - -0.29078569022808276f, - -0.290660444453114f, - -0.2905351936977571f, - -0.29040993796415815f, - -0.2902846772544625f, - -0.29015941157081815f, - -0.2900341409153699f, - -0.2899088652902666f, - -0.2897835846976516f, - -0.289658299139674f, - -0.2895330086184788f, - -0.2894077131362155f, - -0.28928241269502747f, - -0.2891571072970643f, - -0.28903179694447134f, - -0.28890648163939836f, - -0.2887811613839892f, - -0.28865583618039364f, - -0.2885305060307575f, - -0.28840517093722995f, - -0.2882798309019577f, - -0.2881544859270884f, - -0.28802913601476904f, - -0.28790378116714904f, - -0.28777842138637555f, - -0.28765305667459656f, - -0.2875276870339593f, - -0.2874023124666137f, - -0.2872769329747071f, - -0.2871515485603878f, - -0.2870261592258035f, - -0.28690076497310435f, - -0.2867753658044381f, - -0.2866499617219534f, - -0.28652455272779825f, - -0.2863991388241231f, - -0.2862737200130761f, - -0.28614829629680627f, - -0.2860228676774618f, - -0.28589743415719365f, - -0.28577199573815015f, - -0.28564655242247994f, - -0.28552110421233484f, - -0.2853956511098611f, - -0.28527019311721086f, - -0.28514473023653203f, - -0.285019262469977f, - -0.2848937898196922f, - -0.28476831228783017f, - -0.28464282987653916f, - -0.28451734258797184f, - -0.28439185042427506f, - -0.28426635338760153f, - -0.28414085148010004f, - -0.2840153447039227f, - -0.2838898330612191f, - -0.28376431655414f, - -0.28363879518483504f, - -0.28351326895545687f, - -0.2833877378681554f, - -0.2832622019250816f, - -0.28313666112838565f, - -0.28301111548022034f, - -0.2828855649827361f, - -0.28276000963808406f, - -0.2826344494484148f, - -0.28250888441588146f, - -0.2823833145426339f, - -0.2822577398308262f, - -0.2821321602826066f, - -0.2820065759001296f, - -0.2818809866855453f, - -0.2817553926410081f, - -0.28162979376866665f, - -0.2815041900706756f, - -0.2813785815491863f, - -0.2812529682063511f, - -0.2811273500443214f, - -0.28100172706525134f, - -0.2808760992712926f, - -0.2807504666645969f, - -0.2806248292473187f, - -0.2804991870216098f, - -0.28037353998962317f, - -0.2802478881535108f, - -0.2801222315154275f, - -0.2799965700775254f, - -0.2798709038419577f, - -0.27974523281087676f, - -0.27961955698643776f, - -0.2794938763707932f, - -0.27936819096609655f, - -0.2792425007745006f, - -0.2791168057981606f, - -0.27899110603922966f, - -0.27886540149986144f, - -0.278739692182209f, - -0.2786139780884282f, - -0.27848825922067205f, - -0.2783625355810949f, - -0.27823680717185f, - -0.27811107399509344f, - -0.2779853360529779f, - -0.27785959334766047f, - -0.27773384588129224f, - -0.27760809365603045f, - -0.27748233667402816f, - -0.27735657493744265f, - -0.27723080844842546f, - -0.27710503720913415f, - -0.276979261221722f, - -0.2768534804883468f, - -0.27672769501116024f, - -0.2766019047923203f, - -0.2764761098339805f, - -0.2763503101382982f, - -0.27622450570742796f, - -0.2760986965435254f, - -0.2759728826487455f, - -0.27584706402524556f, - -0.2757212406751808f, - -0.275595412600707f, - -0.27546957980397946f, - -0.2753437422871559f, - -0.2752179000523917f, - -0.2750920531018432f, - -0.27496620143766665f, - -0.27484034506201765f, - -0.27471448397705445f, - -0.2745886181849328f, - -0.27446274768780937f, - -0.27433687248784f, - -0.27421099258718334f, - -0.2740851079879954f, - -0.27395921869243317f, - -0.27383332470265287f, - -0.27370742602081344f, - -0.27358152264907115f, - -0.2734556145895834f, - -0.2733297018445067f, - -0.2732037844160003f, - -0.27307786230622f, - -0.272951935517326f, - -0.2728260040514726f, - -0.27270006791082024f, - -0.272574127097525f, - -0.2724481816137474f, - -0.27232223146164214f, - -0.27219627664336987f, - -0.2720703171610871f, - -0.2719443530169538f, - -0.27181838421312743f, - -0.27169241075176653f, - -0.2715664326350287f, - -0.27144044986507426f, - -0.27131446244406104f, - -0.27118847037414784f, - -0.2710624736574926f, - -0.27093647229625595f, - -0.27081046629259603f, - -0.27068445564867194f, - -0.270558440366642f, - -0.2704324204486671f, - -0.27030639589690575f, - -0.27018036671351736f, - -0.2700543329006605f, - -0.26992829446049643f, - -0.269802251395184f, - -0.26967620370688283f, - -0.26955015139775196f, - -0.2694240944699529f, - -0.2692980329256448f, - -0.2691719667669876f, - -0.26904589599614154f, - -0.26891982061526587f, - -0.26879374062652256f, - -0.26866765603207027f, - -0.268541566834072f, - -0.2684154730346848f, - -0.26828937463607183f, - -0.2681632716403921f, - -0.2680371640498088f, - -0.26791105186647945f, - -0.26778493509256746f, - -0.2676588137302321f, - -0.26753268778163697f, - -0.2674065572489398f, - -0.26728042213430436f, - -0.26715428243989026f, - -0.2670281381678606f, - -0.26690198932037584f, - -0.2667758358995977f, - -0.26664967790768673f, - -0.26652351534680646f, - -0.2663973482191178f, - -0.2662711765267825f, - -0.2661450002719617f, - -0.26601881945681904f, - -0.265892634083515f, - -0.26576644415421413f, - -0.26564024967107536f, - -0.26551405063626354f, - -0.26538784705193935f, - -0.2652616389202678f, - -0.265135426243408f, - -0.2650092090235252f, - -0.26488298726278114f, - -0.2647567609633387f, - -0.2646305301273598f, - -0.26450429475700915f, - -0.2643780548544489f, - -0.26425181042184115f, - -0.2641255614613509f, - -0.26399930797514054f, - -0.26387304996537336f, - -0.2637467874342119f, - -0.2636205203838214f, - -0.2634942488163644f, - -0.2633679727340047f, - -0.2632416921389051f, - -0.26311540703323183f, - -0.26298911741914555f, - -0.26286282329881255f, - -0.2627365246743953f, - -0.2626102215480595f, - -0.26248391392196857f, - -0.2623576017982866f, - -0.2622312851791772f, - -0.2621049640668064f, - -0.26197863846333785f, - -0.26185230837093615f, - -0.261725973791765f, - -0.26159963472799086f, - -0.26147329118177765f, - -0.2613469431552902f, - -0.2612205906506927f, - -0.2610942336701518f, - -0.26096787221583084f, - -0.2608415062898976f, - -0.26071513589451395f, - -0.2605887610318477f, - -0.2604623817040626f, - -0.2603359979133267f, - -0.260209609661802f, - -0.26008321695165687f, - -0.2599568197850552f, - -0.2598304181641645f, - -0.2597040120911498f, - -0.25957760156817705f, - -0.2594511865974113f, - -0.25932476718102043f, - -0.25919834332116976f, - -0.2590719150200255f, - -0.258945482279754f, - -0.2588190451025207f, - -0.2586926034904939f, - -0.25856615744583916f, - -0.2584397069707232f, - -0.2583132520673118f, - -0.2581867927377735f, - -0.2580603289842743f, - -0.257933860808981f, - -0.25780738821405985f, - -0.25768091120167963f, - -0.2575544297740066f, - -0.257427943933208f, - -0.25730145368145024f, - -0.2571749590209025f, - -0.25704845995373127f, - -0.25692195648210414f, - -0.2567954486081878f, - -0.2566689363341517f, - -0.2565424196621619f, - -0.25641589859438874f, - -0.2562893731329967f, - -0.25616284328015637f, - -0.2560363090380341f, - -0.25590977040880053f, - -0.25578322739462045f, - -0.2556566799976647f, - -0.2555301282201f, - -0.2554035720640973f, - -0.25527701153182164f, - -0.2551504466254443f, - -0.25502387734713206f, - -0.2548973036990554f, - -0.2547707256833824f, - -0.25464414330228174f, - -0.2545175565579217f, - -0.2543909654524729f, - -0.2542643699881037f, - -0.25413777016698313f, - -0.2540111659912797f, - -0.25388455746316446f, - -0.2537579445848059f, - -0.2536313273583735f, - -0.25350470578603596f, - -0.25337807986996463f, - -0.25325144961232837f, - -0.25312481501529693f, - -0.2529981760810402f, - -0.2528715328117272f, - -0.25274488520952965f, - -0.25261823327661675f, - -0.25249157701515873f, - -0.25236491642732484f, - -0.25223825151528717f, - -0.25211158228121433f, - -0.2519849087272794f, - -0.25185823085564935f, - -0.25173154866849745f, - -0.25160486216799266f, - -0.2514781713563082f, - -0.2513514762356115f, - -0.251224776808076f, - -0.25109807307587095f, - -0.25097136504117f, - -0.2508446527061408f, - -0.2507179360729571f, - -0.25059121514378846f, - -0.2504644899208079f, - -0.25033776040618594f, - -0.2502110266020941f, - -0.2500842885107031f, - -0.2499575461341862f, - -0.24983079947471426f, - -0.24970404853445907f, - -0.24957729331559164f, - -0.24945053382028556f, - -0.24932377005071196f, - -0.24919700200904293f, - -0.24907022969744974f, - -0.2489434531181063f, - -0.24881667227318408f, - -0.24868988716485535f, - -0.24856309779529176f, - -0.2484363041666675f, - -0.24830950628115428f, - -0.24818270414092475f, - -0.2480558977481508f, - -0.24792908710500688f, - -0.24780227221366505f, - -0.24767545307629824f, - -0.2475486296950786f, - -0.2474218020721809f, - -0.24729497020977748f, - -0.2471681341100407f, - -0.24704129377514558f, - -0.2469144492072646f, - -0.24678760040857128f, - -0.24666074738123822f, - -0.24653389012744162f, - -0.24640702864935168f, - -0.24628016294914476f, - -0.24615329302899291f, - -0.24602641889107174f, - -0.24589954053755436f, - -0.2457726579706148f, - -0.24564577119242623f, - -0.24551888020516463f, - -0.24539198501100334f, - -0.2452650856121167f, - -0.24513818201067822f, - -0.24501127420886404f, - -0.2448843622088479f, - -0.24475744601280436f, - -0.24463052562290727f, - -0.24450360104133306f, - -0.24437667227025484f, - -0.24424973931185007f, - -0.2441228021682903f, - -0.24399586084175312f, - -0.2438689153344119f, - -0.24374196564844444f, - -0.24361501178602255f, - -0.24348805374932408f, - -0.24336109154052274f, - -0.24323412516179657f, - -0.24310715461531765f, - -0.24298017990326418f, - -0.2428532010278101f, - -0.2427262179911329f, - -0.24259923079540752f, - -0.24247223944280988f, - -0.2423452439355159f, - -0.2422182442757008f, - -0.24209124046554237f, - -0.24196423250721594f, - -0.24183722040289773f, - -0.24171020415476324f, - -0.24158318376499058f, - -0.24145615923575534f, - -0.24132913056923402f, - -0.24120209776760237f, - -0.24107506083303884f, - -0.24094801976771926f, - -0.24082097457382043f, - -0.24069392525351843f, - -0.2405668718089919f, - -0.240439814242417f, - -0.24031275255597087f, - -0.24018568675182975f, - -0.24005861683217267f, - -0.23993154279917603f, - -0.23980446465501723f, - -0.23967738240187283f, - -0.23955029604192213f, - -0.23942320557734093f, - -0.23929611101030954f, - -0.2391690123430022f, - -0.2390419095775993f, - -0.238914802716277f, - -0.23878769176121584f, - -0.23866057671459034f, - -0.23853345757858122f, - -0.23840633435536487f, - -0.23827920704712127f, - -0.23815207565602783f, - -0.2380249401842629f, - -0.23789780063400406f, - -0.23777065700743155f, - -0.2376435093067231f, - -0.23751635753405728f, - -0.23738920169161198f, - -0.2372620417815677f, - -0.23713487780610246f, - -0.23700770976739513f, - -0.23688053766762387f, - -0.23675336150896945f, - -0.23662618129361015f, - -0.23649899702372515f, - -0.23637180870149374f, - -0.23624461632909438f, - -0.23611741990870821f, - -0.23599021944251383f, - -0.2358630149326908f, - -0.23573580638141786f, - -0.23560859379087645f, - -0.2354813771632454f, - -0.23535415650070463f, - -0.23522693180543305f, - -0.23509970307961242f, - -0.23497247032542104f, - -0.2348452335450416f, - -0.23471799274065078f, - -0.23459074791443144f, - -0.23446349906856215f, - -0.23433624620522586f, - -0.2342089893265996f, - -0.2340817284348664f, - -0.2339544635322052f, - -0.2338271946207992f, - -0.23369992170282566f, - -0.23357264478046794f, - -0.2334453638559052f, - -0.2333180789313201f, - -0.23319079000889273f, - -0.23306349709080418f, - -0.23293620017923472f, - -0.23280889927636725f, - -0.23268159438438218f, - -0.23255428550546087f, - -0.23242697264178383f, - -0.23229965579553427f, - -0.23217233496889286f, - -0.23204501016404122f, - -0.23191768138316016f, - -0.23179034862843315f, - -0.23166301190204114f, - -0.231535671206166f, - -0.23140832654298885f, - -0.23128097791469338f, - -0.23115362532346082f, - -0.23102626877147336f, - -0.23089890826091233f, - -0.23077154379396175f, - -0.23064417537280313f, - -0.230516802999618f, - -0.23038942667659143f, - -0.2302620464059026f, - -0.23013466218973663f, - -0.23000727403027454f, - -0.22987988192970168f, - -0.22975248589019745f, - -0.22962508591394729f, - -0.22949768200313245f, - -0.22937027415993855f, - -0.22924286238654526f, - -0.2291154466851383f, - -0.2289880270578992f, - -0.22886060350701298f, - -0.22873317603466217f, - -0.22860574464303018f, - -0.22847830933429963f, - -0.22835087011065586f, - -0.2282234269742816f, - -0.2280959799273606f, - -0.22796852897207573f, - -0.22784107411061258f, - -0.22771361534515416f, - -0.22758615267788448f, - -0.22745868611098669f, - -0.22733121564664663f, - -0.22720374128704673f, - -0.22707626303437384f, - -0.2269487808908088f, - -0.22682129485853858f, - -0.22669380493974586f, - -0.2265663111366178f, - -0.22643881345133549f, - -0.2263113118860861f, - -0.22618380644305355f, - -0.2260562971244226f, - -0.2259287839323772f, - -0.22580126686910396f, - -0.22567374593678705f, - -0.22554622113761058f, - -0.22541869247376142f, - -0.22529115994742385f, - -0.22516362356078315f, - -0.2250360833160237f, - -0.22490853921533263f, - -0.2247809912608945f, - -0.22465343945489483f, - -0.2245258837995183f, - -0.22439832429695225f, - -0.22427076094938156f, - -0.22414319375899194f, - -0.22401562272796843f, - -0.22388804785849858f, - -0.2237604691527675f, - -0.22363288661296127f, - -0.22350530024126505f, - -0.22337771003986678f, - -0.2232501160109518f, - -0.2231225181567064f, - -0.22299491647931602f, - -0.2228673109809689f, - -0.22273970166384974f, - -0.2226120885301477f, - -0.22248447158204593f, - -0.2223568508217337f, - -0.22222922625139604f, - -0.22210159787322237f, - -0.2219739656893961f, - -0.22184632970210674f, - -0.2217186899135396f, - -0.22159104632588433f, - -0.22146339894132464f, - -0.22133574776205028f, - -0.22120809279024684f, - -0.22108043402810332f, - -0.22095277147780631f, - -0.22082510514154324f, - -0.22069743502150083f, - -0.2205697611198683f, - -0.22044208343883256f, - -0.22031440198058125f, - -0.22018671674730217f, - -0.22005902774118233f, - -0.21993133496441136f, - -0.2198036384191764f, - -0.21967593810766547f, - -0.2195482340320658f, - -0.21942052619456737f, - -0.21929281459735744f, - -0.21916509924262442f, - -0.21903738013255575f, - -0.21890965726934164f, - -0.21878193065516965f, - -0.21865420029222843f, - -0.21852646618270566f, - -0.2183987283287918f, - -0.2182709867326739f, - -0.2181432413965433f, - -0.2180154923225855f, - -0.21788773951299195f, - -0.21775998296995003f, - -0.21763222269565136f, - -0.21750445869228158f, - -0.21737669096203258f, - -0.2172489195070918f, - -0.2171211443296512f, - -0.21699336543189676f, - -0.21686558281602047f, - -0.21673779648421015f, - -0.2166100064386571f, - -0.21648221268155013f, - -0.2163544152150789f, - -0.21622661404143237f, - -0.21609880916280208f, - -0.21597100058137708f, - -0.21584318829934732f, - -0.215715372318902f, - -0.2155875526422329f, - -0.21545972927152934f, - -0.21533190220898152f, - -0.21520407145677886f, - -0.21507623701711345f, - -0.21494839889217482f, - -0.21482055708415346f, - -0.214692711595239f, - -0.21456486242762382f, - -0.21443700958349768f, - -0.2143091530650513f, - -0.21418129287447463f, - -0.21405342901396024f, - -0.21392556148569816f, - -0.21379769029187937f, - -0.21366981543469493f, - -0.21354193691633505f, - -0.21341405473899266f, - -0.21328616890485722f, - -0.21315827941612264f, - -0.21303038627497678f, - -0.21290248948361368f, - -0.21277458904422306f, - -0.2126466849589991f, - -0.21251877723012988f, - -0.2123908658598097f, - -0.21226295085022856f, - -0.21213503220357996f, - -0.2120071099220549f, - -0.21187918400784528f, - -0.21175125446314222f, - -0.2116233212901395f, - -0.21149538449102834f, - -0.2113674440680009f, - -0.21123950002324854f, - -0.21111155235896528f, - -0.2109836010773426f, - -0.21085564618057293f, - -0.21072768767084785f, - -0.21059972555036163f, - -0.21047175982130514f, - -0.21034379048587368f, - -0.21021581754625643f, - -0.2100878410046488f, - -0.20995986086324278f, - -0.2098318771242313f, - -0.2097038897898064f, - -0.20957589886216285f, - -0.20944790434349292f, - -0.20931990623598973f, - -0.2091919045418456f, - -0.2090638992632556f, - -0.20893589040241217f, - -0.20880787796150782f, - -0.20867986194273777f, - -0.20855184234829466f, - -0.20842381918037206f, - -0.20829579244116278f, - -0.20816776213286223f, - -0.20803972825766331f, - -0.20791169081775987f, - -0.2077836498153449f, - -0.20765560525261495f, - -0.20752755713176058f, - -0.20739950545497843f, - -0.20727145022446095f, - -0.207143391442404f, - -0.20701532911100104f, - -0.2068872632324463f, - -0.20675919380893337f, - -0.20663112084265836f, - -0.20650304433581493f, - -0.2063749642905976f, - -0.20624688070920016f, - -0.20611879359381902f, - -0.205990702946648f, - -0.20586260876988197f, - -0.2057345110657149f, - -0.20560640983634337f, - -0.20547830508396073f, - -0.20535019681076458f, - -0.20522208501894654f, - -0.2050939697107044f, - -0.2049658508882316f, - -0.2048377285537261f, - -0.20470960270937968f, - -0.2045814733573904f, - -0.204453340499952f, - -0.2043252041392617f, - -0.20419706427751422f, - -0.20406892091690523f, - -0.20394077405962951f, - -0.2038126237078846f, - -0.20368446986386549f, - -0.20355631252976797f, - -0.20342815170778805f, - -0.2032999874001208f, - -0.2031718196089641f, - -0.20304364833651317f, - -0.20291547358496415f, - -0.20278729535651246f, - -0.2026591136533561f, - -0.20253092847769058f, - -0.20240273983171234f, - -0.20227454771761694f, - -0.2021463521376027f, - -0.2020181530938653f, - -0.20188995058860146f, - -0.20176174462400698f, - -0.20163353520228036f, - -0.2015053223256176f, - -0.2013771059962156f, - -0.2012488862162704f, - -0.20112066298798079f, - -0.20099243631354208f, - -0.20086420619515402f, - -0.2007359726350103f, - -0.20060773563531079f, - -0.20047949519825106f, - -0.20035125132603107f, - -0.2002230040208448f, - -0.20009475328489232f, - -0.1999664991203694f, - -0.1998382415294763f, - -0.1997099805144072f, - -0.19958171607736236f, - -0.1994534482205379f, - -0.19932517694613336f, - -0.19919690225634573f, - -0.19906862415337304f, - -0.19894034263941235f, - -0.19881205771666352f, - -0.1986837693873238f, - -0.19855547765359136f, - -0.19842718251766356f, - -0.1982988839817405f, - -0.19817058204801963f, - -0.19804227671869937f, - -0.19791396799597732f, - -0.19778565588205377f, - -0.19765734037912644f, - -0.197529021489394f, - -0.19740069921505513f, - -0.19727237355830773f, - -0.1971440445213524f, - -0.1970157121063871f, - -0.19688737631561082f, - -0.19675903715122164f, - -0.1966306946154204f, - -0.19650234871040448f, - -0.1963739994383756f, - -0.1962456468015296f, - -0.1961172908020683f, - -0.19598893144218935f, - -0.19586056872409474f, - -0.19573220264998045f, - -0.19560383322204863f, - -0.1954754604424971f, - -0.19534708431352812f, - -0.19521870483733786f, - -0.19509032201612872f, - -0.19496193585209873f, - -0.19483354634744954f, - -0.19470515350438014f, - -0.19457675732509055f, - -0.1944483578117799f, - -0.19431995496665008f, - -0.19419154879190031f, - -0.19406313928973082f, - -0.193934726462341f, - -0.19380631031193288f, - -0.19367789084070602f, - -0.19354946805086082f, - -0.1934210419445969f, - -0.19329261252411653f, - -0.19316417979161948f, - -0.1930357437493064f, - -0.19290730439937714f, - -0.1927788617440342f, - -0.19265041578547754f, - -0.19252196652590806f, - -0.1923935139675258f, - -0.19226505811253355f, - -0.19213659896313146f, - -0.19200813652152066f, - -0.19187967078990145f, - -0.19175120177047678f, - -0.1916227294654471f, - -0.1914942538770128f, - -0.19136577500737798f, - -0.19123729285874053f, - -0.1911088074333046f, - -0.19098031873327004f, - -0.19085182676084106f, - -0.19072333151821583f, - -0.19059483300759872f, - -0.19046633123118975f, - -0.19033782619119255f, - -0.1902093178898081f, - -0.19008080632923838f, - -0.18995229151168452f, - -0.18982377343935034f, - -0.18969525211443708f, - -0.1895667275391469f, - -0.18943819971568124f, - -0.18930966864624404f, - -0.18918113433303682f, - -0.189052596778262f, - -0.1889240559841211f, - -0.18879551195281843f, - -0.18866696468655478f, - -0.18853841418753542f, - -0.18840986045795952f, - -0.18828130350003244f, - -0.18815274331595522f, - -0.1880241799079333f, - -0.18789561327816612f, - -0.18776704342885925f, - -0.18763847036221393f, - -0.18750989408043586f, - -0.18738131458572468f, - -0.18725273188028618f, - -0.18712414596632268f, - -0.18699555684603664f, - -0.18686696452163312f, - -0.18673836899531465f, - -0.18660977026928466f, - -0.18648116834574582f, - -0.1863525632269034f, - -0.18622395491496016f, - -0.18609534341211975f, - -0.18596672872058506f, - -0.18583811084256158f, - -0.18570948978025226f, - -0.185580865535861f, - -0.1854522381115909f, - -0.18532360750964766f, - -0.18519497373223448f, - -0.18506633678155543f, - -0.18493769665981385f, - -0.1848090533692157f, - -0.1846804069119643f, - -0.18455175729026402f, - -0.1844231045063184f, - -0.18429444856233357f, - -0.18416578946051226f, - -0.18403712720306167f, - -0.18390846179218287f, - -0.18377979323008314f, - -0.18365112151896543f, - -0.18352244666103712f, - -0.1833937686584995f, - -0.18326508751356008f, - -0.18313640322842203f, - -0.18300771580529293f, - -0.18287902524637434f, - -0.1827503315538739f, - -0.18262163472999504f, - -0.18249293477694467f, - -0.18236423169692717f, - -0.18223552549214783f, - -0.18210681616481111f, - -0.1819781037171242f, - -0.18184938815129162f, - -0.1817206694695189f, - -0.18159194767401074f, - -0.1814632227669745f, - -0.18133449475061494f, - -0.1812057636271378f, - -0.18107702939874887f, - -0.1809482920676531f, - -0.18081955163605806f, - -0.1806908081061689f, - -0.18056206148019152f, - -0.18043331176033114f, - -0.18030455894879557f, - -0.18017580304779013f, - -0.18004704405952096f, - -0.17991828198619345f, - -0.17978951683001568f, - -0.1796607485931931f, - -0.1795319772779321f, - -0.17940320288643835f, - -0.17927442542092004f, - -0.179145644883582f, - -0.1790168612766335f, - -0.17888807460227765f, - -0.17875928486272388f, - -0.1786304920601772f, - -0.17850169619684703f, - -0.17837289727493677f, - -0.17824409529665597f, - -0.17811529026420989f, - -0.17798648217980817f, - -0.17785767104565442f, - -0.17772885686395842f, - -0.17760003963692558f, - -0.1774712193667649f, - -0.17734239605568286f, - -0.17721356970588675f, - -0.17708474031958313f, - -0.1769559078989812f, - -0.1768270724462876f, - -0.17669823396370987f, - -0.17656939245345477f, - -0.1764405479177317f, - -0.17631170035874752f, - -0.17618284977871f, - -0.17605399617982603f, - -0.1759251395643053f, - -0.17579627993435484f, - -0.17566741729218263f, - -0.17553855163999577f, - -0.17540968298000414f, - -0.175280811314415f, - -0.1751519366454365f, - -0.175023058975276f, - -0.17489417830614357f, - -0.17476529464024662f, - -0.17463640797979268f, - -0.17450751832699282f, - -0.17437862568405205f, - -0.1742497300531815f, - -0.17412083143658805f, - -0.1739919298364829f, - -0.17386302525507133f, - -0.17373411769456465f, - -0.17360520715716993f, - -0.17347629364509862f, - -0.17334737716055615f, - -0.1732184577057541f, - -0.17308953528289966f, - -0.17296060989420367f, - -0.1728316815418744f, - -0.1727027502281209f, - -0.1725738159551516f, - -0.17244487872517744f, - -0.1723159385404069f, - -0.17218699540304927f, - -0.17205804931531316f, - -0.1719291002794097f, - -0.17180014829754756f, - -0.1716711933719363f, - -0.17154223550478465f, - -0.171413274698304f, - -0.1712843109547023f, - -0.171155344276192f, - -0.17102637466497936f, - -0.17089740212327686f, - -0.17076842665329267f, - -0.17063944825723937f, - -0.17051046693732347f, - -0.17038148269575767f, - -0.1702524955347512f, - -0.1701235054565133f, - -0.16999451246325603f, - -0.16986551655718868f, - -0.1697365177405216f, - -0.16960751601546425f, - -0.16947851138422884f, - -0.16934950384902492f, - -0.169220493412063f, - -0.16909148007555277f, - -0.16896246384170657f, - -0.1688334447127342f, - -0.1687044226908464f, - -0.16857539777825298f, - -0.16844636997716655f, - -0.16831733928979709f, - -0.1681883057183555f, - -0.16805926926505182f, - -0.16793022993209886f, - -0.1678011877217068f, - -0.16767214263608668f, - -0.16754309467744885f, - -0.1674140438480062f, - -0.16728499014996917f, - -0.167155933585549f, - -0.16702687415695622f, - -0.16689781186640393f, - -0.16676874671610187f, - -0.16663967870826413f, - -0.16651060784509875f, - -0.16638153412881998f, - -0.1662524575616377f, - -0.1661233781457662f, - -0.16599429588341377f, - -0.16586521077679478f, - -0.16573612282811936f, - -0.165607032039602f, - -0.16547793841345113f, - -0.16534884195188135f, - -0.16521974265710299f, - -0.16509064053132982f, - -0.16496153557677315f, - -0.16483242779564514f, - -0.1647033171901571f, - -0.16457420376252313f, - -0.1644450875149546f, - -0.16431596844966395f, - -0.16418684656886356f, - -0.16405772187476506f, - -0.16392859436958268f, - -0.16379946405552812f, - -0.16367033093481398f, - -0.16354119500965209f, - -0.16341205628225686f, - -0.1632829147548402f, - -0.1631537704296149f, - -0.16302462330879297f, - -0.162895473394589f, - -0.16276632068921515f, - -0.16263716519488433f, - -0.16250800691380876f, - -0.16237884584820328f, - -0.16224968200027926f, - -0.1621205153722525f, - -0.1619913459663328f, - -0.161862173784736f, - -0.1617329988296737f, - -0.16160382110336194f, - -0.1614746406080106f, - -0.16134545734583577f, - -0.16121627131904925f, - -0.16108708252986725f, - -0.16095789098049984f, - -0.16082869667316335f, - -0.16069949961006968f, - -0.1605702997934344f, - -0.16044109722547042f, - -0.16031189190839157f, - -0.1601826838444109f, - -0.16005347303574408f, - -0.15992425948460423f, - -0.15979504319320542f, - -0.15966582416376082f, - -0.15953660239848635f, - -0.1594073778995953f, - -0.15927815066930187f, - -0.1591489207098195f, - -0.15901968802336428f, - -0.15889045261214962f, - -0.15876121447838998f, - -0.15863197362429898f, - -0.1585027300520928f, - -0.1583734837639852f, - -0.15824423476219074f, - -0.15811498304892405f, - -0.15798572862639898f, - -0.157856471496832f, - -0.15772721166243703f, - -0.15759794912542888f, - -0.1574686838880216f, - -0.15733941595243184f, - -0.1572101453208728f, - -0.15708087199556214f, - -0.15695159597871144f, - -0.15682231727253843f, - -0.15669303587925648f, - -0.15656375180108348f, - -0.1564344650402311f, - -0.15630517559891732f, - -0.1561758834793557f, - -0.1560465886837634f, - -0.15591729121435494f, - -0.15578799107334584f, - -0.1556586882629507f, - -0.1555293827853869f, - -0.15540007464286912f, - -0.15527076383761304f, - -0.1551414503718335f, - -0.15501213424774798f, - -0.15488281546757143f, - -0.1547534940335197f, - -0.15462416994780775f, - -0.15449484321265333f, - -0.1543655138302706f, - -0.1542361818028783f, - -0.15410684713268888f, - -0.15397750982192118f, - -0.15384816987279043f, - -0.15371882728751288f, - -0.15358948206830386f, - -0.15346013421738142f, - -0.15333078373696107f, - -0.15320143062925914f, - -0.15307207489649122f, - -0.15294271654087552f, - -0.1528133555646277f, - -0.15268399196996343f, - -0.1525546257591011f, - -0.15242525693425646f, - -0.15229588549764622f, - -0.15216651145148624f, - -0.15203713479799597f, - -0.1519077555393887f, - -0.15177837367788397f, - -0.15164898921569694f, - -0.15151960215504717f, - -0.15139021249814824f, - -0.15126082024721976f, - -0.15113142540447713f, - -0.15100202797213924f, - -0.15087262795242237f, - -0.1507432253475438f, - -0.1506138201597199f, - -0.15048441239116978f, - -0.1503550020441099f, - -0.15022558912075767f, - -0.1500961736233297f, - -0.1499667555540452f, - -0.14983733491512f, - -0.1497079117087743f, - -0.1495784859372222f, - -0.14944905760268404f, - -0.14931962670737578f, - -0.14919019325351782f, - -0.14906075724332443f, - -0.14893131867901613f, - -0.14880187756280902f, - -0.14867243389692372f, - -0.14854298768357466f, - -0.14841353892498252f, - -0.1482840876233636f, - -0.1481546337809378f, - -0.14802517739992235f, - -0.1478957184825355f, - -0.14776625703099544f, - -0.14763679304751962f, - -0.14750732653432813f, - -0.14737785749363844f, - -0.14724838592766898f, - -0.14711891183863732f, - -0.14698943522876373f, - -0.1468599561002659f, - -0.1467304744553624f, - -0.14660099029627094f, - -0.14647150362521202f, - -0.14634201444440345f, - -0.14621252275606403f, - -0.14608302856241162f, - -0.14595353186566687f, - -0.14582403266804778f, - -0.1456945309717733f, - -0.1455650267790615f, - -0.14543552009213317f, - -0.1453060109132065f, - -0.1451764992445006f, - -0.14504698508823372f, - -0.1449174684466268f, - -0.14478794932189734f, - -0.14465842771626725f, - -0.1445289036319523f, - -0.14439937707117456f, - -0.1442698480361516f, - -0.1441403165291055f, - -0.1440107825522523f, - -0.1438812461078141f, - -0.14375170719800875f, - -0.1436221658250585f, - -0.14349262199117946f, - -0.14336307569859402f, - -0.1432335269495201f, - -0.14310397574617928f, - -0.1429744220907905f, - -0.14284486598557364f, - -0.14271530743274768f, - -0.14258574643453437f, - -0.14245618299315282f, - -0.1423266171108231f, - -0.1421970487897643f, - -0.1420674780321984f, - -0.14193790484034466f, - -0.14180832921642322f, - -0.14167875116265355f, - -0.14154917068125758f, - -0.14141958777445485f, - -0.14129000244446566f, - -0.14116041469351048f, - -0.14103082452380883f, - -0.140901231937583f, - -0.1407716369370526f, - -0.14064203952443824f, - -0.14051243970195967f, - -0.14038283747183927f, - -0.14025323283629598f, - -0.14012362579755322f, - -0.13999401635782824f, - -0.13986440451934445f, - -0.13973479028432104f, - -0.13960517365498148f, - -0.13947555463354322f, - -0.1393459332222299f, - -0.1392163094232608f, - -0.1390866832388596f, - -0.1389570546712439f, - -0.13882742372263746f, - -0.13869779039525976f, - -0.13856815469133377f, - -0.1384385166130799f, - -0.13830887616271945f, - -0.13817923334247287f, - -0.13804958815456334f, - -0.13791994060121143f, - -0.13779029068463858f, - -0.13766063840706547f, - -0.13753098377071535f, - -0.137401326777809f, - -0.13727166743056807f, - -0.13714200573121327f, - -0.13701234168196816f, - -0.1368826752850536f, - -0.13675300654269135f, - -0.13662333545710242f, - -0.13649366203051042f, - -0.1363639862651364f, - -0.1362343081632023f, - -0.1361046277269293f, - -0.13597494495854112f, - -0.135845259860259f, - -0.13571557243430415f, - -0.13558588268290053f, - -0.13545619060826944f, - -0.13532649621263312f, - -0.13519679949821298f, - -0.13506710046723394f, - -0.13493739912191488f, - -0.13480769546448082f, - -0.13467798949715243f, - -0.13454828122215484f, - -0.13441857064170704f, - -0.13428885775803423f, - -0.13415914257335723f, - -0.13402942508990046f, - -0.1338997053098857f, - -0.13376998323553566f, - -0.13364025886907221f, - -0.13351053221271994f, - -0.13338080326870075f, - -0.1332510720392375f, - -0.13312133852655228f, - -0.13299160273286978f, - -0.13286186466041208f, - -0.13273212431140222f, - -0.1326023816880624f, - -0.13247263679261745f, - -0.1323428896272888f, - -0.13221314019430225f, - -0.1320833884958775f, - -0.13195363453424044f, - -0.13182387831161263f, - -0.13169411983022006f, - -0.13156435909228253f, - -0.13143459610002614f, - -0.13130483085567257f, - -0.131175063361448f, - -0.13104529361957235f, - -0.13091552163227188f, - -0.13078574740176932f, - -0.13065597093028744f, - -0.13052619222005168f, - -0.13039641127328488f, - -0.1302666280922108f, - -0.13013684267905234f, - -0.13000705503603513f, - -0.12987726516538217f, - -0.12974747306931736f, - -0.12961767875006375f, - -0.1294878822098471f, - -0.12935808345089062f, - -0.1292282824754183f, - -0.12909847928565338f, - -0.1289686738838218f, - -0.1288388662721468f, - -0.12870905645285266f, - -0.12857924442816274f, - -0.12844943020030306f, - -0.12831961377149712f, - -0.12818979514396925f, - -0.12805997431994298f, - -0.12793015130164453f, - -0.12780032609129666f, - -0.12767049869112645f, - -0.127540669103355f, - -0.1274108373302095f, - -0.12728100337391285f, - -0.12715116723669234f, - -0.1270213289207692f, - -0.12689148842837075f, - -0.12676164576172008f, - -0.1266318009230446f, - -0.12650195391456567f, - -0.1263721047385108f, - -0.12624225339710318f, - -0.12611239989256956f, - -0.125982544227134f, - -0.1258526864030216f, - -0.12572282642245655f, - -0.1255929642876657f, - -0.12546310000087335f, - -0.12533323356430465f, - -0.125203364980184f, - -0.12507349425073838f, - -0.12494362137819225f, - -0.1248137463647709f, - -0.12468386921269972f, - -0.12455398992420326f, - -0.12442410850150872f, - -0.12429422494684068f, - -0.12416433926242468f, - -0.12403445145048539f, - -0.12390456151325016f, - -0.12377466945294376f, - -0.12364477527179182f, - -0.12351487897201918f, - -0.12338498055585334f, - -0.1232550800255192f, - -0.12312517738324256f, - -0.12299527263124839f, - -0.12286536577176432f, - -0.12273545680701453f, - -0.1226055457392276f, - -0.12247563257062602f, - -0.12234571730343845f, - -0.12221579993988917f, - -0.12208588048220693f, - -0.12195595893261436f, - -0.12182603529334027f, - -0.12169610956660909f, - -0.12156618175464882f, - -0.12143625185968489f, - -0.12130631988394358f, - -0.12117638582965037f, - -0.12104644969903341f, - -0.12091651149431823f, - -0.1207865712177313f, - -0.12065662887149822f, - -0.12052668445784728f, - -0.12039673797900417f, - -0.12026678943719547f, - -0.12013683883464696f, - -0.12000688617358704f, - -0.11987693145624155f, - -0.11974697468483723f, - -0.11961701586159997f, - -0.11948705498875833f, - -0.11935709206853828f, - -0.11922712710316673f, - -0.11909716009486966f, - -0.11896719104587582f, - -0.11883721995841129f, - -0.11870724683470311f, - -0.11857727167697833f, - -0.11844729448746315f, - -0.11831731526838646f, - -0.11818733402197365f, - -0.11805735075045458f, - -0.11792736545605292f, - -0.1177973781409986f, - -0.11766738880751715f, - -0.11753739745783855f, - -0.11740740409418662f, - -0.11727740871879143f, - -0.11714741133387865f, - -0.11701741194167838f, - -0.11688741054441461f, - -0.11675740714431752f, - -0.11662740174361293f, - -0.11649739434453019f, - -0.11636738494929606f, - -0.11623737356013825f, - -0.11610736017928355f, - -0.11597734480896149f, - -0.11584732745139895f, - -0.11571730810882376f, - -0.11558728678346288f, - -0.11545726347754594f, - -0.1153272381932991f, - -0.11519721093295296f, - -0.11506718169873197f, - -0.11493715049286679f, - -0.11480711731758371f, - -0.11467708217511344f, - -0.1145470450676806f, - -0.11441700599751596f, - -0.11428696496684684f, - -0.11415692197790145f, - -0.11402687703290716f, - -0.11389683013409402f, - -0.11376678128368946f, - -0.11363673048392096f, - -0.11350667773701867f, - -0.11337662304521012f, - -0.11324656641072377f, - -0.11311650783578721f, - -0.11298644732263073f, - -0.112856384873482f, - -0.1127263204905696f, - -0.11259625417612128f, - -0.11246618593236832f, - -0.11233611576153589f, - -0.11220604366585535f, - -0.11207596964755367f, - -0.11194589370886142f, - -0.11181581585200652f, - -0.11168573607921783f, - -0.11155565439272334f, - -0.11142557079475374f, - -0.11129548528753708f, - -0.11116539787330235f, - -0.11103530855427768f, - -0.11090521733269387f, - -0.11077512421077912f, - -0.11064502919076255f, - -0.11051493227487241f, - -0.11038483346533966f, - -0.11025473276439171f, - -0.11012463017426048f, - -0.10999452569717169f, - -0.1098644193353573f, - -0.1097343110910449f, - -0.10960420096646646f, - -0.1094740889638479f, - -0.10934397508542129f, - -0.10921385933341432f, - -0.10908374171005913f, - -0.10895362221758174f, - -0.10882350085821435f, - -0.1086933776341848f, - -0.10856325254772445f, - -0.10843312560106211f, - -0.10830299679642746f, - -0.10817286613605022f, - -0.10804273362215924f, - -0.10791259925698611f, - -0.10778246304275975f, - -0.10765232498171f, - -0.10752218507606585f, - -0.107392043328059f, - -0.1072618997399185f, - -0.10713175431387433f, - -0.1070016070521556f, - -0.10687145795699413f, - -0.1067413070306191f, - -0.1066111542752606f, - -0.10648099969314792f, - -0.10635084328651294f, - -0.10622068505758499f, - -0.1060905250085943f, - -0.10596036314177025f, - -0.10583019945934488f, - -0.10570003396354676f, - -0.10556986665660886f, - -0.10543969754075806f, - -0.10530952661822741f, - -0.10517935389124561f, - -0.10504917936204573f, - -0.1049190030328548f, - -0.10478882490590598f, - -0.10465864498342806f, - -0.1045284632676543f, - -0.1043982797608118f, - -0.10426809446513387f, - -0.1041379073828494f, - -0.10400771851619094f, - -0.1038775278673883f, - -0.10374733543867229f, - -0.10361714123227284f, - -0.10348694525042254f, - -0.1033567474953514f, - -0.1032265479692903f, - -0.10309634667446932f, - -0.10296614361312117f, - -0.10283593878747596f, - -0.10270573219976474f, - -0.10257552385221765f, - -0.10244531374706756f, - -0.10231510188654468f, - -0.10218488827288018f, - -0.10205467290830435f, - -0.10192445579505015f, - -0.10179423693534793f, - -0.10166401633142896f, - -0.10153379398552455f, - -0.10140356989986511f, - -0.1012733440766838f, - -0.1011431165182102f, - -0.1010128872266784f, - -0.10088265620431629f, - -0.100752423453358f, - -0.10062218897603328f, - -0.1004919527745763f, - -0.10036171485121509f, - -0.1002314752081839f, - -0.10010123384771258f, - -0.09997099077203542f, - -0.09984074598338057f, - -0.0997104994839824f, - -0.09958025127607087f, - -0.09945000136187954f, - -0.09931974974363929f, - -0.09918949642358195f, - -0.09905924140393851f, - -0.09892898468694263f, - -0.0987987262748253f, - -0.0986684661698185f, - -0.09853820437415331f, - -0.0984079408900635f, - -0.09827767571978019f, - -0.09814740886553545f, - -0.0980171403295605f, - -0.09788687011408923f, - -0.09775659822135199f, - -0.09762632465358362f, - -0.09749604941301278f, - -0.09736577250187436f, - -0.09723549392239973f, - -0.09710521367682118f, - -0.09697493176737015f, - -0.09684464819628075f, - -0.09671436296578445f, - -0.09658407607811369f, - -0.09645378753549998f, - -0.09632349734017756f, - -0.09619320549437806f, - -0.09606291200033307f, - -0.09593261686027692f, - -0.0958023200764413f, - -0.0956720216510588f, - -0.09554172158636118f, - -0.09541141988458374f, - -0.09528111654795562f, - -0.0951508115787122f, - -0.09502050497908444f, - -0.09489019675130778f, - -0.09475988689761146f, - -0.09462957542023095f, - -0.09449926232139737f, - -0.09436894760334533f, - -0.09423863126830687f, - -0.09410831331851491f, - -0.09397799375620156f, - -0.09384767258360155f, - -0.09371734980294703f, - -0.09358702541647103f, - -0.09345669942640576f, - -0.09332637183498607f, - -0.09319604264444334f, - -0.09306571185701336f, - -0.09293537947492578f, - -0.09280504550041646f, - -0.09267470993571687f, - -0.09254437278306295f, - -0.09241403404468441f, - -0.09228369372281728f, - -0.09215335181969309f, - -0.09202300833754787f, - -0.0918926632786115f, - -0.09176231664512007f, - -0.09163196843930523f, - -0.09150161866340226f, - -0.09137126731964378f, - -0.0912409144102633f, - -0.09111055993749442f, - -0.09098020390356981f, - -0.09084984631072489f, - -0.09071948716119238f, - -0.09058912645720597f, - -0.09045876420099848f, - -0.09032840039480539f, - -0.09019803504085955f, - -0.09006766814139475f, - -0.08993729969864389f, - -0.08980692971484261f, - -0.08967655819222384f, - -0.08954618513302147f, - -0.08941581053946852f, - -0.0892854344138007f, - -0.08915505675825108f, - -0.08902467757505367f, - -0.08889429686644156f, - -0.08876391463465057f, - -0.08863353088191389f, - -0.0885031456104656f, - -0.08837275882253894f, - -0.0882423705203698f, - -0.08811198070619063f, - -0.08798158938223821f, - -0.08785119655074328f, - -0.0877208022139427f, - -0.087590406374069f, - -0.08746000903335911f, - -0.08732961019404382f, - -0.08719920985836016f, - -0.0870688080285407f, - -0.08693840470682161f, - -0.08680799989543646f, - -0.08667759359661967f, - -0.08654718581260486f, - -0.08641677654562827f, - -0.08628636579792358f, - -0.0861559535717253f, - -0.08602553986926717f, - -0.08589512469278553f, - -0.08576470804451414f, - -0.08563428992668763f, - -0.08550387034153983f, - -0.08537344929130719f, - -0.08524302677822355f, - -0.0851126028045237f, - -0.08498217737244237f, - -0.08485175048421353f, - -0.08472132214207374f, - -0.08459089234825698f, - -0.08446046110499814f, - -0.08433002841453123f, - -0.08419959427909295f, - -0.08406915870091737f, - -0.08393872168223947f, - -0.08380828322529336f, - -0.08367784333231584f, - -0.08354740200554021f, - -0.08341695924720419f, - -0.08328651505953932f, - -0.08315606944478342f, - -0.08302562240516984f, - -0.08289517394293643f, - -0.08276472406031482f, - -0.08263427275954292f, - -0.0825038200428542f, - -0.08237336591248658f, - -0.08224291037067182f, - -0.08211245341964789f, - -0.08198199506164837f, - -0.0818515352989104f, - -0.08172107413366848f, - -0.08159061156815804f, - -0.08146014760461363f, - -0.08132968224527248f, - -0.08119921549236919f, - -0.08106874734813929f, - -0.08093827781481741f, - -0.0808078068946409f, - -0.08067733458984445f, - -0.08054686090266366f, - -0.0804163858353333f, - -0.08028590939009077f, - -0.08015543156917086f, - -0.0800249523748093f, - -0.07989447180924092f, - -0.07976398987470322f, - -0.07963350657343111f, - -0.07950302190766038f, - -0.07937253587962596f, - -0.07924204849156548f, - -0.07911155974571389f, - -0.07898106964430622f, - -0.07885057818958102f, - -0.0787200853837707f, - -0.07858959122911387f, - -0.07845909572784475f, - -0.07832859888220198f, - -0.07819810069441806f, - -0.0780676011667317f, - -0.0779371003013772f, - -0.0778065981005933f, - -0.0776760945666126f, - -0.0775455897016739f, - -0.07741508350801157f, - -0.07728457598786359f, - -0.07715406714346529f, - -0.07702355697705288f, - -0.07689304549086175f, - -0.07676253268712994f, - -0.07663201856809287f, - -0.07650150313598687f, - -0.0763709863930474f, - -0.07624046834151259f, - -0.07610994898361795f, - -0.0759794283215999f, - -0.07584890635769398f, - -0.07571838309413843f, - -0.07558785853316796f, - -0.07545733267702173f, - -0.07532680552793272f, - -0.07519627708814013f, - -0.07506574735987875f, - -0.07493521634538786f, - -0.0748046840469005f, - -0.07467415046665596f, - -0.07454361560689005f, - -0.07441307946983941f, - -0.07428254205773988f, - -0.07415200337282994f, - -0.07402146341734546f, - -0.07389092219352231f, - -0.07376037970359905f, - -0.07362983594981164f, - -0.07349929093439686f, - -0.0733687446595907f, - -0.07323819712763181f, - -0.0731076483407562f, - -0.07297709830120079f, - -0.07284654701120163f, - -0.07271599447299745f, - -0.07258544068882435f, - -0.07245488566091933f, - -0.07232432939151855f, - -0.07219377188286079f, - -0.07206321313718225f, - -0.07193265315672004f, - -0.07180209194371036f, - -0.07167152950039211f, - -0.07154096582900157f, - -0.07141040093177592f, - -0.07127983481095145f, - -0.07114926746876714f, - -0.07101869890745847f, - -0.07088812912926537f, - -0.07075755813642155f, - -0.07062698593116697f, - -0.07049641251573718f, - -0.07036583789237218f, - -0.07023526206330578f, - -0.07010468503077803f, - -0.06997410679702457f, - -0.06984352736428544f, - -0.06971294673479458f, - -0.0695823649107921f, - -0.0694517818945137f, - -0.06932119768819868f, - -0.06919061229408366f, - -0.06906002571440618f, - -0.06892943795140294f, - -0.06879884900731328f, - -0.06866825888437394f, - -0.06853766758482253f, - -0.06840707511089583f, - -0.06827648146483326f, - -0.06814588664887161f, - -0.06801529066524861f, - -0.067884693516202f, - -0.06775409520396859f, - -0.06762349573078796f, - -0.067492895098897f, - -0.06736229331053352f, - -0.06723169036793446f, - -0.06710108627333942f, - -0.06697048102898541f, - -0.06683987463711029f, - -0.06670926709995109f, - -0.06657865841974751f, - -0.06644804859873572f, - -0.06631743763915635f, - -0.06618682554324382f, - -0.0660562123132388f, - -0.06592559795137755f, - -0.06579498245990076f, - -0.06566436584104295f, - -0.06553374809704485f, - -0.0654031292301428f, - -0.06527250924257756f, - -0.06514188813658375f, - -0.06501126591440216f, - -0.06488064257826921f, - -0.06475001813042487f, - -0.06461939257310646f, - -0.06448876590855222f, - -0.06435813813899952f, - -0.06422750926668837f, - -0.06409687929385621f, - -0.06396624822274136f, - -0.06383561605558122f, - -0.06370498279461594f, - -0.06357434844208298f, - -0.06344371300022074f, - -0.06331307647126674f, - -0.06318243885746117f, - -0.06305180016104156f, - -0.0629211603842464f, - -0.06279051952931326f, - -0.06265987759848243f, - -0.06252923459399153f, - -0.06239859051807907f, - -0.06226794537298274f, - -0.06213729916094288f, - -0.06200665188419718f, - -0.06187600354498425f, - -0.06174535414554272f, - -0.061614703688110346f, - -0.06148405217492755f, - -0.061353399608231246f, - -0.06122274599026279f, - -0.061092091323257346f, - -0.060961435609456306f, - -0.060830778851096654f, - -0.06070012105041981f, - -0.06056946220966102f, - -0.06043880233106175f, - -0.060308141416859036f, - -0.06017747946929439f, - -0.06004681649060312f, - -0.059916152483026744f, - -0.05978548744880241f, - -0.05965482139017078f, - -0.05952415430936991f, - -0.05939348620863873f, - -0.059262817090215324f, - -0.05913214695634044f, - -0.0590014758092522f, - -0.05887080365118961f, - -0.058740130484390814f, - -0.058609456311096646f, - -0.058478781133544384f, - -0.058348104953975785f, - -0.05821742777462639f, - -0.05808674959773799f, - -0.05795607042554794f, - -0.05782539026029806f, - -0.05769470910422396f, - -0.0575640269595675f, - -0.057433343828566984f, - -0.057302659713461636f, - -0.05717197461648981f, - -0.057041288539892536f, - -0.05691060148590819f, - -0.056779913456775175f, - -0.05664922445473457f, - -0.056518534482024804f, - -0.056387843540885225f, - -0.05625715163355429f, - -0.05612645876227315f, - -0.0559957649292803f, - -0.055865070136815145f, - -0.055734374387116224f, - -0.05560367768242563f, - -0.05547298002497926f, - -0.05534228141701925f, - -0.055211581860783315f, - -0.05508088135851273f, - -0.05495017991244612f, - -0.05481947752482303f, - -0.05468877419788211f, - -0.05455806993386471f, - -0.05442736473500951f, - -0.05429665860355613f, - -0.054165951541743286f, - -0.05403524355181238f, - -0.05390453463600218f, - -0.05377382479655233f, - -0.05364311403570164f, - -0.053512402355691574f, - -0.05338168975876006f, - -0.05325097624714949f, - -0.053120261823096045f, - -0.05298954648884216f, - -0.05285883024662582f, - -0.05272811309868948f, - -0.052597395047269395f, - -0.05246667609460805f, - -0.05233595624294348f, - -0.05220523549451734f, - -0.05207451385156859f, - -0.05194379131633711f, - -0.051813067891061916f, - -0.05168234357798469f, - -0.051551618379344466f, - -0.051420892297381185f, - -0.051290165334334815f, - -0.05115943749244443f, - -0.051028708773951784f, - -0.050897979181096f, - -0.050767248716117104f, - -0.05063651738125422f, - -0.05050578517874918f, - -0.05037505211084116f, - -0.05024431817977022f, - -0.050113583387775586f, - -0.04998284773709913f, - -0.049852111229980074f, - -0.04972137386865856f, - -0.049590635655373846f, - -0.04945989659236789f, - -0.049329156681879954f, - -0.04919841592615025f, - -0.04906767432741809f, - -0.04893693188792548f, - -0.04880618860991087f, - -0.04867544449561718f, - -0.04854469954728113f, - -0.04841395376714565f, - -0.048283207157449264f, - -0.048152459720434936f, - -0.04802171145833946f, - -0.04789096237340581f, - -0.04776021246787257f, - -0.04762946174398277f, - -0.047498710203973234f, - -0.04736795785008702f, - -0.04723720468456275f, - -0.04710645070964264f, - -0.046975695927566216f, - -0.04684494034057393f, - -0.04671418395090537f, - -0.046583426760802765f, - -0.046452668772505736f, - -0.04632190998825477f, - -0.04619115041028951f, - -0.04606039004085225f, - -0.04592962888218265f, - -0.04579886693652127f, - -0.04566810420610779f, - -0.04553734069318457f, - -0.04540657639999132f, - -0.04527581132876865f, - -0.045145045481757184f, - -0.045014278861196674f, - -0.04488351146932954f, - -0.04475274330839557f, - -0.04462197438063543f, - -0.044491204688288925f, - -0.044360434233598534f, - -0.044229663018803204f, - -0.04409889104614632f, - -0.043968118317865075f, - -0.04383734483620289f, - -0.04370657060339876f, - -0.04357579562169612f, - -0.04344501989333222f, - -0.043314243420550534f, - -0.0431834662055901f, - -0.043052688250694415f, - -0.04292190955810077f, - -0.04279113013005269f, - -0.042660349968789264f, - -0.042529569076553156f, - -0.042398787455584376f, - -0.04226800510812382f, - -0.042137222036411535f, - -0.042006438242690215f, - -0.04187565372919993f, - -0.04174486849818163f, - -0.0416140825518754f, - -0.041483295892523996f, - -0.04135250852236752f, - -0.041221720443646984f, - -0.04109093165860252f, - -0.040960142169476924f, - -0.04082935197851036f, - -0.04069856108794389f, - -0.04056776950001767f, - -0.040436977216974576f, - -0.040306184241054796f, - -0.040175390574499446f, - -0.040044596219548735f, - -0.03991380117844558f, - -0.03978300545343023f, - -0.03965220904674382f, - -0.03952141196062663f, - -0.03939061419732162f, - -0.039259815759069075f, - -0.039129016648109305f, - -0.038998216866685295f, - -0.03886741641703737f, - -0.03873661530140677f, - -0.03860581352203384f, - -0.038475011081162504f, - -0.03834420798103047f, - -0.03821340422388168f, - -0.03808259981195565f, - -0.037951794747495445f, - -0.03782098903274149f, - -0.0376901826699351f, - -0.03755937566131673f, - -0.03742856800912949f, - -0.03729775971561385f, - -0.03716695078301118f, - -0.037036141213561954f, - -0.036905331009509344f, - -0.03677452017309386f, - -0.03664370870655691f, - -0.036512896612139016f, - -0.03638208389208339f, - -0.0362512705486297f, - -0.03612045658402206f, - -0.03598964200049838f, - -0.03585882680030279f, - -0.03572801098567501f, - -0.03559719455885919f, - -0.03546637752209328f, - -0.03533555987762146f, - -0.03520474162768347f, - -0.035073922774523536f, - -0.03494310332037963f, - -0.03481228326749597f, - -0.034681462618113244f, - -0.03455064137447214f, - -0.03441981953881602f, - -0.03428899711338559f, - -0.034158174100422455f, - -0.03402735050216735f, - -0.03389652632086367f, - -0.03376570155875217f, - -0.033634876218074504f, - -0.033504050301071425f, - -0.033373223809986384f, - -0.03324239674706017f, - -0.03311156911453447f, - -0.03298074091465009f, - -0.032849912149650516f, - -0.032719082821776574f, - -0.03258825293326998f, - -0.03245742248637159f, - -0.032326591483324923f, - -0.032195759926370845f, - -0.03206492781775112f, - -0.031934095159706626f, - -0.03180326195448093f, - -0.031672428204314935f, - -0.031541593911450436f, - -0.03141075907812836f, - -0.0312799237065923f, - -0.031149087799082313f, - -0.031018251357842894f, - -0.030887414385112343f, - -0.03075657688313518f, - -0.030625738854151496f, - -0.030494900300405824f, - -0.030364061224136495f, - -0.030233221627588073f, - -0.030102381513000674f, - -0.02997154088261799f, - -0.029840699738681052f, - -0.029709858083431784f, - -0.029579015919111235f, - -0.02944817324796313f, - -0.02931733007222853f, - -0.0291864863941494f, - -0.029055642215966824f, - -0.028924797539924555f, - -0.028793952368263695f, - -0.028663106703226242f, - -0.02853226054705331f, - -0.02840141390198869f, - -0.028270566770273516f, - -0.028139719154149815f, - -0.02800887105585963f, - -0.02787802247764412f, - -0.027747173421747113f, - -0.027616323890409786f, - -0.02748547388587421f, - -0.027354623410381577f, - -0.02722377246617575f, - -0.02709292105549794f, - -0.026962069180590242f, - -0.026831216843693887f, - -0.026700364047052765f, - -0.026569510792907234f, - -0.026438657083502088f, - -0.02630780292107592f, - -0.026176948307873545f, - -0.026046093246135344f, - -0.025915237738106146f, - -0.025784381786024577f, - -0.02565352539213548f, - -0.025522668558679268f, - -0.0253918112879008f, - -0.025260953582038732f, - -0.025130095443337937f, - -0.024999236874038856f, - -0.024868377876385492f, - -0.024737518452619192f, - -0.0246066586049822f, - -0.02447579833571587f, - -0.024344937647064233f, - -0.02421407654126867f, - -0.024083215020571445f, - -0.023952353087213954f, - -0.023821490743440248f, - -0.02369062799149173f, - -0.02355976483361071f, - -0.02342890127203859f, - -0.023298037309019467f, - -0.023167172946794767f, - -0.02303630818760682f, - -0.022905443033697067f, - -0.022774577487309624f, - -0.02264371155068595f, - -0.022512845226068393f, - -0.02238197851569843f, - -0.022251111421820194f, - -0.02212024394667518f, - -0.021989376092504873f, - -0.021858507861554324f, - -0.021727639256062373f, - -0.02159677027827408f, - -0.021465900930430073f, - -0.02133503121477543f, - -0.021204161133549018f, - -0.021073290688995917f, - -0.02094241988335679f, - -0.020811548718876728f, - -0.020680677197794626f, - -0.020549805322355598f, - -0.020418933094800317f, - -0.020288060517373023f, - -0.020157187592315294f, - -0.0200263143218696f, - -0.01989544070827753f, - -0.01976456675378335f, - -0.019633692460628658f, - -0.01950281783105595f, - -0.019371942867306837f, - -0.019241067571625605f, - -0.01911019194625388f, - -0.01897931599343418f, - -0.018848439715408137f, - -0.01871756311442006f, - -0.01858668619271071f, - -0.01845580895252529f, - -0.01832493139610279f, - -0.01819405352568843f, - -0.01806317534352299f, - -0.017932296851851697f, - -0.01780141805291357f, - -0.017670538948953835f, - -0.017539659542214193f, - -0.017408779834936335f, - -0.017277899829364625f, - -0.01714701952774077f, - -0.017016138932307367f, - -0.016885258045306134f, - -0.016754376868981454f, - -0.01662349540557505f, - -0.016492613657329548f, - -0.016361731626486676f, - -0.01623084931529084f, - -0.016099966725983787f, - -0.015969083860808152f, - -0.01583820072200569f, - -0.01570731731182083f, - -0.015576433632495331f, - -0.015445549686271848f, - -0.015314665475392156f, - -0.015183781002100697f, - -0.015052896268639253f, - -0.014922011277250498f, - -0.014791126030176223f, - -0.014660240529660886f, - -0.01452935477794629f, - -0.014398468777275124f, - -0.014267582529889198f, - -0.014136696038032989f, - -0.014005809303947422f, - -0.013874922329877875f, - -0.013744035118063505f, - -0.013613147670749694f, - -0.013482259990177388f, - -0.013351372078591975f, - -0.013220483938232634f, - -0.013089595571344759f, - -0.012958706980169312f, - -0.012827818166951699f, - -0.01269692913393111f, - -0.01256603988335296f, - -0.012435150417458221f, - -0.012304260738491429f, - -0.012173370848694453f, - -0.012042480750310057f, - -0.011911590445580118f, - -0.011780699936749182f, - -0.011649809226059136f, - -0.011518918315752757f, - -0.011388027208072823f, - -0.011257135905261232f, - -0.011126244409562547f, - -0.01099535272321867f, - -0.010864460848472394f, - -0.01073356878756563f, - -0.010602676542742951f, - -0.010471784116246274f, - -0.010340891510318407f, - -0.010209998727201268f, - -0.010079105769139448f, - -0.009948212638374872f, - -0.009817319337150361f, - -0.009686425867707849f, - -0.009555532232291932f, - -0.009424638433143666f, - -0.00929374447250854f, - -0.00916285035262584f, - -0.009031956075741062f, - -0.008901061644095268f, - -0.008770167059933963f, - -0.00863927232549644f, - -0.008508377443028207f, - -0.008377482414770338f, - -0.008246587242968346f, - -0.008115691929861535f, - -0.007984796477695422f, - -0.00785390088871109f, - -0.007723005165153177f, - -0.007592109309263657f, - -0.0074612133232853945f, - -0.00733031720946037f, - -0.007199420970033229f, - -0.007068524607245954f, - -0.006937628123341419f, - -0.006806731520561613f, - -0.006675834801151189f, - -0.00654493796735214f, - -0.006414041021407347f, - -0.006283143965558805f, - -0.006152246802051177f, - -0.006021349533126463f, - -0.005890452161027551f, - -0.005759554687996444f, - -0.005628657116277812f, - -0.00549775944811366f, - -0.005366861685746886f, - -0.005235963831420387f, - -0.005105065887376174f, - -0.004974167855858924f, - -0.004843269739110653f, - -0.004712371539374262f, - -0.004581473258891771f, - -0.004450574899907861f, - -0.004319676464663663f, - -0.004188777955404753f, - -0.004057879374370489f, - -0.003926980723806445f, - -0.0037960820059537597f, - -0.003665183223058011f, - -0.003534284377358562f, - -0.0034033854711009925f, - -0.0032724865065264447f, - -0.003141587485879613f, - -0.003010688411402528f, - -0.0028797892853381106f, - -0.002748890109928394f, - -0.002617990887418076f, - -0.002487091620049191f, - -0.002356192310064663f, - -0.002225292959706529f, - -0.0020943935712194888f, - -0.001963494146845581f, - -0.001832594688827731f, - -0.0017016951994079782f, - -0.001570795680831026f, - -0.001439896135338026f, - -0.001308996565174571f, - -0.0011780969725800373f, - -0.0010471973598000183f, - -0.0009162977290765556f, - -0.0007853980826525788f, - -0.0006544984227701298f, - -0.0005235987516739153f, - -0.00039269907160597775f, - -0.0002617993848092476f, - -0.00013089969352576765f, - }; -} // namespace WaveTable diff --git a/Gems/AudioSystem/Code/audiosystem_tests_files.cmake b/Gems/AudioSystem/Code/audiosystem_tests_files.cmake index 5cc8fd6809..c163473703 100644 --- a/Gems/AudioSystem/Code/audiosystem_tests_files.cmake +++ b/Gems/AudioSystem/Code/audiosystem_tests_files.cmake @@ -10,5 +10,4 @@ set(FILES Tests/AudioSystemTest.cpp Tests/Mocks/ATLEntitiesMock.h Tests/Mocks/FileCacheManagerMock.h - Tests/Mocks/IAudioSystemImplementationMock.h ) From bce3320fb50bb6d9cf95468da66a550d7701aec6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:18:54 -0800 Subject: [PATCH 158/394] Remove unused files from Gems/AWSCore Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Disabled/HttpClientComponent_white.png | 3 - .../Icons/Components/HttpClientComponent.png | 3 - .../Viewport/HttpClientComponent.png | 3 - .../Editor/Translation/scriptcanvas_en_us.ts | 171 ------------------ .../Include/Framework/HttpClientComponent.h | 69 ------- .../Code/Include/Framework/JobExecuter.h | 66 ------- .../Include/Framework/MultipartFormData.h | 76 -------- .../Source/Framework/MultipartFormData.cpp | 123 ------------- Gems/AWSCore/Code/awscore_files.cmake | 4 - 9 files changed, 518 deletions(-) delete mode 100644 Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png delete mode 100644 Assets/Editor/Icons/Components/HttpClientComponent.png delete mode 100644 Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png delete mode 100644 Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h delete mode 100644 Gems/AWSCore/Code/Include/Framework/JobExecuter.h delete mode 100644 Gems/AWSCore/Code/Include/Framework/MultipartFormData.h delete mode 100644 Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp diff --git a/Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png b/Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png deleted file mode 100644 index 12b5be2ccc..0000000000 --- a/Assets/Editor/Icons/Components/Disabled/HttpClientComponent_white.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bfc2ef8c6dbf2fba078e27e4e94384099e090468e679327dd826a5cbf22b04ed -size 1019 diff --git a/Assets/Editor/Icons/Components/HttpClientComponent.png b/Assets/Editor/Icons/Components/HttpClientComponent.png deleted file mode 100644 index 7a619a5a59..0000000000 --- a/Assets/Editor/Icons/Components/HttpClientComponent.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:708b12d41229afab78e0f7d59097ae3de855fea8525a920c5c214fc0ce79f1bd -size 1209 diff --git a/Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png b/Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png deleted file mode 100644 index 16e4917180..0000000000 --- a/Assets/Editor/Icons/Components/Viewport/HttpClientComponent.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fab63af9b50790dca25330058e70517987ea8bf11c00f9353dd951ebdbd1dbe5 -size 5008 diff --git a/Assets/Editor/Translation/scriptcanvas_en_us.ts b/Assets/Editor/Translation/scriptcanvas_en_us.ts index 6d436b7caf..bfbd8cf316 100644 --- a/Assets/Editor/Translation/scriptcanvas_en_us.ts +++ b/Assets/Editor/Translation/scriptcanvas_en_us.ts @@ -49513,106 +49513,6 @@ An Entity can be selected by using the pick button, or by dragging an Entity fro - - Handler: HttpClientComponentNotificationBus - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_NAME - HttpClientComponentNotificationBus - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_CATEGORY - Networking - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_NAME - Class/Bus: HttpClientComponentNotificationBus Event/Method: OnHttpRequestSuccess - OnHttpRequestSuccess - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_CATEGORY - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUT_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUT_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_IN_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_IN_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT0_NAME - Simple Type: Number C++ Type: int - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT0_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT1_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTSUCCESS_OUTPUT1_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_NAME - Class/Bus: HttpClientComponentNotificationBus Event/Method: OnHttpRequestFailure - OnHttpRequestFailure - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_CATEGORY - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUT_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUT_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_IN_NAME - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_IN_TOOLTIP - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUTPUT0_NAME - Simple Type: Number C++ Type: int - - - - HANDLER_HTTPCLIENTCOMPONENTNOTIFICATIONBUS_ONHTTPREQUESTFAILURE_OUTPUT0_TOOLTIP - - - Handler: InputEventNotificationBus @@ -79046,77 +78946,6 @@ The element is removed from its current parent and added as a child of the new p - - EBus: HttpClientComponentRequestBus - - HTTPCLIENTCOMPONENTREQUESTBUS_NAME - HttpClientComponentRequestBus - - - HTTPCLIENTCOMPONENTREQUESTBUS_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_CATEGORY - Networking - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_NAME - Class/Bus: HttpClientComponentRequestBus Event/Method: MakeHttpRequest - MakeHttpRequest - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_CATEGORY - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_OUT_NAME - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_OUT_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_IN_NAME - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_IN_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM0_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM0_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM1_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM1_TOOLTIP - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM2_NAME - Simple Type: String C++ Type: AZStd::basic_string<char, AZStd::char_traits<char>, allocator> - - - - HTTPCLIENTCOMPONENTREQUESTBUS_MAKEHTTPREQUEST_PARAM2_TOOLTIP - - - Handler: AWSBehaviorURLNotificationsBus diff --git a/Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h b/Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h deleted file mode 100644 index 48b59cc56a..0000000000 --- a/Gems/AWSCore/Code/Include/Framework/HttpClientComponent.h +++ /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 - * - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - - - -#include - - -namespace AWSCore -{ - ///////////////////////////////////////////// - // EBus Definitions - ///////////////////////////////////////////// - class HttpClientComponentRequests - : public AZ::ComponentBus - { - public: - virtual ~HttpClientComponentRequests() {} - virtual void MakeHttpRequest(AZStd::string url, AZStd::string method, AZStd::string jsonBody) {} - }; - - using HttpClientComponentRequestBus = AZ::EBus; - - class HttpClientComponentNotifications - : public AZ::ComponentBus - { - public: - ~HttpClientComponentNotifications() override = default; - virtual void OnHttpRequestSuccess(int responseCode, AZStd::string responseBody) {} - virtual void OnHttpRequestFailure(int responseCode) {} - }; - - using HttpClientComponentNotificationBus = AZ::EBus; - - ///////////////////////////////////////////// - // Entity Component - ///////////////////////////////////////////// - class HttpClientComponent - : public AZ::Component - , public HttpClientComponentRequestBus::Handler - { - public: - AZ_COMPONENT(HttpClientComponent, "{23ECDBDF-129A-4670-B9B4-1E0B541ACD61}"); - ~HttpClientComponent() override = default; - - void Init() override; - void Activate() override; - void Deactivate() override; - - void MakeHttpRequest(AZStd::string, AZStd::string, AZStd::string) override; - - static void Reflect(AZ::ReflectContext*); - }; - -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Framework/JobExecuter.h b/Gems/AWSCore/Code/Include/Framework/JobExecuter.h deleted file mode 100644 index 899644ed61..0000000000 --- a/Gems/AWSCore/Code/Include/Framework/JobExecuter.h +++ /dev/null @@ -1,66 +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 - -#include - -namespace AWSCore -{ - - /// AZ:Job type used by the JobExecuter. It is used call the callback - /// function provided by the AWS SDK. - using ExecuterJob = AZ::JobFunction>; - - /// This class provides a simple alternative to using the the AwsRequestJob, - /// AwsApiClientJob, or AwsApiJob classes. Those classes provide configuration - /// management and more abstracted usage patterns. With JobExecutor you need - /// to do all the configuration management and work directly with the AWS API. - /// - /// An AWS API async executer that uses the AZ::Job system to make AWS service calls. - /// To use, set the Aws::Client::ClientConfiguration executor field so it points to - /// an instance of this class, then use that client configuration object when creating - /// AWS service client objects. This will cause the Async APIs on the AWS service - /// client object to use the AZ::Job system to execute the request. - class JobExecuter - : public Aws::Utils::Threading::Executor - { - - public: - /// Initialize a JobExecuter object. - /// - /// \param context - The JobContext that will be used to execute the jobs created - /// by the JobExecuter. - /// - /// By default the global JobContext is used. However, the AWS SDK currently - /// only supports blocking calls, so, to avoid impacting other jobs, it is - /// recommended that you create a JobContext with a JobManager dedicated to - /// dedicated to processing these jobs. This context can also be used with - /// AwsApiCore::HttpJob. - JobExecuter(AZ::JobContext* context) - : m_context{ context } - { - } - - protected: - AZ::JobContext* m_context; - - /// Called by the AWS SDK to queue a callback for execution. - bool SubmitToThread(std::function&& callback) override - { - ExecuterJob* job = aznew ExecuterJob(callback, true, m_context); - job->Start(); - } - - }; - -} // namespace AWCore - diff --git a/Gems/AWSCore/Code/Include/Framework/MultipartFormData.h b/Gems/AWSCore/Code/Include/Framework/MultipartFormData.h deleted file mode 100644 index 153cbac644..0000000000 --- a/Gems/AWSCore/Code/Include/Framework/MultipartFormData.h +++ /dev/null @@ -1,76 +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 -#include - -namespace AWSCore -{ - /// Class for generating multi-part form data capable of sending files via HTTP POST. - /// The current implementation writes the entire contents of the file to an output buffer in a single operation, - /// i.e. there is no streaming for large files. - /// A stream-based solution would require better bridging of types between CGF and AWS. - class MultipartFormData - { - public: - struct ComposeResult - { - AZStd::string m_content; // Use for the request body - AZStd::string m_contentLength; // Use for the 'Content-Length' HTTP header field - AZStd::string m_contentType; // Use for the 'Content-Type' HTTP header field - }; - - public: - AZ_CLASS_ALLOCATOR(MultipartFormData, AZ::SystemAllocator, 0); - - /// Add a field/value pair to the form - void AddField(AZStd::string name, AZStd::string value); - - /// Add a file's contents to the form - void AddFile(AZStd::string fieldName, AZStd::string fileName, const char* path); - void AddFileBytes(AZStd::string fieldName, AZStd::string fileName, const void* bytes, size_t length); - - /// Set a custom boundary delimiter to use in the form. This is optional; a random one will be generated normally. - void SetCustomBoundary(AZStd::string boundary); - - /// Compose the form's contents and returns those contents along with metadata. - ComposeResult ComposeForm(); - - private: - struct Field - { - AZStd::string m_fieldName; - AZStd::string m_value; - }; - - struct FileField - { - AZStd::string m_fieldName; - AZStd::string m_fileName; - AZStd::vector m_fileData; - }; - - using Fields = AZStd::vector; - using FileFields = AZStd::vector; - - private: - void Prepare(); - size_t EstimateBodySize() const; - - private: - AZStd::string m_boundary; - AZStd::string m_separator; - AZStd::string m_composedBody; - Fields m_fields; - FileFields m_fileFields; - }; - -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp b/Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp deleted file mode 100644 index 47059ac156..0000000000 --- a/Gems/AWSCore/Code/Source/Framework/MultipartFormData.cpp +++ /dev/null @@ -1,123 +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 - -namespace AWSCore -{ - namespace Detail - { - namespace - { - const char FIELD_HEADER_FMT[] = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n"; - const char FILE_HEADER_FMT[] = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\n\r\n"; - const char FOOTER_FMT[] = "--%s--\r\n"; - const char ENTRY_SEPARATOR[] = "\r\n"; - } - } - - void MultipartFormData::AddField(AZStd::string name, AZStd::string value) - { - m_fields.emplace_back(Field{ std::move(name), std::move(value) }); - } - - void MultipartFormData::AddFile(AZStd::string fieldName, AZStd::string fileName, const char* path) - { - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetDirectInstance(); - - AZ::IO::HandleType fileHandle; - - if (fileIO->Open(path, AZ::IO::OpenMode::ModeRead | AZ::IO::OpenMode::ModeBinary, fileHandle)) { - m_fileFields.emplace_back(FileField{ std::move(fieldName), std::move(fileName) , AZStd::vector{} }); - auto destFileBuffer = &m_fileFields.back().m_fileData; - AZ::u64 size; - if (fileIO->Size(path, size) && size > 0) { - destFileBuffer->resize(size); - fileIO->Read(fileHandle, &destFileBuffer->at(0), destFileBuffer->size()); - } - } - fileIO->Close(fileHandle); - } - - void MultipartFormData::AddFileBytes(AZStd::string fieldName, AZStd::string fileName, const void* bytes, size_t length) - { - m_fileFields.emplace_back(FileField{ std::move(fieldName), std::move(fileName) , AZStd::vector{} }); - m_fileFields.back().m_fileData.reserve(length); - m_fileFields.back().m_fileData.assign(static_cast(bytes), static_cast(bytes) + length); - } - - void MultipartFormData::SetCustomBoundary(AZStd::string boundary) - { - m_boundary = boundary; - } - - void MultipartFormData::Prepare() - { - if (m_boundary.empty()) - { - char buffer[33]; - AZ::Uuid::CreateRandom().ToString(buffer, sizeof(buffer), false, false); - m_boundary = buffer; - } - } - - size_t MultipartFormData::EstimateBodySize() const - { - // Estimate the size of the final string as best we can to avoid unnecessary copies - const size_t boundarySize = m_boundary.length(); - const size_t individualFieldBaseSize = boundarySize + sizeof(Detail::FIELD_HEADER_FMT) + sizeof(Detail::ENTRY_SEPARATOR); - const size_t individualFileBaseSize = boundarySize + sizeof(Detail::FILE_HEADER_FMT) + sizeof(Detail::ENTRY_SEPARATOR); - size_t estimatedSize = sizeof(Detail::FOOTER_FMT) + boundarySize; - - for (const auto& field : m_fields) - { - estimatedSize += individualFieldBaseSize + field.m_fieldName.length() + field.m_value.length(); - } - - for (const auto& fileField : m_fileFields) - { - estimatedSize += individualFileBaseSize + fileField.m_fieldName.length() + fileField.m_fileName.length() + fileField.m_fileData.size(); - } - - return estimatedSize; - } - - MultipartFormData::ComposeResult MultipartFormData::ComposeForm() - { - ComposeResult result; - Prepare(); - - // Build the form body - result.m_content.reserve(EstimateBodySize()); - - for (const auto& field : m_fields) - { - result.m_content.append(AZStd::string::format(Detail::FIELD_HEADER_FMT, m_boundary.c_str(), field.m_fieldName.c_str())); - result.m_content.append(field.m_value); - result.m_content.append(Detail::ENTRY_SEPARATOR); - } - - for (const auto& fileField : m_fileFields) - { - result.m_content.append(AZStd::string::format(Detail::FILE_HEADER_FMT, m_boundary.c_str(), fileField.m_fieldName.c_str(), fileField.m_fileName.c_str())); - result.m_content.append(fileField.m_fileData.begin(), fileField.m_fileData.end()); - result.m_content.append(Detail::ENTRY_SEPARATOR); - } - - result.m_content.append(AZStd::string::format(Detail::FOOTER_FMT, m_boundary.c_str())); - - // Populate the metadata - result.m_contentLength = AZStd::string::format("%zu", result.m_content.length()); - result.m_contentType = AZStd::string::format("multipart/form-data; boundary=%s", m_boundary.c_str()); - - return result; - } - - -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/awscore_files.cmake b/Gems/AWSCore/Code/awscore_files.cmake index 9abc162f8a..c59802119c 100644 --- a/Gems/AWSCore/Code/awscore_files.cmake +++ b/Gems/AWSCore/Code/awscore_files.cmake @@ -16,13 +16,10 @@ set(FILES Include/Framework/AWSApiRequestJob.h Include/Framework/AWSApiRequestJobConfig.h Include/Framework/Error.h - Include/Framework/HttpClientComponent.h Include/Framework/HttpRequestJob.h Include/Framework/HttpRequestJobConfig.h - Include/Framework/JobExecuter.h Include/Framework/JsonObjectHandler.h Include/Framework/JsonWriter.h - Include/Framework/MultipartFormData.h Include/Framework/RequestBuilder.h Include/Framework/ServiceClientJob.h Include/Framework/ServiceClientJobConfig.h @@ -61,7 +58,6 @@ set(FILES Source/Framework/HttpRequestJob.cpp Source/Framework/HttpRequestJobConfig.cpp Source/Framework/JsonObjectHandler.cpp - Source/Framework/MultipartFormData.cpp Source/Framework/RequestBuilder.cpp Source/Framework/ServiceJob.cpp Source/Framework/ServiceJobConfig.cpp From 4fe43c81cf3e5d4b4afd329f470b351d27e04bc4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:27:14 -0800 Subject: [PATCH 159/394] Removes ExporterFileProcessor from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommandSystem/Source/ActorCommands.cpp | 1 - .../Source/AnimGraphCommands.cpp | 1 - .../CommandSystem/Source/MotionCommands.cpp | 1 - .../Source/MotionSetCommands.cpp | 1 - .../Exporter/ExporterFileProcessor.cpp | 127 ------------------ .../Exporter/ExporterFileProcessor.h | 46 ------- .../ExporterLib/exporterlib_files.cmake | 2 - .../Behaviors/ActorGroupBehavior.cpp | 1 + .../SceneAPIExt/Groups/MotionGroup.cpp | 1 - .../Code/EMotionFX/Source/MotionManager.h | 1 + 10 files changed, 2 insertions(+), 180 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp index ef573ab40c..fc22a81726 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp index b1a830c838..69a7068f58 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp index 2bec066549..5da75006dd 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp index 34fee273c2..08d1e62528 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include namespace CommandSystem diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp deleted file mode 100644 index 1d6687f135..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp +++ /dev/null @@ -1,127 +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 the required headers -#include "ExporterFileProcessor.h" -#include "Exporter.h" -#include -#include -#include - - -namespace ExporterLib -{ -#define PREPARE_DISKFILE_SAVE(EXTENSION) \ - AZ::Debug::Timer saveTimer; \ - saveTimer.Stamp(); \ - if (filenameWithoutExtension.empty()) \ - { \ - MCore::LogError("Cannot save file. Empty FileName."); \ - return false; \ - } \ - AZStd::string extension; \ - AzFramework::StringFunc::Path::GetExtension(filenameWithoutExtension.c_str(), extension); \ - if (!extension.empty()) \ - { \ - AzFramework::StringFunc::Replace(filenameWithoutExtension, extension.c_str(), EXTENSION(), true, false, true); \ - } \ - else \ - { \ - filenameWithoutExtension += EXTENSION(); \ - } \ - \ - MCore::MemoryFile memoryFile; \ - memoryFile.Open(); \ - - -#define FINISH_DISKFILE_SAVE \ - bool result = memoryFile.SaveToDiskFile(filenameWithoutExtension.c_str()); \ - const float saveTime = saveTimer.GetDeltaTimeInSeconds() * 1000.0f; \ - MCore::LogInfo("Saved file '%s' in %.2f ms.", filenameWithoutExtension.c_str(), saveTime); \ - return result; - - - // constructor - Exporter::Exporter() - : EMotionFX::BaseObject() - { - } - - - // destructor - Exporter::~Exporter() - { - } - - - // create the exporter - Exporter* Exporter::Create() - { - return new Exporter(); - } - - - void Exporter::Delete() - { - delete this; - } - - - // make the memory file ready for saving - void Exporter::ResetMemoryFile(MCore::MemoryFile* file) - { - // make sure the file is valid - MCORE_ASSERT(file); - - // reset the incoming memory file - file->Close(); - file->Open(); - file->SetPreAllocSize(262144); // 256kB - file->Seek(0); - } - - - // actor - bool Exporter::SaveActor(MCore::MemoryFile* file, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType) - { - ResetMemoryFile(file); - ExporterLib::SaveActor(file, actor, targetEndianType); - return true; - } - - - bool Exporter::SaveActor(AZStd::string filenameWithoutExtension, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType) - { - PREPARE_DISKFILE_SAVE(GetActorExtension); - if (SaveActor(&memoryFile, actor, targetEndianType) == false) - { - return false; - } - FINISH_DISKFILE_SAVE - } - - - // skeletal motion - bool Exporter::SaveMotion(MCore::MemoryFile* file, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType) - { - ResetMemoryFile(file); - ExporterLib::SaveMotion(file, motion, targetEndianType); - return true; - } - - - bool Exporter::SaveMotion(AZStd::string filenameWithoutExtension, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType) - { - PREPARE_DISKFILE_SAVE(GetMotionExtension); - if (SaveMotion(&memoryFile, motion, targetEndianType) == false) - { - return false; - } - FINISH_DISKFILE_SAVE - } -} // namespace ExporterLib diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h deleted file mode 100644 index db1c6d4f3c..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h +++ /dev/null @@ -1,46 +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 -#include -#include -#include -#include -#include - - -namespace ExporterLib -{ - class Exporter - : public EMotionFX::BaseObject - { - MCORE_MEMORYOBJECTCATEGORY(Exporter, EMFX_DEFAULT_ALIGNMENT, EMotionFX::EMFX_MEMCATEGORY_FILEPROCESSORS); - - public: - static Exporter* Create(); - - // actor - bool SaveActor(MCore::MemoryFile* file, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType); - bool SaveActor(AZStd::string filenameWithoutExtension, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType); - - // motion - bool SaveMotion(MCore::MemoryFile* file, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType); - bool SaveMotion(AZStd::string filenameWithoutExtension, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType); - - private: - void ResetMemoryFile(MCore::MemoryFile* file); - - Exporter(); - virtual ~Exporter(); - - void Delete() override; - }; -} // namespace ExporterLib diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake index 8837238e3c..63e65fa1e2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake @@ -10,8 +10,6 @@ set(FILES Exporter/EndianConversion.cpp Exporter/Exporter.h Exporter/ExporterActor.cpp - Exporter/ExporterFileProcessor.cpp - Exporter/ExporterFileProcessor.h Exporter/FileHeaderExport.cpp Exporter/MorphTargetExport.cpp Exporter/MotionEventExport.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp index d89e41f1a6..36173a2d2c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp index e033d7ebb0..226a760292 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h index 24c8c784f3..aa2c83aebe 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace EMotionFX { From 83879a0c53eb7e7049e45a320be0870b9736b5eb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:33:12 -0800 Subject: [PATCH 160/394] Removes Light.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Rendering/OpenGL2/Source/Light.h | 31 ------------------- .../EMotionFX/Rendering/rendering_files.cmake | 1 - 2 files changed, 32 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.h deleted file mode 100644 index 7fa9fa25ba..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Light.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 "RenderGLConfig.h" -#include -#include - -namespace RenderGL -{ - struct RENDERGL_API Light - { - Light() - : m_dir(-1.0f, 0.0f, -1.0f) - , m_diffuse(1.0f, 1.0f, 1.0f, 1.0f) - , m_specular(1.0f, 1.0f, 1.0f, 1.0f) - , m_ambient(0.0f, 0.0f, 0.0f, 0.0f) - {} - - AZ::Vector3 m_dir; - AZ::Color m_diffuse; - AZ::Color m_specular; - AZ::Color m_ambient; - }; -} diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake index b0a5376290..a53f329d66 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/rendering_files.cmake @@ -42,7 +42,6 @@ set(FILES OpenGL2/Source/GraphicsManager.h OpenGL2/Source/IndexBuffer.cpp OpenGL2/Source/IndexBuffer.h - OpenGL2/Source/Light.h OpenGL2/Source/Material.cpp OpenGL2/Source/Material.h OpenGL2/Source/PostProcessShader.cpp From f768bb23c2d5524a884144221a1d52342a421bcb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:45:22 -0800 Subject: [PATCH 161/394] Removes EMotionFX.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/EMotionFX/Source/EMotionFX.h | 141 ------------------ .../Code/EMotionFX/emotionfx_files.cmake | 1 - 2 files changed, 142 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h deleted file mode 100644 index b02c33b5df..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFX.h +++ /dev/null @@ -1,141 +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 - * - */ - -/* - NOTE: To minimize your compile times, please consider manually including only the required header files instead of using this main include. -*/ - -#pragma once - -#include "Actor.h" -#include "ActorInstance.h" -#include "ActorManager.h" -#include "ActorUpdateScheduler.h" -#include "Algorithms.h" -#include "Attachment.h" -#include "AttachmentSkin.h" -#include "AttachmentNode.h" -#include "BaseObject.h" -#include "AnimGraph.h" -#include "AnimGraphAttributeTypes.h" -#include "AnimGraphBindPoseNode.h" -#include "AnimGraphEntryNode.h" -#include "AnimGraphEventBuffer.h" -#include "AnimGraphExitNode.h" -#include "AnimGraphGameControllerSettings.h" -#include "AnimGraphInstance.h" -#include "AnimGraphManager.h" -#include "AnimGraphMotionCondition.h" -#include "AnimGraphMotionNode.h" -#include "AnimGraphNode.h" -#include "AnimGraphNodeData.h" -#include "AnimGraphNodeGroup.h" -#include "AnimGraphObject.h" -#include "AnimGraphObjectData.h" -#include "AnimGraphObjectFactory.h" -#include "AnimGraphParameterCondition.h" -#include "AnimGraphPlayTimeCondition.h" -#include "AnimGraphPose.h" -#include "AnimGraphPosePool.h" -#include "AnimGraphRefCountedData.h" -#include "AnimGraphRefCountedDataPool.h" -#include "AnimGraphStateCondition.h" -#include "AnimGraphStateMachine.h" -#include "AnimGraphStateTransition.h" -#include "AnimGraphSyncTrack.h" -#include "AnimGraphTimeCondition.h" -#include "AnimGraphTransitionCondition.h" -#include "AnimGraphVector2Condition.h" -#include "BlendSpace2DNode.h" -#include "BlendSpace1DNode.h" -#include "BlendTree.h" -#include "BlendTreeAccumTransformNode.h" -#include "BlendTreeBlend2Node.h" -#include "BlendTreeBlendNNode.h" -#include "BlendTreeBoolLogicNode.h" -#include "BlendTreeConnection.h" -#include "BlendTreeDirectionToWeightNode.h" -#include "BlendTreeFinalNode.h" -#include "BlendTreeFloatConditionNode.h" -#include "BlendTreeFloatMath1Node.h" -#include "BlendTreeFloatMath2Node.h" -#include "BlendTreeFloatSwitchNode.h" -#include "BlendTreeLookAtNode.h" -#include "BlendTreeMaskNode.h" -#include "BlendTreeMirrorPoseNode.h" -#include "BlendTreeMotionFrameNode.h" -#include "BlendTreeParameterNode.h" -#include "BlendTreePoseSwitchNode.h" -#include "BlendTreeRangeRemapperNode.h" -#include "BlendTreeSmoothingNode.h" -#include "BlendTreeTransformNode.h" -#include "BlendTreeTwoLinkIKNode.h" -#include "BlendTreeVector2ComposeNode.h" -#include "BlendTreeVector2DecomposeNode.h" -#include "BlendTreeVector3ComposeNode.h" -#include "BlendTreeVector3DecomposeNode.h" -#include "BlendTreeVector3Math1Node.h" -#include "BlendTreeVector3Math2Node.h" -#include "BlendTreeVector4ComposeNode.h" -#include "BlendTreeVector4DecomposeNode.h" -#include "CompressedKeyFrames.h" -#include "DualQuatSkinDeformer.h" -#include "EMotionFX.h" -#include "EMotionFXConfig.h" -#include "EMotionFXManager.h" -#include "EventHandler.h" -#include "EventInfo.h" -#include "EventManager.h" -#include "KeyFrame.h" -#include "KeyFrameFinder.h" -#include "KeyTrackLinearDynamic.h" -#include "LayerPass.h" -#include "Material.h" -#include "MemoryCategories.h" -#include "Mesh.h" -#include "MeshDeformer.h" -#include "MeshDeformerStack.h" -#include "MorphMeshDeformer.h" -#include "MorphSetup.h" -#include "MorphSetupInstance.h" -#include "MorphTarget.h" -#include "MorphTargetStandard.h" -#include "Motion.h" -#include "MotionEvent.h" -#include "MotionEventTable.h" -#include "MotionEventTrack.h" -#include "MotionInstance.h" -#include "MotionInstancePool.h" -#include "MotionLayerSystem.h" -#include "MotionManager.h" -#include "MotionQueue.h" -#include "MotionSet.h" -#include "MotionSystem.h" -#include "MultiThreadScheduler.h" -#include "Node.h" -#include "NodeAttribute.h" -#include "NodeGroup.h" -#include "NodeMap.h" -#include "PlayBackInfo.h" -#include "Pose.h" -#include "Recorder.h" -#include "RepositioningLayerPass.h" -#include "SingleThreadScheduler.h" -#include "Skeleton.h" -#include "SkinningInfoVertexAttributeLayer.h" -#include "SoftSkinDeformer.h" -#include "SoftSkinManager.h" -#include "StandardMaterial.h" -#include "SubMesh.h" -#include "ThreadData.h" -#include "Transform.h" -#include "TransformData.h" -#include "VertexAttributeLayer.h" -#include "VertexAttributeLayerAbstractData.h" -#include "Importer/ChunkProcessors.h" -#include "Importer/Importer.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake index 52c9d6aa15..6e8082e631 100644 --- a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake @@ -36,7 +36,6 @@ set(FILES Source/DebugDraw.cpp Source/DualQuatSkinDeformer.cpp Source/DualQuatSkinDeformer.h - Source/EMotionFX.h Source/EMotionFXConfig.h Source/EMotionFXManager.cpp Source/EMotionFXManager.h From d934967caf7ac9e8d0d9726555b9bb4feaa4badd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:48:20 -0800 Subject: [PATCH 162/394] Removes MeshBuilderInvalidIndex.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/MeshBuilderInvalidIndex.h | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h b/Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h deleted file mode 100644 index b94f46a3e7..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Source/MeshBuilderInvalidIndex.h +++ /dev/null @@ -1,19 +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 - -namespace AZ::MeshBuilder -{ - template - inline static constexpr IndexType InvalidIndexT = static_cast(-1); - - inline static constexpr size_t InvalidIndex = InvalidIndexT; -} // namespace AZ::MeshBuilder From 4ec93b2e2396060ad8b027b340d2419ff4d31b4e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:54:10 -0800 Subject: [PATCH 163/394] Removes EMStudioCore.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EMStudioSDK/Source/Commands.cpp | 1 + .../EMStudioSDK/Source/EMStudioCore.h | 17 ----------------- .../Source/RenderPlugin/CommandCallbacks.cpp | 1 - .../RenderPlugin/RenderUpdateCallback.cpp | 1 - .../Source/RenderPlugin/RenderViewWidget.cpp | 1 - .../EMStudioSDK/emstudiosdk_files.cmake | 1 - .../Source/OpenGLRender/GLWidget.cpp | 1 - .../Source/OpenGLRender/OpenGLRenderPlugin.cpp | 1 - .../MorphTargetsWindowPlugin.cpp | 1 - .../MotionSetManagementWindow.cpp | 1 - .../Source/MotionSetsWindow/MotionSetWindow.cpp | 1 - .../MotionSetsWindow/MotionSetsWindowPlugin.cpp | 1 - .../Source/NodeGroups/NodeGroupsPlugin.cpp | 1 - 13 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp index e2e2224c67..0d177ad82c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Commands.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h deleted file mode 100644 index 2899ebc33a..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h +++ /dev/null @@ -1,17 +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 all headers -#include "EMStudioConfig.h" -#include "EMStudioManager.h" -//#include "MainWindow.h" -#include "PluginManager.h" -#include "EMStudioPlugin.h" -#include "LayoutManager.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp index 90d748a9d3..a04e2a87c8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp @@ -8,7 +8,6 @@ // include the required headers #include "RenderPlugin.h" -#include "../EMStudioCore.h" #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp index 5cc88db0b0..49bb5509b6 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp @@ -9,7 +9,6 @@ // include the required headers #include "RenderUpdateCallback.h" #include "RenderPlugin.h" -#include "../EMStudioCore.h" #include #include #include "RenderWidget.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp index fe8fb61f02..f729e2e323 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp @@ -8,7 +8,6 @@ #include "RenderViewWidget.h" #include "RenderPlugin.h" -#include "../EMStudioCore.h" #include "../PreferencesWindow.h" #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake index 073d7c1bdb..22c7223d57 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake @@ -14,7 +14,6 @@ set(FILES Source/DockWidgetPlugin.cpp Source/DockWidgetPlugin.h Source/EMStudioConfig.h - Source/EMStudioCore.h Source/EMStudioManager.cpp Source/EMStudioManager.h Source/EMStudioPlugin.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp index be9d704727..c6cab07a44 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp @@ -12,7 +12,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp index 5626e482eb..7943420a09 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp @@ -8,7 +8,6 @@ #include "OpenGLRenderPlugin.h" #include "GLWidget.h" -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include "../../../../EMStudioSDK/Source/MainWindow.h" #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderViewWidget.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp index 1ceeb155fa..67e1bd9ad0 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/MorphTargetsWindowPlugin.cpp @@ -10,7 +10,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp index ca62d6d927..80c35f2a01 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp @@ -10,7 +10,6 @@ #include "AzCore/std/iterator.h" #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp index 3a4c2628b3..20e3dd402b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp @@ -28,7 +28,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include "../../../../EMStudioSDK/Source/EMStudioManager.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp index cf23c2e79e..6429af8970 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetsWindowPlugin.cpp @@ -18,7 +18,6 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include "../../../../EMStudioSDK/Source/MainWindow.h" #include "../../../../EMStudioSDK/Source/SaveChangedFilesManager.h" #include "../../../../EMStudioSDK/Source/FileManager.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp index 3fe5c589a7..17fb621725 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupsPlugin.cpp @@ -8,7 +8,6 @@ // include required headers #include "NodeGroupsPlugin.h" -#include "../../../../EMStudioSDK/Source/EMStudioCore.h" #include #include #include From c5986d50745fe596ea860613129bfe6eefd2295f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:21:07 -0800 Subject: [PATCH 164/394] Removes unused plugin files from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../EMStudioSDK/Source/EMStudioPlugin.cpp | 16 ------- .../EMStudioSDK/Source/EMStudioPlugin.h | 1 - .../EMStudioSDK/Source/InvisiblePlugin.cpp | 27 ------------ .../EMStudioSDK/Source/InvisiblePlugin.h | 42 ------------------- .../EMStudioSDK/Source/PluginOptions.cpp | 14 ------- .../Source/RenderPlugin/RenderViewWidget.cpp | 3 +- .../EMStudioSDK/emstudiosdk_files.cmake | 4 -- .../Source/OpenGLRender/OpenGLRenderPlugin.h | 1 + .../RenderPlugins/Source/RegisterPlugins.cpp | 30 ------------- 9 files changed, 3 insertions(+), 135 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp index 05ed5f24d7..e69de29bb2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp @@ -1,16 +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 the required headers -#include "EMStudioPlugin.h" - -namespace EMStudio -{ -} // namespace EMStudio - -#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h index f1cabccc31..2dc86ba01b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h @@ -42,7 +42,6 @@ namespace EMStudio class EMSTUDIO_API EMStudioPlugin : public QObject { - Q_OBJECT MCORE_MEMORYOBJECTCATEGORY(EMStudioPlugin, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_EMSTUDIOSDK) public: diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp deleted file mode 100644 index 202eadb826..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.cpp +++ /dev/null @@ -1,27 +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 required headers -#include "InvisiblePlugin.h" - -namespace EMStudio -{ - // constructor - InvisiblePlugin::InvisiblePlugin() - : EMStudioPlugin() - { - } - - - // destructor - InvisiblePlugin::~InvisiblePlugin() - { - } -} // namespace EMStudio - -#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h deleted file mode 100644 index 127705867a..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h +++ /dev/null @@ -1,42 +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 MCore -#if !defined(Q_MOC_RUN) -#include -#include "EMStudioConfig.h" -#include "EMStudioPlugin.h" -#endif - - -namespace EMStudio -{ - /** - * - * - */ - class EMSTUDIO_API InvisiblePlugin - : public EMStudioPlugin - { - Q_OBJECT - MCORE_MEMORYOBJECTCATEGORY(InvisiblePlugin, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_EMSTUDIOSDK) - public: - InvisiblePlugin(); - virtual ~InvisiblePlugin(); - - EMStudioPlugin::EPluginType GetPluginType() const override { return EMStudioPlugin::PLUGINTYPE_INVISIBLE; } - - bool Init() override { return true; } // for this type of plugin, perform the init inside the constructor - bool GetHasWindowWithObjectName(const AZStd::string& objectName) override { MCORE_UNUSED(objectName); return false; } - QString GetObjectName() const override { return objectName(); } - void SetObjectName(const QString& objectName) override { setObjectName(objectName); } - void CreateBaseInterface(const char* objectName) override { MCORE_UNUSED(objectName); } - }; -} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp deleted file mode 100644 index 02af548668..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginOptions.cpp +++ /dev/null @@ -1,14 +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 "PluginOptions.h" - -namespace EMotionFX -{ - -} diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp index f729e2e323..fba20c5bfd 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp @@ -14,9 +14,10 @@ #include #include #include +#include #include - +#include namespace EMStudio { diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake index 22c7223d57..962f2b8b83 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake @@ -16,14 +16,11 @@ set(FILES Source/EMStudioConfig.h Source/EMStudioManager.cpp Source/EMStudioManager.h - Source/EMStudioPlugin.cpp Source/EMStudioPlugin.h Source/FileManager.cpp Source/FileManager.h Source/GUIOptions.cpp Source/GUIOptions.h - Source/InvisiblePlugin.cpp - Source/InvisiblePlugin.h Source/KeyboardShortcutsWindow.cpp Source/KeyboardShortcutsWindow.h Source/LayoutManager.cpp @@ -35,7 +32,6 @@ set(FILES Source/MotionEventPresetManager.h Source/PluginManager.cpp Source/PluginManager.h - Source/PluginOptions.cpp Source/PluginOptions.h Source/PluginOptionsBus.h Source/PreferencesWindow.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h index ba2bb0f462..a0e7d1e3b4 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.h @@ -17,6 +17,7 @@ #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderWidget.h" #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderLayouts.h" #include "../../../../EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.h" +#include #include "GLWidget.h" #endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp deleted file mode 100644 index f6bde013fb..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RegisterPlugins.cpp +++ /dev/null @@ -1,30 +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 the EMotion Studio SDK -#include "RenderPluginsConfig.h" -#include "../../../EMStudioSDK/Source/EMStudioConfig.h" -#include "../../../EMStudioSDK/Source/EMStudioManager.h" -#include "../../../EMStudioSDK/Source/PluginManager.h" - -// include the plugin interfaces -#include "OpenGLRender/OpenGLRenderPlugin.h" - -extern "C" -{ -// the main register function which is executed when loading the plugin library -// we register our plugins to the plugin manager here -RENDERPLUGINS_API void MCORE_CDECL RegisterPlugins() -{ - // get the plugin manager - EMStudio::PluginManager* pluginManager = EMStudio::GetPluginManager(); - - // register the plugins - pluginManager->RegisterPlugin(new EMStudio::OpenGLRenderPlugin()); -} -} From a857ad53b6da2170174be2f38ff71772eda78acf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:26:58 -0800 Subject: [PATCH 165/394] Removes AnimGraphNodeWidget.cpp from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/AnimGraph/AnimGraphNodeWidget.cpp | 11 ----------- .../Source/AnimGraph/AnimGraphNodeWidget.h | 2 -- .../StandardPlugins/standardplugins_files.cmake | 1 - 3 files changed, 14 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp deleted file mode 100644 index 3200325adc..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.cpp +++ /dev/null @@ -1,11 +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 diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h index d96dd35636..90ac968942 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphNodeWidget.h @@ -23,8 +23,6 @@ namespace EMStudio class AnimGraphNodeWidget : public QWidget { - Q_OBJECT - public: AnimGraphNodeWidget(QWidget* parent = nullptr) : QWidget(parent) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake index 65af4d50ee..05a636be0a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake @@ -52,7 +52,6 @@ set(FILES Source/AnimGraph/AnimGraphHierarchyWidget.cpp Source/AnimGraph/AnimGraphHierarchyWidget.h Source/AnimGraph/AnimGraphNodeWidget.h - Source/AnimGraph/AnimGraphNodeWidget.cpp Source/AnimGraph/AnimGraphOptions.cpp Source/AnimGraph/AnimGraphOptions.h Source/AnimGraph/AnimGraphPlugin.cpp From 87f32e0659895174d40d9ef7638748dd8f88c525 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:33:45 -0800 Subject: [PATCH 166/394] Removes DebugEventHandler from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/AnimGraph/AnimGraphPlugin.cpp | 1 - .../Source/AnimGraph/DebugEventHandler.cpp | 92 ------------------- .../Source/AnimGraph/DebugEventHandler.h | 46 ---------- .../standardplugins_files.cmake | 2 - 4 files changed, 141 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp index 4baec366f0..46ad92a910 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.cpp @@ -16,7 +16,6 @@ #include "AttributesWindow.h" #include "NodeGroupWindow.h" #include "BlendTreeVisualNode.h" -#include "DebugEventHandler.h" #include "StateGraphNode.h" #include "ParameterWindow.h" #include "GraphNodeFactory.h" diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp deleted file mode 100644 index e03392f6bc..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.cpp +++ /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 - * - */ - -// include the required headers -#include "DebugEventHandler.h" -#include - - -namespace EMStudio -{ - // constructor - AnimGraphInstanceDebugEventHandler::AnimGraphInstanceDebugEventHandler() - { - } - - - // destructor - AnimGraphInstanceDebugEventHandler::~AnimGraphInstanceDebugEventHandler() - { - } - - - void AnimGraphInstanceDebugEventHandler::OnStateEnter(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - MCore::LogError("Entered '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStateEntering(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - if (state == nullptr) - { - return; - } - - MCore::LogError("Entering '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStateExit(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - if (state == nullptr) - { - return; - } - - MCore::LogError("Exit '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStateEnd(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state) - { - MCORE_UNUSED(animGraphInstance); - if (state == nullptr) - { - return; - } - - MCore::LogError("End '%s'", state->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnStartTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition) - { - if (transition == nullptr) - { - return; - } - - MCore::LogError("Start transition from '%s' to '%s'", transition->GetSourceNode(animGraphInstance)->GetName(), transition->GetTargetNode()->GetName()); - } - - - void AnimGraphInstanceDebugEventHandler::OnEndTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition) - { - if (transition == nullptr) - { - return; - } - - MCore::LogError("End transition from '%s' to '%s'", transition->GetSourceNode(animGraphInstance)->GetName(), transition->GetTargetNode()->GetName()); - } -} // namespace EMStudio - diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h deleted file mode 100644 index 4786527f62..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h +++ /dev/null @@ -1,46 +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 MCore -#if !defined(Q_MOC_RUN) -#include "../StandardPluginsConfig.h" -#include -#include -#include -#include -#include -#include -#include "../StandardPluginsConfig.h" -#endif - - - - -namespace EMStudio -{ - class AnimGraphInstanceDebugEventHandler - : public EMotionFX::AnimGraphInstanceEventHandler - { - MCORE_MEMORYOBJECTCATEGORY(AnimGraphInstanceDebugEventHandler, MCore::MCORE_DEFAULT_ALIGNMENT, MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH) - - public: - AnimGraphInstanceDebugEventHandler(); - virtual ~AnimGraphInstanceDebugEventHandler(); - - void OnStateEnter(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStateEntering(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStateExit(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStateEnd(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphNode* state); - void OnStartTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition); - void OnEndTransition(EMotionFX::AnimGraphInstance* animGraphInstance, EMotionFX::AnimGraphStateTransition* transition); - - private: - }; -} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake index 05a636be0a..f74e20a6f2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake @@ -58,8 +58,6 @@ set(FILES Source/AnimGraph/AnimGraphPlugin.h Source/AnimGraph/AnimGraphPluginCallbacks.cpp Source/AnimGraph/ContextMenu.cpp - Source/AnimGraph/DebugEventHandler.cpp - Source/AnimGraph/DebugEventHandler.h Source/AnimGraph/GameController.cpp Source/AnimGraph/GameController.h Source/AnimGraph/GameControllerWindow.cpp From 6cefe610b82196976fd7b4dc38a028ceba461900 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:46:33 -0800 Subject: [PATCH 167/394] Removes GraphWidgetCallback from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/AnimGraph/GraphWidgetCallback.h | 37 ------------------- .../Source/AnimGraph/NodeGraphWidget.h | 4 -- 2 files changed, 41 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h deleted file mode 100644 index 2ce33f9011..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h +++ /dev/null @@ -1,37 +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 required headers -#include -#include "../StandardPluginsConfig.h" -#include - - -namespace EMStudio -{ - // forward declarations - class NodeGraphWidget; - - // the graph widget callback base class - class GraphWidgetCallback - { - MCORE_MEMORYOBJECTCATEGORY(GraphWidgetCallback, EMFX_DEFAULT_ALIGNMENT, MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH); - - public: - // constructor and destructor - GraphWidgetCallback(NodeGraphWidget* graphWidget) { m_graphWidget = graphWidget; } - virtual ~GraphWidgetCallback() {} - - virtual void DrawOverlay(QPainter& painter) = 0; - - protected: - NodeGraphWidget* m_graphWidget; - }; -} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h index f3bea6d5f9..b3282bfe7b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraphWidget.h @@ -27,7 +27,6 @@ namespace EMStudio // forward declarations class NodeGraph; class GraphNode; - class GraphWidgetCallback; class NodePort; class NodeConnection; class AnimGraphPlugin; @@ -53,8 +52,6 @@ namespace EMStudio void SetActiveGraph(NodeGraph* graph); NodeGraph* GetActiveGraph() const; - void SetCallback(GraphWidgetCallback* callback); - MCORE_INLINE GraphWidgetCallback* GetCallback() { return m_callback; } MCORE_INLINE const QPoint& GetMousePos() const { return m_mousePos; } MCORE_INLINE void SetMousePos(const QPoint& pos) { m_mousePos = pos; } MCORE_INLINE void SetShowFPS(bool showFPS) { m_showFps = showFPS; } @@ -138,7 +135,6 @@ namespace EMStudio int m_curHeight; GraphNode* m_moveNode; // the node we're moving NodeGraph* m_activeGraph = nullptr; - GraphWidgetCallback* m_callback; QFont m_font; QFontMetrics* m_fontMetrics; AZ::Debug::Timer m_renderTimer; From a5005deba7a4b299ef953c458532397abeba01a4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:57:36 -0800 Subject: [PATCH 168/394] Removes BoundingSphere from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/MCore/Source/BoundingSphere.cpp | 106 ------------------ .../Code/MCore/Source/BoundingSphere.h | 26 ----- Gems/EMotionFX/Code/MCore/mcore_files.cmake | 1 - 3 files changed, 133 deletions(-) delete mode 100644 Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp diff --git a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp b/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp deleted file mode 100644 index 376052563f..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.cpp +++ /dev/null @@ -1,106 +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 required headers -#include "BoundingSphere.h" -#include "AABB.h" - - -namespace MCore -{ - // encapsulate a point in the sphere - void BoundingSphere::Encapsulate(const AZ::Vector3& v) - { - // calculate the squared distance from the center to the point - const AZ::Vector3 diff = v - m_center; - const float dist = diff.Dot(diff); - - // if the current sphere doesn't contain the point, grow the sphere so that it contains the point - if (dist > m_radiusSq) - { - const AZ::Vector3 diff2 = diff.GetNormalized() * m_radius; - const AZ::Vector3 delta = 0.5f * (diff - diff2); - m_center += delta; - // TODO: KB- Was a 'safe' function, is there an AZ equivalent? - float length = delta.GetLengthSq(); - if (length >= FLT_EPSILON) - { - m_radius += sqrtf(length); - } - else - { - m_radius = 0.0f; - } - m_radiusSq = m_radius * m_radius; - } - } - - - // check if the sphere intersects with a given AABB - bool BoundingSphere::Intersects(const AABB& b) const - { - float distance = 0.0f; - - for (int32_t t = 0; t < 3; ++t) - { - const AZ::Vector3& minVec = b.GetMin(); - if (m_center.GetElement(t) < minVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - minVec.GetElement(t)) * (m_center.GetElement(t) - minVec.GetElement(t)); - if (distance > m_radiusSq) - { - return false; - } - } - else - { - const AZ::Vector3& maxVec = b.GetMax(); - if (m_center.GetElement(t) > maxVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - maxVec.GetElement(t)) * (m_center.GetElement(t) - maxVec.GetElement(t)); - if (distance > m_radiusSq) - { - return false; - } - } - } - } - - return true; - } - - - // check if the sphere completely contains a given AABB - bool BoundingSphere::Contains(const AABB& b) const - { - float distance = 0.0f; - for (int32_t t = 0; t < 3; ++t) - { - const AZ::Vector3& maxVec = b.GetMax(); - if (m_center.GetElement(t) < maxVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - maxVec.GetElement(t)) * (m_center.GetElement(t) - maxVec.GetElement(t)); - } - else - { - const AZ::Vector3& minVec = b.GetMin(); - if (m_center.GetElement(t) > minVec.GetElement(t)) - { - distance += (m_center.GetElement(t) - minVec.GetElement(t)) * (m_center.GetElement(t) - minVec.GetElement(t)); - } - } - - if (distance > m_radiusSq) - { - return false; - } - } - - return true; - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h b/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h index 1687f72799..ec63bb4b5d 100644 --- a/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h +++ b/Gems/EMotionFX/Code/MCore/Source/BoundingSphere.h @@ -108,32 +108,6 @@ namespace MCore */ MCORE_INLINE bool Intersects(const BoundingSphere& s) const { return ((m_center - s.m_center).GetLengthSq() <= (m_radiusSq + s.m_radiusSq)); } - /** - * Encapsulate a given 3D point with this sphere. - * Automatically adjust the center and radius of the sphere after 'adding' the given point to the sphere. - * Note that you should only use this method when the center of the bounding sphere isnt exactly known yet. - * This encapsulation method will adjust the center of the sphere as well. If the center of the sphere is known upfront and it is - * known upfront as well that this center point won't change, you should use the Encapsulate() method instead. - * @param v The vector representing the 3D point to use in the encapsulation. - */ - void Encapsulate(const AZ::Vector3& v); - - /** - * Checks if this sphere completely contains a given Axis Aligned Bounding Box (AABB). - * Note that the border of the sphere is counted as 'inside'. - * @param 'b' The box to perform the test with. - * @result Returns true when 'b' is COMPLETELY inside the spheres volume, otherwise false is returned. - */ - bool Contains(const AABB& b) const; - - /** - * Checks if a given Axis Aligned Bounding Box (AABB) intersects this sphere. - * Note that the border of the sphere is counted as inside. - * @param 'b' The box to perform the test with. - * @result Returns true when 'b' is completely or partially inside the volume of this sphere. - */ - bool Intersects(const AABB& b) const; - /** * Get the radius of the sphere. * @result Returns the radius of the sphere. diff --git a/Gems/EMotionFX/Code/MCore/mcore_files.cmake b/Gems/EMotionFX/Code/MCore/mcore_files.cmake index fd4eeb23c4..d33041eaf8 100644 --- a/Gems/EMotionFX/Code/MCore/mcore_files.cmake +++ b/Gems/EMotionFX/Code/MCore/mcore_files.cmake @@ -34,7 +34,6 @@ set(FILES Source/AttributeVector3.h Source/AttributeVector4.h Source/AzCoreConversions.h - Source/BoundingSphere.cpp Source/BoundingSphere.h Source/Color.cpp Source/Color.h From d28fc46a5397ed54b26fa62daee093f1f06b3ee5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:14:46 -0800 Subject: [PATCH 169/394] Removes Matrix4 from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp | 2730 ----------------- Gems/EMotionFX/Code/MCore/Source/Matrix4.h | 917 ------ Gems/EMotionFX/Code/MCore/Source/Matrix4.inl | 330 -- Gems/EMotionFX/Code/MCore/mcore_files.cmake | 3 - Gems/EMotionFX/Code/Tests/Matchers.h | 25 - .../Code/Tests/TransformUnitTests.cpp | 1 - 6 files changed, 4006 deletions(-) delete mode 100644 Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp delete mode 100644 Gems/EMotionFX/Code/MCore/Source/Matrix4.h delete mode 100644 Gems/EMotionFX/Code/MCore/Source/Matrix4.inl diff --git a/Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp b/Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp deleted file mode 100644 index f454df04ab..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/Matrix4.cpp +++ /dev/null @@ -1,2730 +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 required headers -#include "Matrix4.h" -#include -#include -#include - - -namespace MCore -{ - // set the matrix to identity - void Matrix::Identity() - { - TMAT(0, 0) = 1.0f; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 1.0f; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // calculate the matrix determinant - float Matrix::CalcDeterminant() const - { - return - TMAT(0, 0) * TMAT(1, 1) * TMAT(2, 2) + - TMAT(0, 1) * TMAT(1, 2) * TMAT(2, 0) + - TMAT(0, 2) * TMAT(1, 0) * TMAT(2, 1) - - TMAT(0, 2) * TMAT(1, 1) * TMAT(2, 0) - - TMAT(0, 1) * TMAT(1, 0) * TMAT(2, 2) - - TMAT(0, 0) * TMAT(1, 2) * TMAT(2, 1); - } - - - // add operator - Matrix Matrix::operator + (const Matrix& right) const - { - Matrix r; - for (uint32 i = 0; i < 4; ++i) - { - MMAT(r, i, 0) = TMAT(i, 0) + MMAT(right, i, 0); - MMAT(r, i, 1) = TMAT(i, 1) + MMAT(right, i, 1); - MMAT(r, i, 2) = TMAT(i, 2) + MMAT(right, i, 2); - MMAT(r, i, 3) = TMAT(i, 3) + MMAT(right, i, 3); - } - return r; - } - - - // subtract operator - Matrix Matrix::operator - (const Matrix& right) const - { - Matrix r; - for (uint32 i = 0; i < 4; ++i) - { - MMAT(r, i, 0) = TMAT(i, 0) - MMAT(right, i, 0); - MMAT(r, i, 1) = TMAT(i, 1) - MMAT(right, i, 1); - MMAT(r, i, 2) = TMAT(i, 2) - MMAT(right, i, 2); - MMAT(r, i, 3) = TMAT(i, 3) - MMAT(right, i, 3); - } - return r; - } - - - - Matrix Matrix::operator * (const Matrix& right) const - { - Matrix r; - - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = r.m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - for (uint32 i = 0; i < 4; ++i) - { - MMAT(r, i, 0) = TMAT(i, 0) * MMAT(right, 0, 0) + TMAT(i, 1) * MMAT(right, 1, 0) + TMAT(i, 2) * MMAT(right, 2, 0) + TMAT(i, 3) * MMAT(right, 3, 0); - MMAT(r, i, 1) = TMAT(i, 0) * MMAT(right, 0, 1) + TMAT(i, 1) * MMAT(right, 1, 1) + TMAT(i, 2) * MMAT(right, 2, 1) + TMAT(i, 3) * MMAT(right, 3, 1); - MMAT(r, i, 2) = TMAT(i, 0) * MMAT(right, 0, 2) + TMAT(i, 1) * MMAT(right, 1, 2) + TMAT(i, 2) * MMAT(right, 2, 2) + TMAT(i, 3) * MMAT(right, 3, 2); - MMAT(r, i, 3) = TMAT(i, 0) * MMAT(right, 0, 3) + TMAT(i, 1) * MMAT(right, 1, 3) + TMAT(i, 2) * MMAT(right, 2, 3) + TMAT(i, 3) * MMAT(right, 3, 3); - } - #endif - - return r; - } - - - - Matrix& Matrix::operator += (const Matrix& right) - { - for (uint32 i = 0; i < 4; ++i) - { - TMAT(i, 0) += MMAT(right, i, 0); - TMAT(i, 1) += MMAT(right, i, 1); - TMAT(i, 2) += MMAT(right, i, 2); - TMAT(i, 3) += MMAT(right, i, 3); - } - return *this; - } - - - Matrix Matrix::operator * (float value) const - { - Matrix result(*this); - for (uint32 i = 0; i < 4; ++i) - { - MMAT(result, i, 0) *= value; - MMAT(result, i, 1) *= value; - MMAT(result, i, 2) *= value; - MMAT(result, i, 3) *= value; - } - return result; - } - - - Matrix& Matrix::operator -= (const Matrix& right) - { - for (uint32 i = 0; i < 4; ++i) - { - TMAT(i, 0) -= MMAT(right, i, 0); - TMAT(i, 1) -= MMAT(right, i, 1); - TMAT(i, 2) -= MMAT(right, i, 2); - TMAT(i, 3) -= MMAT(right, i, 3); - } - return *this; - } - - - - Matrix& Matrix::operator *= (const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[4]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - v[3] = TMAT(i, 3); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0) + v[3] * MMAT(right, 3, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1) + v[3] * MMAT(right, 3, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2) + v[3] * MMAT(right, 3, 2); - TMAT(i, 3) = v[0] * MMAT(right, 0, 3) + v[1] * MMAT(right, 1, 3) + v[2] * MMAT(right, 2, 3) + v[3] * MMAT(right, 3, 3); - } - #endif - - return *this; - } - - - - // calculate euler angles - AZ::Vector3 Matrix::CalcEulerAngles() const - { - AZ::Vector3 v; - /* - // Version with smooth transitions to poles, but slow - float SignCosY = 1; - float NearPole = Math::Pow(Math::Abs(m44[2][0]), 12); - v.y = Math::ASin( -m44[2][0] ); - v.z = Math::ATan( m44[1][0] / m44[0][0] ); - if( Math::Abs(v.y) < Math::Abs(v.z) ) - { - SignCosY = Math::SignOfCos(v.y); - v.z = Math::ATan2( SignCosY * m44[1][0], SignCosY * m44[0][0] ); - } - else - { - v.y = Math::ATan2( -m44[2][0], Math::Sqrt( m44[0][0]*m44[0][0] + m44[1][0]*m44[1][0] ) - * Math::SignOfFloat(Math::SignOfCos(v.z) * m44[0][0])); - SignCosY = Math::SignOfCos(v.y); - } - v.x = (1 - NearPole) * Math::ATan2( SignCosY * m44[2][1], SignCosY * m44[2][2] ) - + NearPole * 0.5 * Math::ATan2(-m44[1][2], m44[1][1]); - v.y = (1 - NearPole) * v.y + NearPole * Math::ATan2(-m44[2][0], m44[0][0]); - v.z = (1 - NearPole) * v.z - NearPole * Math::SignOfSin(v.y) * 0.5 * Math::ATan2(-m44[1][2], m44[1][1]); - */ - - if (Math::Abs(TMAT(2, 0)) < 0.9f) - { - float SignCosY = 1.0f; - v.SetY(Math::ASin(-TMAT(2, 0))); - v.SetZ(Math::ATan(TMAT(1, 0) / TMAT(0, 0))); - if (Math::Abs(v.GetY()) < Math::Abs(v.GetZ())) - { - SignCosY = Math::SignOfCos(v.GetY()); - v.SetZ(Math::ATan2(SignCosY * TMAT(1, 0), SignCosY * TMAT(0, 0))); - } - else - { - v.SetY(Math::ATan2(-TMAT(2, 0), Math::Sqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0)) * Math::SignOfFloat(Math::SignOfCos(v.GetZ()) * TMAT(0, 0)))); - SignCosY = Math::SignOfCos(v.GetY()); - } - v.SetX(Math::ATan2(SignCosY * m44[2][1], SignCosY * TMAT(2, 2))); - } - else - { - v.SetZ(0.5f * Math::ATan2(-TMAT(1, 2), TMAT(1, 1))); - v.SetY(Math::ATan2(-TMAT(2, 0), TMAT(0, 0))); - v.SetX(-Math::SignOfSin(v.GetY()) * v.GetZ()); - } - - v.SetY(-v.GetY()); - v.SetZ(-v.GetZ()); - - // get the angles in the range [-pi, pi] - v.SetX(v.GetX() + Math::twoPi * Math::Floor((-v.GetX()) / Math::twoPi + 0.5f)); - v.SetY(v.GetY() + Math::twoPi * Math::Floor((-v.GetY()) / Math::twoPi + 0.5f)); - v.SetZ(v.GetZ() + Math::twoPi * Math::Floor((-v.GetZ()) / Math::twoPi + 0.5f)); - - return v; - } - - - - - /* - void Matrix::SetRotationMatrixEulerXYZ(const Vector3& v) - { - const float sy = Math::Sin(v.x); - const float cy = Math::Cos(v.x); - const float sp = Math::Sin(v.y); - const float cp = Math::Cos(v.y); - const float sr = Math::Sin(v.z); - const float cr = Math::Cos(v.z); - const float spsy = sp * sy; - const float spcy = sp * cy; - - m44[0][0] = cr * cp; - m44[0][1] = sr * cp; - m44[0][2] = -sp; - m44[0][3] = 0; - m44[1][0] = cr * spsy - sr * cy; - m44[1][1] = sr * spsy + cr * cy; - m44[1][2] = cp * sy; - m44[1][3] = 0; - m44[2][0] = cr * spcy + sr * sy; - m44[2][1] = sr * spcy - cr * sy; - m44[2][2] = cp * cy; - m44[2][3] = 0; - m44[3][0] = 0; - m44[3][1] = 0; - m44[3][2] = 0; - m44[3][3] = 1; - } - */ - - - // setup as scale matrix - void Matrix::SetScaleMatrix(const AZ::Vector3& s) - { - TMAT(0, 0) = s.GetX(); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = s.GetY(); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = s.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // setup as translation matrix - void Matrix::SetTranslationMatrix(const AZ::Vector3& t) - { - TMAT(0, 0) = 1.0f; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 1.0f; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = t.GetX(); - TMAT(3, 1) = t.GetY(); - TMAT(3, 2) = t.GetZ(); - TMAT(3, 3) = 1.0f; - } - - - // setup as rotation matrix - void Matrix::SetRotationMatrixX(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - TMAT(0, 0) = 1.0f; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = c; - TMAT(1, 2) = s; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = -s; - TMAT(2, 2) = c; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // setup as rotation matrix - void Matrix::SetRotationMatrixY(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - TMAT(0, 0) = c; - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = -s; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 1.0f; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = s; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = c; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // setup as rotation matrix - void Matrix::SetRotationMatrixZ(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - TMAT(0, 0) = c; - TMAT(0, 1) = s; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = -s; - TMAT(1, 1) = c; - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - void Matrix::SetRotationMatrixEulerZYX(const AZ::Vector3& v) - { - *this = Matrix::RotationMatrixX(v.GetZ()); - this->MultMatrix4x3(Matrix::RotationMatrixY(v.GetY())); - this->MultMatrix4x3(Matrix::RotationMatrixZ(v.GetX())); - } - - - - void Matrix::SetRotationMatrixEulerXYZ(const AZ::Vector3& v) - { - *this = Matrix::RotationMatrixX(v.GetX()); - this->MultMatrix4x3(Matrix::RotationMatrixY(v.GetY())); - this->MultMatrix4x3(Matrix::RotationMatrixZ(v.GetZ())); - } - - - - void Matrix::SetRotationMatrixAxisAngle(const AZ::Vector3& axis, float angle) - { - const float length2 = axis.GetLengthSq(); - if (Math::Abs(length2) < 0.00001f) - { - Identity(); - return; - } - - const AZ::Vector3 n = axis / Math::Sqrt(length2); - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - const float k = 1.0f - c; - const float xx = n.GetX() * n.GetX() * k + c; - const float yy = n.GetY() * n.GetY() * k + c; - const float zz = n.GetZ() * n.GetZ() * k + c; - const float xy = n.GetX() * n.GetY() * k; - const float yz = n.GetY() * n.GetZ() * k; - const float zx = n.GetZ() * n.GetX() * k; - const float xs = n.GetX() * s; - const float ys = n.GetY() * s; - const float zs = n.GetZ() * s; - - TMAT(0, 0) = xx; - TMAT(0, 1) = xy + zs; - TMAT(0, 2) = zx - ys; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = xy - zs; - TMAT(1, 1) = yy; - TMAT(1, 2) = yz + xs; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = zx + ys; - TMAT(2, 1) = yz - xs; - TMAT(2, 2) = zz; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - void Matrix::Scale3x3(const AZ::Vector3& scale) - { - TMAT(0, 0) *= scale.GetX(); - TMAT(0, 1) *= scale.GetY(); - TMAT(0, 2) *= scale.GetZ(); - - TMAT(1, 0) *= scale.GetX(); - TMAT(1, 1) *= scale.GetY(); - TMAT(1, 2) *= scale.GetZ(); - - TMAT(2, 0) *= scale.GetX(); - TMAT(2, 1) *= scale.GetY(); - TMAT(2, 2) *= scale.GetZ(); - } - - - AZ::Vector3 Matrix::ExtractScale() - { - const AZ::Vector4 x = GetRow4D(0); - const AZ::Vector4 y = GetRow4D(1); - const AZ::Vector4 z = GetRow4D(2); - const float lengthX = x.GetLength(); - const float lengthY = y.GetLength(); - const float lengthZ = z.GetLength(); - SetRow(0, x / lengthX); - SetRow(1, y / lengthY); - SetRow(2, z / lengthZ); - - return AZ::Vector3(lengthX, lengthY, lengthZ); - } - - void Matrix::RotateX(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - for (uint32 i = 0; i < 3; ++i) - { - const float x = TMAT(2, i); - const float z = TMAT(1, i); - TMAT(2, i) = x * c - z * s; - TMAT(1, i) = x * s + z * c; - } - } - - - - void Matrix::RotateY(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - for (uint32 i = 0; i < 3; ++i) - { - const float x = TMAT(0, i); - const float z = TMAT(2, i); - TMAT(0, i) = x * c - z * s; - TMAT(2, i) = x * s + z * c; - } - } - - - - void Matrix::RotateZ(float angle) - { - const float s = Math::Sin(angle); - const float c = Math::Cos(angle); - - for (uint32 i = 0; i < 3; ++i) - { - const float x = TMAT(1, i); - const float z = TMAT(0, i); - TMAT(1, i) = x * c - z * s; - TMAT(0, i) = x * s + z * c; - } - } - - /* - void Matrix::RotateXYZ(const float yaw, const float pitch, const float roll) - { - const float sy = Math::Sin(yaw); - const float cy = Math::Cos(yaw); - const float sp = Math::Sin(pitch); - const float cp = Math::Cos(pitch); - const float sr = Math::Sin(roll); - const float cr = Math::Cos(roll); - const float spsy = sp * sy; - const float spcy = sp * cy; - const float m00 = cr * cp; - const float m01 = sr * cp; - const float m02 = -sp; - const float m10 = cr * spsy - sr * cy; - const float m11 = sr * spsy + cr * cy; - const float m12 = cp * sy; - const float m20 = cr * spcy + sr * sy; - const float m21 = sr * spcy - cr * sy; - const float m22 = cp * cy; - - for ( int32 i=0; i<4; i++ ) - { - const float x = m44[i][0]; - const float y = m44[i][1]; - const float z = m44[i][2]; - m44[i][0] = x * m00 + y * m10 + z * m20; - m44[i][1] = x * m01 + y * m11 + z * m21; - m44[i][2] = x * m02 + y * m12 + z * m22; - } - } - */ - - - void Matrix::MultMatrix(const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[4]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - v[3] = TMAT(i, 3); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0) + v[3] * MMAT(right, 3, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1) + v[3] * MMAT(right, 3, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2) + v[3] * MMAT(right, 3, 2); - TMAT(i, 3) = v[0] * MMAT(right, 0, 3) + v[1] * MMAT(right, 1, 3) + v[2] * MMAT(right, 2, 3) + v[3] * MMAT(right, 3, 3); - } - #endif - } - - - // init from position, rotation, scale and shear - // use this to reconstruct a matrix that has been decomposed using the DecomposeQRGramSchmidt method - void Matrix::InitFromPosRotScaleShear(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Vector3& shear) - { - // convert quat to matrix - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(0, 1) = +xy + zw + xy + zw; - TMAT(0, 2) = +xz - yw + xz - yw; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(1, 2) = +yz + xw + yz + xw; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = +xz + yw + xz + yw; - TMAT(2, 1) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(2, 3) = 0.0f; - - // scale - TMAT(0, 0) *= scale.GetX(); - TMAT(0, 1) *= scale.GetY(); - TMAT(0, 2) *= scale.GetZ(); - TMAT(1, 0) *= scale.GetX(); - TMAT(1, 1) *= scale.GetY(); - TMAT(1, 2) *= scale.GetZ(); - TMAT(2, 0) *= scale.GetX(); - TMAT(2, 1) *= scale.GetY(); - TMAT(2, 2) *= scale.GetZ(); - - // multiply with the shear matrix - float v[3]; - v[0] = TMAT(0, 0); - v[1] = TMAT(0, 1); - v[2] = TMAT(0, 2); - TMAT(0, 1) = v[0] * shear.GetX() + v[1]; - TMAT(0, 2) = v[0] * shear.GetY() + v[1] * shear.GetZ() + v[2]; - - v[0] = TMAT(1, 0); - v[1] = TMAT(1, 1); - v[2] = TMAT(1, 2); - TMAT(1, 1) = v[0] * shear.GetX() + v[1]; - TMAT(1, 2) = v[0] * shear.GetY() + v[1] * shear.GetZ() + v[2]; - - v[0] = TMAT(2, 0); - v[1] = TMAT(2, 1); - v[2] = TMAT(2, 2); - TMAT(2, 1) = v[0] * shear.GetX() + v[1]; - TMAT(2, 2) = v[0] * shear.GetY() + v[1] * shear.GetZ() + v[2]; - - // translation - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - } - - - // init from position, rotation, scale, scale rotation - // use this to reconstruct a matrix decomposed using the MatrixDecomposer class using polar decomposition - void Matrix::InitFromPosRotScaleScaleRot(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Quaternion& scaleRot) - { - float xx = scaleRot.GetX() * scaleRot.GetX(); - float xy = scaleRot.GetX() * scaleRot.GetY(), yy = scaleRot.GetY() * scaleRot.GetY(); - float xz = scaleRot.GetX() * scaleRot.GetZ(), yz = scaleRot.GetY() * scaleRot.GetZ(), zz = scaleRot.GetZ() * scaleRot.GetZ(); - float xw = scaleRot.GetX() * scaleRot.GetW(), yw = scaleRot.GetY() * scaleRot.GetW(), zw = scaleRot.GetZ() * scaleRot.GetW(), ww = scaleRot.GetW() * scaleRot.GetW(); - - // init on the inversed scale rotation - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(1, 0) = +xy + zw + xy + zw; - TMAT(2, 0) = +xz - yw + xz - yw; // translation part not initialized - TMAT(0, 1) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(2, 1) = +yz + xw + yz + xw; - TMAT(0, 2) = +xz + yw + xz + yw; - TMAT(1, 2) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 3) = 1.0f; - - // copy the 3x3 part into a temp buffer, so that we have the inverse scale rotation, before scaling applied to it - float r33[3][3]; - uint32 i; - for (i = 0; i < 3; ++i) - { -#ifdef MCORE_MATRIX_ROWMAJOR - r33[i][0] = TMAT(i, 0); - r33[i][1] = TMAT(i, 1); - r33[i][2] = TMAT(i, 2); -#else - r33[0][i] = TMAT(i, 0); - r33[1][i] = TMAT(i, 1); - r33[2][i] = TMAT(i, 2); -#endif - } - - // apply scaling - TMAT(0, 0) *= scale.GetX(); - TMAT(0, 1) *= scale.GetY(); - TMAT(0, 2) *= scale.GetZ(); - TMAT(1, 0) *= scale.GetX(); - TMAT(1, 1) *= scale.GetY(); - TMAT(1, 2) *= scale.GetZ(); - TMAT(2, 0) *= scale.GetX(); - TMAT(2, 1) *= scale.GetY(); - TMAT(2, 2) *= scale.GetZ(); - - // undo the scale rotation - float v[3]; - for (i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - -#ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; // transposed multiply - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; -#else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; // transposed multiply - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; -#endif - } - - // apply regular rotation - xx = rot.GetX() * rot.GetX(); - xy = rot.GetX() * rot.GetY(); - yy = rot.GetY() * rot.GetY(); - xz = rot.GetX() * rot.GetZ(); - yz = rot.GetY() * rot.GetZ(); - zz = rot.GetZ() * rot.GetZ(); - xw = rot.GetX() * rot.GetW(); - yw = rot.GetY() * rot.GetW(); - zw = rot.GetZ() * rot.GetW(); - ww = rot.GetW() * rot.GetW(); - -#ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx - yy - zz + ww; - r33[0][1] = +xy + zw + xy + zw; - r33[0][2] = +xz - yw + xz - yw; - r33[1][0] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[1][2] = +yz + xw + yz + xw; - r33[2][0] = +xz + yw + xz + yw; - r33[2][1] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; -#else - r33[0][0] = +xx - yy - zz + ww; - r33[1][0] = +xy + zw + xy + zw; - r33[2][0] = +xz - yw + xz - yw; - r33[0][1] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[2][1] = +yz + xw + yz + xw; - r33[0][2] = +xz + yw + xz + yw; - r33[1][2] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; -#endif - - // mult 3x3 matrix - for (i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - -#ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; -#else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; -#endif - } - - // apply translation - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - } - - - // init from pos/rot/scale - void Matrix::InitFromPosRotScale(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale) - { - // init on a scale + translation matrix - TMAT(0, 0) = scale.GetX(); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = scale.GetY(); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = scale.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - - // multiply it with a rotation matrix built from the AZ::Quaternion - // don't rotate the translation part - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - - float r33[3][3]; - #ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx - yy - zz + ww; - r33[0][1] = +xy + zw + xy + zw; - r33[0][2] = +xz - yw + xz - yw; - r33[1][0] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[1][2] = +yz + xw + yz + xw; - r33[2][0] = +xz + yw + xz + yw; - r33[2][1] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #else - r33[0][0] = +xx - yy - zz + ww; - r33[1][0] = +xy + zw + xy + zw; - r33[2][0] = +xz - yw + xz - yw; - r33[0][1] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[2][1] = +yz + xw + yz + xw; - r33[0][2] = +xz + yw + xz + yw; - r33[1][2] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #endif - - // perform the matrix mul - float v[3]; - for (uint32 i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; - #else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; - #endif - } - } - - - // init from pos/rot/scale with parent scale compensation - void Matrix::InitFromNoScaleInherit(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Vector3& invParentScale) - { - // init on a scale + translation matrix - TMAT(0, 0) = scale.GetX(); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = scale.GetY(); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = scale.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - - // multiply it with a rotation matrix built from the AZ::Quaternion - // don't rotate the translation part - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - - float r33[3][3]; - #ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx - yy - zz + ww; - r33[0][1] = +xy + zw + xy + zw; - r33[0][2] = +xz - yw + xz - yw; - r33[1][0] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[1][2] = +yz + xw + yz + xw; - r33[2][0] = +xz + yw + xz + yw; - r33[2][1] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #else - r33[0][0] = +xx - yy - zz + ww; - r33[1][0] = +xy + zw + xy + zw; - r33[2][0] = +xz - yw + xz - yw; - r33[0][1] = +xy - zw + xy - zw; - r33[1][1] = -xx + yy - zz + ww; - r33[2][1] = +yz + xw + yz + xw; - r33[0][2] = +xz + yw + xz + yw; - r33[1][2] = +yz - xw + yz - xw; - r33[2][2] = -xx - yy + zz + ww; - #endif - - // perform the matrix mul - float v[3]; - for (uint32 i = 0; i < 3; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[1][0] + v[2] * r33[2][0]; - TMAT(i, 1) = v[0] * r33[0][1] + v[1] * r33[1][1] + v[2] * r33[2][1]; - TMAT(i, 2) = v[0] * r33[0][2] + v[1] * r33[1][2] + v[2] * r33[2][2]; - #else - TMAT(i, 0) = v[0] * r33[0][0] + v[1] * r33[0][1] + v[2] * r33[0][2]; - TMAT(i, 1) = v[0] * r33[1][0] + v[1] * r33[1][1] + v[2] * r33[1][2]; - TMAT(i, 2) = v[0] * r33[2][0] + v[1] * r33[2][1] + v[2] * r33[2][2]; - #endif - } - - // multiply this with the 3x3 scale inverse parent scale matrix - TMAT(0, 0) *= invParentScale.GetX(); - TMAT(0, 1) *= invParentScale.GetY(); - TMAT(0, 2) *= invParentScale.GetZ(); - TMAT(1, 0) *= invParentScale.GetX(); - TMAT(1, 1) *= invParentScale.GetY(); - TMAT(1, 2) *= invParentScale.GetZ(); - TMAT(2, 0) *= invParentScale.GetX(); - TMAT(2, 1) *= invParentScale.GetY(); - TMAT(2, 2) *= invParentScale.GetZ(); - } - - - void Matrix::InitFromPosRot(const AZ::Vector3& pos, const AZ::Quaternion& rot) - { - const float xx = rot.GetX() * rot.GetX(); - const float xy = rot.GetX() * rot.GetY(), yy = rot.GetY() * rot.GetY(); - const float xz = rot.GetX() * rot.GetZ(), yz = rot.GetY() * rot.GetZ(), zz = rot.GetZ() * rot.GetZ(); - const float xw = rot.GetX() * rot.GetW(), yw = rot.GetY() * rot.GetW(), zw = rot.GetZ() * rot.GetW(), ww = rot.GetW() * rot.GetW(); - - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(0, 1) = +xy + zw + xy + zw; - TMAT(0, 2) = +xz - yw + xz - yw; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(1, 2) = +yz + xw + yz + xw; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = +xz + yw + xz + yw; - TMAT(2, 1) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = pos.GetX(); - TMAT(3, 1) = pos.GetY(); - TMAT(3, 2) = pos.GetZ(); - TMAT(3, 3) = 1.0f; - } - - /* - // optimized routine for handling scale rotation, rotation, scale and translation - void Matrix::Set(const AZ::Quaternion& scaleRot, const AZ::Quaternion& rotation, const Vector3& scale, const Vector3& translation) - { - float xx=scaleRot.x*scaleRot.x; - float xy=scaleRot.x*scaleRot.y, yy=scaleRot.y*scaleRot.y; - float xz=scaleRot.x*scaleRot.z, yz=scaleRot.y*scaleRot.z, zz=scaleRot.z*scaleRot.z; - float xw=scaleRot.x*scaleRot.w, yw=scaleRot.y*scaleRot.w, zw=scaleRot.z*scaleRot.w, ww=scaleRot.w*scaleRot.w; - - // init on the inversed scale rotation - TMAT(0,0) = +xx-yy-zz+ww; TMAT(1,0) = +xy+zw+xy+zw; TMAT(2,0) = +xz-yw+xz-yw; // translation part not initialized - TMAT(0,1) = +xy-zw+xy-zw; TMAT(1,1) = -xx+yy-zz+ww; TMAT(2,1) = +yz+xw+yz+xw; - TMAT(0,2) = +xz+yw+xz+yw; TMAT(1,2) = +yz-xw+yz-xw; TMAT(2,2) = -xx-yy+zz+ww; - TMAT(0,3) = 0.0f; TMAT(1,3) = 0.0f; TMAT(2,3) = 0.0f; TMAT(3,3) = 1.0f; - - // copy the 3x3 part into a temp buffer, so that we have the inverse scale rotation, before scaling applied to it - float r33[3][3]; - uint32 i; - for (i=0; i<3; ++i) - { - #ifdef MCORE_MATRIX_ROWMAJOR - r33[i][0] = TMAT(i,0); - r33[i][1] = TMAT(i,1); - r33[i][2] = TMAT(i,2); - #else - r33[0][i] = TMAT(i,0); - r33[1][i] = TMAT(i,1); - r33[2][i] = TMAT(i,2); - #endif - } - - // apply scaling - TMAT(0,0) *= scale.x; - TMAT(0,1) *= scale.y; - TMAT(0,2) *= scale.z; - TMAT(1,0) *= scale.x; - TMAT(1,1) *= scale.y; - TMAT(1,2) *= scale.z; - TMAT(2,0) *= scale.x; - TMAT(2,1) *= scale.y; - TMAT(2,2) *= scale.z; - - // undo the scale rotation - float v[3]; - for (i=0; i<3; ++i) - { - v[0] = TMAT(i,0); - v[1] = TMAT(i,1); - v[2] = TMAT(i,2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[0][1] + v[2]*r33[0][2]; // transposed multiply - TMAT(i,1) = v[0]*r33[1][0] + v[1]*r33[1][1] + v[2]*r33[1][2]; - TMAT(i,2) = v[0]*r33[2][0] + v[1]*r33[2][1] + v[2]*r33[2][2]; - #else - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[1][0] + v[2]*r33[2][0]; // transposed multiply - TMAT(i,1) = v[0]*r33[0][1] + v[1]*r33[1][1] + v[2]*r33[2][1]; - TMAT(i,2) = v[0]*r33[0][2] + v[1]*r33[1][2] + v[2]*r33[2][2]; - #endif - } - - // apply regular rotation - xx=rotation.x*rotation.x; - xy=rotation.x*rotation.y; yy=rotation.y*rotation.y; - xz=rotation.x*rotation.z; yz=rotation.y*rotation.z; zz=rotation.z*rotation.z; - xw=rotation.x*rotation.w; yw=rotation.y*rotation.w; zw=rotation.z*rotation.w; ww=rotation.w*rotation.w; - - #ifdef MCORE_MATRIX_ROWMAJOR - r33[0][0] = +xx-yy-zz+ww; r33[0][1] = +xy+zw+xy+zw; r33[0][2] = +xz-yw+xz-yw; - r33[1][0] = +xy-zw+xy-zw; r33[1][1] = -xx+yy-zz+ww; r33[1][2] = +yz+xw+yz+xw; - r33[2][0] = +xz+yw+xz+yw; r33[2][1] = +yz-xw+yz-xw; r33[2][2] = -xx-yy+zz+ww; - #else - r33[0][0] = +xx-yy-zz+ww; r33[1][0] = +xy+zw+xy+zw; r33[2][0] = +xz-yw+xz-yw; - r33[0][1] = +xy-zw+xy-zw; r33[1][1] = -xx+yy-zz+ww; r33[2][1] = +yz+xw+yz+xw; - r33[0][2] = +xz+yw+xz+yw; r33[1][2] = +yz-xw+yz-xw; r33[2][2] = -xx-yy+zz+ww; - #endif - - // mult 3x3 matrix - for (i=0; i<3; ++i) - { - v[0] = TMAT(i,0); - v[1] = TMAT(i,1); - v[2] = TMAT(i,2); - - #ifdef MCORE_MATRIX_ROWMAJOR - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[1][0] + v[2]*r33[2][0]; - TMAT(i,1) = v[0]*r33[0][1] + v[1]*r33[1][1] + v[2]*r33[2][1]; - TMAT(i,2) = v[0]*r33[0][2] + v[1]*r33[1][2] + v[2]*r33[2][2]; - #else - TMAT(i,0) = v[0]*r33[0][0] + v[1]*r33[0][1] + v[2]*r33[0][2]; - TMAT(i,1) = v[0]*r33[1][0] + v[1]*r33[1][1] + v[2]*r33[1][2]; - TMAT(i,2) = v[0]*r33[2][0] + v[1]*r33[2][1] + v[2]*r33[2][2]; - #endif - } - - // apply translation - TMAT(3,0) = translation.x; - TMAT(3,1) = translation.y; - TMAT(3,2) = translation.z; - } - */ - - - void Matrix::MultMatrix4x3(const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[3]; - - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2); - } - - TMAT(3, 0) += MMAT(right, 3, 0); - TMAT(3, 1) += MMAT(right, 3, 1); - TMAT(3, 2) += MMAT(right, 3, 2); - #endif - } - - - // *this = left * right - void Matrix::MultMatrix(const Matrix& left, const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = left.m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[4]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = MMAT(left, i, 0); - v[1] = MMAT(left, i, 1); - v[2] = MMAT(left, i, 2); - v[3] = MMAT(left, i, 3); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0) + v[3] * MMAT(right, 3, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1) + v[3] * MMAT(right, 3, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2) + v[3] * MMAT(right, 3, 2); - TMAT(i, 3) = v[0] * MMAT(right, 0, 3) + v[1] * MMAT(right, 1, 3) + v[2] * MMAT(right, 2, 3) + v[3] * MMAT(right, 3, 3); - } - #endif - } - - - - void Matrix::MultMatrix4x3(const Matrix& left, const Matrix& right) - { - #if (AZ_TRAIT_USE_PLATFORM_SIMD_SSE && defined(MCORE_MATRIX_ROWMAJOR)) - const float* m = right.m_m16; - const float* n = left.m_m16; - float* t = this->m_m16; - - __m128 x0; - __m128 x1; - __m128 x2; - __m128 x3; - __m128 x4; - __m128 x5; - __m128 x6; - __m128 x7; - x0 = _mm_loadu_ps(&m[0]); - x1 = _mm_loadu_ps(&m[4]); - x2 = _mm_loadu_ps(&m[8]); - x3 = _mm_loadu_ps(&m[12]); - x4 = _mm_load_ps1(&n[0]); - x5 = _mm_load_ps1(&n[1]); - x6 = _mm_load_ps1(&n[2]); - x7 = _mm_load_ps1(&n[3]); - x4 = _mm_mul_ps(x4, x0); - x5 = _mm_mul_ps(x5, x1); - x6 = _mm_mul_ps(x6, x2); - x7 = _mm_mul_ps(x7, x3); - x4 = _mm_add_ps(x4, x5); - x6 = _mm_add_ps(x6, x7); - x4 = _mm_add_ps(x4, x6); - x5 = _mm_load_ps1(&n[4]); - x6 = _mm_load_ps1(&n[5]); - x7 = _mm_load_ps1(&n[6]); - x5 = _mm_mul_ps(x5, x0); - x6 = _mm_mul_ps(x6, x1); - x7 = _mm_mul_ps(x7, x2); - x5 = _mm_add_ps(x5, x6); - x5 = _mm_add_ps(x5, x7); - x6 = _mm_load_ps1(&n[7]); - x6 = _mm_mul_ps(x6, x3); - x5 = _mm_add_ps(x5, x6); - x6 = _mm_load_ps1(&n[8]); - x7 = _mm_load_ps1(&n[9]); - x6 = _mm_mul_ps(x6, x0); - x7 = _mm_mul_ps(x7, x1); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[10]); - x7 = _mm_mul_ps(x7, x2); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[11]); - x7 = _mm_mul_ps(x7, x3); - x6 = _mm_add_ps(x6, x7); - x7 = _mm_load_ps1(&n[12]); - x0 = _mm_mul_ps(x0, x7); - x7 = _mm_load_ps1(&n[13]); - x1 = _mm_mul_ps(x1, x7); - x7 = _mm_load_ps1(&n[14]); - x2 = _mm_mul_ps(x2, x7); - x7 = _mm_load_ps1(&n[15]); - x3 = _mm_mul_ps(x3, x7); - x0 = _mm_add_ps(x0, x1); - x2 = _mm_add_ps(x2, x3); - x0 = _mm_add_ps(x0, x2); - - //store result - _mm_storeu_ps(&t[0], x4); - _mm_storeu_ps(&t[4], x5); - _mm_storeu_ps(&t[8], x6); - _mm_storeu_ps(&t[12], x0); - #else - float v[3]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = MMAT(left, i, 0); - v[1] = MMAT(left, i, 1); - v[2] = MMAT(left, i, 2); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2); - } - - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 3) = 1.0f; - TMAT(3, 0) += MMAT(right, 3, 0); - TMAT(3, 1) += MMAT(right, 3, 1); - TMAT(3, 2) += MMAT(right, 3, 2); - #endif - } - - - void Matrix::MultMatrix3x3(const Matrix& right) - { - float v[3]; - for (uint32 i = 0; i < 4; ++i) - { - v[0] = TMAT(i, 0); - v[1] = TMAT(i, 1); - v[2] = TMAT(i, 2); - TMAT(i, 0) = v[0] * MMAT(right, 0, 0) + v[1] * MMAT(right, 1, 0) + v[2] * MMAT(right, 2, 0); - TMAT(i, 1) = v[0] * MMAT(right, 0, 1) + v[1] * MMAT(right, 1, 1) + v[2] * MMAT(right, 2, 1); - TMAT(i, 2) = v[0] * MMAT(right, 0, 2) + v[1] * MMAT(right, 1, 2) + v[2] * MMAT(right, 2, 2); - } - } - - - void Matrix::Transpose() - { - Matrix v; - - MMAT(v, 0, 0) = TMAT(0, 0); - MMAT(v, 0, 1) = TMAT(1, 0); - MMAT(v, 0, 2) = TMAT(2, 0); - MMAT(v, 0, 3) = TMAT(3, 0); - MMAT(v, 1, 0) = TMAT(0, 1); - MMAT(v, 1, 1) = TMAT(1, 1); - MMAT(v, 1, 2) = TMAT(2, 1); - MMAT(v, 1, 3) = TMAT(3, 1); - MMAT(v, 2, 0) = TMAT(0, 2); - MMAT(v, 2, 1) = TMAT(1, 2); - MMAT(v, 2, 2) = TMAT(2, 2); - MMAT(v, 2, 3) = TMAT(3, 2); - MMAT(v, 3, 0) = TMAT(0, 3); - MMAT(v, 3, 1) = TMAT(1, 3); - MMAT(v, 3, 2) = TMAT(2, 3); - MMAT(v, 3, 3) = TMAT(3, 3); - - *this = v; - } - - - void Matrix::TransposeTranslation() - { - AZ::Vector3 temp; - - temp.SetX(TMAT(3, 0)); - temp.SetY(TMAT(3, 1)); - temp.SetZ(TMAT(3, 2)); - - TMAT(3, 0) = TMAT(0, 3); - TMAT(3, 1) = TMAT(1, 3); - TMAT(3, 2) = TMAT(2, 3); - - TMAT(0, 3) = temp.GetX(); - TMAT(1, 3) = temp.GetY(); - TMAT(2, 3) = temp.GetZ(); - } - - - - void Matrix::Adjoint() - { - Matrix v; - - MMAT(v, 0, 0) = TMAT(1, 1) * TMAT(2, 2) - TMAT(1, 2) * TMAT(2, 1); - MMAT(v, 0, 1) = TMAT(2, 1) * TMAT(0, 2) - TMAT(2, 2) * TMAT(0, 1); - MMAT(v, 0, 2) = TMAT(0, 1) * TMAT(1, 2) - TMAT(0, 2) * TMAT(1, 1); - MMAT(v, 0, 3) = TMAT(0, 3); - MMAT(v, 1, 0) = TMAT(1, 2) * TMAT(2, 0) - TMAT(1, 0) * TMAT(2, 2); - MMAT(v, 1, 1) = TMAT(2, 2) * TMAT(0, 0) - TMAT(2, 0) * TMAT(0, 2); - MMAT(v, 1, 2) = TMAT(0, 2) * TMAT(1, 0) - TMAT(0, 0) * TMAT(1, 2); - MMAT(v, 1, 3) = TMAT(1, 3); - MMAT(v, 2, 0) = TMAT(1, 0) * TMAT(2, 1) - TMAT(1, 1) * TMAT(2, 0); - MMAT(v, 2, 1) = TMAT(2, 0) * TMAT(0, 1) - TMAT(2, 1) * TMAT(0, 0); - MMAT(v, 2, 2) = TMAT(0, 0) * TMAT(1, 1) - TMAT(0, 1) * TMAT(1, 0); - MMAT(v, 2, 3) = TMAT(2, 3); - MMAT(v, 3, 0) = -(TMAT(0, 0) * TMAT(3, 0) + TMAT(1, 0) * TMAT(3, 1) + TMAT(2, 0) * TMAT(3, 2)); - MMAT(v, 3, 1) = -(TMAT(0, 1) * TMAT(3, 0) + TMAT(1, 1) * TMAT(3, 1) + TMAT(2, 1) * TMAT(3, 2)); - MMAT(v, 3, 2) = -(TMAT(0, 2) * TMAT(3, 0) + TMAT(1, 2) * TMAT(3, 1) + TMAT(2, 2) * TMAT(3, 2)); - MMAT(v, 3, 3) = TMAT(3, 3); - - *this = v; - } - - - - AZ::Vector3 Matrix::InverseRot(const AZ::Vector3& v) - { - Matrix m(*this); - m.Inverse(); - m.SetTranslation(0.0f, 0.0f, 0.0f); - return v * m; - } - - - - void Matrix::Inverse() - { - Matrix v; - - const float s = 1.0f / CalcDeterminant(); - MMAT(v, 0, 0) = (TMAT(1, 1) * TMAT(2, 2) - TMAT(1, 2) * TMAT(2, 1)) * s; - MMAT(v, 0, 1) = (TMAT(2, 1) * TMAT(0, 2) - TMAT(2, 2) * TMAT(0, 1)) * s; - MMAT(v, 0, 2) = (TMAT(0, 1) * TMAT(1, 2) - TMAT(0, 2) * TMAT(1, 1)) * s; - MMAT(v, 0, 3) = TMAT(0, 3); - MMAT(v, 1, 0) = (TMAT(1, 2) * TMAT(2, 0) - TMAT(1, 0) * TMAT(2, 2)) * s; - MMAT(v, 1, 1) = (TMAT(2, 2) * TMAT(0, 0) - TMAT(2, 0) * TMAT(0, 2)) * s; - MMAT(v, 1, 2) = (TMAT(0, 2) * TMAT(1, 0) - TMAT(0, 0) * TMAT(1, 2)) * s; - MMAT(v, 1, 3) = TMAT(1, 3); - MMAT(v, 2, 0) = (TMAT(1, 0) * TMAT(2, 1) - TMAT(1, 1) * TMAT(2, 0)) * s; - MMAT(v, 2, 1) = (TMAT(2, 0) * TMAT(0, 1) - TMAT(2, 1) * TMAT(0, 0)) * s; - MMAT(v, 2, 2) = (TMAT(0, 0) * TMAT(1, 1) - TMAT(0, 1) * TMAT(1, 0)) * s; - MMAT(v, 2, 3) = TMAT(2, 3); - MMAT(v, 3, 0) = -(MMAT(v, 0, 0) * TMAT(3, 0) + MMAT(v, 1, 0) * TMAT(3, 1) + MMAT(v, 2, 0) * TMAT(3, 2)); - MMAT(v, 3, 1) = -(MMAT(v, 0, 1) * TMAT(3, 0) + MMAT(v, 1, 1) * TMAT(3, 1) + MMAT(v, 2, 1) * TMAT(3, 2)); - MMAT(v, 3, 2) = -(MMAT(v, 0, 2) * TMAT(3, 0) + MMAT(v, 1, 2) * TMAT(3, 1) + MMAT(v, 2, 2) * TMAT(3, 2)); - MMAT(v, 3, 3) = TMAT(3, 3); - - *this = v; - } - - - - void Matrix::OrthoNormalize() - { - AZ::Vector3 x = GetRight(); - AZ::Vector3 y = GetUp(); - //Vector3 z = GetForward(); - - x.Normalize(); - y -= x * x.Dot(y); - y.Normalize(); - AZ::Vector3 z = x.Cross(y); - - SetRight(x); - SetUp(y); - SetForward(z); - } - - - - void Matrix::Mirror(const Matrix& transform, const PlaneEq& plane) - { - // components - AZ::Vector3 x = transform.GetRight(); - AZ::Vector3 y = transform.GetForward(); - AZ::Vector3 z = transform.GetUp(); - AZ::Vector3 t = transform.GetTranslation(); - AZ::Vector3 n = plane.GetNormal(); - AZ::Vector3 n2 = n * -2.0f; - float d = plane.GetDist(); - - // mirror translation - AZ::Vector3 mt = t + n2 * (t.Dot(n) - d); - - // mirror x rotation - x += t; - x += n2 * (x.Dot(n) - d); - x -= mt; - - // mirror y rotation - y += t; - y += n2 * (y.Dot(n) - d); - y -= mt; - - // mirror z rotation - z += t; - z += n2 * (z.Dot(n) - d); - z -= mt; - - // write result - SetRight(x); - SetForward(y); - SetUp(z); - SetTranslation(mt); - - TMAT(0, 3) = 0; - TMAT(1, 3) = 0; - TMAT(2, 3) = 0; - TMAT(3, 3) = 1; - } - - - void Matrix::LookAt(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up) - { - const AZ::Vector3 z = (target - view).GetNormalized(); - const AZ::Vector3 x = (up.Cross(z)).GetNormalized(); - const AZ::Vector3 y = z.Cross(x); - - TMAT(0, 0) = x.GetX(); - TMAT(0, 1) = y.GetX(); - TMAT(0, 2) = z.GetX(); - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = x.GetY(); - TMAT(1, 1) = y.GetY(); - TMAT(1, 2) = z.GetY(); - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = x.GetZ(); - TMAT(2, 1) = y.GetZ(); - TMAT(2, 2) = z.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = -x.Dot(view); - TMAT(3, 1) = -y.Dot(view); - TMAT(3, 2) = -z.Dot(view); - TMAT(3, 3) = 1.0f; - - // DirectX: - // zaxis = normal(cameraTarget - cameraPosition) - // xaxis = normal(cross(cameraUpVector, zaxis)) - // yaxis = cross(zaxis, xaxis) - // xaxis.x yaxis.x zaxis.x 0 - // xaxis.y yaxis.y zaxis.y 0 - // xaxis.z yaxis.z zaxis.z 0 - // -dot(xaxis, cameraPosition) -dot(yaxis, cameraPosition) -dot(zaxis, cameraPosition) 1 - } - - - void Matrix::LookAtRH(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up) - { - const AZ::Vector3 z = (view - target).GetNormalized(); - const AZ::Vector3 x = (up.Cross(z)).GetNormalized(); - const AZ::Vector3 y = z.Cross(x); - - TMAT(0, 0) = x.GetX(); - TMAT(0, 1) = y.GetX(); - TMAT(0, 2) = z.GetX(); - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = x.GetY(); - TMAT(1, 1) = y.GetY(); - TMAT(1, 2) = z.GetY(); - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = x.GetZ(); - TMAT(2, 1) = y.GetZ(); - TMAT(2, 2) = z.GetZ(); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = -x.Dot(view); - TMAT(3, 1) = -y.Dot(view); - TMAT(3, 2) = -z.Dot(view); - TMAT(3, 3) = 1.0f; - - // DirectX: - // zaxis = normal(cameraPosition - cameraTarget) - // xaxis = normal(cross(cameraUpVector, zaxis)) - // yaxis = cross(zaxis, xaxis) - // xaxis.x yaxis.x zaxis.x 0 - // xaxis.y yaxis.y zaxis.y 0 - // xaxis.z yaxis.z zaxis.z 0 - // -dot(xaxis, cameraPosition) -dot(yaxis, cameraPosition) -dot(zaxis, cameraPosition) 1 - } - - // ortho projection matrix - void Matrix::OrthoOffCenter(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (zfar - znear); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = (left + right) / (left - right); - TMAT(3, 1) = (top + bottom) / (bottom - top); - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/(right-l) 0 0 0 - // 0 2/(top-bottom) 0 0 - // 0 0 1/(zfarPlane-znearPlane) 0 - // (l+right)/(l-right) (top+bottom)/(bottom-top) znearPlane/(znearPlane-zfarPlane) 1 - } - - - // ortho projection matrix - void Matrix::OrthoOffCenterRH(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (znear - zfar); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = (left + right) / (left - right); - TMAT(3, 1) = (top + bottom) / (bottom - top); - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/(right-left) 0 0 0 - // 0 2/(top-bottom) 0 0 - // 0 0 1/(znearPlane-zfarPlane) 0 - // (l+right)/(l-rright) (top+bottom)/(bottom-top) znearPlane/(znearPlane-zfarPlane) 1 - } - - - // ortho projection matrix - void Matrix::Ortho(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (zfar - znear); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/width 0 0 0 - // 0 2/height 0 0 - // 0 0 1/(zfarPlane-znearPlane) 0 - // 0 0 znearPlane/(znearPlane-zfarPlane) 1 - } - - - // ortho projection matrix, right handed - void Matrix::OrthoRH(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f / (right - left); - TMAT(0, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = 0.0f; - TMAT(1, 1) = 2.0f / (top - bottom); - TMAT(1, 2) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = 0.0f; - TMAT(2, 1) = 0.0f; - TMAT(2, 2) = 1.0f / (znear - zfar); - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = znear / (znear - zfar); - TMAT(3, 3) = 1.0f; - - // DirectX: - // 2/width 0 0 0 - // 0 2/height 0 0 - // 0 0 1/(znearPlane-zfarPlane) 0 - // 0 0 znearPlane/(znearPlane-zfarPlane) 1 - } - - - // frustum matrix - void Matrix::Frustum(float left, float right, float top, float bottom, float znear, float zfar) - { - TMAT(0, 0) = 2.0f * znear / (right - left); - TMAT(1, 0) = 0.0f; - TMAT(2, 0) = (right + left) / (right - left); - TMAT(3, 0) = 0.0f; - TMAT(0, 1) = 0.0f; - TMAT(1, 1) = 2.0f * znear / (top - bottom); - TMAT(2, 1) = (top + bottom) / (top - bottom); - TMAT(3, 1) = 0.0f; - TMAT(0, 2) = 0.0f; - TMAT(1, 2) = 0.0f; - TMAT(2, 2) = (zfar + znear) / (zfar - znear); - TMAT(3, 2) = 2.0f * zfar * znear / (zfar - znear); - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = -1.0f; - TMAT(3, 3) = 0.0f; - } - - - // setup perspective projection matrix - void Matrix::Perspective(float fov, float aspect, float zNear, float zFar) - { - const float yScale = 1.0f / Math::Tan(fov * 0.5f); - const float xScale = yScale / aspect; - const float d = zFar / (zFar - zNear); - - MCore::MemSet(m44, 0, 16 * sizeof(float)); - TMAT(0, 0) = xScale; - TMAT(1, 1) = yScale; - TMAT(2, 2) = d; - TMAT(2, 3) = 1.0f; - TMAT(3, 2) = -zNear * d; - } - - - // setup perspective projection matrix, right handed - void Matrix::PerspectiveRH(float fov, float aspect, float zNear, float zFar) - { - const float yScale = 1.0f / Math::Tan(fov * 0.5f); - const float xScale = yScale / aspect; - const float d = zFar / (zNear - zFar); - - MCore::MemSet(m44, 0, 16 * sizeof(float)); - TMAT(0, 0) = xScale; - TMAT(1, 1) = yScale; - TMAT(2, 2) = d; - TMAT(2, 3) = -1.0f; - TMAT(3, 2) = zNear * d; - } - - - // check if the matrix is symmetric or not - bool Matrix::CheckIfIsSymmetric(float tolerance) const - { - // if no tolerance check is needed - if (MCore::Math::IsFloatZero(tolerance)) - { - if (TMAT(1, 0) != TMAT(0, 1)) - { - return false; - } - if (TMAT(2, 0) != TMAT(0, 2)) - { - return false; - } - if (TMAT(2, 1) != TMAT(1, 2)) - { - return false; - } - if (TMAT(3, 0) != TMAT(0, 3)) - { - return false; - } - if (TMAT(3, 1) != TMAT(1, 3)) - { - return false; - } - if (TMAT(3, 2) != TMAT(2, 3)) - { - return false; - } - } - else // tolerance check needed - { - if (Math::Abs(TMAT(1, 0) - TMAT(0, 1)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(2, 0) - TMAT(0, 2)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(2, 1) - TMAT(1, 2)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(3, 0) - TMAT(0, 3)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(3, 1) - TMAT(1, 3)) > tolerance) - { - return false; - } - if (Math::Abs(TMAT(3, 2) - TMAT(2, 3)) > tolerance) - { - return false; - } - } - - // yeah, we have a symmetric matrix here - return true; - } - - - // check if this matrix is a diagonal matrix or not. - bool Matrix::CheckIfIsDiagonal(float tolerance) const - { - if (tolerance <= Math::epsilon) - { - // for all entries - for (uint32 y = 0; y < 4; ++y) - { - for (uint32 x = 0; x < 4; ++x) - { - // if we are on the diagonal - if (x == y) - { - if (TMAT(y, x) == 0) - { - return false; // if this entry on the diagonal is 0, we have no diagonal matrix - } - } - else // we are not on the diagonal - if (TMAT(y, x) != 0) - { - return false; // if the entry isn't equal to 0, it isn't a diagonal matrix - } - } - } - } - else - { - // for all entries - for (uint32 y = 0; y < 4; ++y) - { - for (uint32 x = 0; x < 4; ++x) - { - // if we are on the diagonal - if (x == y) - { - if (Math::Abs(TMAT(y, x)) < tolerance) - { - return false; // if this entry on the diagonal is 0, we have no diagonal matrix - } - } - else // we are not on the diagonal - { - if (Math::Abs(TMAT(y, x)) > tolerance) - { - return false; // if the entry isn't equal to 0, it isn't a diagonal matrix - } - } - } - } - } - - // yeaaah, we have a diagonal matrix here - return true; - } - - - // prints the matrix into the logfile or debug output, using MCore::LOG() - void Matrix::Log() const - { - MCore::LogDetailedInfo(""); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[0], m_m16[1], m_m16[2], m_m16[3]); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[4], m_m16[5], m_m16[6], m_m16[7]); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[8], m_m16[9], m_m16[10], m_m16[11]); - MCore::LogDetailedInfo("(%.8f, %.8f, %.8f, %.8f)", m_m16[12], m_m16[13], m_m16[14], m_m16[15]); - MCore::LogDetailedInfo(""); - } - - - // check if the matrix is orthogonal or not - bool Matrix::CheckIfIsOrthogonal(float tolerance) const - { - // get the matrix vectors - AZ::Vector3 right = GetRight(); - AZ::Vector3 up = GetUp(); - AZ::Vector3 forward = GetForward(); - - // check if the vectors form an orthonormal set - if (Math::Abs(right.Dot(up)) > tolerance) - { - return false; - } - if (Math::Abs(right.Dot(forward)) > tolerance) - { - return false; - } - if (Math::Abs(forward.Dot(up)) > tolerance) - { - return false; - } - - // the vector set is not orthonormal, so the matrix is not an orthogonal one - return true; - } - - - // check if the matrix is an identity matrix or not - bool Matrix::CheckIfIsIdentity(float tolerance) const - { - // for all entries - for (uint32 y = 0; y < 4; ++y) - { - for (uint32 x = 0; x < 4; ++x) - { - // if we are on the diagonal - if (x == y) - { - if (Math::Abs(1.0f - TMAT(y, x)) > tolerance) - { - return false; // if this entry on the diagonal not 1, we have no identity matrix - } - } - else // we are not on the diagonal - { - if (Math::Abs(TMAT(y, x)) > tolerance) - { - return false; // if the entry isn't equal to 0, it isn't an identity matrix - } - } - } - } - - // yup, we have an identity matrix here :) - return true; - } - - - // calculate the handedness of the matrix - float Matrix::CalcHandedness() const - { - // get the matrix vectors - AZ::Vector3 right = GetRight(); - AZ::Vector3 up = GetUp(); - AZ::Vector3 forward = GetForward(); - - // calculate the handedness (negative result means left handed, positive means right handed) - return (right.Cross(up)).Dot(forward); - } - - - // check if the matrix is right handed or not - bool Matrix::CheckIfIsRightHanded() const - { - return (CalcHandedness() <= 0.0f); - } - - - // check if the matrix is right handed or not - - bool Matrix::CheckIfIsLeftHanded() const - { - return (CalcHandedness() > 0.0f); - } - - - // check if this matrix is a pure rotation matrix or not - bool Matrix::CheckIfIsPureRotationMatrix(float tolerance) const - { - return (Math::Abs(1.0f - CalcDeterminant()) < tolerance); - } - - - // check if the matrix is reflected (mirrored) or not - bool Matrix::CheckIfIsReflective() const - { - float determinant = CalcDeterminant(); - return (determinant < 0.0f); - //return ((determinant > (-1.0 - tolerance)) && (determinant < (-1.0 + tolerance))); // if the determinant is near -1, it will reflect - } - - - // calculate the inverse transpose - void Matrix::InverseTranspose() - { - Inverse(); - Transpose(); - } - - - // return the inverse transposed version of this matrix - Matrix Matrix::InverseTransposed() const - { - Matrix result(*this); - result.InverseTranspose(); - return result; - } - - - // normalize a matrix - void Matrix::Normalize() - { - // get the current vectors - AZ::Vector3 right = GetRight(); - AZ::Vector3 up = GetUp(); - AZ::Vector3 forward = GetForward(); - - // normalize them - right.Normalize(); - up.Normalize(); - forward.Normalize(); - - // update them again with the normalized versions - SetRight(right); - SetUp(up); - SetForward(forward); - } - - - // creates a shear matrix - void Matrix::SetShearMatrix(const AZ::Vector3& s) - { - TMAT(0, 0) = 1; - TMAT(0, 1) = s.GetX(); - TMAT(0, 2) = s.GetY(); - TMAT(0, 3) = 0; - TMAT(1, 0) = 0; - TMAT(1, 1) = 1; - TMAT(1, 2) = s.GetZ(); - TMAT(1, 3) = 0; - TMAT(2, 0) = 0; - TMAT(2, 1) = 0; - TMAT(2, 2) = 1; - TMAT(2, 3) = 0; - TMAT(3, 0) = 0; - TMAT(3, 1) = 0; - TMAT(3, 2) = 0; - TMAT(3, 3) = 1; - } - - - - void Matrix::SetRotationMatrix(const AZ::Quaternion& rotation) - { - const float xx = rotation.GetX() * rotation.GetX(); - const float xy = rotation.GetX() * rotation.GetY(), yy = rotation.GetY() * rotation.GetY(); - const float xz = rotation.GetX() * rotation.GetZ(), yz = rotation.GetY() * rotation.GetZ(), zz = rotation.GetZ() * rotation.GetZ(); - const float xw = rotation.GetX() * rotation.GetW(), yw = rotation.GetY() * rotation.GetW(), zw = rotation.GetZ() * rotation.GetW(), ww = rotation.GetW() * rotation.GetW(); - - TMAT(0, 0) = +xx - yy - zz + ww; - TMAT(0, 1) = +xy + zw + xy + zw; - TMAT(0, 2) = +xz - yw + xz - yw; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = +xy - zw + xy - zw; - TMAT(1, 1) = -xx + yy - zz + ww; - TMAT(1, 2) = +yz + xw + yz + xw; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = +xz + yw + xz + yw; - TMAT(2, 1) = +yz - xw + yz - xw; - TMAT(2, 2) = -xx - yy + zz + ww; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - // calculate a rotation matrix from two vectors - void Matrix::SetRotationMatrixTwoVectors(const AZ::Vector3& from, const AZ::Vector3& to) - { - // calculate intermediate values - const float lengths = SafeLength(to) * SafeLength(from); - const float D = (lengths > Math::epsilon) ? 1.0f / lengths : 0.0f; - const float C = (to.GetX() * from.GetX() + to.GetY() * from.GetY() + to.GetZ() * from.GetZ()) * D; - const float vzwy = (to.GetY() * from.GetZ()) - (to.GetZ() * from.GetY()); - const float wxuz = (to.GetZ() * from.GetX()) - (to.GetX() * from.GetZ()); - const float uyvx = (to.GetX() * from.GetY()) - (to.GetY() * from.GetX()); - const float A = vzwy * vzwy + wxuz * wxuz + uyvx * uyvx; - - // return identity if the cross product of the two vectors is small - if (A < Math::epsilon) - { - Identity(); - return; - } - - // set the components of the rotation matrix - const float t = (1.0f - C) / A; - TMAT(0, 0) = t * vzwy * vzwy + C; - TMAT(1, 1) = t * wxuz * wxuz + C; - TMAT(2, 2) = t * uyvx * uyvx + C; - TMAT(3, 3) = 1.0f; - TMAT(0, 1) = t * vzwy * wxuz + D * uyvx; - TMAT(0, 2) = t * vzwy * uyvx - D * wxuz; - TMAT(1, 2) = t * wxuz * uyvx + D * vzwy; - TMAT(1, 0) = t * vzwy * wxuz - D * uyvx; - TMAT(2, 0) = t * vzwy * uyvx + D * wxuz; - TMAT(2, 1) = t * wxuz * uyvx - D * vzwy; - TMAT(0, 3) = 0.0f; - TMAT(1, 3) = 0.0f; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - } - - - - // output: x=pitch, y=yaw, z=roll - // reconstruction: roll*pitch*yaw (zxy) - AZ::Vector3 Matrix::CalcPitchYawRoll() const - { - const float pitch = Math::ASin(-TMAT(2, 1)); - const float cosPitch = Math::Cos(pitch); - const float threshold = 0.0001f; - float roll; - float yaw; - - if (cosPitch > threshold) - { - roll = Math::ATan2(TMAT(0, 1), TMAT(1, 1)); - yaw = Math::ATan2(TMAT(2, 0), TMAT(2, 2)); - } - else - { - roll = Math::ATan2(-TMAT(1, 0), TMAT(0, 0)); - yaw = 0.0f; - } - - return AZ::Vector3(pitch, yaw, roll); - } - - - - // init the matrix from a yaw/pitch/roll angle set - void Matrix::SetRotationMatrixPitchYawRoll(float pitch, float yaw, float roll) - { - const float cosX = Math::Cos(pitch); - const float cosY = Math::Cos(yaw); - const float cosZ = Math::Cos(roll); - const float sinX = Math::Sin(pitch); - const float sinY = Math::Sin(yaw); - const float sinZ = Math::Sin(roll); - - TMAT(0, 0) = cosZ * cosY + sinZ * sinX * sinY; - TMAT(0, 1) = sinZ * cosX; - TMAT(0, 2) = cosZ * -sinY + sinZ * sinX * cosY; - TMAT(0, 3) = 0.0f; - TMAT(1, 0) = -sinZ * cosY + cosZ * sinX * sinY; - TMAT(1, 1) = cosZ * cosX; - TMAT(1, 2) = sinZ * sinY + cosZ * sinX * cosY; - TMAT(1, 3) = 0.0f; - TMAT(2, 0) = cosX * sinY; - TMAT(2, 1) = -sinX; - TMAT(2, 2) = cosX * cosY; - TMAT(2, 3) = 0.0f; - TMAT(3, 0) = 0.0f; - TMAT(3, 1) = 0.0f; - TMAT(3, 2) = 0.0f; - TMAT(3, 3) = 1.0f; - } - - - - - // - void Matrix::DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale, AZ::Vector3& shear) const - { - // build orthogonal matrix Q - float invLength = Math::InvSqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0) + TMAT(2, 0) * TMAT(2, 0)); - MMAT(rot, 0, 0) = TMAT(0, 0) * invLength; - MMAT(rot, 1, 0) = TMAT(1, 0) * invLength; - MMAT(rot, 2, 0) = TMAT(2, 0) * invLength; - - float fDot = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(rot, 0, 1) = TMAT(0, 1) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 1) = TMAT(1, 1) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 1) = TMAT(2, 1) - fDot * MMAT(rot, 2, 0); - invLength = Math::InvSqrt(MMAT(rot, 0, 1) * MMAT(rot, 0, 1) + MMAT(rot, 1, 1) * MMAT(rot, 1, 1) + MMAT(rot, 2, 1) * MMAT(rot, 2, 1)); - MMAT(rot, 0, 1) *= invLength; - MMAT(rot, 1, 1) *= invLength; - MMAT(rot, 2, 1) *= invLength; - - fDot = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(rot, 0, 2) = TMAT(0, 2) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 2) = TMAT(1, 2) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 2) = TMAT(2, 2) - fDot * MMAT(rot, 2, 0); - fDot = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(rot, 0, 2) -= fDot * MMAT(rot, 0, 1); - MMAT(rot, 1, 2) -= fDot * MMAT(rot, 1, 1); - MMAT(rot, 2, 2) -= fDot * MMAT(rot, 2, 1); - invLength = Math::InvSqrt(MMAT(rot, 0, 2) * MMAT(rot, 0, 2) + MMAT(rot, 1, 2) * MMAT(rot, 1, 2) + MMAT(rot, 2, 2) * MMAT(rot, 2, 2)); - MMAT(rot, 0, 2) *= invLength; - MMAT(rot, 1, 2) *= invLength; - MMAT(rot, 2, 2) *= invLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = MMAT(rot, 0, 0) * MMAT(rot, 1, 1) * MMAT(rot, 2, 2) + MMAT(rot, 0, 1) * MMAT(rot, 1, 2) * MMAT(rot, 2, 0) + - MMAT(rot, 0, 2) * MMAT(rot, 1, 0) * MMAT(rot, 2, 1) - MMAT(rot, 0, 2) * MMAT(rot, 1, 1) * MMAT(rot, 2, 0) - - MMAT(rot, 0, 1) * MMAT(rot, 1, 0) * MMAT(rot, 2, 2) - MMAT(rot, 0, 0) * MMAT(rot, 1, 2) * MMAT(rot, 2, 1); - - if (fDet < 0.0f) - { - for (uint32 r = 0; r < 3; ++r) - { - for (uint32 c = 0; c < 3; ++c) - { - MMAT(rot, r, c) = -MMAT(rot, r, c); - } - } - } - - // build "right" matrix R - Matrix R; - MMAT(R, 0, 0) = MMAT(rot, 0, 0) * TMAT(0, 0) + MMAT(rot, 1, 0) * TMAT(1, 0) + MMAT(rot, 2, 0) * TMAT(2, 0); - MMAT(R, 0, 1) = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(R, 1, 1) = MMAT(rot, 0, 1) * TMAT(0, 1) + MMAT(rot, 1, 1) * TMAT(1, 1) + MMAT(rot, 2, 1) * TMAT(2, 1); - MMAT(R, 0, 2) = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(R, 1, 2) = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(R, 2, 2) = MMAT(rot, 0, 2) * TMAT(0, 2) + MMAT(rot, 1, 2) * TMAT(1, 2) + MMAT(rot, 2, 2) * TMAT(2, 2); - - // the scaling component - scale.SetX(MMAT(R, 0, 0)); - scale.SetY(MMAT(R, 1, 1)); - scale.SetZ(MMAT(R, 2, 2)); - - // the shear component - const float invScaleX = 1.0f / scale.GetX(); - shear.SetX(MMAT(R, 0, 1) * invScaleX); - shear.SetY(MMAT(R, 0, 2) * invScaleX); - shear.SetZ(MMAT(R, 1, 2) / scale.GetY()); - - translation = GetTranslation(); - } - - - // - void Matrix::DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale) const - { - // build orthogonal matrix Q - float invLength = Math::InvSqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0) + TMAT(2, 0) * TMAT(2, 0)); - MMAT(rot, 0, 0) = TMAT(0, 0) * invLength; - MMAT(rot, 1, 0) = TMAT(1, 0) * invLength; - MMAT(rot, 2, 0) = TMAT(2, 0) * invLength; - - float fDot = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(rot, 0, 1) = TMAT(0, 1) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 1) = TMAT(1, 1) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 1) = TMAT(2, 1) - fDot * MMAT(rot, 2, 0); - invLength = Math::InvSqrt(MMAT(rot, 0, 1) * MMAT(rot, 0, 1) + MMAT(rot, 1, 1) * MMAT(rot, 1, 1) + MMAT(rot, 2, 1) * MMAT(rot, 2, 1)); - MMAT(rot, 0, 1) *= invLength; - MMAT(rot, 1, 1) *= invLength; - MMAT(rot, 2, 1) *= invLength; - - fDot = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(rot, 0, 2) = TMAT(0, 2) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 2) = TMAT(1, 2) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 2) = TMAT(2, 2) - fDot * MMAT(rot, 2, 0); - fDot = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(rot, 0, 2) -= fDot * MMAT(rot, 0, 1); - MMAT(rot, 1, 2) -= fDot * MMAT(rot, 1, 1); - MMAT(rot, 2, 2) -= fDot * MMAT(rot, 2, 1); - invLength = Math::InvSqrt(MMAT(rot, 0, 2) * MMAT(rot, 0, 2) + MMAT(rot, 1, 2) * MMAT(rot, 1, 2) + MMAT(rot, 2, 2) * MMAT(rot, 2, 2)); - MMAT(rot, 0, 2) *= invLength; - MMAT(rot, 1, 2) *= invLength; - MMAT(rot, 2, 2) *= invLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = MMAT(rot, 0, 0) * MMAT(rot, 1, 1) * MMAT(rot, 2, 2) + MMAT(rot, 0, 1) * MMAT(rot, 1, 2) * MMAT(rot, 2, 0) + - MMAT(rot, 0, 2) * MMAT(rot, 1, 0) * MMAT(rot, 2, 1) - MMAT(rot, 0, 2) * MMAT(rot, 1, 1) * MMAT(rot, 2, 0) - - MMAT(rot, 0, 1) * MMAT(rot, 1, 0) * MMAT(rot, 2, 2) - MMAT(rot, 0, 0) * MMAT(rot, 1, 2) * MMAT(rot, 2, 1); - - if (fDet < 0.0f) - { - for (uint32 r = 0; r < 3; ++r) - { - for (uint32 c = 0; c < 3; ++c) - { - MMAT(rot, r, c) = -MMAT(rot, r, c); - } - } - } - - // build "right" matrix R - Matrix R; - MMAT(R, 0, 0) = MMAT(rot, 0, 0) * TMAT(0, 0) + MMAT(rot, 1, 0) * TMAT(1, 0) + MMAT(rot, 2, 0) * TMAT(2, 0); - MMAT(R, 0, 1) = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(R, 1, 1) = MMAT(rot, 0, 1) * TMAT(0, 1) + MMAT(rot, 1, 1) * TMAT(1, 1) + MMAT(rot, 2, 1) * TMAT(2, 1); - MMAT(R, 0, 2) = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(R, 1, 2) = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(R, 2, 2) = MMAT(rot, 0, 2) * TMAT(0, 2) + MMAT(rot, 1, 2) * TMAT(1, 2) + MMAT(rot, 2, 2) * TMAT(2, 2); - - // the scaling component - scale.SetX(MMAT(R, 0, 0)); - scale.SetY(MMAT(R, 1, 1)); - scale.SetZ(MMAT(R, 2, 2)); - - translation = GetTranslation(); - } - - - // decompose into translation and rotation - void Matrix::DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot) const - { - // build orthogonal matrix Q - float invLength = Math::InvSqrt(TMAT(0, 0) * TMAT(0, 0) + TMAT(1, 0) * TMAT(1, 0) + TMAT(2, 0) * TMAT(2, 0)); - MMAT(rot, 0, 0) = TMAT(0, 0) * invLength; - MMAT(rot, 1, 0) = TMAT(1, 0) * invLength; - MMAT(rot, 2, 0) = TMAT(2, 0) * invLength; - - float fDot = MMAT(rot, 0, 0) * TMAT(0, 1) + MMAT(rot, 1, 0) * TMAT(1, 1) + MMAT(rot, 2, 0) * TMAT(2, 1); - MMAT(rot, 0, 1) = TMAT(0, 1) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 1) = TMAT(1, 1) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 1) = TMAT(2, 1) - fDot * MMAT(rot, 2, 0); - invLength = Math::InvSqrt(MMAT(rot, 0, 1) * MMAT(rot, 0, 1) + MMAT(rot, 1, 1) * MMAT(rot, 1, 1) + MMAT(rot, 2, 1) * MMAT(rot, 2, 1)); - MMAT(rot, 0, 1) *= invLength; - MMAT(rot, 1, 1) *= invLength; - MMAT(rot, 2, 1) *= invLength; - - fDot = MMAT(rot, 0, 0) * TMAT(0, 2) + MMAT(rot, 1, 0) * TMAT(1, 2) + MMAT(rot, 2, 0) * TMAT(2, 2); - MMAT(rot, 0, 2) = TMAT(0, 2) - fDot * MMAT(rot, 0, 0); - MMAT(rot, 1, 2) = TMAT(1, 2) - fDot * MMAT(rot, 1, 0); - MMAT(rot, 2, 2) = TMAT(2, 2) - fDot * MMAT(rot, 2, 0); - fDot = MMAT(rot, 0, 1) * TMAT(0, 2) + MMAT(rot, 1, 1) * TMAT(1, 2) + MMAT(rot, 2, 1) * TMAT(2, 2); - MMAT(rot, 0, 2) -= fDot * MMAT(rot, 0, 1); - MMAT(rot, 1, 2) -= fDot * MMAT(rot, 1, 1); - MMAT(rot, 2, 2) -= fDot * MMAT(rot, 2, 1); - invLength = Math::InvSqrt(MMAT(rot, 0, 2) * MMAT(rot, 0, 2) + MMAT(rot, 1, 2) * MMAT(rot, 1, 2) + MMAT(rot, 2, 2) * MMAT(rot, 2, 2)); - MMAT(rot, 0, 2) *= invLength; - MMAT(rot, 1, 2) *= invLength; - MMAT(rot, 2, 2) *= invLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = MMAT(rot, 0, 0) * MMAT(rot, 1, 1) * MMAT(rot, 2, 2) + MMAT(rot, 0, 1) * MMAT(rot, 1, 2) * MMAT(rot, 2, 0) + - MMAT(rot, 0, 2) * MMAT(rot, 1, 0) * MMAT(rot, 2, 1) - MMAT(rot, 0, 2) * MMAT(rot, 1, 1) * MMAT(rot, 2, 0) - - MMAT(rot, 0, 1) * MMAT(rot, 1, 0) * MMAT(rot, 2, 2) - MMAT(rot, 0, 0) * MMAT(rot, 1, 2) * MMAT(rot, 2, 1); - - if (fDet < 0.0f) - { - for (uint32 r = 0; r < 3; ++r) - { - for (uint32 c = 0; c < 3; ++c) - { - MMAT(rot, r, c) = -MMAT(rot, r, c); - } - } - } - - translation = GetTranslation(); - } - - /* - // init from pos/rot/scale/shear - void Matrix::Set(const Vector3& translation, const AZ::Quaternion& rotation, const Vector3& scale, const Vector3& shear) - { - // convert quat to matrix - const float xx=rotation.x*rotation.x; - const float xy=rotation.x*rotation.y, yy=rotation.y*rotation.y; - const float xz=rotation.x*rotation.z, yz=rotation.y*rotation.z, zz=rotation.z*rotation.z; - const float xw=rotation.x*rotation.w, yw=rotation.y*rotation.w, zw=rotation.z*rotation.w, ww=rotation.w*rotation.w; - TMAT(0,0) = +xx-yy-zz+ww; TMAT(0,1) = +xy+zw+xy+zw; TMAT(0,2) = +xz-yw+xz-yw; TMAT(0,3) = 0.0f; - TMAT(1,0) = +xy-zw+xy-zw; TMAT(1,1) = -xx+yy-zz+ww; TMAT(1,2) = +yz+xw+yz+xw; TMAT(1,3) = 0.0f; - TMAT(2,0) = +xz+yw+xz+yw; TMAT(2,1) = +yz-xw+yz-xw; TMAT(2,2) = -xx-yy+zz+ww; TMAT(2,3) = 0.0f; - TMAT(3,0) = translation.x; TMAT(3,1) = translation.y; TMAT(3,2) = translation.z; TMAT(3,3) = 1.0f; - - // scale - TMAT(0,0) *= scale.x; - TMAT(0,1) *= scale.y; - TMAT(0,2) *= scale.z; - TMAT(1,0) *= scale.x; - TMAT(1,1) *= scale.y; - TMAT(1,2) *= scale.z; - TMAT(2,0) *= scale.x; - TMAT(2,1) *= scale.y; - TMAT(2,2) *= scale.z; - - // multiply with the shear matrix - float v[3]; - v[0] = TMAT(0,0); - v[1] = TMAT(0,1); - v[2] = TMAT(0,2); - TMAT(0,1) = v[0]*shear.x + v[1]; - TMAT(0,2) = v[0]*shear.y + v[1]*shear.z + v[2]; - - v[0] = TMAT(1,0); - v[1] = TMAT(1,1); - v[2] = TMAT(1,2); - TMAT(1,1) = v[0]*shear.x + v[1]; - TMAT(1,2) = v[0]*shear.y + v[1]*shear.z + v[2]; - - v[0] = TMAT(2,0); - v[1] = TMAT(2,1); - v[2] = TMAT(2,2); - TMAT(2,1) = v[0]*shear.x + v[1]; - TMAT(2,2) = v[0]*shear.y + v[1]*shear.z + v[2]; - - // translation - TMAT(3,0) = translation.x; - TMAT(3,1) = translation.y; - TMAT(3,2) = translation.z; - TMAT(3,3) = 1.0f; - } - */ - - //------------------------------------------------------- - /* - // decompose using QR decomposition (householder) - void Matrix::DecomposeQRHouseHolder(Vector3& outTranslation, AZ::Quaternion& outRotation, Vector3& outScale, Vector3& outShear) - { - // extract translation - outTranslation = GetTranslation(); - SetTranslation( Vector3(0.0f, 0.0f, 0.0f) ); - - // decompose into the two matrices first - Matrix Q; - Matrix R; - DecomposeQRHouseHolder(Q, R); - SetTranslation( outTranslation ); - - // extract scale - outScale.Set( MMAT(R,0,0), MMAT(R,1,1), MMAT(R,2,2) ); - - // extract shear - const float invScaleX = 1.0f / outScale.x; // TODO: handle 0 scale? - outShear.x = MMAT(R, 0, 1) * invScaleX; - outShear.y = MMAT(R, 0, 2) * invScaleX; - outShear.z = MMAT(R, 1, 2) / outScale.y; - - // convert the rotation into a AZ::Quaternion - outRotation.FromMatrix( Q ); - } - - - - // decompose using QR decomposition - void Matrix::DecomposeQRHouseHolder(Vector3& outTranslation, AZ::Quaternion& outRotation, Vector3& outScale) - { - // extract translation - outTranslation = GetTranslation(); - SetTranslation( Vector3(0.0f, 0.0f, 0.0f) ); - - // decompose into the two matrices first - Matrix Q; - Matrix R; - DecomposeQRHouseHolder(Q, R); - SetTranslation( outTranslation ); - - // extract scale - outScale.Set( MMAT(R,0,0), MMAT(R,1,1), MMAT(R,2,2) ); - - // convert the rotation into a AZ::Quaternion - outRotation.FromMatrix( Q ); - } - - - // decompose using QR decomposition - void Matrix::DecomposeQRHouseHolder(Vector3& outTranslation, AZ::Quaternion& outRotation) - { - // extract translation - outTranslation = GetTranslation(); - SetTranslation( Vector3(0.0f, 0.0f, 0.0f) ); - - // decompose into the two matrices first - Matrix Q; - Matrix R; - DecomposeQRHouseHolder(Q, R); - SetTranslation( outTranslation ); - - // convert the rotation into a AZ::Quaternion - outRotation.FromMatrix( Q ); - } - - - // decompose into Q (rotation) and R (scale/shear/translation) matrices - void Matrix::DecomposeQRHouseHolder(Matrix& Q, Matrix& R) - { - float mag; - float alpha; - Vector4 u; - Vector4 v; - Matrix P; - Matrix I; - - I.Identity(); - P.Identity(); - - Q.Identity(); - R = *this; - - for (uint32 i=0; i<4; i++) - { - u.Zero(); - v.Zero(); - - mag = 0.0f; - for (uint32 j=i; j<4; ++j) - { - u[j] = MMAT(R, j, i); - mag += u[j] * u[j]; - } - - mag = Math::SafeSqrt(mag); - alpha = u[i] < 0 ? mag : -mag; - - mag = 0.0f; - for (uint32 j=i; j<4; ++j) - { - v[j] = (j == i) ? u[j] + alpha : u[j]; - mag += v[j] * v[j]; - } - - mag = Math::SafeSqrt(mag); - if (mag < Math::epsilon) - continue; - - const float invMag = 1.0f / mag; - for (uint32 j=i; j<4; j++) - v[j] *= invMag; - - //P = I - (v * v.Transpose()) * 2.0; - P = I - OuterProduct(v, v) * 2.0f; - - //R = P * R; - //Q = Q * P; - R.MultMatrix(P, R); - Q.MultMatrix(P); - } - } - //------------------------------------------------------- - */ - - // basically does (vecA * vecB.Transposed()) and results in a 4x4 matrix - Matrix Matrix::OuterProduct(const AZ::Vector4& column, const AZ::Vector4& row) - { - Matrix result; - - for (uint32 r = 0; r < 4; ++r) - { - for (uint32 c = 0; c < 4; ++c) - { - MMAT(result, r, c) = column.GetElement(r) * row.GetElement(c); - } - } - - return result; - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/Matrix4.h b/Gems/EMotionFX/Code/MCore/Source/Matrix4.h deleted file mode 100644 index 5d6da79bf5..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/Matrix4.h +++ /dev/null @@ -1,917 +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 - -// includes -#include -#include "StandardHeaders.h" -#include "Vector.h" -#include "PlaneEq.h" -#include "LogManager.h" -#include -#include -#include - -// matrix order -#define MCORE_MATRIX_ROWMAJOR - -// matrix element access -#ifdef MCORE_MATRIX_ROWMAJOR - #define MMAT(matrix, row, col) matrix.m44[row][col] - #define TMAT(row, col) m44[row][col] -#else - #define MMAT(matrix, row, col) matrix.m44[col][row] - #define TMAT(row, col) m44[col][row] -#endif - - -namespace AZ { class Quaternion; } - -namespace MCore -{ - /** - * Depracated. Please use AZ::Transform instead. - * A 4x4 matrix class. - * Matrices can for example be used to transform points or vectors. - * Transforming means moving to another coordinate system. With matrices you can do things like: translate (move), rotate and scale. - * One single matrix can store a translation, rotation and scale. If we have only a rotation inside the matrix, this means that if we - * multiply the matrix with a vector, the vector will rotate by the rotation inside the matrix! The cool thing is that you can also - * concatenate matrices. In other words, you can multiply matrices with eachother. If you have a rotation matrix, like described above, and - * also have a translation matrix, then multiplying these two matrices with eachother will result in a new matrix, which contains both the - * rotation and the translation! So when you multiply this resulting matrix with a vector, it will both translate and rotate. - * But, does it first rotate and then translate in the rotated space? Or does it first translate and then rotate? - * For example if you want to rotate a planet, while it's moving, you want to rotate it in it's local coordinate system. Like when you spin - * a globe you can have on your desk. So where it spins around it's own center. However, if the planet is at location (10,10,10) in 3D space for example - * it is also possible that rotates around the origin in world space (0,0,0). The order of multiplication between matrices matters. - * This means that (matrixA * matrixB) does not have to not result in the same as (matrixB * matrixA). - * - * Here is some information about how the matrices are stored internally: - * - * [00 01 02 03] // m16 offsets
- * [04 05 06 07]
- * [08 09 10 11]
- * [12 13 14 15]
- * - * [00 01 02 03] // m44 offsets --> [row][column]
- * [10 11 12 13]
- * [20 21 22 23]
- * [30 31 32 33]
- * - * [Xx Xy Xz 0] // right
- * [Yx Yy Yz 0] // up
- * [Zx Zy Zz 0] // forward
- * [Tx Ty Tz 1] // translation
- * - */ - class MCORE_API alignas(16) Matrix - { - public: - /** - * Default constructor. - * This leaves the matrix uninitialized. - */ - MCORE_INLINE Matrix() {} - - /** - * Init the matrix using given float data. - * The number of elements stored at the float pointer location that is used as parameter must be at least 16 floats in size. - * @param elementData A pointer to the matrix float data, which must be 16 floats in size, or more, although only the first 16 floats are used. - */ - MCORE_INLINE explicit Matrix(const float* elementData) { MCore::MemCopy(m_m16, elementData, sizeof(float) * 16); } - - /** - * Copy constructor. - * @param m The matrix to copy the data from. - */ - MCORE_INLINE Matrix(const Matrix& m); - - MCORE_INLINE Matrix(const AZ::Matrix4x4& m) - { - TMAT(0, 0) = m.GetElement(0, 0); - TMAT(0, 1) = m.GetElement(0, 1); - TMAT(0, 2) = m.GetElement(0, 2); - TMAT(0, 3) = m.GetElement(0, 3); - TMAT(1, 0) = m.GetElement(1, 0); - TMAT(1, 1) = m.GetElement(1, 1); - TMAT(1, 2) = m.GetElement(1, 2); - TMAT(1, 3) = m.GetElement(1, 3); - TMAT(2, 0) = m.GetElement(2, 0); - TMAT(2, 1) = m.GetElement(2, 1); - TMAT(2, 2) = m.GetElement(2, 2); - TMAT(2, 3) = m.GetElement(2, 3); - TMAT(3, 0) = m.GetElement(3, 0); - TMAT(3, 1) = m.GetElement(3, 1); - TMAT(3, 2) = m.GetElement(3, 2); - TMAT(3, 3) = m.GetElement(3, 3); - } - - void InitFromPosRot(const AZ::Vector3& pos, const AZ::Quaternion& rot); - void InitFromPosRotScale(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale); - void InitFromNoScaleInherit(const AZ::Vector3& translation, const AZ::Quaternion& rotation, const AZ::Vector3& scale, const AZ::Vector3& invParentScale); - void InitFromPosRotScaleScaleRot(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Quaternion& scaleRot); - void InitFromPosRotScaleShear(const AZ::Vector3& pos, const AZ::Quaternion& rot, const AZ::Vector3& scale, const AZ::Vector3& shear); - - /** - * Sets the matrix to identity. - * When a matrix is an identity matrix it will have no influence. - */ - void Identity(); - - /** - * Makes the matrix a scaling matrix. - * Values of 1.0 would have no influence on the scale. Values of for example 2.0 would scale up by a factor of two. - * @param s The vector containing the scale values for each axis. - */ - void SetScaleMatrix(const AZ::Vector3& s); - - /** - * Makes this matrix a shear matrix from three different shear matrices: XY, XZ and YZ. - * The multiplication order is YZ * XZ * XY. - * @param s The shear values (x=XY, y=XZ, z=YZ) - */ - void SetShearMatrix(const AZ::Vector3& s); - - /** - * Makes this matrix a translation matrix. - * @param t The translation value. - */ - void SetTranslationMatrix(const AZ::Vector3& t); - - /** - * Initialize this matrix into a rotation matrix from a AZ::Quaternion. - * @param rotation The AZ::Quaternion representing the rotatation. - */ - void SetRotationMatrix(const AZ::Quaternion& rotation); - - /** - * Makes the matrix an rotation matrix along the x-axis. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixX(float angle); - - /** - * Makes the matrix a rotation matrix along the y-axis. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixY(float angle); - - /** - * Makes the matrix a rotation matrix along the z-axis. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixZ(float angle); - - /** - * Makes the matrix a rotation matrix around a given axis with a given angle. - * @param axis The axis to rotate around. - * @param angle The angle to rotate around this axis, in radians. - */ - void SetRotationMatrixAxisAngle(const AZ::Vector3& axis, float angle); - - /** - * Makes the matrix a rotation matrix given the euler angles. - * The multiplication order is RotMatrix(v.z) * RotMatrix(v.y) * RotMatrix(v.x). - * @param anglevec The vector containing the angles for each axis, in radians, so (pitch, yaw, roll) as (x,y,z). - */ - void SetRotationMatrixEulerZYX(const AZ::Vector3& anglevec); - - /** - * Initialize the matrix from a yaw, pitch and roll. - * Pitch is the rotation around the x-axis. - * Yaw is the rotation aroudn the y-axis. - * Roll is the rotation around the z-axis. - * All angles are in radians. - * @param pitch The pitch angle (rotation around x-axis), in radians. - * @param yaw The yaw angle (rotation around y-axis), in radians. - * @param roll The roll angle (rotation around z-axis), in radians. - */ - void SetRotationMatrixPitchYawRoll(float pitch, float yaw, float roll); - - /** - * Initialize the matrix from a yaw, pitch and roll. - * Pitch is the rotation around the x-axis. - * Yaw is the rotation aroudn the y-axis. - * Roll is the rotation around the z-axis. - * All angles are in radians. - * @param angles The angle for each axis, in radians. - */ - MCORE_INLINE void SetRotationMatrixPitchYawRoll(const AZ::Vector3& angles) { SetRotationMatrixPitchYawRoll(angles.GetX(), angles.GetY(), angles.GetZ()); } - - /** - * Makes the matrix a rotation matrix given the euler angles. - * The multiplication order is RotMatrix(v.x) * RotMatrix(v.y) * RotMatrix(v.z). - * @param anglevec The vector containing the angles for each axis, in radians, so (pitch, yaw, roll) as (x,y,z). - */ - void SetRotationMatrixEulerXYZ(const AZ::Vector3& anglevec); - - /** - * Inverse rotate a vector with this matrix. - * This means that the vector will be multiplied with the inverse rotation of this matrix. - * @param v The vector to rotate. - * @result The rotated vector. - */ - AZ::Vector3 InverseRot(const AZ::Vector3& v); - - /** - * Multiply this matrix with another matrix and stores the result in itself. - * @param right The matrix to multiply with. - */ - void MultMatrix(const Matrix& right); - - /** - * Multiply this matrix with another matrix, but only multiply the 4x3 part. - * So treat the other matrix as 4x3 matrix instead of 4x4 matrix. Stores the result in itself. - * @param right The matrix to multiply with. - */ - void MultMatrix4x3(const Matrix& right); - - /** - * Multiply two matrices together, but only the 4x3 part, and store the result in itself. - * @param left The left matrix. - * @param right The right matrix. - */ - void MultMatrix4x3(const Matrix& left, const Matrix& right); - - /** - * Multiply the left matrix with the right matrix and store the result in this matrix object. - * So basically this is a fast version of:
- *
-         * Matrix result = left * right;    // where left and right are also Matrix objects
-         * 
- * - * @param left The left matrix of the matrix multiply. - * @param right The right matrix of the matrix multiply. - */ - void MultMatrix(const Matrix& left, const Matrix& right); - - /** - * Multiply this matrix with the 3x3 rotation part of the other given matrix, and modify itself. - * @param right The matrix to multiply with. - */ - void MultMatrix3x3(const Matrix& right); - - MCORE_INLINE void Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, AZ::Vector3* outPos, AZ::Vector3* outNormal, float weight); - MCORE_INLINE void Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, float weight); - MCORE_INLINE void Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, const AZ::Vector3* inBitangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, AZ::Vector3* outBitangent, float weight); - - /** - * Perform skinning on an input vertex, and add the result to the output, weighted by a weight value. - * The calculation performed is: - * - *
-         * out += (in * thisMatrix) * weight;
-         * 
- * - * Only the 4x3 part of the matrix is used during the matrix multiply. - * So this should be used when skinning for example positions. - * @param in The input vector to skin. - * @param out The output vector. Keep in mind that the result will be added to the output vector. - * @param weight The weight value. - */ - MCORE_INLINE void Skin4x3(const AZ::Vector3& in, AZ::Vector3& out, float weight); - - /** - * Perform skinning on an input vertex, and add the result to the output, weighted by a weight value. - * The calculation performed is: - * - *
-         * out += (in * thisMatrix) * weight;
-         * 
- * - * Only the 3x3 part of the matrix is used during the matrix multiply. - * So this should be used to skin normals and tangents. - * @param in The input vector to skin. - * @param out The output vector. Keep in mind that the result will be added to the output vector. - * @param weight The weight value. - */ - MCORE_INLINE void Skin3x3(const AZ::Vector3& in, AZ::Vector3& out, float weight); - - /** - * Transpose the matrix (swap rows with columns). - */ - void Transpose(); - - /** - * Transpose the translation 1x3 translation part. - * Leaves the rotation in tact. - */ - void TransposeTranslation(); - - /** - * Adjoint this matrix. - */ - void Adjoint(); - - /** - * Inverse this matrix. - */ - void Inverse(); - - /** - * Makes this the inverse tranpose version of this matrix. - * The inverse transpose is the transposed version of the inverse. - */ - MCORE_INLINE void InverseTranspose(); - - /** - * Returns the inverse transposed version of this matrix. - * The inverse transpose is the transposed version of the inverse. - * @result The inverse transposed version of this matrix. - */ - MCORE_INLINE Matrix InverseTransposed() const; - - /** - * Orthonormalize this matrix (to prevent skewing or other errors). - * This normalizes the x, y and z vectors of the matrix. - * It makes sure that the axis vectors are perpendicular to eachother. - */ - void OrthoNormalize(); - - /** - * Normalizes the matrix, which means that all axis vectors (right, up, forward) - * will be made of unit length. - */ - void Normalize(); - - /** - * Returns a normalized version of this matrix. - * @result The normalized version of this matrix, where the right, up and forward vectors are of unit length. - */ - MCORE_INLINE Matrix Normalized() const; - - /** - * Scale this matrix. - * @param scale The scale factors for each axis. - */ - MCORE_INLINE void Scale(const AZ::Vector3& scale); - - /** - * Scale only the upper left 3x3 part of this matrix. - * So this doesn't scale the translation part. - * @param scale The scale factors for each axis. - */ - void Scale3x3(const AZ::Vector3& scale); - - AZ::Vector3 ExtractScale(); - - /** - * Rotate this matrix around the x-axis. - * @param angle The rotation in radians. - */ - void RotateX(float angle); - - /** - * Rotate this matrix around the y-axis. - * @param angle The rotation in radians. - */ - void RotateY(float angle); - - /** - * Rotate this matrix around the z-axis. - * @param angle The rotation in radians. - */ - void RotateZ(float angle); - - /** - * Initialize the matrix as a rotation matrix given two vectors. The resulting matrix rotates the vector 'from' such that it points - * in the same direction as the vector 'to'. - * @param from The vector that the resulting matrix rotates from. - * @param to The vector that the resulting matrix rotates to. - */ - void SetRotationMatrixTwoVectors(const AZ::Vector3& from, const AZ::Vector3& to); - - /** - * Multiply a vector with the 3x3 rotation part of this matrix. - * @param v The vector to transform. - * @result The transformed (rotated) vector. - */ - MCORE_INLINE AZ::Vector3 Mul3x3(const AZ::Vector3& v) const; - - /** - * Returns the inversed version of this matrix. - * @result The inversed version of this matrix. - */ - MCORE_INLINE Matrix Inversed() const { Matrix m(*this); m.Inverse(); return m; } - - /** - * Returns the transposed version of this matrix. - * @result The transposed version of this matrix. - */ - MCORE_INLINE Matrix Transposed() const { Matrix m(*this); m.Transpose(); return m; } - - /** - * Returns the adjointed version of this matrix. - * @result The adjointed version of this matrix. - */ - MCORE_INLINE Matrix Adjointed() const { Matrix m(*this); m.Adjoint(); return m; } - - /** - * Translate the matrix. - * @param x The number of units to add to the current translation along the x-axis. - * @param y The number of units to add to the current translation along the y-axis. - * @param z The number of units to add to the current translation along the z-axis. - */ - MCORE_INLINE void Translate(float x, float y, float z) { TMAT(3, 0) += x; TMAT(3, 1) += y; TMAT(3, 2) += z; } - - /** - * Translate the matrix. - * @param t The vector containing the translation to add to the current translation of the matrix. - */ - MCORE_INLINE void Translate(const AZ::Vector3& t) { TMAT(3, 0) += t.GetX(); TMAT(3, 1) += t.GetY(); TMAT(3, 2) += t.GetZ(); } - - /** - * Set the values for a given row, using a 3D vector. - * Only the first 3 values on the row will be touched, so the 4th value will remain untouched inside the specified row of the matrix. - * @param row A zero-based index of the row. - * @param value The values to set in the row. - */ - MCORE_INLINE void SetRow(uint32 row, const AZ::Vector3& value) { TMAT(row, 0) = value.GetX(); TMAT(row, 1) = value.GetY(); TMAT(row, 2) = value.GetZ(); } - - /** - * Set the values in the given row, using a 4D vector. - * @param row A zero-based index of the row. - * @param value The values to set in the row. - */ - MCORE_INLINE void SetRow(uint32 row, const AZ::Vector4& value) { TMAT(row, 0) = value.GetX(); TMAT(row, 1) = value.GetY(); TMAT(row, 2) = value.GetZ(); TMAT(row, 3) = value.GetW(); } - - /** - * Set the values for a given column, using a 3D vector. - * Only the first 3 values on the column will be touched, so the 4th value will remain untouched inside the specified column of the matrix. - * @param column A zero-based index of the column. - * @param value The values to set in the column. - */ - MCORE_INLINE void SetColumn(uint32 column, const AZ::Vector3& value) { TMAT(0, column) = value.GetX(); TMAT(1, column) = value.GetY(); TMAT(2, column) = value.GetZ(); } - - /** - * Set the values for a given column, using a 4D vector. - * @param column A zero-based index of the column. - * @param value The values to set in the column. - */ - MCORE_INLINE void SetColumn(uint32 column, const AZ::Vector4& value) { TMAT(0, column) = value.GetX(); TMAT(1, column) = value.GetY(); TMAT(2, column) = value.GetZ(); TMAT(3, column) = value.GetW(); } - - /** - * Get the values of a given row as 3D vector. - * @param row A zero-based index of the row number ot get. - * @result The vector containing the values of the specified row. - */ - MCORE_INLINE AZ::Vector3 GetRow(uint32 row) const { return AZ::Vector3(TMAT(row, 0), TMAT(row, 1), TMAT(row, 2)); } - - /** - * Get the values of a given row as 4D vector. - * @param column A zero-based index of the row number ot get. - * @result The vector containing the values of the specified row. - */ - MCORE_INLINE AZ::Vector3 GetColumn(uint32 column) const { return AZ::Vector3(TMAT(0, column), TMAT(1, column), TMAT(2, column)); } - - /** - * Get the values of a given column as 3D vector. - * @param row A zero-based index of the column number ot get. - * @result The vector containing the values of the specified column. - */ - MCORE_INLINE AZ::Vector4 GetRow4D(uint32 row) const { return AZ::Vector4(TMAT(row, 0), TMAT(row, 1), TMAT(row, 2), TMAT(row, 3)); } - - /** - * Get the values of a given column as 4D vector. - * @param column A zero-based index of the column number ot get. - * @result The vector containing the values of the specified column. - */ - MCORE_INLINE AZ::Vector4 GetColumn4D(uint32 column) const { return AZ::Vector4(TMAT(0, column), TMAT(1, column), TMAT(2, column), TMAT(3, column)); } - - /** - * Set the right vector (must be normalized). - * @param xx The x component of the right vector. - * @param xy The y component of the right vector. - * @param xz The z component of the right vector. - */ - MCORE_INLINE void SetRight(float xx, float xy, float xz); - - /** - * Set the right vector. - * @param x The right vector, must be normalized. - */ - MCORE_INLINE void SetRight(const AZ::Vector3& x); - - /** - * Set the up vector (must be normalized). - * @param yx The x component of the up vector. - * @param yy The y component of the up vector. - * @param yz The z component of the up vector. - */ - MCORE_INLINE void SetUp(float yx, float yy, float yz); - - /** - * Set the up vector (must be normalized). - * @param y The up vector. - */ - MCORE_INLINE void SetUp(const AZ::Vector3& y); - - /** - * Set the forward vector (must be normalized). - * @param zx The x component of the forward vector. - * @param zy The y component of the forward vector. - * @param zz The z component of the forward vector. - */ - MCORE_INLINE void SetForward(float zx, float zy, float zz); - - /** - * Set the forward vector (must be normalized). - * @param z The forward vector. - */ - MCORE_INLINE void SetForward(const AZ::Vector3& z); - - /** - * Set the translation part of the matrix. - * @param tx The translation along the x-axis. - * @param ty The translation along the y-axis. - * @param tz The translation along the z-axis. - */ - MCORE_INLINE void SetTranslation(float tx, float ty, float tz); - - /** - * Set the translation part of the matrix. - * @param t The translation vector. - */ - MCORE_INLINE void SetTranslation(const AZ::Vector3& t); - - /** - * Get the right vector. - * @result The right vector (x-axis). - */ - MCORE_INLINE AZ::Vector3 GetRight() const; - - /** - * Get the up vector. - * @result The up vector (z-axis). - */ - MCORE_INLINE AZ::Vector3 GetUp() const; - - /** - * Get the forward vector. - * @result The forward vector (y-axis). - */ - MCORE_INLINE AZ::Vector3 GetForward() const; - - /** - * Get the translation part of the matrix. - * @result The vector containing the translation. - */ - MCORE_INLINE AZ::Vector3 GetTranslation() const; - - /** - * Calculates the determinant of the matrix. - * @result The determinant. - */ - float CalcDeterminant() const; - - /** - * Calculates the euler angles. - * @result The euler angles, describing the rotation along each axis, in radians. - */ - AZ::Vector3 CalcEulerAngles() const; - - /** - * Calculate the pitch, yaw and roll. - * Pitch is the rotation around the x axis. - * Yaw is the rotation around the y axis. - * Roll is the rotation around the z axis. - * All angles returned are in radians. - * @result The vector containing the rotation around each axis (x=pitch, y=yaw, z=roll). - */ - AZ::Vector3 CalcPitchYawRoll() const; - - /** - * Makes this matrix a mirrored version of a specified matrix. - * After executing this operation this matrix is the mirrored version of the specified matrix. - * @param transform The transformation matrix to mirror (so the original matrix). - * @param plane The plane to use as mirror. - */ - void Mirror(const Matrix& transform, const PlaneEq& plane); - - /** - * Makes this matrix a lookat matrix (also known as camera or view matrix). - * @param view The view position, so the position of the camera. - * @param target The target position, so where the camera is looking at. - * @param up The up vector, describing the roll of the camera, where (0,1,0) would mean the camera is straight up and has no roll and - * where (0,-1,0) would mean the camera is upside down, etc. - */ - void LookAt(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up); - - /** - * Makes this matrix a lookat matrix (also known as camera or view matrix), in right handed mode. - * @param view The view position, so the position of the camera. - * @param target The target position, so where the camera is looking at. - * @param up The up vector, describing the roll of the camera, where (0,1,0) would mean the camera is straight up and has no roll and - * where (0,-1,0) would mean the camera is upside down, etc. - */ - void LookAtRH(const AZ::Vector3& view, const AZ::Vector3& target, const AZ::Vector3& up); - - /** - * Makes this matrix a perspective projection matrix. - * @param fov The field of view, in radians. - * @param aspect The aspect ratio which is the width divided by height. - * @param zNear The distance to the near plane. - * @param zFar The distance to the far plane. - */ - void Perspective(float fov, float aspect, float zNear, float zFar); - - /** - * Makes this matrix a perspective projection matrix, in right handed mode. - * @param fov The field of view, in radians. - * @param aspect The aspect ratio which is the width divided by height. - * @param zNear The distance to the near plane. - * @param zFar The distance to the far plane. - */ - void PerspectiveRH(float fov, float aspect, float zNear, float zFar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void Ortho(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void OrthoRH(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void OrthoOffCenter(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix an ortho projection matrix, so without perspective. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void OrthoOffCenterRH(float left, float right, float top, float bottom, float znear, float zfar); - - /** - * Makes this matrix a frustum matrix. - * @param left The left of the image plane. - * @param right The right of the image plane. - * @param top The top of the image plane. - * @param bottom The bottom of the image plane. - * @param znear The distance to the near plane. - * @param zfar The distance to the far plane. - */ - void Frustum(float left, float right, float top, float bottom, float znear, float zfar); - - - // QR Gram-Schmidt decomposition - void DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot) const; - void DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale) const; - void DecomposeQRGramSchmidt(AZ::Vector3& translation, Matrix& rot, AZ::Vector3& scale, AZ::Vector3& shear) const; - - static Matrix OuterProduct(const AZ::Vector4& column, const AZ::Vector4& row); - - /** - * Get the handedness of the matrix, which described if the matrix is left- or right-handed. - * The value returned by this method is the dot product between the forward vector and the result of the - * cross product between the right and up vector. So: DotProduct( Cross(right, up), forward ); - * If the value returned by this method is positive we are dealing with a matrix which is in a right-handed - * coordinate system, otherwise we are dealing with a left-handed coordinate system. - * Performing an odd number of reflections reverses the handedness. An even number of reflections is always - * equivalent to a rotation, so any series of reflections can always be regarded as a single rotation followed - * by at most one reflection. - * If a reflection is present (think of a mirror) the handedness will be reversed. A reflection can be detected - * by looking at the determinant of the matrix. If the determinant is negative, then a reflection is present. - * @result The handedness of the matrix. If this value is positive we are dealing with a matrix in a right handed - * coordinate system. Otherwise we are dealing with one in a left-handed coordinate system. - * @see IsRightHanded() - * @see IsLeftHanded() - */ - float CalcHandedness() const; - - /** - * Check if this matrix is symmetric or not. - * A materix is said to be symmetric if and only if M(i, j) = M(j, i). - * That is, a matrix whose entries are symmetric about the main diagonal. - * @param tolerance The maximum difference tolerance between the M(i, j) and M(j, i) entries. - * The reason for having this tolerance is of course floating point inaccuracy which might have - * caused some entries to be a bit different. - * @result Returns true when the matrix is symmetric, or false when not. - */ - bool CheckIfIsSymmetric(float tolerance = 0.00001f) const; - - /** - * Check if this matrix is a diagonal matrix or not. - * A matrix is said to be a diagonal matrix when only the entries on the diagonal contain non-zero values. - * The tolerance value is needed because of possible floating point inaccuracies. - * @param tolerance The maximum difference between 0 and the entry on the diagonal. - * @result Returns true when the matrix is a diagonal matrix, otherwise false is returned. - */ - bool CheckIfIsDiagonal(float tolerance = 0.00001f) const; - - /** - * Check if the matrix is orthogonal or not. - * A matrix is orthogonal if the vectors in the matrix form an orthonormal set. - * This is when the vectors (right, up and forward) are perpendicular to eachother. - * If a matrix is orthogonal, the inverse of the matrix is equal to the transpose of the matrix. - * This assumption can be used to optimize specific calculations, since the inverse is slower to calculate than - * the transpose of the matrix. Also it can speed up by transforming normals with the matrix. - * In that example instead of having to use the inverse transpose matrix, you could just use the transpose of the matrix. - * @param tolerance The maximum tolerance in the orthonormal test. - * @result Returns true when the matrix is orthogonal, otherwise false is returned. - */ - bool CheckIfIsOrthogonal(float tolerance = 0.00001f) const; - - /** - * Check if the matrix is an identity matrix or not. - * @param tolerance The maximum error value per entry in the matrix. - * @result Returns true if this matrix is an identity matrix, otherwise false is returned. - */ - bool CheckIfIsIdentity(float tolerance = 0.00001f) const; - - /** - * Check if the matrix is left handed or not. - * @result Returns true when the matrix is left handed, otherwise false is returned (so then it is right handed). - */ - bool CheckIfIsLeftHanded() const; - - /** - * Check if the matrix is right handed or not. - * @result Returns true when the matrix is right handed, otherwise false is returned (so then it is left handed). - */ - bool CheckIfIsRightHanded() const; - - /** - * Check if this matrix is a pure rotation matrix or not. - * @param tolerance The maximum error in the measurement. - * @result Returns true when the matrix represents only a rotation, otherwise false is returned. - */ - bool CheckIfIsPureRotationMatrix(float tolerance = 0.00001f) const; - - /** - * Check if this matrix contains a reflection or not. - * @result Returns true when the matrix represents a reflection, otherwise false is returned. - */ - bool CheckIfIsReflective() const; - - AZ::Matrix4x4 ToAzMatrix() const - { -#ifdef MCORE_MATRIX_ROWMAJOR - return AZ::Matrix4x4::CreateFromRowMajorFloat16(m_m16); -#else - return AZ::Matrix4x4::CreateFromColumnMajorFloat16(m16); -#endif - } - - /** - * Prints the matrix into the logfile or debug output, using MCore::LogDetailedInfo(). - * Please note that the values are printed using floats or doubles. So it is not possible - * to use this method for printing matrices of vectors or something other than real numbers. - */ - void Log() const; - - /** - * Returns a translation matrix. - * @param v The translation of the matrix. - * @result The translation matrix having the specified translation. - */ - static MCORE_INLINE Matrix TranslationMatrix(const AZ::Vector3& v) { Matrix m; m.SetTranslationMatrix(v); return m; } - - /** - * Returns a rotation matrix from a AZ::Quaternion. - * @param rot The AZ::Quaternion that represents the rotation. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrix(const AZ::Quaternion& rot) { Matrix m; m.SetRotationMatrix(rot); return m; } - - /** - * Returns a rotation matrix, including a translation, where the rotation is represented by a AZ::Quaternion. - * @param rot The AZ::Quaternion that represents the rotation. - * @param trans The translation of the matrix. - * @result The rotation matrix, that includes a translation as well. - */ - static MCORE_INLINE Matrix RotationTranslationMatrix(const AZ::Quaternion& rot, const AZ::Vector3& trans) { Matrix m; m.InitFromPosRot(trans, rot); return m; } - - /** - * Returns a rotation matrix along the x-axis. - * @param rad The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixX(float rad) { Matrix m; m.SetRotationMatrixX(rad); return m; } - - /** - * Returns a rotation matrix along the y-axis. - * @param rad The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixY(float rad) { Matrix m; m.SetRotationMatrixY(rad); return m; } - - /** - * Returns a rotation matrix along the z-axis. - * @param rad The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixZ(float rad) { Matrix m; m.SetRotationMatrixZ(rad); return m; } - - /** - * Returns a rotation matrix along the x, y and z-axis. - * The multiplication order is RotMatrix(v.x) * RotMatrix(v.y) * RotMatrix(v.z). - * @param eulerAngles The euler angles in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixEulerXYZ(const AZ::Vector3& eulerAngles) { Matrix m; m.SetRotationMatrixEulerXYZ(eulerAngles); return m; } - - /** - * Returns a rotation matrix along the x, y and z-axis. - * The multiplication order is RotMatrix(v.z) * RotMatrix(v.y) * RotMatrix(v.x). - * @param eulerAngles The euler angles in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixEulerZYX(const AZ::Vector3& eulerAngles) { Matrix m; m.SetRotationMatrixEulerZYX(eulerAngles); return m; } - - /** - * Returns a rotation matrix given a pitch, yaw and roll. - * Pitch is the rotation around the x-axis. - * Yaw is the rotation aroudn the y-axis. - * Roll is the rotation around the z-axis. - * @param angles The rotation angles for each axis, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixPitchYawRoll(const AZ::Vector3& angles) { Matrix m; m.SetRotationMatrixPitchYawRoll(angles); return m; } - - /** - * Constructs a rotation matrix given two vectors. The resulting matrix rotates the vector 'from' such that it points - * in the same direction as the vector 'to'. - * @param from The vector that the resulting matrix rotates to. - * @param to The vector that the resulting matrix rotates from. - * @result The rotation matrix that rotates the vector 'from' into the vector 'to'. - */ - static MCORE_INLINE Matrix RotationMatrixTwoVectors(const AZ::Vector3& from, const AZ::Vector3& to) { Matrix m; m.SetRotationMatrixTwoVectors(from, to); return m; } - - /** - * Returns a rotation matrix from a given axis and angle. - * @param axis The axis to rotate around. - * @param angle The angle of rotation, in radians. - * @result A rotation matrix. - */ - static MCORE_INLINE Matrix RotationMatrixAxisAngle(const AZ::Vector3& axis, float angle) { Matrix m; m.SetRotationMatrixAxisAngle(axis, angle); return m; } - - /** - * Returns a scale matrix from a given scaling factor. - * @param s The vector containing the scaling factors for each axis. - * @result A scaling matrix. - */ - static MCORE_INLINE Matrix ScaleMatrix(const AZ::Vector3& s) { Matrix m; m.SetScaleMatrix(s); return m; } - - /** - * Returns a shear matrix created from three different shear matrices: XY, XZ and YZ. - * The multiplication order is YZ * XZ * XY. - * @param s The shear values (x=XY, y=XZ, z=YZ) - * @result The shear matrix. - */ - static MCORE_INLINE Matrix ShearMatrix(const AZ::Vector3& s) { Matrix m; m.SetShearMatrix(s); return m; } - - // operators - Matrix operator + (const Matrix& right) const; - Matrix operator - (const Matrix& right) const; - Matrix operator * (const Matrix& right) const; - Matrix operator * (float value) const; - Matrix& operator += (const Matrix& right); - Matrix& operator -= (const Matrix& right); - Matrix& operator *= (const Matrix& right); - Matrix& operator *= (float value); - MCORE_INLINE void operator = (const Matrix& right); - - // attributes - union - { - float m_m16[16]; // 16 floats as 1D array - float m44[4][4]; // as 2D array - }; - }; - - - // include inline code -#include "Matrix4.inl" -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/Matrix4.inl b/Gems/EMotionFX/Code/MCore/Source/Matrix4.inl deleted file mode 100644 index 99900abcee..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/Matrix4.inl +++ /dev/null @@ -1,330 +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 - * - */ - -MCORE_INLINE Matrix::Matrix(const Matrix& m) -{ - MCore::MemCopy(m_m16, m.m_m16, sizeof(Matrix)); -} - - -MCORE_INLINE void Matrix::operator = (const Matrix& right) -{ - MCore::MemCopy(m_m16, right.m_m16, sizeof(Matrix)); -} - - - -MCORE_INLINE void Matrix::SetRight(float xx, float xy, float xz) -{ - TMAT(0, 0) = xx; - TMAT(0, 1) = xy; - TMAT(0, 2) = xz; -} - - - -MCORE_INLINE void Matrix::SetUp(float yx, float yy, float yz) -{ - TMAT(1, 0) = yx; - TMAT(1, 1) = yy; - TMAT(1, 2) = yz; -} - - - -MCORE_INLINE void Matrix::SetForward(float zx, float zy, float zz) -{ - TMAT(2, 0) = zx; - TMAT(2, 1) = zy; - TMAT(2, 2) = zz; -} - - - -MCORE_INLINE void Matrix::SetTranslation(float tx, float ty, float tz) -{ - TMAT(3, 0) = tx; - TMAT(3, 1) = ty; - TMAT(3, 2) = tz; -} - - - -MCORE_INLINE void Matrix::SetRight(const AZ::Vector3& x) -{ - TMAT(0, 0) = x.GetX(); - TMAT(0, 1) = x.GetY(); - TMAT(0, 2) = x.GetZ(); -} - - - -MCORE_INLINE void Matrix::SetUp(const AZ::Vector3& y) -{ - TMAT(1, 0) = y.GetX(); - TMAT(1, 1) = y.GetY(); - TMAT(1, 2) = y.GetZ(); -} - - - -MCORE_INLINE void Matrix::SetForward(const AZ::Vector3& z) -{ - TMAT(2, 0) = z.GetX(); - TMAT(2, 1) = z.GetY(); - TMAT(2, 2) = z.GetZ(); -} - - - -MCORE_INLINE void Matrix::SetTranslation(const AZ::Vector3& t) -{ - TMAT(3, 0) = t.GetX(); - TMAT(3, 1) = t.GetY(); - TMAT(3, 2) = t.GetZ(); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetRight() const -{ - //return *reinterpret_cast( m16/* + 0*/); - return AZ::Vector3(TMAT(0, 0), TMAT(0, 1), TMAT(0, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetForward() const -{ - // return *reinterpret_cast(m16+4); - return AZ::Vector3(TMAT(1, 0), TMAT(1, 1), TMAT(1, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetUp() const -{ - // return *reinterpret_cast(m16+8); - return AZ::Vector3(TMAT(2, 0), TMAT(2, 1), TMAT(2, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::GetTranslation() const -{ - //return *reinterpret_cast(m16+12); - return AZ::Vector3(TMAT(3, 0), TMAT(3, 1), TMAT(3, 2)); -} - - - -MCORE_INLINE AZ::Vector3 Matrix::Mul3x3(const AZ::Vector3& v) const -{ - return AZ::Vector3( - v.GetX() * TMAT(0, 0) + v.GetY() * TMAT(1, 0) + v.GetZ() * TMAT(2, 0), - v.GetX() * TMAT(0, 1) + v.GetY() * TMAT(1, 1) + v.GetZ() * TMAT(2, 1), - v.GetX() * TMAT(0, 2) + v.GetY() * TMAT(1, 2) + v.GetZ() * TMAT(2, 2)); -} - - - -MCORE_INLINE void operator *= (AZ::Vector3& v, const Matrix& m) -{ - v = AZ::Vector3( - v.GetX() * MMAT(m, 0, 0) + v.GetY() * MMAT(m, 1, 0) + v.GetZ() * MMAT(m, 2, 0) + MMAT(m, 3, 0), - v.GetX() * MMAT(m, 0, 1) + v.GetY() * MMAT(m, 1, 1) + v.GetZ() * MMAT(m, 2, 1) + MMAT(m, 3, 1), - v.GetX() * MMAT(m, 0, 2) + v.GetY() * MMAT(m, 1, 2) + v.GetZ() * MMAT(m, 2, 2) + MMAT(m, 3, 2)); -} - - - -MCORE_INLINE void operator *= (AZ::Vector4& v, const Matrix& m) -{ - v = AZ::Vector4( - v.GetX() * MMAT(m, 0, 0) + v.GetY() * MMAT(m, 1, 0) + v.GetZ() * MMAT(m, 2, 0) + v.GetW() * MMAT(m, 3, 0), - v.GetX() * MMAT(m, 0, 1) + v.GetY() * MMAT(m, 1, 1) + v.GetZ() * MMAT(m, 2, 1) + v.GetW() * MMAT(m, 3, 1), - v.GetX() * MMAT(m, 0, 2) + v.GetY() * MMAT(m, 1, 2) + v.GetZ() * MMAT(m, 2, 2) + v.GetW() * MMAT(m, 3, 2), - v.GetX() * MMAT(m, 0, 3) + v.GetY() * MMAT(m, 1, 3) + v.GetZ() * MMAT(m, 2, 3) + v.GetW() * MMAT(m, 3, 3)); -} - - - -MCORE_INLINE AZ::Vector3 operator * (const AZ::Vector3& v, const Matrix& m) -{ - return AZ::Vector3( - v.GetX() * MMAT(m, 0, 0) + v.GetY() * MMAT(m, 1, 0) + v.GetZ() * MMAT(m, 2, 0) + MMAT(m, 3, 0), - v.GetX() * MMAT(m, 0, 1) + v.GetY() * MMAT(m, 1, 1) + v.GetZ() * MMAT(m, 2, 1) + MMAT(m, 3, 1), - v.GetX() * MMAT(m, 0, 2) + v.GetY() * MMAT(m, 1, 2) + v.GetZ() * MMAT(m, 2, 2) + MMAT(m, 3, 2)); -} - - - - -// skin a vertex position -MCORE_INLINE void Matrix::Skin4x3(const AZ::Vector3& in, AZ::Vector3& out, float weight) -{ - out.Set( - out.GetX() + (in.GetX() * TMAT(0, 0) + in.GetY() * TMAT(1, 0) + in.GetZ() * TMAT(2, 0) + TMAT(3, 0)) * weight, - out.GetY() + (in.GetX() * TMAT(0, 1) + in.GetY() * TMAT(1, 1) + in.GetZ() * TMAT(2, 1) + TMAT(3, 1)) * weight, - out.GetZ() + (in.GetX() * TMAT(0, 2) + in.GetY() * TMAT(1, 2) + in.GetZ() * TMAT(2, 2) + TMAT(3, 2)) * weight - ); -} - - -// skin a position and normal -MCORE_INLINE void Matrix::Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, AZ::Vector3* outPos, AZ::Vector3* outNormal, float weight) -{ - const float mat00 = TMAT(0, 0); - const float mat10 = TMAT(1, 0); - const float mat20 = TMAT(2, 0); - const float mat30 = TMAT(3, 0); - const float mat01 = TMAT(0, 1); - const float mat11 = TMAT(1, 1); - const float mat21 = TMAT(2, 1); - const float mat31 = TMAT(3, 1); - const float mat02 = TMAT(0, 2); - const float mat12 = TMAT(1, 2); - const float mat22 = TMAT(2, 2); - const float mat32 = TMAT(3, 2); - - outPos->Set( - outPos->GetX() + (inPos->GetX() * mat00 + inPos->GetY() * mat10 + inPos->GetZ() * mat20 + mat30) * weight, - outPos->GetY() + (inPos->GetX() * mat01 + inPos->GetY() * mat11 + inPos->GetZ() * mat21 + mat31) * weight, - outPos->GetZ() + (inPos->GetX() * mat02 + inPos->GetY() * mat12 + inPos->GetZ() * mat22 + mat32) * weight - ); - - outNormal->Set( - outNormal->GetX() + (inNormal->GetX() * mat00 + inNormal->GetY() * mat10 + inNormal->GetZ() * mat20) * weight, - outNormal->GetY() + (inNormal->GetX() * mat01 + inNormal->GetY() * mat11 + inNormal->GetZ() * mat21) * weight, - outNormal->GetZ() + (inNormal->GetX() * mat02 + inNormal->GetY() * mat12 + inNormal->GetZ() * mat22) * weight - ); -} - - -// skin a position, normal, and tangent -MCORE_INLINE void Matrix::Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, float weight) -{ - const float mat00 = TMAT(0, 0); - const float mat10 = TMAT(1, 0); - const float mat20 = TMAT(2, 0); - const float mat30 = TMAT(3, 0); - const float mat01 = TMAT(0, 1); - const float mat11 = TMAT(1, 1); - const float mat21 = TMAT(2, 1); - const float mat31 = TMAT(3, 1); - const float mat02 = TMAT(0, 2); - const float mat12 = TMAT(1, 2); - const float mat22 = TMAT(2, 2); - const float mat32 = TMAT(3, 2); - - outPos->Set( - outPos->GetX() + (inPos->GetX() * mat00 + inPos->GetY() * mat10 + inPos->GetZ() * mat20 + mat30) * weight, - outPos->GetY() + (inPos->GetX() * mat01 + inPos->GetY() * mat11 + inPos->GetZ() * mat21 + mat31) * weight, - outPos->GetZ() + (inPos->GetX() * mat02 + inPos->GetY() * mat12 + inPos->GetZ() * mat22 + mat32) * weight - ); - - outNormal->Set( - outNormal->GetX() + (inNormal->GetX() * mat00 + inNormal->GetY() * mat10 + inNormal->GetZ() * mat20) * weight, - outNormal->GetY() + (inNormal->GetX() * mat01 + inNormal->GetY() * mat11 + inNormal->GetZ() * mat21) * weight, - outNormal->GetZ() + (inNormal->GetX() * mat02 + inNormal->GetY() * mat12 + inNormal->GetZ() * mat22) * weight - ); - - outTangent->Set( - outTangent->GetX() + (inTangent->GetX() * mat00 + inTangent->GetY() * mat10 + inTangent->GetZ() * mat20) * weight, - outTangent->GetY() + (inTangent->GetX() * mat01 + inTangent->GetY() * mat11 + inTangent->GetZ() * mat21) * weight, - outTangent->GetZ() + (inTangent->GetX() * mat02 + inTangent->GetY() * mat12 + inTangent->GetZ() * mat22) * weight, - inTangent->GetW() - ); -} - -// skin a position, normal, and tangent and bitangent -MCORE_INLINE void Matrix::Skin(const AZ::Vector3* inPos, const AZ::Vector3* inNormal, const AZ::Vector4* inTangent, const AZ::Vector3* inBitangent, AZ::Vector3* outPos, AZ::Vector3* outNormal, AZ::Vector4* outTangent, AZ::Vector3* outBitangent, float weight) -{ - const float mat00 = TMAT(0, 0); - const float mat10 = TMAT(1, 0); - const float mat20 = TMAT(2, 0); - const float mat30 = TMAT(3, 0); - const float mat01 = TMAT(0, 1); - const float mat11 = TMAT(1, 1); - const float mat21 = TMAT(2, 1); - const float mat31 = TMAT(3, 1); - const float mat02 = TMAT(0, 2); - const float mat12 = TMAT(1, 2); - const float mat22 = TMAT(2, 2); - const float mat32 = TMAT(3, 2); - - outPos->Set( - outPos->GetX() + (inPos->GetX() * mat00 + inPos->GetY() * mat10 + inPos->GetZ() * mat20 + mat30) * weight, - outPos->GetY() + (inPos->GetX() * mat01 + inPos->GetY() * mat11 + inPos->GetZ() * mat21 + mat31) * weight, - outPos->GetZ() + (inPos->GetX() * mat02 + inPos->GetY() * mat12 + inPos->GetZ() * mat22 + mat32) * weight - ); - - outNormal->Set( - outNormal->GetX() + (inNormal->GetX() * mat00 + inNormal->GetY() * mat10 + inNormal->GetZ() * mat20) * weight, - outNormal->GetY() + (inNormal->GetX() * mat01 + inNormal->GetY() * mat11 + inNormal->GetZ() * mat21) * weight, - outNormal->GetZ() + (inNormal->GetX() * mat02 + inNormal->GetY() * mat12 + inNormal->GetZ() * mat22) * weight - ); - - outTangent->Set( - outTangent->GetX() + (inTangent->GetX() * mat00 + inTangent->GetY() * mat10 + inTangent->GetZ() * mat20) * weight, - outTangent->GetY() + (inTangent->GetX() * mat01 + inTangent->GetY() * mat11 + inTangent->GetZ() * mat21) * weight, - outTangent->GetZ() + (inTangent->GetX() * mat02 + inTangent->GetY() * mat12 + inTangent->GetZ() * mat22) * weight, - inTangent->GetW() - ); - - outBitangent->Set( - outBitangent->GetX() + (inBitangent->GetX() * mat00 + inBitangent->GetY() * mat10 + inBitangent->GetZ() * mat20) * weight, - outBitangent->GetY() + (inBitangent->GetX() * mat01 + inBitangent->GetY() * mat11 + inBitangent->GetZ() * mat21) * weight, - outBitangent->GetZ() + (inBitangent->GetX() * mat02 + inBitangent->GetY() * mat12 + inBitangent->GetZ() * mat22) * weight - ); -} - - -// skin a normal -MCORE_INLINE void Matrix::Skin3x3(const AZ::Vector3& in, AZ::Vector3& out, float weight) -{ - out.Set( - out.GetX() + (in.GetX() * TMAT(0, 0) + in.GetY() * TMAT(1, 0) + in.GetZ() * TMAT(2, 0)) * weight, - out.GetY() + (in.GetX() * TMAT(0, 1) + in.GetY() * TMAT(1, 1) + in.GetZ() * TMAT(2, 1)) * weight, - out.GetZ() + (in.GetX() * TMAT(0, 2) + in.GetY() * TMAT(1, 2) + in.GetZ() * TMAT(2, 2)) * weight - ); -} - - -// multiply by a float -MCORE_INLINE Matrix& Matrix::operator *= (float value) -{ - for (uint32 i = 0; i < 16; ++i) - { - m_m16[i] *= value; - } - - return *this; -} - - -// scale (uniform) -MCORE_INLINE void Matrix::Scale(const AZ::Vector3& scale) -{ - for (uint32 i = 0; i < 4; ++i) - { - TMAT(i, 0) *= scale.GetX(); - TMAT(i, 1) *= scale.GetY(); - TMAT(i, 2) *= scale.GetZ(); - } -} - - -// returns a normalized version of this matrix -Matrix Matrix::Normalized() const -{ - Matrix result(*this); - result.Normalize(); - return result; -} - diff --git a/Gems/EMotionFX/Code/MCore/mcore_files.cmake b/Gems/EMotionFX/Code/MCore/mcore_files.cmake index d33041eaf8..c1203cb72e 100644 --- a/Gems/EMotionFX/Code/MCore/mcore_files.cmake +++ b/Gems/EMotionFX/Code/MCore/mcore_files.cmake @@ -79,9 +79,6 @@ set(FILES Source/LogManager.cpp Source/LogManager.h Source/Macros.h - Source/Matrix4.cpp - Source/Matrix4.h - Source/Matrix4.inl Source/MCoreSystem.cpp Source/MCoreSystem.h Source/MemoryCategoriesCore.h diff --git a/Gems/EMotionFX/Code/Tests/Matchers.h b/Gems/EMotionFX/Code/Tests/Matchers.h index 9f7b9017ba..61370aafa0 100644 --- a/Gems/EMotionFX/Code/Tests/Matchers.h +++ b/Gems/EMotionFX/Code/Tests/Matchers.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -89,27 +88,3 @@ inline bool IsCloseMatcherP::gmock_Impl -template<> -inline bool IsCloseMatcherP::gmock_Impl::MatchAndExplain(const MCore::Matrix& arg, ::testing::MatchResultListener* result_listener) const -{ - using ::testing::FloatEq; - using ::testing::ExplainMatchResult; - return ExplainMatchResult(FloatEq(expected.m_m16[0]), arg.m_m16[0], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[1]), arg.m_m16[1], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[2]), arg.m_m16[2], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[3]), arg.m_m16[3], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[4]), arg.m_m16[4], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[5]), arg.m_m16[5], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[6]), arg.m_m16[6], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[7]), arg.m_m16[7], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[8]), arg.m_m16[8], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[9]), arg.m_m16[9], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[10]), arg.m_m16[10], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[11]), arg.m_m16[11], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[12]), arg.m_m16[12], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[13]), arg.m_m16[13], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[14]), arg.m_m16[14], result_listener) - && ExplainMatchResult(FloatEq(expected.m_m16[15]), arg.m_m16[15], result_listener); -} diff --git a/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp b/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp index b5f98bc5e8..bc63f6f9bd 100644 --- a/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp +++ b/Gems/EMotionFX/Code/Tests/TransformUnitTests.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include From 0abbdcd4ac235d9b31b4b5e5fc527d453c070c45 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:20:31 -0800 Subject: [PATCH 170/394] Removes PlaneEq.cpp/inl and TriangleListOptimizer.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp | 81 ------- Gems/EMotionFX/Code/MCore/Source/PlaneEq.h | 39 --- Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl | 33 --- .../Code/MCore/Source/TriangleListOptimizer.h | 223 ------------------ Gems/EMotionFX/Code/MCore/mcore_files.cmake | 3 - 5 files changed, 379 deletions(-) delete mode 100644 Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp delete mode 100644 Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl delete mode 100644 Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h diff --git a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp deleted file mode 100644 index fd64974fb1..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.cpp +++ /dev/null @@ -1,81 +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 required headers -#include "PlaneEq.h" - -namespace MCore -{ - // clip points against the plane - bool PlaneEq::Clip(const AZStd::vector& pointsIn, AZStd::vector& pointsOut) const - { - size_t numPoints = pointsIn.size(); - - MCORE_ASSERT(&pointsIn != &pointsOut); - MCORE_ASSERT(numPoints >= 2); - - size_t vert1 = numPoints - 1; - float firstDist = CalcDistanceTo(pointsIn[vert1]); - float nextDist = firstDist; - bool firstIn = (firstDist >= 0.0f); - bool nextIn = firstIn; - - pointsOut.clear(); - - if (numPoints == 2) - { - numPoints = 1; - } - - for (int32 vert2 = 0; vert2 < numPoints; vert2++) - { - float dist = nextDist; - bool in = nextIn; - - nextDist = CalcDistanceTo(pointsIn[vert2]); - nextIn = (nextDist >= 0.0f); - - if (in) - { - pointsOut.emplace_back(pointsIn[vert1]); - } - - if ((in != nextIn) && (dist != 0.0f) && (nextDist != 0.0f)) - { - AZ::Vector3 dir = (pointsIn[vert2] - pointsIn[vert1]); - - float frac = dist / (dist - nextDist); - if ((frac > 0.0f) && (frac < 1.0f)) - { - pointsOut.emplace_back(pointsIn[vert1] + frac * dir); - } - } - - vert1 = vert2; - } - - //if (numPoints == 1) - // return (pointsOut.GetLength() > 1); - - return (pointsOut.size() > 1); - } - - - // clip a set of vectors to this plane - bool PlaneEq::Clip(AZStd::vector& points) const - { - AZStd::vector pointsOut; - if (Clip(points, pointsOut)) - { - points = pointsOut; - return true; - } - - return false; - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h index df8738a1ee..3c8954a29a 100644 --- a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h +++ b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.h @@ -147,43 +147,6 @@ namespace MCore */ MCORE_INLINE float GetDist() const { return m_dist; } - /** - * Checks if a given axis aligned bounding box (AABB) is partially above (aka in front) this plane or not. - * The Frustum class uses this method to check if a box is partially inside a the frustum or not. - * @param box The axis aligned bounding box to perform the test with. - * @result Returns true when 'box' is partially (or completely) above the plane or not. - */ - MCORE_INLINE bool PartiallyAbove(const AABB& box) const; - - /** - * Check if a given axis aligned bounding box (AABB) is completely above (aka in front) this plane or not. - * The Frustum class uses this method to check if a box is completely inside a the frustum or not. - * @param box The axis aligned bounding box to perform the test with. - * @result Returns true when 'box' is completely above the plane or not. - */ - MCORE_INLINE bool CompletelyAbove(const AABB& box) const; - - /** - * Clips a set of 3D points to this plane. - * Actually these are not just points, but edges. The edges go from point 0 to 1, from 1 to 2, etc. - * Beware that the clipped number of points can be higher as the ones you input to this method. - * This method can be used to pretty easily clip polygon data against the plane. - * @param pointsIn The array of points (and edges) to be clipped to the planes. - * @param pointsOut The array of clipped points (and edges). Note that (pointsOut.GetLength() > pointsIn.GetLength()) can be true. - * @result Returns true when the points have been clipped. False is returned when the clipping resulted in 0 output points. - */ - bool Clip(const AZStd::vector& pointsIn, AZStd::vector& pointsOut) const; - - /** - * Clip a set of 3D points to this plane. - * Actually these are not just points, but edges. The edges go from point 0 to 1, from 1 to 2, etc. - * Beware that the clipped number of points can be higher as the ones you input to this method. - * This method can be used to pretty easily clip polygon data against the plane. - * @param points The set of points (or edges) to clip. When done, points contains the clipped points. - * @result Returns true when the points have been clipped. False is returned when the clipping resulted in 0 points. In that last case 'points' won't be effected and contains just the original input points. - */ - bool Clip(AZStd::vector& points) const; - /** * Project a vector onto the plane. * @param vectorToProject The vector you wish to project onto the plane. @@ -197,6 +160,4 @@ namespace MCore float m_dist; /**< The D in the plane equation (Ax + By + Cz + D = 0). */ }; - // include the inline code -#include "PlaneEq.inl" } // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl b/Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl deleted file mode 100644 index 62ccb19551..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/PlaneEq.inl +++ /dev/null @@ -1,33 +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 - * - */ - - -// check if the box is partially above the plane -MCORE_INLINE bool PlaneEq::PartiallyAbove(const AABB& box) const -{ - const AZ::Vector3 minVec = box.GetMin(); - const AZ::Vector3 maxVec = box.GetMax(); - const AZ::Vector3 testPoint(IsNegative(float(m_normal.GetX())) ? minVec.GetX() : maxVec.GetX(), - IsNegative(static_cast(m_normal.GetY())) ? minVec.GetY() : maxVec.GetY(), - IsNegative(static_cast(m_normal.GetZ())) ? minVec.GetZ() : maxVec.GetZ()); - - return IsPositive(m_normal.Dot(testPoint) + m_dist); -} - - -// check if the box is completely above the plane -MCORE_INLINE bool PlaneEq::CompletelyAbove(const AABB& box) const -{ - const AZ::Vector3 minVec = box.GetMin(); - const AZ::Vector3 maxVec = box.GetMax(); - const AZ::Vector3 testPoint(IsPositive(m_normal.GetX()) ? minVec.GetX() : maxVec.GetX(), - IsPositive(m_normal.GetY()) ? minVec.GetY() : maxVec.GetY(), - IsPositive(m_normal.GetZ()) ? minVec.GetZ() : maxVec.GetZ()); - - return IsPositive(m_normal.Dot(testPoint) + m_dist); -} diff --git a/Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h b/Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h deleted file mode 100644 index 38e5df8de4..0000000000 --- a/Gems/EMotionFX/Code/MCore/Source/TriangleListOptimizer.h +++ /dev/null @@ -1,223 +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 MCore -{ - /** - * The triangle list optimizer. - * This can be used to improve cache efficiency. It reorders the index buffers to maximize the number of cache hits. - */ - template - class TriangleListOptimizer - { - public: - /** - * The constructor. - * @param numCacheEntries The cache size in number of elements. Smaller values often result in better optimizations. - */ - TriangleListOptimizer(size_t numCacheEntries = 8); - - /** - * Optimizes an index buffer. - * This will modify the input triangle list index buffer. - * Each triangle needs three indices. - * @param triangleList The index buffer. - * @param numIndices The number of indices inside the specified index buffer. - */ - void OptimizeIndexBuffer(IndexType* triangleList, size_t numIndices); - - /** - * Calculate the number of cache hits that the a given triange list would get. - * Higher values will be better than lower values. - * @param triangleList The index buffer, with three indices per triangle. - * @param numIndices The number of indices. - * @result The number of cache hits. - */ - size_t CalcNumCacheHits(IndexType* triangleList, size_t numIndices); - - private: - AZStd::vector m_entries{}; - size_t m_numUsedEntries = 0; /**< The number of used cache entries. */ - size_t m_oldestEntry = 0; /**< The index to the oldest entry, which will be overwritten first when the cache is full. */ - - void Flush(); - - /** - * Calculate the number of cache hits for a given triangle. - * @param indexA The first vertex index. - * @param indexB The second vertex index. - * @param indexC The third vertex index. - * @result The number of cache hits that this triangle would give. - */ - size_t CalcNumCacheHits(IndexType indexA, IndexType indexB, IndexType indexC) const; - - /** - * Add an index value to the cache. - * @param vertexIndex The vertex index value. - */ - void AddToCache(IndexType vertexIndex); - }; - - template - TriangleListOptimizer::TriangleListOptimizer(size_t numCacheEntries) - { - // We never push more items than this capacity. The vector stores the - // max number of entries for us in its capacity() method. - m_entries.set_capacity(numCacheEntries); - } - - template - void TriangleListOptimizer::OptimizeIndexBuffer(IndexType* triangleList, size_t numIndices) - { - Flush(); - - // create a temporary buffer - AZStd::vector newBuffer(numIndices); - size_t maxIndices = numIndices; - - // for all triangles in the triangle list - for (size_t f = 0; f < numIndices; f += 3) - { - size_t mostEfficient = 0; - size_t mostHits = 0; - - for (size_t i = 0; i < maxIndices; i += 3) - { - // get the triangle indices - const IndexType indexA = triangleList[i]; - const IndexType indexB = triangleList[i + 1]; - const IndexType indexC = triangleList[i + 2]; - - // calculate how many hits this triangle would give - size_t numHits = CalcNumCacheHits(indexA, indexB, indexC); - - // if the number of hits is the maximum hits we can score, use this triangle - if (numHits == 3) - { - mostHits = numHits; - mostEfficient = i; - break; - } - - // check if this gives more hits than any other triangle we tested before - if (numHits > mostHits) - { - mostHits = numHits; - mostEfficient = i; - } - } - - // insert the triangle that gave most cache hits to the new triangle list - AddToCache(triangleList[mostEfficient]); - AddToCache(triangleList[mostEfficient + 1]); - AddToCache(triangleList[mostEfficient + 2]); - newBuffer[f] = triangleList[mostEfficient]; - newBuffer[f + 1] = triangleList[mostEfficient + 1]; - newBuffer[f + 2] = triangleList[mostEfficient + 2]; - - // remove the triangle from the old list, so that we don't test it anymore next time, since we already inserted it inside the new optimized list - AZStd::move( - /*input first*/ triangleList + mostEfficient + 3, - /*input last*/ triangleList + maxIndices, - /*output first*/ triangleList + mostEfficient); - - // we need to test one less triangle next time, since we just added one of the triangles to the new list - // so there is one less left - maxIndices -= 3; - } - - // copy the results - AZStd::copy(begin(newBuffer), end(newBuffer), triangleList); - } - - // calculate the number of cache hits - template - size_t TriangleListOptimizer::CalcNumCacheHits(IndexType* triangleList, size_t numIndices) - { - // clear the cache - Flush(); - - size_t totalHits = 0; - - // for all triangles in the triangle list - for (size_t f = 0; f < numIndices; f += 3) - { - const IndexType indexA = triangleList[f]; - const IndexType indexB = triangleList[f + 1]; - const IndexType indexC = triangleList[f + 2]; - - totalHits += CalcNumCacheHits(indexA, indexB, indexC); - - AddToCache(indexA); - AddToCache(indexB); - AddToCache(indexC); - } - - return totalHits; - } - - template - void TriangleListOptimizer::Flush() - { - m_numUsedEntries = 0; - m_oldestEntry = 0; - m_entries.clear(); - } - - // calculate the number of cache hits for a triangle - template - size_t TriangleListOptimizer::CalcNumCacheHits(IndexType indexA, IndexType indexB, IndexType indexC) const - { - size_t total = 0; - - // check all cache entries - for (IndexType entryValue : m_entries) - { - if (entryValue == indexA || entryValue == indexB || entryValue == indexC) - { - total++; - } - if (total == 3) - { - break; - } - } - - return total; - } - - // get a value from the cache - template - void TriangleListOptimizer::AddToCache(IndexType vertexIndex) - { - // check if this entry is already in the cache, if so we have a cache hit and can quit - const auto entryIt = AZStd::find(m_entries.begin(), m_entries.end(), vertexIndex); - if (entryIt != m_entries.end()) - { - return; - } - - // the entry is not inside the cache and the cache is not full yet, we can simply insert the cache entry and return - if (m_numUsedEntries < m_entries.capacity()) - { - m_entries.emplace_back(vertexIndex); - ++m_numUsedEntries; - return; - } - - // the cache is full, remove one of the entries - // since we simulate a FIFO cache, we have to remove the oldest entry - m_entries[m_oldestEntry] = vertexIndex; - ++m_oldestEntry %= m_entries.capacity(); - } -} // namespace MCore diff --git a/Gems/EMotionFX/Code/MCore/mcore_files.cmake b/Gems/EMotionFX/Code/MCore/mcore_files.cmake index c1203cb72e..7468b4f60d 100644 --- a/Gems/EMotionFX/Code/MCore/mcore_files.cmake +++ b/Gems/EMotionFX/Code/MCore/mcore_files.cmake @@ -91,9 +91,7 @@ set(FILES Source/MemoryTracker.cpp Source/MemoryTracker.h Source/MultiThreadManager.h - Source/PlaneEq.cpp Source/PlaneEq.h - Source/PlaneEq.inl Source/Random.cpp Source/Random.h Source/Ray.cpp @@ -109,6 +107,5 @@ set(FILES Source/StringIdPool.h Source/ReflectionSerializer.cpp Source/ReflectionSerializer.h - Source/TriangleListOptimizer.h Source/Vector.h ) From 94fa49da4997e84d26d2d1d663b8222c6331d3bb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:28:41 -0800 Subject: [PATCH 171/394] Removes Tests/Mocks/AnimGraphObjectData.h from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Tests/AnimGraphParameterCommandsTests.cpp | 1 - .../Code/Tests/Mocks/AnimGraphObjectData.h | 14 -------------- Gems/EMotionFX/Code/emotionfx_tests_files.cmake | 1 - 3 files changed, 16 deletions(-) delete mode 100644 Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp index 2f5a661850..1eae86587c 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphParameterCommandsTests.cpp @@ -102,7 +102,6 @@ namespace AnimGraphParameterCommandsTests #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h b/Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h deleted file mode 100644 index 83831708d1..0000000000 --- a/Gems/EMotionFX/Code/Tests/Mocks/AnimGraphObjectData.h +++ /dev/null @@ -1,14 +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 - * - */ - -namespace EMotionFX -{ - class AnimGraphObjectData - { - }; -} diff --git a/Gems/EMotionFX/Code/emotionfx_tests_files.cmake b/Gems/EMotionFX/Code/emotionfx_tests_files.cmake index c418998a8f..98d7809fe9 100644 --- a/Gems/EMotionFX/Code/emotionfx_tests_files.cmake +++ b/Gems/EMotionFX/Code/emotionfx_tests_files.cmake @@ -132,7 +132,6 @@ set(FILES Tests/Mocks/AnimGraphManager.h Tests/Mocks/AnimGraphNode.h Tests/Mocks/AnimGraphObject.h - Tests/Mocks/AnimGraphObjectData.h Tests/Mocks/AnimGraphStateTransition.h Tests/Mocks/BlendTreeParameterNode.h Tests/Mocks/Command.h From b982d5627b6cf9949aee43c67a42637fc7869c24 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 12:45:55 -0800 Subject: [PATCH 172/394] Removes unused IRecognizerMock.h from Gems/Gestures Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Gestures/Code/Mocks/IRecognizerMock.h | 25 ---------------------- 1 file changed, 25 deletions(-) delete mode 100644 Gems/Gestures/Code/Mocks/IRecognizerMock.h diff --git a/Gems/Gestures/Code/Mocks/IRecognizerMock.h b/Gems/Gestures/Code/Mocks/IRecognizerMock.h deleted file mode 100644 index c698c8285a..0000000000 --- a/Gems/Gestures/Code/Mocks/IRecognizerMock.h +++ /dev/null @@ -1,25 +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 - -namespace Gestures -{ - class RecognizerMock - : public IRecognizer - { - public: - MOCK_CONST_METHOD0(GetPriority, - int32_t()); - MOCK_METHOD2(OnPressedEvent, - bool(const Vec2&screenPositionPixels, uint32_t pointerIndex)); - MOCK_METHOD2(OnDownEvent, - bool(const Vec2&screenPositionPixels, uint32_t pointerIndex)); - MOCK_METHOD2(OnReleasedEvent, - bool(const Vec2&screenPositionPixels, uint32_t pointerIndex)); - }; -} From 8c6cc2ea046140219934819aafa7799861686b39 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 12:49:10 -0800 Subject: [PATCH 173/394] Removes EditorGradientComponentBase.cpp from Gems/GradientSignal Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Gestures/Code/gestures_test_files.cmake | 1 - .../Editor/EditorGradientComponentBase.cpp | 16 ---------------- .../Code/gradientsignal_editor_files.cmake | 1 - 3 files changed, 18 deletions(-) delete mode 100644 Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp diff --git a/Gems/Gestures/Code/gestures_test_files.cmake b/Gems/Gestures/Code/gestures_test_files.cmake index 26667e96e2..c3b648b55d 100644 --- a/Gems/Gestures/Code/gestures_test_files.cmake +++ b/Gems/Gestures/Code/gestures_test_files.cmake @@ -11,5 +11,4 @@ set(FILES Tests/GestureRecognizerClickOrTapTests.cpp Tests/GestureRecognizerPinchTests.cpp Tests/GesturesTest.cpp - Mocks/IRecognizerMock.h ) diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp b/Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp deleted file mode 100644 index 9edfd92c3a..0000000000 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientComponentBase.cpp +++ /dev/null @@ -1,16 +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 - -namespace GradientSignal -{ -} //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake b/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake index 787b767002..3470fa6b87 100644 --- a/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_editor_files.cmake @@ -21,7 +21,6 @@ set(FILES Source/Editor/EditorConstantGradientComponent.h Source/Editor/EditorDitherGradientComponent.cpp Source/Editor/EditorDitherGradientComponent.h - Source/Editor/EditorGradientComponentBase.cpp Source/Editor/EditorGradientSurfaceDataComponent.cpp Source/Editor/EditorGradientSurfaceDataComponent.h Source/Editor/EditorGradientTransformComponent.cpp From 78ae3fdb805733266ae0a644b8ab1305d9f93a2c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:19:05 -0800 Subject: [PATCH 174/394] Removes tools.cpp from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/tools.cpp | 85 ------------------- Gems/GraphCanvas/Code/graphcanvas_files.cmake | 1 - 2 files changed, 86 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/Source/tools.cpp diff --git a/Gems/GraphCanvas/Code/Source/tools.cpp b/Gems/GraphCanvas/Code/Source/tools.cpp deleted file mode 100644 index 79d32dbf5e..0000000000 --- a/Gems/GraphCanvas/Code/Source/tools.cpp +++ /dev/null @@ -1,85 +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 - -#include - -////////// -// Tools -////////// - -QDebug operator<<(QDebug debug, const AZ::Entity* entity) -{ - QDebugStateSaver saver(debug); - if (!entity) - { - debug.nospace() << "Entity(nullptr)"; - return debug; - } - - const AZStd::string id = entity->GetId().ToString(); - const AZStd::string& name = entity->GetName(); - - QString state; - switch (entity->GetState()) - { - case AZ::Entity::State::Init: - state = "ES_INIT"; - break; - case AZ::Entity::State::Constructed: - state = "ES_CONSTRUCTED"; - break; - case AZ::Entity::State::Active: - state = "ES_ACTIVE"; - break; - default: - state = "ES_BAD_STATE"; - break; - } - - debug.nospace() << "Entity(" << QString(id.c_str()) << ", " << state << ", \"" << QString(name.c_str()) << "\")"; - - return debug; -} - -QDebug operator<<(QDebug debug, const AZ::EntityId& entity) -{ - const AZ::Entity* actual = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(actual, &AZ::ComponentApplicationRequests::FindEntity, entity); - - return operator<<(debug, actual); -} - -QDebug operator<<(QDebug debug, const AZ::Component* component) -{ - QDebugStateSaver saver(debug); - if (!component) - { - debug.nospace() << "Component(nullptr)"; - return debug; - } - - std::ostringstream converter; - converter << std::hex << component->GetId(); - - debug.nospace() << "Component(" << QString::fromStdString(converter.str()) << " {" << component->GetEntity() << "})"; - - return debug; -} - -QDebug operator<<(QDebug debug, const AZ::Vector2& position) -{ - QDebugStateSaver saver(debug); - debug.nospace() << "Vector2(" << position.GetX() << ", " << position.GetY() << ")"; - return debug; -} diff --git a/Gems/GraphCanvas/Code/graphcanvas_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_files.cmake index cf586e16ac..8ba9fd3073 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_files.cmake @@ -16,7 +16,6 @@ set(FILES Source/GraphCanvas.h Source/GraphCanvasModule.h Source/GraphCanvasEditorModule.cpp - Source/tools.cpp Source/Components/BookmarkManagerComponent.cpp Source/Components/BookmarkManagerComponent.h Source/Components/GeometryComponent.cpp From 640f4980cd2c664233bcfe3def857e169ca2ac5d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:21:00 -0800 Subject: [PATCH 175/394] Removes VariableReferenceNodePropertyDisplay.h/cpp from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../VariableReferenceNodePropertyDisplay.cpp | 420 ------------------ .../VariableReferenceNodePropertyDisplay.h | 159 ------- 2 files changed, 579 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp delete mode 100644 Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h diff --git a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp b/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp deleted file mode 100644 index 2d8ff18c3a..0000000000 --- a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.cpp +++ /dev/null @@ -1,420 +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 -#include - -namespace GraphCanvas -{ - ////////////////////// - // VariableItemModel - ////////////////////// - - VariableItemModel::VariableItemModel() - { - } - - VariableItemModel::~VariableItemModel() - { - } - - int VariableItemModel::rowCount(const QModelIndex& parent) const - { - return static_cast(m_variableIds.size()); - } - - QVariant VariableItemModel::data(const QModelIndex& index, int role) const - { - int row = index.row(); - AZ::EntityId variableId = FindVariableIdForRow(row); - - if (variableId.IsValid()) - { - switch (role) - { - case Qt::DisplayRole: - { - AZStd::string variableName; - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - return QString(variableName.c_str()); - } - case Qt::EditRole: - { - AZStd::string variableName; - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - return QString(variableName.c_str()); - } - default: - break; - } - } - else - { - switch (role) - { - case Qt::DisplayRole: - { - return QString("Unreferenced"); - } - case Qt::EditRole: - { - return QString("Unreferenced"); - } - default: - break; - } - } - - return QVariant(); - } - - QVariant VariableItemModel::headerData(int section, Qt::Orientation orientation, int role) const - { - return QVariant(); - } - - Qt::ItemFlags VariableItemModel::flags(const QModelIndex& index) const - { - return Qt::ItemFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - } - - void VariableItemModel::SetSceneId(const AZ::EntityId& sceneId) - { - m_sceneId = sceneId; - } - - void VariableItemModel::SetDataType(const AZ::Uuid& variableType) - { - if (m_dataType != variableType) - { - m_dataType = variableType; - } - } - - void VariableItemModel::RefreshData() - { - layoutAboutToBeChanged(); - ClearData(); - - m_variableIds.emplace_back(AZ::EntityId()); - - if (m_dataType == AZStd::any::TYPEINFO_Uuid()) - { - SceneVariableRequestBus::EnumerateHandlersId(m_sceneId, [this](SceneVariableRequests* variableRequests) - { - m_variableIds.emplace_back(variableRequests->GetVariableId()); - return true; - }); - } - else - { - SceneVariableRequestBus::EnumerateHandlersId(m_sceneId, [this](SceneVariableRequests* variableRequests) - { - AZ::EntityId variableId = variableRequests->GetVariableId(); - AZ::Uuid dataType; - VariableRequestBus::EventResult(dataType, variableId, &VariableRequests::GetDataType); - - if (dataType == m_dataType) - { - m_variableIds.emplace_back(variableRequests->GetVariableId()); - } - return true; - }); - } - - layoutChanged(); - } - - void VariableItemModel::ClearData() - { - layoutAboutToBeChanged(); - m_variableIds.clear(); - layoutChanged(); - } - - int VariableItemModel::FindRowForVariable(const AZ::EntityId& variableId) const - { - int row = -1; - - for (int i = 0; i < static_cast(m_variableIds.size()); ++i) - { - if (m_variableIds[i] == variableId) - { - row = i; - break; - } - } - - return row; - } - - AZ::EntityId VariableItemModel::FindVariableIdForRow(int row) const - { - if (row >= 0 && row < m_variableIds.size()) - { - return m_variableIds[row]; - } - - return AZ::EntityId(); - } - - AZ::EntityId VariableItemModel::FindVariableIdForName(const AZStd::string& variableName) const - { - AZ::EntityId variableId; - - QString lowerName = QString(variableName.c_str()).toLower(); - - GraphCanvas::SceneVariableRequestBus::EnumerateHandlersId(m_sceneId, [&lowerName, &variableId](GraphCanvas::SceneVariableRequests* sceneVariable) - { - AZ::EntityId testId = sceneVariable->GetVariableId(); - - AZStd::string testName; - GraphCanvas::VariableRequestBus::EventResult(testName, testId, &GraphCanvas::VariableRequests::GetVariableName); - - QString lowerTextName = QString(testName.c_str()).toLower(); - - if (lowerTextName.compare(lowerName) == 0) - { - variableId = testId; - } - - return !variableId.IsValid(); - }); - - return variableId; - } - - //////////////////////////// - // VariableSelectionWidget - //////////////////////////// - - VariableSelectionWidget::VariableSelectionWidget() - : QWidget(nullptr) - , m_lineEdit(aznew Internal::FocusableLineEdit()) - , m_itemModel(aznew VariableItemModel()) - { - m_completer = new QCompleter(m_itemModel, this); - m_completer->setCaseSensitivity(Qt::CaseInsensitive); - m_completer->setCompletionMode(QCompleter::InlineCompletion); - - m_lineEdit->setCompleter(m_completer); - m_lineEdit->setPlaceholderText("Select Variable..."); - - m_layout = new QVBoxLayout(this); - m_layout->addWidget(m_lineEdit); - - setContentsMargins(0, 0, 0, 0); - m_layout->setContentsMargins(0, 0, 0, 0); - - setLayout(m_layout); - - QObject::connect(m_lineEdit, &Internal::FocusableLineEdit::OnFocusIn, this, &VariableSelectionWidget::HandleFocusIn); - QObject::connect(m_lineEdit, &Internal::FocusableLineEdit::OnFocusOut, this, &VariableSelectionWidget::HandleFocusOut); - QObject::connect(m_lineEdit, &Internal::FocusableLineEdit::returnPressed, this, &VariableSelectionWidget::SubmitName); - } - - VariableSelectionWidget::~VariableSelectionWidget() - { - } - - void VariableSelectionWidget::SetSceneId(const AZ::EntityId& sceneId) - { - m_itemModel->SetSceneId(sceneId); - } - - void VariableSelectionWidget::SetDataType(const AZ::Uuid& dataType) - { - m_itemModel->SetDataType(dataType); - } - - void VariableSelectionWidget::OnEscape() - { - SetSelectedVariable(m_initialVariable); - m_lineEdit->selectAll(); - } - - void VariableSelectionWidget::HandleFocusIn() - { - m_itemModel->RefreshData(); - emit OnFocusIn(); - - AzToolsFramework::EditorEvents::Bus::Handler::BusConnect(); - } - - void VariableSelectionWidget::HandleFocusOut() - { - m_itemModel->ClearData(); - emit OnFocusOut(); - - SetSelectedVariable(m_initialVariable); - - AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect(); - } - - void VariableSelectionWidget::SubmitName() - { - AZStd::string variableName = m_lineEdit->text().toUtf8().data(); - AZ::EntityId variableId = m_itemModel->FindVariableIdForName(variableName); - - if (variableId.IsValid()) - { - SetSelectedVariable(variableId); - m_lineEdit->selectAll(); - } - else - { - QSignalBlocker block(m_lineEdit); - m_lineEdit->setText(""); - } - - emit OnVariableSelected(variableId); - } - - void VariableSelectionWidget::SetSelectedVariable(const AZ::EntityId& variableId) - { - QSignalBlocker blocker(m_lineEdit); - - AZStd::string variableName; - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - - m_lineEdit->setText(variableName.c_str()); - - m_initialVariable = variableId; - } - - ///////////////////////////////////////// - // VariableReferenceNodePropertyDisplay - ///////////////////////////////////////// - - VariableReferenceNodePropertyDisplay::VariableReferenceNodePropertyDisplay(VariableReferenceDataInterface* dataInterface) - : m_variableReferenceDataInterface(dataInterface) - { - m_variableReferenceDataInterface->RegisterDisplay(this); - - m_disabledLabel = aznew GraphCanvasLabel(); - m_displayLabel = aznew GraphCanvasLabel(); - - m_proxyWidget = new QGraphicsProxyWidget(); - - m_variableSelectionWidget = aznew VariableSelectionWidget(); - m_variableSelectionWidget->setProperty("HasNoWindowDecorations", true); - - m_proxyWidget->setWidget(m_variableSelectionWidget); - - m_variableSelectionWidget->SetDataType(dataInterface->GetVariableDataType()); - - QObject::connect(m_variableSelectionWidget, &VariableSelectionWidget::OnFocusIn, [this]() { EditStart(); }); - QObject::connect(m_variableSelectionWidget, &VariableSelectionWidget::OnFocusOut, [this]() { EditFinished(); }); - QObject::connect(m_variableSelectionWidget, &VariableSelectionWidget::OnVariableSelected, [this](const AZ::EntityId& variableId) { AssignVariable(variableId); }); - - RegisterShortcutDispatcher(m_variableSelectionWidget); - } - - VariableReferenceNodePropertyDisplay::~VariableReferenceNodePropertyDisplay() - { - delete m_variableReferenceDataInterface; - - delete m_disabledLabel; - delete m_displayLabel; - } - - void VariableReferenceNodePropertyDisplay::RefreshStyle() - { - m_disabledLabel->SetSceneStyle(GetSceneId(), NodePropertyDisplay::CreateDisabledLabelStyle("variable").c_str()); - m_displayLabel->SetSceneStyle(GetSceneId(), NodePropertyDisplay::CreateDisplayLabelStyle("variable").c_str()); - - m_variableSelectionWidget->setMinimumSize(m_displayLabel->GetStyleHelper().GetMinimumSize().toSize()); - } - - void VariableReferenceNodePropertyDisplay::UpdateDisplay() - { - VariableNotificationBus::Handler::BusDisconnect(); - - AZ::EntityId variableId = m_variableReferenceDataInterface->GetVariableReference(); - - DisplayVariableString(variableId); - - m_variableSelectionWidget->SetSelectedVariable(variableId); - - if (variableId.IsValid()) - { - VariableNotificationBus::Handler::BusConnect(variableId); - } - } - - QGraphicsLayoutItem* VariableReferenceNodePropertyDisplay::GetDisabledGraphicsLayoutItem() const - { - return m_disabledLabel; - } - - QGraphicsLayoutItem* VariableReferenceNodePropertyDisplay::GetDisplayGraphicsLayoutItem() const - { - return m_displayLabel; - } - - QGraphicsLayoutItem* VariableReferenceNodePropertyDisplay::GetEditableGraphicsLayoutItem() const - { - return m_proxyWidget; - } - - void VariableReferenceNodePropertyDisplay::OnNameChanged() - { - AZ::EntityId variableId = m_variableReferenceDataInterface->GetVariableReference(); - - DisplayVariableString(variableId); - } - - void VariableReferenceNodePropertyDisplay::OnVariableActivated() - { - AZ::EntityId variableId = m_variableReferenceDataInterface->GetVariableReference(); - - DisplayVariableString(variableId); - } - - void VariableReferenceNodePropertyDisplay::OnIdSet() - { - m_variableSelectionWidget->SetSceneId(GetSceneId()); - } - - void VariableReferenceNodePropertyDisplay::DisplayVariableString(const AZ::EntityId& variableId) - { - AZStd::string variableName = "Select Variable"; - - if (variableId.IsValid()) - { - VariableRequestBus::EventResult(variableName, variableId, &VariableRequests::GetVariableName); - } - - m_displayLabel->SetLabel(variableName.c_str()); - } - - void VariableReferenceNodePropertyDisplay::EditStart() - { - NodePropertiesRequestBus::Event(GetNodeId(), &NodePropertiesRequests::LockEditState, this); - TryAndSelectNode(); - } - - void VariableReferenceNodePropertyDisplay::AssignVariable(const AZ::EntityId& variableId) - { - m_variableReferenceDataInterface->AssignVariableReference(variableId); - DisplayVariableString(m_variableReferenceDataInterface->GetVariableReference()); - } - - void VariableReferenceNodePropertyDisplay::EditFinished() - { - UpdateDisplay(); - NodePropertiesRequestBus::Event(GetNodeId(), &NodePropertiesRequests::UnlockEditState, this); - } - -#include -} diff --git a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h b/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h deleted file mode 100644 index 0dba76b674..0000000000 --- a/Gems/GraphCanvas/Code/Source/Components/NodePropertyDisplays/VariableReferenceNodePropertyDisplay.h +++ /dev/null @@ -1,159 +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 - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#endif - -namespace GraphCanvas -{ - class GraphCanvasLabel; - - // TODO: Make this into a single static instance that gets updated for each scene - // rather then a 1:1 relationship with the number of variable elements we have. - class VariableItemModel - : public QAbstractListModel - { - public: - AZ_CLASS_ALLOCATOR(VariableItemModel, AZ::SystemAllocator, 0); - - VariableItemModel(); - ~VariableItemModel() override; - - // QAstractListModel - int rowCount(const QModelIndex& parent) const override; - QVariant data(const QModelIndex& index, int role) const override; - - QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - - Qt::ItemFlags flags(const QModelIndex& index) const override; - //// - - void SetSceneId(const AZ::EntityId& sceneId); - void SetDataType(const AZ::Uuid& variableType); - void RefreshData(); - void ClearData(); - - int FindRowForVariable(const AZ::EntityId& variableId) const; - AZ::EntityId FindVariableIdForRow(int row) const; - AZ::EntityId FindVariableIdForName(const AZStd::string& variableName) const; - - private: - - AZ::EntityId m_sceneId; - - AZ::Uuid m_dataType; - AZStd::vector< AZ::EntityId > m_variableIds; - }; - - class VariableSelectionWidget - : public QWidget - , public AzToolsFramework::EditorEvents::Bus::Handler - { - Q_OBJECT - - public: - AZ_CLASS_ALLOCATOR(VariableSelectionWidget, AZ::SystemAllocator, 0); - - VariableSelectionWidget(); - ~VariableSelectionWidget(); - - void SetSceneId(const AZ::EntityId& sceneId); - void SetDataType(const AZ::Uuid& dataType); - void SetSelectedVariable(const AZ::EntityId& variableId); - - // AzToolsFramework::EditorEvents::Bus - void OnEscape() override; - //// - - public slots: - - // Line Edit - void HandleFocusIn(); - void HandleFocusOut(); - void SubmitName(); - - signals: - - void OnFocusIn(); - void OnFocusOut(); - - void OnVariableSelected(const AZ::EntityId& variableId); - - private: - - Internal::FocusableLineEdit* m_lineEdit; - VariableItemModel* m_itemModel; - - QCompleter* m_completer; - - QVBoxLayout* m_layout; - - AZ::EntityId m_initialVariable; - }; - - class VariableReferenceNodePropertyDisplay - : public NodePropertyDisplay - , public VariableNotificationBus::Handler - { - public: - AZ_CLASS_ALLOCATOR(VariableReferenceNodePropertyDisplay, AZ::SystemAllocator, 0); - VariableReferenceNodePropertyDisplay(VariableReferenceDataInterface* dataInterface); - ~VariableReferenceNodePropertyDisplay() override; - - // NodePropertyDisplay - void RefreshStyle() override; - void UpdateDisplay() override; - - QGraphicsLayoutItem* GetDisabledGraphicsLayoutItem() const override; - QGraphicsLayoutItem* GetDisplayGraphicsLayoutItem() const override; - QGraphicsLayoutItem* GetEditableGraphicsLayoutItem() const override; - //// - - // VariableNotificationBus - void OnNameChanged() override; - void OnVariableActivated() override; - //// - - private: - - // NodePropertyDisplay - void OnIdSet() override; - //// - - void DisplayVariableString(const AZ::EntityId& variableId); - - void EditStart(); - void AssignVariable(const AZ::EntityId& variableId); - void EditFinished(); - - VariableReferenceDataInterface* m_variableReferenceDataInterface; - - GraphCanvasLabel* m_disabledLabel; - GraphCanvasLabel* m_displayLabel; - - QGraphicsProxyWidget* m_proxyWidget; - VariableSelectionWidget* m_variableSelectionWidget; - }; -} From 886a9631c7d29141d13787ed466e94d32d200495 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:08:51 -0800 Subject: [PATCH 176/394] Removes CommentLayerControllerComponent from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Nodes/Comment/CommentLayerControllerComponent.cpp | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp diff --git a/Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp deleted file mode 100644 index 708520fe9d..0000000000 --- a/Gems/GraphCanvas/Code/Source/Components/Nodes/Comment/CommentLayerControllerComponent.cpp +++ /dev/null @@ -1,9 +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 From 592a7dd9b3aba46fe4a191185bbaff775433c95e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:10:14 -0800 Subject: [PATCH 177/394] Removes DoubleDataInterface from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../NodePropertyDisplay/DoubleDataInterface.h | 37 ------------------- .../StaticLib/GraphCanvas/GraphCanvasBus.h | 2 +- .../Code/graphcanvas_staticlib_files.cmake | 1 - .../Integration/FloatDataInterface.h | 3 -- 4 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h deleted file mode 100644 index 8c552a331f..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h +++ /dev/null @@ -1,37 +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 "DataInterface.h" -#include "NumericDataInterface.h" - -namespace GraphCanvas -{ - // Deprecated name for the NumericDataInterface - class DoubleDataInterface - : public NumericDataInterface - { - public: - AZ_DEPRECATED(DoubleDataInterface(), "DoubleDataInterface renamed to NumericDataInterface") - { - } - - virtual double GetDouble() const = 0; - virtual void SetDouble(double value) = 0; - - double GetNumber() const override final - { - return GetDouble(); - } - - void SetNumber(double value) override final - { - SetDouble(value); - } - }; -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h index 0b09cb5cee..8791ec7c1f 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/GraphCanvasBus.h @@ -135,7 +135,7 @@ namespace GraphCanvas //! The PropertyDisplay will take ownership of the DataInterface virtual NodePropertyDisplay* CreateBooleanNodePropertyDisplay(BooleanDataInterface* dataInterface) const = 0; - //! Creates a DoubleNodeProperty display using the specified DoubleDataInterface + //! Creates a DoubleNodeProperty display using the specified NumericDataInterface //! param: dataInterface is the interface to local data to be used in the operation of the NodePropertyDisplay. //! The PropertyDisplay will take ownership of the DataInterface virtual NodePropertyDisplay* CreateNumericNodePropertyDisplay(NumericDataInterface* dataInterface) const = 0; diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index 455b5673d3..ad26ac09d8 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -50,7 +50,6 @@ set(FILES StaticLib/GraphCanvas/Components/NodePropertyDisplay/BooleanDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/ComboBoxDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/DataInterface.h - StaticLib/GraphCanvas/Components/NodePropertyDisplay/DoubleDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/EntityIdDataInterface.h StaticLib/GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.cpp StaticLib/GraphCanvas/Components/NodePropertyDisplay/NodePropertyDisplay.h diff --git a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h index cfd40cecdf..66c0f57fe4 100644 --- a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h +++ b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h @@ -8,9 +8,6 @@ #pragma once -// Graph Canvas -#include - // Graph Model #include From f2869463773d3894b67fd61abdbac77b0f14d938 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:21:19 -0800 Subject: [PATCH 178/394] Removes VariableDataInterface.h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../VariableDataInterface.h | 27 ------------------- .../GraphCanvas/NodeDescriptorBus.h | 1 - 2 files changed, 28 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h deleted file mode 100644 index 967f332fa6..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/NodePropertyDisplay/VariableDataInterface.h +++ /dev/null @@ -1,27 +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 "DataInterface.h" - -namespace GraphCanvas -{ - class VariableReferenceDataInterface - : public DataInterface - { - public: - // Returns the Uuid that represents the varaible assigned to this value. - virtual AZ::Uuid GetVariableReference() const = 0; - - // Sets the entity reference that - virtual void AssignVariableReference(const AZ::Uuid& variableId) = 0; - - // Returns the type of variable that should be assigned to this value. - virtual AZ::Uuid GetVariableDataType() const = 0; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h index f5fc8f4292..8fa81b7f5a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h @@ -27,7 +27,6 @@ namespace GraphCanvas { class StringDataInterface; - class VariableReferenceDataInterface; } namespace ScriptCanvasEditor From 7292fea50fc536f064d58add78ce2f18edf6e328 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:23:42 -0800 Subject: [PATCH 179/394] Removes VariableNodeBus.h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Nodes/Variable/VariableNodeBus.h | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h deleted file mode 100644 index 59a531a117..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Nodes/Variable/VariableNodeBus.h +++ /dev/null @@ -1,55 +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 - -#include - -class QGraphicsLayoutItem; -class QMimeData; - -namespace GraphCanvas -{ - namespace Deprecated - { - //! SceneVariableRequestBus - //! Requests to be made about variables in a particular scene. - class SceneVariableRequests : public AZ::EBusTraits - { - public: - // The BusId here is the SceneId of the scene that contains the variable. - // - // Should mainly be used with enumeration for collecting information and not as a way of directly interacting - // with variables inside of a particular scene. - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - - virtual AZ::EntityId GetVariableId() const = 0; - }; - - using SceneVariableRequestBus = AZ::EBus; - - //! VariableRequestBus - //! Requests to be made about a particular variable. - class VariableRequests : public AZ::EBusTraits - { - public: - // The BusId here is the VariableId of the variable that information is required about. - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - - virtual AZStd::string GetVariableName() const = 0; - virtual AZ::Uuid GetDataType() const = 0; - virtual AZStd::string GetDataTypeDisplayName() const = 0; - }; - - using VariableRequestBus = AZ::EBus; - } -} From 504009a63ba79745263ec694ef4230442b15abf0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:44:25 -0800 Subject: [PATCH 180/394] Removes definitions.cpp from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/StaticLib/GraphCanvas/Styling/Parser.cpp | 4 ++-- .../StaticLib/GraphCanvas/Styling/definitions.cpp | 15 --------------- .../Code/graphcanvas_staticlib_files.cmake | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp index 5d15c9fcd0..8cfb81715a 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp @@ -47,7 +47,7 @@ namespace const QRegularExpression invalidStart(R"_(^\s*>\s*)_"); const QRegularExpression invalidEnd(R"_(\s*>\s*$)_"); const QRegularExpression splitNesting(R"_(\s*>\s*)_"); - const QRegularExpression selector(R"_(^(?:(?:(\w+)?(\.\w+)?)|(#\w+)?)(:\w+)?$)_"); + const QRegularExpression s_selectorRegex(R"_(^(?:(?:(\w+)?(\.\w+)?)|(#\w+)?)(:\w+)?$)_"); AZStd::string QtToAz(const QString& source) { @@ -1013,7 +1013,7 @@ namespace GraphCanvas nestedSelectors.reserve(parts.size()); for (const QString& part : parts) { - auto matches = selector.match(part); + auto matches = s_selectorRegex.match(part); if (!matches.hasMatch()) { qWarning() << "Invalid selector:" << part << "in" << candidate; diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp deleted file mode 100644 index f8ba5ffab3..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/definitions.cpp +++ /dev/null @@ -1,15 +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 - -int LinkerWarningWorkaround() -{ - return 0; -} diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index ad26ac09d8..9572219a13 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -76,7 +76,6 @@ set(FILES StaticLib/GraphCanvas/Editor/EditorTypes.h StaticLib/GraphCanvas/Editor/GraphCanvasProfiler.h StaticLib/GraphCanvas/Editor/GraphModelBus.h - StaticLib/GraphCanvas/Styling/definitions.cpp StaticLib/GraphCanvas/Styling/definitions.h StaticLib/GraphCanvas/Styling/PseudoElement.cpp StaticLib/GraphCanvas/Styling/PseudoElement.h From 0f59718ff07f548b2a53e962766eb778589cec9b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 14:59:09 -0800 Subject: [PATCH 181/394] Removes CommentConstructMenuActions.cpp/h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommentConstructMenuActions.cpp | 55 ------------------- .../CommentConstructMenuActions.h | 26 --------- .../GraphCanvasConstructActionsMenuGroup.cpp | 1 - .../Code/graphcanvas_staticlib_files.cmake | 2 - 4 files changed, 84 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp deleted file mode 100644 index d07ec91a3f..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp +++ /dev/null @@ -1,55 +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 -#include - -#include - - -namespace GraphCanvas -{ - ///////////////////////// - // AddCommentMenuAction - ///////////////////////// - - AddCommentMenuAction::AddCommentMenuAction(QObject* parent) - : ConstructContextMenuAction("Add comment", parent) - { - } - - ContextMenuAction::SceneReaction AddCommentMenuAction::TriggerAction(const AZ::Vector2& scenePos) - { - const GraphId& graphId = GetGraphId(); - - SceneRequestBus::Event(graphId, &SceneRequests::ClearSelection); - - AZ::Entity* graphCanvasEntity = nullptr; - GraphCanvasRequestBus::BroadcastResult(graphCanvasEntity, &GraphCanvasRequests::CreateCommentNodeAndActivate); - - AZ_Assert(graphCanvasEntity, "Unable to create GraphCanvas Bus Node"); - - if (graphCanvasEntity) - { - SceneRequestBus::Event(graphId, &SceneRequests::AddNode, graphCanvasEntity->GetId(), scenePos, false); - CommentUIRequestBus::Event(graphCanvasEntity->GetId(), &CommentUIRequests::SetEditable, true); - } - - if (graphCanvasEntity != nullptr) - { - return SceneReaction::PostUndo; - } - else - { - return SceneReaction::Nothing; - } - } -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h deleted file mode 100644 index 3c9c767619..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h +++ /dev/null @@ -1,26 +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 - -namespace GraphCanvas -{ - class AddCommentMenuAction - : public ConstructContextMenuAction - { - public: - AZ_CLASS_ALLOCATOR(AddCommentMenuAction, AZ::SystemAllocator, 0); - - AddCommentMenuAction(QObject* parent); - virtual ~AddCommentMenuAction() = default; - - using ConstructContextMenuAction::TriggerAction; - SceneReaction TriggerAction(const AZ::Vector2& scenePos) override; - }; -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp index d075594ab0..e5a7cf8073 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/GraphCanvasConstructActionsMenuGroup.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index 9572219a13..eeba6ff4fb 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -144,8 +144,6 @@ set(FILES StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/AlignmentMenuActions/AlignmentContextMenuActions.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/BookmarkConstructMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/BookmarkConstructMenuActions.h - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.cpp - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/CommentConstructMenuActions.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/ConstructContextMenuAction.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/ConstructPresetMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/ConstructMenuActions/ConstructPresetMenuActions.h From 9ad837c952cf8dbdb235a5509502e827f013447c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:25:20 -0800 Subject: [PATCH 182/394] Removes SceneActionsMenuGroup.h/cpp from Gems/GraphCanvas Removes Resource.h from Gems/GraphCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Widgets/Bookmarks/BookmarkDockWidget.cpp | 1 - .../SceneActionsMenuGroup.cpp | 36 ------------------- .../SceneMenuActions/SceneActionsMenuGroup.h | 30 ---------------- .../GraphCanvas/Widgets/Resources/Resources.h | 10 ------ .../Code/graphcanvas_staticlib_files.cmake | 3 -- 5 files changed, 80 deletions(-) delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h delete mode 100644 Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp index 50e6be25e0..a68ed78ead 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Bookmarks/BookmarkDockWidget.cpp @@ -19,7 +19,6 @@ #include #include #include -#include namespace { diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp deleted file mode 100644 index 2160160f77..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp +++ /dev/null @@ -1,36 +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 - -namespace GraphCanvas -{ - ////////////////////////// - // SceneActionsMenuGroup - ////////////////////////// - - SceneActionsMenuGroup::SceneActionsMenuGroup(EditorContextMenu* contextMenu) - : m_removeUnusedNodesAction(nullptr) - { - contextMenu->AddActionGroup(SceneContextMenuAction::GetSceneContextMenuActionGroupId()); - - m_removeUnusedNodesAction = aznew RemoveUnusedNodesMenuAction(contextMenu); - contextMenu->AddMenuAction(m_removeUnusedNodesAction); - } - - SceneActionsMenuGroup::~SceneActionsMenuGroup() - { - } - - void SceneActionsMenuGroup::SetCleanUpGraphEnabled(bool enabled) - { - m_removeUnusedNodesAction->setEnabled(enabled); - } -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h deleted file mode 100644 index f0c1d03419..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h +++ /dev/null @@ -1,30 +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 GraphCanvas -{ - class SceneActionsMenuGroup - { - public: - AZ_CLASS_ALLOCATOR(SceneActionsMenuGroup, AZ::SystemAllocator, 0); - - SceneActionsMenuGroup(EditorContextMenu* contextMenu); - ~SceneActionsMenuGroup(); - - void SetCleanUpGraphEnabled(bool enabled); - - private: - - ContextMenuAction* m_removeUnusedNodesAction; - }; -} diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h deleted file mode 100644 index 6a89627825..0000000000 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/Resources/Resources.h +++ /dev/null @@ -1,10 +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 - - diff --git a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake index eeba6ff4fb..286391cf71 100644 --- a/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake +++ b/Gems/GraphCanvas/Code/graphcanvas_staticlib_files.cmake @@ -8,7 +8,6 @@ set(FILES StaticLib/GraphCanvas/Widgets/Resources/GraphCanvasEditorResources.qrc - StaticLib/GraphCanvas/Widgets/Resources/Resources.h StaticLib/GraphCanvas/Widgets/GraphCanvasMimeContainer.cpp StaticLib/GraphCanvas/Widgets/GraphCanvasMimeContainer.h StaticLib/GraphCanvas/Widgets/GraphCanvasMimeEvent.cpp @@ -174,8 +173,6 @@ set(FILES StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/NodeMenuActions/NodeContextMenuAction.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/NodeMenuActions/NodeContextMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/NodeMenuActions/NodeContextMenuActions.h - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.cpp - StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneActionsMenuGroup.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneContextMenuAction.h StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneContextMenuActions.cpp StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SceneMenuActions/SceneContextMenuActions.h From 9a99d9b5ea5291fc214fbd1b19c8ec260062253d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:27:03 -0800 Subject: [PATCH 183/394] Removes ImGuiLYCurveEditor from Gems/ImGui Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Include/ImGuiLYCurveEditorBus.h | 27 ----------------- .../LYCommonMenu/ImGuiLYCurveEditor.cpp | 24 --------------- .../Source/LYCommonMenu/ImGuiLYCurveEditor.h | 29 ------------------- Gems/ImGui/Code/imgui_game_files.cmake | 3 -- 4 files changed, 83 deletions(-) delete mode 100644 Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h delete mode 100644 Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp delete mode 100644 Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h diff --git a/Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h b/Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h deleted file mode 100644 index f764e56b58..0000000000 --- a/Gems/ImGui/Code/Include/ImGuiLYCurveEditorBus.h +++ /dev/null @@ -1,27 +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 - -namespace ImGui -{ - /// Bus for sending events and getting state from the ImGui manager. - class IImGuiCurveEditorRequests : public AZ::EBusTraits - { - public: - static const char* GetUniqueName() { return "IImGuiCurveEditorRequests"; } - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - using Bus = AZ::EBus; - }; - - using ImGuiCurveEditorRequestBus = AZ::EBus; - -} // namespace ImGui diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp deleted file mode 100644 index e61ba25e9c..0000000000 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.cpp +++ /dev/null @@ -1,24 +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 "ImGuiLYCurveEditor.h" - -#ifdef IMGUI_ENABLED - -namespace ImGui -{ - ImGuiCurveEditor::~ImGuiCurveEditor() - { - } - - void ImGuiCurveEditor::CreateCurveEditor(const char * label, float * points, int num_points, int max_points) - { - } -} // namespace ImGui - -#endif diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h deleted file mode 100644 index 6c7c0f5c90..0000000000 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCurveEditor.h +++ /dev/null @@ -1,29 +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 "ImGuiManager.h" - -#ifdef IMGUI_ENABLED -#include "ImGuiLYCurveEditorBus.h" -#include -#include - -namespace ImGui -{ - class ImGuiCurveEditor - : public ImGuiCurveEditorRequestBus::Handler - { - ImGuiCurveEditor(); - ~ImGuiCurveEditor(); - - void CreateCurveEditor(const char* label, float* points, int num_points, int max_points); - - }; -} -#endif // IMGUI_ENABLED diff --git a/Gems/ImGui/Code/imgui_game_files.cmake b/Gems/ImGui/Code/imgui_game_files.cmake index 8b677c3041..8ebd25fb1a 100644 --- a/Gems/ImGui/Code/imgui_game_files.cmake +++ b/Gems/ImGui/Code/imgui_game_files.cmake @@ -8,7 +8,6 @@ set(FILES Include/ImGuiBus.h - Include/ImGuiLYCurveEditorBus.h Source/ImGuiGem.cpp Source/ImGuiColorDefines.h Source/ImGuiManager.h @@ -17,6 +16,4 @@ set(FILES Source/LYCommonMenu/ImGuiLYCommonMenu.cpp Source/LYCommonMenu/ImGuiLYEntityOutliner.h Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp - Source/LYCommonMenu/ImGuiLYCurveEditor.h - Source/LYCommonMenu/ImGuiLYCurveEditor.cpp ) From 2dfdde0bb5f87dfd5c09553983da34f96d8fb0b6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:35:40 -0800 Subject: [PATCH 184/394] Removes LmbrCentral/Physics from Gems/LmbrCentral Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Editor/Translation/scriptcanvas_en_us.ts | 1018 ----------------- .../Physics/ForceVolumeRequestBus.h | 250 ---- .../Physics/WaterNotificationBus.h | 46 - .../Physics/WindVolumeRequestBus.h | 76 -- .../Code/lmbrcentral_headers_files.cmake | 3 - 5 files changed, 1393 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h diff --git a/Assets/Editor/Translation/scriptcanvas_en_us.ts b/Assets/Editor/Translation/scriptcanvas_en_us.ts index bfbd8cf316..5af338426c 100644 --- a/Assets/Editor/Translation/scriptcanvas_en_us.ts +++ b/Assets/Editor/Translation/scriptcanvas_en_us.ts @@ -69750,477 +69750,6 @@ The element is removed from its current parent and added as a child of the new p The name of the action triggered when the interactive element is released
- - EBus: ForceVolumeRequestBus - - FORCEVOLUMEREQUESTBUS_NAME - ForceVolumeRequestBus - - - FORCEVOLUMEREQUESTBUS_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_CATEGORY - Physics - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetAirDensity - SetAirDensity - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - FORCEVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetAirResistance - GetAirResistance - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_NAME - C++ Type: float - Number - - - FORCEVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceMassDependent - GetForceMassDependent - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUTPUT0_NAME - C++ Type: bool - Boolean - - - FORCEVOLUMEREQUESTBUS_GETFORCEMASSDEPENDENT_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetAirResistance - SetAirResistance - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - FORCEVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetAirDensity - GetAirDensity - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_NAME - C++ Type: float - Number - - - FORCEVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceMode - GetForceMode - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUTPUT0_NAME - C++ Type: int - Number - - - FORCEVOLUMEREQUESTBUS_GETFORCEMODE_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceMagnitude - GetForceMagnitude - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUTPUT0_NAME - C++ Type: float - Number - - - FORCEVOLUMEREQUESTBUS_GETFORCEMAGNITUDE_OUTPUT0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceMode - SetForceMode - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_PARAM0_NAME - Simple Type: Number C++ Type: int - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMODE_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceMagnitude - SetForceMagnitude - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMAGNITUDE_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceMassDependent - SetForceMassDependent - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_PARAM0_NAME - Simple Type: Boolean C++ Type: bool - - - - FORCEVOLUMEREQUESTBUS_SETFORCEMASSDEPENDENT_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: SetForceDirection - SetForceDirection - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_PARAM0_NAME - Simple Type: Vector3 C++ Type: const Vector3& - - - - FORCEVOLUMEREQUESTBUS_SETFORCEDIRECTION_PARAM0_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_NAME - Class/Bus: ForceVolumeRequestBus Event/Method: GetForceDirection - GetForceDirection - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_CATEGORY - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUT_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUT_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_IN_NAME - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_IN_TOOLTIP - - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUTPUT0_NAME - C++ Type: const Vector3& - Vector3 - - - FORCEVOLUMEREQUESTBUS_GETFORCEDIRECTION_OUTPUT0_TOOLTIP - - - Handler: UiDraggableNotificationBus @@ -73260,553 +72789,6 @@ The element is removed from its current parent and added as a child of the new p The absolute position where the entity should spawn - - EBus: WindVolumeRequestBus - - WINDVOLUMEREQUESTBUS_NAME - Wind Volume - - - WINDVOLUMEREQUESTBUS_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_CATEGORY - Physics (Legacy) - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetVolumeSize - Get Volume Size - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUTPUT0_NAME - C++ Type: const Vector3& - Vector3 - - - WINDVOLUMEREQUESTBUS_GETVOLUMESIZE_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetAirResistance - Get Air Resistance - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETAIRRESISTANCE_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetAirResistance - Set Air Resistance - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETAIRRESISTANCE_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetAirDensity - Get Air Density - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETAIRDENSITY_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetSpeed - Get Speed - - - WINDVOLUMEREQUESTBUS_GETSPEED_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETSPEED_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETSPEED_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetWindDirection - Set Wind Direction - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_PARAM0_NAME - Simple Type: Vector3 C++ Type: const Vector3& - - - - WINDVOLUMEREQUESTBUS_SETWINDDIRECTION_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetWindDirection - Get Wind Direction - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUTPUT0_NAME - C++ Type: const Vector3& - Vector3 - - - WINDVOLUMEREQUESTBUS_GETWINDDIRECTION_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetSpeed - Set Speed - - - WINDVOLUMEREQUESTBUS_SETSPEED_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETSPEED_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETSPEED_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETSPEED_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETSPEED_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETSPEED_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetVolumeSize - Set Volume Size - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_PARAM0_NAME - Simple Type: Vector3 C++ Type: const Vector3& - - - - WINDVOLUMEREQUESTBUS_SETVOLUMESIZE_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetEllipsoidal - Get Ellipsoidal - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUTPUT0_NAME - C++ Type: bool - Boolean - - - WINDVOLUMEREQUESTBUS_GETELLIPSOIDAL_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_NAME - Class/Bus: WindVolumeRequestBus Event/Method: GetFalloffInner - Get Falloff Inner - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_CATEGORY - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_IN_NAME - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUTPUT0_NAME - C++ Type: float - Number - - - WINDVOLUMEREQUESTBUS_GETFALLOFFINNER_OUTPUT0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetEllipsoidal - Set Ellipsoidal - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_PARAM0_NAME - Simple Type: Boolean C++ Type: bool - - - - WINDVOLUMEREQUESTBUS_SETELLIPSOIDAL_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetFalloffInner - Set Falloff Inner - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETFALLOFFINNER_PARAM0_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_NAME - Class/Bus: WindVolumeRequestBus Event/Method: SetAirDensity - Set Air Density - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_CATEGORY - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_OUT_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_IN_NAME - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_IN_TOOLTIP - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_NAME - Simple Type: Number C++ Type: float - - - - WINDVOLUMEREQUESTBUS_SETAIRDENSITY_PARAM0_TOOLTIP - - - EBus: ActorComponentNotificationBus diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h deleted file mode 100644 index 35a630c4ca..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/ForceVolumeRequestBus.h +++ /dev/null @@ -1,250 +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 -#include -#include -#include - -namespace LmbrCentral -{ - /** - * Parameters of an entity in the force volume. - * Used to calculate final force. - */ - struct EntityParams - { - AZ::EntityId m_id; - AZ::Vector3 m_position; - AZ::Vector3 m_velocity; - AZ::Aabb m_aabb; - float m_mass; - }; - - /** - * Parameters of the force volume. - * Used to calculate final force. - */ - struct VolumeParams - { - AZ::EntityId m_id; - AZ::Vector3 m_position; - AZ::Quaternion m_rotation; - AZ::SplinePtr m_spline; - AZ::Aabb m_aabb; - }; - - /** - * Represents a single force in the force volume. - * - * Developers should implement this interface and register - * their class with the EditContext to have their custom - * force appear in the ForceVolume dropdown box in the editor. - */ - class Force - { - public: - AZ_CLASS_ALLOCATOR(Force, AZ::SystemAllocator, 0); - AZ_RTTI(Force, "{9BD236BD-4580-4D6F-B02F-F8F431EBA593}"); - static void Reflect(AZ::SerializeContext& context) - { - context.Class(); - } - virtual ~Force() = default; - - /** - * Connect to any busses. - */ - virtual void Activate(AZ::EntityId /*entityId*/) {} - - /** - * Disconnect from any busses. - */ - virtual void Deactivate() {} - - /** - * Calculate the size and direction the force. - */ - virtual AZ::Vector3 CalculateForce(const EntityParams& /*entityParams*/, const VolumeParams& /*volumeParams*/) - { - return AZ::Vector3::CreateZero(); - } - }; - - /** - * Requests serviced by the WorldSpaceForce. - */ - class WorldSpaceForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the direction of the force in worldspace. - */ - virtual void SetDirection(const AZ::Vector3& direction) = 0; - - /** - * @brief Gets the direction of the force in world space. - */ - virtual const AZ::Vector3& GetDirection() = 0; - - /** - * @brief Sets the magnitude of the force. - */ - virtual void SetMagnitude(float magnitude) = 0; - - /** - * @brief Gets the magnitude of the force. - */ - virtual float GetMagnitude() = 0; - }; - - using WorldSpaceForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the LocalSpaceForce. - */ - class LocalSpaceForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the direction of the force in localspace. - */ - virtual void SetDirection(const AZ::Vector3& direction) = 0; - - /** - * @brief Gets the direction of the force in local space. - */ - virtual const AZ::Vector3& GetDirection() = 0; - - /** - * @brief Sets the magnitude of the force. - */ - virtual void SetMagnitude(float magnitude) = 0; - - /** - * @brief Gets the magnitude of the force. - */ - virtual float GetMagnitude() = 0; - }; - - using LocalSpaceForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the PointSpaceForce. - */ - class PointForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the magnitude of the force. - */ - virtual void SetMagnitude(float magnitude) = 0; - - /** - * @brief Gets the magnitude of the force. - */ - virtual float GetMagnitude() = 0; - }; - - using PointForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the PointSpaceForce. - */ - class SplineFollowForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the damping ratio of the force. - */ - virtual void SetDampingRatio(float ratio) = 0; - - /** - * @brief Gets the damping ratio of the force. - */ - virtual float GetDampingRatio() = 0; - - /** - * @brief Sets the frequency of the force. - */ - virtual void SetFrequency(float frequency) = 0; - - /** - * @brief Gets the frequency of the force. - */ - virtual float GetFrequency() = 0; - - /** - * @brief Sets the traget speed of the force. - */ - virtual void SetTargetSpeed(float targetSpeed) = 0; - - /** - * @brief Gets the target speed of the force. - */ - virtual float GetTargetSpeed() = 0; - - /** - * @brief Sets the lookahead of the force. - */ - virtual void SetLookAhead(float lookAhead) = 0; - - /** - * @brief Gets the lookahead of the force. - */ - virtual float GetLookAhead() = 0; - }; - - using SplineFollowForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the LocalSpaceForce. - */ - class SimpleDragForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the density of the volume. - */ - virtual void SetDensity(float density) = 0; - - /** - * @brief Gets the density of the volume. - */ - virtual float GetDensity() = 0; - }; - - using SimpleDragForceRequestBus = AZ::EBus; - - /** - * Requests serviced by the LocalSpaceForce. - */ - class LinearDampingForceRequests - : public AZ::ComponentBus - { - public: - /** - * @brief Sets the damping amount of the force. - */ - virtual void SetDamping(float damping) = 0; - - /** - * @brief Gets the damping amount of the force. - */ - virtual float GetDamping() = 0; - }; - - using LinearDampingForceRequestBus = AZ::EBus; -} diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h deleted file mode 100644 index 8ad7b1aa8f..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WaterNotificationBus.h +++ /dev/null @@ -1,46 +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 - -namespace AZ -{ - class Transform; -} - -namespace LmbrCentral -{ - /** - * Broadcasts change notifications from the water ocean and water volume components - */ - class WaterNotifications - : public AZ::EBusTraits - { - public: - //////////////////////////////////////////////////////////////////////// - // EBusTraits - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - //////////////////////////////////////////////////////////////////////// - - //! allows multiple threads to call - using MutexType = AZStd::recursive_mutex; - - //! Notifies when the height of the ocean changes - virtual void OceanHeightChanged([[maybe_unused]] float height) {} - - //! Notifies when a water volume is moved - virtual void WaterVolumeTransformChanged([[maybe_unused]] AZ::EntityId entityId, [[maybe_unused]] const AZ::Transform& worldTransform) {} - - //! Notifies when a water volume shape is changed - virtual void WaterVolumeShapeChanged([[maybe_unused]] AZ::EntityId entityId) {} - }; - - using WaterNotificationBus = AZ::EBus; -} diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h deleted file mode 100644 index 4b814685d3..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Physics/WindVolumeRequestBus.h +++ /dev/null @@ -1,76 +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 LmbrCentral -{ - /** - * Messages serviced by the WindVolumeComponent - */ - class WindVolumeRequests - : public AZ::ComponentBus - { - public: - /** - * Sets the falloff. Only affects the wind speed in the volume. A value of 0 will reduce the speed from the center towards the edge of the volume. - * A value of 1 or greater will have no effect. - */ - virtual void SetFalloff(float falloff) = 0; - - /** - * Gets the falloff. - */ - virtual float GetFalloff() = 0; - - /** - * Sets the speed of the wind. The air resistance must be non zero to affect physical objects. - */ - virtual void SetSpeed(float speed) = 0; - - /** - * Gets the speed of the wind. - */ - virtual float GetSpeed() = 0; - - /** - * Sets the air resistance causing objects moving through the volume to slow down. - */ - virtual void SetAirResistance(float airResistance) = 0; - - /** - * Gets the air resistance. - */ - virtual float GetAirResistance() = 0; - - /** - * Sets the density of the volume. - * Objects with lower density will experience a buoyancy force. Objects with higher density will sink. - */ - virtual void SetAirDensity(float airDensity) = 0; - - /** - * Gets the air density. - */ - virtual float GetAirDensity() = 0; - - /** - * Sets the direction the wind is blowing. If zero, then the direction is considered omnidirectional. - */ - virtual void SetWindDirection(const AZ::Vector3& direction) = 0; - - /** - * Gets the direction the wind is blowing. - */ - virtual const AZ::Vector3& GetWindDirection() = 0; - }; - - using WindVolumeRequestBus = AZ::EBus; -} diff --git a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake index 270a46cf32..cd8f3eff21 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake @@ -27,9 +27,6 @@ set(FILES include/LmbrCentral/Dependency/DependencyMonitor.h include/LmbrCentral/Dependency/DependencyMonitor.inl include/LmbrCentral/Dependency/DependencyNotificationBus.h - include/LmbrCentral/Physics/WindVolumeRequestBus.h - include/LmbrCentral/Physics/ForceVolumeRequestBus.h - include/LmbrCentral/Physics/WaterNotificationBus.h include/LmbrCentral/Rendering/DecalComponentBus.h include/LmbrCentral/Rendering/LightComponentBus.h include/LmbrCentral/Rendering/MaterialAsset.h From 2a7fe4efcf4742522ca418e18250462822ae50eb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:12:38 -0800 Subject: [PATCH 185/394] Removes multiple Rendering files from LmbrCentral that are no longer used Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CryEditDoc.cpp | 44 +--- Code/Editor/CryEditDoc.h | 1 - .../SandboxIntegration.cpp | 1 - .../UI/AssetCatalogModel.cpp | 1 - Gems/LmbrCentral/Code/Source/LmbrCentral.cpp | 1 - .../LmbrCentral/Rendering/DecalComponentBus.h | 74 ------- .../Rendering/EditorLightComponentBus.h | 195 ------------------ .../LmbrCentral/Rendering/GiRegistrationBus.h | 39 ---- .../LmbrCentral/Rendering/LensFlareAsset.h | 32 --- .../LmbrCentral/Rendering/LightComponentBus.h | 164 --------------- .../LmbrCentral/Rendering/MaterialHandle.h | 54 ----- .../Rendering/MeshModificationBus.h | 132 ------------ .../Code/lmbrcentral_editor_files.cmake | 1 - .../Code/lmbrcentral_headers_files.cmake | 5 - 14 files changed, 2 insertions(+), 742 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 9d93fd5f5b..bcd3efd770 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -57,7 +57,6 @@ // LmbrCentral #include -#include // for LmbrCentral::EditorLightComponentRequestBus static const char* kAutoBackupFolder = "_autobackup"; static const char* kHoldFolder = "$tmp_hold"; // conform to the ignored file types $tmp[0-9]*_ regex @@ -2130,52 +2129,13 @@ void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr) ////////////////////////////////////////////////////////////////////////// // AzToolsFramework::EditorEntityContextNotificationBus interface implementation -void CCryEditDoc::OnSliceInstantiated(const AZ::Data::AssetId& sliceAssetId, AZ::SliceComponent::SliceInstanceAddress& sliceAddress, const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) { - if (m_envProbeSliceAssetId == sliceAssetId) - { - const AZ::SliceComponent::EntityList& entities = sliceAddress.GetInstance()->GetInstantiated()->m_entities; - const AZ::Uuid editorEnvProbeComponentId("{8DBD6035-583E-409F-AFD9-F36829A0655D}"); - AzToolsFramework::EntityIdList entityIds; - entityIds.reserve(entities.size()); - for (const AZ::Entity* entity : entities) - { - if (entity->FindComponent(editorEnvProbeComponentId)) - { - // Update Probe Area size to cover the whole terrain - LmbrCentral::EditorLightComponentRequestBus::Event(entity->GetId(), &LmbrCentral::EditorLightComponentRequests::SetProbeAreaDimensions, AZ::Vector3(m_terrainSize, m_terrainSize, m_envProbeHeight)); - - // Force update the light to apply cubemap - LmbrCentral::EditorLightComponentRequestBus::Event(entity->GetId(), &LmbrCentral::EditorLightComponentRequests::RefreshLight); - } - entityIds.push_back(entity->GetId()); - } - - //Detach instantiated env probe entities from engine slice - AzToolsFramework::SliceEditorEntityOwnershipServiceRequestBus::Broadcast( - &AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::DetachSliceEntities, entityIds); - - sliceAddress.SetInstance(nullptr); - sliceAddress.SetReference(nullptr); - SetModifiedFlag(true); - SetModifiedModules(eModifiedEntities); - - AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect(); - - //save after level default slice fully instantiated - Save(); - } GetIEditor()->ResumeUndo(); } - -void CCryEditDoc::OnSliceInstantiationFailed(const AZ::Data::AssetId& sliceAssetId, const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) { - if (m_envProbeSliceAssetId == sliceAssetId) - { - AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect(); - AZ_Warning("Editor", false, "Failed to instantiate default environment probe slice."); - } GetIEditor()->ResumeUndo(); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h index 5d20bddf45..3874914396 100644 --- a/Code/Editor/CryEditDoc.h +++ b/Code/Editor/CryEditDoc.h @@ -200,7 +200,6 @@ protected: QString m_pathName; QString m_slicePathName; QString m_title; - AZ::Data::AssetId m_envProbeSliceAssetId; float m_terrainSize; const char* m_envProbeSliceRelativePath = "EngineAssets/Slices/DefaultLevelSetup.slice"; const float m_envProbeHeight = 200.0f; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp index 69b195d243..b88c7f8d60 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp @@ -69,7 +69,6 @@ #include "ISourceControl.h" #include "UI/QComponentEntityEditorMainWindow.h" -#include #include #include diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp index 60fda239dc..b1233b8387 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/AssetCatalogModel.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp index 84ef11b35d..76f50b5ea6 100644 --- a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp +++ b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp @@ -60,7 +60,6 @@ #include #include #include -#include // Scriptable Ebus Registration #include "Events/ReflectScriptableEvents.h" diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h deleted file mode 100644 index a184f37b4e..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/DecalComponentBus.h +++ /dev/null @@ -1,74 +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 LmbrCentral -{ - /*! - * DecalComponentRequests::Bus - * Messages serviced by the Decal component. - */ - class DecalComponentRequests - : public AZ::ComponentBus - { - public: - - virtual ~DecalComponentRequests() {} - - /** - * Makes the decal visible. - */ - virtual void Show() = 0; - - /** - * Hides the decal. - */ - virtual void Hide() = 0; - - /** - * Specify the decal's visibility. - * \param visible true to make the decal visible, false to hide it. - */ - virtual void SetVisibility(bool visible) = 0; - }; - - using DecalComponentRequestBus = AZ::EBus; - - /*! - * DecalComponentEditorRequests::Bus - * Editor/UI messages serviced by the Decal component. - */ - class DecalComponentEditorRequests - : public AZ::ComponentBus - { - public: - - using Bus = AZ::EBus; - - virtual ~DecalComponentEditorRequests() {} - - virtual void RefreshDecal() {} - }; - - /*! - * DecalComponentEvents::Bus - * Events dispatched by the Decal component. - */ - class DecalComponentEvents - : public AZ::ComponentBus - { - public: - - using Bus = AZ::EBus; - - virtual ~DecalComponentEvents() {} - }; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h deleted file mode 100644 index d7747c5094..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/EditorLightComponentBus.h +++ /dev/null @@ -1,195 +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 -#include - -namespace LmbrCentral -{ - class LightConfiguration; - - /*! - * EditorLightComponentRequestBus - * Editor/UI messages serviced by the light component. - */ - class EditorLightComponentRequests - : public AZ::ComponentBus - { - public: - virtual ~EditorLightComponentRequests() {} - - //! Recreates the render light. - virtual void RefreshLight() {} - - //! Sets the active cubemap resource. - virtual void SetCubemap(const AZStd::string& /*cubemap*/) {} - virtual void SetProjectorTexture(const AZStd::string& /*projectorTexture*/) {} - - //! Retrieves configured cubemap resolution for generation. - virtual AZ::u32 GetCubemapResolution() { return 0; } - //! Sets cubemap resolution for generation. See LightConfiguration::ResolutionSetting for options. - virtual void SetCubemapResolution(AZ::u32 /*resolution*/) = 0; - - //! Retrieves Configuration - virtual const LightConfiguration& GetConfiguration() const = 0; - - //! get if it's customized cubemap - virtual bool UseCustomizedCubemap() const { return false; } - //////////////////////////////////////////////////////////////////// - // Modifiers - these must match the same virtual methods in LightComponentRequests - - // General Light Settings - virtual void SetVisible(bool /*isVisible*/) {} - virtual bool GetVisible() { return true; } - - // Turned on by default? - virtual void SetOnInitially(bool /*onInitially*/) {} - virtual bool GetOnInitially() { return true; } - - virtual void SetColor(const AZ::Color& /*newColor*/) {} - virtual const AZ::Color GetColor() { return AZ::Color::CreateOne(); } - - virtual void SetDiffuseMultiplier(float /*newMultiplier*/) {} - virtual float GetDiffuseMultiplier() { return FLT_MAX; } - - virtual void SetSpecularMultiplier(float /*newMultiplier*/) {} - virtual float GetSpecularMultiplier() { return FLT_MAX; } - - virtual void SetAmbient(bool /*isAmbient*/) {} - virtual bool GetAmbient() { return true; } - - virtual void SetIndoorOnly(bool /*indoorOnly*/) {} - virtual bool GetIndoorOnly() { return false; } - - virtual void SetCastShadowSpec(AZ::u32 /*castShadowSpec*/) {} - virtual AZ::u32 GetCastShadowSpec() { return 0; } - - virtual void SetViewDistanceMultiplier(float /*viewDistanceMultiplier*/) {} - virtual float GetViewDistanceMultiplier() { return 0.0f; } - - virtual void SetVolumetricFog(bool /*volumetricFog*/) {} - virtual bool GetVolumetricFog() { return false; } - - virtual void SetVolumetricFogOnly(bool /*volumetricFogOnly*/) {} - virtual bool GetVolumetricFogOnly() { return false; } - - virtual void SetUseVisAreas(bool /*useVisAreas*/) {} - virtual bool GetUseVisAreas() { return false; } - - virtual void SetAffectsThisAreaOnly(bool /*affectsThisAreaOnly*/) {} - virtual bool GetAffectsThisAreaOnly() { return false; } - - // Point Light Specific Modifiers - virtual void SetPointMaxDistance(float /*newMaxDistance*/) {} - virtual float GetPointMaxDistance() { return FLT_MAX; } - - virtual void SetPointAttenuationBulbSize(float /*newAttenuationBulbSize*/) {} - virtual float GetPointAttenuationBulbSize() { return FLT_MAX; } - - // Area Light Specific Modifiers - virtual void SetAreaMaxDistance(float /*newMaxDistance*/) {} - virtual float GetAreaMaxDistance() { return FLT_MAX; } - - virtual void SetAreaWidth(float /*newWidth*/) {} - virtual float GetAreaWidth() { return FLT_MAX; } - - virtual void SetAreaHeight(float /*newHeight*/) {} - virtual float GetAreaHeight() { return FLT_MAX; } - - virtual void SetAreaFOV(float /*newFOV*/) {} - virtual float GetAreaFOV() { return FLT_MAX; } - - // Project Light Specific Modifiers - virtual void SetProjectorMaxDistance(float /*newMaxDistance*/) {} - virtual float GetProjectorMaxDistance() { return FLT_MAX; } - - virtual void SetProjectorAttenuationBulbSize(float /*newAttenuationBulbSize*/) {} - virtual float GetProjectorAttenuationBulbSize() { return FLT_MAX; } - - virtual void SetProjectorFOV(float /*newFOV*/) {} - virtual float GetProjectorFOV() { return FLT_MAX; } - - virtual void SetProjectorNearPlane(float /*newNearPlane*/) {} - virtual float GetProjectorNearPlane() { return FLT_MAX; } - - // Environment Probe Settings - virtual void SetProbeAreaDimensions(const AZ::Vector3& newDimensions) { (void)newDimensions; } - virtual const AZ::Vector3 GetProbeAreaDimensions() { return AZ::Vector3::CreateOne(); } - - virtual void SetProbeSortPriority(AZ::u32 newPriority) { (void)newPriority; } - virtual AZ::u32 GetProbeSortPriority() { return 0; } - - virtual void SetProbeBoxProjected(bool isProbeBoxProjected) { (void)isProbeBoxProjected; } - virtual bool GetProbeBoxProjected() { return false; } - - virtual void SetProbeBoxHeight(float newHeight) { (void)newHeight; } - virtual float GetProbeBoxHeight() { return FLT_MAX; } - - virtual void SetProbeBoxLength(float newLength) { (void)newLength; } - virtual float GetProbeBoxLength() { return FLT_MAX; } - - virtual void SetProbeBoxWidth(float newWidth) { (void)newWidth; } - virtual float GetProbeBoxWidth() { return FLT_MAX; } - - virtual void SetProbeAttenuationFalloff(float newAttenuationFalloff) { (void)newAttenuationFalloff; } - virtual float GetProbeAttenuationFalloff() { return FLT_MAX; } - - virtual void SetProbeFade(float fade) { (void)fade; } - virtual float GetProbeFade() { return 1.0f; } - - // Environment Light Specific Modifiers (probes) - virtual void SetProbeArea(const AZ::Vector3& /*probeArea*/) {} - virtual AZ::Vector3 GetProbeArea() { return AZ::Vector3::CreateZero(); } - - virtual void SetAttenuationFalloffMax(float /*attenFalloffMax*/) {} - virtual float GetAttenuationFalloffMax() { return 0; } - - virtual void SetBoxHeight(float /*boxHeight*/) {} - virtual float GetBoxHeight() { return 0.0f; } - - virtual void SetBoxWidth(float /*boxWidth*/) {} - virtual float GetBoxWidth() { return 0.0f; } - - virtual void SetBoxLength(float /*boxLength*/) {} - virtual float GetBoxLength() { return 0.0f; } - - virtual void SetBoxProjected(bool /*boxProjected*/) {} - virtual bool GetBoxProjected() { return false; } - //////////////////////////////////////////////////////////////////// - - // Shadow parameters - virtual void SetShadowBias(float /*shadowBias*/) {} - virtual float GetShadowBias() { return 0.0f; } - - virtual void SetShadowSlopeBias(float /*shadowSlopeBias*/) {} - virtual float GetShadowSlopeBias() { return 0.0f; } - - virtual void SetShadowResScale(float /*shadowResScale*/) {} - virtual float GetShadowResScale() { return 0.0f; } - - virtual void SetShadowUpdateMinRadius(float /*shadowUpdateMinRadius*/) {} - virtual float GetShadowUpdateMinRadius() { return 0.0f; } - - virtual void SetShadowUpdateRatio(float /*shadowUpdateRatio*/) {} - virtual float GetShadowUpdateRatio() { return 0.0f; } - - // Animation parameters - virtual void SetAnimIndex(AZ::u32 /*animIndex*/) {} - virtual AZ::u32 GetAnimIndex() { return 0; } - - virtual void SetAnimSpeed(float /*animSpeed*/) {} - virtual float GetAnimSpeed() { return 0.0f; } - - virtual void SetAnimPhase(float /*animPhase*/) {} - virtual float GetAnimPhase() { return 0.0f; } - }; - - using EditorLightComponentRequestBus = AZ::EBus; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h deleted file mode 100644 index 0bb4363add..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/GiRegistrationBus.h +++ /dev/null @@ -1,39 +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 LmbrCentral -{ - /*! - * Messages for handling SVOGI registration. - */ - class GiRegistration - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - using MutexType = AZStd::recursive_mutex; - // static const bool LocklessDispatch = true - - //Upsert will unpack the mesh, transform, world aabb and material and upsert to the gi system. - //If something is already registered on this entityId it will be removed then reinserted. - virtual void UpsertToGi(AZ::EntityId entityId, AZ::Transform transform, AZ::Aabb worldAabb, - AZ::Data::Asset meshAsset, _smart_ptr material) = 0; - //Remove will remove any data associated with the entityId. - virtual void RemoveFromGi(AZ::EntityId entityId) = 0; - }; - - using GiRegistrationBus = AZ::EBus; - -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h deleted file mode 100644 index 3267397e72..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LensFlareAsset.h +++ /dev/null @@ -1,32 +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 -#include - -namespace LmbrCentral -{ - class LensFlareAsset - : public AZ::Data::AssetData - { - friend class LensFlareAssetHandler; - - public: - AZ_RTTI(LensFlareAsset, "{CF44D1F0-F178-4A3D-A9E6-D44721F50C20}", AZ::Data::AssetData); - AZ_CLASS_ALLOCATOR(LensFlareAsset, AZ::SystemAllocator, 0); - - const AZStd::vector& GetPaths() { return m_flarePaths; } - - private: - void AddPath(AZStd::string&& newPath) { m_flarePaths.emplace_back(std::move(newPath)); } - - AZStd::vector m_flarePaths; - }; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h deleted file mode 100644 index c360bec6cb..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/LightComponentBus.h +++ /dev/null @@ -1,164 +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 -#include - -namespace LmbrCentral -{ - class LightConfiguration; - - /*! - * LightComponentRequestBus - * Messages serviced by the light component. - */ - class LightComponentRequests - : public AZ::ComponentBus - { - public: - - enum class State - { - Off = 0, - On, - }; - - virtual ~LightComponentRequests() {} - - //! Control light state. - virtual void SetLightState([[maybe_unused]] State state) {} - - //! Turns light on. Returns true if the light was successfully turned on - virtual bool TurnOnLight() { return false; } - - //! Turns light off. Returns true if the light was successfully turned off - virtual bool TurnOffLight() { return false; } - - //! Toggles light state. - virtual void ToggleLight() {} - - //////////////////////////////////////////////////////////////////// - // Modifiers - these must match the same virutal methods in LightComponentEditorRequests - - // General Settings Modifiers - virtual void SetVisible(bool isVisible) { (void)isVisible; } - virtual bool GetVisible() { return true; } - - virtual void SetColor(const AZ::Color& newColor) { (void)newColor; }; - virtual const AZ::Color GetColor() { return AZ::Color::CreateOne(); } - - virtual void SetDiffuseMultiplier(float newMultiplier) { (void)newMultiplier; }; - virtual float GetDiffuseMultiplier() { return FLT_MAX; } - - virtual void SetSpecularMultiplier(float newMultiplier) { (void)newMultiplier; }; - virtual float GetSpecularMultiplier() { return FLT_MAX; } - - virtual void SetAmbient(bool isAmbient) { (void)isAmbient; } - virtual bool GetAmbient() { return true; } - - // Point Light Specific Modifiers - virtual void SetPointMaxDistance(float newMaxDistance) { (void)newMaxDistance; }; - virtual float GetPointMaxDistance() { return FLT_MAX; } - - virtual void SetPointAttenuationBulbSize(float newAttenuationBulbSize) { (void)newAttenuationBulbSize; }; - virtual float GetPointAttenuationBulbSize() { return FLT_MAX; } - - // Area Light Specific Modifiers - virtual void SetAreaMaxDistance(float newMaxDistance) { (void)newMaxDistance; }; - virtual float GetAreaMaxDistance() { return FLT_MAX; } - - virtual void SetAreaWidth(float newWidth) { (void)newWidth; }; - virtual float GetAreaWidth() { return FLT_MAX; } - - virtual void SetAreaHeight(float newHeight) { (void)newHeight; }; - virtual float GetAreaHeight() { return FLT_MAX; } - - virtual void SetAreaFOV(float newFOV) { (void)newFOV; }; - virtual float GetAreaFOV() { return FLT_MAX; } - - // Project Light Specific Modifiers - virtual void SetProjectorMaxDistance(float newMaxDistance) { (void)newMaxDistance; }; - virtual float GetProjectorMaxDistance() { return FLT_MAX; } - - virtual void SetProjectorAttenuationBulbSize(float newAttenuationBulbSize) { (void)newAttenuationBulbSize; }; - virtual float GetProjectorAttenuationBulbSize() { return FLT_MAX; } - - virtual void SetProjectorFOV(float newFOV) { (void)newFOV; }; - virtual float GetProjectorFOV() { return FLT_MAX; } - - virtual void SetProjectorNearPlane(float newNearPlane) { (void)newNearPlane; }; - virtual float GetProjectorNearPlane() { return FLT_MAX; } - - // Environment Probe Settings - virtual void SetProbeAreaDimensions(const AZ::Vector3& newDimensions) { (void)newDimensions; } - virtual const AZ::Vector3 GetProbeAreaDimensions() { return AZ::Vector3::CreateOne(); } - - virtual void SetProbeSortPriority(AZ::u32 newPriority) { (void)newPriority; } - virtual AZ::u32 GetProbeSortPriority() { return 0; } - - virtual void SetProbeBoxProjected(bool isProbeBoxProjected) { (void)isProbeBoxProjected; } - virtual bool GetProbeBoxProjected() { return false; } - - virtual void SetProbeBoxHeight(float newHeight) { (void)newHeight; } - virtual float GetProbeBoxHeight() { return FLT_MAX; } - - virtual void SetProbeBoxLength(float newLength) { (void)newLength; } - virtual float GetProbeBoxLength() { return FLT_MAX; } - - virtual void SetProbeBoxWidth(float newWidth) { (void)newWidth; } - virtual float GetProbeBoxWidth() { return FLT_MAX; } - - virtual void SetProbeAttenuationFalloff(float newAttenuationFalloff) { (void)newAttenuationFalloff; } - virtual float GetProbeAttenuationFalloff() { return FLT_MAX; } - - virtual void SetProbeFade(float fade) { (void)fade; } - virtual float GetProbeFade() { return 1.0f; } - //////////////////////////////////////////////////////////////////// - }; - - using LightComponentRequestBus = AZ::EBus; - - /*! - * LightComponentNotificationBus - * Events dispatched by the light component. - */ - class LightComponentNotifications - : public AZ::ComponentBus - { - public: - - virtual ~LightComponentNotifications() {} - - // Sent when the light is turned on. - virtual void LightTurnedOn() {} - - // Sent when the light is turned off. - virtual void LightTurnedOff() {} - }; - - using LightComponentNotificationBus = AZ::EBus < LightComponentNotifications >; - - /*! - * LightSettingsNotifications - * Events dispatched by the light component or light component editor when settings have changed. - */ - class LightSettingsNotifications - : public AZ::ComponentBus - { - public: - - virtual ~LightSettingsNotifications() {} - - virtual void AnimationSettingsChanged() = 0; - }; - - using LightSettingsNotificationsBus = AZ::EBus < LightSettingsNotifications >; - -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h deleted file mode 100644 index b8b9e316ff..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MaterialHandle.h +++ /dev/null @@ -1,54 +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 - -struct IMaterial; - -namespace AZ -{ - class BehaviorContext; -} -namespace LmbrCentral -{ - //! Wraps a IMaterial pointer in a way that BehaviorContext can use it - class MaterialHandle - { - public: - AZ_CLASS_ALLOCATOR(MaterialHandle, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(MaterialHandle, "{BF659DC6-ACDD-4062-A52E-4EC053286F4F}"); - - MaterialHandle() - { - } - - MaterialHandle(const MaterialHandle& handle) - : m_material(handle.m_material) - { - } - - ~MaterialHandle() - { - } - - MaterialHandle& operator=(const MaterialHandle& rhs) - { - m_material = rhs.m_material; - return *this; - } - - IMaterial* m_material; - - static void Reflect(AZ::BehaviorContext* behaviorContext); - static void Reflect(AZ::SerializeContext* serializeContext); - }; - -} diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h deleted file mode 100644 index eb1e53edcd..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshModificationBus.h +++ /dev/null @@ -1,132 +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 -#include - -struct IRenderMesh; - -namespace LmbrCentral -{ - /* - * MeshModificationRequestBus - * Requests for a render mesh to be sent for editing. - */ - class MeshModificationRequests - : public AZ::ComponentBus - { - public: - - virtual void RequireSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) = 0; - - virtual void StopSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) = 0; - - protected: - ~MeshModificationRequests() = default; - }; - - using MeshModificationRequestBus = AZ::EBus; - - /* - * MeshModificationRequestHelper - * Helper class to manage storing indices for the render meshes to edit. - */ - class MeshModificationRequestHelper - : public MeshModificationRequestBus::Handler - , public AZ::TickBus::Handler - { - public: - struct MeshLODPrimIndex - { - size_t lodIndex; - size_t primitiveIndex; - - bool operator<(const MeshLODPrimIndex& right) const - { - return (lodIndex < right.lodIndex) - || (lodIndex == right.lodIndex && primitiveIndex < right.primitiveIndex); - } - }; - - void Connect(MeshModificationRequestBus::BusIdType busId) - { - MeshModificationRequestBus::Handler::BusConnect(busId); - AZ::TickBus::Handler::BusConnect(); - } - - bool IsConnected() - { - return MeshModificationRequestBus::Handler::BusIsConnected(); - } - - void Disconnect() - { - AZ::TickBus::Handler::BusDisconnect(); - MeshModificationRequestBus::Handler::BusDisconnect(); - } - - void RequireSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) override - { - m_meshesToSendForEditing.insert({ lodIndex, primitiveIndex }); - } - - void StopSendingRenderMeshForModification(size_t lodIndex, size_t primitiveIndex) override - { - m_meshesToSendForEditing.erase({ lodIndex, primitiveIndex }); - } - - const AZStd::set& MeshesToEdit() const - { - return m_meshesToSendForEditing; - } - - bool GetMeshModified() const - { - return m_meshModified; - } - - void SetMeshModified(bool value) - { - m_meshModified = value; - } - - private: - void OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) override - { - m_meshModified = false; - } - - int GetTickOrder() override - { - return AZ::TICK_PRE_RENDER; - } - - AZStd::set m_meshesToSendForEditing; - bool m_meshModified = false; - }; - - /* - * MeshModificationNotificationBus - * Sends an event when the render mesh data should be edited. - */ - class MeshModificationNotifications - : public AZ::ComponentBus - { - public: - using MutexType = AZStd::mutex; - - virtual void ModifyMesh([[maybe_unused]] size_t lodIndex, [[maybe_unused]] size_t primitiveIndex, [[maybe_unused]] IRenderMesh* renderMesh) {} - - protected: - ~MeshModificationNotifications() = default; - }; - - using MeshModificationNotificationBus = AZ::EBus; -}// namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake index 24f9ff6dcd..665dbef5b7 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_editor_files.cmake @@ -8,7 +8,6 @@ set(FILES include/LmbrCentral/Rendering/EditorCameraCorrectionBus.h - include/LmbrCentral/Rendering/EditorLightComponentBus.h include/LmbrCentral/Shape/EditorPolygonPrismShapeComponentBus.h include/LmbrCentral/Shape/EditorSplineComponentBus.h include/LmbrCentral/Shape/EditorTubeShapeComponentBus.h diff --git a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake index cd8f3eff21..9c2d4c1746 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake @@ -27,13 +27,8 @@ set(FILES include/LmbrCentral/Dependency/DependencyMonitor.h include/LmbrCentral/Dependency/DependencyMonitor.inl include/LmbrCentral/Dependency/DependencyNotificationBus.h - include/LmbrCentral/Rendering/DecalComponentBus.h - include/LmbrCentral/Rendering/LightComponentBus.h include/LmbrCentral/Rendering/MaterialAsset.h - include/LmbrCentral/Rendering/MaterialHandle.h include/LmbrCentral/Rendering/MeshAsset.h - include/LmbrCentral/Rendering/MeshModificationBus.h - include/LmbrCentral/Rendering/GiRegistrationBus.h include/LmbrCentral/Rendering/RenderBoundsBus.h include/LmbrCentral/Scripting/EditorTagComponentBus.h include/LmbrCentral/Scripting/GameplayNotificationBus.h From 55e557b5539534bf27836dfe9b3d082d09405259 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:15:00 -0800 Subject: [PATCH 186/394] Removes TerrainSystemRequestBus.h from Gems/LmbrCentral Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Terrain/TerrainSystemRequestBus.h | 34 ------------------- .../Code/lmbrcentral_headers_files.cmake | 1 - 2 files changed, 35 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h deleted file mode 100644 index 1c5c319731..0000000000 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Terrain/TerrainSystemRequestBus.h +++ /dev/null @@ -1,34 +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 LmbrCentral -{ - // Shared interface for terrain system implementations - class TerrainSystemRequests - : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - - // Get the terrain height at a specific location - virtual float GetElevation(const AZ::Vector3& position) const = 0; - - // Get the terrain surface normal at a specific location - virtual AZ::Vector3 GetNormal(const AZ::Vector3& position) const = 0; - }; - - using TerrainSystemRequestBus = AZ::EBus; -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake index 9c2d4c1746..f7c51c67b6 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake +++ b/Gems/LmbrCentral/Code/lmbrcentral_headers_files.cmake @@ -51,5 +51,4 @@ set(FILES include/LmbrCentral/Shape/ReferenceShapeComponentBus.h include/LmbrCentral/Shape/SplineAttribute.h include/LmbrCentral/Shape/SplineAttribute.inl - include/LmbrCentral/Terrain/TerrainSystemRequestBus.h ) From 837a139464b7864ae142eba9e64d4d7393c88680 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:18:39 -0800 Subject: [PATCH 187/394] =?UTF-8?q?=EF=BB=BFRemoves=20LmbrCentralReflectio?= =?UTF-8?q?nTest.cpp=20from=20Gems/LmbrCentral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp diff --git a/Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp b/Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp deleted file mode 100644 index 196f0931e0..0000000000 --- a/Gems/LmbrCentral/Code/Tests/LmbrCentralReflectionTest.cpp +++ /dev/null @@ -1,7 +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 - * - */ From d89b682e9c791954b86ee0aa59e4fcd73e9fd24f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:24:04 -0800 Subject: [PATCH 188/394] Removes CommandHierarchyItemToggleIsSelected.h/cpp from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommandHierarchyItemToggleIsSelected.cpp | 67 ------------------- .../CommandHierarchyItemToggleIsSelected.h | 52 -------------- Gems/LyShine/Code/Editor/EditorCommon.h | 2 - .../Code/lyshine_uicanvaseditor_files.cmake | 2 - 4 files changed, 123 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp delete mode 100644 Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h diff --git a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp b/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp deleted file mode 100644 index 563fbe1935..0000000000 --- a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.cpp +++ /dev/null @@ -1,67 +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 "EditorCommon.h" - -CommandHierarchyItemToggleIsSelected::CommandHierarchyItemToggleIsSelected(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item) - : QUndoCommand() - , m_stack(stack) - , m_hierarchy(hierarchy) - , m_id(item->GetEntityId()) - , m_toIsSelected(false) -{ - setText(QString("toggle selection of \"%1\"").arg(item->GetElement()->GetName().c_str())); - - EBUS_EVENT_ID_RESULT(m_toIsSelected, m_id, UiEditorBus, GetIsSelected); - m_toIsSelected = !m_toIsSelected; -} - -void CommandHierarchyItemToggleIsSelected::undo() -{ - UndoStackExecutionScope s(m_stack); - - SetIsSelected(!m_toIsSelected); -} - -void CommandHierarchyItemToggleIsSelected::redo() -{ - UndoStackExecutionScope s(m_stack); - - SetIsSelected(m_toIsSelected); -} - -void CommandHierarchyItemToggleIsSelected::SetIsSelected(bool isSelected) -{ - AZ::Entity* element = EntityHelpers::GetEntity(m_id); - if (!element) - { - // The element DOESN'T exist. - // Nothing to do. - return; - } - - // This will do both the Runtime-side and Editor-side. - HierarchyItem::RttiCast(HierarchyHelpers::ElementToItem(m_hierarchy, element, false))->SetIsSelected(isSelected); -} - -void CommandHierarchyItemToggleIsSelected::Push(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item) -{ - if (stack->GetIsExecuting()) - { - // This is a redundant Qt notification. - // Nothing else to do. - return; - } - - stack->push(new CommandHierarchyItemToggleIsSelected(stack, - hierarchy, - item)); -} diff --git a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h b/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h deleted file mode 100644 index 97a988e04b..0000000000 --- a/Gems/LyShine/Code/Editor/CommandHierarchyItemToggleIsSelected.h +++ /dev/null @@ -1,52 +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 - -class CommandHierarchyItemToggleIsSelected - : public QUndoCommand -{ -public: - - void undo() override; - void redo() override; - - // IMPORTANT: We DON'T want this command to support mergeWith(). - // Otherwise we leave commands on the undo stack that have no - // effect (NOOP). - // - // To avoid the NOOPs, we can either: - // - // (1) Delete the NOPs from the undo stack. - // or - // (2) NOT support mergeWith(). - // - // The problem with (1) is that it only allows odd number of - // state changes to be undoable. (2) is more consistent - // by making all state changes undoable. - - static void Push(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item); - -private: - - CommandHierarchyItemToggleIsSelected(UndoStack* stack, - HierarchyWidget* hierarchy, - HierarchyItem* item); - - void SetIsSelected(bool isSelected); - - UndoStack* m_stack; - - HierarchyWidget* m_hierarchy; - - AZ::EntityId m_id; - bool m_toIsSelected; -}; diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 5a435e7dba..95b0bf753f 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -42,7 +42,6 @@ class CommandHierarchyItemRename; class CommandHierarchyItemReparent; class CommandHierarchyItemToggleIsExpanded; class CommandHierarchyItemToggleIsSelectable; -class CommandHierarchyItemToggleIsSelected; class CommandHierarchyItemToggleIsVisible; class CommandPropertiesChange; class CommandViewportInteractionMode; @@ -123,7 +122,6 @@ enum class FusibleCommand #include "CommandHierarchyItemReparent.h" #include "CommandHierarchyItemToggleIsExpanded.h" #include "CommandHierarchyItemToggleIsSelectable.h" -#include "CommandHierarchyItemToggleIsSelected.h" #include "CommandHierarchyItemToggleIsVisible.h" #include "CommandPropertiesChange.h" #include "CommandViewportInteractionMode.h" diff --git a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake index 49fee653be..9750116ad1 100644 --- a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake +++ b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake @@ -50,8 +50,6 @@ set(FILES Editor/CommandHierarchyItemToggleIsExpanded.h Editor/CommandHierarchyItemToggleIsSelectable.cpp Editor/CommandHierarchyItemToggleIsSelectable.h - Editor/CommandHierarchyItemToggleIsSelected.cpp - Editor/CommandHierarchyItemToggleIsSelected.h Editor/CommandHierarchyItemToggleIsVisible.cpp Editor/CommandHierarchyItemToggleIsVisible.h Editor/CommandPropertiesChange.cpp From 4cfdbe3731f32678ff97558ec99a0b66952029d5 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:28:37 -0800 Subject: [PATCH 189/394] Removes CommandViewportInteractionMode from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Editor/CommandViewportInteractionMode.cpp | 94 ------------------- .../Editor/CommandViewportInteractionMode.h | 43 --------- Gems/LyShine/Code/Editor/EditorCommon.h | 2 - .../Code/lyshine_uicanvaseditor_files.cmake | 2 - 4 files changed, 141 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp delete mode 100644 Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h diff --git a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp b/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp deleted file mode 100644 index 260ff4c4e4..0000000000 --- a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.cpp +++ /dev/null @@ -1,94 +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 "EditorCommon.h" - -CommandViewportInteractionMode::CommandViewportInteractionMode(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to) - : QUndoCommand() - , m_stack(stack) - , m_viewportInteraction(viewportInteraction) - , m_from(from) - , m_to(to) -{ - UpdateText(); -} - -void CommandViewportInteractionMode::undo() -{ - UndoStackExecutionScope s(m_stack); - - SetMode(m_from); -} - -void CommandViewportInteractionMode::redo() -{ - UndoStackExecutionScope s(m_stack); - - SetMode(m_to); -} - -int CommandViewportInteractionMode::id() const -{ - return (int)FusibleCommand::kViewportInteractionMode; -} - -bool CommandViewportInteractionMode::mergeWith(const QUndoCommand* other) -{ - if (other->id() != id()) - { - // NOT the same command type. - return false; - } - - const CommandViewportInteractionMode* subsequent = static_cast(other); - AZ_Assert(subsequent, "No command to merge with"); - - if (!((subsequent->m_stack == m_stack) && - (subsequent->m_viewportInteraction == m_viewportInteraction))) - { - // NOT the same context. - return false; - } - - m_to = subsequent->m_to; - - UpdateText(); - - return true; -} - -void CommandViewportInteractionMode::UpdateText() -{ - setText(QString("mode change to %1").arg(ViewportHelpers::InteractionModeToString(m_to->data().toInt()))); -} - -void CommandViewportInteractionMode::SetMode(QAction* action) const -{ - action->trigger(); - - // IMPORTANT: It's NOT necessary to prevent this from executing on the - // first run. We WON'T get a redundant Qt notification by this point. - m_viewportInteraction->SetMode((ViewportInteraction::InteractionMode)action->data().toInt()); -} - -void CommandViewportInteractionMode::Push(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to) -{ - if (stack->GetIsExecuting()) - { - // This is a redundant Qt notification. - // Nothing else to do. - return; - } - - stack->push(new CommandViewportInteractionMode(stack, viewportInteraction, from, to)); -} diff --git a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h b/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h deleted file mode 100644 index be6f1bc6ab..0000000000 --- a/Gems/LyShine/Code/Editor/CommandViewportInteractionMode.h +++ /dev/null @@ -1,43 +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 - -class CommandViewportInteractionMode - : public QUndoCommand -{ -public: - - void undo() override; - void redo() override; - - int id() const override; - bool mergeWith(const QUndoCommand* other) override; - - static void Push(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to); - -private: - - CommandViewportInteractionMode(UndoStack* stack, - ViewportInteraction* viewportInteraction, - QAction* from, - QAction* to); - - void UpdateText(); - void SetMode(QAction* action) const; - - UndoStack* m_stack; - - ViewportInteraction* m_viewportInteraction; - QAction* m_from; - QAction* m_to; -}; diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 95b0bf753f..76f883b6ec 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -44,7 +44,6 @@ class CommandHierarchyItemToggleIsExpanded; class CommandHierarchyItemToggleIsSelectable; class CommandHierarchyItemToggleIsVisible; class CommandPropertiesChange; -class CommandViewportInteractionMode; class ComponentButton; class CoordinateSystemToolbarSection; class EditorMenu; @@ -124,7 +123,6 @@ enum class FusibleCommand #include "CommandHierarchyItemToggleIsSelectable.h" #include "CommandHierarchyItemToggleIsVisible.h" #include "CommandPropertiesChange.h" -#include "CommandViewportInteractionMode.h" #include "ComponentButton.h" #include "CoordinateSystemToolbarSection.h" #include "EditorWindow.h" diff --git a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake index 9750116ad1..c53891dcfc 100644 --- a/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake +++ b/Gems/LyShine/Code/lyshine_uicanvaseditor_files.cmake @@ -54,8 +54,6 @@ set(FILES Editor/CommandHierarchyItemToggleIsVisible.h Editor/CommandPropertiesChange.cpp Editor/CommandPropertiesChange.h - Editor/CommandViewportInteractionMode.cpp - Editor/CommandViewportInteractionMode.h Editor/ComponentAssetHelpers.h Editor/ComponentButton.cpp Editor/ComponentButton.h From 70ffece2a969f157c80ac45d3b5289474b5a8f31 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:33:41 -0800 Subject: [PATCH 190/394] Removes UiAnimViewSplitter from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Editor/Animation/UiAnimViewSplitter.cpp | 67 ------------------- .../Editor/Animation/UiAnimViewSplitter.h | 36 ---------- 2 files changed, 103 deletions(-) delete mode 100644 Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp delete mode 100644 Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp deleted file mode 100644 index 5a1ffd73f7..0000000000 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.cpp +++ /dev/null @@ -1,67 +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 "UiAnimViewSplitter.h" - - -// CUiAnimViewSplitter - -IMPLEMENT_DYNAMIC(CUiAnimViewSplitter, CSplitterWnd) -CUiAnimViewSplitter::CUiAnimViewSplitter() -{ - m_cxSplitter = m_cySplitter = 3 + 1 + 1 - 1; - m_cxBorderShare = m_cyBorderShare = 0; - m_cxSplitterGap = m_cySplitterGap = 3 + 1 + 1 - 1; - m_cxBorder = m_cyBorder = 0; -} - -CUiAnimViewSplitter::~CUiAnimViewSplitter() -{ -} - - -BEGIN_MESSAGE_MAP(CUiAnimViewSplitter, CSplitterWnd) -END_MESSAGE_MAP() - - - -// CUiAnimViewSplitter message handlers - -void CUiAnimViewSplitter::SetPane(int row, int col, CWnd* pWnd, SIZE sizeInit) -{ - assert(pWnd != NULL); - - // set the initial size for that pane - m_pColInfo[col].nIdealSize = sizeInit.cx; - m_pRowInfo[row].nIdealSize = sizeInit.cy; - - pWnd->ModifyStyle(0, WS_BORDER, WS_CHILD | WS_VISIBLE); - pWnd->SetParent(this); - - CRect rect(CPoint(0, 0), sizeInit); - pWnd->MoveWindow(0, 0, sizeInit.cx, sizeInit.cy, FALSE); - pWnd->SetDlgCtrlID(IdFromRowCol(row, col)); - - ASSERT((int)::GetDlgCtrlID(pWnd->m_hWnd) == IdFromRowCol(row, col)); -} - -void CUiAnimViewSplitter::OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg) -{ - // Let CSplitterWnd handle everything but the border-drawing - //if((nType != splitBorder) || (pDC == NULL)) - { - CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg); - return; - } - - ASSERT_VALID(pDC); - - // Draw border - pDC->Draw3dRect(rectArg, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); -} diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h deleted file mode 100644 index 028861289b..0000000000 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplitter.h +++ /dev/null @@ -1,36 +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 - - - -// CUiAnimViewSplitter - -class CUiAnimViewSplitter - : public CSplitterWnd -{ - DECLARE_DYNAMIC(CUiAnimViewSplitter) - - virtual CWnd * GetActivePane(int* pRow = NULL, int* pCol = NULL) - { - return GetFocus(); - } - - void SetPane(int row, int col, CWnd* pWnd, SIZE sizeInit); - // Ovveride this for flat look. - void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg); - -public: - CUiAnimViewSplitter(); - virtual ~CUiAnimViewSplitter(); - -protected: - DECLARE_MESSAGE_MAP() -}; From 5b0cb9cdff34288d1e6aae2e2f4e8cfba12c1b77 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:44:48 -0800 Subject: [PATCH 191/394] refactors some code to better pickup AZ_LOADSCREENCOMPONENT_ENABLED's value Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp | 2 +- Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp | 2 +- Code/Legacy/CrySystem/System.h | 2 +- Code/Legacy/CrySystem/SystemInit.cpp | 2 +- Gems/LmbrCentral/Code/Source/LmbrCentral.cpp | 6 ------ Gems/LyShine/Code/Source/LyShineModule.cpp | 2 ++ 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp index dbe92ee6aa..0b90e73bc0 100644 --- a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp @@ -15,7 +15,7 @@ #include #include "CryPath.h" -#include +#include #include #include diff --git a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp index 095d296373..a890b76662 100644 --- a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp @@ -10,7 +10,7 @@ #include "SpawnableLevelSystem.h" #include "IMovieSystem.h" -#include +#include #include #include diff --git a/Code/Legacy/CrySystem/System.h b/Code/Legacy/CrySystem/System.h index 9b76e94eb4..63a24c9f9c 100644 --- a/Code/Legacy/CrySystem/System.h +++ b/Code/Legacy/CrySystem/System.h @@ -17,7 +17,7 @@ #include "CmdLine.h" #include -#include +#include #include #include diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 19d94ba6ec..600a799bc1 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp index 76f50b5ea6..9062e7552c 100644 --- a/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp +++ b/Gems/LmbrCentral/Code/Source/LmbrCentral.cpp @@ -219,9 +219,6 @@ namespace LmbrCentral PolygonPrismShapeDebugDisplayComponent::CreateDescriptor(), TubeShapeDebugDisplayComponent::CreateDescriptor(), AssetSystemDebugComponent::CreateDescriptor(), -#if AZ_LOADSCREENCOMPONENT_ENABLED - LoadScreenComponent::CreateDescriptor(), -#endif // if AZ_LOADSCREENCOMPONENT_ENABLED }); // This is an internal Amazon gem, so register it's components for metrics tracking, otherwise the name of the component won't get sent back. @@ -248,9 +245,6 @@ namespace LmbrCentral azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), -#if AZ_LOADSCREENCOMPONENT_ENABLED - azrtti_typeid(), -#endif // if AZ_LOADSCREENCOMPONENT_ENABLED }; } diff --git a/Gems/LyShine/Code/Source/LyShineModule.cpp b/Gems/LyShine/Code/Source/LyShineModule.cpp index 1a6b2cdbda..604cd09e22 100644 --- a/Gems/LyShine/Code/Source/LyShineModule.cpp +++ b/Gems/LyShine/Code/Source/LyShineModule.cpp @@ -55,6 +55,8 @@ #include "Pipeline/LyShineBuilder/LyShineBuilderComponent.h" #endif // LYSHINE_BUILDER +#include + namespace LyShine { LyShineModule::LyShineModule() From aed48d0f25d6759105cb76fc8b1319f3da69fea4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:46:38 -0800 Subject: [PATCH 192/394] Removes resource.h from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LyShine/Code/Source/resource.h | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 Gems/LyShine/Code/Source/resource.h diff --git a/Gems/LyShine/Code/Source/resource.h b/Gems/LyShine/Code/Source/resource.h deleted file mode 100644 index 0d25f9094b..0000000000 --- a/Gems/LyShine/Code/Source/resource.h +++ /dev/null @@ -1,23 +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 - * - */ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by CryFont.rc -// -#define VS_VERSION_INFO 1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif From 16afbf6bc0f7258fbb08bef1aa8d73e4a0d97fb3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:51:02 -0800 Subject: [PATCH 193/394] Removes UiEntityContext.cpp from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LyShine/Code/Source/UiEntityContext.cpp | 219 ------------------- 1 file changed, 219 deletions(-) delete mode 100644 Gems/LyShine/Code/Source/UiEntityContext.cpp diff --git a/Gems/LyShine/Code/Source/UiEntityContext.cpp b/Gems/LyShine/Code/Source/UiEntityContext.cpp deleted file mode 100644 index 2741c4c521..0000000000 --- a/Gems/LyShine/Code/Source/UiEntityContext.cpp +++ /dev/null @@ -1,219 +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 -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -UiEntityContext::UiEntityContext() - : AzFramework::EntityContext(AzFramework::EntityContextId::CreateRandom()) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -UiEntityContext::~UiEntityContext() -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::Activate() -{ - InitContext(); - - GetRootSlice()->Instantiate(); - - UiEntityContextRequestBus::Handler::BusConnect(GetContextId()); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::Deactivate() -{ - UiEntityContextRequestBus::Handler::BusDisconnect(); - - DestroyContext(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiEntityContext::GetRootAssetEntity() -{ - return m_rootAsset.Get()->GetEntity(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiEntityContext::CloneRootAssetEntity() -{ - AZ::SerializeContext* context = nullptr; - EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); - - AZ::Entity* rootAssetEntity = GetRootAssetEntity(); - - AZ::Entity* clonedRootAssetEntity = context->CloneObject(rootAssetEntity); - return clonedRootAssetEntity; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Entity* UiEntityContext::CreateUiEntity(const char* name) -{ - AZ::Entity* entity = CreateEntity(name); - - if (entity) - { - // we don't currently do anything extra here, UI entities are not automatically - // Init'ed and Activate'd when they are created. We wait until the required components - // are added before Init and Activate - } - - return entity; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::AddUiEntity(AZ::Entity* entity) -{ - AZ_Assert(entity, "Supplied entity is invalid."); - - AddEntity(entity); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::AddUiEntities(const AzFramework::EntityContext::EntityList& entities) -{ - AZ::PrefabAsset* rootSlice = m_rootAsset.Get(); - - for (AZ::Entity* entity : entities) - { - AZ_Assert(!AzFramework::EntityIdContextQueryBus::MultiHandler::BusIsConnectedId(entity->GetId()), "Entity already in context."); - rootSlice->GetComponent()->AddEntity(entity); - } - - HandleEntitiesAdded(entities); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiEntityContext::CloneUiEntities(const AZStd::vector& sourceEntities, AzFramework::EntityContext::EntityList& resultEntities) -{ - resultEntities.clear(); - - AZ::PrefabComponent::InstantiatedContainer sourceObjects; - for (const AZ::EntityId& id : sourceEntities) - { - AZ::Entity* entity = nullptr; - EBUS_EVENT_RESULT(entity, AZ::ComponentApplicationBus, FindEntity, id); - if (entity) - { - sourceObjects.m_entities.push_back(entity); - } - } - - AZ::PrefabComponent::EntityIdToEntityIdMap idMap; - AZ::PrefabComponent::InstantiatedContainer* clonedObjects = - AZ::Utils::CloneObjectAndFixEntities(&sourceObjects, idMap); - if (!clonedObjects) - { - AZ_Error("UiEntityContext", false, "Failed to clone source entities."); - return false; - } - - resultEntities = clonedObjects->m_entities; - - AddUiEntities(resultEntities); - - sourceObjects.m_entities.clear(); - clonedObjects->m_entities.clear(); - delete clonedObjects; - - return true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiEntityContext::DestroyUiEntity(AZ::EntityId entityId) -{ - if (DestroyEntity(entityId)) - { - return true; - } - - return false; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -bool UiEntityContext::HandleLoadedRootSliceEntity(AZ::Entity* rootEntity, bool remapIds, AZ::PrefabComponent::EntityIdToEntityIdMap* idRemapTable) -{ - AZ_Assert(m_rootAsset, "The context has not been initialized."); - - if (!AzFramework::EntityContext::HandleLoadedRootSliceEntity(rootEntity, remapIds, idRemapTable)) - { - return false; - } - - AZ::PrefabComponent::EntityList entities; - GetRootSlice()->GetEntities(entities); - - GetRootSlice()->SetIsDynamic(true); - - InitializeEntities(entities); - - return true; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::OnContextEntitiesAdded(const AzFramework::EntityContext::EntityList& entities) -{ - EntityContext::OnContextEntitiesAdded(entities); - - InitializeEntities(entities); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::OnContextEntityRemoved(const AZ::EntityId& entityId) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::SetupUiEntity(AZ::Entity* entity) -{ - InitializeEntities({ entity }); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiEntityContext::InitializeEntities(const AzFramework::EntityContext::EntityList& entities) -{ - // UI entities are now automatically activated on creation - - for (AZ::Entity* entity : entities) - { - if (entity->GetState() == AZ::Entity::ES_CONSTRUCTED) - { - entity->Init(); - } - } - - for (AZ::Entity* entity : entities) - { - if (entity->GetState() == AZ::Entity::ES_INIT) - { - entity->Activate(); - } - } -} From 845d72c54295aba6e35bc648abf85b344f228835 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:58:08 -0800 Subject: [PATCH 194/394] Removes AnimTrack.cpp and AnimSplineTrack.cpp from Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LyShine/Code/Source/Animation/AnimSplineTrack.cpp | 11 ----------- Gems/LyShine/Code/Source/Animation/AnimTrack.cpp | 10 ---------- Gems/LyShine/Code/lyshine_static_files.cmake | 3 --- 3 files changed, 24 deletions(-) delete mode 100644 Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp delete mode 100644 Gems/LyShine/Code/Source/Animation/AnimTrack.cpp diff --git a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp b/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp deleted file mode 100644 index 5e44bfdc2b..0000000000 --- a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.cpp +++ /dev/null @@ -1,11 +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 "AnimSplineTrack.h" - diff --git a/Gems/LyShine/Code/Source/Animation/AnimTrack.cpp b/Gems/LyShine/Code/Source/Animation/AnimTrack.cpp deleted file mode 100644 index 080e0b05a6..0000000000 --- a/Gems/LyShine/Code/Source/Animation/AnimTrack.cpp +++ /dev/null @@ -1,10 +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 "AnimTrack.h" diff --git a/Gems/LyShine/Code/lyshine_static_files.cmake b/Gems/LyShine/Code/lyshine_static_files.cmake index 925658e756..376a53f724 100644 --- a/Gems/LyShine/Code/lyshine_static_files.cmake +++ b/Gems/LyShine/Code/lyshine_static_files.cmake @@ -102,7 +102,6 @@ set(FILES Source/UiImageSequenceComponent.h Source/UiRenderer.cpp Source/UiRenderer.h - Source/resource.h Include/LyShine/LyShineBus.h Source/EditorPropertyTypes.cpp Source/EditorPropertyTypes.h @@ -207,10 +206,8 @@ set(FILES Source/Animation/AnimNode.h Source/Animation/AnimSequence.cpp Source/Animation/AnimSequence.h - Source/Animation/AnimSplineTrack.cpp Source/Animation/AnimSplineTrack.h Source/Animation/AnimSplineTrack_Vec2Specialization.h - Source/Animation/AnimTrack.cpp Source/Animation/AnimTrack.h Source/Animation/AzEntityNode.cpp Source/Animation/AzEntityNode.h From ba6cad1ac1183aea08830909f8f987d7072cdfac Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:06:54 -0800 Subject: [PATCH 195/394] Removes AnimTrack.cpp and AnimSplineTrack.cpp from Gems/Maestro Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/Cinematics/AnimSplineTrack.cpp | 11 ----------- Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp | 10 ---------- Gems/Maestro/Code/maestro_static_files.cmake | 2 -- 3 files changed, 23 deletions(-) delete mode 100644 Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp delete mode 100644 Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp deleted file mode 100644 index 5e44bfdc2b..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.cpp +++ /dev/null @@ -1,11 +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 "AnimSplineTrack.h" - diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp deleted file mode 100644 index 080e0b05a6..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/AnimTrack.cpp +++ /dev/null @@ -1,10 +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 "AnimTrack.h" diff --git a/Gems/Maestro/Code/maestro_static_files.cmake b/Gems/Maestro/Code/maestro_static_files.cmake index 4e576dfbe5..da92f90347 100644 --- a/Gems/Maestro/Code/maestro_static_files.cmake +++ b/Gems/Maestro/Code/maestro_static_files.cmake @@ -23,8 +23,6 @@ set(FILES Source/Cinematics/Movie.h Source/Cinematics/TCBSpline.h Source/Cinematics/resource.h - Source/Cinematics/AnimSplineTrack.cpp - Source/Cinematics/AnimTrack.cpp Source/Cinematics/AssetBlendTrack.cpp Source/Cinematics/BoolTrack.cpp Source/Cinematics/CaptureTrack.cpp From c8dd05b154728b10f1a4b4689a58c7fd3f3dbe4d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:10:20 -0800 Subject: [PATCH 196/394] Removes Cinematic/resource.h from Gems/Maestro Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Maestro/Code/Source/Cinematics/resource.h | 21 ------------------- Gems/Maestro/Code/maestro_static_files.cmake | 1 - 2 files changed, 22 deletions(-) delete mode 100644 Gems/Maestro/Code/Source/Cinematics/resource.h diff --git a/Gems/Maestro/Code/Source/Cinematics/resource.h b/Gems/Maestro/Code/Source/Cinematics/resource.h deleted file mode 100644 index eb3d76bc60..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/resource.h +++ /dev/null @@ -1,21 +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 - * - */ - - -#define VS_VERSION_INFO 1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Gems/Maestro/Code/maestro_static_files.cmake b/Gems/Maestro/Code/maestro_static_files.cmake index da92f90347..688ae1d074 100644 --- a/Gems/Maestro/Code/maestro_static_files.cmake +++ b/Gems/Maestro/Code/maestro_static_files.cmake @@ -22,7 +22,6 @@ set(FILES Source/Cinematics/CharacterTrackAnimator.h Source/Cinematics/Movie.h Source/Cinematics/TCBSpline.h - Source/Cinematics/resource.h Source/Cinematics/AssetBlendTrack.cpp Source/Cinematics/BoolTrack.cpp Source/Cinematics/CaptureTrack.cpp From bc27465a3c1456465562f1b793658ffa8717be74 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:16:46 -0800 Subject: [PATCH 197/394] Removes TCBSpline.h from Gems/Maestro Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/Animation/AnimSplineTrack.h | 1 - .../Code/Source/Cinematics/AnimSplineTrack.h | 1 - .../Code/Source/Cinematics/TCBSpline.h | 856 ------------------ Gems/Maestro/Code/maestro_static_files.cmake | 1 - 4 files changed, 859 deletions(-) delete mode 100644 Gems/Maestro/Code/Source/Cinematics/TCBSpline.h diff --git a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h b/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h index 8859118e00..882934d8ee 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h +++ b/Gems/LyShine/Code/Source/Animation/AnimSplineTrack.h @@ -10,7 +10,6 @@ #pragma once #include -//#include "TCBSpline.h" #include "2DSpline.h" #define MIN_TIME_PRECISION 0.01f diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h b/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h index 93f71d64ac..e621d0ef87 100644 --- a/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h +++ b/Gems/Maestro/Code/Source/Cinematics/AnimSplineTrack.h @@ -13,7 +13,6 @@ #pragma once #include "IMovieSystem.h" -#include "TCBSpline.h" #include "2DSpline.h" #define MIN_TIME_PRECISION 0.01f diff --git a/Gems/Maestro/Code/Source/Cinematics/TCBSpline.h b/Gems/Maestro/Code/Source/Cinematics/TCBSpline.h deleted file mode 100644 index 35eca3ed00..0000000000 --- a/Gems/Maestro/Code/Source/Cinematics/TCBSpline.h +++ /dev/null @@ -1,856 +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 - * - */ - - -// Description : Classes for TCB Spline curves -// Notice : Deprecated by 2DSpline h - - -#ifndef CRYINCLUDE_CRYMOVIE_TCBSPLINE_H -#define CRYINCLUDE_CRYMOVIE_TCBSPLINE_H -#pragma once - - -#include - - - - -namespace spline -{ - //! Quaternion interpolation for angles > 2PI. - ILINE static Quat CreateSquadRev(f32 angle, // angle of rotation - const Vec3& axis, // the axis of rotation - const Quat& p, // start quaternion - const Quat& a, // start tangent quaternion - const Quat& b, // end tangent quaternion - const Quat& q, // end quaternion - f32 t) // Time parameter, in range [0,1] - { - f32 s, v; - f32 omega = 0.5f * angle; - f32 nrevs = 0; - Quat r, pp, qq; - - if (omega < (gf_PI - 0.00001f)) - { - return Quat::CreateSquad(p, a, b, q, t); - } - - while (omega > (gf_PI - 0.00001f)) - { - omega -= gf_PI; - nrevs += 1.0f; - } - if (omega < 0) - { - omega = 0; - } - s = t * angle / gf_PI; // 2t(omega+Npi)/pi - - if (s < 1.0f) - { - pp = p * Quat(0.0f, axis);//pp = p.Orthog( axis ); - r = Quat::CreateSquad(p, a, pp, pp, s); // in first 90 degrees. - } - else - { - v = s + 1.0f - 2.0f * (nrevs + (omega / gf_PI)); - if (v <= 0.0f) - { - // middle part, on great circle(p,q). - while (s >= 2.0f) - { - s -= 2.0f; - } - pp = p * Quat(0.0f, axis);//pp = p.Orthog(axis); - r = Quat::CreateSlerp(p, pp, s); - } - else - { - // in last 90 degrees. - qq = -q* Quat(0.0f, axis); - r = Quat::CreateSquad(qq, qq, b, q, v); - } - } - return r; - } - - - - - /** TCB spline key extended for tangent unify/break. - */ - template - struct TCBSplineKeyEx - : public TCBSplineKey - { - float theta_from_dd_to_ds; - float scale_from_dd_to_ds; - - void ComputeThetaAndScale() { assert(0); } - void SetOutTangentFromIn() { assert(0); } - void SetInTangentFromOut() { assert(0); } - - TCBSplineKeyEx() - : theta_from_dd_to_ds(gf_PI) - , scale_from_dd_to_ds(1.0f) {} - }; - - template <> - inline void TCBSplineKeyEx::ComputeThetaAndScale() - { - scale_from_dd_to_ds = (easeto + 1.0f) / (easefrom + 1.0f); - float out = atan_tpl(dd); - float in = atan_tpl(ds); - theta_from_dd_to_ds = in + gf_PI - out; - } - - template<> - inline void TCBSplineKeyEx::SetOutTangentFromIn() - { - assert((flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED); - easefrom = (easeto + 1.0f) / scale_from_dd_to_ds - 1.0f; - if (easefrom > 1) - { - easefrom = 1.0f; - } - else if (easefrom < 0) - { - easefrom = 0; - } - float in = atan_tpl(ds); - dd = tan_tpl(in + gf_PI - theta_from_dd_to_ds); - } - - template<> - inline void TCBSplineKeyEx::SetInTangentFromOut() - { - assert((flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED); - easeto = scale_from_dd_to_ds * (easefrom + 1.0f) - 1.0f; - if (easeto > 1) - { - easeto = 1.0f; - } - else if (easeto < 0) - { - easeto = 0; - } - float out = atan_tpl(dd); - ds = tan_tpl(out + theta_from_dd_to_ds - gf_PI); - } - - /**************************************************************************** - ** TCBSpline class implementation ** - ****************************************************************************/ - template > - class TCBSpline - : public TSpline< Key, HermitBasis > - { - public: - virtual void comp_deriv(); - - protected: - virtual void interp_keys(int key1, int key2, float u, T& val); - float calc_ease(float t, float a, float b); - - private: - void compMiddleDeriv(int curr); - void compFirstDeriv(); - void compLastDeriv(); - void comp2KeyDeriv(); - }; - - ////////////////////////////////////////////////////////////////////////// - template - inline void TCBSpline::compMiddleDeriv(int curr) - { - float dsA, dsB, ddA, ddB; - float A, B, cont1, cont2; - int last = this->num_keys() - 1; - - dsA = 0; - ddA = 0; - - // dsAdjust,ddAdjust apply speed correction when continuity is 0. - // Middle key. - if (curr == 0) - { - // First key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(1) - this->time(0)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - dsA = dt * dts; - ddA = dt * (this->time(1) - this->time(0)); - } - } - else - { - if (curr == last) - { - // Last key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(last) - this->time(last - 1)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - dsA = dt * dts; - ddA = dt * (this->time(last) - this->time(last - 1)); - } - } - else - { - // Middle key. - float fDiv = this->time(curr + 1) - this->time(curr - 1); - if (fDiv != 0.f) - { - float dt = 2.0f / fDiv; - dsA = dt * (this->time(curr) - this->time(curr - 1)); - ddA = dt * (this->time(curr + 1) - this->time(curr)); - } - } - } - typename TSpline::key_type& k = this->key(curr); - T ds0 = k.ds; - T dd0 = k.dd; - - float c = (float)fabs(k.cont); - float sa = dsA + c * (1.0f - dsA); - float da = ddA + c * (1.0f - ddA); - - A = 0.5f * (1.0f - k.tens) * (1.0f + k.bias); - B = 0.5f * (1.0f - k.tens) * (1.0f - k.bias); - cont1 = (1.0f - k.cont); - cont2 = (1.0f + k.cont); - //dsA = dsA * A * cont1; - //dsB = dsA * B * cont2; - //ddA = ddA * A * cont2; - //ddB = ddA * B * cont1; - dsA = sa * A * cont1; - dsB = sa * B * cont2; - ddA = da * A * cont2; - ddB = da * B * cont1; - - T qp, qn; - if (curr > 0) - { - qp = this->value(curr - 1); - } - else - { - qp = this->value(last); - } - if (curr < last) - { - qn = this->value(curr + 1); - } - else - { - qn = this->value(0); - } - k.ds = Concatenate(dsA * Subtract(k.value, qp), dsB * Subtract(qn, k.value)); - k.dd = Concatenate(ddA * Subtract(k.value, qp), ddB * Subtract(qn, k.value)); - - switch (this->GetInTangentType(curr)) - { - case SPLINE_KEY_TANGENT_STEP: - case SPLINE_KEY_TANGENT_ZERO: - Zero(k.ds); - break; - case SPLINE_KEY_TANGENT_LINEAR: - k.ds = Subtract(k.value, qp); - break; - case SPLINE_KEY_TANGENT_CUSTOM: - k.ds = ds0; - break; - } - switch (this->GetOutTangentType(curr)) - { - case SPLINE_KEY_TANGENT_STEP: - case SPLINE_KEY_TANGENT_ZERO: - Zero(k.dd); - break; - case SPLINE_KEY_TANGENT_LINEAR: - k.dd = Subtract(qn, k.value); - break; - case SPLINE_KEY_TANGENT_CUSTOM: - k.dd = dd0; - break; - } - } - - template - inline void TCBSpline::compFirstDeriv() - { - typename TSpline::key_type& k = this->key(0); - - if (this->GetInTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k.ds); - } - - if (this->GetOutTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - k.dd = 0.5f * - (1.0f - k.tens) * (3.0f * - Subtract(Subtract(this->value(1), k.value), this->ds(1))); - } - } - - template - inline void TCBSpline::compLastDeriv() - { - int last = this->num_keys() - 1; - typename TSpline::key_type& k = this->key(last); - - if (this->GetInTangentType(last) != SPLINE_KEY_TANGENT_CUSTOM) - { - k.ds = -0.5f * (1.0f - - k.tens) * (3.0f * - Concatenate(Subtract(this->value(last - 1), k.value), this->dd(last - 1))); - } - - if (this->GetOutTangentType(last) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k.dd); - } - } - - template - inline void TCBSpline::comp2KeyDeriv() - { - typename TSpline::key_type& k1 = this->key(0); - typename TSpline::key_type& k2 = this->key(1); - - typename TSpline::value_type val = Subtract(this->value(1), this->value(0)); - - if (this->GetInTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k1.ds); - } - if (this->GetOutTangentType(0) != SPLINE_KEY_TANGENT_CUSTOM) - { - k1.dd = (1.0f - k1.tens) * val; - } - if (this->GetInTangentType(1) != SPLINE_KEY_TANGENT_CUSTOM) - { - k2.ds = (1.0f - k2.tens) * val; - } - if (this->GetOutTangentType(1) != SPLINE_KEY_TANGENT_CUSTOM) - { - Zero(k2.dd); - } - } - - template - inline void TCBSpline::comp_deriv() - { - if (this->num_keys() > 1) - { - if ((this->num_keys() == 2) && !this->closed()) - { - comp2KeyDeriv(); - return; - } - if (this->closed()) - { - for (int i = 0; i < this->num_keys(); ++i) - { - compMiddleDeriv(i); - } - } - else - { - for (int i = 1; i < (this->num_keys() - 1); ++i) - { - compMiddleDeriv(i); - } - compFirstDeriv(); - compLastDeriv(); - } - } - this->SetModified(false); - } - - template - inline float TCBSpline::calc_ease(float t, float a, float b) - { - float k; - float s = a + b; - - if (t == 0.0f || t == 1.0f) - { - return t; - } - if (s == 0.0f) - { - return t; - } - if (s > 1.0f) - { - k = 1.0f / s; - a *= k; - b *= k; - } - k = 1.0f / (2.0f - a - b); - if (t < a) - { - return ((k / a) * t * t); - } - else - { - if (t < 1.0f - b) - { - return (k * (2.0f * t - a)); - } - else - { - t = 1.0f - t; - return (1.0f - (k / b) * t * t); - } - } - } - - template - inline void TCBSpline::interp_keys(int from, int to, float u, T& val) - { - if (this->GetOutTangentType(from) == SPLINE_KEY_TANGENT_STEP) - { - val = this->value(to); - } - else if (this->GetInTangentType(to) == SPLINE_KEY_TANGENT_STEP) - { - val = this->value(from); - } - else - { - u = calc_ease(u, this->key(from).easefrom, this->key(to).easeto); - typename TSpline::basis_type basis(u); - val = Concatenate( - Concatenate( - Concatenate( - (basis[0] * this->value(from)), (basis[1] * this->value(to)) - ), - (basis[2] * this->dd(from)) - ), - (basis[3] * this->ds(to)) - ); - } - } - - - - /**************************************************************************** - ** TCBQuatSpline class implementation ** - ****************************************************************************/ - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - class TCBQuatSpline - : public TCBSpline - { - public: - //void interpolate( float time,value_type& val ); - void comp_deriv(); - - protected: - void interp_keys(int key1, int key2, float u, value_type& val); - - private: - void compKeyDeriv(int curr); - - // Loacal function to add quaternions. - Quat AddQuat(const Quat& q1, const Quat& q2) - { - return Quat(q1.w + q2.w, q1.v.x + q2.v.x, q1.v.y + q2.v.y, q1.v.z + q2.v.z); - } - }; - - inline void TCBQuatSpline::interp_keys(int from, int to, float u, value_type& val) - { - u = calc_ease(u, key(from).easefrom, key(to).easeto); - basis_type basis(u); - //val = SquadRev( angle(to),axis(to), value(from), dd(from), ds(to), value(to), u ); - val = Quat::CreateSquad(value(from), dd(from), ds(to), value(to), u); - val = (val).GetNormalized(); // Normalize quaternion. - } - - - inline void TCBQuatSpline::comp_deriv() - { - if (num_keys() > 1) - { - for (int i = 0; i < num_keys(); ++i) - { - compKeyDeriv(i); - } - } - this->SetModified(false); - } - - - - inline void TCBQuatSpline::compKeyDeriv(int curr) - { - Quat qp, qm; - float fp, fn; - int last = num_keys() - 1; - - if (curr > 0 || closed()) - { - int prev = (curr != 0) ? curr - 1 : last; - qm = value(prev); - if ((qm | (value(curr))) < 0.0f) - { - qm = -qm; - } - qm = Quat::LnDif(qm.GetNormalizedSafe(), value(curr).GetNormalizedSafe()); - } - - if (curr < last || closed()) - { - int next = (curr != last) ? curr + 1 : 0; - Quat qnext = value(next); - if ((qnext | (value(curr))) < 0.0f) - { - qnext = -qnext; - } - qp = value(curr); - qp = Quat::LnDif(qp.GetNormalizedSafe(), qnext.GetNormalizedSafe()); - } - - if (curr == 0 && !closed()) - { - qm = qp; - } - if (curr == last && !closed()) - { - qp = qm; - } - - key_type& k = key(curr); - float c = (float)fabs(k.cont); - - fp = fn = 1.0f; - if ((curr > 0 && curr < last) || closed()) - { - if (curr == 0) - { - // First key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(1) - this->time(0)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - fp = dt * dts; - fn = dt * (this->time(1) - this->time(0)); - } - } - else - { - if (curr == last) - { - // Last key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float fDiv = (dts + this->time(last) - this->time(last - 1)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - fp = dt * dts; - fn = dt * (this->time(last) - this->time(last - 1)); - } - } - else - { - // Middle key. - float fDiv = (this->time(curr + 1) - this->time(curr - 1)); - if (fDiv != 0.0f) - { - float dt = 2.0f / fDiv; - fp = dt * (this->time(curr) - this->time(curr - 1)); - fn = dt * (this->time(curr + 1) - this->time(curr)); - } - } - } - fp += c - c * fp; - fn += c - c * fn; - } - - float tm, cm, cp, bm, bp, tmcm, tmcp, ksm, ksp, kdm, kdp; - - cm = 1.0f - k.cont; - tm = 0.5f * (1.0f - k.tens); - cp = 2.0f - cm; - bm = 1.0f - k.bias; - bp = 2.0f - bm; - tmcm = tm * cm; - tmcp = tm * cp; - ksm = 1.0f - tmcm * bp * fp; - ksp = -tmcp * bm * fp; - kdm = tmcp * bp * fn; - kdp = tmcm * bm * fn - 1.0f; - - Quat qa = 0.5f * AddQuat(kdm * qm, kdp * qp); - Quat qb = 0.5f * AddQuat(ksm * qm, ksp * qp); - qa = Quat::exp(qa.v); - qb = Quat::exp(qb.v); - - // ds = qb, dd = qa. - k.ds = value(curr) * qb; - k.dd = value(curr) * qa; - } - - /**************************************************************************** - ** TCBAngleAxisSpline class implementation ** - ****************************************************************************/ - /////////////////////////////////////////////////////////////////////////////// - // - // TCBAngleAxisSpline takes as input relative Angle-Axis values. - // Interpolated result is returned as Normalized quaternion. - // - ////////////////////////////////////////////////////////////////////////// - struct SAngleAxis - { - float angle; - Vec3 axis; - }; - - - class TCBAngleAxisSpline - : public TCBSpline - { - public: - //void interpolate( float time,value_type& val ); - void comp_deriv(); - - // Angle axis used for quaternion. - float& angle(int i) { return key(i).angle; }; - Vec3& axis(int i) { return key(i).axis; }; - - protected: - void interp_keys(int key1, int key2, float u, value_type& val); - - private: - virtual void compKeyDeriv(int curr); - - // Loacal function to add quaternions. - Quat AddQuat(const Quat& q1, const Quat& q2) - { - return Quat(q1.w + q2.w, q1.v.x + q2.v.x, q1.v.y + q2.v.y, q1.v.z + q2.v.z); - } - }; - - ////////////////////////////////////////////////////////////////////////// - inline void TCBAngleAxisSpline::interp_keys(int from, int to, float u, value_type& val) - { - u = calc_ease(u, key(from).easefrom, key(to).easeto); - basis_type basis(u); - val = CreateSquadRev(angle(to), axis(to), value(from), dd(from), ds(to), value(to), u); - val = (val).GetNormalized(); // Normalize quaternion. - } - - ////////////////////////////////////////////////////////////////////////// - inline void TCBAngleAxisSpline::comp_deriv() - { - // Convert from relative angle-axis to absolute quaternion. - Quat q, lastq; - lastq.SetIdentity(); - for (int i = 0; i < num_keys(); ++i) - { - q.SetRotationAA(angle(i), axis(i)); - q.Normalize(); // Normalize quaternion - q = lastq * q; - lastq = q; - value(i) = q; - } - - if (num_keys() > 1) - { - for (int i = 0; i < num_keys(); ++i) - { - compKeyDeriv(i); - } - } - this->SetModified(false); - } - - ////////////////////////////////////////////////////////////////////////// - inline void TCBAngleAxisSpline::compKeyDeriv(int curr) - { - Quat qp, qm; - float fp, fn; - int last = num_keys() - 1; - - if (curr > 0 || closed()) - { - int prev = (curr != 0) ? curr - 1 : last; - if (angle(curr) > gf_PI2) - { - Vec3 a = axis(curr); - qm = Quat(0, Quat::log(Quat(0, a.x, a.y, a.z))); - } - else - { - qm = value(prev); - if ((qm | (value(curr))) < 0.0f) - { - qm = -qm; - } - qm = Quat::LnDif(qm, value(curr)); - } - } - - if (curr < last || closed()) - { - int next = (curr != last) ? curr + 1 : 0; - if (angle(next) > gf_PI2) - { - Vec3 a = axis(next); - qp = Quat(0, Quat::log(Quat(0, a.x, a.y, a.z))); - } - else - { - Quat qnext = value(next); - if ((qnext | (value(curr))) < 0.0f) - { - qnext = -qnext; - } - qp = value(curr); - qp = Quat::LnDif(qp, qnext); - } - } - - if (curr == 0 && !closed()) - { - qm = qp; - } - if (curr == last && !closed()) - { - qp = qm; - } - - key_type& k = key(curr); - float c = (float)fabs(k.cont); - - fp = fn = 1.0f; - if ((curr > 0 && curr < last) || closed()) - { - if (curr == 0) - { - // First key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float dt = 2.0f / (dts + this->time(1) - this->time(0)); - fp = dt * dts; - fn = dt * (this->time(1) - this->time(0)); - } - else - { - if (curr == last) - { - // Last key. - float dts = (this->GetRangeEnd() - this->time(last)) + (this->time(0) - this->GetRangeStart()); - float dt = 2.0f / (dts + this->time(last) - this->time(last - 1)); - fp = dt * dts; - fn = dt * (this->time(last) - this->time(last - 1)); - } - else - { - // Middle key. - float dt = 2.0f / (this->time(curr + 1) - this->time(curr - 1)); - fp = dt * (this->time(curr) - this->time(curr - 1)); - fn = dt * (this->time(curr + 1) - this->time(curr)); - } - } - fp += c - c * fp; - fn += c - c * fn; - } - - float tm, cm, cp, bm, bp, tmcm, tmcp, ksm, ksp, kdm, kdp; - - cm = 1.0f - k.cont; - tm = 0.5f * (1.0f - k.tens); - cp = 2.0f - cm; - bm = 1.0f - k.bias; - bp = 2.0f - bm; - tmcm = tm * cm; - tmcp = tm * cp; - ksm = 1.0f - tmcm * bp * fp; - ksp = -tmcp * bm * fp; - kdm = tmcp * bp * fn; - kdp = tmcm * bm * fn - 1.0f; - - const Vec3 va = 0.5f * (kdm * qm.v + kdp * qp.v); - const Vec3 vb = 0.5f * (ksm * qm.v + ksp * qp.v); - - const Quat qa = Quat::exp(va); - const Quat qb = Quat::exp(vb); - - // ds = qb, dd = qa. - k.ds = value(curr) * qb; - k.dd = value(curr) * qa; - } - - - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - template - class TrackSplineInterpolator - : public spline::CBaseSplineInterpolator< T, spline::TCBSpline > > - { - typedef typename spline::CBaseSplineInterpolator< T, spline::TCBSpline > > I; - public: - virtual void SerializeSpline(XmlNodeRef& node, bool bLoading) {}; - virtual void SetKeyFlags(int k, int flags) - { - if (k >= 0 && k < this->num_keys()) - { - if ((this->key(k).flags & SPLINE_KEY_TANGENT_ALL_MASK) != SPLINE_KEY_TANGENT_UNIFIED - && (flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED) - { - this->key(k).ComputeThetaAndScale(); - } - } - spline::CBaseSplineInterpolator< T, spline::TCBSpline > >::SetKeyFlags(k, flags); - } - virtual void SetKeyInTangent(int k, ISplineInterpolator::ValueType tin) - { - if (k >= 0 && k < this->num_keys()) - { - I::FromValueType(tin, this->key(k).ds); - if ((this->key(k).flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED) - { - this->key(k).SetOutTangentFromIn(); - } - this->SetModified(true); - } - } - virtual void SetKeyOutTangent(int k, ISplineInterpolator::ValueType tout) - { - if (k >= 0 && k < this->num_keys()) - { - I::FromValueType(tout, this->key(k).dd); - if ((this->key(k).flags & SPLINE_KEY_TANGENT_ALL_MASK) == SPLINE_KEY_TANGENT_UNIFIED) - { - this->key(k).SetInTangentFromOut(); - } - this->SetModified(true); - } - } - }; - - template <> - class TrackSplineInterpolator - : public spline::CBaseSplineInterpolator< Quat, spline::TCBQuatSpline > - { - public: - virtual void SerializeSpline([[maybe_unused]] XmlNodeRef& node, [[maybe_unused]] bool bLoading) {}; - }; -}; // namespace spline - -#endif // CRYINCLUDE_CRYMOVIE_TCBSPLINE_H diff --git a/Gems/Maestro/Code/maestro_static_files.cmake b/Gems/Maestro/Code/maestro_static_files.cmake index 688ae1d074..809f4b3b22 100644 --- a/Gems/Maestro/Code/maestro_static_files.cmake +++ b/Gems/Maestro/Code/maestro_static_files.cmake @@ -21,7 +21,6 @@ set(FILES Source/Cinematics/AnimSequence.h Source/Cinematics/CharacterTrackAnimator.h Source/Cinematics/Movie.h - Source/Cinematics/TCBSpline.h Source/Cinematics/AssetBlendTrack.cpp Source/Cinematics/BoolTrack.cpp Source/Cinematics/CaptureTrack.cpp From 2a924dd7ceeeb8abd0d6ee5085c247861c6257a6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:25:10 -0800 Subject: [PATCH 198/394] Removes WAVUtil.h from Gems/Micropohone Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Microphone/Code/CMakeLists.txt | 2 - .../Code/Include/Microphone/WAVUtil.h | 108 ------------------ Gems/Microphone/Code/microphone_files.cmake | 1 - 3 files changed, 111 deletions(-) delete mode 100644 Gems/Microphone/Code/Include/Microphone/WAVUtil.h diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index 873d05e98d..bde4f59e4e 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -17,8 +17,6 @@ ly_add_target( PLATFORM_INCLUDE_FILES ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake INCLUDE_DIRECTORIES - PRIVATE - Include PUBLIC Source BUILD_DEPENDENCIES diff --git a/Gems/Microphone/Code/Include/Microphone/WAVUtil.h b/Gems/Microphone/Code/Include/Microphone/WAVUtil.h deleted file mode 100644 index 9fdcc95a97..0000000000 --- a/Gems/Microphone/Code/Include/Microphone/WAVUtil.h +++ /dev/null @@ -1,108 +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 - -namespace Audio -{ - struct WAVHeader - { - AZ::u8 riffTag[4]; - AZ::u32 fileSize; - AZ::u8 waveTag[4]; - AZ::u8 fmtTag[4]; - AZ::u32 fmtSize; - AZ::u16 audioFormat; - AZ::u16 channels; - AZ::u32 sampleRate; - AZ::u32 byteRate; - AZ::u16 blockAlign; - AZ::u16 bitsPerSample; - AZ::u8 dataTag[4]; - AZ::u32 dataSize; - - // defaults to 16 KHz 16 bit mono PCM format - inline WAVHeader() - : fileSize { 0 } - , fmtSize { 16 } - , audioFormat { 1 } - , channels { 1 } - , sampleRate { 16000 } - , bitsPerSample { 16 } - , byteRate { 16000 * 2 } // 16 bit is 2 bytes per sample - , blockAlign { 2 } - , dataSize { 0 } - { - memcpy(riffTag, "RIFF", 4); - memcpy(waveTag, "WAVE", 4); - memcpy(fmtTag, "fmt ", 4); - memcpy(dataTag, "data", 4); - } - }; - - - class WAVUtil - { - public: - WAVHeader m_wavHeader; - - inline WAVUtil(AZ::u32 sampleRate, AZ::u16 bitsPerSample, AZ::u16 channels, bool isFloat) - { - m_wavHeader.sampleRate = sampleRate; - m_wavHeader.bitsPerSample = bitsPerSample; - m_wavHeader.channels = channels; - m_wavHeader.byteRate = static_cast(sampleRate * channels * (bitsPerSample / 8)); - m_wavHeader.audioFormat = isFloat ? 3 : 1; // 1 = PCM 3 = IEEE Float - } - - // Set the wav buffer to use for class operations. This buffer should have reserved - // space at the beginning of the buffer in the amount of sizeof(WAVHeader) which - // this function will write over. The remaining data should be sound data that - // matches your format - inline bool SetBuffer(AZ::u8* buffer, AZStd::size_t bufferSize) - { - if(buffer == nullptr || bufferSize <= sizeof(WAVHeader)) - { - return false; - } - m_buffer = buffer; - m_bufferSize = bufferSize; - m_wavHeader.fileSize = bufferSize - 8; // the 'RIFF' tag and filesize aren't counted in this. - m_wavHeader.dataSize = bufferSize - sizeof(WAVHeader); - AZ::u8* headerBuff = reinterpret_cast(&m_wavHeader); - ::memcpy(m_buffer, headerBuff, sizeof(WAVHeader)); - return true; - } - - inline bool WriteWAVToFile(const AZStd::string& filePath) - { - if(m_buffer == nullptr || m_bufferSize == 0) - { - AZ_TracePrintf("WAVUtil", "WAV buffer invalid, unable to write file. Buffer Ptr: %d, Buffer Size: %d\n", m_buffer, m_bufferSize); - return false; - } - AZ::IO::FileIOStream fileStream(filePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeBinary); - if (fileStream.IsOpen()) - { - [[maybe_unused]] auto bytesWritten = fileStream.Write(m_bufferSize, m_buffer); - AZ_TracePrintf("WAVUtil", "Wrote WAV file: %s, %d bytes\n", filePath.c_str(), bytesWritten); - return true; - } - else - { - AZ_TracePrintf("WAVUtil", "Unable to write WAV file, can't open stream for file %s\n", filePath.c_str()); - return false; - } - } - - private: - AZ::u8* m_buffer = nullptr; - AZStd::size_t m_bufferSize = 0; - - }; -} diff --git a/Gems/Microphone/Code/microphone_files.cmake b/Gems/Microphone/Code/microphone_files.cmake index 7ae423e995..4a8acf232d 100644 --- a/Gems/Microphone/Code/microphone_files.cmake +++ b/Gems/Microphone/Code/microphone_files.cmake @@ -11,5 +11,4 @@ set(FILES Source/MicrophoneSystemComponent.h Source/SimpleDownsample.cpp Source/SimpleDownsample.h - Include/Microphone/WAVUtil.h ) From 919c671bfd33734f57021a5ae5a85196f24bdfae Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:27:04 -0800 Subject: [PATCH 199/394] Removes WAVUtil.h from another file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Platform/Android/MicrophoneSystemComponent_Android.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp b/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp index 1e696f7978..eb9656e2a0 100644 --- a/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp +++ b/Gems/Microphone/Code/Source/Platform/Android/MicrophoneSystemComponent_Android.cpp @@ -25,8 +25,6 @@ #include #include -#include - namespace Audio { class MicrophoneSystemEventsAndroid : public AZ::EBusTraits From be2e2ed4d121303993ae09cd776e0c88deda7cfb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:46:40 -0800 Subject: [PATCH 200/394] Removes PhysicsUtils.h and PhysicsUtils.cpp from Gems/Multiplayer Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Multiplayer/Physics/PhysicsUtils.h | 33 ------ .../Code/Source/Physics/PhysicsUtils.cpp | 100 ------------------ Gems/Multiplayer/Code/multiplayer_files.cmake | 1 - 3 files changed, 134 deletions(-) delete mode 100644 Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h delete mode 100644 Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h b/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h deleted file mode 100644 index a93dcc7a65..0000000000 --- a/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h +++ /dev/null @@ -1,33 +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 - -namespace Multiplayer -{ - namespace Physics - { - //! Performs rewind-aware ray cast in the default physics world. - //! @param request The ray cast request to make. - //! @return Returns a structure that contains a list of Hits. - AzPhysics::SceneQueryHits RayCast(const AzPhysics::RayCastRequest& request); - - //! Performs rewind-aware shape cast in the default physics world. - //! @param request The shape cast request to make. - //! @return Returns a structure that contains a list of Hits. - AzPhysics::SceneQueryHits ShapeCast(const AzPhysics::ShapeCastRequest& request); - - //! Performs rewind-aware overlap in the default physics world. - //! @param request The overlap request to make. - //! @return Returns a structure that contains a list of Hits. - AzPhysics::SceneQueryHits Overlap(const AzPhysics::OverlapRequest& request); - - } // namespace Physics -} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp b/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp deleted file mode 100644 index c6f5a56422..0000000000 --- a/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp +++ /dev/null @@ -1,100 +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 -#include - -namespace -{ - template - AzPhysics::SceneQueryHits SceneQueryInternal(const RequestT& request) - { - auto* sceneInterface = AZ::Interface::Get(); - if (!sceneInterface) - { - return {}; - } - - AzPhysics::SceneHandle sceneHandle = sceneInterface->GetSceneHandle(AzPhysics::DefaultPhysicsSceneName); - if (sceneHandle == AzPhysics::InvalidSceneHandle) - { - return {}; - } - - Multiplayer::INetworkTime* currentNetTime = Multiplayer::GetNetworkTime(); - - if(!currentNetTime->IsTimeRewound()) - { - // If the time is not rewound, we simply execute the scene query as is. - AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(sceneHandle, &request); - return result; - } - - // If the time is rewound, we want to query against rigid bodies present at the same frame ID: the same as the current rewound time is. - RequestT netSceneQueryRequest = request; - netSceneQueryRequest.m_filterCallback = [&request, currentFrameId = (uint32_t)currentNetTime->GetHostFrameId()]( - const AzPhysics::SimulatedBody* body, const ::Physics::Shape* shape) - { - if (body->GetFrameId() == AzPhysics::SimulatedBody::UndefinedFrameId || body->GetFrameId() == currentFrameId) - { - if (request.m_filterCallback) - { - return request.m_filterCallback(body, shape); - } - - // Overlap filter callbacks return true/false rather than Touch/Block/None - if constexpr (AZStd::is_same_v) - { - return true; - } - else - { - return AzPhysics::SceneQuery::QueryHitType::Touch; - } - } - - if constexpr (AZStd::is_same_v) - { - return false; - } - else - { - return AzPhysics::SceneQuery::QueryHitType::None; - } - }; - - // Execute the scene query modified for the time rewind. - AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(sceneHandle, &netSceneQueryRequest); - return result; - } -} - -namespace Multiplayer -{ - namespace Physics - { - AzPhysics::SceneQueryHits RayCast(const AzPhysics::RayCastRequest& request) - { - return SceneQueryInternal(request); - } - - AzPhysics::SceneQueryHits ShapeCast(const AzPhysics::ShapeCastRequest& request) - { - return SceneQueryInternal(request); - } - - AzPhysics::SceneQueryHits Overlap(const AzPhysics::OverlapRequest& request) - { - return SceneQueryInternal(request); - } - } // namespace Physics -} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/multiplayer_files.cmake b/Gems/Multiplayer/Code/multiplayer_files.cmake index 7c5f3a946b..9c83af49a3 100644 --- a/Gems/Multiplayer/Code/multiplayer_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_files.cmake @@ -57,7 +57,6 @@ set(FILES Include/Multiplayer/NetworkTime/RewindableFixedVector.inl Include/Multiplayer/NetworkTime/RewindableObject.h Include/Multiplayer/NetworkTime/RewindableObject.inl - Include/Multiplayer/Physics/PhysicsUtils.h Include/Multiplayer/ReplicationWindows/IReplicationWindow.h Include/Multiplayer/AutoGen/AutoComponentTypes_Header.jinja Include/Multiplayer/AutoGen/AutoComponentTypes_Source.jinja From 617b9d1136386d6ef5728ddfd85ff29e302b1fe8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:49:08 -0800 Subject: [PATCH 201/394] Removes BuilderSystemComponent.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Builder/BuilderSystemComponent.h | 51 ------------------- ...scriptcanvasgem_editor_builder_files.cmake | 1 - 2 files changed, 52 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h diff --git a/Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h b/Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h deleted file mode 100644 index 3ad5ee4fb0..0000000000 --- a/Gems/ScriptCanvas/Code/Builder/BuilderSystemComponent.h +++ /dev/null @@ -1,51 +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 -{ - namespace Data - { - class AssetHandler; - } -} - -namespace ScriptCanvasBuilder -{ - class BuilderSystemComponent - : public AZ::Component - { - public: - AZ_COMPONENT(BuilderSystemComponent, "{2FB1C848-B863-4562-9C4B-01E18BD61583}"); - - BuilderSystemComponent(); - ~BuilderSystemComponent() override; - - static void Reflect(AZ::ReflectContext* context); - - static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); - - //////////////////////////////////////////////////////////////////////// - // AZ::Component... - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - private: - BuilderSystemComponent(const BuilderSystemComponent&) = delete; - - AZStd::unique_ptr m_scriptCanvasAssetHandler; - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake index 6a3af2afc3..c1c0108b75 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_builder_files.cmake @@ -7,7 +7,6 @@ # set(FILES - Builder/BuilderSystemComponent.h Builder/ScriptCanvasBuilder.cpp Builder/ScriptCanvasBuilder.h Builder/ScriptCanvasBuilderComponent.cpp From 44f0646906bde3efd28b36651115bb274766fd67 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:57:54 -0800 Subject: [PATCH 202/394] Removes empty Debugger files from Gems/ScriptCanvas/Code/Editor Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Code/Editor/Debugger/Debugger.cpp | 9 --------- Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h | 14 -------------- .../Code/Editor/ScriptCanvasEditorGem.cpp | 2 -- 3 files changed, 25 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h diff --git a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp b/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp deleted file mode 100644 index 8ed679c751..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.cpp +++ /dev/null @@ -1,9 +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 - * - */ - - diff --git a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h b/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h deleted file mode 100644 index 5820d1b01e..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Debugger/Debugger.h +++ /dev/null @@ -1,14 +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 - -namespace DragonUI -{ - -} diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index 1a3bb0e4f9..68b9d21939 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -26,8 +26,6 @@ #include #include -#include - #include #include From 364eb039bbd7aa5dc2bbba036f978ac61c022cbc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:54:15 -0800 Subject: [PATCH 203/394] Removes ScriptCanvasEnumDataInterface.h and ScriptCanvasReadOnlyDataInterface.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Components/EditorGraph.cpp | 2 - .../ScriptCanvasEnumDataInterface.h | 98 ------------------- .../ScriptCanvasReadOnlyDataInterface.h | 44 --------- .../Code/scriptcanvasgem_editor_files.cmake | 2 - 4 files changed, 146 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 469482e604..f59f05b462 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -49,11 +49,9 @@ AZ_POP_DISABLE_WARNING #include #include #include -#include #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h deleted file mode 100644 index be548556d2..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h +++ /dev/null @@ -1,98 +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 - -#include - -#include "ScriptCanvasDataInterface.h" - -namespace ScriptCanvasEditor -{ - // Used for fixed values value input. - class ScriptCanvasEnumDataInterface - : public ScriptCanvasDataInterface - { - public: - AZ_CLASS_ALLOCATOR(ScriptCanvasEnumDataInterface, AZ::SystemAllocator, 0); - - ScriptCanvasEnumDataInterface(const AZ::EntityId& nodeId, const ScriptCanvas::SlotId& slotId) - : ScriptCanvasDataInterface(nodeId, slotId) - { - } - - ~ScriptCanvasEnumDataInterface() = default; - - void AddElement(int32_t element, const AZStd::string& displayName) - { - QString qtName = displayName.c_str(); - m_comboBoxModel.AddElement(element, qtName); - } - - // GraphCanvas::ComboBoxDataInterface - GraphCanvas::ComboBoxItemModelInterface* GetItemInterface() override - { - return &m_comboBoxModel; - } - - void AssignIndex(const QModelIndex& index) override - { - ScriptCanvas::ModifiableDatumView datumView; - ModifySlotObject(datumView); - - if (datumView.IsValid()) - { - int32_t value = m_comboBoxModel.GetValueForIndex(index); - - datumView.SetAs(value); - - PostUndoPoint(); - PropertyGridRequestBus::Broadcast(&PropertyGridRequests::RefreshPropertyGrid); - } - } - - QModelIndex GetAssignedIndex() const override - { - const ScriptCanvas::Datum* object = GetSlotObject(); - - if (object) - { - const int* element = object->GetAs(); - - if (element) - { - return m_comboBoxModel.GetIndexForValue(*element); - } - } - - return m_comboBoxModel.GetDefaultIndex(); - } - - QString GetDisplayString() const override - { - const ScriptCanvas::Datum* object = GetSlotObject(); - - if (object) - { - const int* element = object->GetAs(); - - if (element) - { - return m_comboBoxModel.GetNameForValue((*element)); - } - } - return GraphCanvas::ComboBoxDataInterface::GetDisplayString(); - } - //// - - private: - GraphCanvas::GraphCanvasListComboBoxModel m_comboBoxModel; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h deleted file mode 100644 index 41ac73d0aa..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h +++ /dev/null @@ -1,44 +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 "ScriptCanvasDataInterface.h" - -namespace ScriptCanvasEditor -{ - class ScriptCanvasReadOnlyDataInterface - : public ScriptCanvasDataInterface - { - public: - AZ_CLASS_ALLOCATOR(ScriptCanvasReadOnlyDataInterface, AZ::SystemAllocator, 0); - ScriptCanvasReadOnlyDataInterface(const AZ::EntityId& nodeId, const ScriptCanvas::SlotId& slotId) - : ScriptCanvasDataInterface(nodeId, slotId) - { - } - - ~ScriptCanvasReadOnlyDataInterface() = default; - - // ReadOnlyDataInterface - AZStd::string GetString() const override - { - AZStd::string retVal; - - const ScriptCanvas::Datum* object = GetSlotObject(); - - if (object) - { - object->ToString(retVal); - } - - return retVal; - } - //// - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index b2f98226b4..d920c69f45 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -94,12 +94,10 @@ set(FILES Editor/GraphCanvas/DataInterfaces/ScriptCanvasAssetIdDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasBoolDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasEntityIdDataInterface.h - Editor/GraphCanvas/DataInterfaces/ScriptCanvasEnumDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasColorDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasCRCDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasNumericDataInterface.h - Editor/GraphCanvas/DataInterfaces/ScriptCanvasReadOnlyDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasStringDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasVectorDataInterface.h Editor/GraphCanvas/DataInterfaces/ScriptCanvasVariableDataInterface.h From 7e4f708da444e53c8205ceb01f560f5f2c747fd7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:59:30 -0800 Subject: [PATCH 204/394] Removes unused buses from from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Bus/DocumentContextBus.h | 108 ------------------ .../Bus/ScriptCanvasAssetNodeBus.h | 44 ------- 2 files changed, 152 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h deleted file mode 100644 index 7c5acbe209..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/DocumentContextBus.h +++ /dev/null @@ -1,108 +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 -#include -#include - -#include - -namespace AZ -{ - namespace Data - { - class AssetInfo; - } -} - -namespace ScriptCanvasEditor -{ - enum class ScriptCanvasFileState : AZ::s32 - { - NEW, - MODIFIED, - UNMODIFIED, - INVALID = -1 - }; - - struct ScriptCanvasAssetFileInfo - { - AZ_TYPE_INFO(ScriptCanvasAssetFileInfo, "{81F6B390-7CF3-4A97-B5A6-EC09330F184E}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetFileInfo, AZ::SystemAllocator, 0); - ScriptCanvasFileState m_fileModificationState = ScriptCanvasFileState::INVALID; - bool m_reloadable = false; - AZStd::string m_absolutePath; - }; - - //! Bus for handling transactions involving ScriptCanvas Assets, such as graph Saving, graph modification state, etc - class DocumentContextRequests - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - //! Creates a new ScriptCanvas asset and registers it with the document context - virtual AZ::Data::Asset CreateScriptCanvasAsset(AZStd::string_view relativeAssetPath) = 0; - - using SaveCB = AZStd::function; - // !Callback will fire when a new in-memory Script Canvas asset is saved to disk for the first time and a new AssetId is generated for it - using SourceFileChangedCB = AZStd::function; - //! Saves a ScriptCanvas asset using the supplied AssetPath structure - //! \param assetAbsolutePath path where ScriptCanvas asset will be saved on disk - virtual void SaveScriptCanvasAsset(AZStd::string_view/*assetAbsolutePath*/, AZ::Data::Asset, const SaveCB&, const SourceFileChangedCB&) = 0; - - //! Loads a ScriptCanvas asset by looking up the assetPath in the AssetCatalog - //! \param assetPath filepath to asset that will be looked up in the AssetCatalog for the AssetId - //! \param loadBlocking should the loading of the ScriptCanvas asset be blocking - virtual AZ::Data::Asset LoadScriptCanvasAsset(const char* assetPath, bool loadBlocking) = 0; - virtual AZ::Data::Asset LoadScriptCanvasAssetById(const AZ::Data::AssetId& assetId, bool loadBlocking) = 0; - - //! Registers a ScriptCanvas assetId with the DocumentContext for lookup. ScriptCanvasAssetFileInfo will be associated with the ScriptCanvasAsset - //! \return true if the assetId is newly registered, false if the assetId is already registered - virtual bool RegisterScriptCanvasAsset(const AZ::Data::AssetId& assetId, const ScriptCanvasAssetFileInfo& assetFileInfo) = 0; - - //! Unregisters a ScriptCanvas assetId with the DocumentContext for lookup - //! \return true if assetId was registered with the DocumentContext, false otherwise - virtual bool UnregisterScriptCanvasAsset(const AZ::Data::AssetId& assetId) = 0; - - virtual ScriptCanvasFileState GetScriptCanvasAssetModificationState(const AZ::Data::AssetId& assetId) = 0; - virtual void SetScriptCanvasAssetModificationState(const AZ::Data::AssetId& assetId, ScriptCanvasFileState) = 0; - - //! Retrieves the file information for the registered ScriptCanvas asset - virtual AZ::Outcome GetFileInfo(const AZ::Data::AssetId& assetId) const = 0; - virtual AZ::Outcome SetFileInfo(const AZ::Data::AssetId& assetId, const ScriptCanvasAssetFileInfo& fileInfo) = 0; - }; - - using DocumentContextRequestBus = AZ::EBus; - - class DocumentContextNotifications - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - virtual void OnAssetModificationStateChanged(ScriptCanvasFileState) {} - - //! Notification which fires after an ScriptCanvasDocumentContext has received it's on AssetReady callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReady(const AZ::Data::Asset& /*scriptCanvasAsset*/) {} - - //! Notification which fires after an ScriptCanvasDocumentContext has received it's on AssetReloaded callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReloaded(const AZ::Data::Asset& /*scriptCanvaAsset */) {} - - //! Notification which fires after an ScriptCanvasDocumentContext has received it's on AssetReady callback - //! \param AssetId AssetId of unloaded ScriptCanvas - virtual void OnScriptCanvasAssetUnloaded(const AZ::Data::AssetId& /*assetId*/) {} - }; - - using DocumentContextNotificationBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h deleted file mode 100644 index 1b0d5e5a04..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasAssetNodeBus.h +++ /dev/null @@ -1,44 +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 -#include - -namespace AZ -{ - class Vector2; -} - -namespace GraphCanvas -{ - class SceneSliceInstance; - class SceneSliceReference; - struct ExposedEndpointInfo; - - //! SubSceneRequests - //! EBus for forwarding scene request for a node to the a contained sub scene - class SubSceneRequests - : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::EntityId; - - //! Retrieves the SceneSlice reference of the sub scene - virtual SceneSliceReference* GetReference() = 0; - virtual const SceneSliceReference* GetReferenceConst() const = 0; - - //! Retrieves the SceneSlice instance from the sub scene scene slice reference - virtual SceneSliceInstance* GetInstance() = 0; - }; - - using SubSceneRequestBus = AZ::EBus; -} From 5209c28021c0ac922ae214eca1760abd72ad0032 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 15:06:52 -0800 Subject: [PATCH 205/394] Removes LibraryDataModel.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Model/LibraryDataModel.cpp | 125 ------------------ .../Code/Editor/Model/LibraryDataModel.h | 56 -------- .../Code/scriptcanvasgem_editor_files.cmake | 2 - 3 files changed, 183 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h diff --git a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp b/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp deleted file mode 100644 index 40e43ca7e8..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.cpp +++ /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 - * - */ - -#include "LibraryDataModel.h" - -#include - -#include -#include -#include - -#include -#include - -namespace ScriptCanvasEditor -{ - namespace Model - { - LibraryData::LibraryData(QObject* parent /*= nullptr*/) : QAbstractTableModel(parent) - { - Add("All", AZ::Uuid::CreateNull()); - - AZ::SerializeContext* serializeContext = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); - serializeContext->EnumerateDerived( - [this] - (const AZ::SerializeContext::ClassData* classData, [[maybe_unused]] const AZ::Uuid& classUuid) -> bool - { - Add(classData->m_name, classData->m_typeId); - return true; - }); - } - - int LibraryData::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const - { - return m_data.size(); - } - - int LibraryData::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const - { - return ColumnIndex::Count; - } - - QVariant LibraryData::data(const QModelIndex &index, int role /*= Qt::DisplayRole*/) const - { - switch (role) - { - case DataSetRole: - { - if (index.column() == ColumnIndex::Name) - { - const Data* data = &m_data[index.row()]; - return QVariant::fromValue(reinterpret_cast(const_cast(data))); - } - } - break; - - case Qt::DisplayRole: - { - if (index.column() == ColumnIndex::Name) - { - return m_data[index.row()].m_name; - } - } - break; - - case Qt::DecorationRole: - { - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(m_data[index.row()].m_uuid); - - if (classData && classData->m_editData) - { - const auto& editorElementData = classData->m_editData->FindElementData(AZ::Edit::ClassElements::EditorData); - if (editorElementData) - { - if (auto iconAttribute = editorElementData->FindAttribute(AZ::Edit::Attributes::Icon)) - { - if (auto iconAttributeData = azdynamic_cast*>(iconAttribute)) - { - AZStd::string iconAttributeValue = iconAttributeData->Get(nullptr); - if (!iconAttributeValue.empty()) - { - return QVariant(QIcon(QString(iconAttributeValue.c_str()))); - } - } - } - } - } - else - { - QString defaultIcon = QStringLiteral("Icons/ScriptCanvas/Libraries/All.png"); - return QVariant(QIcon(defaultIcon)); - } - - return QVariant(); - } - break; - - default: - break; - } - - return QVariant(); - } - - Qt::ItemFlags LibraryData::flags([[maybe_unused]] const QModelIndex &index) const - { - return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled; - } - - void LibraryData::Add(const char* name, const AZ::Uuid& uuid) - { - m_data.push_back({ QString(name), uuid }); - } - - } -} - diff --git a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h b/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h deleted file mode 100644 index 66f6a823bb..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Model/LibraryDataModel.h +++ /dev/null @@ -1,56 +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 ScriptCanvasEditor -{ - namespace Model - { - //! Stores the data for the list of ScriptCanvas libraries - class LibraryData - : public QAbstractTableModel - { - public: - - enum Role - { - DataSetRole = Qt::UserRole - }; - - enum ColumnIndex - { - Name, - Count - }; - - LibraryData(QObject* parent = nullptr); - - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - int columnCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - - Qt::ItemFlags flags(const QModelIndex &index) const override; - - void Add(const char* name, const AZ::Uuid& uuid); - - struct Data - { - QString m_name; - AZ::Uuid m_uuid; - }; - typedef QVector DataSet; - - DataSet m_data; - }; - } -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index d920c69f45..cead461ffe 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -106,8 +106,6 @@ set(FILES Editor/GraphCanvas/PropertyInterfaces/ScriptCanvasStringPropertyDataInterface.h Editor/Model/EntityMimeDataHandler.h Editor/Model/EntityMimeDataHandler.cpp - Editor/Model/LibraryDataModel.h - Editor/Model/LibraryDataModel.cpp Editor/Model/UnitTestBrowserFilterModel.h Editor/Model/UnitTestBrowserFilterModel.cpp Editor/Nodes/NodeCreateUtils.h From 7b1e06fac6c91f2dfc5426983dd5f0342d06537d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:02:41 -0800 Subject: [PATCH 206/394] Removes GenericLineEditCtrl.h/inl/cpp from Gems/ScriptCanvas (which lead to removing a target) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/ScriptCanvas/Code/CMakeLists.txt | 35 +---- .../View/EditCtrls/GenericLineEditCtrl.h | 133 ------------------ .../View/EditCtrls/GenericLineEditCtrl.inl | 123 ---------------- .../View/EditCtrls/GenericLineEditCtrl.cpp | 91 ------------ .../Code/Editor/SystemComponent.cpp | 1 - .../scriptcanvasgem_editor_static_files.cmake | 12 -- Gems/ScriptCanvasTesting/Code/CMakeLists.txt | 3 +- 7 files changed, 5 insertions(+), 393 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl delete mode 100644 Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp delete mode 100644 Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake diff --git a/Gems/ScriptCanvas/Code/CMakeLists.txt b/Gems/ScriptCanvas/Code/CMakeLists.txt index 7be5ec962e..cdaf7df338 100644 --- a/Gems/ScriptCanvas/Code/CMakeLists.txt +++ b/Gems/ScriptCanvas/Code/CMakeLists.txt @@ -137,32 +137,6 @@ ly_create_alias(NAME ScriptCanvas.Clients NAMESPACE Gem TARGETS Gem::ScriptCanv ly_create_alias(NAME ScriptCanvas.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvas) if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_target( - NAME ScriptCanvasEditor STATIC - NAMESPACE Gem - AUTOMOC - FILES_CMAKE - scriptcanvasgem_editor_static_files.cmake - COMPILE_DEFINITIONS - PUBLIC - SCRIPTCANVAS_ERRORS_ENABLED - PRIVATE - SCRIPTCANVAS_EDITOR - ${SCRIPT_CANVAS_COMMON_DEFINES} - INCLUDE_DIRECTORIES - PUBLIC - . - Editor/Include - Editor/Static/Include - Editor/Assets - BUILD_DEPENDENCIES - PRIVATE - AZ::AzCore - AZ::AzToolsFramework - 3rdParty::Qt::Widgets - Gem::ScriptCanvas - ) - ly_add_target( NAME ScriptCanvas.Editor.Static STATIC NAMESPACE Gem @@ -181,11 +155,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) SCRIPTCANVAS_EDITOR ${SCRIPT_CANVAS_COMMON_DEFINES} INCLUDE_DIRECTORIES + PUBLIC + Editor/Include PRIVATE . Editor Tools - Editor/Include ${SCRIPT_CANVAS_AUTOGEN_BUILD_DIR} BUILD_DEPENDENCIES PUBLIC @@ -194,7 +169,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AssetBuilderSDK ${additional_dependencies} Gem::ScriptCanvas - Gem::ScriptCanvasEditor Gem::ScriptEvents.Static Gem::GraphCanvasWidgets Gem::ExpressionEvaluation.Static @@ -206,7 +180,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME ScriptCanvas.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE scriptcanvasgem_editor_shared_files.cmake @@ -217,10 +190,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) SCRIPTCANVAS_EDITOR ${SCRIPT_CANVAS_COMMON_DEFINES} INCLUDE_DIRECTORIES + PUBLIC + Editor/Include PRIVATE . Editor - Editor/Include BUILD_DEPENDENCIES PRIVATE AZ::AzToolsFramework @@ -294,7 +268,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - Gem::ScriptCanvasEditor Gem::ScriptCanvas.Editor.Static ) ly_add_googletest( diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h b/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h deleted file mode 100644 index 950fa8ef2e..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h +++ /dev/null @@ -1,133 +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 - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include - -#include -#endif - -class QLineEdit; - -namespace ScriptCanvasEditor -{ - namespace EditCtrl - { - template using PropertyToStringCB = AZStd::function; - template using StringToPropertyCB = AZStd::function; - using StringValidatorCB = AZStd::function; - } - - template - class GenericLineEditHandler; - - class GenericLineEditCtrlBase - : public QWidget - { - Q_OBJECT - public: - template - friend class GenericLineEditHandler; - AZ_RTTI(GenericLineEditCtrlBase, "{0EC84840-666F-424E-9443-D20D8FEF743B}"); - AZ_CLASS_ALLOCATOR(GenericLineEditCtrlBase, AZ::SystemAllocator, 0); - - GenericLineEditCtrlBase(QWidget* pParent = nullptr); - ~GenericLineEditCtrlBase() override = default; - - AZStd::string value() const; - - QWidget* GetFirstInTabOrder(); - QWidget* GetLastInTabOrder(); - void UpdateTabOrder(); - - signals: - void valueChanged(AZStd::string& newValue); - - public: - void setValue(AZStd::string_view val); - void setMaxLen(int maxLen); - void onChildLineEditValueChange(const QString& value); - - protected: - void focusInEvent(QFocusEvent* e) override; - - private: - QLineEdit* m_pLineEdit; - }; - - template - class GenericLineEditCtrl - : public GenericLineEditCtrlBase - { - public: - friend class GenericLineEditHandler; - AZ_RTTI(((GenericLineEditCtrl), "{4A094311-8956-40C9-95B5-7D50C2574B45}", T), GenericLineEditCtrlBase); - AZ_CLASS_ALLOCATOR(GenericLineEditCtrl, AZ::SystemAllocator, 0); - - GenericLineEditCtrl(QWidget* pParent = nullptr) - : GenericLineEditCtrlBase(pParent) - {} - ~GenericLineEditCtrl() override = default; - - private: - // Stores per ctrl instance string <-> T conversion functions - EditCtrl::PropertyToStringCB m_propertyToStringCB; - EditCtrl::StringToPropertyCB m_stringToPropertyCB; - }; - - template - class GenericLineEditHandler - : QObject - , public AzToolsFramework::PropertyHandler - { - public: - AZ_CLASS_ALLOCATOR(GenericLineEditHandler, AZ::SystemAllocator, 0); - - GenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB, - const EditCtrl::StringValidatorCB& stringValidatorCB = {}); - - AZ::u32 GetHandlerName(void) const override { return ScriptCanvas::Attributes::UIHandlers::GenericLineEdit; } - QWidget* GetFirstInTabOrder(GenericLineEditCtrlBase* widget) override { return widget->GetFirstInTabOrder(); } - QWidget* GetLastInTabOrder(GenericLineEditCtrlBase* widget) override { return widget->GetLastInTabOrder(); } - void UpdateWidgetInternalTabbing(GenericLineEditCtrlBase* widget) override { widget->UpdateTabOrder(); } - - QWidget* CreateGUI(QWidget* pParent) override; - void ConsumeAttribute(GenericLineEditCtrlBase* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; - void WriteGUIValuesIntoProperty(size_t index, GenericLineEditCtrlBase* GUI, typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - bool ReadValuesIntoGUI(size_t index, GenericLineEditCtrlBase* GUI, const typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - - bool AutoDelete() const override { return false; } - - private: - // Stores per handler string <-> T conversion functions - // There is only 1 handler per instantiated T - EditCtrl::PropertyToStringCB m_propertyToStringCB; - EditCtrl::StringToPropertyCB m_stringToPropertyCB; - EditCtrl::StringValidatorCB m_stringValidatorCB; - }; - - template - AzToolsFramework::PropertyHandlerBase* RegisterGenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB) - { - if (!AzToolsFramework::PropertyTypeRegistrationMessages::Bus::FindFirstHandler()) - { - return nullptr; - } - - auto propertyHandler(aznew GenericLineEditHandler(propertyToStringCB, stringToPropertyCB)); - AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, propertyHandler); - return propertyHandler; - } -} - -#include diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl b/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl deleted file mode 100644 index e889a937ab..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.inl +++ /dev/null @@ -1,123 +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 - -namespace ScriptCanvasEditor -{ - class GenericStringValidator - : public QValidator - { - public: - AZ_CLASS_ALLOCATOR(GenericStringValidator, AZ::SystemAllocator, 0); - GenericStringValidator(const EditCtrl::StringValidatorCB& stringValidatorCB) - : m_stringValidatorCB(stringValidatorCB) - {} - - QValidator::State validate(QString& input, int& pos) const override - { - return m_stringValidatorCB ? m_stringValidatorCB(input, pos) : QValidator::State::Acceptable; - } - - private: - EditCtrl::StringValidatorCB m_stringValidatorCB; - }; - - template - GenericLineEditHandler::GenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB, - const EditCtrl::StringValidatorCB& stringValidatorCB) - : m_propertyToStringCB(propertyToStringCB) - , m_stringToPropertyCB(stringToPropertyCB) - , m_stringValidatorCB(stringValidatorCB) - { - } - - template - QWidget* GenericLineEditHandler::CreateGUI(QWidget* pParent) - { - auto newCtrl = aznew GenericLineEditCtrl(pParent); - if (m_stringValidatorCB) - { - newCtrl->m_pLineEdit->setValidator(aznew GenericStringValidator(m_stringValidatorCB)); - } - connect(newCtrl, &GenericLineEditCtrl::valueChanged, this, [newCtrl]() - { - AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl); - }); - return newCtrl; - } - - template - void GenericLineEditHandler::ConsumeAttribute(GenericLineEditCtrlBase* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrReader, const char* debugName) - { - (void)debugName; - if (attrib == ScriptCanvas::Attributes::StringToProperty) - { - EditCtrl::StringToPropertyCB value; - if (attrReader->Read>(value)) - { - auto genericGUI = azrtti_cast*>(GUI); - genericGUI->m_stringToPropertyCB = value; - } - else - { - AZ_WarningOnce("Script Canvas", false, "Failed to read 'StringToProperty' attribute from property '%s'. Expected a function.", debugName, AZ::AzTypeInfo::Name()); - } - } - else if (attrib == ScriptCanvas::Attributes::PropertyToString) - { - EditCtrl::PropertyToStringCB value; - if (attrReader->Read>(value)) - { - auto genericGUI = azrtti_cast*>(GUI); - genericGUI->m_propertyToStringCB = value; - } - else - { - AZ_WarningOnce("Script Canvas", false, "Failed to read 'PropertyToString' attribute from property '%s'. Expected a function.", debugName, AZ::AzTypeInfo::Name()); - } - } - } - - template - void GenericLineEditHandler::WriteGUIValuesIntoProperty(size_t, GenericLineEditCtrlBase* GUI, typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode*) - { - // Invoke the ctrl string -> T override if it exist otherwise attempt to invoke the handler string -> T override - auto genericGUI = azrtti_cast*>(GUI); - if (genericGUI->m_stringToPropertyCB) - { - genericGUI->m_stringToPropertyCB(instance, genericGUI->value()); - } - else if (m_stringToPropertyCB) - { - m_stringToPropertyCB(instance, GUI->value()); - } - } - - template - bool GenericLineEditHandler::ReadValuesIntoGUI(size_t, GenericLineEditCtrlBase* GUI, const typename GenericLineEditHandler::property_t& instance, AzToolsFramework::InstanceDataNode*) - { - // Invoke the ctrl T -> string override if it exist otherwise attempt to invoke the handler T -> string override - auto genericGUI = azrtti_cast*>(GUI); - if (genericGUI->m_propertyToStringCB) - { - AZStd::string val; - genericGUI->m_propertyToStringCB(val, instance); - genericGUI->setValue(val); - return true; - } - else if (m_propertyToStringCB) - { - AZStd::string val; - m_propertyToStringCB(val, instance); - GUI->setValue(val); - return true; - } - return false; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp deleted file mode 100644 index 6eb2b63129..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp +++ /dev/null @@ -1,91 +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 ScriptCanvasEditor -{ - GenericLineEditCtrlBase::GenericLineEditCtrlBase(QWidget* pParent) - : QWidget(pParent) - { - // create the gui, it consists of a layout, and in that layout, a text field for the value - // and then a slider for the value. - QHBoxLayout* pLayout = new QHBoxLayout(this); - m_pLineEdit = new QLineEdit(this); - - pLayout->setSpacing(4); - pLayout->setContentsMargins(1, 0, 1, 0); - - pLayout->addWidget(m_pLineEdit); - - m_pLineEdit->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); - m_pLineEdit->setMinimumWidth(AzToolsFramework::PropertyQTConstant_MinimumWidth); - m_pLineEdit->setFixedHeight(AzToolsFramework::PropertyQTConstant_DefaultHeight); - - m_pLineEdit->setFocusPolicy(Qt::StrongFocus); - - setLayout(pLayout); - setFocusProxy(m_pLineEdit); - setFocusPolicy(m_pLineEdit->focusPolicy()); - - connect(m_pLineEdit, &QLineEdit::textChanged, this, &GenericLineEditCtrlBase::onChildLineEditValueChange); - connect(m_pLineEdit, &QLineEdit::editingFinished, this, [this]() - { - AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::OnEditingFinished, this); - }); - } - - void GenericLineEditCtrlBase::setValue(AZStd::string_view value) - { - QSignalBlocker signalBlocker(m_pLineEdit); - m_pLineEdit->setText(value.data()); - } - - void GenericLineEditCtrlBase::focusInEvent(QFocusEvent* e) - { - m_pLineEdit->event(e); - m_pLineEdit->selectAll(); - } - - AZStd::string GenericLineEditCtrlBase::value() const - { - return AZStd::string(m_pLineEdit->text().toUtf8().data()); - } - - void GenericLineEditCtrlBase::setMaxLen(int maxLen) - { - QSignalBlocker signalBlocker(m_pLineEdit); - m_pLineEdit->setMaxLength(maxLen); - } - - void GenericLineEditCtrlBase::onChildLineEditValueChange(const QString& newValue) - { - AZStd::string changedVal(newValue.toUtf8().data()); - emit valueChanged(changedVal); - } - - QWidget* GenericLineEditCtrlBase::GetFirstInTabOrder() - { - return m_pLineEdit; - } - QWidget* GenericLineEditCtrlBase::GetLastInTabOrder() - { - return m_pLineEdit; - } - - void GenericLineEditCtrlBase::UpdateTabOrder() - { - // There's only one QT widget on this property. - } -} - -#include diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 6087dfb98f..23c127b83b 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake deleted file mode 100644 index 3ef141f0f7..0000000000 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_static_files.cmake +++ /dev/null @@ -1,12 +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 -# -# - -set(FILES - Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h - Editor/Static/Source/View/EditCtrls/GenericLineEditCtrl.cpp -) diff --git a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt index 499bb84c2d..c90eff9389 100644 --- a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt +++ b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt @@ -29,7 +29,7 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC Gem::ScriptCanvas - Gem::ScriptCanvasEditor + Gem::ScriptCanvas.Editor Gem::GraphCanvasWidgets Gem::ScriptEvents.Editor PRIVATE @@ -44,7 +44,6 @@ ly_add_target( *.ScriptCanvasNodeable.xml,ScriptCanvasNodeable_Source.jinja,$path/$fileprefix.generated.cpp RUNTIME_DEPENDENCIES Gem::ScriptCanvas.Editor - Gem::ScriptCanvasEditor Gem::GraphCanvasWidgets Gem::ScriptEvents ) From 1342d54c7d9bb6840905bdc7cef3ba5f57da3a40 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:23:26 -0800 Subject: [PATCH 207/394] Removes Utilities/Command.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Utilities/Command.cpp | 14 --------- .../Code/Editor/Utilities/Command.h | 29 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 2 -- 3 files changed, 45 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Utilities/Command.h diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp b/Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp deleted file mode 100644 index 482347f37e..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.cpp +++ /dev/null @@ -1,14 +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 "Command.h" - -namespace ScriptCanvasEditor -{ - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.h b/Gems/ScriptCanvas/Code/Editor/Utilities/Command.h deleted file mode 100644 index a391a4d833..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/Command.h +++ /dev/null @@ -1,29 +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 - -namespace ScriptCanvasEditor -{ - // Commands are named wrappers around ebus events - class Command - { - public: - - //template - //void Execute(const char* commandName, args&&... parameters); - - private: - - AZStd::string m_commandName; - AZStd::string m_description; - AZStd::string m_category; - AZStd::string m_iconPath; - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index cead461ffe..a830ba08ff 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -119,8 +119,6 @@ set(FILES Editor/Undo/ScriptCanvasGraphCommand.h Editor/Undo/ScriptCanvasUndoManager.cpp Editor/Undo/ScriptCanvasUndoManager.h - Editor/Utilities/Command.h - Editor/Utilities/Command.cpp Editor/Utilities/CommonSettingsConfigurations.h Editor/Utilities/CommonSettingsConfigurations.cpp Editor/Utilities/RecentFiles.h From 3db71950e864367b423b1018497d2ffb1bf96cb3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:31:10 -0800 Subject: [PATCH 208/394] Removes NewGraphDialog from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/SystemComponent.cpp | 1 - .../Editor/View/Dialogs/NewGraphDialog.cpp | 51 --------------- .../Code/Editor/View/Dialogs/NewGraphDialog.h | 42 ------------- .../Editor/View/Dialogs/NewGraphDialog.ui | 63 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 3 - 5 files changed, 160 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 23c127b83b..59c52de05c 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp deleted file mode 100644 index 402d80fb32..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.cpp +++ /dev/null @@ -1,51 +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 "NewGraphDialog.h" - -#include -#include - -#include "Editor/View/Dialogs/ui_NewGraphDialog.h" - - - -namespace ScriptCanvasEditor -{ - NewGraphDialog::NewGraphDialog(const QString& title, const QString& text, QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , ui(new Ui::NewGraphDialog) - , m_text(text) - { - ui->setupUi(this); - - setWindowTitle(title); - - QObject::connect(ui->GraphName, &QLineEdit::returnPressed, this, &NewGraphDialog::OnOK); - QObject::connect(ui->GraphName, &QLineEdit::textChanged, this, &NewGraphDialog::OnTextChanged); - QObject::connect(ui->ok, &QPushButton::clicked, this, &NewGraphDialog::OnOK); - QObject::connect(ui->cancel, &QPushButton::clicked, this, &QDialog::reject); - - ui->ok->setEnabled(false); - } - - void NewGraphDialog::OnTextChanged(const QString& text) - { - ui->ok->setEnabled(!text.isEmpty()); - } - - void NewGraphDialog::OnOK() - { - QString itemName = ui->GraphName->text(); - m_text = itemName.toLocal8Bit().constData(); - - accept(); - } - - #include -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h b/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h deleted file mode 100644 index de6c2a102f..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.h +++ /dev/null @@ -1,42 +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 - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace Ui -{ - class NewGraphDialog; -} - -namespace ScriptCanvasEditor -{ - class NewGraphDialog - : public QDialog - { - Q_OBJECT - - public: - NewGraphDialog(const QString& title, const QString& text, QWidget* pParent = nullptr); - - const QString& GetText() const { return m_text; } - - protected: - - void OnOK(); - void OnTextChanged(const QString& text); - - QString m_text; - - Ui::NewGraphDialog* ui; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui b/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui deleted file mode 100644 index 89861c0a49..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Dialogs/NewGraphDialog.ui +++ /dev/null @@ -1,63 +0,0 @@ - - - NewGraphDialog - - - - 0 - 0 - 300 - 72 - - - - - - - Name: - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 10 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - - diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index a830ba08ff..51843a8837 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -125,9 +125,6 @@ set(FILES Editor/Utilities/RecentFiles.cpp Editor/Utilities/RecentAssetPath.h Editor/Utilities/RecentAssetPath.cpp - Editor/View/Dialogs/NewGraphDialog.h - Editor/View/Dialogs/NewGraphDialog.cpp - Editor/View/Dialogs/NewGraphDialog.ui Editor/View/Dialogs/SettingsDialog.h Editor/View/Dialogs/SettingsDialog.cpp Editor/View/Dialogs/SettingsDialog.ui From 4015ffd0736ff4f5a75f66b81c9add1bacd3afe7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:34:17 -0800 Subject: [PATCH 209/394] Removes WidgetBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/View/Widgets/WidgetBus.h | 25 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 1 - 2 files changed, 26 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h deleted file mode 100644 index 8b78b07524..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/WidgetBus.h +++ /dev/null @@ -1,25 +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 ScriptCanvasEditor -{ - class WidgetNotification : public AZ::EBusTraits - { - public: - virtual void OnLibrarySelected(const AZ::Uuid& library) = 0; - }; - - using WidgetNotificationBus = AZ::EBus; - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 51843a8837..a9624185ea 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -161,7 +161,6 @@ set(FILES Editor/View/Widgets/ScriptCanvasNodePaletteToolbar.ui Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp - Editor/View/Widgets/WidgetBus.h Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.cpp Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.h Editor/View/Widgets/NodePalette/CreateNodeMimeEvent.cpp From d858c168317a58e86ab92198deaaef5cebac042a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:39:06 -0800 Subject: [PATCH 210/394] Removes LoggingTypes.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../View/Widgets/LoggingPanel/LoggingTypes.cpp | 13 ------------- .../Code/scriptcanvasgem_editor_files.cmake | 1 - 2 files changed, 14 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp deleted file mode 100644 index 8a99701802..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp +++ /dev/null @@ -1,13 +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 - -namespace ScriptCanvasEditor -{ -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index a9624185ea..90bf36ac8f 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -182,7 +182,6 @@ set(FILES Editor/View/Widgets/NodePalette/VariableNodePaletteTreeItemTypes.h Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.cpp Editor/View/Widgets/LoggingPanel/LoggingDataAggregator.h - Editor/View/Widgets/LoggingPanel/LoggingTypes.cpp Editor/View/Widgets/LoggingPanel/LoggingTypes.h Editor/View/Widgets/LoggingPanel/LoggingWindow.cpp Editor/View/Widgets/LoggingPanel/LoggingWindow.h From 5c557f56a3555aec73bac449f38203c9755e5672 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:43:21 -0800 Subject: [PATCH 211/394] Removes LoggingAssetDataAggregator/LoggingAssetWindowSession from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../LoggingAssetDataAggregator.cpp | 70 ------------------- .../LoggingAssetDataAggregator.h | 44 ------------ .../LoggingAssetWindowSession.cpp | 48 ------------- .../LoggingAssetWindowSession.h | 40 ----------- .../Code/scriptcanvasgem_editor_files.cmake | 4 -- 5 files changed, 206 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp deleted file mode 100644 index 08e80c30d7..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp +++ /dev/null @@ -1,70 +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 - -namespace ScriptCanvasEditor -{ - /////////////////////////////// - // LoggingAssetDataAggregator - /////////////////////////////// - - LoggingAssetDataAggregator::LoggingAssetDataAggregator(const AZ::Data::AssetId& assetId) - : m_assetId(assetId) - { - } - - LoggingAssetDataAggregator::~LoggingAssetDataAggregator() - { - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::AnnotateNodeSignal& /**/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::ExecutionThreadEnd& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::ExecutionThreadBeginning& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::GraphActivation& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::GraphDeactivation& /*loggableEvent*/) - { - // call parent process function in the aggregator class - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::NodeStateChange& loggableEvent) - { - ProcessNodeStateChanged(loggableEvent); - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::InputSignal& loggableEvent) - { - ProcessInputSignal(loggableEvent); - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::OutputSignal& loggableEvent) - { - ProcessOutputSignal(loggableEvent); - } - - void LoggingAssetDataAggregator::Visit(ScriptCanvas::VariableChange& loggableEvent) - { - ProcessVariableChangedSignal(loggableEvent); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h deleted file mode 100644 index 71efcbb017..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h +++ /dev/null @@ -1,44 +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 -#include - -namespace ScriptCanvasEditor -{ - class LoggingAssetDataAggregator - : public LoggingDataAggregator - , public ScriptCanvas::LoggableEventVisitor - { - public: - AZ_CLASS_ALLOCATOR(LoggingAssetDataAggregator, AZ::SystemAllocator, 0); - - LoggingAssetDataAggregator(const AZ::Data::AssetId& assetId); - ~LoggingAssetDataAggregator() override; - - bool CanCaptureData() const override { return false; } - bool IsCapturingData() const override { return false; } - - protected: - void Visit(ScriptCanvas::AnnotateNodeSignal&) override; - void Visit(ScriptCanvas::ExecutionThreadEnd&) override; - void Visit(ScriptCanvas::ExecutionThreadBeginning&) override; - void Visit(ScriptCanvas::GraphActivation&) override; - void Visit(ScriptCanvas::GraphDeactivation&) override; - void Visit(ScriptCanvas::NodeStateChange&) override; - void Visit(ScriptCanvas::InputSignal&) override; - void Visit(ScriptCanvas::OutputSignal&) override; - void Visit(ScriptCanvas::VariableChange&) override; - - private: - - AZ::Data::AssetId m_assetId; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp deleted file mode 100644 index b761ead488..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp +++ /dev/null @@ -1,48 +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 - -namespace ScriptCanvasEditor -{ - ////////////////////////////// - // LoggingAssetWindowSession - ////////////////////////////// - - LoggingAssetWindowSession::LoggingAssetWindowSession(const AZ::Data::AssetId& assetId, QWidget* parent) - : LoggingWindowSession(parent) - , m_dataAggregator(assetId) - , m_assetId(assetId) - { - SetDataId(m_dataAggregator.GetDataId()); - - m_ui->captureButton->setEnabled(false); - - RegisterTreeRoot(m_dataAggregator.GetTreeRoot()); - } - - LoggingAssetWindowSession::~LoggingAssetWindowSession() - { - } - - void LoggingAssetWindowSession::OnCaptureButtonPressed() - { - } - - void LoggingAssetWindowSession::OnPlaybackButtonPressed() - { - // TODO - } - - void LoggingAssetWindowSession::OnOptionsButtonPressed() - { - // TODO - } - -#include -} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h deleted file mode 100644 index c603f8e860..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h +++ /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 - * - */ -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#endif - -namespace ScriptCanvasEditor -{ - class LoggingAssetWindowSession - : public LoggingWindowSession - { - Q_OBJECT - - public: - AZ_CLASS_ALLOCATOR(LoggingAssetWindowSession, AZ::SystemAllocator, 0); - - LoggingAssetWindowSession(const AZ::Data::AssetId& assetId, QWidget* parent = nullptr); - ~LoggingAssetWindowSession() override; - - protected: - - void OnCaptureButtonPressed() override; - void OnPlaybackButtonPressed() override; - void OnOptionsButtonPressed() override; - - private: - - AZ::Data::AssetId m_assetId; - - LoggingAssetDataAggregator m_dataAggregator; - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 90bf36ac8f..206a73a9e6 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -195,10 +195,6 @@ set(FILES Editor/View/Widgets/LoggingPanel/LiveWindowSession/LiveLoggingDataAggregator.h Editor/View/Widgets/LoggingPanel/LiveWindowSession/LiveLoggingWindowSession.cpp Editor/View/Widgets/LoggingPanel/LiveWindowSession/LiveLoggingWindowSession.h - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.cpp - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetDataAggregator.h - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.cpp - Editor/View/Widgets/LoggingPanel/AssetWindowSession/LoggingAssetWindowSession.h Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.h Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.ui From 9d95ad4a2ade1942c650e693121994d77ac532a4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:48:36 -0800 Subject: [PATCH 212/394] Removes CreateNodeContextMenu.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../View/Windows/CreateNodeContextMenu.cpp | 266 ------------------ .../View/Windows/CreateNodeContextMenu.h | 140 --------- 2 files changed, 406 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp deleted file mode 100644 index e54469c80c..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.cpp +++ /dev/null @@ -1,266 +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 - -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ScriptCanvasContextMenus.h" - -namespace ScriptCanvasEditor -{ - ////////////////////////////// - // AddSelectedEntitiesAction - ////////////////////////////// - - AddSelectedEntitiesAction::AddSelectedEntitiesAction(QObject* parent) - : GraphCanvas::ContextMenuAction("", parent) - { - } - - GraphCanvas::ActionGroupId AddSelectedEntitiesAction::GetActionGroupId() const - { - return AZ_CRC("EntityActionGroup", 0x17e16dfe); - } - - void AddSelectedEntitiesAction::RefreshAction(const GraphCanvas::GraphId&, const AZ::EntityId&) - { - AzToolsFramework::EntityIdList selectedEntities; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - setEnabled(!selectedEntities.empty()); - - if (selectedEntities.size() <= 1) - { - setText("Reference selected entity"); - } - else - { - setText("Reference selected entities"); - } - } - - GraphCanvas::ContextMenuAction::SceneReaction AddSelectedEntitiesAction::TriggerAction(const AZ::EntityId& graphCanvasGraphId, const AZ::Vector2& scenePos) - { - AzToolsFramework::EntityIdList selectedEntities; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - AZ::EntityId scriptCanvasGraphId; - GeneralRequestBus::BroadcastResult(scriptCanvasGraphId, &GeneralRequests::GetScriptCanvasGraphId, graphCanvasGraphId); - - GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::ClearSelection); - - AZ::Vector2 addPosition = scenePos; - - for (const AZ::EntityId& id : selectedEntities) - { - NodeIdPair nodePair = Nodes::CreateEntityNode(id, scriptCanvasGraphId); - GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::AddNode, nodePair.m_graphCanvasId, addPosition); - addPosition += AZ::Vector2(20, 20); - } - - return GraphCanvas::ContextMenuAction::SceneReaction::PostUndo; - } - - //////////////////////////// - // EndpointSelectionAction - //////////////////////////// - - EndpointSelectionAction::EndpointSelectionAction(const GraphCanvas::Endpoint& proposedEndpoint) - : QAction(nullptr) - , m_endpoint(proposedEndpoint) - { - AZStd::string name; - GraphCanvas::SlotRequestBus::EventResult(name, proposedEndpoint.GetSlotId(), &GraphCanvas::SlotRequests::GetName); - - AZStd::string tooltip; - GraphCanvas::SlotRequestBus::EventResult(tooltip, proposedEndpoint.GetSlotId(), &GraphCanvas::SlotRequests::GetTooltip); - - setText(name.c_str()); - setToolTip(tooltip.c_str()); - } - - const GraphCanvas::Endpoint& EndpointSelectionAction::GetEndpoint() const - { - return m_endpoint; - } - - //////////////////////////////////// - // RemoveUnusedVariablesMenuAction - //////////////////////////////////// - - RemoveUnusedVariablesMenuAction::RemoveUnusedVariablesMenuAction(QObject* parent) - : SceneContextMenuAction("Variables", parent) - { - setToolTip("Removes all of the unused variables from the active graph"); - } - - void RemoveUnusedVariablesMenuAction::RefreshAction(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetId) - { - setEnabled(true); - } - - bool RemoveUnusedVariablesMenuAction::IsInSubMenu() const - { - return true; - } - - AZStd::string RemoveUnusedVariablesMenuAction::GetSubMenuPath() const - { - return "Remove Unused"; - } - - GraphCanvas::ContextMenuAction::SceneReaction RemoveUnusedVariablesMenuAction::TriggerAction(const GraphCanvas::GraphId& graphId, const AZ::Vector2& scenePos) - { - GraphCanvas::SceneRequestBus::Event(graphId, &GraphCanvas::SceneRequests::RemoveUnusedNodes); - return SceneReaction::PostUndo; - } - - ///////////////////// - // SceneContextMenu - ///////////////////// - - SceneContextMenu::SceneContextMenu(const NodePaletteModel& paletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel) - { - QWidgetAction* actionWidget = new QWidgetAction(this); - - const bool inContextMenu = true; - m_palette = aznew Widget::NodePaletteDockWidget(paletteModel, tr("Node Palette"), this, assetModel, inContextMenu); - - actionWidget->setDefaultWidget(m_palette); - - GraphCanvas::ContextMenuAction* menuAction = aznew AddSelectedEntitiesAction(this); - - AddActionGroup(menuAction->GetActionGroupId()); - AddMenuAction(menuAction); - - AddMenuAction(actionWidget); - - connect(this, &QMenu::aboutToShow, this, &SceneContextMenu::SetupDisplay); - connect(m_palette, &Widget::NodePaletteDockWidget::OnContextMenuSelection, this, &SceneContextMenu::HandleContextMenuSelection); - } - - void SceneContextMenu::ResetSourceSlotFilter() - { - m_palette->ResetSourceSlotFilter(); - } - - void SceneContextMenu::FilterForSourceSlot(const AZ::EntityId& scriptCanvasGraphId, const AZ::EntityId& sourceSlotId) - { - m_palette->FilterForSourceSlot(scriptCanvasGraphId, sourceSlotId); - } - - const Widget::NodePaletteDockWidget* SceneContextMenu::GetNodePalette() const - { - return m_palette; - } - - void SceneContextMenu::OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId) - { - // Don't want to overly manipulate the state. So we only modify this when we know we want to turn it on. - if (GraphVariablesTableView::HasCopyVariableData()) - { - m_editorActionsGroup.SetPasteEnabled(true); - } - } - - void SceneContextMenu::HandleContextMenuSelection() - { - close(); - } - - void SceneContextMenu::SetupDisplay() - { - m_palette->ResetDisplay(); - m_palette->FocusOnSearchFilter(); - } - - void SceneContextMenu::keyPressEvent(QKeyEvent* keyEvent) - { - if (!m_palette->hasFocus()) - { - QMenu::keyPressEvent(keyEvent); - } - } - - ////////////////////////// - // ConnectionContextMenu - ////////////////////////// - - ConnectionContextMenu::ConnectionContextMenu(const NodePaletteModel& nodePaletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel) - { - QWidgetAction* actionWidget = new QWidgetAction(this); - - const bool inContextMenu = true; - m_palette = aznew Widget::NodePaletteDockWidget(nodePaletteModel, tr("Node Palette"), this, assetModel, inContextMenu); - - actionWidget->setDefaultWidget(m_palette); - - AddMenuAction(actionWidget); - - connect(this, &QMenu::aboutToShow, this, &ConnectionContextMenu::SetupDisplay); - connect(m_palette, &Widget::NodePaletteDockWidget::OnContextMenuSelection, this, &ConnectionContextMenu::HandleContextMenuSelection); - } - - const Widget::NodePaletteDockWidget* ConnectionContextMenu::GetNodePalette() const - { - return m_palette; - } - - void ConnectionContextMenu::OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId) - { - GraphCanvas::ConnectionContextMenu::OnRefreshActions(graphId, targetMemberId); - - m_palette->ResetSourceSlotFilter(); - - m_connectionId = targetMemberId; - - // TODO: Filter nodes. - } - - void ConnectionContextMenu::HandleContextMenuSelection() - { - close(); - } - - void ConnectionContextMenu::SetupDisplay() - { - m_palette->ResetDisplay(); - m_palette->FocusOnSearchFilter(); - } - - void ConnectionContextMenu::keyPressEvent(QKeyEvent* keyEvent) - { - if (!m_palette->hasFocus()) - { - QMenu::keyPressEvent(keyEvent); - } - } - - #include "Editor/View/Windows/moc_ScriptCanvasContextMenus.cpp" -} - diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h deleted file mode 100644 index 54f52df171..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/CreateNodeContextMenu.h +++ /dev/null @@ -1,140 +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 - -#if !defined(Q_MOC_RUN) -#include -#include - -#include -#include - -#include -#include -#include -#include -#endif - -namespace ScriptCanvasEditor -{ - class NodePaletteModel; - - namespace Widget - { - class NodePaletteDockWidget; - } - - class AddSelectedEntitiesAction - : public GraphCanvas::ContextMenuAction - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(AddSelectedEntitiesAction, AZ::SystemAllocator, 0); - - AddSelectedEntitiesAction(QObject* parent); - virtual ~AddSelectedEntitiesAction() = default; - - GraphCanvas::ActionGroupId GetActionGroupId() const override; - - void RefreshAction(const GraphCanvas::GraphId& graphCanvasGraphId, const AZ::EntityId& targetId) override; - SceneReaction TriggerAction(const GraphCanvas::GraphId& graphCanvasGraphId, const AZ::Vector2& scenePos) override; - }; - - class EndpointSelectionAction - : public QAction - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(EndpointSelectionAction, AZ::SystemAllocator, 0); - - EndpointSelectionAction(const GraphCanvas::Endpoint& endpoint); - ~EndpointSelectionAction() = default; - - const GraphCanvas::Endpoint& GetEndpoint() const; - - private: - GraphCanvas::Endpoint m_endpoint; - }; - - class RemoveUnusedVariablesMenuAction - : public GraphCanvas::SceneContextMenuAction - { - public: - AZ_CLASS_ALLOCATOR(RemoveUnusedVariablesMenuAction, AZ::SystemAllocator, 0); - - RemoveUnusedVariablesMenuAction(QObject* parent); - virtual ~RemoveUnusedVariablesMenuAction() = default; - - bool IsInSubMenu() const override; - AZStd::string GetSubMenuPath() const override; - - void RefreshAction(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetId) override; - GraphCanvas::ContextMenuAction::SceneReaction TriggerAction(const GraphCanvas::GraphId& graphId, const AZ::Vector2& scenePos) override; - }; - - class SceneContextMenu - : public GraphCanvas::SceneContextMenu - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(SceneContextMenu, AZ::SystemAllocator, 0); - - SceneContextMenu(const NodePaletteModel& nodePaletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel); - ~SceneContextMenu() = default; - - void ResetSourceSlotFilter(); - void FilterForSourceSlot(const AZ::EntityId& scriptCanvasGraphId, const AZ::EntityId& sourceSlotId); - const Widget::NodePaletteDockWidget* GetNodePalette() const; - - // EditConstructContextMenu - void OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId) override; - //// - - public slots: - - void HandleContextMenuSelection(); - void SetupDisplay(); - - protected: - void keyPressEvent(QKeyEvent* keyEvent) override; - - AZ::EntityId m_sourceSlotId; - Widget::NodePaletteDockWidget* m_palette; - }; - - class ConnectionContextMenu - : public GraphCanvas::ConnectionContextMenu - { - Q_OBJECT - public: - AZ_CLASS_ALLOCATOR(ConnectionContextMenu, AZ::SystemAllocator, 0); - - ConnectionContextMenu(const NodePaletteModel& nodePaletteModel, AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* assetModel); - ~ConnectionContextMenu() = default; - - const Widget::NodePaletteDockWidget* GetNodePalette() const; - - protected: - - void OnRefreshActions(const GraphCanvas::GraphId& graphId, const AZ::EntityId& targetMemberId); - - public slots: - - void HandleContextMenuSelection(); - void SetupDisplay(); - - protected: - void keyPressEvent(QKeyEvent* keyEvent) override; - - private: - - AZ::EntityId m_connectionId; - Widget::NodePaletteDockWidget* m_palette; - }; -} From 2174f522cb3583382380211eedf9e7b4ac84e6a8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:52:15 -0800 Subject: [PATCH 213/394] Removes MainWindowBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindowBus.h | 30 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 1 - 2 files changed, 31 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h deleted file mode 100644 index 86c805eff1..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindowBus.h +++ /dev/null @@ -1,30 +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 - -namespace ScriptCanvasEditor -{ - class MainWindowNotifications : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - virtual void PreOnActiveSceneChanged() {} - virtual void OnActiveSceneChanged(const AZ::EntityId& /*sceneId*/) {} - virtual void PostOnActiveSceneChanged() {} - - virtual void OnSceneLoaded(const AZ::EntityId& /*sceneId*/) {} - virtual void OnSceneRefreshed(const AZ::EntityId& /*oldSceneId*/, const AZ::EntityId& /*newSceneId*/) {} - virtual void OnSceneUnloaded(const AZ::EntityId& /*sceneId*/) {} - }; - - using MainWindowNotificationBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 206a73a9e6..71ca1bc826 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -232,7 +232,6 @@ set(FILES Editor/View/Windows/MainWindow.cpp Editor/View/Windows/MainWindow.h Editor/View/Windows/mainwindow.ui - Editor/View/Windows/MainWindowBus.h Editor/View/Windows/ScriptCanvasContextMenus.cpp Editor/View/Windows/ScriptCanvasContextMenus.h Editor/View/Windows/ScriptCanvasEditorResources.qrc From 74b7ce8bd90ab91b3e83cf644b4c54ae84ae11a6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:53:20 -0800 Subject: [PATCH 214/394] Removes ScriptCanvasAssetData.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Asset/ScriptCanvasAssetData.h | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h deleted file mode 100644 index 333ea12445..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h +++ /dev/null @@ -1,14 +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 - -namespace ScriptCanvas -{ - -} From 2b75b127fe11b686d69cde9081d99f1cd6f233ff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:57:49 -0800 Subject: [PATCH 215/394] Removes ContractBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Include/ScriptCanvas/Core/Contract.cpp | 1 - .../Include/ScriptCanvas/Core/ContractBus.h | 38 ------------------- .../Contracts/ConnectionLimitContract.cpp | 1 - .../Core/Contracts/ContractRTTI.cpp | 1 - .../DisallowReentrantExecutionContract.cpp | 1 - ...DisplayGroupConnectedSlotLimitContract.cpp | 1 - .../Core/Contracts/DynamicTypeContract.cpp | 1 - .../Contracts/IsReferenceTypeContract.cpp | 1 - .../Core/Contracts/MethodOverloadContract.cpp | 1 - .../Core/Contracts/RestrictedNodeContract.cpp | 1 - .../Core/Contracts/SlotTypeContract.cpp | 1 - .../Core/Contracts/SupportsMethodContract.cpp | 1 - .../Core/Contracts/TypeContract.cpp | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 14 files changed, 51 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp index cfa14b49f1..5053fa1375 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contract.cpp @@ -7,7 +7,6 @@ */ #include "Contract.h" -#include "ContractBus.h" #include "Slot.h" #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h deleted file mode 100644 index b357fc5ca6..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/ContractBus.h +++ /dev/null @@ -1,38 +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 "Core.h" - -#include - -namespace ScriptCanvas -{ - class Contract; - class Slot; - - namespace Data - { - class Type; - } - - class ContractEvents : public AZ::EBusTraits - { - public: - ////////////////////////////////////////////////////////////////////////// - // EBusTraits overrides - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - ////////////////////////////////////////////////////////////////////////// - - virtual void OnValidContract(const Contract*, const Slot&, const Slot&) = 0; - virtual void OnInvalidContract(const Contract*, const Slot&, const Slot&) = 0; - }; - - using ContractEventBus = AZ::EBus; - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp index 362ee24735..daa2d5e80d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ConnectionLimitContract.cpp @@ -7,7 +7,6 @@ */ #include "ConnectionLimitContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp index 3125bfd022..e3f86e1af0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/ContractRTTI.cpp @@ -8,7 +8,6 @@ #include "ContractRTTI.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp index 74a12b0f8a..b0f1f61382 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisallowReentrantExecutionContract.cpp @@ -7,7 +7,6 @@ */ #include "DisallowReentrantExecutionContract.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp index 16259f9ddb..30790c4946 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DisplayGroupConnectedSlotLimitContract.cpp @@ -8,7 +8,6 @@ #include "DisplayGroupConnectedSlotLimitContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp index ad512d4e95..64a165be6e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/DynamicTypeContract.cpp @@ -8,7 +8,6 @@ #include "DynamicTypeContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp index 7762f45271..e5722428f6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/IsReferenceTypeContract.cpp @@ -8,7 +8,6 @@ #include "IsReferenceTypeContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp index cdf3b6353a..6fdfe34f71 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp @@ -8,7 +8,6 @@ #include "MethodOverloadContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp index ad28cc316c..200b8dbfe8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/RestrictedNodeContract.cpp @@ -7,7 +7,6 @@ */ #include "RestrictedNodeContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp index 6ba3610f18..41d0903682 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SlotTypeContract.cpp @@ -7,7 +7,6 @@ */ #include "SlotTypeContract.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp index fb10501e64..648f7a77bb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/SupportsMethodContract.cpp @@ -7,7 +7,6 @@ */ #include "SupportsMethodContract.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp index cc57570c2f..0ab98707d7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/TypeContract.cpp @@ -7,7 +7,6 @@ */ #include "TypeContract.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 9830535ad8..530d98e112 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -23,7 +23,6 @@ set(FILES Include/ScriptCanvas/Core/NodeBus.h Include/ScriptCanvas/Core/EBusNodeBus.h Include/ScriptCanvas/Core/NodelingBus.h - Include/ScriptCanvas/Core/ContractBus.h Include/ScriptCanvas/Core/Attributes.h Include/ScriptCanvas/Core/Connection.h Include/ScriptCanvas/Core/ConnectionBus.h From e97db10ac31ab9166e8328a6de4c57a2667f64e2 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:30:26 -0800 Subject: [PATCH 216/394] Removes StorageRequiredContract from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Contracts/StorageRequiredContract.cpp | 47 ------------------- .../Core/Contracts/StorageRequiredContract.h | 30 ------------ 2 files changed, 77 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp deleted file mode 100644 index f730379ec2..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.cpp +++ /dev/null @@ -1,47 +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 "StorageRequiredContract.h" - -#include -#include -#include - -namespace ScriptCanvas -{ - AZ::Outcome StorageRequiredContract::OnEvaluate(const Slot& sourceSlot, const Slot& targetSlot) const - { - if (sourceSlot.GetType() == SlotType::DataOut && targetSlot.GetType() == SlotType::DataIn) - { - bool isSlotValidStorage{}; - NodeRequestBus::EventResult(isSlotValidStorage, targetSlot.GetNodeId(), &NodeRequests::IsSlotValidStorage, targetSlot.GetId()); - if (isSlotValidStorage) - { - return AZ::Success(); - } - } - - AZStd::string errorMessage = AZStd::string::format("Connection cannot be created between source slot \"%s\" and target slot \"%s\", Storage requirement is not met. (%s)" - , sourceSlot.GetName().data() - , targetSlot.GetName().data() - , RTTI_GetTypeName() - ); - - return AZ::Failure(errorMessage); - } - - void StorageRequiredContract::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(0) - ; - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h deleted file mode 100644 index c8718ec47f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/StorageRequiredContract.h +++ /dev/null @@ -1,30 +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 - -namespace ScriptCanvas -{ - class StorageRequiredContract - : public Contract - { - public: - AZ_CLASS_ALLOCATOR(StorageRequiredContract, AZ::SystemAllocator, 0); - AZ_RTTI(StorageRequiredContract, "{AECE109D-121F-477C-995F-D044CA05F88D}", Contract); - - StorageRequiredContract() = default; - - ~StorageRequiredContract() override = default; - - static void Reflect(AZ::ReflectContext* reflection); - - protected: - AZ::Outcome OnEvaluate(const Slot& sourceSlot, const Slot& targetSlot) const override; - }; -} From b56512fd18a43dae6ca4aef6a081f0ed6cf79d57 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:36:50 -0800 Subject: [PATCH 217/394] Removes LogReader.h/cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Debugger/ClientTransceiver.h | 1 - .../ScriptCanvas/Debugger/LogReader.cpp | 65 ------------------- .../Include/ScriptCanvas/Debugger/LogReader.h | 53 --------------- .../Code/scriptcanvasgem_debugger_files.cmake | 2 - 4 files changed, 121 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h index 78e293c4b0..9335bdd1eb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/ClientTransceiver.h @@ -17,7 +17,6 @@ #include "APIArguments.h" #include "Logger.h" -#include "LogReader.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp deleted file mode 100644 index 1a47ba4553..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.cpp +++ /dev/null @@ -1,65 +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 "LogReader.h" - -namespace ScriptCanvas -{ - namespace Debugger - { - LogReader::LogReader() - { - - } - - LogReader::~LogReader() - { - - } - - void LogReader::Visit([[maybe_unused]] ExecutionThreadEnd& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] ExecutionThreadBeginning& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] GraphActivation& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] GraphDeactivation& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] NodeStateChange& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] InputSignal& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] OutputSignal& loggableEvent) - { - - } - - void LogReader::Visit([[maybe_unused]] VariableChange& loggableEvent) - { - - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h deleted file mode 100644 index bb0fb0d0dc..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Debugger/LogReader.h +++ /dev/null @@ -1,53 +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 -#include -#include -#include - -#include "APIArguments.h" - -namespace ScriptCanvas -{ - namespace Debugger - { - class LogReader - : public LoggableEventVisitor - { - public: - AZ_CLASS_ALLOCATOR(LogReader, AZ::SystemAllocator, 0); - - LogReader(); - ~LogReader(); - - // start at the beginning, if possible - bool Start() { return false; } - // step back one event, if possible - bool StepBack() { return false; } - // step forward one event, if possible - bool StepForward() { return false; } - - protected: - void Visit(ExecutionThreadEnd&); - void Visit(ExecutionThreadBeginning&); - void Visit(GraphActivation&); - void Visit(GraphDeactivation&); - void Visit(NodeStateChange&); - void Visit(InputSignal&); - void Visit(OutputSignal&); - void Visit(VariableChange&); - - private: - size_t m_index = 0; - }; - } -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake index 0a68a9b175..aaeeffae45 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_debugger_files.cmake @@ -18,8 +18,6 @@ set(FILES Include/ScriptCanvas/Debugger/Debugger.cpp Include/ScriptCanvas/Debugger/Logger.h Include/ScriptCanvas/Debugger/Logger.cpp - Include/ScriptCanvas/Debugger/LogReader.h - Include/ScriptCanvas/Debugger/LogReader.cpp Include/ScriptCanvas/Debugger/StatusBus.h Include/ScriptCanvas/Debugger/Messages/Notify.cpp Include/ScriptCanvas/Debugger/Messages/Notify.h From 5cca35370967b30883875165e2e4eb8dcbe2ce16 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:45:03 -0800 Subject: [PATCH 218/394] Removes NativeHostDeclarations and NativeHostDefinitions from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Execution/NativeHostDeclarations.cpp | 16 ----- .../Execution/NativeHostDeclarations.h | 25 ------- .../Execution/NativeHostDefinitions.cpp | 65 ------------------- .../Execution/NativeHostDefinitions.h | 24 ------- .../Code/scriptcanvasgem_common_files.cmake | 4 -- .../Code/scriptcanvasgem_headers.cmake | 4 -- 6 files changed, 138 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp deleted file mode 100644 index b3383a1044..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp +++ /dev/null @@ -1,16 +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 "NativeHostDeclarations.h" - -namespace ScriptCanvas -{ - RuntimeContext::RuntimeContext(AZ::EntityId graphId) - : m_graphId(graphId) - {} -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h deleted file mode 100644 index ea6c884a6f..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDeclarations.h +++ /dev/null @@ -1,25 +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 - -namespace ScriptCanvas -{ - class RuntimeContext - { - public: - RuntimeContext(AZ::EntityId graphId); - - AZ_INLINE AZ::EntityId GetGraphId() const { return m_graphId; } - - protected: - AZ::EntityId m_graphId; - }; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp deleted file mode 100644 index 036310fca4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp +++ /dev/null @@ -1,65 +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 "NativeHostDefinitions.h" -#include - -namespace NativeHostDefinitionsCPP -{ - using namespace ScriptCanvas; - - using FunctionMap = AZStd::unordered_map; - FunctionMap s_functionMap; -} - -namespace ScriptCanvas -{ - bool CallNativeGraphStart(AZStd::string_view name, const RuntimeContext& context) - { - using namespace NativeHostDefinitionsCPP; - - auto iter = s_functionMap.find(name); - if (iter != s_functionMap.end()) - { - iter->second(context); - return true; - } - - return false; - } - - bool RegisterNativeGraphStart(AZStd::string_view name, GraphStartFunction function) - { - using namespace NativeHostDefinitionsCPP; - - auto iter = s_functionMap.find(name); - if (iter == s_functionMap.end()) - { - s_functionMap.insert({ name, function }); - return true; - } - - return false; - } - - // this may never have to be necessary - bool UnregisterNativeGraphStart(AZStd::string_view name) - { - using namespace NativeHostDefinitionsCPP; - - auto iter = s_functionMap.find(name); - if (iter != s_functionMap.end()) - { - s_functionMap.erase(iter); - return true; - } - - return false; - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h deleted file mode 100644 index 457e8d4621..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NativeHostDefinitions.h +++ /dev/null @@ -1,24 +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 "NativeHostDeclarations.h" - -namespace ScriptCanvas -{ - typedef void (*GraphStartFunction)(const RuntimeContext&); - - using GraphStartFunction = void(*)(const RuntimeContext&); - - bool CallNativeGraphStart(AZStd::string_view name, const RuntimeContext& context); - - bool RegisterNativeGraphStart(AZStd::string_view name, GraphStartFunction function); - - // this may never have to be necessary - bool UnregisterNativeGraphStart(AZStd::string_view name); - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index c0dcc04838..65aaeb1b33 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -68,8 +68,6 @@ set(FILES Include/ScriptCanvas/Execution/ExecutionObjectCloning.cpp Include/ScriptCanvas/Execution/ExecutionPerformanceTimer.cpp Include/ScriptCanvas/Execution/ExecutionState.cpp - Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp - Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp @@ -90,8 +88,6 @@ set(FILES Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp Include/ScriptCanvas/Execution/ExecutionContext.cpp - Include/ScriptCanvas/Execution/NativeHostDeclarations.cpp - Include/ScriptCanvas/Execution/NativeHostDefinitions.cpp Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 530d98e112..c5e0d75b39 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -100,8 +100,6 @@ set(FILES Include/ScriptCanvas/Execution/ExecutionPerformanceTimer.h Include/ScriptCanvas/Execution/ExecutionState.h Include/ScriptCanvas/Execution/ExecutionStateDeclarations.h - Include/ScriptCanvas/Execution/NativeHostDeclarations.h - Include/ScriptCanvas/Execution/NativeHostDefinitions.h Include/ScriptCanvas/Execution/RuntimeComponent.h Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.h Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.h @@ -126,8 +124,6 @@ set(FILES Include/ScriptCanvas/Execution/ErrorBus.h Include/ScriptCanvas/Execution/ExecutionContext.h Include/ScriptCanvas/Execution/ExecutionBus.h - Include/ScriptCanvas/Execution/NativeHostDeclarations.h - Include/ScriptCanvas/Execution/NativeHostDefinitions.h Include/ScriptCanvas/Execution/RuntimeComponent.h Include/ScriptCanvas/Internal/Nodeables/BaseTimer.h Include/ScriptCanvas/Internal/Nodeables/BaseTimer.ScriptCanvasNodeable.xml From 0e2af596b4015c8d79fed425660f5543baae2a68 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:45:49 -0800 Subject: [PATCH 219/394] Removes duplicated lines in cmake files in Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 65aaeb1b33..1301883453 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -87,13 +87,10 @@ set(FILES Include/ScriptCanvas/Grammar/Primitives.cpp Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp Include/ScriptCanvas/Grammar/PrimitivesExecution.cpp - Include/ScriptCanvas/Execution/ExecutionContext.cpp - Include/ScriptCanvas/Execution/RuntimeComponent.cpp Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp Include/ScriptCanvas/Internal/Nodes/ExpressionNodeBase.cpp Include/ScriptCanvas/Internal/Nodes/StringFormatted.cpp - Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp Include/ScriptCanvas/Libraries/Libraries.cpp Include/ScriptCanvas/Libraries/Core/AzEventHandler.cpp Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp @@ -200,6 +197,5 @@ set(FILES Include/ScriptCanvas/Utils/NodeUtils.cpp Include/ScriptCanvas/Utils/VersionConverters.cpp Include/ScriptCanvas/Utils/VersioningUtils.cpp - Include/ScriptCanvas/Utils/VersioningUtils.cpp Include/ScriptCanvas/Utils/BehaviorContextUtils.cpp -) \ No newline at end of file +) From 48a5280b6d646d096a01a783f385fefd59a475aa Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:56:29 -0800 Subject: [PATCH 220/394] Removes NodeableOutNative.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Core/SubgraphInterfaceUtility.h | 20 ----- .../Interpreted/ExecutionInterpretedAPI.cpp | 1 - .../ExecutionInterpretedCloningAPI.cpp | 1 - .../ExecutionInterpretedEBusAPI.cpp | 1 - .../Interpreted/ExecutionInterpretedOut.cpp | 1 - .../Execution/NodeableOut/NodeableOutNative.h | 66 -------------- .../Code/scriptcanvasgem_headers.cmake | 1 - .../Tests/ScriptCanvas_RuntimeInterpreted.cpp | 1 - .../Code/Tests/ScriptCanvas_VM.cpp | 87 ------------------- 9 files changed, 179 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h index a43f4be6b6..91e229978a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h @@ -78,26 +78,6 @@ namespace ScriptCanvas return output; } - template - Out CreateOutHelper(const AZStd::string& name, const AZStd::vector& outputNames, AZStd::index_sequence) - { - Out out; - SetDisplayAndParsedName(out, name); - out.outputs.reserve(sizeof...(Is)); - - int dummy[]{ 0, (out.outputs.emplace_back(CreateOutput(outputNames[Is])), 0)... }; - static_cast(dummy); /* avoid warning for unused variable */ - - return out; - } - - template - Out CreateOut(const AZStd::string& name, const AZStd::vector& outputNames = {}) - { - return CreateOutHelper(name, outputNames, AZStd::make_index_sequence()); - } - - template Out CreateOutReturnHelper(const AZStd::string& name, const AZStd::string& returnName, const AZStd::vector& outputNames, AZStd::index_sequence) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index eb856963f7..b98b962be9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp index 387b537148..90cb632961 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedCloningAPI.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp index d33f78c8b4..fd91221088 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedEBusAPI.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "ExecutionInterpretedOut.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp index 4820cf4741..99cb414597 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedOut.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "ExecutionInterpretedAPI.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h deleted file mode 100644 index ab6859db1e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h +++ /dev/null @@ -1,66 +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 -#include - -#include - -namespace ScriptCanvas -{ - namespace Execution - { - template - FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence, std::index_sequence, ReturnTypeIsNotVoid) - { - auto nodeCallWrapper = [callable = AZStd::forward(callable)](AZ::BehaviorValueParameter* result, AZ::BehaviorValueParameter* arguments, int numArguments) mutable - { - [[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args); - (void)numArguments; - AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters"); - AZ_Assert(result, "no null result allowed"); - result->StoreResult(AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe()...)); - }; - - static_assert(!AZStd::is_same_v || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor"); - return FunctorOut(AZStd::move(nodeCallWrapper), allocator); - } - - template - FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence, std::index_sequence, ReturnTypeIsVoid) - { - auto nodeCallWrapper = [callable = AZStd::forward(callable)](AZ::BehaviorValueParameter*, AZ::BehaviorValueParameter* arguments, int numArguments) mutable - { - [[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args); - (void)numArguments; - AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters"); - AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe()...); - }; - - static_assert(!AZStd::is_same_v || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor"); - return FunctorOut(AZStd::move(nodeCallWrapper), allocator); - } - - template - FunctorOut CreateOut(Callable&& callable, Allocator& allocator) - { - using CallableTraits = AZStd::function_traits>; - return CreateOutWithArgs - ( AZStd::forward(callable) - , allocator - , typename CallableTraits::arg_types{} - , typename CallableTraits::template expand_args{} - , typename AZStd::is_void::type{}); - } - - } - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index c5e0d75b39..cf6bbbd31c 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -111,7 +111,6 @@ set(FILES Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPure.h Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedSingleton.h Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedUtility.h - Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h Include/ScriptCanvas/Grammar/AbstractCodeModel.h Include/ScriptCanvas/Grammar/DebugMap.h Include/ScriptCanvas/Grammar/ExecutionTraversalListeners.h diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp index 3d88f014ff..a4a5a78b7e 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp index 2c455d80f5..29e72cbd2b 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -25,92 +24,6 @@ using namespace ScriptCanvasTests; using namespace TestNodes; using namespace ScriptCanvas::Execution; -// TEST_F(ScriptCanvasTestFixture, NativeNodeableStack) -// { -// TestNodeableObject nodeable; -// nodeable.Initialize(); -// -// bool wasTrueCalled = false; -// bool wasFalseCalled = false; -// -// nodeable.SetExecutionOut -// ( AZ_CRC("BranchTrue", 0xd49f121c) -// , CreateOut -// ([&wasTrueCalled](ExecutionState&, Data::BooleanType condition, const Data::StringType& message) -// { -// EXPECT_TRUE(condition); -// EXPECT_EQ(message, AZStd::string("called the true version!")); -// wasTrueCalled = true; -// } -// , StackAllocatorType{})); -// -// nodeable.SetExecutionOut -// ( AZ_CRC("BranchFalse", 0xaceca8bc) -// , CreateOut -// ([&wasFalseCalled](ExecutionState&, Data::BooleanType condition, const Data::StringType& message, const Data::Vector3Type& vector) -// { -// EXPECT_FALSE(condition); -// EXPECT_EQ(message, AZStd::string("called the false version!")); -// EXPECT_EQ(vector, AZ::Vector3(1, 2, 3)); -// wasFalseCalled = true; -// } -// , StackAllocatorType{})); -// -// nodeable.Branch(true); -// nodeable.Branch(false); -// -// EXPECT_TRUE(wasTrueCalled); -// EXPECT_TRUE(wasFalseCalled); -// } - -// -// TEST_F(ScriptCanvasTestFixture, NativeNodeableHeap) -// { -// TestNodeableObject nodeable; -// nodeable.Initialize(); -// -// AZStd::string routedArg("XYZ"); -// AZStd::array bigArray; -// std::fill(bigArray.begin(), bigArray.end(), 0); -// -// bigArray[0] = 7; -// bigArray[2047] = 7; -// -// EXPECT_EQ(bigArray[0], 7); -// EXPECT_EQ(bigArray[2047], 7); -// -// bool isHeapCalled = false; -// -// nodeable.SetExecutionOut -// ( AZ_CRC("BranchTrue", 0xd49f121c) -// , CreateOut -// ([routedArg, &isHeapCalled, bigArray](ExecutionState&, Data::BooleanType condition, const Data::StringType& message) mutable -// { -// EXPECT_EQ(message, AZStd::string("called the true version!")); -// routedArg = message; -// isHeapCalled = true; -// EXPECT_EQ(bigArray[0], 7); -// EXPECT_EQ(bigArray[2047], 7); -// bigArray[0] = 9; -// bigArray[2047] = 9; -// EXPECT_EQ(bigArray[0], 9); -// EXPECT_EQ(bigArray[2047], 9); -// } -// , HeapAllocatorType{})); -// -// -// bigArray[0] = 8; -// bigArray[2047] = 8; -// EXPECT_EQ(bigArray[0], 8); -// EXPECT_EQ(bigArray[2047], 8); -// -// nodeable.Branch(true); -// EXPECT_TRUE(isHeapCalled); -// -// // just making sure no crash occurs on unconnected outs -// nodeable.Branch(false); -// } - class Grandparent { public: From 8f4e547b9e2b9e055a65970d777446951661b330 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:59:32 -0800 Subject: [PATCH 221/394] Removes ExecutionIterator.h and Parser.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Grammar/ExecutionIterator.h | 86 --------------- .../Include/ScriptCanvas/Grammar/Parser.h | 104 ------------------ 2 files changed, 190 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h deleted file mode 100644 index 03c6842b7c..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ExecutionIterator.h +++ /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 - * - */ - -#pragma once - -#include -#include -#include -#include - -#include "ExecutionVisitor.h" - -namespace ScriptCanvas -{ - class Graph; - class Node; - - namespace Grammar - { - /** - This is the effective lexer of the system. It properly identifies which canvas node is the next 'token' - */ - class ExecutionIterator - { - friend class ExecutionVisitor; - - public: - ExecutionIterator(); - ExecutionIterator(const Graph& graph); - ExecutionIterator(const Node& block); - - bool Begin(); - bool Begin(const Graph& graph); - bool Begin(const Node& block); - AZ_INLINE const Node* GetCurrentToken() const { return *m_current; } - const Node* operator->() const; - explicit operator bool() const; - bool operator!() const; - ExecutionIterator& operator++(); - void PrettyPrint() const; - - protected: - static const Node* FindNextStatement(const Node& current); - - void PushFunctionCall(); - void PushExpression(); - void PushStatement(); - void BuildNextStatement(); - - bool BuildQueue(const Graph& graph); - bool BuildQueue(const Node& node); - bool BuildQueue(); - - private: - // track whether we're in a expression stack - bool m_pushingExpressions = false; - // current canvas node of any type - const Node* m_currentSourceNode = nullptr; - // current executable statement that isn't just an expression - const Node* m_currentSourceStatementNode = nullptr; - // first statement in the block entry - const Node* m_currentSourceStatementRoot = nullptr; - // canvas source - const Graph* m_source = nullptr; - - NodeIdList m_sourceNodes; - // "parent-less" executable statements, or parented only to a start node - NodePtrConstList m_currentSourceInitialStatements; - // detect infinite loops - AZStd::set m_iteratedStatements; - - ExecutionVisitor m_visitor; - // final queue of iterated nodes - AZStd::vector m_queue; - // current position in the final queue - NodePtrConstList::iterator m_current = nullptr; - }; - - } // namespace Parser - -} // namepsace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h deleted file mode 100644 index f6a02e24c8..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/Parser.h +++ /dev/null @@ -1,104 +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 -#include -#include -#include - -#include "ExecutionIterator.h" -#include "ParseError.h" -#include "ParserVisitor.h" - -namespace ScriptCanvas -{ - class Graph; - class Node; - - namespace AST - { - class Block; - } - - namespace Grammar - { - NodePtrConstList FindInitialStatements(const NodeIdList& nodes); - NodePtrConstList FindInitialStatements(const Node& node); - const Node* FindNextStatement(const Node& node); - - class Parser - { - friend class ParserVisitor; - - public: - Parser(const Graph& graph); - - AZ_CLASS_ALLOCATOR(Parser, AZ::SystemAllocator, 0); - - AST::SmartPtrConst Parse(); - void ConsumeToken(); - const Node* GetToken() const; - const Graph& GetSource() const; - const NodeIdList& GetSourceNodeIDs() const; - AST::NodePtr GetTree() const; - bool IsValid() const; - void SetRoot(AST::SmartPtr&& root); - void AddChild(AST::NodePtr&& child); - - Grammar::eRule GetExpectedRule() const; - - protected: - void AddError(ParseError&& error); - void AddStatement(AST::SmartPtrConst&& statement); - void FindInitialStatements(); - void FindNextSourceNode(); - void InitializeGraphBlock(); - - AST::SmartPtrConst CreateBinaryOperator(const Node& node, Grammar::eRule operatorType, AST::SmartPtrConst&& lhs, AST::SmartPtrConst&& rhs); - AST::SmartPtrConst ParseBinaryOperation(const Node& node, Grammar::eRule operatorType); - AST::SmartPtrConst ParseExpression(const Node& node); - AST::SmartPtrConst ParseExpressionList(const Node& node); - AST::NodePtrConst ParseFunctionCall(const Node& node, const char* functionName); - AST::SmartPtrConst ParseFunctionCallAsStatement(const Node& node, const char* functionName); - AST::SmartPtrConst ParseNumeral(const Node& node); - - private: - class ExpressionScoper - { - public: - AZ_INLINE ExpressionScoper(Parser& parser) - : m_parser(parser) - { - ++m_parser.m_expressionDepth; - } - - AZ_INLINE ~ExpressionScoper() - { - --m_parser.m_expressionDepth; - } - - private: - Parser& m_parser; - }; - - friend class ExpressionScoper; - - int m_expressionDepth = 0; - Grammar::ExecutionIterator m_executionIterator; - AST::SmartPtr m_currentBlock; - AST::SmartPtr m_root; - AZStd::set m_consumedSourceNodes; - AZStd::vector m_errors; - ParserVisitor m_visitor; - }; - } // namespace Grammar - -} // namespace ScriptCanvas} From ff0a5b6c0dae3cd912881805fc5bd1bdab975ebb Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:27:54 -0800 Subject: [PATCH 222/394] Removes ComparisonFunctions.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Comparison/ComparisonFunctions.h | 387 ------------------ .../Libraries/Comparison/EqualTo.h | 2 - .../Libraries/Comparison/Greater.h | 1 - .../Libraries/Comparison/GreaterEqual.h | 2 - .../ScriptCanvas/Libraries/Comparison/Less.h | 1 - .../Libraries/Comparison/LessEqual.h | 1 - .../Libraries/Comparison/NotEqualTo.h | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 8 files changed, 396 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h deleted file mode 100644 index bd50d6c481..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h +++ /dev/null @@ -1,387 +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 - -#if defined(EXPRESSION_TEMPLATES_ENABLED) - -#include -#include - -#include -#include -#include -#include - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Comparison - { - enum class OperatorType : AZ::u32 - { - Equal, - NotEqual, - Less, - Greater, - LessEqual, - GreaterEqual - }; - - template - struct CompareAction - { - // Compares two primitive types each other - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - inline static bool CompareNumber(bool& result, OperatorType operatorType, NumberType1 leftNumber, NumberType2 rightNumber) - { - switch (operatorType) - { - case OperatorType::Equal: - result = leftNumber == rightNumber; - return true; - case OperatorType::NotEqual: - result = leftNumber != rightNumber; - return true; - case OperatorType::Less: - result = leftNumber < rightNumber; - return true; - case OperatorType::Greater: - result = leftNumber > rightNumber; - return true; - case OperatorType::LessEqual: - result = leftNumber <= rightNumber; - return true; - case OperatorType::GreaterEqual: - result = leftNumber >= rightNumber; - return true; - default: - return false; - } - } - }; - - //! Attempts to cast the second object parameter to a primitive type and compare it against the supplied primitive parameter - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - template::value>> - inline bool CompareNumberToBehaviorParameter(bool& result, OperatorType operatorType, NumberType leftNumber, AZ::BehaviorValueParameter& rhs) - { - if(CanCastToValue(rhs)) - { - NumberType convertedParam{}; - return CastToValue(convertedParam, rhs) && CompareAction::CompareNumber(result, operatorType, leftNumber, convertedParam); - } - return false; - } - - //! Attempts to cast the supplied object parameters to a primitive type and compare them - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - inline bool ComparePrimitive(bool& result, OperatorType operatorType, const Datum& lhs, const Datum& rhs) - { - auto leftParam = lhs.Get(); - auto rightParam = rhs.Get(); - if (CanCastToValue(leftParam)) - { - bool convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - double convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result,operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - float convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u64 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s64 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - unsigned long convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - long convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u32 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s32 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u16 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s16 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::u8 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - AZ::s8 convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - else if (CanCastToValue(leftParam)) - { - char convertedParam{}; - return CastToValue(convertedParam, leftParam) && CompareNumberToBehaviorParameter(result, operatorType, convertedParam, rightParam); - } - - return false; - } - - /** - For the record, this is amazing. But, we can't go dumpster diving through behavior context for the right method to call. If there is a proper evaluation to make, we make the ability for people to - expose to behavior context the correct operations they want used in ScriptCanvas. No matter which route we chose, we should do it at edit time, rather than compile time. - */ - - //! Returns a multimap of methods which match the operatorType prioritized by the by least number of type conversions needed for both parameters to invoke the method - inline AZStd::multimap FindOperatorMethod(AZ::Script::Attributes::OperatorType operatorLookupType, AZ::BehaviorValueParameter& leftParameter, AZ::BehaviorValueParameter& rightParameter) - { - AZStd::multimap methodMap; - AZ::BehaviorContext* behaviorContext{}; - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - if (!behaviorContext) - { - return methodMap; - } - - auto behaviorClassIt = behaviorContext->m_typeToClassMap.find(leftParameter.m_typeId); - if (behaviorClassIt != behaviorContext->m_typeToClassMap.end()) - { - AZ::BehaviorClass* behaviorClass = behaviorClassIt->second; - for (auto& methodPair : behaviorClass->m_methods) - { - AZ::BehaviorMethod* method = methodPair.second; - if (auto* operatorAttr = FindAttribute(AZ::Script::Attributes::Operator, method->m_attributes)) - { - // read the operator type - AZ::AttributeReader operatorAttrReader(nullptr, operatorAttr); - AZ::Script::Attributes::OperatorType operatorType; - operatorAttrReader.Read(operatorType); - - if (operatorType == operatorLookupType - && method->HasResult() && method->GetResult()->m_typeId == azrtti_typeid() && method->GetNumArguments() == 2) - { - if (behaviorClass->m_typeId == method->GetArgument(0)->m_typeId && rightParameter.m_typeId == method->GetArgument(1)->m_typeId) - { - methodMap.emplace(0, method); - } - else if (behaviorClass->m_typeId == method->GetArgument(0)->m_typeId && rightParameter.m_azRtti && rightParameter.m_azRtti->IsTypeOf(method->GetArgument(1)->m_typeId)) - { - methodMap.emplace(1, method); - } - else if (behaviorClass->m_azRtti && behaviorClass->m_azRtti->IsTypeOf(method->GetArgument(0)->m_typeId) && rightParameter.m_typeId == method->GetArgument(1)->m_typeId) - { - methodMap.emplace(1, method); - } - else if (behaviorClass->m_azRtti && behaviorClass->m_azRtti->IsTypeOf(method->GetArgument(0)->m_typeId) && rightParameter.m_azRtti && rightParameter.m_azRtti->IsTypeOf(method->GetArgument(1)->m_typeId)) - { - methodMap.emplace(2, method); - } - } - } - } - } - - return methodMap; - } - - inline bool InvokeMethod(AZ::BehaviorMethod* method, AZ::BehaviorValueParameter& resultParam, AZStd::array, 2> parameters) - { - AZStd::array argAddresses; - AZStd::array methodArgs; - for (size_t i = 0; i < methodArgs.size(); ++i) - { - methodArgs[i].Set(*method->GetArgument(i)); - argAddresses[i] = parameters[i].get().GetValueAddress(); - if (methodArgs[i].m_traits & AZ::BehaviorParameter::TR_POINTER) - { - methodArgs[i].m_value = &argAddresses[i]; - } - else - { - methodArgs[i].m_value = argAddresses[i]; - } - } - - return method->Call(methodArgs.data(), static_cast(methodArgs.size()), &resultParam); - } - - //! Compares two object types to each other - //! \return true if a comparison occurred between both types and stores the result of the comparison in the @result parameter - inline bool CompareObjects(bool& result, OperatorType operatorType, const Datum& lhs, const Datum& rhs) - { - auto leftParameter = lhs.Get(); - auto rightParameter = rhs.Get(); - AZ::BehaviorValueParameter resultParameter(&result); - AZStd::multimap methodMap{}; - switch (operatorType) - { - case OperatorType::Equal: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter)} })) - { - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, rightParameter, leftParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - return true; - } - } - } - break; - case OperatorType::NotEqual: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - result = !result; - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::Equal, rightParameter, leftParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - result = !result; - return true; - } - } - } - break; - - case OperatorType::Less: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - return true; - } - } - break; - case OperatorType::Greater: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - return true; - } - } - break; - case OperatorType::LessEqual: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessEqualThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - result = !result; - return true; - } - } - } - break; - case OperatorType::GreaterEqual: - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessEqualThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(rightParameter), AZStd::reference_wrapper(leftParameter) } })) - { - return true; - } - } - else - { - methodMap = FindOperatorMethod(AZ::Script::Attributes::OperatorType::LessThan, leftParameter, rightParameter); - if (!methodMap.empty()) - { - if (InvokeMethod(methodMap.begin()->second, resultParameter, { { AZStd::reference_wrapper(leftParameter), AZStd::reference_wrapper(rightParameter) } })) - { - result = !result; - return true; - } - } - } - break; - default: - break; - } - return false; - } - - template - struct ComparisonOperator - { - bool operator()(const Datum& lhs, const Datum& rhs) const - { - - // If both types sides are primitive types then perform a special case primitive value compare - bool result{}; - if (ComparePrimitive(result, operatorType, lhs, rhs) || CompareObjects(result, operatorType, lhs, rhs)) - { - return result; - } - - return false; - } - - }; - } - } -} - -#endif // EXPRESSION_TEMPLATES_ENABLED diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h index b2ef525880..9223248c77 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/EqualTo.h @@ -8,10 +8,8 @@ #pragma once -#include "ComparisonFunctions.h" #include - namespace ScriptCanvas { namespace Nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h index da3765c7fc..8465d79be1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Greater.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h index 70d9b073d7..2ee7afe3b4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/GreaterEqual.h @@ -8,8 +8,6 @@ #pragma once - -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h index f96dd12d0d..b4fd2810d8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/Less.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h index a0459e6fe0..7f0fe9b9ce 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/LessEqual.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h index be47c49e6d..fa2525b94f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h @@ -8,7 +8,6 @@ #pragma once -#include "ComparisonFunctions.h" #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index cf6bbbd31c..2bfa9c74e3 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -230,7 +230,6 @@ set(FILES Include/ScriptCanvas/Libraries/Math/Vector3Nodes.h Include/ScriptCanvas/Libraries/Math/Vector4Nodes.h Include/ScriptCanvas/Libraries/Comparison/Comparison.h - Include/ScriptCanvas/Libraries/Comparison/ComparisonFunctions.h Include/ScriptCanvas/Libraries/Comparison/EqualTo.h Include/ScriptCanvas/Libraries/Comparison/NotEqualTo.h Include/ScriptCanvas/Libraries/Comparison/Less.h From 7cefe2b6c272dcd880077f353c9dd4bd4d6af7c6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:31:26 -0800 Subject: [PATCH 223/394] Removes FunctionBus.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Libraries/Core/FunctionBus.h | 51 ------------------- .../Libraries/Core/FunctionDefinitionNode.cpp | 1 - .../ScriptCanvas/Libraries/Core/Nodeling.cpp | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 4 files changed, 54 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h deleted file mode 100644 index 5e89cf4d15..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionBus.h +++ /dev/null @@ -1,51 +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 - -#include - -namespace ScriptCanvas -{ - class FunctionRequests : public AZ::EBusTraits - { - public: - using BusIdType = AZ::EntityId; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - - virtual void OnSignalOut(ID, SlotId) = 0; - }; - - using FunctionRequestBus = AZ::EBus; - - class FunctionNodeNotifications : public AZ::EBusTraits - { - public: - using BusIdType = GraphScopedNodeId; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - - virtual void OnNameChanged() = 0; - }; - - using FunctionNodeNotificationBus = AZ::EBus; - - class FunctionNodeRequests : public AZ::EBusTraits - { - public: - using BusIdType = GraphScopedNodeId; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - - virtual AZStd::string GetName() const = 0; - }; - - using FunctionNodeRequestBus = AZ::EBus; -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp index 542fc2f0c1..35e17f15ed 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp index 56d346b67e..64eef40a0f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Nodeling.cpp @@ -14,7 +14,6 @@ #include #include -#include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 2bfa9c74e3..68fb0e2e67 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -146,7 +146,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/EventHandlerTranslationUtility.h Include/ScriptCanvas/Libraries/Core/ForEach.h Include/ScriptCanvas/Libraries/Core/ForEach.ScriptCanvasGrammar.xml - Include/ScriptCanvas/Libraries/Core/FunctionBus.h Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h Include/ScriptCanvas/Libraries/Core/FunctionCallNode.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.h From b292f62a446defe5993693c764c83089aa76b719 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:42:12 -0800 Subject: [PATCH 224/394] Removes MethodUtility.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptCanvas/Core/NodeableNode.cpp | 1 - .../Core/NodeableNodeOverloaded.cpp | 1 - .../Core/SubgraphInterfaceUtility.cpp | 1 - .../Internal/Nodes/BaseTimerNode.cpp | 2 - .../Libraries/Core/ExtractProperty.cpp | 1 - .../ScriptCanvas/Libraries/Core/ForEach.cpp | 2 - .../Libraries/Core/FunctionCallNode.cpp | 1 - .../Libraries/Core/GetVariable.cpp | 1 - .../ScriptCanvas/Libraries/Core/Method.cpp | 1 - .../Libraries/Core/MethodOverloaded.cpp | 1 - .../Libraries/Core/MethodUtility.cpp | 87 ------------------- .../Libraries/Core/MethodUtility.h | 28 ------ .../ScriptCanvas/Libraries/Core/Repeater.cpp | 1 - .../Libraries/Core/SendScriptEvent.cpp | 1 - .../Libraries/Core/SetVariable.cpp | 3 +- .../Operators/Containers/OperatorAt.cpp | 1 - .../Operators/Containers/OperatorBack.cpp | 1 - .../Operators/Containers/OperatorClear.cpp | 1 - .../Operators/Containers/OperatorEmpty.cpp | 1 - .../Operators/Containers/OperatorErase.cpp | 1 - .../Operators/Containers/OperatorFront.cpp | 1 - .../Operators/Containers/OperatorInsert.cpp | 1 - .../Operators/Containers/OperatorPushBack.cpp | 1 - .../Operators/Containers/OperatorSize.cpp | 1 - .../Libraries/Operators/Math/OperatorAdd.cpp | 1 - .../Operators/Math/OperatorArithmetic.cpp | 1 - .../Libraries/Operators/Math/OperatorDiv.cpp | 1 - .../Operators/Math/OperatorDivideByNumber.cpp | 1 - .../Operators/Math/OperatorLength.cpp | 1 - .../Libraries/Operators/Math/OperatorMul.cpp | 1 - .../Libraries/Operators/Math/OperatorSub.cpp | 1 - .../Libraries/Operators/Operator.cpp | 2 - .../Code/scriptcanvasgem_common_files.cmake | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 34 files changed, 2 insertions(+), 150 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp index 28b7b05cda..323448f57c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNode.cpp @@ -14,7 +14,6 @@ #include #include #include -#include namespace NodeableNodeCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp index 58af3a75de..1c77836fff 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/NodeableNodeOverloaded.cpp @@ -14,7 +14,6 @@ #include #include #include -#include namespace NodeableNodeOverloadedCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp index 74a41eb2c6..a9f80b784b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp @@ -9,7 +9,6 @@ #include "SubgraphInterfaceUtility.h" #include -#include namespace SubgraphInterfaceUtilityCpp { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp index 912251ce45..4d72bac561 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/BaseTimerNode.cpp @@ -7,8 +7,6 @@ */ #include -#include - namespace ScriptCanvas { namespace Nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp index 71e2d338d6..47519773ab 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ExtractProperty.cpp @@ -7,7 +7,6 @@ */ #include -#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp index 97e41d6a53..43af6fa508 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp @@ -9,8 +9,6 @@ #include #include -#include - namespace ScriptCanvas { namespace Nodes diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp index 551b9b4002..94a04f4f59 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index c907c47c78..f88fb03726 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -8,7 +8,6 @@ #include "GetVariable.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp index ccdf15a111..e00c99b93e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp index f49fcb3318..96c2fbf3e7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp deleted file mode 100644 index 0ddd161847..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp +++ /dev/null @@ -1,87 +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 - -namespace ScriptCanvas -{ - AZStd::unordered_map GetTupleGetMethodsFromResult(const AZ::BehaviorMethod& method) - { - if (method.HasResult()) - { - if (const AZ::BehaviorParameter* result = method.GetResult()) - { - return GetTupleGetMethods(result->m_typeId); - } - } - - return {}; - } - - AZStd::unordered_map GetTupleGetMethods(const AZ::TypeId& typeId) - { - AZStd::unordered_map tupleGetMethodMap; - - AZ::BehaviorContext* behaviorContext{}; - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - auto bcClassIterator = behaviorContext->m_typeToClassMap.find(typeId); - const AZ::BehaviorClass* behaviorClass = bcClassIterator != behaviorContext->m_typeToClassMap.end() ? bcClassIterator->second : nullptr; - - if (behaviorClass) - { - for (auto& methodPair : behaviorClass->m_methods) - { - const AZ::BehaviorMethod* behaviorMethod = methodPair.second; - if (AZ::Attribute* attribute = FindAttribute(AZ::ScriptCanvasAttributes::TupleGetFunctionIndex, behaviorMethod->m_attributes)) - { - AZ::AttributeReader tupleGetFuncAttrReader(nullptr, attribute); - int tupleGetFuncIndex = -1; - if (tupleGetFuncAttrReader.Read(tupleGetFuncIndex)) - { - [[maybe_unused]] auto insertIter = tupleGetMethodMap.emplace(tupleGetFuncIndex, behaviorMethod); - AZ_Error("Script Canvas", insertIter.second, "Multiple methods with the same TupleGetFunctionIndex attribute" - "has been registered for the class name: %s with typeid: %s", - behaviorClass->m_name.data(), behaviorClass->m_typeId.ToString().data()) - } - } - } - } - - return tupleGetMethodMap; - } - - AZ::Outcome GetTupleGetMethod(const AZ::TypeId& typeId, size_t index) - { - const AZ::BehaviorContext* behaviorContext{}; - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - auto bcClassIterator = behaviorContext->m_typeToClassMap.find(typeId); - const AZ::BehaviorClass* behaviorClass = bcClassIterator != behaviorContext->m_typeToClassMap.end() ? bcClassIterator->second : nullptr; - - if (behaviorClass) - { - for (auto methodPair : behaviorClass->m_methods) - { - const AZ::BehaviorMethod* behaviorMethod = methodPair.second; - if (AZ::Attribute* attribute = FindAttribute(AZ::ScriptCanvasAttributes::TupleGetFunctionIndex, behaviorMethod->m_attributes)) - { - AZ::AttributeReader tupleGetFuncAttrReader(nullptr, attribute); - int tupleGetFuncIndex = -1; - if (tupleGetFuncAttrReader.Read(tupleGetFuncIndex) && index == tupleGetFuncIndex) - { - return AZ::Success(behaviorMethod); - } - } - } - } - - return AZ::Failure(); - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h deleted file mode 100644 index 33175b4363..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodUtility.h +++ /dev/null @@ -1,28 +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 -#include -#include - -namespace ScriptCanvas::Grammar -{ - struct FunctionPrototype; -} - -namespace ScriptCanvas -{ - AZStd::unordered_map GetTupleGetMethodsFromResult(const AZ::BehaviorMethod& method); - - AZStd::unordered_map GetTupleGetMethods(const AZ::TypeId& typeId); - - AZ::Outcome GetTupleGetMethod(const AZ::TypeId& typeID, size_t index); -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp index 5fa71e96c6..6a253dbe0b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Repeater.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp index 26a9b4fc96..e99bb721d9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SendScriptEvent.cpp @@ -11,7 +11,6 @@ #include #include -#include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp index 8c53b0d1b4..1e16de7762 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/SetVariable.cpp @@ -8,8 +8,9 @@ #include "SetVariable.h" +#include + #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp index e44fd0b1f1..614c2eb116 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorAt.cpp @@ -9,7 +9,6 @@ #include "OperatorAt.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp index 66d33d4c8f..82fe82a960 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorBack.cpp @@ -9,7 +9,6 @@ #include "OperatorBack.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp index c75b046aa3..5140845ec6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorClear.cpp @@ -9,7 +9,6 @@ #include "OperatorClear.h" #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp index 679fbec076..1be67c7773 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorEmpty.cpp @@ -7,7 +7,6 @@ */ #include "OperatorEmpty.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp index ebb7a8233a..941dcea024 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorErase.cpp @@ -9,7 +9,6 @@ #include "OperatorErase.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp index d83711adbe..6f010721d3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorFront.cpp @@ -9,7 +9,6 @@ #include "OperatorFront.h" #include -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp index 7374b3442f..889c2d4b98 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorInsert.cpp @@ -7,7 +7,6 @@ */ #include "OperatorInsert.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp index 5793d06aec..d5cbf7b36e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorPushBack.cpp @@ -7,7 +7,6 @@ */ #include "OperatorPushBack.h" -#include #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp index 072d3b87ed..e7313c6f39 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Containers/OperatorSize.cpp @@ -7,7 +7,6 @@ */ #include "OperatorSize.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp index 15727ac5ba..f50c3f3565 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorAdd.cpp @@ -7,7 +7,6 @@ */ #include "OperatorAdd.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp index eb3e352211..5fd6bb1edb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorArithmetic.cpp @@ -7,7 +7,6 @@ */ #include "OperatorArithmetic.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp index 6890cb66ed..046b1d7ed6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDiv.cpp @@ -7,7 +7,6 @@ */ #include "OperatorDiv.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp index db7ff3722b..665b6e5e0f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorDivideByNumber.cpp @@ -7,7 +7,6 @@ */ #include "OperatorDivideByNumber.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp index 83720f47c1..648cfa72a2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorLength.cpp @@ -7,7 +7,6 @@ */ #include "OperatorLength.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp index 06ccb617ff..2488644871 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp @@ -7,7 +7,6 @@ */ #include "OperatorMul.h" -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp index 21b38fc553..cec4c64216 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorSub.cpp @@ -7,7 +7,6 @@ */ #include "OperatorSub.h" -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp index 3d31096f12..cd82263b28 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp @@ -14,8 +14,6 @@ #include #include -#include - #include namespace ScriptCanvas diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 1301883453..6df2f80339 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -105,7 +105,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/GetVariable.cpp Include/ScriptCanvas/Libraries/Core/Method.cpp Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp - Include/ScriptCanvas/Libraries/Core/MethodUtility.cpp Include/ScriptCanvas/Libraries/Core/Nodeling.cpp Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.cpp Include/ScriptCanvas/Libraries/Core/Repeater.cpp diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 68fb0e2e67..a22fb370c0 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -155,7 +155,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/GetVariable.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/Method.h Include/ScriptCanvas/Libraries/Core/MethodOverloaded.h - Include/ScriptCanvas/Libraries/Core/MethodUtility.h Include/ScriptCanvas/Libraries/Core/Nodeling.h Include/ScriptCanvas/Libraries/Core/Nodeling.ScriptCanvasGrammar.xml Include/ScriptCanvas/Libraries/Core/ReceiveScriptEvent.h From 0344e8bf1d197e528b92afe4ffdc27cbe4128940 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:50:26 -0800 Subject: [PATCH 225/394] Removes FindTaggedEntities.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/Entity/FindTaggedEntities.cpp | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp deleted file mode 100644 index ab5d0f775d..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/FindTaggedEntities.cpp +++ /dev/null @@ -1,27 +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 - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Entity - { - void FindTaggedEntities::OnInputSignal(const SlotId&) - { - AZ::Crc32 tagEntity = WhenEntityActiveProperty::GetCrc32(this); - } - } - } -} - -#include From f4a3867b7dc863359f26e2e1f93970a18f7110bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:51:57 -0800 Subject: [PATCH 226/394] Removes BinaryOperation.h/cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/Math/BinaryOperation.cpp | 137 ------------------ .../Libraries/Math/BinaryOperation.h | 46 ------ 2 files changed, 183 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp deleted file mode 100644 index 68621799f1..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.cpp +++ /dev/null @@ -1,137 +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 "BinaryOperation.h" - -namespace ScriptCanvas -{ - namespace Nodes - { - namespace Math - { - void Sum::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(2) - ->Field("A", &Sum::m_a) - ->Field("B", &Sum::m_b) - ; - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("Sum", "Performs the sum between two numbers.") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/ScriptCanvas/Sum.png") - ; - } - - } - - AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); - if (behaviorContext) - { - behaviorContext->Class("Sum") - ->Method("In", &Sum::OnInputSignal) - ->Attribute(ScriptCanvas::Attributes::Input, true) - ->Method("Out", &Sum::SignalOutput) - ->Attribute(ScriptCanvas::Attributes::Output, true) - ->Property("A", BehaviorValueProperty(&Sum::m_a)) - ->Property("B", BehaviorValueProperty(&Sum::m_b)) - ->Property("This", BehaviorValueProperty(&Sum::m_sum)) - ; - } - } - - Sum::Sum() - : Number() - {} - - Sum::~Sum() - {} - - void Sum::OnEntry() - { - m_status = ExecutionStatus::Immediate; - m_executionMode = ExecutionStatus::Immediate; - } - - void Sum::OnInputSignal(const SlotID& slot) - { - //static const SlotID& inSlot = SlotID("In"); - - //if (slot == inSlot) - //{ - // Types::Value* result = nullptr; - - // if (auto value = azdynamic_cast(Evaluate(SlotID("This")))) - // { - // m_value = value->Get(); - // } - //} - } - - void Sum::OnExecute(double deltaTime) - { - if (m_status != ExecutionStatus::NotStarted) - { - EvaluateSlot(SlotID("GetThis")); - SignalOutput(SlotID("Out")); - } - } - - AZ::BehaviorValueParameter Sum::EvaluateSlot(const ScriptCanvas::SlotID& slotId) - { - ScriptCanvas::Slot* slot = GetSlot(slotId); - if (slot) - { - if (slot->GetType() == ScriptCanvas::SlotType::Setter) - { - if (!slot->GetConnectionList().empty()) - { - auto connection = slot->GetConnectionList()[0]; - - // Evaluate the node connected to this slot, we'll set our value according to it. - AZ::BehaviorValueParameter parameter; - ScriptCanvas::NodeServiceRequestBus::EventResult(parameter, connection.GetNodeId(), &NodeServiceRequests::EvaluateSlot, connection.GetSlotId()); - return slot->GetProperty() ? ScriptCanvas::SafeSet(parameter, slot->GetProperty()->m_setter, this) : parameter; - } - } - else if (slot->GetType() == ScriptCanvas::SlotType::Getter) - { - static const ScriptCanvas::SlotID aSlot("SetA"); - static const ScriptCanvas::SlotID bSlot("SetB"); - - // Evaluating each slot will invoke its setter which, if there is a connection it will get evaluate and - // return the connected value, otherwise we'll use the default value of the property. - EvaluateSlot(aSlot); - EvaluateSlot(bSlot); - - // Both m_a and m_b have been resolved so we'll do the sum and return it. - m_sum = m_a.Get() + m_b.Get(); - - return AZ::BehaviorValueParameter(&m_sum); - } - } - - // There was no connection to invoke a setter - return AZ::BehaviorValueParameter(); - } - - Types::Value* Sum::Evaluate(const SlotID& slot) - { - AZ_Assert(false, "Deprecated"); - return nullptr; - } - } - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h deleted file mode 100644 index 48e63f93d4..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/BinaryOperation.h +++ /dev/null @@ -1,46 +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 - -namespace ScriptCanvas -{ - class NodeVisitor; - - namespace Nodes - { - class BinaryOperation - : public Number - { - public: - - AZ_COMPONENT(BinaryOperation, "{04798FF9-50EE-487E-9433-B2C4F0FE4D37}", Node); - - static void Reflect(AZ::ReflectContext* reflection); - - BinaryOperation(); - ~BinaryOperation() override; - - void OnInputSignal(const SlotID& slot) override; - Types::Value* Evaluate(const SlotID& slot) override; - - AZ::BehaviorValueParameter EvaluateSlot(const ScriptCanvas::SlotID&) override; - - void Visit(NodeVisitor& visitor) const override { visitor.Visit(*this); } - - protected: - - Types::ValueFloat m_a; - Types::ValueFloat m_b; - Types::ValueFloat m_sum; - - }; - } -} From 0b8859b24607175bedb17ead726a976f96e6bdd2 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:02:22 -0800 Subject: [PATCH 227/394] Removes Format.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Include/ScriptCanvas/Libraries/String/Format.cpp | 9 --------- .../ScriptCanvas/Code/scriptcanvasgem_common_files.cmake | 1 - 2 files changed, 10 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp deleted file mode 100644 index f541bbacbe..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/String/Format.cpp +++ /dev/null @@ -1,9 +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 "Format.h" diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 6df2f80339..b3e1e05cc5 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -144,7 +144,6 @@ set(FILES Include/ScriptCanvas/Libraries/Spawning/Spawning.cpp Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.cpp Include/ScriptCanvas/Libraries/String/Contains.cpp - Include/ScriptCanvas/Libraries/String/Format.cpp Include/ScriptCanvas/Libraries/String/Replace.cpp Include/ScriptCanvas/Libraries/String/String.cpp Include/ScriptCanvas/Libraries/String/StringMethods.cpp From d9dbd439d417835edfc72177bae24f64fe3baa90 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:52:25 -0800 Subject: [PATCH 228/394] Removes CountdownNodeable.cpp/h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/Time/CountdownNodeable.cpp | 90 ------------------- .../Libraries/Time/CountdownNodeable.h | 75 ---------------- 2 files changed, 165 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp deleted file mode 100644 index 24544abac7..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.cpp +++ /dev/null @@ -1,90 +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 "CountdownNodeable.h" -#include -#include - -namespace ScriptCanvas -{ - namespace Nodeables - { - namespace Time - { - CountdownNodeable::~CountdownNodeable() - { - AZ::TickBus::Handler::BusDisconnect(); - } - - void CountdownNodeable::InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime) - { - if (reset || !AZ::TickBus::Handler::BusIsConnected()) - { - // If we're resetting, we need to disconnect. - AZ::TickBus::Handler::BusDisconnect(); - - m_countdownSeconds = countdownSeconds; - m_looping = looping; - m_holdTime = holdTime; - - m_currentTime = m_countdownSeconds; - - AZ::TickBus::Handler::BusConnect(); - } - } - - void CountdownNodeable::OnDeactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - } - - void CountdownNodeable::OnTick(float deltaTime, AZ::ScriptTimePoint time) - { - if (m_currentTime <= 0.f) - { - if (m_holding) - { - m_holding = false; - m_currentTime = m_countdownSeconds; - m_elapsedTime = 0.f; - return; - } - - if (!m_looping) - { - AZ::TickBus::Handler::BusDisconnect(); - } - else - { - m_holding = m_holdTime > 0.f; - m_currentTime = m_holding ? m_holdTime : m_countdownSeconds; - } - - ExecutionOut(AZ_CRC("Done", 0x102de0ab), m_elapsedTime); - } - else - { - m_currentTime -= static_cast(deltaTime); - m_elapsedTime = m_holding ? 0.f : m_countdownSeconds - m_currentTime; - } - } - - void CountdownNodeable::Reset(float countdownSeconds, Data::BooleanType looping, float holdTime) - { - InitiateCountdown(true, countdownSeconds, looping, holdTime); - } - - void CountdownNodeable::Start(float countdownSeconds, Data::BooleanType looping, float holdTime) - { - InitiateCountdown(false, countdownSeconds, looping, holdTime); - } - } - } -} - -#include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h deleted file mode 100644 index 98e9356b18..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/CountdownNodeable.h +++ /dev/null @@ -1,75 +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 -#include -#include - -#include - -namespace ScriptCanvas -{ - namespace Nodeables - { - namespace Time - { - class CountdownNodeable - : public ScriptCanvas::Nodeable - , public AZ::TickBus::Handler - { - NodeDefinition(CountdownNodeable, "Delay", "Counts down time from a specified value.", - NodeTags::Category("Timing"), - NodeTags::Version(0) - ); - - public: - virtual ~CountdownNodeable(); - - InputMethod("Start", "When signaled, execution is delayed at this node according to the specified properties.", - SlotTags::Contracts({ DisallowReentrantExecutionContract })) - void Start(float countdownSeconds, Data::BooleanType looping, float holdTime); - - DataInput(float, "Start: Time", 0.0f, "", SlotTags::DisplayGroup("Start")); - DataInput(Data::BooleanType, "Start: Loop", false, "", SlotTags::DisplayGroup("Start")); - DataInput(float, "Start: Hold", 0.0f, "", SlotTags::DisplayGroup("Start")); - - InputMethod("Reset", "When signaled, execution is delayed at this node according to the specified properties.", - SlotTags::Contracts({ DisallowReentrantExecutionContract })) - void Reset(float countdownSeconds, Data::BooleanType looping, float holdTime); - - DataInput(float, "Reset: Time", 0.0f, "", SlotTags::DisplayGroup("Reset")); - DataInput(Data::BooleanType, "Reset: Loop", false, "", SlotTags::DisplayGroup("Reset")); - DataInput(float, "Reset: Hold", 0.0f, "", SlotTags::DisplayGroup("Reset")); - - ExecutionLatentOutput("Done", "Signaled when the delay reaches zero."); - DataOutput(float, "Elapsed", 0.0f, "The amount of time that has elapsed since the delay began.", - SlotTags::DisplayGroup("Done")); - - protected: - void OnDeactivate() override; - - // TickBus - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - - private: - void InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime); - - float m_countdownSeconds = 0.0f; - bool m_looping = false; - float m_holdTime = 0.0f; - float m_elapsedTime = 0.0f; - bool m_holding = false; - float m_currentTime = 0.0f; - }; - } - } -} From e0a12e740c622ef97028709ed56f161c062399ae Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:55:39 -0800 Subject: [PATCH 229/394] Removes AddFailure.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/UnitTesting/AddFailure.cpp | 12 ------------ .../Code/scriptcanvasgem_common_files.cmake | 1 - 2 files changed, 13 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp deleted file mode 100644 index d8a61ba076..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp +++ /dev/null @@ -1,12 +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 "AddFailure.h" - -#include "UnitTestBus.h" - diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index b3e1e05cc5..9569422e0f 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -148,7 +148,6 @@ set(FILES Include/ScriptCanvas/Libraries/String/String.cpp Include/ScriptCanvas/Libraries/String/StringMethods.cpp Include/ScriptCanvas/Libraries/String/Utilities.cpp - Include/ScriptCanvas/Libraries/UnitTesting/AddFailure.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectFalse.cpp Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp From a2479259c99490820dd88795aa9507c4f342777b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:56:21 -0800 Subject: [PATCH 230/394] Removes UnitTestBus.cpp from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/UnitTesting/UnitTestBus.cpp | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp deleted file mode 100644 index addbb96494..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBus.cpp +++ /dev/null @@ -1,23 +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 "UnitTestBus.h" - -#include -#include -#include - -namespace ScriptCanvas -{ - namespace UnitTesting - { - - - } // namespace UnitTest - -} // namespace ScriptCanvas From 14952b6c34b2e638e23de5082e11f61a42ccabc0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:02:02 -0800 Subject: [PATCH 231/394] Removes UnitTestBusSenderMacros.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Libraries/UnitTesting/ExpectEqual.cpp | 1 - .../UnitTesting/ExpectGreaterThan.cpp | 1 - .../UnitTesting/ExpectGreaterThanEqual.cpp | 1 - .../Libraries/UnitTesting/ExpectLessThan.cpp | 1 - .../UnitTesting/ExpectLessThanEqual.cpp | 1 - .../Libraries/UnitTesting/ExpectNotEqual.cpp | 1 - .../Libraries/UnitTesting/UnitTestBusSender.h | 1 - .../UnitTesting/UnitTestBusSenderMacros.h | 75 ------------------- .../Code/scriptcanvasgem_headers.cmake | 1 - 9 files changed, 83 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp index fa6b5e35b0..96717274f5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp index deb92f0bf9..dc1d9cd5c7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThan.cpp @@ -9,7 +9,6 @@ #include "ExpectGreaterThan.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp index ad14591a07..a4a8677bcd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectGreaterThanEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectGreaterThanEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp index 1e7047d6e0..48a7621eb6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThan.cpp @@ -9,7 +9,6 @@ #include "ExpectLessThan.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp index b69f3235e5..a04a9ae211 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectLessThanEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectLessThanEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp index acf5e0e3cc..95ab9059c8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/ExpectNotEqual.cpp @@ -9,7 +9,6 @@ #include "ExpectNotEqual.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h index 00f3453394..59dd432961 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h @@ -11,7 +11,6 @@ #include "UnitTesting.h" #include "UnitTestBus.h" -#include "UnitTestBusSenderMacros.h" namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h deleted file mode 100644 index 5ff6e2216e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h +++ /dev/null @@ -1,75 +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 - -#define SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(OVERLOAD, NAME, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, AABB, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Boolean, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, CRC, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Color, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, EntityID, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Matrix3x3, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Matrix4x4, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Number, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, OBB, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Plane, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Quaternion, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, String, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Transform, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Vector2, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Vector3, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Vector4, PARAM0, PARAM1, PARAM2) - -#define SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(OVERLOAD, NAME, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, Number, PARAM0, PARAM1, PARAM2)\ - OVERLOAD(NAME, String, PARAM0, PARAM1, PARAM2) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_DECLARATION(NAME, TYPE, PARAM0, PARAM1, PARAM2)\ - static void NAME(const AZ::EntityId& graphUniqueId, const Data::TYPE##Type candidate, const Data::TYPE##Type reference, const Report& report); - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_IMPLEMENTATION(NAME, TYPE, PARAM0, PARAM1, PARAM2)\ - void EventSender::NAME(const AZ::EntityId& graphUniqueId, const Data::TYPE##Type candidate, const Data::TYPE##Type reference, const Report& report)\ - {\ - void(BusTraits::* f)(const Data::##TYPE##Type, const Data::##TYPE##Type, const Report&) = &BusTraits::##NAME;\ - Bus::Event(graphUniqueId, f, candidate, reference, report);\ - } - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_REFLECTION(NAME, TYPE, LOOK_UP, OPERATOR, PARAM2)\ - builder->Method(LOOK_UP, static_cast(&EventSender::##NAME), { { {"", "", behaviorContext->MakeDefaultValue(UniqueId)}, {"Candidate", "left of " OPERATOR}, {"Reference", "right of " OPERATOR}, {"Report", "additional notes for the test report"} } }) ;\ - builder->Attribute(AZ::ScriptCanvasAttributes::HiddenParameterIndex, uniqueIdIndex); - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_EQUALITY_OVERLOAD_DECLARATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_DECLARATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_EQUALITY_OVERLOAD_IMPLEMENTATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_IMPLEMENTATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_EQUALITY_OVERLOAD_REFLECTIONS(NAME, LOOK_UP, OPERATOR)\ - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_REFLECTION, NAME, LOOK_UP, OPERATOR, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_COMPARE_OVERLOAD_DECLARATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_DECLARATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_COMPARE_OVERLOAD_IMPLEMENTATIONS(NAME)\ - SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_IMPLEMENTATION, NAME, unused, unused, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_SENDER_COMPARE_OVERLOAD_REFLECTIONS(NAME, LOOK_UP, OPERATOR)\ - SCRIPT_CANVAS_UNIT_TEST_COMPARE_TYPES(SCRIPT_CANVAS_UNIT_TEST_SENDER_OVERLOAD_REFLECTION, NAME, LOOK_UP, OPERATOR, unused) - -#define SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_IMPLEMENTATION(NAME, TYPE, PARAM0, PARAM1, PARAM2)\ - case Data::eType::##TYPE##:\ - {\ - void(ScriptCanvas::UnitTesting::BusTraits::* f)(const Data::##TYPE##Type, const Data::##TYPE##Type, const ScriptCanvas::UnitTesting::Report&) = &ScriptCanvas::UnitTesting::BusTraits::##NAME##;\ - ScriptCanvas::UnitTesting::Bus::Event(GetOwningScriptCanvasId(), f, *lhs->GetAs(), *rhs->GetAs(), *report);\ - }\ - break; - -#define SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_EQUALITY_IMPLEMENTATIONS(NAME) case Data::eType::Number: break; default: break; - -#define SCRIPT_CANVAS_UNIT_TEST_LEGACY_NODE_COMPARE_IMPLEMENTATIONS(NAME) case Data::eType::Number: break; default: break; diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index a22fb370c0..9ccd352929 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -300,7 +300,6 @@ set(FILES Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h - Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSenderMacros.h Include/ScriptCanvas/Libraries/Operators/Operators.h Include/ScriptCanvas/Libraries/Operators/Operator.h Include/ScriptCanvas/Libraries/Operators/Operator.ScriptCanvasGrammar.xml From faa44260c6c8a2f4d9e559363168e7d89c099e15 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:09:10 -0800 Subject: [PATCH 232/394] Removes AuxiliaryGenerics.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../UnitTesting/Auxiliary/AuxiliaryGenerics.h | 40 ------------------- .../Code/scriptcanvasgem_headers.cmake | 1 - 2 files changed, 41 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h deleted file mode 100644 index cdbed97807..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h +++ /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 - * - */ - -#pragma once - -#include - -namespace ScriptCanvas -{ - namespace UnitTesting - { - namespace Auxiliary - { - AZ_INLINE AZStd::vector FillWithOrdinals(Data::NumberType count) - { - AZStd::vector ordinals; - ordinals.reserve(aznumeric_caster(count)); - - for (float ordinal = 1.f; ordinal <= count; ++ordinal) - { - ordinals.push_back(ordinal); - } - - return ordinals; - } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FillWithOrdinals, "UnitTesting/Auxiliary", "{D135E6C2-DDAE-494F-B13B-F214D3E0BC20}", "", "Count"); - - using Registrar = RegistrarGeneric - < FillWithOrdinalsNode - > ; - - - } - } -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 9ccd352929..1c32c743d6 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -298,7 +298,6 @@ set(FILES Include/ScriptCanvas/Libraries/UnitTesting/UnitTesting.h Include/ScriptCanvas/Libraries/UnitTesting/UnitTestingLibrary.h Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/Auxiliary.h - Include/ScriptCanvas/Libraries/UnitTesting/Auxiliary/AuxiliaryGenerics.h Include/ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h Include/ScriptCanvas/Libraries/Operators/Operators.h Include/ScriptCanvas/Libraries/Operators/Operator.h From b571e0c03168e193d66bd165164626d67f4659af Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:11:22 -0800 Subject: [PATCH 233/394] Removes AbstractModelTranslator.h from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Translation/AbstractModelTranslator.h | 34 ------------------- .../Code/scriptcanvasgem_headers.cmake | 1 - 2 files changed, 35 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h deleted file mode 100644 index dc7c3852d3..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/AbstractModelTranslator.h +++ /dev/null @@ -1,34 +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 - -namespace ScriptCanvas -{ - class Graph; - - namespace Grammar - { - class AbstractCodeModel; - } - - namespace Translation - { - // move the shared functionality here\ - - // avoid virtual calls with a virtual function call - // that defines characters for single line comment - // block comment open/close, etc - // function delcarations, etc - // scope resolution - - } - -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 1c32c743d6..72c49cb272 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -54,7 +54,6 @@ set(FILES Include/ScriptCanvas/Core/SlotNames.h Include/ScriptCanvas/Core/SubgraphInterface.h Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h - Include/ScriptCanvas/Translation/AbstractModelTranslator.h Include/ScriptCanvas/Translation/Configuration.h Include/ScriptCanvas/Translation/GraphToCPlusPlus.h Include/ScriptCanvas/Translation/GraphToLua.h From d4f45e9ac59c3c0a3d3249b3037fba49c4d4b6b6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:19:58 -0800 Subject: [PATCH 234/394] Removes GraphToCPlusPlus from Gems/ScriptCanvas Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Translation/GraphToCPlusPlus.cpp | 201 ------------------ .../Translation/GraphToCPlusPlus.h | 60 ------ .../ScriptCanvas/Translation/Translation.cpp | 36 ---- .../Code/scriptcanvasgem_common_files.cmake | 1 - .../Code/scriptcanvasgem_headers.cmake | 1 - 5 files changed, 299 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp deleted file mode 100644 index c6c927ebe8..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp +++ /dev/null @@ -1,201 +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 "GraphToCPlusPlus.h" - -#include -#include - -namespace ScriptCanvas -{ - namespace Translation - { - Configuration CreateCPlusPluseConfig() - { - Configuration configuration; - configuration.m_blockCommentClose = "*/"; - configuration.m_blockCommentOpen = "/*"; - configuration.m_namespaceClose = "}"; - configuration.m_namespaceOpen = "{"; - configuration.m_namespaceOpenPrefix = "namespace"; - configuration.m_scopeClose = "}"; - configuration.m_scopeOpen = "{"; - configuration.m_singleLineComment = "//"; - return configuration; - } - - GraphToCPlusPlus::GraphToCPlusPlus(const Grammar::AbstractCodeModel& model) - : GraphToX(CreateCPlusPluseConfig(), model) - { - WriteHeaderDotH(); - WriteHeaderDotCPP(); - - TranslateDependenciesDotH(); - TranslateDependenciesDotCPP(); - - TranslateNamespaceOpen(); - { - TranslateClassOpen(); - { - TranslateVariables(); - TranslateHandlers(); - TranslateConstruction(); - TranslateDestruction(); - TranslateStartNode(); - } - TranslateClassClose(); - } - TranslateNamespaceClose(); - } - - AZ::Outcome> GraphToCPlusPlus::Translate(const Grammar::AbstractCodeModel& model, AZStd::string& dotH, AZStd::string& dotCPP) - { - GraphToCPlusPlus translation(model); - - if (translation.IsSuccessfull()) - { - dotH = AZStd::move(translation.m_dotH.MoveOutput()); - dotCPP = AZStd::move(translation.m_dotCPP.MoveOutput()); - return AZ::Success(); - } - else - { - return AZ::Failure(AZStd::make_pair(AZStd::string(".h errors"), AZStd::string(".cpp errors"))); - } - } - - void GraphToCPlusPlus::TranslateClassClose() - { - m_dotH.Outdent(); - m_dotH.WriteIndent(); - m_dotH.Write("};"); - m_dotH.WriteSpace(); - SingleLineComment(m_dotH); - m_dotH.WriteSpace(); - m_dotH.WriteLine("class %s", GetGraphName().data()); - } - - void GraphToCPlusPlus::TranslateClassOpen() - { - m_dotH.WriteIndent(); - m_dotH.WriteLine("class %s", GetGraphName().data()); - m_dotH.WriteIndent(); - m_dotH.WriteLine("{"); - m_dotH.Indent(); - } - - void GraphToCPlusPlus::TranslateConstruction() - { - - } - - void GraphToCPlusPlus::TranslateDependencies() - { - TranslateDependenciesDotH(); - TranslateDependenciesDotCPP(); - } - - void GraphToCPlusPlus::TranslateDependenciesDotH() - { - - } - - void GraphToCPlusPlus::TranslateDependenciesDotCPP() - { - - } - - void GraphToCPlusPlus::TranslateDestruction() - { - - } - - void GraphToCPlusPlus::TranslateHandlers() - { - - } - - void GraphToCPlusPlus::TranslateNamespaceOpen() - { - OpenNamespace(m_dotH, "ScriptCanvas"); - OpenNamespace(m_dotH, GetAutoNativeNamespace()); - OpenNamespace(m_dotCPP, "ScriptCanvas"); - OpenNamespace(m_dotCPP, GetAutoNativeNamespace()); - } - - void GraphToCPlusPlus::TranslateNamespaceClose() - { - CloseNamespace(m_dotH, "ScriptCanvas"); - CloseNamespace(m_dotH, GetAutoNativeNamespace()); - CloseNamespace(m_dotCPP, "ScriptCanvas"); - CloseNamespace(m_dotCPP, GetAutoNativeNamespace()); - } - - void GraphToCPlusPlus::TranslateStartNode() - { - // write a start function - const Node* startNode = nullptr; - - if (startNode) - { - { // .h - m_dotH.WriteIndent(); - m_dotH.WriteLine("public: static void %s(const RuntimeContext& context);", Grammar::k_OnGraphStartFunctionName); - } - - { // .cpp - m_dotCPP.WriteIndent(); - m_dotCPP.WriteLine("void %s::%s(const RuntimeContext& context)", GetGraphName().data(), Grammar::k_OnGraphStartFunctionName); - OpenScope(m_dotCPP); - { - m_dotCPP.WriteIndent(); - m_dotCPP.WriteLine("AZ_TracePrintf(\"ScriptCanvas\", \"This call wasn't generated from parsing a print node!\");"); - m_dotCPP.WriteLine("LogNotificationBus::Event(context.GetGraphId(), &LogNotifications::LogMessage, \"This call wasn't generated from parsing a print node!\");"); - // get the related function call and call it - // with possible appropriate variables - } - CloseScope(m_dotCPP); - } - } - } - - void GraphToCPlusPlus::TranslateVariables() - { - - } - - void GraphToCPlusPlus::WriteHeader() - { - WriteHeaderDotH(); - WriteHeaderDotCPP(); - } - - void GraphToCPlusPlus::WriteHeaderDotCPP() - { - WriteCopyright(m_dotCPP); - m_dotCPP.WriteNewLine(); - WriteDoNotModify(m_dotCPP); - m_dotCPP.WriteNewLine(); - m_dotCPP.WriteLine("#include \"%s.h\"", GetGraphName().data()); - m_dotCPP.WriteNewLine(); - } - - void GraphToCPlusPlus::WriteHeaderDotH() - { - WriteCopyright(m_dotH); - m_dotH.WriteNewLine(); - m_dotH.WriteLine("#pragma once"); - m_dotH.WriteNewLine(); - WriteDoNotModify(m_dotH); - m_dotH.WriteNewLine(); - m_dotH.WriteLine("#include "); - m_dotH.WriteNewLine(); - } - - } -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h deleted file mode 100644 index f1007f6956..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/GraphToCPlusPlus.h +++ /dev/null @@ -1,60 +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 "TranslationUtilities.h" -#include "GraphToX.h" - -namespace ScriptCanvas -{ - class Graph; - - namespace Grammar - { - class AbstractCodeModel; - } - - namespace Translation - { - class GraphToCPlusPlus - : public GraphToX - { - public: - static AZ::Outcome> Translate(const Grammar::AbstractCodeModel& model, AZStd::string& dotH, AZStd::string& dotCPP); - - AZ_INLINE bool IsSuccessfull() const { return false; } - private: - // cpp only - Writer m_dotH; - Writer m_dotCPP; - - GraphToCPlusPlus(const Grammar::AbstractCodeModel& model); - - void TranslateClassClose(); - void TranslateClassOpen(); - void TranslateConstruction(); - void TranslateDependencies(); - void TranslateDependenciesDotH(); - void TranslateDependenciesDotCPP(); - void TranslateDestruction(); - void TranslateFunctions(); - void TranslateHandlers(); - void TranslateNamespaceOpen(); - void TranslateNamespaceClose(); - void TranslateStartNode(); - void TranslateVariables(); - void WriteHeader(); // Write, not translate, because this should be less dependent on the contents of the graph - void WriteHeaderDotH(); // Write, not translate, because this should be less dependent on the contents of the graph - void WriteHeaderDotCPP(); // Write, not translate, because this should be less dependent on the contents of the graph - }; - } - -} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp index 3299bb97b4..db7ea22112 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Translation/Translation.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -27,41 +26,6 @@ namespace TranslationCPP using namespace ScriptCanvas; using namespace ScriptCanvas::Translation; - /* - AZ::Outcome, AZStd::pair> ToCPlusPlus(const Grammar::AbstractCodeModel& model, bool rawSave = false) - { - AZStd::string dotH, dotCPP; - auto outcome = GraphToCPlusPlus::Translate(model, dotH, dotCPP); - if (outcome.IsSuccess()) - { -#if defined(SCRIPT_CANVAS_PRINT_FILES_CONSOLE) - AZ_TracePrintf("ScriptCanvas", "\n\n *** .h file ***\n\n"); - AZ_TracePrintf("ScriptCanvas", dotH.data()); - AZ_TracePrintf("ScriptCanvas", "\n\n *** .cpp file *\n\n"); - AZ_TracePrintf("ScriptCanvas", dotCPP.data()); - AZ_TracePrintf("ScriptCanvas", "\n\n"); -#endif - if (rawSave) - { - auto saveOutcome = SaveDotH(model.GetSource(), dotH); - if (saveOutcome.IsSuccess()) - { - saveOutcome = SaveDotCPP(model.GetSource(), dotCPP); - } - if (!saveOutcome.IsSuccess()) - { - AZ_TracePrintf("Save failed %s", saveOutcome.GetError().data()); - } - } - return AZ::Success(AZStd::make_pair(AZStd::move(dotH), AZStd::move(dotCPP))); - } - else - { - return AZ::Failure(outcome.TakeError()); - } - } - */ - AZ::Outcome ToLua(const Grammar::AbstractCodeModel& model, bool rawSave = false) { auto outcome = GraphToLua::Translate(model); diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 9569422e0f..b765a92f45 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -39,7 +39,6 @@ set(FILES Include/ScriptCanvas/Core/SlotMetadata.cpp Include/ScriptCanvas/Core/SubgraphInterface.cpp Include/ScriptCanvas/Core/SubgraphInterfaceUtility.cpp - Include/ScriptCanvas/Translation/GraphToCPlusPlus.cpp Include/ScriptCanvas/Translation/GraphToLua.cpp Include/ScriptCanvas/Translation/GraphToLuaUtility.cpp Include/ScriptCanvas/Translation/GraphToX.cpp diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 72c49cb272..0eec37350e 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -55,7 +55,6 @@ set(FILES Include/ScriptCanvas/Core/SubgraphInterface.h Include/ScriptCanvas/Core/SubgraphInterfaceUtility.h Include/ScriptCanvas/Translation/Configuration.h - Include/ScriptCanvas/Translation/GraphToCPlusPlus.h Include/ScriptCanvas/Translation/GraphToLua.h Include/ScriptCanvas/Translation/GraphToLuaUtility.h Include/ScriptCanvas/Translation/GraphToX.h From 4d01cdc59170b5946cd986c34055936b00485161 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:27:18 -0800 Subject: [PATCH 235/394] Removes FullyConnectedNodePaletteCreation.h from Gems/ScriptCanvasDeveloper Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FullyConnectedNodePaletteCreation.h | 19 ------------------- .../ScriptCanvasDeveloperEditorComponent.cpp | 1 - 2 files changed, 20 deletions(-) delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h b/Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h deleted file mode 100644 index 42c90bff73..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Include/ScriptCanvasDeveloperEditor/AutomationActions/FullyConnectedNodePaletteCreation.h +++ /dev/null @@ -1,19 +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 - -class QAction; -class QMenu; - -namespace ScriptCanvasDeveloperEditor -{ - namespace NodePaletteFullCreation - { - QAction* FullyConnectedNodePaletteCreation(QMenu* mainWindow); - }; -} diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp index 9193556624..e4fabcc136 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/ScriptCanvasDeveloperEditorComponent.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include From 991ef84f08212bf84961001336b4cbfb7d60bac3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:32:18 -0800 Subject: [PATCH 236/394] Removes XMLDoc from Gems/ScriptCanvasDeveloper Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Source/XMLDoc.cpp | 411 ------------------ .../Code/Editor/Source/XMLDoc.h | 50 --- ...riptcanvasdeveloper_gem_editor_files.cmake | 2 - 3 files changed, 463 deletions(-) delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp deleted file mode 100644 index a246bb946e..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.cpp +++ /dev/null @@ -1,411 +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 "XMLDoc.h" -#include -#include -#include -#include -#include -#include - -namespace ScriptCanvasDeveloperEditor -{ - namespace Internal - { - xml_node<> *FindDocumentTypeNode(const xml_document<> & doc, const AZStd::string & nodeName) - { - // this will only work if the xml document was parsed with the flag "parse_doctype_node" - - for(xml_node<> *docTypeNode=doc.first_node(); docTypeNode!=nullptr; docTypeNode=docTypeNode->next_sibling()) - { - if (docTypeNode->type() == node_type::node_doctype) - { - if ( nodeName == docTypeNode->value() ) - { - return docTypeNode; - } - } - } - - return nullptr; - } - - bool GetAttribute(xml_node<> *tsNode, AZStd::string_view attribName, float & value) - { - if( tsNode != nullptr) - { - for (xml_attribute<> *attrib = tsNode->first_attribute(); attrib != nullptr; attrib = attrib->next_attribute()) - { - if ( attribName == attrib->name() ) - { - value = AzFramework::StringFunc::ToFloat( attrib->value() ); - return true; - } - } - } - - return false; - } - - bool GetAttribute(xml_node<> *tsNode, AZStd::string_view attribName, AZStd::string & value) - { - if( tsNode != nullptr) - { - for (xml_attribute<> *attrib = tsNode->first_attribute(); attrib != nullptr; attrib = attrib->next_attribute()) - { - if (attribName == attrib->name()) - { - value = attrib->value(); - return true; - } - } - } - - return false; - } - - xml_node<> *FindContextNode(const xml_document<> & doc, const AZStd::string & contextName) - { - xml_node<> *tsNode = doc.first_node("TS"); - - if (tsNode != nullptr) - { - for(xml_node<> *contextNode=tsNode->first_node("context"); contextNode!=nullptr; contextNode=contextNode->next_sibling("context") ) - { - xml_node<> *contextNameNode = contextNode->first_node("name"); - - if (contextNameNode != nullptr) - { - if( contextName == contextNameNode->value() ) - { - return contextNode; - } - } - } - } - - return nullptr; - } - } - - XMLDocPtr XMLDoc::Alloc(const AZStd::string& contextName) - { - XMLDocPtr xmlDoc( AZStd::make_shared() ); - - xmlDoc->CreateTSDoc(contextName); - - return xmlDoc; - } - - XMLDocPtr XMLDoc::LoadFromDisk(const AZStd::string& fileName) - { - XMLDocPtr xmlDoc(AZStd::make_shared()); - - if ( !xmlDoc->LoadTSDoc(fileName) ) - { - xmlDoc = nullptr; - } - - return xmlDoc; - } - - XMLDoc::XMLDoc() - : m_tsNode(nullptr) - , m_context(nullptr) - , m_readBuffer(0) - { - } - - void XMLDoc::CreateTSDoc(const AZStd::string& contextName) - { - xml_node<>* decl = m_doc.allocate_node(node_declaration); - decl->append_attribute(m_doc.allocate_attribute("version", "1.0")); - decl->append_attribute(m_doc.allocate_attribute("encoding", "utf-8")); - m_doc.append_node(decl); - - xml_node<>* commentNode = m_doc.allocate_node(node_comment, "", AllocString(AZStd::string::format("Generated for %s", contextName.c_str()))); - m_doc.append_node(commentNode); - - xml_node<>* docType = m_doc.allocate_node(node_doctype, "", "TS"); - m_doc.append_node(docType); - - m_tsNode = m_doc.allocate_node(node_element, "TS"); - m_doc.append_node(m_tsNode); - m_tsNode->append_attribute(m_doc.allocate_attribute("version", "2.1")); - m_tsNode->append_attribute(m_doc.allocate_attribute("language", "en_US")); - } - - bool XMLDoc::LoadTSDoc(const AZStd::string& fileName) - { - bool success = false; - - char tsFilePath[AZ::IO::MaxPathLength] = { "" }; - - if (AZ::IO::FileIOBase::GetInstance()->ResolvePath(fileName.c_str(), tsFilePath, AZ::IO::MaxPathLength)) - { - AZ::IO::FileIOStream xmlFile; - - if( AZ::IO::FileIOBase::GetInstance()->Exists(tsFilePath) ) - { - if ( xmlFile.Open(tsFilePath, AZ::IO::OpenMode::ModeRead|AZ::IO::OpenMode::ModeText) ) - { - AZ::IO::SizeType bytesToRead = xmlFile.GetLength(); - - if( bytesToRead > 0 ) - { - m_readBuffer.resize(bytesToRead, '\0'); - if( xmlFile.Read(bytesToRead, m_readBuffer.data() ) == bytesToRead ) - { - m_doc.parse( m_readBuffer.data() ); - - success = IsValidTSDoc(); - - if (success) - { - AZ_TracePrintf("ScriptCanvas", "Loaded \"%s\"", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Error reading Qt .ts file! filename=\"%s\".", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Zero byte Qt .ts file! filename=\"%s\".", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Can't open file Qt .ts file! filename=\"%s\".", tsFilePath); - } - } - } - else - { - AZ_Error("ScriptCanvas", false, "XMLDoc::LoadTSDoc-Invalid filename specified! filename=\"%s\".", tsFilePath); - } - - return success; - } - - bool XMLDoc::WriteToDisk(const AZStd::string & fileName) - { - bool success = false; - - char tsFilePath[AZ::IO::MaxPathLength] = { "" }; - if (AZ::IO::FileIOBase::GetInstance()->ResolvePath(fileName.c_str(), tsFilePath, AZ::IO::MaxPathLength)) - { - AZStd::string writeFolder(tsFilePath); - AzFramework::StringFunc::Path::StripFullName(writeFolder); - - if (!AZ::IO::FileIOBase::GetInstance()->IsDirectory(writeFolder.c_str())) - { - AZ::IO::FileIOBase::GetInstance()->CreatePath(writeFolder.c_str()); - } - - AZ::IO::FileIOStream xmlFile; - - if (xmlFile.Open(tsFilePath, AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText)) - { - AZStd::string xmlData(ToString()); - AZ::IO::SizeType bytesWritten = xmlFile.Write(xmlData.size(), xmlData.data()); - - if (bytesWritten != xmlData.size()) - { - AZ_Error("ScriptCanvas", false, "Write error writing out %s, bytes actually written: %llu expected bytes to write: %llu!", tsFilePath, bytesWritten, xmlData.size()); - } - else - { - AZ_TracePrintf("ScriptCanvas", "Successfully wrote out ScriptCanvas localization file \"%s\".", tsFilePath); - success = true; - } - - xmlFile.Close(); - } - else - { - AZ_Error("ScriptCanvas", false, "Could not open file \"%s\"!", tsFilePath); - } - } - else - { - AZ_Error("ScriptCanvas", false, "Invalid filename specified XMLDoc::WriteToDisk! filename=\"%s\".", tsFilePath); - } - - return success; - } - - - bool XMLDoc::StartContext(const AZStd::string& contextName) - { - bool isNew = false; - - if( !contextName.empty() ) - { - // check to see if we have a context of this name already, if so find that node and use it, otherwise - // create a new one. - - xml_node<> *existingContextNode = Internal::FindContextNode(m_doc, contextName); - - if (existingContextNode == nullptr) - { - m_context = m_doc.allocate_node(node_element, "context"); - m_tsNode->append_node(m_context); - - xml_node<>* contextNameNode = m_doc.allocate_node(node_element, "name", AllocString(contextName)); - m_context->append_node(contextNameNode); - - isNew = true; - } - else - { - m_context = existingContextNode; - } - } - else - { - m_context = nullptr; - } - - return isNew; - } - - void XMLDoc::AddToContext(const AZStd::string& id, const AZStd::string& translation/*=""*/, const AZStd::string& comment /*=""*/, const AZStd::string& source/*=""*/) - { - if (m_context == nullptr) - { - return; - } - - xml_node<>* messageNode = m_doc.allocate_node(node_element, "message"); - - messageNode->append_attribute(m_doc.allocate_attribute("id", AllocString(id))); - - xml_node<>* sourceNode = m_doc.allocate_node(node_element, "source", AllocString(source.empty() ? id.c_str() : source.c_str())); - messageNode->append_node(sourceNode); - - xml_node<>* translationNode = m_doc.allocate_node(node_element, "translation", AllocString(translation)); - messageNode->append_node(translationNode); - - xml_node<>* commentNode = m_doc.allocate_node(node_element, "comment", AllocString(comment)); - messageNode->append_node(commentNode); - - m_context->append_node(messageNode); - } - - bool XMLDoc::MethodFamilyExists(const AZStd::string& baseId) const - { - if (m_tsNode != nullptr) - { - AZStd::string nameID(baseId + "_NAME"); - - for (xml_node<> *contextNode=m_tsNode->first_node("context"); contextNode!=nullptr; contextNode=contextNode->next_sibling("context")) - { - for (xml_node<> *messageNode = contextNode->first_node("message"); messageNode != nullptr; messageNode = messageNode->next_sibling("message")) - { - AZStd::string id; - - if ( Internal::GetAttribute(messageNode, "id", id) ) - { - if (id == nameID) - { - return true; - } - } - } - } - } - - return false; - } - - AZStd::string XMLDoc::ToString() const - { - AZStd::string buffer; - - print( AZStd::back_inserter(buffer), m_doc, 0); - - return buffer; - } - - const char *XMLDoc::AllocString(const AZStd::string& str) - { - return m_doc.allocate_string( str.c_str(), str.size() + 1 ); - } - - bool XMLDoc::IsValidTSDoc() - { - bool isTSDoc = false; - // - // Basic format of a .ts file, we are checking to make sure the document type is ts, and the version is 2.1 or greater - // and there is a non-null language attribute. and at least 1 context section - // - // - // - // - // - // ... - // - // - // - - // this node should be the doc type - - xml_node<> *docTypeNode = Internal::FindDocumentTypeNode(m_doc, "TS"); - - if (docTypeNode !=nullptr) - { - xml_node<> *tsNode = m_doc.first_node("TS"); - - if( tsNode != nullptr) - { - float attribVersion = 0.0f; - if( Internal::GetAttribute(tsNode, "version", attribVersion) && (attribVersion >= 2.1f) ) - { - AZStd::string attribLanguage; - if( Internal::GetAttribute(tsNode, "language", attribLanguage) && !attribLanguage.empty() ) - { - xml_node<> *contextNode = tsNode->first_node("context"); - if(contextNode != nullptr) - { - m_tsNode = tsNode; - - AZ_TracePrintf("ScriptCanvas", "TS: Version=%2.1f, Language=\"%s\"", attribVersion, attribLanguage.c_str()); - isTSDoc = true; - } - else - { - AZ_Warning("ScriptCanvas", false, "TS document contains no \"context\" nodes!"); - } - } - else - { - AZ_Warning("ScriptCanvas", false, "TS document has a bad or missing \"language\" attribute!"); - } - } - else - { - AZ_Warning("ScriptCanvas", false, "TS document has a bad or missing \"version\" attribute!"); - } - } - else - { - AZ_Error("ScriptCanvas", false, "TS document contains no \"TS\" node!"); - } - } - else - { - AZ_Error("ScriptCanvas", false, "XML doc is not a valid TS document!"); - } - - return isTSDoc; - } -} diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h deleted file mode 100644 index be98e1bab0..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/XMLDoc.h +++ /dev/null @@ -1,50 +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 -#include -#include - -using namespace AZ::rapidxml; - -namespace ScriptCanvasDeveloperEditor -{ - class XMLDoc; - using XMLDocPtr = AZStd::shared_ptr; - - class XMLDoc - { - public: - static XMLDocPtr Alloc(const AZStd::string& contextName); - static XMLDocPtr LoadFromDisk(const AZStd::string& fileName); - - XMLDoc(); - virtual ~XMLDoc() {} - - bool WriteToDisk(const AZStd::string & filename); - bool StartContext(const AZStd::string& contextName); - void AddToContext(const AZStd::string& id, const AZStd::string& translation = "", const AZStd::string& comment = "", const AZStd::string& source = ""); - bool MethodFamilyExists(const AZStd::string& familyName) const; - AZStd::string ToString() const; - - private: - void CreateTSDoc(const AZStd::string& contextName); - bool LoadTSDoc(const AZStd::string& contextName); - bool IsValidTSDoc(); - const char *AllocString(const AZStd::string& str); - - private: - xml_document<> m_doc; - xml_node<> * m_tsNode; - xml_node<> * m_context; - AZStd::vector m_readBuffer; - }; -} diff --git a/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake b/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake index 1d34b5484a..c73b9919cd 100644 --- a/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake +++ b/Gems/ScriptCanvasDeveloper/Code/scriptcanvasdeveloper_gem_editor_files.cmake @@ -53,8 +53,6 @@ set(FILES Editor/Source/NodeListDumpAction.cpp Editor/Source/TSGenerateAction.cpp Editor/Source/WrapperMock.cpp - Editor/Source/XMLDoc.cpp - Editor/Source/XMLDoc.h # AutomationActions Editor/Source/AutomationActions/DynamicSlotFullCreation.cpp From af2745afb8d96ac50667c8f92134530faf094e9a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:34:10 -0800 Subject: [PATCH 237/394] Removes FullyConnectedNodePaletteCreation.cpp from Gems/ScriptCanvasDeveloper Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../FullyConnectedNodePaletteCreation.cpp | 242 ------------------ 1 file changed, 242 deletions(-) delete mode 100644 Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp deleted file mode 100644 index 95075c8ea1..0000000000 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/FullyConnectedNodePaletteCreation.cpp +++ /dev/null @@ -1,242 +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 -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -namespace ScriptCanvasDeveloperEditor -{ - namespace NodePaletteFullCreation - { - class CreateFullyConnectedNodePaletteInterface - : public ProcessNodePaletteInterface - { - public: - - CreateFullyConnectedNodePaletteInterface(DeveloperUtils::ConnectionStyle connectionStyle, bool skipHandlers = false) - { - m_chainConfig.m_connectionStyle = connectionStyle; - m_chainConfig.m_skipHandlers = skipHandlers; - } - - void SetupInterface(const AZ::EntityId& activeGraphCanvasGraphId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId) - { - m_graphCanvasGraphId = activeGraphCanvasGraphId; - m_scriptCanvasId = scriptCanvasId; - - GraphCanvas::SceneRequestBus::EventResult(m_viewId, activeGraphCanvasGraphId, &GraphCanvas::SceneRequests::GetViewId); - GraphCanvas::SceneRequestBus::EventResult(m_gridId, activeGraphCanvasGraphId, &GraphCanvas::SceneRequests::GetGrid); - - GraphCanvas::GridRequestBus::EventResult(m_minorPitch, m_gridId, &GraphCanvas::GridRequests::GetMinorPitch); - - QGraphicsScene* graphicsScene = nullptr; - GraphCanvas::SceneRequestBus::EventResult(graphicsScene, activeGraphCanvasGraphId, &GraphCanvas::SceneRequests::AsQGraphicsScene); - - if (graphicsScene) - { - QRectF sceneArea = graphicsScene->sceneRect(); - sceneArea.adjust(m_minorPitch.GetX(), m_minorPitch.GetY(), -m_minorPitch.GetX(), -m_minorPitch.GetY()); - GraphCanvas::ViewRequestBus::Event(m_viewId, &GraphCanvas::ViewRequests::CenterOnArea, sceneArea); - QApplication::processEvents(); - } - - GraphCanvas::ViewRequestBus::EventResult(m_nodeCreationPos, m_viewId, &GraphCanvas::ViewRequests::GetViewSceneCenter); - - GraphCanvas::GraphCanvasGraphicsView* graphicsView = nullptr; - GraphCanvas::ViewRequestBus::EventResult(graphicsView, m_viewId, &GraphCanvas::ViewRequests::AsGraphicsView); - - m_viewportRectangle = graphicsView->mapToScene(graphicsView->viewport()->geometry()).boundingRect(); - - // Temporary work around until the extra automation tools can be merged over that have better ways of doing this. - const GraphCanvas::GraphCanvasTreeItem* treeItem = nullptr; - ScriptCanvasEditor::AutomationRequestBus::BroadcastResult(treeItem, &ScriptCanvasEditor::AutomationRequests::GetNodePaletteRoot); - - const GraphCanvas::NodePaletteTreeItem* onGraphStartItem = nullptr; - - if (treeItem) - { - AZStd::unordered_set< const GraphCanvas::GraphCanvasTreeItem* > unexploredSet = { treeItem }; - - while (!unexploredSet.empty()) - { - const GraphCanvas::GraphCanvasTreeItem* treeItem = (*unexploredSet.begin()); - unexploredSet.erase(unexploredSet.begin()); - - const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem = azrtti_cast(treeItem); - - if (nodePaletteTreeItem && nodePaletteTreeItem->GetName().compare("On Graph Start") == 0) - { - onGraphStartItem = nodePaletteTreeItem; - break; - } - - for (int i = 0; i < treeItem->GetChildCount(); ++i) - { - const GraphCanvas::GraphCanvasTreeItem* childItem = treeItem->FindChildByRow(i); - - if (childItem) - { - unexploredSet.insert(childItem); - } - } - } - } - - if (onGraphStartItem) - { - ProcessItem(onGraphStartItem); - } - } - - int m_counter = 60; - - bool ShouldProcessItem(const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem) const - { - return m_counter > 0; - } - - void ProcessItem(const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem) - { - GraphCanvas::GraphCanvasMimeEvent* mimeEvent = nodePaletteTreeItem->CreateMimeEvent(); - - if (ScriptCanvasEditor::MultiCreateNodeMimeEvent* multiCreateMimeEvent = azrtti_cast(mimeEvent)) - { - --m_counter; - AZStd::vector< GraphCanvas::GraphCanvasMimeEvent* > mimeEvents = multiCreateMimeEvent->CreateMimeEvents(); - - for (GraphCanvas::GraphCanvasMimeEvent* currentEvent : mimeEvents) - { - ScriptCanvasEditor::NodeIdPair createdPair = DeveloperUtils::HandleMimeEvent(currentEvent, m_graphCanvasGraphId, m_viewportRectangle, m_widthOffset, m_heightOffset, m_maxRowHeight, m_minorPitch); - delete currentEvent; - - if (DeveloperUtils::CreateConnectedChain(createdPair, m_chainConfig)) - { - m_createdNodes.emplace_back(createdPair); - } - else - { - m_nodesToDelete.insert(GraphCanvas::GraphUtils::FindOutermostNode(createdPair.m_graphCanvasId)); - } - } - } - else if (mimeEvent) - { - --m_counter; - ScriptCanvasEditor::NodeIdPair createdPair = DeveloperUtils::HandleMimeEvent(mimeEvent, m_graphCanvasGraphId, m_viewportRectangle, m_widthOffset, m_heightOffset, m_maxRowHeight, m_minorPitch); - - if (DeveloperUtils::CreateConnectedChain(createdPair, m_chainConfig)) - { - m_createdNodes.emplace_back(createdPair); - } - else - { - m_nodesToDelete.insert(GraphCanvas::GraphUtils::FindOutermostNode(createdPair.m_graphCanvasId)); - } - } - - delete mimeEvent; - } - - private: - - void OnProcessingComplete() override - { - GraphCanvas::SceneRequestBus::Event(m_graphCanvasGraphId, &GraphCanvas::SceneRequests::Delete, m_nodesToDelete); - } - - DeveloperUtils::CreateConnectedChainConfig m_chainConfig; - - AZStd::vector m_createdNodes; - AZStd::unordered_set m_nodesToDelete; - - AZ::EntityId m_graphCanvasGraphId; - ScriptCanvas::ScriptCanvasId m_scriptCanvasId; - - AZ::Vector2 m_nodeCreationPos = AZ::Vector2::CreateZero(); - - AZ::EntityId m_viewId; - AZ::EntityId m_gridId; - - AZ::Vector2 m_minorPitch = AZ::Vector2::CreateZero(); - - QRectF m_viewportRectangle; - - int m_widthOffset = 0; - int m_heightOffset = 0; - - int m_maxRowHeight = 0; - }; - - void CreateSingleExecutionConnectedNodePaletteAction() - { - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationBegin); - - CreateFullyConnectedNodePaletteInterface nodePaletteInterface(DeveloperUtils::ConnectionStyle::SingleExecutionConnection); - DeveloperUtils::ProcessNodePalette(nodePaletteInterface); - - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationEnd); - } - - void CreateSingleExecutionConnectedNodePaletteExcludeHandlersAction() - { - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationBegin); - - CreateFullyConnectedNodePaletteInterface nodePaletteInterface(DeveloperUtils::ConnectionStyle::SingleExecutionConnection, true); - DeveloperUtils::ProcessNodePalette(nodePaletteInterface); - - ScriptCanvasEditor::AutomationRequestBus::Broadcast(&ScriptCanvasEditor::AutomationRequests::SignalAutomationEnd); - } - - QAction* FullyConnectedNodePaletteCreation(QMenu* mainMenu) - { - QAction* createNodePaletteAction = nullptr; - - if (mainMenu) - { - { - createNodePaletteAction = mainMenu->addAction(QAction::tr("Create Execution Connected Node Palette")); - createNodePaletteAction->setAutoRepeat(false); - createNodePaletteAction->setToolTip("Tries to create every node in the node palette and will attempt to create an execution path through them."); - - QObject::connect(createNodePaletteAction, &QAction::triggered, &CreateSingleExecutionConnectedNodePaletteAction); - } - - { - createNodePaletteAction = mainMenu->addAction(QAction::tr("Create Execution Connected Node Palette sans Handlers")); - createNodePaletteAction->setAutoRepeat(false); - createNodePaletteAction->setToolTip("Tries to create every node in the node palette(except EBus Handlers) and attempt to create an execution path through them.."); - - QObject::connect(createNodePaletteAction, &QAction::triggered, &CreateSingleExecutionConnectedNodePaletteExcludeHandlersAction); - } - - - } - - return createNodePaletteAction; - } - } -} From 5b2ea01a8382f094aea681b2ebde34a04e68a58b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:35:02 -0800 Subject: [PATCH 238/394] Removes ScriptCanvas_Regressions.cpp from Gems/ScriptCanvasTesting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Tests/ScriptCanvas_Regressions.cpp | 13 ------------- .../scriptcanvastestingeditor_tests_files.cmake | 1 - 2 files changed, 14 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp deleted file mode 100644 index 72ec6067b1..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_Regressions.cpp +++ /dev/null @@ -1,13 +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 - -using namespace ScriptCanvasTests; - diff --git a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake index 87d65aa7b4..e2e86ca551 100644 --- a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake +++ b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake @@ -23,7 +23,6 @@ set(FILES Tests/ScriptCanvas_Math.cpp Tests/ScriptCanvas_MethodOverload.cpp Tests/ScriptCanvas_NodeGenerics.cpp - Tests/ScriptCanvas_Regressions.cpp Tests/ScriptCanvas_RuntimeInterpreted.cpp Tests/ScriptCanvas_Slots.cpp Tests/ScriptCanvas_StringNodes.cpp From 91e404567df1407d4e603270596f1f3205c59fe7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:36:35 -0800 Subject: [PATCH 239/394] Removes UnitTestingReporter from Gems/ScriptCanvasTesting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Source/Framework/UnitTestingReporter.cpp | 253 ------------------ .../Source/Framework/UnitTestingReporter.h | 105 -------- 2 files changed, 358 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp delete mode 100644 Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp b/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp deleted file mode 100644 index 7041b2de32..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.cpp +++ /dev/null @@ -1,253 +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 "UnitTestingReporter.h" - -#include -#include - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_EQ(LHS, RHS)\ - EXPECT_EQ(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_NE(LHS, RHS)\ - EXPECT_NE(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GT(LHS, RHS)\ - EXPECT_GT(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GE(LHS, RHS)\ - EXPECT_GE(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LT(LHS, RHS)\ - EXPECT_LT(LHS, RHS) << report.data(); - -#define SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LE(LHS, RHS)\ - EXPECT_LE(LHS, RHS) << report.data(); - -namespace ScriptCanvas -{ - namespace UnitTesting - { - Reporter::Reporter() - : m_graphId{} - , m_entityId{} - {} - - Reporter::Reporter(const RuntimeComponent& graph) - { - SetGraph(graph); - } - - Reporter::~Reporter() - { - Reset(); - } - - void Reporter::Checkpoint(const Report& report) - { - if (m_isReportFinished) - return; - - m_checkpoints.push_back(report); - } - - const AZStd::vector& Reporter::GetCheckpoints() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_checkpoints; - } - - const AZStd::vector& Reporter::GetFailure() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_failures; - } - - const AZ::EntityId& Reporter::GetGraphId() const - { - return m_graphId; - } - - const AZStd::vector& Reporter::GetSuccess() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_successes; - } - - bool Reporter::IsActivated() const - { - return m_graphIsActivated; - } - - bool Reporter::IsComplete() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsComplete; - } - - bool Reporter::IsDeactivated() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsDeactivated; - } - - bool Reporter::IsErrorFree() const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsErrorFree; - } - - bool Reporter::IsReportFinished() const - { - return m_isReportFinished; - } - - void Reporter::FinishReport() - { - AZ_Assert(!m_isReportFinished, "the report is already finished"); - m_isReportFinished = true; - } - - void Reporter::FinishReport(const RuntimeComponent& graph) - { - AZ_Assert(!m_isReportFinished, "the report is already finished"); - Bus::Handler::BusDisconnect(m_graphId); - AZ::EntityBus::Handler::BusDisconnect(m_entityId); - m_graphIsErrorFree = !graph.IsInErrorState(); - m_isReportFinished = true; - } - - bool Reporter::operator==(const Reporter& other) const - { - AZ_Assert(m_isReportFinished, "the report must be finished before evaluation"); - return m_graphIsActivated == other.m_graphIsActivated - && m_graphIsDeactivated == other.m_graphIsDeactivated - && m_graphIsComplete == other.m_graphIsComplete - && m_graphIsErrorFree == other.m_graphIsErrorFree - && m_isReportFinished == other.m_isReportFinished - && m_failures == other.m_failures - && m_successes == other.m_successes; - } - - void Reporter::OnEntityActivated(const AZ::EntityId& entity) - { - AZ_Assert(m_entityId == entity, "this reporter is listening to the wrong entity"); - if (m_isReportFinished) - return; - - m_graphIsActivated = true; - } - - void Reporter::OnEntityDeactivated(const AZ::EntityId& entity) - { - AZ_Assert(m_entityId == entity, "this reporter is listening to the wrong entity"); - if (m_isReportFinished) - return; - - m_graphIsDeactivated = true; - } - - void Reporter::Reset() - { - if (m_graphId.IsValid()) - { - Bus::Handler::BusDisconnect(); - } - - if (m_entityId.IsValid()) - { - AZ::EntityBus::Handler::BusDisconnect(); - } - - m_graphIsActivated = false; - m_graphIsComplete = false; - m_graphIsErrorFree = false; - m_isReportFinished = false; - m_graphId = AZ::EntityId{}; - m_failures.clear(); - m_failures.clear(); - } - - void Reporter::SetGraph(const RuntimeComponent& graph) - { - Reset(); - m_graphId = graph.GetUniqueId(); - m_entityId = graph.GetEntityId(); - Bus::Handler::BusConnect(m_graphId); - AZ::EntityBus::Handler::BusConnect(m_entityId); - } - - // Handler - void Reporter::MarkComplete(const Report& report) - { - if (m_isReportFinished) - return; - - if (m_graphIsComplete) - { - AddFailure(AZStd::string::format("MarkComplete was called twice. %s", report.data())); - } - else - { - m_graphIsComplete = true; - } - } - - void Reporter::AddFailure(const Report& report) - { - if (m_isReportFinished) - return; - - m_failures.push_back(report); - Checkpoint(AZStd::string::format("AddFailure: %s", report.data())); - } - - void Reporter::AddSuccess(const Report& report) - { - if (m_isReportFinished) - return; - - m_successes.push_back(report); - Checkpoint(AZStd::string::format("AddSuccess: %s", report.data())); - } - - void Reporter::ExpectFalse(const bool value, const Report& report) - { - EXPECT_FALSE(value) << report.data(); - Checkpoint(AZStd::string::format("ExpectFalse: %s", report.data())); - } - - void Reporter::ExpectTrue(const bool value, const Report& report) - { - EXPECT_TRUE(value) << report.data(); - Checkpoint(AZStd::string::format("ExpectTrue: %s", report.data())); - } - - void Reporter::ExpectEqualNumber(const Data::NumberType lhs, const Data::NumberType rhs, const Report& report) - { - EXPECT_NEAR(lhs, rhs, 0.001) << report.data(); - Checkpoint(AZStd::string::format("ExpectEqualNumber: %s", report.data())); - } - - void Reporter::ExpectNotEqualNumber(const Data::NumberType lhs, const Data::NumberType rhs, const Report& report) - { - EXPECT_NE(lhs, rhs) << report.data(); - Checkpoint(AZStd::string::format("ExpectNotEqualNumber: %s", report.data())); - } - - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_EQ) - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectNotEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_NE) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectGreaterThan, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GT) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectGreaterThanEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_GE) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectLessThan, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LT) - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(Reporter, ExpectLessThanEqual, SCRIPT_CANVAS_UNIT_TEST_REPORTER_EXPECT_LE) - - } // namespace UnitTesting - -} // namespace ScriptCanvas diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h b/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h deleted file mode 100644 index 27c91d9ccc..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/UnitTestingReporter.h +++ /dev/null @@ -1,105 +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 -#include -#include -#include - -namespace ScriptCanvas -{ - class RuntimeComponent; - - namespace UnitTesting - { - class Reporter - : public Bus::Handler - , public AZ::EntityBus::Handler - { - public: - Reporter(); - Reporter(const RuntimeComponent& graph); - ~Reporter(); - - void FinishReport(); - - void FinishReport(const RuntimeComponent& graph); - - const AZStd::vector& GetCheckpoints() const; - - const AZStd::vector& GetFailure() const; - - const AZ::EntityId& GetGraphId() const; - - const AZStd::vector& GetSuccess() const; - - bool IsActivated() const; - - bool IsComplete() const; - - bool IsDeactivated() const; - - bool IsErrorFree() const; - - bool IsReportFinished() const; - - bool operator==(const Reporter& other) const; - - void Reset(); - - void SetGraph(const RuntimeComponent& graph); - - // Bus::Handler - - void AddFailure(const Report& report) override; - - void AddSuccess(const Report& report) override; - - void Checkpoint(const Report& report) override; - - void ExpectFalse(const bool value, const Report& report) override; - - void ExpectTrue(const bool value, const Report& report) override; - - void MarkComplete(const Report& report) override; - - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_OVERRIDES(ExpectEqual); - - SCRIPT_CANVAS_UNIT_TEST_EQUALITY_OVERLOAD_OVERRIDES(ExpectNotEqual); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectGreaterThan); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectGreaterThanEqual); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectLessThan); - - SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_OVERRIDES(ExpectLessThanEqual); - - protected: - void OnEntityActivated(const AZ::EntityId&) override; - void OnEntityDeactivated(const AZ::EntityId&) override; - - private: - bool m_graphIsActivated = false; - bool m_graphIsDeactivated = false; - bool m_graphIsComplete = false; - bool m_graphIsErrorFree = false; - bool m_isReportFinished = false; - AZ::EntityId m_graphId; - AZ::EntityId m_entityId; - AZStd::vector m_checkpoints; - AZStd::vector m_failures; - AZStd::vector m_successes; - }; // class Reporter/ - - } // namespace UnitTesting - -} // namespace ScriptCanvas From eb5218e1a3bc96589034c248e912ac39cd68d2d6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:40:54 -0800 Subject: [PATCH 240/394] Removes ScriptCanvas_BehaviorContext from Gems/ScriptCanvasTesting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/ScriptCanvas_BehaviorContext.cpp | 29 ------------------- ...criptcanvastestingeditor_tests_files.cmake | 1 - 2 files changed, 30 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp deleted file mode 100644 index 5222be6e31..0000000000 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_BehaviorContext.cpp +++ /dev/null @@ -1,29 +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 -#include -#include - -using namespace ScriptCanvasTests; -using namespace ScriptCanvasEditor; -using namespace TestNodes; - -void ReflectSignCorrectly() -{ - AZ::BehaviorContext* behaviorContext(nullptr); - AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext); - AZ_Assert(behaviorContext, "A behavior context is required!"); - behaviorContext->Method("Sign", AZ::GetSign); -} diff --git a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake index e2e86ca551..98bf13c404 100644 --- a/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake +++ b/Gems/ScriptCanvasTesting/Code/scriptcanvastestingeditor_tests_files.cmake @@ -16,7 +16,6 @@ set(FILES Source/Framework/ScriptCanvasTestApplication.h Source/Framework/EntityRefTests.h Tests/ScriptCanvasTestingTest.cpp - Tests/ScriptCanvas_BehaviorContext.cpp Tests/ScriptCanvas_ContainerSupport.cpp Tests/ScriptCanvas_Core.cpp Tests/ScriptCanvas_EventHandlers.cpp From 250500e93782798473e193e0ad2f3dda832b7b70 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:48:54 -0800 Subject: [PATCH 241/394] Removes BuilderSystemComponent.h from Gems/ScriptEvents Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Builder/BuilderSystemComponent.h | 40 ------------------- .../scriptevents_editor_builder_files.cmake | 1 - 2 files changed, 41 deletions(-) delete mode 100644 Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h diff --git a/Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h b/Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h deleted file mode 100644 index 485698e99a..0000000000 --- a/Gems/ScriptEvents/Code/Builder/BuilderSystemComponent.h +++ /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 - * - */ - -#pragma once - -#include -#include - -namespace ScriptEventsBuilder -{ - class BuilderSystemComponent - : public AZ::Component - { - public: - AZ_COMPONENT(BuilderSystemComponent, "{6CE4EF5D-5A18-4E25-A676-501644676B58}"); - - BuilderSystemComponent(); - ~BuilderSystemComponent() override; - - static void Reflect(AZ::ReflectContext* context); - - static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); - - //////////////////////////////////////////////////////////////////////// - // AZ::Component... - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - private: - BuilderSystemComponent(const BuilderSystemComponent&) = delete; - - }; -} diff --git a/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake b/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake index 5cce31dcd9..ece30fbd07 100644 --- a/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake +++ b/Gems/ScriptEvents/Code/scriptevents_editor_builder_files.cmake @@ -11,5 +11,4 @@ set(FILES Builder/ScriptEventsBuilderComponent.h Builder/ScriptEventsBuilderWorker.cpp Builder/ScriptEventsBuilderWorker.h - Builder/BuilderSystemComponent.h ) From 1251d66114c3bc20dc7afcb07c13825e8d282069 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:51:25 -0800 Subject: [PATCH 242/394] Removes ScriptEventsLegacyDefinitions from Gems/ScriptEvents Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../ScriptEventsLegacyDefinitions.h | 122 ------------------ 1 file changed, 122 deletions(-) delete mode 100644 Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h diff --git a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h deleted file mode 100644 index b61d07295d..0000000000 --- a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventsLegacyDefinitions.h +++ /dev/null @@ -1,122 +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 -#include -#include - - - - -namespace ScriptEventsLegacy -{ - /** - * This class represents an EBus event parameter. - * void Foo(parameterType parameterName) - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * parameter - */ - struct ParameterDefinition - { - AZ_TYPE_INFO(ParameterDefinition, "{6586FFB5-0FF6-424F-A542-C797E2FF3458}"); - AZ_CLASS_ALLOCATOR(ParameterDefinition, AZ::SystemAllocator, 0); - - ParameterDefinition() = default; - ParameterDefinition(const AZStd::string& name, const AZStd::string& tooltip, const AZ::Uuid& type) - : m_name(name) - , m_tooltip(tooltip) - , m_type(type) - {} - - AZStd::string m_name; - AZStd::string m_tooltip; - AZ::Uuid m_type = AZ::BehaviorContext::GetVoidTypeId(); - }; - - /** - * This class represents an EBus event. - * void Foo (parameterType parameterName, parameterType2 parameterName2) - * ^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * m_returnType, m_name, m_parameters - */ - struct EventDefinition - { - AZ_TYPE_INFO(EventDefinition, "{211BB356-FA42-400F-B3DD-9326C6A686B6}"); - AZ_CLASS_ALLOCATOR(EventDefinition, AZ::SystemAllocator, 0); - - EventDefinition() = default; - EventDefinition(const AZStd::string& eventName, const AZStd::string& tooltip, const AZ::Uuid& returnValue, const AZStd::vector& parameters) - : m_name(eventName) - , m_tooltip(tooltip) - , m_returnType(returnValue) - , m_parameters(parameters) - {} - - AZStd::string m_name; - AZStd::string m_tooltip; - AZ::Uuid m_returnType = AZ::BehaviorContext::GetVoidTypeId(); - AZStd::vector m_parameters; - }; - - /** - * This class represents EBus type traits. - * At the moment only bus id type is supported. - */ - struct TypeTraitsDefinition - { - AZ_TYPE_INFO(TypeTraitsDefinition, "{EC374DE0-8003-4572-BC26-C4A8DBE50AB6}"); - AZ_CLASS_ALLOCATOR(TypeTraitsDefinition, AZ::SystemAllocator, 0); - - TypeTraitsDefinition() = default; - TypeTraitsDefinition(const AZ::Uuid& busIdType) - : m_busIdType(busIdType) {} - - AZ::Uuid m_busIdType = AZ::BehaviorContext::GetVoidTypeId(); - }; - - /** - * This class represents an EBus. - * An EBus has a name, traits, and a collection of events - * Configurable EBuses are added to the Behavior Context as both Request and Notification buses - */ - struct Definition - { - AZ_TYPE_INFO(Definition, "{4663215E-8137-4A16-979D-26B48401F40D}"); - AZ_CLASS_ALLOCATOR(Definition, AZ::SystemAllocator, 0); - - Definition() = default; - Definition(const AZStd::string& name, const AZStd::string& tooltip, const TypeTraitsDefinition& traits, const AZStd::vector& events) - : m_name(name) - , m_tooltip(tooltip) - , m_traits(traits) - , m_events(events) - {} - - EventDefinition FindEvent(const char* name) const - { - for (const EventDefinition& eventDefinition : m_events) - { - if (eventDefinition.m_name.compare(name) == 0) - { - return eventDefinition; - } - } - - return EventDefinition(); - } - - AZStd::string m_name; - AZStd::string m_tooltip; - AZStd::string m_category = "Custom Events"; - TypeTraitsDefinition m_traits; - AZStd::vector m_events; - }; -} From 57499860e0244c9e49e55d086ce94de5e4fedf58 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:51:58 -0800 Subject: [PATCH 243/394] Removes Input.h/cpp from Gems/StartingPoint Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/StartingPointInput/Code/Source/Input.cpp | 490 ------------------ Gems/StartingPointInput/Code/Source/Input.h | 125 ----- 2 files changed, 615 deletions(-) delete mode 100644 Gems/StartingPointInput/Code/Source/Input.cpp delete mode 100644 Gems/StartingPointInput/Code/Source/Input.h diff --git a/Gems/StartingPointInput/Code/Source/Input.cpp b/Gems/StartingPointInput/Code/Source/Input.cpp deleted file mode 100644 index 934ebe4d35..0000000000 --- a/Gems/StartingPointInput/Code/Source/Input.cpp +++ /dev/null @@ -1,490 +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 "Input.h" -#include "LyToAzInputNameConversions.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -// CryCommon includes -#include -#include - - -namespace Input -{ - static const int s_inputVersion = 2; - - bool ConvertInputVersion1To2(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) - { - const int deviceTypeElementIndex = classElement.FindElement(AZ_CRC("Input Device Type")); - if (deviceTypeElementIndex == -1) - { - AZ_Error("Input", false, "Could not find 'Input Device Type' element"); - return false; - } - - AZ::SerializeContext::DataElementNode& deviceTypeElementNode = classElement.GetSubElement(deviceTypeElementIndex); - AZStd::string deviceTypeElementValue; - if (!deviceTypeElementNode.GetData(deviceTypeElementValue)) - { - AZ_Error("Input", false, "Could not get 'Input Device Type' element as a string"); - return false; - } - - const AZStd::string convertedDeviceType = ConvertInputDeviceName(deviceTypeElementValue); - if (!deviceTypeElementNode.SetData(context, convertedDeviceType)) - { - AZ_Error("Input", false, "Could not set 'Input Device Type' element as a string"); - return false; - } - - const int eventNameElementIndex = classElement.FindElement(AZ_CRC("Input Name")); - if (eventNameElementIndex == -1) - { - AZ_Error("Input", false, "Could not find 'Input Name' element"); - return false; - } - - AZ::SerializeContext::DataElementNode& eventNameElementNode = classElement.GetSubElement(eventNameElementIndex); - AZStd::string eventNameElementValue; - if (!eventNameElementNode.GetData(eventNameElementValue)) - { - AZ_Error("Input", false, "Could not get 'Input Name' element as a string"); - return false; - } - - const AZStd::string convertedElementName = ConvertInputEventName(eventNameElementValue); - if (!eventNameElementNode.SetData(context, convertedElementName)) - { - AZ_Error("Input", false, "Could not set 'Input Name' element as a string"); - return false; - } - - return true; - } - - bool ConvertInputVersion(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) - { - int currentUpgradedVersion = classElement.GetVersion(); - while (currentUpgradedVersion < s_inputVersion) - { - switch (currentUpgradedVersion) - { - case 1: - { - if (ConvertInputVersion1To2(context, classElement)) - { - currentUpgradedVersion = 2; - } - else - { - AZ_Warning("Input", false, "Failed to convert Input from version 1 to 2, its data will be lost on save"); - return false; - } - } - break; - case 0: - default: - { - AZ_Warning("Input", false, "Unable to convert Input: unsupported version %i, its data will be lost on save", currentUpgradedVersion); - return false; - } - } - } - return true; - } - - void Input::Reflect(AZ::ReflectContext* reflection) - { - AZ::SerializeContext* serializeContext = azrtti_cast(reflection); - if (serializeContext) - { - serializeContext->Class() - ->Version(s_inputVersion, &ConvertInputVersion) - ->Field("Input Device Type", &Input::m_inputDeviceType) - ->Field("Input Name", &Input::m_inputName) - ->Field("Event Value Multiplier", &Input::m_eventValueMultiplier) - ->Field("Dead Zone", &Input::m_deadZone); - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("Input", "Hold an input to generate an event") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &Input::GetEditorText) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &Input::m_inputDeviceType, "Input Device Type", "The type of input device, ex keyboard") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &Input::OnDeviceSelected) - ->Attribute(AZ::Edit::Attributes::StringList, &Input::GetInputDeviceTypes) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &Input::m_inputName, "Input Name", "The name of the input you want to hold ex. space") - ->Attribute(AZ::Edit::Attributes::StringList, &Input::GetInputNamesBySelectedDevice) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(0, &Input::m_eventValueMultiplier, "Event value multiplier", "When the event fires, the value will be scaled by this multiplier") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(0, &Input::m_deadZone, "Dead zone", "An event will only be sent out if the value is above this threshold") - ->Attribute(AZ::Edit::Attributes::Min, 0.0f); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection)) - { - behaviorContext->EBus("InputEventNotificationBus") - ->Event("OnPressed", &AZ::InputEventNotificationBus::Events::OnPressed) - ->Event("OnHeld", &AZ::InputEventNotificationBus::Events::OnHeld) - ->Event("OnReleased", &AZ::InputEventNotificationBus::Events::OnReleased); - } - } - } - - Input::Input() - { - if (m_inputDeviceType.empty()) - { - auto&& deviceTypes = GetInputDeviceTypes(); - if (!deviceTypes.empty()) - { - m_inputDeviceType = deviceTypes[0]; - OnDeviceSelected(); - } - } - } - - bool Input::OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) - { - const LocalUserId localUserIdOfEvent = static_cast(inputChannel.GetInputDevice().GetAssignedLocalUserId()); - const float value = CalculateEventValue(inputChannel); - const bool isPressed = fabs(value) > m_deadZone; - if (!m_wasPressed && isPressed) - { - SendEventsInternal(value, localUserIdOfEvent, m_outgoingBusId, &AZ::InputEventNotificationBus::Events::OnPressed); - } - else if (m_wasPressed && isPressed) - { - SendEventsInternal(value, localUserIdOfEvent, m_outgoingBusId, &AZ::InputEventNotificationBus::Events::OnHeld); - } - else if (m_wasPressed && !isPressed) - { - SendEventsInternal(value, localUserIdOfEvent, m_outgoingBusId, &AZ::InputEventNotificationBus::Events::OnReleased); - } - m_wasPressed = isPressed; - - // Return false so we don't consume the event. This should perhaps be a configurable option? - return false; - } - - float Input::CalculateEventValue(const AzFramework::InputChannel& inputChannel) const - { - return inputChannel.GetValue(); - } - - void Input::SendEventsInternal(float value, const AzFramework::LocalUserId& localUserIdOfEvent, const AZ::InputEventNotificationId busId, InputEventType eventType) - { - value *= m_eventValueMultiplier; - - AZ::InputEventNotificationId localUserBusId = AZ::InputEventNotificationId(localUserIdOfEvent, busId.m_actionNameCrc); - AZ::InputEventNotificationBus::Event(localUserBusId, eventType, value); - - AZ::InputEventNotificationId wildCardBusId = AZ::InputEventNotificationId(AzFramework::LocalUserIdAny, busId.m_actionNameCrc); - AZ::InputEventNotificationBus::Event(wildCardBusId, eventType, value); - } - - void Input::Activate(const AZ::InputEventNotificationId& eventNotificationId) - { - const AzFramework::InputDevice* inputDevice = AzFramework::InputDeviceRequests::FindInputDevice(AzFramework::InputDeviceId(m_inputDeviceType.c_str())); - if (!inputDevice || !inputDevice->IsSupported()) - { - // The input device that this input binding would be listening for input from - // is not supported on the current platform, so don't bother even activating. - // Please note distinction between InputDevice::IsSupported and IsConnected. - return; - } - - const AZ::Crc32 channelNameFilter(m_inputName.c_str()); - const AZ::Crc32 deviceNameFilter(m_inputDeviceType.c_str()); - const AzFramework::LocalUserId localUserIdFilter(eventNotificationId.m_localUserId); - AZStd::shared_ptr filter = AZStd::make_shared(channelNameFilter, deviceNameFilter, localUserIdFilter); - InputChannelEventListener::SetFilter(filter); - InputChannelEventListener::Connect(); - m_wasPressed = false; - - m_outgoingBusId = eventNotificationId; - AZ::GlobalInputRecordRequestBus::Handler::BusConnect(); - AZ::EditableInputRecord editableRecord; - editableRecord.m_localUserId = eventNotificationId.m_localUserId; - editableRecord.m_deviceName = m_inputDeviceType; - editableRecord.m_eventGroup = eventNotificationId.m_actionNameCrc; - editableRecord.m_inputName = m_inputName; - AZ::InputRecordRequestBus::Handler::BusConnect(editableRecord); - } - - void Input::Deactivate(const AZ::InputEventNotificationId& eventNotificationId) - { - if (m_wasPressed) - { - AZ::InputEventNotificationBus::Event(m_outgoingBusId, &AZ::InputEventNotifications::OnReleased, 0.0f); - } - InputChannelEventListener::Disconnect(); - AZ::GlobalInputRecordRequestBus::Handler::BusDisconnect(); - AZ::InputRecordRequestBus::Handler::BusDisconnect(); - } - - AZStd::string Input::GetEditorText() const - { - return m_inputName.empty() ? "" : - m_inputName + (m_outputAxis == OutputAxis::X ? " (x-axis)" : " (y-axis)"); - } - - const AZStd::vector ThumbstickInput::GetInputDeviceTypes() const - { - // Gamepads are currently the only device type that support thumbstick input. - // We could (should) be more robust here by iterating over all input devices, - // looking for any with associated input channels of type InputChannelAxis2D. - AZStd::vector retval; - retval.push_back(AzFramework::InputDeviceGamepad::Name); - return retval; - } - - const AZStd::vector ThumbstickInput::GetInputNamesBySelectedDevice() const - { - // Gamepads are currently the only device type that support thumbstick input. - // We could (should) be more robust here by iterating over all input devices, - // looking for any with associated input channels of type InputChannelAxis2D. - AZStd::vector retval; - retval.push_back(AzFramework::InputDeviceGamepad::ThumbStickAxis2D::L.GetName()); - retval.push_back(AzFramework::InputDeviceGamepad::ThumbStickAxis2D::R.GetName()); - return retval; - } - - bool ThumbstickInput::OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) - { - // Because we are sending all thumbstick events regardless of if they are inside the dead-zone - // (see InputChannelAxis2D::ProcessRawInputEvent) - // ThumbstickInput components can effectively cancel themselves out if they happen to be setup - // to receive input from a local user id that is signed into multiple controllers at the same - // time. If the controller not being used is updated last, the (~0, ~0) events it sends every - // frame cause the base Input::OnInputChannelEventFiltered function to determine that we need - // to send an InputEventNotificationBus::Events::OnReleased event because m_wasPressed is set - // to true by the other controller that is actually in use (and that is being updated first). - // - // To combat this, anytime we enter the m_wasPressed == true state we'll store a reference to - // the input device id that sent the event (see below). Each time we receive an event we will - // then check whether it's originating from the same input device id, and if not we will just - // ignore it. Please note that while taking the address of the device id is a little sketchy, - // we can do this because it's lifecycle is guaranteed to be longer than that of this object - // UNLESS we ever start calling InputSystemComponent::RecreateEnabledInputDevices somewhere. - // - // Now in this case, the old InputDevice that owns the InputChannelId will be destroyed, but - // not before the InputChannels it owns are destroyed first meaning InputChannel::ResetState - // will be called, the internal state of the input channels will be reset, and an event will - // be broadcast that will ultimately result in m_wasPressed being set to false and therefore - // m_wasLastPressedByInputDeviceId being set to nullptr below instead of becoming a dangling - // pointer. I definitely don't like this much, as it is risky behavior entirely dependent on - // the internal workings of the AzFramework input system, but it's the fastest way to perform - // this additional check. The alternative is to store the last pressed InputDeviceId by value, - // but this would involve a (slightly) more expensive check (see InputDeviceId::operator==), - // along with a string copy each time we set/reset the value (see InputDeviceId::operator=). - // - // At some point it may be worth looking at doing this check (or a safer version of it) in - // the base Input::OnInputChannelEventFiltered function, because the 'one user logged into - // multiple controllers' situation could conceivably cause strange behaviour for all types - // of input bindings (albeit only if the user were to actively use both controllers at the - // same time, in which case who can even really say what the correct behaviour should be?). - // But that would be a far riskier change, and because it's only a problem for thumb-stick - // input we're sending even when the controller is completely idle this fix will do for now. - const InputDeviceId* inputDeviceId = &(inputChannel.GetInputDevice().GetInputDeviceId()); - if (m_wasLastPressedByInputDeviceId && m_wasLastPressedByInputDeviceId != inputDeviceId) - { - return false; - } - - const bool shouldBeConsumed = Input::OnInputChannelEventFiltered(inputChannel); - m_wasLastPressedByInputDeviceId = m_wasPressed ? inputDeviceId : nullptr; - return shouldBeConsumed; - } - - float ThumbstickInput::CalculateEventValue(const AzFramework::InputChannel& inputChannel) const - { - const AzFramework::InputChannelAxis2D::AxisData2D* axisData2D = inputChannel.GetCustomData(); - if (axisData2D == nullptr) - { - AZ_Warning("ThumbstickInput", false, "InputChannel with id '%s' has no axis data 2D", inputChannel.GetInputChannelId().GetName()); - return 0.0f; - } - - const AZ::Vector2 outputValues = ApplyDeadZonesAndSensitivity(axisData2D->m_preDeadZoneValues, - m_innerDeadZoneRadius, - m_outerDeadZoneRadius, - m_axisDeadZoneValue, - m_sensitivityExponent); - - // Ideally we would return both values here and allow each to be mapped to a different output - // event, but that would require a greater re-factor of both the InputManagementFramework Gem - // and the StartingPointInput Gem, and there is nothing preventing anyone from setting up one - // ThumbstickInput component for each axis so it would only be a simplification/optimization. - const float axisValueToReturn = (m_outputAxis == OutputAxis::X) ? outputValues.GetX() : outputValues.GetY(); - return axisValueToReturn; - } - - AZ::Vector2 ThumbstickInput::ApplyDeadZonesAndSensitivity(const AZ::Vector2& inputValues, float innerDeadZone, float outerDeadZone, float axisDeadZone, float sensitivityExponent) - { - static const AZ::Vector2 zeroVector = AZ::Vector2::CreateZero(); - const AZ::Vector2 rawAbsValues(fabsf(inputValues.GetX()), fabsf(inputValues.GetY())); - const float rawLength = rawAbsValues.GetLength(); - if (rawLength == 0.0f) - { - return zeroVector; - } - - // Apply the circular dead zones - const AZ::Vector2 normalizedValues = rawAbsValues / rawLength; - const float postCircularDeadZoneLength = AZ::GetClamp((rawLength - innerDeadZone) / (outerDeadZone - innerDeadZone), 0.0f, 1.0f); - AZ::Vector2 absValues = normalizedValues * postCircularDeadZoneLength; - - // Apply the per-axis dead zone - const AZ::Vector2 absAxisValues = zeroVector.GetMax(rawAbsValues - AZ::Vector2(axisDeadZone, axisDeadZone)) / (outerDeadZone - axisDeadZone); - - // Merge the circular and per-axis dead zones. The resulting values are the smallest ones (dead zone takes priority). And restore the components sign. - const AZ::Vector2 signValues(AZ::GetSign(inputValues.GetX()), AZ::GetSign(inputValues.GetY())); - AZ::Vector2 values = absValues.GetMin(absAxisValues) * signValues; - - // Rescale the vector using the post circular dead zone length, which is the real stick vector length, - // to avoid any jump in values when the stick is fully pushed along an axis and slowly getting out of the axis dead zone - // Additionally, apply the sensitivity curve to the final stick vector length - const float postAxisDeadZoneLength = values.GetLength(); - if (postAxisDeadZoneLength > 0.0f) - { - values /= postAxisDeadZoneLength; - - const float postSensitivityLength = powf(postCircularDeadZoneLength, sensitivityExponent); - values *= postSensitivityLength; - } - - return values; - } -} // namespace Input diff --git a/Gems/StartingPointInput/Code/Source/Input.h b/Gems/StartingPointInput/Code/Source/Input.h deleted file mode 100644 index f6734a4f71..0000000000 --- a/Gems/StartingPointInput/Code/Source/Input.h +++ /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 - * - */ -#pragma once -#include -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - class ReflectContext; -} - -namespace Input -{ - ////////////////////////////////////////////////////////////////////////// - /// Input handles raw input from any source and outputs Pressed, Held, and Released input events - class Input - : public InputSubComponent - , protected AzFramework::InputChannelEventListener - , protected AZ::GlobalInputRecordRequestBus::Handler - , protected AZ::InputRecordRequestBus::Handler - { - public: - Input(); - ~Input() override = default; - AZ_RTTI(Input, "{546C9EBC-90EF-4F03-891A-0736BE2A487E}", InputSubComponent); - static void Reflect(AZ::ReflectContext* reflection); - - ////////////////////////////////////////////////////////////////////////// - // InputSubComponent - void Activate(const AZ::InputEventNotificationId& eventNotificationId) override; - void Deactivate(const AZ::InputEventNotificationId& eventNotificationId) override; - - protected: - AZStd::string GetEditorText() const; - virtual const AZStd::vector GetInputDeviceTypes() const; - virtual const AZStd::vector GetInputNamesBySelectedDevice() const; - - AZ::Crc32 OnDeviceSelected(); - - ////////////////////////////////////////////////////////////////////////// - // AZ::GlobalInputRecordRequests::Handler - void GatherEditableInputRecords(AZ::EditableInputRecords& outResults) override; - - ////////////////////////////////////////////////////////////////////////// - // AZ::EditableInputRecord::Handler - void SetInputRecord(const AZ::EditableInputRecord& newInputRecord) override; - - ////////////////////////////////////////////////////////////////////////// - // AzFramework::InputChannelEventListener - bool OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) override; - - using InputEventType = void(AZ::InputEventNotificationBus::Events::*)(float); - virtual float CalculateEventValue(const AzFramework::InputChannel& inputChannel) const; - void SendEventsInternal(float value, const AzFramework::LocalUserId& localUserIdOfEvent, const AZ::InputEventNotificationId busId, InputEventType eventType); - - ////////////////////////////////////////////////////////////////////////// - // Non Reflected Data - AZ::InputEventNotificationId m_outgoingBusId; - bool m_wasPressed = false; - - ////////////////////////////////////////////////////////////////////////// - // Reflected Data - float m_eventValueMultiplier = 1.f; - AZStd::string m_inputName = ""; - AZStd::string m_inputDeviceType = ""; - float m_deadZone = 0.0f; - }; - - ////////////////////////////////////////////////////////////////////////// - /// ThumbstickInput handles raw input from thumbstick sources, applies any - /// custom dead-zone or sensitivity curve calculations, and then outputs - /// Pressed, Held, and Released input events for the specified axis - class ThumbstickInput - : public Input - { - public: - ThumbstickInput(); - ~ThumbstickInput() override = default; - AZ_RTTI(ThumbstickInput, "{4881FA7C-0667-476C-8C77-4DBB6C69F646}", Input); - static void Reflect(AZ::ReflectContext* reflection); - - protected: - ////////////////////////////////////////////////////////////////////////// - // InputSubComponent - AZStd::string GetEditorText() const; - const AZStd::vector GetInputDeviceTypes() const override; - const AZStd::vector GetInputNamesBySelectedDevice() const override; - bool OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) override; - float CalculateEventValue(const AzFramework::InputChannel& inputChannel) const override; - - static AZ::Vector2 ApplyDeadZonesAndSensitivity(const AZ::Vector2& inputValues, - float innerDeadZone, - float outerDeadZone, - float axisDeadZone, - float sensitivityExponent); - - enum class OutputAxis - { - X, - Y - }; - - ////////////////////////////////////////////////////////////////////////// - // Non Reflected Data - const AzFramework::InputDeviceId* m_wasLastPressedByInputDeviceId = nullptr; - - ////////////////////////////////////////////////////////////////////////// - // Reflected Data - float m_innerDeadZoneRadius = 0.0f; - float m_outerDeadZoneRadius = 1.0f; - float m_axisDeadZoneValue = 0.0f; - float m_sensitivityExponent = 1.0f; - OutputAxis m_outputAxis = OutputAxis::X; - }; -} // namespace Input From 03f734c8b3b96b6fcffd51227353088e37acac2a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:52:40 -0800 Subject: [PATCH 244/394] Removes LyToAzInputNameConversions.h from Gems/StartingPointMovement Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/LyToAzInputNameConversions.h | 231 ------------------ 1 file changed, 231 deletions(-) delete mode 100644 Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h diff --git a/Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h b/Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h deleted file mode 100644 index cc94ce1dd5..0000000000 --- a/Gems/StartingPointInput/Code/Source/LyToAzInputNameConversions.h +++ /dev/null @@ -1,231 +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 -#include -#include - -namespace Input -{ - using namespace AzFramework; - - ////////////////////////////////////////////////////////////////////////// - inline AZStd::string ConvertInputDeviceName(AZStd::string inputDeviceName) - { - // Using std::unordered_map instead of AZStd to avoid allocator issues - static const std::unordered_map map = - { - { "mouse", InputDeviceMouse::Id.GetName() }, - { "keyboard", InputDeviceKeyboard::Id.GetName() }, - { "gamepad", InputDeviceGamepad::Name }, - { "game console controller", InputDeviceGamepad::Name }, - { "other game console controller", InputDeviceGamepad::Name }, - { "Oculus Touch Controller", "oculus_controllers" }, - { "OpenVR Controller", "openvr_controllers" } - }; - - const auto& it = map.find(inputDeviceName.c_str()); - return it != map.end() ? it->second.c_str() : inputDeviceName.c_str(); - } - - ////////////////////////////////////////////////////////////////////////// - inline AZStd::string ConvertInputEventName(AZStd::string inputEventName) - { - // Using std::unordered_map instead of AZStd to avoid allocator issues - static const std::unordered_map map = - { - { "mouse1", InputDeviceMouse::Button::Left.GetName() }, - { "mouse2", InputDeviceMouse::Button::Right.GetName() }, - { "mouse3", InputDeviceMouse::Button::Middle.GetName() }, - { "mouse4", InputDeviceMouse::Button::Other1.GetName() }, - { "mouse5", InputDeviceMouse::Button::Other2.GetName() }, - { "maxis_x", InputDeviceMouse::Movement::X.GetName() }, - { "maxis_y", InputDeviceMouse::Movement::Y.GetName() }, - { "maxis_z", InputDeviceMouse::Movement::Z.GetName() }, - { "mwheel_up", InputDeviceMouse::Movement::Z.GetName() }, - { "mwheel_down", InputDeviceMouse::Movement::Z.GetName() }, - { "mouse_pos", InputDeviceMouse::SystemCursorPosition.GetName() }, - - { "escape", InputDeviceKeyboard::Key::Escape.GetName() }, - { "1", InputDeviceKeyboard::Key::Alphanumeric1.GetName() }, - { "2", InputDeviceKeyboard::Key::Alphanumeric2.GetName() }, - { "3", InputDeviceKeyboard::Key::Alphanumeric3.GetName() }, - { "4", InputDeviceKeyboard::Key::Alphanumeric4.GetName() }, - { "5", InputDeviceKeyboard::Key::Alphanumeric5.GetName() }, - { "6", InputDeviceKeyboard::Key::Alphanumeric6.GetName() }, - { "7", InputDeviceKeyboard::Key::Alphanumeric7.GetName() }, - { "8", InputDeviceKeyboard::Key::Alphanumeric8.GetName() }, - { "9", InputDeviceKeyboard::Key::Alphanumeric9.GetName() }, - { "0", InputDeviceKeyboard::Key::Alphanumeric0.GetName() }, - { "minus", InputDeviceKeyboard::Key::PunctuationHyphen.GetName() }, - { "equals", InputDeviceKeyboard::Key::PunctuationEquals.GetName() }, - { "backspace", InputDeviceKeyboard::Key::EditBackspace.GetName() }, - { "tab", InputDeviceKeyboard::Key::EditTab.GetName() }, - { "q", InputDeviceKeyboard::Key::AlphanumericQ.GetName() }, - { "w", InputDeviceKeyboard::Key::AlphanumericW.GetName() }, - { "e", InputDeviceKeyboard::Key::AlphanumericE.GetName() }, - { "r", InputDeviceKeyboard::Key::AlphanumericR.GetName() }, - { "t", InputDeviceKeyboard::Key::AlphanumericT.GetName() }, - { "y", InputDeviceKeyboard::Key::AlphanumericY.GetName() }, - { "u", InputDeviceKeyboard::Key::AlphanumericU.GetName() }, - { "i", InputDeviceKeyboard::Key::AlphanumericI.GetName() }, - { "o", InputDeviceKeyboard::Key::AlphanumericO.GetName() }, - { "p", InputDeviceKeyboard::Key::AlphanumericP.GetName() }, - { "lbracket", InputDeviceKeyboard::Key::PunctuationBracketL.GetName() }, - { "rbracket", InputDeviceKeyboard::Key::PunctuationBracketR.GetName() }, - { "enter", InputDeviceKeyboard::Key::EditEnter.GetName() }, - { "lctrl", InputDeviceKeyboard::Key::ModifierCtrlL.GetName() }, - { "a", InputDeviceKeyboard::Key::AlphanumericA.GetName() }, - { "s", InputDeviceKeyboard::Key::AlphanumericS.GetName() }, - { "d", InputDeviceKeyboard::Key::AlphanumericD.GetName() }, - { "f", InputDeviceKeyboard::Key::AlphanumericF.GetName() }, - { "g", InputDeviceKeyboard::Key::AlphanumericG.GetName() }, - { "h", InputDeviceKeyboard::Key::AlphanumericH.GetName() }, - { "j", InputDeviceKeyboard::Key::AlphanumericJ.GetName() }, - { "k", InputDeviceKeyboard::Key::AlphanumericK.GetName() }, - { "l", InputDeviceKeyboard::Key::AlphanumericL.GetName() }, - { "semicolon", InputDeviceKeyboard::Key::PunctuationSemicolon.GetName() }, - { "apostrophe", InputDeviceKeyboard::Key::PunctuationApostrophe.GetName() }, - { "tilde", InputDeviceKeyboard::Key::PunctuationTilde.GetName() }, - { "lshift", InputDeviceKeyboard::Key::ModifierShiftL.GetName() }, - { "backslash", InputDeviceKeyboard::Key::PunctuationBackslash.GetName() }, - { "z", InputDeviceKeyboard::Key::AlphanumericZ.GetName() }, - { "x", InputDeviceKeyboard::Key::AlphanumericX.GetName() }, - { "c", InputDeviceKeyboard::Key::AlphanumericC.GetName() }, - { "v", InputDeviceKeyboard::Key::AlphanumericV.GetName() }, - { "b", InputDeviceKeyboard::Key::AlphanumericB.GetName() }, - { "n", InputDeviceKeyboard::Key::AlphanumericN.GetName() }, - { "m", InputDeviceKeyboard::Key::AlphanumericM.GetName() }, - { "comma", InputDeviceKeyboard::Key::PunctuationComma.GetName() }, - { "period", InputDeviceKeyboard::Key::PunctuationPeriod.GetName() }, - { "slash", InputDeviceKeyboard::Key::PunctuationSlash.GetName() }, - { "rshift", InputDeviceKeyboard::Key::ModifierShiftR.GetName() }, - { "np_multiply", InputDeviceKeyboard::Key::NumPadMultiply.GetName() }, - { "lalt", InputDeviceKeyboard::Key::ModifierAltL.GetName() }, - { "space", InputDeviceKeyboard::Key::EditSpace.GetName() }, - { "capslock", InputDeviceKeyboard::Key::EditCapsLock.GetName() }, - { "f1", InputDeviceKeyboard::Key::Function01.GetName() }, - { "f2", InputDeviceKeyboard::Key::Function02.GetName() }, - { "f3", InputDeviceKeyboard::Key::Function03.GetName() }, - { "f4", InputDeviceKeyboard::Key::Function04.GetName() }, - { "f5", InputDeviceKeyboard::Key::Function05.GetName() }, - { "f6", InputDeviceKeyboard::Key::Function06.GetName() }, - { "f7", InputDeviceKeyboard::Key::Function07.GetName() }, - { "f8", InputDeviceKeyboard::Key::Function08.GetName() }, - { "f9", InputDeviceKeyboard::Key::Function09.GetName() }, - { "f10", InputDeviceKeyboard::Key::Function10.GetName() }, - { "numlock", InputDeviceKeyboard::Key::NumLock.GetName() }, - { "scrolllock", InputDeviceKeyboard::Key::WindowsSystemScrollLock.GetName() }, - { "np_7", InputDeviceKeyboard::Key::NumPad7.GetName() }, - { "np_8", InputDeviceKeyboard::Key::NumPad8.GetName() }, - { "np_9", InputDeviceKeyboard::Key::NumPad9.GetName() }, - { "np_subtract", InputDeviceKeyboard::Key::NumPadSubtract.GetName() }, - { "np_4", InputDeviceKeyboard::Key::NumPad4.GetName() }, - { "np_5", InputDeviceKeyboard::Key::NumPad5.GetName() }, - { "np_6", InputDeviceKeyboard::Key::NumPad6.GetName() }, - { "np_add", InputDeviceKeyboard::Key::NumPadAdd.GetName() }, - { "np_1", InputDeviceKeyboard::Key::NumPad1.GetName() }, - { "np_2", InputDeviceKeyboard::Key::NumPad2.GetName() }, - { "np_3", InputDeviceKeyboard::Key::NumPad3.GetName() }, - { "np_0", InputDeviceKeyboard::Key::NumPad0.GetName() }, - { "np_period", InputDeviceKeyboard::Key::NumPadDecimal.GetName() }, - { "f11", InputDeviceKeyboard::Key::Function11.GetName() }, - { "f12", InputDeviceKeyboard::Key::Function12.GetName() }, - { "f13", InputDeviceKeyboard::Key::Function13.GetName() }, - { "f14", InputDeviceKeyboard::Key::Function14.GetName() }, - { "f15", InputDeviceKeyboard::Key::Function15.GetName() }, - { "np_enter", InputDeviceKeyboard::Key::NumPadEnter.GetName() }, - { "rctrl", InputDeviceKeyboard::Key::ModifierCtrlR.GetName() }, - { "np_divide", InputDeviceKeyboard::Key::NumPadDivide.GetName() }, - { "print", InputDeviceKeyboard::Key::WindowsSystemPrint.GetName() }, - { "ralt", InputDeviceKeyboard::Key::ModifierAltR.GetName() }, - { "pause", InputDeviceKeyboard::Key::WindowsSystemPause.GetName() }, - { "home", InputDeviceKeyboard::Key::NavigationHome.GetName() }, - { "up", InputDeviceKeyboard::Key::NavigationArrowUp.GetName() }, - { "pgup", InputDeviceKeyboard::Key::NavigationPageUp.GetName() }, - { "left", InputDeviceKeyboard::Key::NavigationArrowLeft.GetName() }, - { "right", InputDeviceKeyboard::Key::NavigationArrowRight.GetName() }, - { "end", InputDeviceKeyboard::Key::NavigationEnd.GetName() }, - { "down", InputDeviceKeyboard::Key::NavigationArrowDown.GetName() }, - { "pgdn", InputDeviceKeyboard::Key::NavigationPageDown.GetName() }, - { "insert", InputDeviceKeyboard::Key::NavigationInsert.GetName() }, - { "delete", InputDeviceKeyboard::Key::NavigationDelete.GetName() }, - { "oem_102", InputDeviceKeyboard::Key::SupplementaryISO.GetName() }, - - { "gamepad_a", InputDeviceGamepad::Button::A.GetName() }, - { "gamepad_b", InputDeviceGamepad::Button::B.GetName() }, - { "gamepad_x", InputDeviceGamepad::Button::X.GetName() }, - { "gamepad_y", InputDeviceGamepad::Button::Y.GetName() }, - { "gamepad_l1", InputDeviceGamepad::Button::L1.GetName() }, - { "gamepad_r1", InputDeviceGamepad::Button::R1.GetName() }, - { "gamepad_l2", InputDeviceGamepad::Trigger::L2.GetName() }, - { "gamepad_r2", InputDeviceGamepad::Trigger::R2.GetName() }, - { "gamepad_l3", InputDeviceGamepad::Button::L3.GetName() }, - { "gamepad_r3", InputDeviceGamepad::Button::R3.GetName() }, - { "gamepad_up", InputDeviceGamepad::Button::DU.GetName() }, - { "gamepad_down", InputDeviceGamepad::Button::DD.GetName() }, - { "gamepad_left", InputDeviceGamepad::Button::DL.GetName() }, - { "gamepad_right", InputDeviceGamepad::Button::DR.GetName() }, - { "gamepad_start", InputDeviceGamepad::Button::Start.GetName() }, - { "gamepad_select", InputDeviceGamepad::Button::Select.GetName() }, - { "gamepad_sticklx", InputDeviceGamepad::ThumbStickAxis1D::LX.GetName() }, - { "gamepad_stickly", InputDeviceGamepad::ThumbStickAxis1D::LY.GetName() }, - { "gamepad_stickrx", InputDeviceGamepad::ThumbStickAxis1D::RX.GetName() }, - { "gamepad_stickry", InputDeviceGamepad::ThumbStickAxis1D::RY.GetName() }, - - // Additional platform device configurations may be added here - - { "OculusTouch_A", "oculus_button_a" }, - { "OculusTouch_B", "oculus_button_b" }, - { "OculusTouch_X", "oculus_button_x" }, - { "OculusTouch_Y", "oculus_button_y" }, - { "OculusTouch_LeftThumbstickButton", "oculus_button_l3" }, - { "OculusTouch_RightThumbstickButton", "oculus_button_r3" }, - { "OculusTouch_LeftTrigger", "oculus_trigger_l1" }, - { "OculusTouch_RightTrigger", "oculus_trigger_r1" }, - { "OculusTouch_LeftHandTrigger", "oculus_trigger_l2" }, - { "OculusTouch_RightHandTrigger", "oculus_trigger_r2" }, - { "OculusTouch_LeftThumbstickX", "oculus_thumbstick_l_x" }, - { "OculusTouch_LeftThumbstickY", "oculus_thumbstick_l_y" }, - { "OculusTouch_RightThumbstickX", "oculus_thumbstick_r_x" }, - { "OculusTouch_RightThumbstickY", "oculus_thumbstick_r_y" }, - - { "OpenVR_A_0", "openvr_button_a_l" }, - { "OpenVR_A_1", "openvr_button_a_r" }, - { "OpenVR_DPadUp_0", "openvr_button_d_up_l" }, - { "OpenVR_DPadDown_0", "openvr_button_d_down_l" }, - { "OpenVR_DPadLeft_0", "openvr_button_d_left_l" }, - { "OpenVR_DPadRight_0", "openvr_button_d_right_l" }, - { "OpenVR_DPadUp_1", "openvr_button_d_up_r" }, - { "OpenVR_DPadDown_1", "openvr_button_d_down_r" }, - { "OpenVR_DPadLeft_1", "openvr_button_d_left_r" }, - { "OpenVR_DPadRight_1", "openvr_button_d_right_r" }, - { "OpenVR_Grip_0", "openvr_button_grip_l" }, - { "OpenVR_Grip_1", "openvr_button_grip_r" }, - { "OpenVR_Application_0", "openvr_button_start_l" }, - { "OpenVR_Application_1", "openvr_button_start_r" }, - { "OpenVR_System_0", "openvr_button_select_l" }, - { "OpenVR_System_1", "openvr_button_select_r" }, - { "OpenVR_TriggerButton_0", "openvr_button_trigger_l" }, - { "OpenVR_TriggerButton_1", "openvr_button_trigger_r" }, - { "OpenVR_TouchpadButton_0", "openvr_button_touchpad_l" }, - { "OpenVR_TouchpadButton_1", "openvr_button_touchpad_r" }, - { "OpenVR_Trigger_0", "openvr_trigger_l1" }, - { "OpenVR_Trigger_1", "openvr_trigger_r1" }, - { "OpenVR_TouchpadX_0", "openvr_touchpad_l_x" }, - { "OpenVR_TouchpadY_0", "openvr_touchpad_l_y" }, - { "OpenVR_TouchpadX_1", "openvr_touchpad_r_x" }, - { "OpenVR_TouchpadY_1", "openvr_touchpad_r_y" } - }; - - const auto& it = map.find(inputEventName.c_str()); - return it != map.end() ? it->second.c_str() : inputEventName.c_str(); - } -} // namespace Input From b442cb9b3a6e5442c7707f4d69b9013ba744e61f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:56:14 -0800 Subject: [PATCH 245/394] Removes unused files from Gems/StartingPointMovement Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../StartingPointMovement/Code/CMakeLists.txt | 2 -- .../StartingPointMovementConstants.h | 21 -------------- .../StartingPointMovementUtilities.h | 29 ------------------- .../startingpointmovement_shared_files.cmake | 2 -- 4 files changed, 54 deletions(-) delete mode 100644 Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h delete mode 100644 Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h diff --git a/Gems/StartingPointMovement/Code/CMakeLists.txt b/Gems/StartingPointMovement/Code/CMakeLists.txt index 1225c922de..cef65f0574 100644 --- a/Gems/StartingPointMovement/Code/CMakeLists.txt +++ b/Gems/StartingPointMovement/Code/CMakeLists.txt @@ -14,8 +14,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore diff --git a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h b/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h deleted file mode 100644 index 9cc3c48c79..0000000000 --- a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementConstants.h +++ /dev/null @@ -1,21 +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 - -namespace Movement -{ - ////////////////////////////////////////////////////////////////////////// - /// These are intended to be used as an index and needs to be implicitly - /// convertible to int. See StartingPointMovementUtilities.h for examples - enum AxisOfRotation - { - X_Axis = 0, - Y_Axis = 1, - Z_Axis = 2 - }; -} //namespace Movement diff --git a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h b/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h deleted file mode 100644 index a7799a4caf..0000000000 --- a/Gems/StartingPointMovement/Code/Include/StartingPointMovement/StartingPointMovementUtilities.h +++ /dev/null @@ -1,29 +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 "StartingPointMovement/StartingPointMovementConstants.h" -#include -#include - -namespace Movement -{ - ////////////////////////////////////////////////////////////////////////// - /// This will calculate an AZ::Transform based on an axis of rotation and an angle - ////////////////////////////////////////////////////////////////////////// - static AZ::Transform CreateRotationFromAxis(AxisOfRotation rotationType, float radians) - { - static const AZ::Transform(*s_createRotation[3]) (const float) = - { - &AZ::Transform::CreateRotationX, - &AZ::Transform::CreateRotationY, - &AZ::Transform::CreateRotationZ - }; - return s_createRotation[rotationType](radians); - } -} //namespace Movement diff --git a/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake b/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake index 9d15aad6ff..e807bfe31f 100644 --- a/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake +++ b/Gems/StartingPointMovement/Code/startingpointmovement_shared_files.cmake @@ -8,6 +8,4 @@ set(FILES Source/StartingPointMovementGem.cpp - Include/StartingPointMovement/StartingPointMovementConstants.h - Include/StartingPointMovement/StartingPointMovementUtilities.h ) From 064a7f0b9ba3ff4d1acd766941be618d700d870c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 15:57:43 -0800 Subject: [PATCH 246/394] Removes FuelInterface from Gems/Twitch Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/Twitch/Code/Source/FuelInterface.h | 18 ------------------ Gems/Twitch/Code/Source/IFuelInterface.h | 21 --------------------- 2 files changed, 39 deletions(-) delete mode 100644 Gems/Twitch/Code/Source/FuelInterface.h delete mode 100644 Gems/Twitch/Code/Source/IFuelInterface.h diff --git a/Gems/Twitch/Code/Source/FuelInterface.h b/Gems/Twitch/Code/Source/FuelInterface.h deleted file mode 100644 index 560161083f..0000000000 --- a/Gems/Twitch/Code/Source/FuelInterface.h +++ /dev/null @@ -1,18 +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 - -namespace Twitch -{ - class AZ_DEPRECATED(, "The FuelInterface has been deprecated. HTTPRequest functionality has been moved to TwitchREST. Auth has been mvoed to TwitchSystemComponent. All remaining has been deprecated.") - FuelInterface - { - - }; -} diff --git a/Gems/Twitch/Code/Source/IFuelInterface.h b/Gems/Twitch/Code/Source/IFuelInterface.h deleted file mode 100644 index bc2e4a7c5a..0000000000 --- a/Gems/Twitch/Code/Source/IFuelInterface.h +++ /dev/null @@ -1,21 +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 Twitch -{ - class AZ_DEPRECATED(,"The IFuelInterface has been deprecated. HTTPRequest functionality has been moved to TwitchREST. Auth has been mvoed to TwitchSystemComponent. All remaining has been deprecated.") - IFuelInterface - { - - }; -} From ff6f6689a16e15eae9e8ea8b343fd0ed44c7927a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:00:35 -0800 Subject: [PATCH 247/394] Removes DependencyRequestBus from Gems/Vegetation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Vegetation/Ebuses/DependencyRequestBus.h | 32 ------------------- Gems/Vegetation/Code/Tests/VegetationMocks.h | 1 - Gems/Vegetation/Code/vegetation_files.cmake | 1 - 3 files changed, 34 deletions(-) delete mode 100644 Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h diff --git a/Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h b/Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h deleted file mode 100644 index e143d3d8cf..0000000000 --- a/Gems/Vegetation/Code/Include/Vegetation/Ebuses/DependencyRequestBus.h +++ /dev/null @@ -1,32 +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 -#include -#include - -namespace Vegetation -{ - /** - * the EBus is used to query entity and asset dependencies - */ - class DependencyRequests : public AZ::ComponentBus - { - public: - //! allows multiple threads to call - using MutexType = AZStd::recursive_mutex; - - virtual void GetEntityDependencies(AZStd::vector& dependencies) const = 0; - virtual void GetAssetDependencies(AZStd::vector& dependencies) const = 0; - }; - - typedef AZ::EBus DependencyRequestBus; -} diff --git a/Gems/Vegetation/Code/Tests/VegetationMocks.h b/Gems/Vegetation/Code/Tests/VegetationMocks.h index 3361afa177..a3bd80392d 100644 --- a/Gems/Vegetation/Code/Tests/VegetationMocks.h +++ b/Gems/Vegetation/Code/Tests/VegetationMocks.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/Vegetation/Code/vegetation_files.cmake b/Gems/Vegetation/Code/vegetation_files.cmake index b4d4e3a356..b839222b19 100644 --- a/Gems/Vegetation/Code/vegetation_files.cmake +++ b/Gems/Vegetation/Code/vegetation_files.cmake @@ -24,7 +24,6 @@ set(FILES Include/Vegetation/Ebuses/DebugNotificationBus.h Include/Vegetation/Ebuses/DebugRequestsBus.h Include/Vegetation/Ebuses/DebugSystemDataBus.h - Include/Vegetation/Ebuses/DependencyRequestBus.h Include/Vegetation/Ebuses/DescriptorNotificationBus.h Include/Vegetation/Ebuses/DescriptorProviderRequestBus.h Include/Vegetation/Ebuses/DescriptorSelectorRequestBus.h From 223baa7e458b3f6db1fb5cf8e2d77235c68a3944 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:04:46 -0800 Subject: [PATCH 248/394] Removes ProducerConsumerQueue.h and ConcurrentQueue.h from Gems/Vegetation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Source/Util/ConcurrentQueue.h | 80 ------------ .../Code/Source/Util/ProducerConsumerQueue.h | 119 ------------------ Gems/Vegetation/Code/vegetation_files.cmake | 2 - 3 files changed, 201 deletions(-) delete mode 100644 Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h delete mode 100644 Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h diff --git a/Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h b/Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h deleted file mode 100644 index 38a816808d..0000000000 --- a/Gems/Vegetation/Code/Source/Util/ConcurrentQueue.h +++ /dev/null @@ -1,80 +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 -#include - -namespace Vegetation -{ - /** - * Manages a light weight producer consumer storage container - */ - template > - class ConcurrentQueue final - { - public: - AZ_INLINE QueueType& ClaimQueue() - { - int lastQueue = Flip(); - return m_queueData[lastQueue]; - } - - AZ_INLINE QueueType& ClaimQueueNoSort() - { - int lastQueue = FlipNoSort(); - return m_queueData[lastQueue]; - } - - AZ_INLINE bool IsCurrentEmpty() const - { - return m_queueData[m_currentQueueIndex].empty(); - } - - AZ_INLINE void EmplaceBack(TItem item) - { - m_queueData[m_currentQueueIndex].emplace_back(AZStd::move(item)); - } - - AZ_INLINE void CopyBack(TItem item) - { - m_queueData[m_currentQueueIndex].push_back(item); - } - - AZ_INLINE void Insert(TItem item) - { - m_queueData[m_currentQueueIndex].insert(item); - } - - protected: - AZ_INLINE int Flip() - { - // get rid of possible duplicates - int processIndex = FlipNoSort(); - m_queueData[processIndex].sort(); - m_queueData[processIndex].unique(); - return processIndex; - } - - AZ_INLINE int FlipNoSort() - { - int processIndex = m_currentQueueIndex; - { - AZStd::lock_guard lock(m_queueMutex); - m_currentQueueIndex = 1 - m_currentQueueIndex; - } - return processIndex; - } - - private: - QueueType m_queueData[2]; - AZStd::atomic_int m_currentQueueIndex{0}; - AZStd::recursive_mutex m_queueMutex; - }; -} diff --git a/Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h b/Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h deleted file mode 100644 index 55e6385b93..0000000000 --- a/Gems/Vegetation/Code/Source/Util/ProducerConsumerQueue.h +++ /dev/null @@ -1,119 +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 -#include -#include -#include "ConcurrentQueue.h" - -namespace Vegetation -{ - /** - * A simple producer-consumer class to handle dual-threaded working queues - */ - template , typename ConsumerQueueType = AZStd::list> - class ProducerConsumerQueue final - { - public: - AZ_INLINE void EmplaceBack(TItem item) - { - m_producerQueue.EmplaceBack(AZStd::move(item)); - } - - AZ_INLINE void CopyBack(TItem item) - { - m_producerQueue.CopyBack(item); - } - - AZ_INLINE bool IsEmpty() const - { - if (m_producerQueue.IsCurrentEmpty()) - { - AZStd::lock_guard lock(m_consumerQueueMutex); - return m_consumerQueue.empty(); - } - return false; - } - - using ItemFunc = AZStd::function; - using ContinueFunc = AZStd::function; - - // on ItemFunc return TRUE, remove from consumer queue - AZ_INLINE void Consume(ItemFunc consumeItemFunc, ContinueFunc continueFunc) - { - if (CanConsume()) - { - PrepareConsumer(); - } - - // attempt to consume the items - AZStd::lock_guard lock(m_consumerQueueMutex); - auto itItem = m_consumerQueue.begin(); - while (itItem != m_consumerQueue.end()) - { - if (consumeItemFunc(*itItem)) - { - itItem = m_consumerQueue.erase(itItem); - } - else - { - ++itItem; - } - if (!continueFunc()) - { - break; - } - } - } - - // on ItemFunc return TRUE, stop processing - AZ_INLINE void Process(ItemFunc processItemFunc) - { - if (CanConsume()) - { - PrepareConsumer(); - } - - // process the locked queue - AZStd::lock_guard lock(m_consumerQueueMutex); - auto itItem = m_consumerQueue.begin(); - while (itItem != m_consumerQueue.end()) - { - if (processItemFunc(*itItem)) - { - break; - } - ++itItem; - } - } - - protected: - AZ_INLINE bool CanConsume() const - { - return !m_producerQueue.IsCurrentEmpty(); - } - - AZ_INLINE void PrepareConsumer() - { - AZStd::lock_guard lock(m_consumerQueueMutex); - auto& itemList = m_producerQueue.ClaimQueueNoSort(); - while (!itemList.empty()) - { - m_consumerQueue.emplace_back(AZStd::move(itemList.back())); - itemList.pop_back(); - } - } - - private: - ProducerQueueType m_producerQueue; - ConsumerQueueType m_consumerQueue; - mutable AZStd::recursive_mutex m_consumerQueueMutex; - }; -} diff --git a/Gems/Vegetation/Code/vegetation_files.cmake b/Gems/Vegetation/Code/vegetation_files.cmake index b839222b19..b4e90cab97 100644 --- a/Gems/Vegetation/Code/vegetation_files.cmake +++ b/Gems/Vegetation/Code/vegetation_files.cmake @@ -87,8 +87,6 @@ set(FILES Source/Components/SurfaceMaskFilterComponent.h Source/Components/SurfaceSlopeFilterComponent.cpp Source/Components/SurfaceSlopeFilterComponent.h - Source/Util/ConcurrentQueue.h - Source/Util/ProducerConsumerQueue.h Source/Debugger/AreaDebugComponent.cpp Source/Debugger/AreaDebugComponent.h Source/Debugger/DebugComponent.cpp From c1d2da990a6d355df30471a957623e600d5b1e67 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:11:39 -0800 Subject: [PATCH 249/394] Removes WhiteBoxAllocator and EditorWhiteBoxBus from Gems/WhiteBox Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Include/WhiteBox/EditorWhiteBoxBus.h | 28 --------------- .../Code/Source/WhiteBoxAllocator.cpp | 13 ------- Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h | 34 ------------------- Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp | 4 --- .../whitebox_editor_supported_files.cmake | 1 - .../Code/whitebox_supported_files.cmake | 2 -- 6 files changed, 82 deletions(-) delete mode 100644 Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h delete mode 100644 Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp delete mode 100644 Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h diff --git a/Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h b/Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h deleted file mode 100644 index 841d86003e..0000000000 --- a/Gems/WhiteBox/Code/Include/WhiteBox/EditorWhiteBoxBus.h +++ /dev/null @@ -1,28 +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 - -namespace WhiteBox -{ - //! EditorWhiteBox system level requests. - class EditorWhiteBoxRequests : public AZ::EBusTraits - { - public: - // EBusTraits overrides ... - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - protected: - ~EditorWhiteBoxRequests() = default; - }; - - using EditorWhiteBoxRequestBus = AZ::EBus; -} // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp b/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp deleted file mode 100644 index a0c873d14a..0000000000 --- a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.cpp +++ /dev/null @@ -1,13 +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 "WhiteBoxAllocator.h" - -namespace WhiteBox -{ -} // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h b/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h deleted file mode 100644 index a66c6d021b..0000000000 --- a/Gems/WhiteBox/Code/Source/WhiteBoxAllocator.h +++ /dev/null @@ -1,34 +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 WhiteBox -{ - //! White Box Gem allocator for all default allocations. - class WhiteBoxAllocator : public AZ::SimpleSchemaAllocator> - { - public: - AZ_TYPE_INFO(WhiteBoxAllocator, "{BFEB8C64-FDB7-4A19-B9B4-DDF57A434F14}"); - - using Schema = AZ::ChildAllocatorSchema; - using Base = AZ::SimpleSchemaAllocator; - using Descriptor = Base::Descriptor; - - WhiteBoxAllocator() - : Base("White Box Allocator", "Child Allocator used to track White Box allocations") - { - } - }; - - //! Alias for using WhiteBoxAllocator with std container types. - using WhiteBoxAZStdAlloc = AZ::AZStdAlloc; -} // namespace WhiteBox diff --git a/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp b/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp index b0723667e9..27def67f1a 100644 --- a/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp +++ b/Gems/WhiteBox/Code/Source/WhiteBoxModule.cpp @@ -7,7 +7,6 @@ */ #include "Components/WhiteBoxColliderComponent.h" -#include "WhiteBoxAllocator.h" #include "WhiteBoxComponent.h" #include "WhiteBoxModule.h" #include "WhiteBoxSystemComponent.h" @@ -19,8 +18,6 @@ namespace WhiteBox WhiteBoxModule::WhiteBoxModule() : CryHooksModule() { - AZ::AllocatorInstance::Create(); - // push results of [MyComponent]::CreateDescriptor() into m_descriptors here m_descriptors.insert( m_descriptors.end(), @@ -33,7 +30,6 @@ namespace WhiteBox WhiteBoxModule::~WhiteBoxModule() { - AZ::AllocatorInstance::Destroy(); } AZ::ComponentTypeList WhiteBoxModule::GetRequiredSystemComponents() const diff --git a/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake b/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake index ac4746b5a7..71dc8b9289 100644 --- a/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake +++ b/Gems/WhiteBox/Code/whitebox_editor_supported_files.cmake @@ -7,7 +7,6 @@ # set(FILES - Include/WhiteBox/EditorWhiteBoxBus.h Include/WhiteBox/EditorWhiteBoxComponentBus.h Include/WhiteBox/WhiteBoxToolApi.h Include/WhiteBox/EditorWhiteBoxColliderBus.h diff --git a/Gems/WhiteBox/Code/whitebox_supported_files.cmake b/Gems/WhiteBox/Code/whitebox_supported_files.cmake index 87eb594eb5..faf054c9d6 100644 --- a/Gems/WhiteBox/Code/whitebox_supported_files.cmake +++ b/Gems/WhiteBox/Code/whitebox_supported_files.cmake @@ -8,8 +8,6 @@ set(FILES Include/WhiteBox/WhiteBoxBus.h - Source/WhiteBoxAllocator.cpp - Source/WhiteBoxAllocator.h Source/WhiteBoxComponent.cpp Source/WhiteBoxComponent.h Source/WhiteBoxSystemComponent.cpp From ef9e95c1db715a612ef7cb6870014d4be4e65727 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:12:17 -0800 Subject: [PATCH 250/394] More improvements to the unused_compilation script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unusued_compilation.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unusued_compilation.py index 4515a663af..1bd69d496f 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unusued_compilation.py @@ -20,11 +20,15 @@ EXCLUSIONS = ( 'REGISTER_QT_CLASS_DESC(', 'TEST(', 'TEST_F(', + 'TEST_P(', 'INSTANTIATE_TEST_CASE_P(', 'INSTANTIATE_TYPED_TEST_CASE_P(', 'AZ_UNIT_TEST_HOOK(', 'IMPLEMENT_TEST_EXECUTABLE_MAIN(', + 'BENCHMARK_REGISTER_F(', 'DllMain(', + 'wWinMain(', + 'AZ_DLL_EXPORT', 'CreatePluginInstance(' ) PATH_EXCLUSIONS = ( @@ -37,7 +41,9 @@ PATH_EXCLUSIONS = ( 'python\\*', 'build\\*', 'install\\*', - 'Code\\Framework\\AzCore\\AzCore\\Android\\*' + 'Code\\Framework\\AzCore\\AzCore\\Android\\*', + 'Gems\\ImGui\\External\\ImGui\\*', + '*_Traits_*.h', ) @@ -104,7 +110,7 @@ def cleanup_unused_compilation(path): with open(file, 'w') as source_file: source_file.write('') # d. build - ret = ci_build.build('build_config.json', 'Windows', 'profile_vs2019') + ret = ci_build.build('build_config.json', 'Windows', 'profile') # e.1 if build succeeds, leave the file empty (leave backup) # e.2 if build fails, restore backup if ret != 0: From 4800aebe6583b3c5493cb22bdad734e4a80a6fdf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 20 Jan 2022 15:46:15 -0800 Subject: [PATCH 251/394] Removes file that was removed but got missing after rebase Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake | 1 - Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake | 1 - 2 files changed, 2 deletions(-) diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake index 72a26c2884..222eebc6e9 100644 --- a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake @@ -9,7 +9,6 @@ set(FILES LmbrCentralEditorTest.cpp LmbrCentralReflectionTest.h - LmbrCentralReflectionTest.cpp EditorBoxShapeComponentTests.cpp EditorSphereShapeComponentTests.cpp EditorCapsuleShapeComponentTests.cpp diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake index 1555ff53d8..485fd77b61 100644 --- a/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake @@ -18,7 +18,6 @@ set(FILES QuadShapeTest.cpp TubeShapeTest.cpp LmbrCentralReflectionTest.h - LmbrCentralReflectionTest.cpp LmbrCentralTest.cpp ShapeGeometryUtilTest.cpp SpawnerComponentTest.cpp From 44c6ca294d4f106b9cb9bde3885f593f56ff3065 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:05:55 -0800 Subject: [PATCH 252/394] Fixes for rebasing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/ErrorReport.h | 3 --- Code/Editor/IEditorImpl.cpp | 1 + Code/Legacy/CrySystem/System.cpp | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 2ede92a8fe..a80bb36404 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,9 +17,6 @@ // forward declarations. class CParticleItem; -#include "BaseLibraryItem.h" -#include - #include "Objects/BaseObject.h" #include "Include/EditorCoreAPI.h" #include "Include/IErrorReport.h" diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index fc18e1f4c3..ec688b27c7 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -12,6 +12,7 @@ #include "EditorDefs.h" #include "IEditorImpl.h" +#include // Qt #include diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index a5cee3a6b6..0b82eded4e 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -461,6 +461,9 @@ bool CSystem::IsQuitting() const bool wasExitMainLoopRequested = false; AzFramework::ApplicationRequests::Bus::BroadcastResult(wasExitMainLoopRequested, &AzFramework::ApplicationRequests::WasExitMainLoopRequested); return wasExitMainLoopRequested; +} + +////////////////////////////////////////////////////////////////////////// ISystem* CSystem::GetCrySystem() { return this; From 1e591ab01974bec6fb997ac4f3e310c191499e12 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 21 Jan 2022 15:32:30 -0600 Subject: [PATCH 253/394] Removed const_cast now that we've switched from array_view to span Signed-off-by: Chris Galvan --- .../Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e2268dbdd8..76260f506e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -385,7 +385,7 @@ namespace AZ { size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); - auto& outValue = const_cast(outValues[outValuesIndex++]); + auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } @@ -412,7 +412,7 @@ namespace AZ { size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); - auto& outValue = const_cast(outValues[outValuesIndex++]); + auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } @@ -439,7 +439,7 @@ namespace AZ { size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); - auto& outValue = const_cast(outValues[outValuesIndex++]); + auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } From c13622c5afcf74426c9ca6d05cb866893cd436b9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 21 Jan 2022 16:07:27 -0600 Subject: [PATCH 254/394] Handled special case logic for SNORM minimum value conversion Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 76260f506e..1ed900b2b8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -146,8 +146,12 @@ namespace AZ case AZ::RHI::Format::R8_SNORM: { // Scale the value from AZ::s8 min/max to -1 to 1 + // We need to treat -128 and -127 the same, so that we get a symmetric + // range of -127 to 127 with complementary scaled values of -1 to 1 auto actualMem = reinterpret_cast(mem); - return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + AZ::s8 signedMax = std::numeric_limits::max(); + AZ::s8 signedMin = aznumeric_cast(-signedMax); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1, 1); } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: @@ -157,8 +161,12 @@ namespace AZ case AZ::RHI::Format::R16_SNORM: { // Scale the value from AZ::s16 min/max to -1 to 1 + // We need to treat -32768 and -32767 the same, so that we get a symmetric + // range of -32767 to 32767 with complementary scaled values of -1 to 1 auto actualMem = reinterpret_cast(mem); - return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + AZ::s16 signedMax = std::numeric_limits::max(); + AZ::s16 signedMin = aznumeric_cast(-signedMax); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1, 1); } case AZ::RHI::Format::R16_FLOAT: { From 29b3cf4fee581110e1cc9453fd28f0bec9a9f908 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:29:42 -0800 Subject: [PATCH 255/394] Fixes to the unused script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../cleanup/{unusued_compilation.py => unused_compilation.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename scripts/cleanup/{unusued_compilation.py => unused_compilation.py} (99%) diff --git a/scripts/cleanup/unusued_compilation.py b/scripts/cleanup/unused_compilation.py similarity index 99% rename from scripts/cleanup/unusued_compilation.py rename to scripts/cleanup/unused_compilation.py index 1bd69d496f..8aeadff309 100644 --- a/scripts/cleanup/unusued_compilation.py +++ b/scripts/cleanup/unused_compilation.py @@ -52,7 +52,7 @@ def create_filelist(path): for input_file in path: if os.path.isdir(input_file): for dp, dn, filenames in os.walk(input_file): - if 'build\\windows_vs2019' in dp: + if 'build\\windows' in dp: continue for f in filenames: extension = os.path.splitext(f)[1] From 6c31f45b9ea8a59e02e810bd120ccfad7a4dba2c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:30:36 -0800 Subject: [PATCH 256/394] Fixes the validation script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h | 0 .../Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp diff --git a/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h b/Code/Framework/AzFramework/AzFramework/Debug/DebugCameraBus.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.cpp deleted file mode 100644 index e69de29bb2..0000000000 From 109cab9b8aa34588ceb19afb322f681c94c2ed25 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:30:56 -0800 Subject: [PATCH 257/394] Fixes Linux generation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzToolsFramework/aztoolsframework_linux_files.cmake | 1 - .../AzToolsFramework/aztoolsframework_mac_files.cmake | 1 - 2 files changed, 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake index afd487daf7..af4bfcb8f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake @@ -29,5 +29,4 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui - ToolsFileUtils/ToolsFileUtils_generic.cpp ) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake index afd487daf7..af4bfcb8f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake @@ -29,5 +29,4 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui - ToolsFileUtils/ToolsFileUtils_generic.cpp ) From fd4014b2789689ef516c7af7ab01e0c56409e89b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 15:31:17 -0800 Subject: [PATCH 258/394] PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CryEditDoc.cpp | 4 ++-- Code/Editor/Util/MemoryBlock.cpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index bcd3efd770..c7d719184d 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -2129,12 +2129,12 @@ void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr) ////////////////////////////////////////////////////////////////////////// // AzToolsFramework::EditorEntityContextNotificationBus interface implementation -void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& ticket) { GetIEditor()->ResumeUndo(); } -void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& /*ticket*/) +void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& ticket) { GetIEditor()->ResumeUndo(); } diff --git a/Code/Editor/Util/MemoryBlock.cpp b/Code/Editor/Util/MemoryBlock.cpp index 6b57557f6f..eb4b53420b 100644 --- a/Code/Editor/Util/MemoryBlock.cpp +++ b/Code/Editor/Util/MemoryBlock.cpp @@ -169,12 +169,10 @@ void CMemoryBlock::Uncompress(CMemoryBlock& toBlock) const assert(this != &toBlock); toBlock.Allocate(m_uncompressedSize); toBlock.m_uncompressedSize = 0; -#if !defined(NDEBUG) unsigned long destSize = m_uncompressedSize; - int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); + [[maybe_unused]] int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize()); assert(result == Z_OK); assert(destSize == static_cast(m_uncompressedSize)); -#endif } ////////////////////////////////////////////////////////////////////////// From 4d62351628781092fedf1fb3e9f0a555e69fd863 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 21 Jan 2022 16:42:30 -0800 Subject: [PATCH 259/394] Fixes for Linux no unity builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/GuidUtil.cpp | 2 +- .../ToolsFileUtils/ToolsFileUtils_generic.cpp | 47 +++++++++++++++++++ .../UI/PropertyEditor/PropertyColorCtrl.cpp | 2 +- .../aztoolsframework_linux_files.cmake | 1 + .../aztoolsframework_mac_files.cmake | 1 + .../Source/RenderPlugin/CommandCallbacks.cpp | 1 + .../RenderPlugin/RenderUpdateCallback.cpp | 1 + .../Source/OpenGLRender/GLWidget.cpp | 4 +- .../Integration/FloatDataInterface.h | 4 ++ .../Libraries/Core/GetVariable.cpp | 1 + 10 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp diff --git a/Code/Editor/Util/GuidUtil.cpp b/Code/Editor/Util/GuidUtil.cpp index e8ea6fd3f8..dbd7d4c371 100644 --- a/Code/Editor/Util/GuidUtil.cpp +++ b/Code/Editor/Util/GuidUtil.cpp @@ -11,7 +11,7 @@ const char* GuidUtil::ToString(REFGUID guid) { static char guidString[64]; - sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + azsprintf(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); return guidString; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp new file mode 100644 index 0000000000..8357a265ba --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsFileUtils/ToolsFileUtils_generic.cpp @@ -0,0 +1,47 @@ +/* + * 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 "ToolsFileUtils.h" +#include +#include + +#include + +namespace AzToolsFramework +{ + namespace ToolsFileUtils + { + bool SetModificationTime(const char* const filename, AZ::u64 modificationTime) + { + struct stat statResult; + if (stat(filename, &statResult) != 0) + { + return false; + } + + struct utimbuf puttime; + puttime.modtime = modificationTime; + puttime.actime = static_cast(statResult.st_ctime); + + if (utime(filename, &puttime) == 0) + { + return true; + } + + return false; + } + + bool GetFreeDiskSpace(const QString& path, qint64& outFreeDiskSpace) + { + QStorageInfo storageInfo(path); + outFreeDiskSpace = storageInfo.bytesFree(); + + return outFreeDiskSpace >= 0; + } + } +} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp index fd6580225f..fae24d9b3a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.cpp @@ -18,7 +18,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING #include -#include +#include namespace AzToolsFramework { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake index af4bfcb8f4..afd487daf7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_linux_files.cmake @@ -29,4 +29,5 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui + ToolsFileUtils/ToolsFileUtils_generic.cpp ) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake index af4bfcb8f4..afd487daf7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_mac_files.cmake @@ -29,4 +29,5 @@ set(FILES UI/UICore/SaveChangesDialog.hxx UI/UICore/SaveChangesDialog.cpp UI/UICore/SaveChangesDialog.ui + ToolsFileUtils/ToolsFileUtils_generic.cpp ) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp index a04e2a87c8..c53c382d34 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/CommandCallbacks.cpp @@ -10,6 +10,7 @@ #include "RenderPlugin.h" #include #include +#include namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp index 49bb5509b6..2024746971 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.cpp @@ -13,6 +13,7 @@ #include #include "RenderWidget.h" #include "RenderViewWidget.h" +#include namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp index c6cab07a44..eefac45a3b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.cpp @@ -15,8 +15,10 @@ #include #include #include -#include "../../../../EMStudioSDK/Source/RenderPlugin/RenderViewWidget.h" +#include +#include +#include namespace EMStudio { diff --git a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h index 66c0f57fe4..8aefe5baf0 100644 --- a/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h +++ b/Gems/GraphModel/Code/Include/GraphModel/Integration/FloatDataInterface.h @@ -8,6 +8,9 @@ #pragma once +// Graph Canvas +#include + // Graph Model #include @@ -36,3 +39,4 @@ namespace GraphModelIntegration AZStd::weak_ptr m_slot; }; } + diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp index f88fb03726..e77d1abeb6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/GetVariable.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace ScriptCanvas { From f3daeba165f77fd8c61b91c9052c2dea09af14fd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 24 Jan 2022 13:08:41 -0600 Subject: [PATCH 260/394] Removed unused IViewPane Editor class Signed-off-by: Chris Galvan --- Code/Editor/Include/IEditorClassFactory.h | 4 - Code/Editor/Include/IViewPane.h | 74 ------------------- Code/Editor/Plugin.cpp | 20 ----- Code/Editor/Plugin.h | 8 -- Code/Editor/QtViewPane.h | 40 ---------- Code/Editor/QtViewPaneManager.h | 8 -- .../TrackView/2DBezierKeyUIControls.cpp | 2 - .../TrackView/AssetBlendKeyUIControls.cpp | 2 - .../Editor/TrackView/CaptureKeyUIControls.cpp | 2 - .../Editor/TrackView/CommentKeyUIControls.cpp | 2 - .../Editor/TrackView/ConsoleKeyUIControls.cpp | 2 - Code/Editor/TrackView/EventKeyUIControls.cpp | 2 - Code/Editor/TrackView/GotoKeyUIControls.cpp | 2 - .../TrackView/ScreenFaderKeyUIControls.cpp | 2 - Code/Editor/TrackView/SelectKeyUIControls.cpp | 2 - .../TrackView/SequenceKeyUIControls.cpp | 2 - Code/Editor/TrackView/SoundKeyUIControls.cpp | 2 - .../TrackView/TimeRangeKeyUIControls.cpp | 2 - .../TrackView/TrackEventKeyUIControls.cpp | 2 - Code/Editor/ViewManager.h | 1 - Code/Editor/editor_lib_files.cmake | 1 - .../Editor/AudioControlsEditorPlugin.cpp | 13 ---- .../Editor/Animation/UiAnimViewDialog.cpp | 1 - 23 files changed, 196 deletions(-) delete mode 100644 Code/Editor/Include/IViewPane.h diff --git a/Code/Editor/Include/IEditorClassFactory.h b/Code/Editor/Include/IEditorClassFactory.h index 6c85192436..82422799cf 100644 --- a/Code/Editor/Include/IEditorClassFactory.h +++ b/Code/Editor/Include/IEditorClassFactory.h @@ -135,9 +135,6 @@ struct IClassDesc ////////////////////////////////////////////////////////////////////////// }; - -struct IViewPaneClass; - struct CRYEDIT_API IEditorClassFactory { public: @@ -149,7 +146,6 @@ public: virtual IClassDesc* FindClass(const char* pClassName) const = 0; //! Find class in the factory by class id virtual IClassDesc* FindClass(const GUID& rClassID) const = 0; - virtual IViewPaneClass* FindViewPaneClassByTitle(const char* pPaneTitle) const = 0; virtual void UnregisterClass(const char* pClassName) = 0; virtual void UnregisterClass(const GUID& rClassID) = 0; //! Get classes that matching specific requirements. diff --git a/Code/Editor/Include/IViewPane.h b/Code/Editor/Include/IViewPane.h deleted file mode 100644 index f2425fb954..0000000000 --- a/Code/Editor/Include/IViewPane.h +++ /dev/null @@ -1,74 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IVIEWPANE_H -#define CRYINCLUDE_EDITOR_INCLUDE_IVIEWPANE_H -#pragma once - -#include "IEditorClassFactory.h" - -#include - -class QWidget; -class QRect; - -struct IViewPaneClass - : public IClassDesc -{ - DEFINE_UUID(0x7E13EC7C, 0xF621, 0x4aeb, 0xB6, 0x42, 0x67, 0xD7, 0x8E, 0xD4, 0x68, 0xF8) - - enum EDockingDirection - { - DOCK_TOP, - DOCK_LEFT, - DOCK_RIGHT, - DOCK_BOTTOM, - DOCK_FLOAT, - }; - - virtual ~IViewPaneClass() = default; - - // Return text for view pane title. - virtual QString GetPaneTitle() = 0; - - // Return the string resource ID for the title's text. - virtual unsigned int GetPaneTitleID() const = 0; - - // Return preferable initial docking position for pane. - virtual EDockingDirection GetDockingDirection() = 0; - - // Initial pane size. - virtual QRect GetPaneRect() = 0; - - // Get Minimal view size - virtual QSize GetMinSize() { return QSize(0, 0); } - - // Return true if only one pane at a time of time view class can be created. - virtual bool SinglePane() = 0; - - // Return true if the view window wants to get ID_IDLE_UPDATE commands. - virtual bool WantIdleUpdate() = 0; - - ////////////////////////////////////////////////////////////////////////// - // IUnknown - ////////////////////////////////////////////////////////////////////////// - HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) - { - if (riid == __az_uuidof(IViewPaneClass)) - { - *ppvObj = this; - return S_OK; - } - return E_NOINTERFACE; - } - ////////////////////////////////////////////////////////////////////////// - -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IVIEWPANE_H diff --git a/Code/Editor/Plugin.cpp b/Code/Editor/Plugin.cpp index 16c386e31c..fd70cc282d 100644 --- a/Code/Editor/Plugin.cpp +++ b/Code/Editor/Plugin.cpp @@ -11,9 +11,6 @@ #include "Plugin.h" -// Editor -#include "Include/IViewPane.h" - #include CClassFactory* CClassFactory::s_pInstance = nullptr; @@ -149,23 +146,6 @@ IClassDesc* CClassFactory::FindClass(const GUID& rClassID) const return pClassDesc; } -IViewPaneClass* CClassFactory::FindViewPaneClassByTitle(const char* pPaneTitle) const -{ - for (size_t i = 0; i < m_classes.size(); i++) - { - IViewPaneClass* viewPane = nullptr; - IClassDesc* desc = m_classes[i]; - if (SUCCEEDED(desc->QueryInterface(__az_uuidof(IViewPaneClass), (void**)&viewPane))) - { - if (QString::compare(viewPane->GetPaneTitle(), pPaneTitle) == 0) - { - return viewPane; - } - } - } - return nullptr; -} - void CClassFactory::UnregisterClass(const char* pClassName) { IClassDesc* pClassDesc = FindClass(pClassName); diff --git a/Code/Editor/Plugin.h b/Code/Editor/Plugin.h index 5fa45ac140..7a6e2f8995 100644 --- a/Code/Editor/Plugin.h +++ b/Code/Editor/Plugin.h @@ -71,8 +71,6 @@ public: IClassDesc* FindClass(const char* className) const; //! Find class in the factory by class ID IClassDesc* FindClass(const GUID& rClassID) const; - //! Find View Pane Class in the factory by pane title - IViewPaneClass* FindViewPaneClassByTitle(const char* pPaneTitle) const; void UnregisterClass(const char* pClassName); void UnregisterClass(const GUID& rClassID); //! Get classes matching specific requirements ordered alphabetically by name. @@ -135,10 +133,4 @@ public: #define REGISTER_CLASS_DESC(ClassDesc) \ CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new ClassDesc); -#define REGISTER_QT_CLASS_DESC(ClassDesc, name, category) \ - CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new CQtViewClass(name, category)); - -#define REGISTER_QT_CLASS_DESC_SYSTEM_ID(ClassDesc, name, category, systemid) \ - CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new CQtViewClass(name, category, systemid)); - #endif // CRYINCLUDE_EDITOR_PLUGIN_H diff --git a/Code/Editor/QtViewPane.h b/Code/Editor/QtViewPane.h index 194dd8919a..7d7dd04459 100644 --- a/Code/Editor/QtViewPane.h +++ b/Code/Editor/QtViewPane.h @@ -13,7 +13,6 @@ #include "IEditor.h" #include "Include/IEditorClassFactory.h" -#include "Include/IViewPane.h" #include "Include/ObjectEvent.h" #include "Objects/ClassDesc.h" @@ -107,43 +106,4 @@ public: } }; -template -class CQtViewClass - : public IViewPaneClass -{ -public: - const char* m_name; - const char* m_category; - ESystemClassID m_classId; - - CQtViewClass(const char* name, const char* category, ESystemClassID classId = ESYSTEM_CLASS_VIEWPANE) - : m_name(name) - , m_category(category) - , m_classId(classId) - { - } - - ESystemClassID SystemClassID() override { return m_classId; }; - static const GUID& GetClassID() - { - return TWidget::GetClassID(); - } - - const GUID& ClassID() override - { - return GetClassID(); - } - QString ClassName() override { return m_name; }; - QString Category() override { return m_category; }; - - QObject* CreateQObject() const override { return new TWidget(); }; - QString GetPaneTitle() override { return m_name; }; - unsigned int GetPaneTitleID() const override { return 0; }; - EDockingDirection GetDockingDirection() override { return DOCK_FLOAT; }; - QRect GetPaneRect() override { return {}; /* KDAB_TODO: ;m_sizeOptions.m_paneRect; */}; - bool SinglePane() override { return false; }; - bool WantIdleUpdate() override { return true; }; - QSize GetMinSize() override { return {}; /*return m_sizeOptions.m_minSize;*/ } -}; - #endif // CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H diff --git a/Code/Editor/QtViewPaneManager.h b/Code/Editor/QtViewPaneManager.h index 0515ae726e..5f65958592 100644 --- a/Code/Editor/QtViewPaneManager.h +++ b/Code/Editor/QtViewPaneManager.h @@ -269,14 +269,6 @@ bool RegisterQtViewPaneWithName([[maybe_unused]] IEditor* editor, const QString& return true; } -template -void UnregisterQtViewPane() -{ - // always close any views that the pane is responsible for before you remove it! - GetIEditor()->CloseView(CQtViewClass::GetClassID()); - GetIEditor()->GetClassFactory()->UnregisterClass(CQtViewClass::GetClassID()); -} - template TWidget* FindViewPane(const QString& name) { diff --git a/Code/Editor/TrackView/2DBezierKeyUIControls.cpp b/Code/Editor/TrackView/2DBezierKeyUIControls.cpp index 81cd151373..24f2633eb9 100644 --- a/Code/Editor/TrackView/2DBezierKeyUIControls.cpp +++ b/Code/Editor/TrackView/2DBezierKeyUIControls.cpp @@ -143,5 +143,3 @@ void C2DBezierKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& se } } } - -REGISTER_QT_CLASS_DESC(C2DBezierKeyUIControls, "TrackView.KeyUI.2DBezier", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp b/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp index 038a9d9780..d90f63ee24 100644 --- a/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp +++ b/Code/Editor/TrackView/AssetBlendKeyUIControls.cpp @@ -220,5 +220,3 @@ void CAssetBlendKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& } } } - -REGISTER_QT_CLASS_DESC(CAssetBlendKeyUIControls, "TrackView.KeyUI.AssetBlends", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/CaptureKeyUIControls.cpp b/Code/Editor/TrackView/CaptureKeyUIControls.cpp index e6d88a6cd6..89d55f0a2b 100644 --- a/Code/Editor/TrackView/CaptureKeyUIControls.cpp +++ b/Code/Editor/TrackView/CaptureKeyUIControls.cpp @@ -143,5 +143,3 @@ void CCaptureKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& sel } } } - -REGISTER_QT_CLASS_DESC(CCaptureKeyUIControls, "TrackView.KeyUI.Capture", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/CommentKeyUIControls.cpp b/Code/Editor/TrackView/CommentKeyUIControls.cpp index 6b52efd8f1..e4d7183d5e 100644 --- a/Code/Editor/TrackView/CommentKeyUIControls.cpp +++ b/Code/Editor/TrackView/CommentKeyUIControls.cpp @@ -169,5 +169,3 @@ void CCommentKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& sel } } } - -REGISTER_QT_CLASS_DESC(CCommentKeyUIControls, "TrackView.KeyUI.Comment", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/ConsoleKeyUIControls.cpp b/Code/Editor/TrackView/ConsoleKeyUIControls.cpp index 7bf23e0b52..f3ed919393 100644 --- a/Code/Editor/TrackView/ConsoleKeyUIControls.cpp +++ b/Code/Editor/TrackView/ConsoleKeyUIControls.cpp @@ -118,5 +118,3 @@ void CConsoleKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& sel } } } - -REGISTER_QT_CLASS_DESC(CConsoleKeyUIControls, "TrackView.KeyUI.Console", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/EventKeyUIControls.cpp b/Code/Editor/TrackView/EventKeyUIControls.cpp index 56b16d7c02..b8c737fa6a 100644 --- a/Code/Editor/TrackView/EventKeyUIControls.cpp +++ b/Code/Editor/TrackView/EventKeyUIControls.cpp @@ -149,5 +149,3 @@ void CEventKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selec } } } - -REGISTER_QT_CLASS_DESC(CEventKeyUIControls, "TrackView.KeyUI.Event", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/GotoKeyUIControls.cpp b/Code/Editor/TrackView/GotoKeyUIControls.cpp index c48ce4c5ad..a2767e9d4f 100644 --- a/Code/Editor/TrackView/GotoKeyUIControls.cpp +++ b/Code/Editor/TrackView/GotoKeyUIControls.cpp @@ -121,5 +121,3 @@ void CGotoKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& select } } } - -REGISTER_QT_CLASS_DESC(CGotoKeyUIControls, "TrackView.KeyUI.Goto", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp b/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp index d8b3a2bdf7..b3f971bce0 100644 --- a/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp +++ b/Code/Editor/TrackView/ScreenFaderKeyUIControls.cpp @@ -167,5 +167,3 @@ void CScreenFaderKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& } } } - -REGISTER_QT_CLASS_DESC(CScreenFaderKeyUIControls, "TrackView.KeyUI.ScreenFader", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/SelectKeyUIControls.cpp b/Code/Editor/TrackView/SelectKeyUIControls.cpp index d12f449c73..81af5f8c8c 100644 --- a/Code/Editor/TrackView/SelectKeyUIControls.cpp +++ b/Code/Editor/TrackView/SelectKeyUIControls.cpp @@ -269,5 +269,3 @@ void CSelectKeyUIControls::ResetCameraEntries() OnCameraAdded(cameraComponentEntities.values[i]); } } - -REGISTER_QT_CLASS_DESC(CSelectKeyUIControls, "TrackView.KeyUI.Select", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/SequenceKeyUIControls.cpp b/Code/Editor/TrackView/SequenceKeyUIControls.cpp index 4199563e10..21c654ecc2 100644 --- a/Code/Editor/TrackView/SequenceKeyUIControls.cpp +++ b/Code/Editor/TrackView/SequenceKeyUIControls.cpp @@ -215,5 +215,3 @@ void CSequenceKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& se } } } - -REGISTER_QT_CLASS_DESC(CSequenceKeyUIControls, "TrackView.KeyUI.Sequence", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/SoundKeyUIControls.cpp b/Code/Editor/TrackView/SoundKeyUIControls.cpp index f001937e82..2ea41077c4 100644 --- a/Code/Editor/TrackView/SoundKeyUIControls.cpp +++ b/Code/Editor/TrackView/SoundKeyUIControls.cpp @@ -127,5 +127,3 @@ void CSoundKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selec } } } - -REGISTER_QT_CLASS_DESC(CSoundKeyUIControls, "TrackView.KeyUI.Sound", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp b/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp index e35c18329b..11e20d854b 100644 --- a/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp +++ b/Code/Editor/TrackView/TimeRangeKeyUIControls.cpp @@ -122,5 +122,3 @@ void CTimeRangeKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& s } } } - -REGISTER_QT_CLASS_DESC(CTimeRangeKeyUIControls, "TrackView.KeyUI.TimeRange", "TrackViewKeyUI"); diff --git a/Code/Editor/TrackView/TrackEventKeyUIControls.cpp b/Code/Editor/TrackView/TrackEventKeyUIControls.cpp index 035087733b..835636c080 100644 --- a/Code/Editor/TrackView/TrackEventKeyUIControls.cpp +++ b/Code/Editor/TrackView/TrackEventKeyUIControls.cpp @@ -235,5 +235,3 @@ void CTrackEventKeyUIControls::BuildEventDropDown(QString& curEvent, const QStri } } } - -REGISTER_QT_CLASS_DESC(CTrackEventKeyUIControls, "TrackView.KeyUI.TrackEvent", "TrackViewKeyUI"); diff --git a/Code/Editor/ViewManager.h b/Code/Editor/ViewManager.h index 5b84efd197..f67fb19bcb 100644 --- a/Code/Editor/ViewManager.h +++ b/Code/Editor/ViewManager.h @@ -17,7 +17,6 @@ #include "Cry_Geo.h" #include "Viewport.h" -#include "Include/IViewPane.h" #include "QtViewPaneManager.h" // forward declaration. class CLayoutWnd; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 5d45bbd853..17f6b0b2f4 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -283,7 +283,6 @@ set(FILES Include/IPreferencesPage.h Include/ISourceControl.h Include/ITransformManipulator.h - Include/IViewPane.h Include/ObjectEvent.h Util/AffineParts.cpp Objects/BaseObject.cpp diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp index f3d5a03ffc..209df2fa69 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorPlugin.cpp @@ -63,7 +63,6 @@ CAudioControlsEditorPlugin::~CAudioControlsEditorPlugin() //-----------------------------------------------------------------------------------------------// void CAudioControlsEditorPlugin::Release() { - UnregisterQtViewPane(); // clear connections before releasing the implementation since they hold pointers to data // instantiated from the implementation dll. CUndoSuspend suspendUndo; @@ -198,15 +197,3 @@ CImplementationManager* CAudioControlsEditorPlugin::GetImplementationManager() { return &ms_implementationManager; } - -//-----------------------------------------------------------------------------------------------// -template<> -REFGUID CQtViewClass::GetClassID() -{ - // {82AD1635-38A6-4642-A801-EAB7A829411B} - static const GUID guid = - { - 0x82AD1635, 0x38A6, 0x4642, { 0xA8, 0x01, 0xEA, 0xB7, 0xA8, 0x29, 0x41, 0x1B } - }; - return guid; -} diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp index 9ad9a50aa5..27c5eac38e 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp @@ -37,7 +37,6 @@ #include "Objects/EntityObject.h" -#include "IViewPane.h" #include "PluginManager.h" #include "Util/3DConnexionDriver.h" #include "UiAnimViewNewSequenceDialog.h" From 5d67b63c92e306d09079bd8addde23901395707b Mon Sep 17 00:00:00 2001 From: scspaldi Date: Mon, 24 Jan 2022 16:52:25 -0800 Subject: [PATCH 261/394] Added basic client connectivity test. Signed-off-by: scspaldi --- .../Multiplayer/TestSuite_Sandbox.py | 6 +- .../Multiplayer_BasicConnectivity_Connects.py | 66 ++ .../BasicConnectivity_Connects.prefab | 581 ++++++++++++++++++ .../BasicConnectivity_Connects/Player.prefab | 118 ++++ .../BasicConnectivity_Connects/tags.txt | 12 + 5 files changed, 782 insertions(+), 1 deletion(-) create mode 100644 AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_BasicConnectivity_Connects.py create mode 100644 AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/BasicConnectivity_Connects.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/Player.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/tags.txt diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py index 8c5f33993d..20198be597 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py @@ -31,7 +31,11 @@ class TestAutomation(TestAutomationBase): def test_Multiplayer_AutoComponent_NetworkInput(self, request, workspace, editor, launcher_platform): from .tests import Multiplayer_AutoComponent_NetworkInput as test_module self._run_prefab_test(request, workspace, editor, test_module) - + def test_Multiplayer_AutoComponent_RPC(self, request, workspace, editor, launcher_platform): from .tests import Multiplayer_AutoComponent_RPC as test_module self._run_prefab_test(request, workspace, editor, test_module) + + def test_Multiplayer_BasicConnectivity_Connects(self, request, workspace, editor, launcher_platform): + from .tests import Multiplayer_BasicConnectivity_Connects as test_module + self._run_prefab_test(request, workspace, editor, test_module) \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_BasicConnectivity_Connects.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_BasicConnectivity_Connects.py new file mode 100644 index 0000000000..b63ee88426 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_BasicConnectivity_Connects.py @@ -0,0 +1,66 @@ +""" +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 +""" + + +# Test Case Title : Check that the basic client connect test works + + +# fmt: off +class TestConstants: + enter_game_mode = ("Entered game mode", "Failed to enter game mode") + exit_game_mode = ("Exited game mode", "Couldn't exit game mode") + find_network_player = ("Found network player", "Couldn't find network player") +# fmt: on + + +def Multiplayer_BasicConnectivity_Connects(): + r""" + Summary: + Runs a test to make sure that a networked player can be spawned + + Level Description: + - Dynamic + 1. Although the level is empty, when the server and editor connect the server will spawn the player prefab. + - Static + 1. This is an empty level. + + Expected Outcome: + We should see the player connect and spawn with no errors. + + :return: + """ + import azlmbr.legacy.general as general + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import Tracer + + from editor_python_test_tools.utils import TestHelper as helper + + + level_name = "BasicConnectivity_Connects" + player_prefab_name = "Player" + player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" + + helper.init_idle() + + # 1) Open Level + helper.open_level("Multiplayer", level_name) + + with Tracer() as section_tracer: + # 2) Enter game mode + helper.multiplayer_enter_game_mode(TestConstants.enter_game_mode, player_prefab_path.lower()) + + # 3) Make sure the network player was spawned + player_id = general.find_game_entity(player_prefab_name) + Report.critical_result(TestConstants.find_network_player, player_id.IsValid()) + + # Exit game mode + helper.exit_game_mode(TestConstants.exit_game_mode) + + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(Multiplayer_BasicConnectivity_Connects) diff --git a/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/BasicConnectivity_Connects.prefab b/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/BasicConnectivity_Connects.prefab new file mode 100644 index 0000000000..9686c39847 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/BasicConnectivity_Connects.prefab @@ -0,0 +1,581 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043 + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 8929576024571800510 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "ChildEntityOrderEntryArray": [ + { + "EntityId": "Entity_[1155164325235]" + }, + { + "EntityId": "Entity_[1180934129011]", + "SortIndex": 1 + }, + { + "EntityId": "Entity_[1172344194419]", + "SortIndex": 2 + }, + { + "EntityId": "Entity_[1168049227123]", + "SortIndex": 3 + }, + { + "EntityId": "Entity_[1163754259827]", + "SortIndex": 4 + }, + { + "EntityId": "Entity_[1159459292531]", + "SortIndex": 5 + } + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + } + }, + "Instances": { + "Instance_[450137905015]": { + "Source": "Levels/Multiplayer/BasicConnectivity_Connects/Player.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14438229160106431107]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14438229160106431107]/Transform Data/Translate/1", + "value": 10.0 + } + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/Player.prefab b/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/Player.prefab new file mode 100644 index 0000000000..35c388a4fd --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/Player.prefab @@ -0,0 +1,118 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Player", + "Components": { + "Component_[10518577910351346732]": { + "$type": "EditorLockComponent", + "Id": 10518577910351346732 + }, + "Component_[10982887273490848966]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10982887273490848966 + }, + "Component_[12400551793021799684]": { + "$type": "SelectionComponent", + "Id": 12400551793021799684 + }, + "Component_[1257365873906714292]": { + "$type": "EditorEntityIconComponent", + "Id": 1257365873906714292 + }, + "Component_[13311663931994949767]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13311663931994949767 + }, + "Component_[14438229160106431107]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14438229160106431107, + "Parent Entity": "" + }, + "Component_[14636573223251575153]": { + "$type": "EditorVisibilityComponent", + "Id": 14636573223251575153 + }, + "Component_[18139850826775373128]": { + "$type": "EditorEntitySortComponent", + "Id": 18139850826775373128 + }, + "Component_[18149872971727933150]": { + "$type": "EditorInspectorComponent", + "Id": 18149872971727933150 + }, + "Component_[3361461948531668955]": { + "$type": "EditorPrefabComponent", + "Id": 3361461948531668955 + }, + "Component_[5198421115432838729]": { + "$type": "EditorPendingCompositionComponent", + "Id": 5198421115432838729 + } + } + }, + "Entities": { + "Entity_[458727839607]": { + "Id": "Entity_[458727839607]", + "Name": "Dummy", + "Components": { + "Component_[10453091667729858383]": { + "$type": "EditorLockComponent", + "Id": 10453091667729858383 + }, + "Component_[15287888392848689630]": { + "$type": "EditorEntityIconComponent", + "Id": 15287888392848689630 + }, + "Component_[15410933204460181490]": { + "$type": "EditorInspectorComponent", + "Id": 15410933204460181490, + "ComponentOrderEntryArray": [ + { + "ComponentId": 868882495636022739 + }, + { + "ComponentId": 517239536919559179, + "SortIndex": 1 + } + ] + }, + "Component_[17682830444684716936]": { + "$type": "EditorEntitySortComponent", + "Id": 17682830444684716936 + }, + "Component_[18433579260689698157]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18433579260689698157 + }, + "Component_[2684999590909523769]": { + "$type": "SelectionComponent", + "Id": 2684999590909523769 + }, + "Component_[517239536919559179]": { + "$type": "GenericComponentWrapper", + "Id": 517239536919559179, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[5980561685482761342]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5980561685482761342 + }, + "Component_[6553553408068929590]": { + "$type": "EditorVisibilityComponent", + "Id": 6553553408068929590 + }, + "Component_[8307469961954670365]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8307469961954670365 + }, + "Component_[868882495636022739]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 868882495636022739, + "Parent Entity": "ContainerEntity" + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/tags.txt b/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/BasicConnectivity_Connects/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 From f3120ca780ffe04231db495e67b4ff3853b5eb41 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 25 Jan 2022 09:58:00 -0600 Subject: [PATCH 262/394] Made some float constants more explicit and updated the pixel index calculation logic to be more concise Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 1ed900b2b8..dc9f0bbaa6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -151,7 +151,7 @@ namespace AZ auto actualMem = reinterpret_cast(mem); AZ::s8 signedMax = std::numeric_limits::max(); AZ::s8 signedMin = aznumeric_cast(-signedMax); - return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1, 1); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: @@ -166,7 +166,7 @@ namespace AZ auto actualMem = reinterpret_cast(mem); AZ::s16 signedMax = std::numeric_limits::max(); AZ::s16 signedMin = aznumeric_cast(-signedMax); - return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1, 1); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); } case AZ::RHI::Format::R16_FLOAT: { @@ -391,7 +391,7 @@ namespace AZ { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); + size_t imageDataIndex = (y * width + x) * pixelSize; auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -418,7 +418,7 @@ namespace AZ { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); + size_t imageDataIndex = (y * width + x) * pixelSize; auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -445,7 +445,7 @@ namespace AZ { for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - size_t imageDataIndex = (y * width * pixelSize) + (x * pixelSize); + size_t imageDataIndex = (y * width + x) * pixelSize; auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); From efd2e41b05efd79c3a24036c1c9bd14e73313b61 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 25 Jan 2022 10:22:39 -0600 Subject: [PATCH 263/394] Added unit test for single pixel and pixel regions API usage Signed-off-by: Chris Galvan --- .../Code/Tests/Image/StreamingImageTests.cpp | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp index f7476c0bc4..f90702d948 100644 --- a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp @@ -433,12 +433,12 @@ namespace UnitTest return poolAsset; } - AZ::Data::Asset BuildTestImage() + AZ::Data::Asset BuildTestImage(AZ::RHI::Format format = AZ::RHI::Format::R8G8B8A8_UNORM) { using namespace AZ; const uint32_t arraySize = 2; - const uint32_t pixelSize = 4; + const uint32_t pixelSize = RHI::GetFormatSize(format); const uint32_t mipCountHead = 1; const uint32_t mipCountMiddle = 2; const uint32_t mipCountTail = 3; @@ -453,7 +453,7 @@ namespace UnitTest RPI::StreamingImageAssetCreator assetCreator; assetCreator.Begin(Data::AssetId(Uuid::CreateRandom())); - RHI::ImageDescriptor imageDesc = RHI::ImageDescriptor::Create2DArray(RHI::ImageBindFlags::ShaderRead, imageWidth, imageHeight, arraySize, RHI::Format::R8G8B8A8_UNORM); + RHI::ImageDescriptor imageDesc = RHI::ImageDescriptor::Create2DArray(RHI::ImageBindFlags::ShaderRead, imageWidth, imageHeight, arraySize, format); imageDesc.m_mipLevels = static_cast(mipCountTotal); assetCreator.SetImageDescriptor(imageDesc); @@ -726,4 +726,41 @@ namespace UnitTest RPI::ImageSystemInterface::Get()->Update(); } + + TEST_F(StreamingImageTests, GetSubImagePixelValues) + { + using namespace AZ; + + Data::Asset imageAsset = BuildTestImage(AZ::RHI::Format::R8_UNORM); + + auto streamingImageAsset = imageAsset.Get(); + EXPECT_NE(streamingImageAsset, nullptr); + + // Validate retrieving one pixel at a time + auto size = streamingImageAsset->GetImageDescriptor().m_size; + for (uint32_t y = 0; y < size.m_height; ++y) + { + for (uint32_t x = 0; x < size.m_width; ++x) + { + auto pixelDataValue = imageAsset->GetSubImagePixelValue(x, y); + auto pixelExpectedValue = static_cast(y * size.m_width + x) / static_cast(std::numeric_limits::max()); + + EXPECT_TRUE(AZ::IsClose(pixelDataValue, pixelExpectedValue)); + } + } + + // Validate retrieving a region of pixels + AZStd::vector pixelValues(size.m_width * size.m_height); + auto topLeft = AZStd::make_pair(0, 0); + auto bottomRight = AZStd::make_pair(size.m_width - 1, size.m_height - 1); + AZStd::span valueSpan(pixelValues.begin(), pixelValues.size()); + streamingImageAsset->GetSubImagePixelValues(topLeft, bottomRight, valueSpan); + for (uint32_t index = 0; index < pixelValues.size(); ++index) + { + auto pixelDataValue = valueSpan[index]; + auto pixelExpectedValue = static_cast(index) / static_cast(std::numeric_limits::max()); + + EXPECT_TRUE(AZ::IsClose(pixelDataValue, pixelExpectedValue)); + } + } } From e27a666bacd9f3b0946981d5069d1a1838f7ee4c Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:11:38 -0800 Subject: [PATCH 264/394] Fixed missing assets when entering Play-In-Editor. At the root the problem is that some editor-only components store information to construct an asset for the runtime component but not the asset itself. This behavior caused the assets to not be correctly detected in two places. The first place was due to the recent move to PrefDocument to avoid repeated (de)serialization of the PrefabDOM when converting to spawnables. Due to the caching the change from editor-only component to runtime component didn't record the new asset. This has been fixed by allowing assets to be collected on store as well and to check the cache validity when retrieving the list of referenced assets. The second problem was with loading assets from the in-memory spawnable that's created for Play-In-Editor. Because the newly created assets wouldn't be loaded they need to be explicitly loaded. The original code used the collected list of assets from the PrefabDocument and checked if they were loaded, depending on hot-reloading to trigger a reload on the actual asset. This turned out to not be universally applicable, so instead the Serialize Context is now used to find all the assets that aren't loaded yet and queues a load. This is a bit more expensive to do, but to offset this cost checks are done to only do any operations on assets that haven't been loaded yet which reduces the number of calls to the Asset Manager. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../AzCore/Asset/AssetJsonSerializer.cpp | 6 + .../Prefab/PrefabDomUtils.cpp | 54 ++++++++ .../AzToolsFramework/Prefab/PrefabDomUtils.h | 24 +++- .../InMemorySpawnableAssetContainer.cpp | 119 +++++++++++------- .../InMemorySpawnableAssetContainer.h | 5 +- .../Prefab/Spawnable/PrefabDocument.cpp | 34 +++-- .../Prefab/Spawnable/PrefabDocument.h | 4 +- 7 files changed, 181 insertions(+), 65 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp index 0d28036646..838caf467a 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp @@ -92,6 +92,12 @@ namespace AZ::Data result.Combine(resultHint); } + if (SerializedAssetTracker* assetTracker = context.GetMetadata().Find(); + assetTracker != nullptr && result.GetProcessing() == JSR::Processing::Completed) + { + assetTracker->AddAsset(*instance); + } + return context.Report(result, result.GetProcessing() == JSR::Processing::Completed ? "Successfully stored Asset." : "Failed to store Asset."); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp index 50c61e6877..3be3fbce11 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp @@ -119,6 +119,60 @@ namespace AzToolsFramework return true; } + bool StoreInstanceInPrefabDom( + const Instance& instance, + PrefabDom& prefabDom, + AZStd::vector>& referencedAssets, + StoreFlags flags) + { + InstanceEntityIdMapper entityIdMapper; + entityIdMapper.SetStoringInstance(instance); + + // Need to store the id mapper as both its type and its base type + // Meta data is found by type id and we need access to both types at different levels (Instance, EntityId) + AZ::JsonSerializerSettings settings; + settings.m_metadata.Add(static_cast(&entityIdMapper)); + settings.m_metadata.Add(&entityIdMapper); + settings.m_metadata.Add(AZ::Data::SerializedAssetTracker{}); + + if ((flags & StoreFlags::StripDefaultValues) != StoreFlags::StripDefaultValues) + { + settings.m_keepDefaults = true; + } + + if ((flags & StoreFlags::StoreLinkIds) != StoreFlags::None) + { + settings.m_metadata.Create(); + } + + AZStd::string scratchBuffer; + auto issueReportingCallback = [&scratchBuffer]( + AZStd::string_view message, AZ::JsonSerializationResult::ResultCode result, + AZStd::string_view path) -> AZ::JsonSerializationResult::ResultCode + { + return Internal::JsonIssueReporter(scratchBuffer, message, result, path); + }; + + settings.m_reporting = AZStd::move(issueReportingCallback); + + AZ::JsonSerializationResult::ResultCode result = + AZ::JsonSerialization::Store(prefabDom, prefabDom.GetAllocator(), instance, settings); + + if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted) + { + AZ_Error( + "Prefab", false, + "Failed to serialize prefab instance with source path %s. " + "Unable to proceed.", + instance.GetTemplateSourcePath().c_str()); + + return false; + } + + referencedAssets = AZStd::move(settings.m_metadata.Find()->GetTrackedAssets()); + return true; + } + bool StoreEntityInPrefabDomFormat(const AZ::Entity& entity, Instance& owningInstance, PrefabDom& prefabDom, StoreFlags flags) { InstanceEntityIdMapper entityIdMapper; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h index 89d1a046e5..e336cf0fca 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h @@ -57,14 +57,28 @@ namespace AzToolsFramework AZ_DEFINE_ENUM_BITWISE_OPERATORS(StoreFlags); /** - * Stores a valid Prefab Instance within a Prefab Dom. Useful for generating Templates - * @param instance The instance to store - * @param prefabDom The prefabDom that will be used to store the Instance data - * @param flags Controls behavior such as whether to store default values - * @return bool on whether the operation succeeded + * Stores a valid Prefab Instance within a Prefab Dom. Useful for generating Templates. + * @param instance The instance to store. + * @param prefabDom The prefabDom that will be used to store the Instance data. + * @param flags Controls behavior such as whether to store default values. + * @return bool on whether the operation succeeded. */ bool StoreInstanceInPrefabDom(const Instance& instance, PrefabDom& prefabDom, StoreFlags flags = StoreFlags::None); + /** + * Stores a valid Prefab Instance within a Prefab Dom. Useful for generating Templates. + * @param instance The instance to store. + * @param prefabDom The prefabDom that will be used to store the Instance data. + * @param referencedAssets Collect a list of the assets that are referenced during storing. + * @param flags Controls behavior such as whether to store default values. + * @return bool on whether the operation succeeded. + */ + bool StoreInstanceInPrefabDom( + const Instance& instance, + PrefabDom& prefabDom, + AZStd::vector>& referencedAssets, + StoreFlags flags = StoreFlags::None); + /** * Stores a valid entity in Prefab Dom format. * @param entity The entity to store diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index dc5cd299b8..634cb9d448 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -6,12 +6,14 @@ * */ -#include #include #include +#include +#include #include #include +#include #include namespace AzToolsFramework::Prefab::PrefabConversionUtils @@ -161,13 +163,10 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { return AZ::Failure(AZStd::string::format("Failed to produce the target spawnable '%.*s'.", AZ_STRING_ARG(spawnableName))); } - + if (loadReferencedAssets) { - for (auto& product : context.GetProcessedObjects()) - { - LoadReferencedAssets(product.GetReferencedAssets()); - } + LoadReferencedAssets(spawnableAssetData); } auto& spawnableAssetDataAdded = m_spawnableAssets.emplace(spawnableName, spawnableAssetData).first->second; @@ -213,63 +212,91 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return m_spawnableAssets; } - void InMemorySpawnableAssetContainer::LoadReferencedAssets(AZStd::vector>& referencedAssets) + void InMemorySpawnableAssetContainer::LoadReferencedAssets(SpawnableAssetData& spawnable) { - // Start our loads on all assets by calling GetAsset from the AssetManager - for (AZ::Data::Asset& asset : referencedAssets) + // Get the referenced assets directly from the product. This is done for two reasons: + // 1. Avoids calls to the Asset Manager for assets that are already loaded. + // 2. Gets the exact asset to load to avoid issues with assets that don't reload. + AZStd::vector*> blockingAssets; + + for (AZ::Data::Asset& asset : spawnable.m_assets) { - if (!asset.GetId().IsValid()) + AZ::SerializeContext* sc = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(sc, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + AZ_Assert( + sc, "Unable to locate Serialize Context while resolving asset references in the in-memory spawnable asset container."); + + auto callback = [&blockingAssets]( + void* object, const AZ::SerializeContext::ClassData* classData, + [[maybe_unused]]const AZ::SerializeContext::ClassElement* elementData) -> bool { - AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); - continue; - } + if (classData->m_typeId == AZ::GetAssetClassId()) + { + auto asset = reinterpret_cast*>(object); - const AZ::Data::AssetLoadBehavior loadBehavior = asset.GetAutoLoadBehavior(); + if (!asset->GetId().IsValid()) + { + AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); + return false; + } - if (loadBehavior == AZ::Data::AssetLoadBehavior::NoLoad) - { - continue; - } + if (asset->GetStatus() != AZ::Data::AssetData::AssetStatus::NotLoaded) + { + // Already loaded so no need to do anything. + return false; + } - AZ::Data::AssetId assetId = asset.GetId(); - AZ::Data::AssetType assetType = asset.GetType(); + const AZ::Data::AssetLoadBehavior loadBehavior = asset->GetAutoLoadBehavior(); + if (loadBehavior == AZ::Data::AssetLoadBehavior::NoLoad) + { + return false; + } - asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, assetType, loadBehavior); + AZ::Data::AssetId assetId = asset->GetId(); + AZ::Data::AssetType assetType = asset->GetType(); - if (!asset.GetId().IsValid()) - { - AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); - continue; - } + // Always queue load as the next step will stop loading for all PreLoad assets + *asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, assetType, AZ::Data::AssetLoadBehavior::QueueLoad); + + if (!asset->GetId().IsValid()) + { + AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); + return false; + } + + if (loadBehavior == AZ::Data::AssetLoadBehavior::PreLoad) + { + // Only assets that are preloaded need to be waited on. + blockingAssets.push_back(asset); + } + return false; + } + return true; + }; + + AZ::SerializeContext::EnumerateInstanceCallContext enumerationContext( + callback, nullptr, sc, AZ::SerializeContext::ENUM_ACCESS_FOR_READ, nullptr); + sc->EnumerateInstance(&enumerationContext, asset.GetData(), asset.GetType(), nullptr, nullptr); } // For all Preload assets we block until they're ready // We do this as a separate pass so that we don't interrupt queuing up all other asset loads - for (AZ::Data::Asset& asset : referencedAssets) + for (AZ::Data::Asset* asset : blockingAssets) { - if (!asset.GetId().IsValid()) + asset->BlockUntilLoadComplete(); + + if (asset->IsError()) { - AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); + AZ_Error( + "Prefab", false, "Asset with id %s failed to preload while entering game mode", + asset->GetId().ToString().c_str()); + continue; } - const AZ::Data::AssetLoadBehavior loadBehavior = asset.GetAutoLoadBehavior(); - - if (loadBehavior != AZ::Data::AssetLoadBehavior::PreLoad) - { - continue; - } - - asset.BlockUntilLoadComplete(); - - if (asset.IsError()) - { - AZ_Error("Prefab", false, "Asset with id %s failed to preload while entering game mode", - asset.GetId().ToString().c_str()); - - continue; - } + // Reset the load behavior back to preload because the async load will have caused the behavior to be set to queued. Some assets + // will complain if they're not set to the correct loading behavior. + asset->SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); } } - } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.h index f567c99b00..6f11976fc9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.h @@ -21,7 +21,6 @@ namespace AzToolsFramework::Prefab namespace AzToolsFramework::Prefab::PrefabConversionUtils { - class InMemorySpawnableAssetContainer { public: @@ -58,8 +57,8 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils const SpawnableAssets& GetAllInMemorySpawnableAssets() const; private: - void LoadReferencedAssets(AZStd::vector>& referencedAssets); - + void LoadReferencedAssets(SpawnableAssetData& spawnable); + SpawnableAssets m_spawnableAssets; PrefabConversionUtils::PrefabConversionPipeline m_converter; AZStd::string_view m_stockProfile; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 230c2226cd..f13ddc027f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -53,21 +53,14 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils const PrefabDom& PrefabDocument::GetDom() const { - if (m_isDirty) - { - m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); - } + RefreshPrefabDom(); return m_dom; } PrefabDom&& PrefabDocument::TakeDom() { - if (m_isDirty) - { - [[maybe_unused]] bool storedSuccessfully = PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); - AZ_Assert(storedSuccessfully, "Failed to store Instance '%s' to PrefabDom.", m_name.c_str()); - m_isDirty = false; - } + RefreshPrefabDom(); + // After the PrefabDom is moved an empty PrefabDom is left behind. This should be reflected in the Instance, // so reset it so it's empty as well. m_instance->Reset(); @@ -126,11 +119,13 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::vector>& PrefabDocument::GetReferencedAssets() { + RefreshPrefabDom(); return m_referencedAssets; } const AZStd::vector>& PrefabDocument::GetReferencedAssets() const { + RefreshPrefabDom(); return m_referencedAssets; } @@ -158,4 +153,23 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return false; } } + + bool PrefabDocument::RefreshPrefabDom() const + { + if (m_isDirty) + { + m_referencedAssets.clear(); + if (PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom, m_referencedAssets)) + { + m_isDirty = false; + return true; + } + else + { + AZ_Assert(false, "Failed to store Instance '%s' to PrefabDom.", m_name.c_str()); + return false; + } + } + return true; + } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 661dba5edf..a651d73e63 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -58,11 +58,13 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils private: bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); + // Marked const so this function can be called from other const functions. It will only operate on mutable variables. + bool RefreshPrefabDom() const; mutable PrefabDom m_dom; AZStd::unique_ptr m_instance; AZStd::string m_name; - AZStd::vector> m_referencedAssets; + mutable AZStd::vector> m_referencedAssets; mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils From 8b5f532e306a174ade34eae4c3edae258dc7d252 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 25 Jan 2022 14:25:32 -0600 Subject: [PATCH 265/394] Disable render pipeline for EditorViewportWidget until a level has been loaded Signed-off-by: Chris Galvan --- Code/Editor/EditorViewportWidget.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index a8180bcace..6ba62604e8 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -89,6 +89,7 @@ #include // Atom +#include #include #include #include @@ -584,7 +585,7 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event) m_renderViewport->SetScene(nullptr); break; - case eNotify_OnEndSceneOpen: + case eNotify_OnEndLoad: UpdateScene(); SetDefaultCamera(); break; @@ -2324,7 +2325,22 @@ void EditorViewportWidget::UpdateScene() { AZ::RPI::SceneNotificationBus::Handler::BusDisconnect(); m_renderViewport->SetScene(mainScene); - AZ::RPI::SceneNotificationBus::Handler::BusConnect(m_renderViewport->GetViewportContext()->GetRenderScene()->GetId()); + auto viewportContext = m_renderViewport->GetViewportContext(); + AZ::RPI::SceneNotificationBus::Handler::BusConnect(viewportContext->GetRenderScene()->GetId()); + + // Don't enable the render pipeline until a level has been loaded + auto renderPipeline = viewportContext->GetCurrentPipeline(); + if (renderPipeline) + { + if (GetIEditor()->IsLevelLoaded()) + { + renderPipeline->AddToRenderTick(); + } + else + { + renderPipeline->RemoveFromRenderTick(); + } + } } } } From 6e05ac678d475fc93925ba51be8df82aa96ff7a4 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 25 Jan 2022 16:46:49 -0600 Subject: [PATCH 266/394] Hide the RenderViewportWidget when there is no level loaded so the gradient background is visible Signed-off-by: Chris Galvan --- Code/Editor/EditorViewportWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 6ba62604e8..9a9e9f5ad3 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -2329,15 +2329,19 @@ void EditorViewportWidget::UpdateScene() AZ::RPI::SceneNotificationBus::Handler::BusConnect(viewportContext->GetRenderScene()->GetId()); // Don't enable the render pipeline until a level has been loaded + // Also show/hide the RenderViewportWidget accordingly so that we get the + // expected gradient background when no level is loaded auto renderPipeline = viewportContext->GetCurrentPipeline(); if (renderPipeline) { if (GetIEditor()->IsLevelLoaded()) { + m_renderViewport->show(); renderPipeline->AddToRenderTick(); } else { + m_renderViewport->hide(); renderPipeline->RemoveFromRenderTick(); } } From a3e541cc47564b3823b016fb0ce3c068f376fbb0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:14:02 -0800 Subject: [PATCH 267/394] Adding back NodeableOutNative.h per PR request Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../NodeableOut/NodeableOutNative.h_unused | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h_unused diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h_unused b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h_unused new file mode 100644 index 0000000000..ab6859db1e --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h_unused @@ -0,0 +1,66 @@ +/* + * 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 +#include + +#include + +namespace ScriptCanvas +{ + namespace Execution + { + template + FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence, std::index_sequence, ReturnTypeIsNotVoid) + { + auto nodeCallWrapper = [callable = AZStd::forward(callable)](AZ::BehaviorValueParameter* result, AZ::BehaviorValueParameter* arguments, int numArguments) mutable + { + [[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args); + (void)numArguments; + AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters"); + AZ_Assert(result, "no null result allowed"); + result->StoreResult(AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe()...)); + }; + + static_assert(!AZStd::is_same_v || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor"); + return FunctorOut(AZStd::move(nodeCallWrapper), allocator); + } + + template + FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence, std::index_sequence, ReturnTypeIsVoid) + { + auto nodeCallWrapper = [callable = AZStd::forward(callable)](AZ::BehaviorValueParameter*, AZ::BehaviorValueParameter* arguments, int numArguments) mutable + { + [[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args); + (void)numArguments; + AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters"); + AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe()...); + }; + + static_assert(!AZStd::is_same_v || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor"); + return FunctorOut(AZStd::move(nodeCallWrapper), allocator); + } + + template + FunctorOut CreateOut(Callable&& callable, Allocator& allocator) + { + using CallableTraits = AZStd::function_traits>; + return CreateOutWithArgs + ( AZStd::forward(callable) + , allocator + , typename CallableTraits::arg_types{} + , typename CallableTraits::template expand_args{} + , typename AZStd::is_void::type{}); + } + + } + +} From 25157b3fa15cd34e5edc8f908cdf77298922732a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:26:00 -0800 Subject: [PATCH 268/394] PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index 0414740f2a..7238a18672 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -118,9 +118,9 @@ namespace AZ AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_schema = new (&g_systemSchema) HphaSchema(heapDesc); + m_schema = new (&g_systemSchema) HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_schema = new (&g_systemSchema) MallocSchema(heapDesc); + m_schema = new (&g_systemSchema) MallocSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -292,7 +292,7 @@ namespace AZ //========================================================================= SystemAllocator::size_type SystemAllocator::AllocationSize(pointer_type ptr) { - size_type allocSize = MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); + size_type allocSize = MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); return allocSize; } From d46bd0ebc061f3313a35dd86d806323afb6e5c04 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:27:40 -0800 Subject: [PATCH 269/394] Removes special Android case, those files where palified properly Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- scripts/cleanup/unused_compilation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/cleanup/unused_compilation.py b/scripts/cleanup/unused_compilation.py index 8aeadff309..1c16e69812 100644 --- a/scripts/cleanup/unused_compilation.py +++ b/scripts/cleanup/unused_compilation.py @@ -41,7 +41,6 @@ PATH_EXCLUSIONS = ( 'python\\*', 'build\\*', 'install\\*', - 'Code\\Framework\\AzCore\\AzCore\\Android\\*', 'Gems\\ImGui\\External\\ImGui\\*', '*_Traits_*.h', ) From 27a75fa6a1b0f3b6a37ca5b3afd48d565ccc1db4 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:15:09 -0800 Subject: [PATCH 270/394] Addressing feedback for the Play In Editor missing asset fixes. - Deduplicated code for StoreInstanceInPrefabDom. - Used QueueLoad to load an asset instead of starting a load by getting a new asset instance. - Extended the error information when failing to load an asset. - RefreshPrefabDom no longer returns a boolean as it wasn't used. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/PrefabDomUtils.cpp | 153 ++++++++---------- .../InMemorySpawnableAssetContainer.cpp | 26 +-- .../Prefab/Spawnable/PrefabDocument.cpp | 5 +- .../Prefab/Spawnable/PrefabDocument.h | 2 +- 4 files changed, 80 insertions(+), 106 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp index 3be3fbce11..d6faed4b0a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp @@ -28,7 +28,7 @@ namespace AzToolsFramework { namespace Internal { - AZ::JsonSerializationResult::ResultCode JsonIssueReporter(AZStd::string& scratchBuffer, + static AZ::JsonSerializationResult::ResultCode JsonIssueReporter(AZStd::string& scratchBuffer, AZStd::string_view message, AZ::JsonSerializationResult::ResultCode result, AZStd::string_view path) { namespace JSR = AZ::JsonSerializationResult; @@ -48,6 +48,66 @@ namespace AzToolsFramework return result; } + + static bool StoreInstanceInPrefabDom( + const Instance& instance, + PrefabDom& prefabDom, + AZStd::vector>* referencedAssets, + StoreFlags flags) + { + InstanceEntityIdMapper entityIdMapper; + entityIdMapper.SetStoringInstance(instance); + + // Need to store the id mapper as both its type and its base type + // Metadata is found by type id and we need access to both types at different levels (Instance, EntityId) + AZ::JsonSerializerSettings settings; + settings.m_metadata.Add(static_cast(&entityIdMapper)); + settings.m_metadata.Add(&entityIdMapper); + if (referencedAssets) + { + settings.m_metadata.Add(AZ::Data::SerializedAssetTracker{}); + } + + if ((flags & StoreFlags::StripDefaultValues) != StoreFlags::StripDefaultValues) + { + settings.m_keepDefaults = true; + } + + if ((flags & StoreFlags::StoreLinkIds) != StoreFlags::None) + { + settings.m_metadata.Create(); + } + + AZStd::string scratchBuffer; + auto issueReportingCallback = [&scratchBuffer]( + AZStd::string_view message, AZ::JsonSerializationResult::ResultCode result, + AZStd::string_view path) -> AZ::JsonSerializationResult::ResultCode + { + return Internal::JsonIssueReporter(scratchBuffer, message, result, path); + }; + + settings.m_reporting = AZStd::move(issueReportingCallback); + + AZ::JsonSerializationResult::ResultCode result = + AZ::JsonSerialization::Store(prefabDom, prefabDom.GetAllocator(), instance, settings); + + if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted) + { + AZ_Error( + "Prefab", false, + "Failed to serialize prefab instance with source path %s. " + "Unable to proceed.", + instance.GetTemplateSourcePath().c_str()); + + return false; + } + + if (referencedAssets) + { + *referencedAssets = AZStd::move(settings.m_metadata.Find()->GetTrackedAssets()); + } + return true; + } } PrefabDomValueReference FindPrefabDomValue(PrefabDomValue& parentValue, const char* valueName) @@ -74,49 +134,7 @@ namespace AzToolsFramework bool StoreInstanceInPrefabDom(const Instance& instance, PrefabDom& prefabDom, StoreFlags flags) { - InstanceEntityIdMapper entityIdMapper; - entityIdMapper.SetStoringInstance(instance); - - // Need to store the id mapper as both its type and its base type - // Meta data is found by type id and we need access to both types at different levels (Instance, EntityId) - AZ::JsonSerializerSettings settings; - settings.m_metadata.Add(static_cast(&entityIdMapper)); - settings.m_metadata.Add(&entityIdMapper); - - if ((flags & StoreFlags::StripDefaultValues) != StoreFlags::StripDefaultValues) - { - settings.m_keepDefaults = true; - } - - if ((flags & StoreFlags::StoreLinkIds) != StoreFlags::None) - { - settings.m_metadata.Create(); - } - - AZStd::string scratchBuffer; - auto issueReportingCallback = [&scratchBuffer] - (AZStd::string_view message, AZ::JsonSerializationResult::ResultCode result, - AZStd::string_view path) -> AZ::JsonSerializationResult::ResultCode - { - return Internal::JsonIssueReporter(scratchBuffer, message, result, path); - }; - - settings.m_reporting = AZStd::move(issueReportingCallback); - - AZ::JsonSerializationResult::ResultCode result = - AZ::JsonSerialization::Store(prefabDom, prefabDom.GetAllocator(), instance, settings); - - if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted) - { - AZ_Error("Prefab", false, - "Failed to serialize prefab instance with source path %s. " - "Unable to proceed.", - instance.GetTemplateSourcePath().c_str()); - - return false; - } - - return true; + return Internal::StoreInstanceInPrefabDom(instance, prefabDom, nullptr, flags); } bool StoreInstanceInPrefabDom( @@ -125,52 +143,7 @@ namespace AzToolsFramework AZStd::vector>& referencedAssets, StoreFlags flags) { - InstanceEntityIdMapper entityIdMapper; - entityIdMapper.SetStoringInstance(instance); - - // Need to store the id mapper as both its type and its base type - // Meta data is found by type id and we need access to both types at different levels (Instance, EntityId) - AZ::JsonSerializerSettings settings; - settings.m_metadata.Add(static_cast(&entityIdMapper)); - settings.m_metadata.Add(&entityIdMapper); - settings.m_metadata.Add(AZ::Data::SerializedAssetTracker{}); - - if ((flags & StoreFlags::StripDefaultValues) != StoreFlags::StripDefaultValues) - { - settings.m_keepDefaults = true; - } - - if ((flags & StoreFlags::StoreLinkIds) != StoreFlags::None) - { - settings.m_metadata.Create(); - } - - AZStd::string scratchBuffer; - auto issueReportingCallback = [&scratchBuffer]( - AZStd::string_view message, AZ::JsonSerializationResult::ResultCode result, - AZStd::string_view path) -> AZ::JsonSerializationResult::ResultCode - { - return Internal::JsonIssueReporter(scratchBuffer, message, result, path); - }; - - settings.m_reporting = AZStd::move(issueReportingCallback); - - AZ::JsonSerializationResult::ResultCode result = - AZ::JsonSerialization::Store(prefabDom, prefabDom.GetAllocator(), instance, settings); - - if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted) - { - AZ_Error( - "Prefab", false, - "Failed to serialize prefab instance with source path %s. " - "Unable to proceed.", - instance.GetTemplateSourcePath().c_str()); - - return false; - } - - referencedAssets = AZStd::move(settings.m_metadata.Find()->GetTrackedAssets()); - return true; + return Internal::StoreInstanceInPrefabDom(instance, prefabDom, &referencedAssets, flags); } bool StoreEntityInPrefabDomFormat(const AZ::Entity& entity, Instance& owningInstance, PrefabDom& prefabDom, StoreFlags flags) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index 634cb9d448..a927f60789 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -255,20 +255,23 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZ::Data::AssetId assetId = asset->GetId(); AZ::Data::AssetType assetType = asset->GetType(); - // Always queue load as the next step will stop loading for all PreLoad assets - *asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, assetType, AZ::Data::AssetLoadBehavior::QueueLoad); - - if (!asset->GetId().IsValid()) - { - AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); - return false; - } - if (loadBehavior == AZ::Data::AssetLoadBehavior::PreLoad) { // Only assets that are preloaded need to be waited on. blockingAssets.push_back(asset); + // Queue any pending request in parallel. Assets that were set to PreLoad will be waited for resulting + // in the same overall load guarantees. + asset->SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::QueueLoad); } + if (!asset->QueueLoad()) + { + AZ_Error( + "Prefab", false, "Failed to queue asset '%s' (%s) of type '%s' for loading while entering game mode.", + asset->GetHint().c_str(), asset->GetId().ToString>().c_str(), + asset->GetType().ToString>().c_str()); + return false; + } + return false; } return true; @@ -288,8 +291,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils if (asset->IsError()) { AZ_Error( - "Prefab", false, "Asset with id %s failed to preload while entering game mode", - asset->GetId().ToString().c_str()); + "Prefab", false, "Asset '%s' (%s) of type '%s' failed to preload while entering game mode", asset->GetHint().c_str(), + asset->GetId().ToString>().c_str(), + asset->GetType().ToString>().c_str()); continue; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index f13ddc027f..097acbb47c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -154,7 +154,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - bool PrefabDocument::RefreshPrefabDom() const + void PrefabDocument::RefreshPrefabDom() const { if (m_isDirty) { @@ -162,14 +162,11 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils if (PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom, m_referencedAssets)) { m_isDirty = false; - return true; } else { AZ_Assert(false, "Failed to store Instance '%s' to PrefabDom.", m_name.c_str()); - return false; } } - return true; } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index a651d73e63..cff6e8368f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -59,7 +59,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils private: bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); // Marked const so this function can be called from other const functions. It will only operate on mutable variables. - bool RefreshPrefabDom() const; + void RefreshPrefabDom() const; mutable PrefabDom m_dom; AZStd::unique_ptr m_instance; From ae3503b74c55db243c0267bf2de3c605fe216f6a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:31:51 -0800 Subject: [PATCH 271/394] Fixes build after merge Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CryEdit.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 805a22e880..fcc330b0b2 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -1820,10 +1820,7 @@ bool CCryEditApp::InitInstance() if (GetIEditor()->GetCommandManager()->IsRegistered("editor.open_lnm_editor")) { CCommand0::SUIInfo uiInfo; -#if !defined(NDEBUG) - bool ok = -#endif - GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo); + bool ok = GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo); assert(ok); } From e6113eb9c53cbe59bee03a44b71a2b86a246740a Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:09:00 -0800 Subject: [PATCH 272/394] Add checks to handle failure in creating entity as a child of a read-only entity in TrackView and LandscapeCanvas (#7156) Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- Code/Editor/TrackView/TrackViewDialog.cpp | 7 +++- .../Code/Source/Editor/MainWindow.cpp | 32 +++++++++++++++++++ .../Code/Source/Editor/MainWindow.h | 4 +++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/Code/Editor/TrackView/TrackViewDialog.cpp b/Code/Editor/TrackView/TrackViewDialog.cpp index d70cbad29e..034e12c098 100644 --- a/Code/Editor/TrackView/TrackViewDialog.cpp +++ b/Code/Editor/TrackView/TrackViewDialog.cpp @@ -1046,7 +1046,12 @@ void CTrackViewDialog::OnAddSequence() AzToolsFramework::ScopedUndoBatch undoBatch("Create TrackView Director Node"); sequenceManager->CreateSequence(sequenceName, sequenceType); CTrackViewSequence* newSequence = sequenceManager->GetSequenceByName(sequenceName); - AZ_Assert(newSequence, "Creating new sequence failed."); + + if (!newSequence) + { + return; + } + undoBatch.MarkEntityDirty(newSequence->GetSequenceComponentEntityId()); // make it the currently selected sequence diff --git a/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp b/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp index e58ea77373..8e3159969d 100644 --- a/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp +++ b/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.cpp @@ -19,13 +19,16 @@ #include #include #include +#include #include #include +#include #include #include #include #include #include +#include #include #include @@ -37,6 +40,7 @@ // Qt #include +#include #include #include #include @@ -448,6 +452,8 @@ namespace LandscapeCanvasEditor return config; } + AzFramework::EntityContextId MainWindow::s_editorEntityContextId = AzFramework::EntityContextId::CreateNull(); + MainWindow::MainWindow(QWidget* parent) : GraphModelIntegration::EditorMainWindow(GetDefaultConfig(), parent) { @@ -470,9 +476,15 @@ namespace LandscapeCanvasEditor AZ::ComponentApplicationBus::BroadcastResult(m_serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); AZ_Assert(m_serializeContext, "Failed to acquire application serialize context."); + AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult( + s_editorEntityContextId, &AzToolsFramework::EditorEntityContextRequests::GetEditorEntityContextId); + m_prefabFocusPublicInterface = AZ::Interface::Get(); AZ_Assert(m_prefabFocusPublicInterface, "LandscapeCanvas - could not get PrefabFocusPublicInterface on construction."); + m_readOnlyEntityPublicInterface = AZ::Interface::Get(); + AZ_Assert(m_readOnlyEntityPublicInterface, "LandscapeCanvas - could not get ReadOnlyEntityPublicInterface on construction."); + const GraphCanvas::EditorId& editorId = GetEditorId(); // Register unique color palettes for our connections (data types) @@ -837,6 +849,26 @@ namespace LandscapeCanvasEditor { using namespace AzFramework::Terrain; + // Detect if it's possible to create a new entity in the current context + AZ::EntityId focusRootEntityId = m_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(s_editorEntityContextId); + if (m_readOnlyEntityPublicInterface->IsReadOnly(focusRootEntityId)) + { + // Abort + CloseEditor(dockWidget->GetDockWidgetId()); + + QWidget* activeWindow = AzToolsFramework::GetActiveWindow(); + + QMessageBox::warning( + activeWindow, + QString("Landscape Canvas Asset Creation Error"), + QString("Could not create new Landscape Canvas asset under read-only entity."), + QMessageBox::Ok, + QMessageBox::Ok + ); + + return; + } + // Invoke the GraphCanvas base instead of the GraphModelIntegration::EditorMainWindow so that we // can do our own custom handling when opening an existing graph GraphCanvas::AssetEditorMainWindow::OnEditorOpened(dockWidget); diff --git a/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.h b/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.h index de6b10529d..09eb63d681 100644 --- a/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.h +++ b/Gems/LandscapeCanvas/Code/Source/Editor/MainWindow.h @@ -34,6 +34,8 @@ namespace AzToolsFramework { + class ReadOnlyEntityPublicInterface; + namespace Prefab { class PrefabFocusPublicInterface; @@ -261,7 +263,9 @@ namespace LandscapeCanvasEditor AZ::SerializeContext* m_serializeContext = nullptr; + static AzFramework::EntityContextId s_editorEntityContextId; AzToolsFramework::Prefab::PrefabFocusPublicInterface* m_prefabFocusPublicInterface = nullptr; + AzToolsFramework::ReadOnlyEntityPublicInterface* m_readOnlyEntityPublicInterface = nullptr; bool m_ignoreGraphUpdates = false; bool m_prefabPropagationInProgress = false; From b0a725340c53bd750174b4f98c16b7b436418886 Mon Sep 17 00:00:00 2001 From: moraaar Date: Wed, 26 Jan 2022 09:37:21 +0000 Subject: [PATCH 273/394] Moved gems .setreg files to Registry folder, otherwise they will be missing in a Pre-built SDK Engine (#7140) Signed-off-by: moraaar --- .../{ => Registry}/AssetProcessorGemConfig.setreg | 0 .../{ => Registry}/AssetProcessorGemConfig.setreg | 0 .../{ => Registry}/AssetProcessorGemConfig.setreg | 0 .../{ => Registry}/AssetProcessorGemConfig.setreg | 0 .../{ => Registry}/AssetProcessorGemConfig.setreg | 5 +++++ .../{ => Registry}/AssetProcessorGemConfig.setreg | 0 Registry/AssetProcessorPlatformConfig.setreg | 11 ----------- 7 files changed, 5 insertions(+), 11 deletions(-) rename Gems/Atom/Asset/ImageProcessingAtom/{ => Registry}/AssetProcessorGemConfig.setreg (100%) rename Gems/AtomLyIntegration/CommonFeatures/{ => Registry}/AssetProcessorGemConfig.setreg (100%) rename Gems/AudioEngineWwise/{ => Registry}/AssetProcessorGemConfig.setreg (100%) rename Gems/Blast/{ => Registry}/AssetProcessorGemConfig.setreg (100%) rename Gems/PhysX/{ => Registry}/AssetProcessorGemConfig.setreg (70%) rename Gems/WhiteBox/{ => Registry}/AssetProcessorGemConfig.setreg (100%) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/AssetProcessorGemConfig.setreg b/Gems/Atom/Asset/ImageProcessingAtom/Registry/AssetProcessorGemConfig.setreg similarity index 100% rename from Gems/Atom/Asset/ImageProcessingAtom/AssetProcessorGemConfig.setreg rename to Gems/Atom/Asset/ImageProcessingAtom/Registry/AssetProcessorGemConfig.setreg diff --git a/Gems/AtomLyIntegration/CommonFeatures/AssetProcessorGemConfig.setreg b/Gems/AtomLyIntegration/CommonFeatures/Registry/AssetProcessorGemConfig.setreg similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/AssetProcessorGemConfig.setreg rename to Gems/AtomLyIntegration/CommonFeatures/Registry/AssetProcessorGemConfig.setreg diff --git a/Gems/AudioEngineWwise/AssetProcessorGemConfig.setreg b/Gems/AudioEngineWwise/Registry/AssetProcessorGemConfig.setreg similarity index 100% rename from Gems/AudioEngineWwise/AssetProcessorGemConfig.setreg rename to Gems/AudioEngineWwise/Registry/AssetProcessorGemConfig.setreg diff --git a/Gems/Blast/AssetProcessorGemConfig.setreg b/Gems/Blast/Registry/AssetProcessorGemConfig.setreg similarity index 100% rename from Gems/Blast/AssetProcessorGemConfig.setreg rename to Gems/Blast/Registry/AssetProcessorGemConfig.setreg diff --git a/Gems/PhysX/AssetProcessorGemConfig.setreg b/Gems/PhysX/Registry/AssetProcessorGemConfig.setreg similarity index 70% rename from Gems/PhysX/AssetProcessorGemConfig.setreg rename to Gems/PhysX/Registry/AssetProcessorGemConfig.setreg index 993a99616b..a5ac31131c 100644 --- a/Gems/PhysX/AssetProcessorGemConfig.setreg +++ b/Gems/PhysX/Registry/AssetProcessorGemConfig.setreg @@ -10,6 +10,11 @@ "glob": "*.pxheightfield", "params": "copy", "productAssetType": "{B61189FE-B2D7-4AF1-8951-CB5C0F7834FC}" + }, + "RC PhysXMeshAsset": { + "glob": "*.pxmesh", + "params": "copy", + "productAssetType": "{7A2871B9-5EAB-4DE0-A901-B0D2C6920DDB}" } } } diff --git a/Gems/WhiteBox/AssetProcessorGemConfig.setreg b/Gems/WhiteBox/Registry/AssetProcessorGemConfig.setreg similarity index 100% rename from Gems/WhiteBox/AssetProcessorGemConfig.setreg rename to Gems/WhiteBox/Registry/AssetProcessorGemConfig.setreg diff --git a/Registry/AssetProcessorPlatformConfig.setreg b/Registry/AssetProcessorPlatformConfig.setreg index 255bac17e0..87133ba34b 100644 --- a/Registry/AssetProcessorPlatformConfig.setreg +++ b/Registry/AssetProcessorPlatformConfig.setreg @@ -480,17 +480,6 @@ "glob": "*.der", "params": "copy" }, - "RC PhysXMeshAsset": { - "glob": "*.pxmesh", - "params": "copy", - "productAssetType": "{7A2871B9-5EAB-4DE0-A901-B0D2C6920DDB}" - }, - // Copy over cooked PhysX heightfield - "RC PhysX HeightField": { - "glob": "*.pxheightfield", - "params": "copy", - "productAssetType": "{B61189FE-B2D7-4AF1-8951-CB5C0F7834FC}" - }, "RC filetag": { "glob": "*.filetag", "params": "copy", From 56f778483b979808c916c988718bc995af1c9fc8 Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:16:18 +0000 Subject: [PATCH 274/394] Fix for editor intersection with helpers disabled for EditorSplineComponent (#7143) * update file name for editor intersection tests Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add additional tests for editor spline component for viewport intersection Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../Source/Shape/EditorSplineComponent.cpp | 15 ++ .../Code/Source/Shape/EditorSplineComponent.h | 3 +- .../EditorComponentIntersectionTests.cpp | 169 ++++++++++++++++++ .../EditorShapeComponentIntersectionTests.cpp | 114 ------------ .../lmbrcentral_editor_tests_files.cmake | 2 +- 5 files changed, 187 insertions(+), 116 deletions(-) create mode 100644 Gems/LmbrCentral/Code/Tests/EditorComponentIntersectionTests.cpp delete mode 100644 Gems/LmbrCentral/Code/Tests/EditorShapeComponentIntersectionTests.cpp diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp index 0875f237b3..056e9ddbdb 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "MathConversion.h" @@ -357,6 +358,20 @@ namespace LmbrCentral return (static_cast(rayIntersectData.m_distanceSq) < powf(s_lineWidth * screenToWorldScale, 2.0f)); } + bool EditorSplineComponent::SupportsEditorRayIntersect() + { + return AzToolsFramework::HelpersVisible(); + } + + bool EditorSplineComponent::SupportsEditorRayIntersectViewport(const AzFramework::ViewportInfo& viewportInfo) + { + bool helpersVisible = false; + AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::EventResult( + helpersVisible, viewportInfo.m_viewportId, + &AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Events::HelpersVisible); + return helpersVisible; + } + void EditorSplineComponent::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) { m_cachedUniformScaleTransform = AzToolsFramework::TransformUniformScale(world); diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.h b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.h index f13879cee5..3ab8a7c795 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.h +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.h @@ -62,7 +62,8 @@ namespace LmbrCentral bool EditorSelectionIntersectRayViewport( const AzFramework::ViewportInfo& viewportInfo, const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) override; - bool SupportsEditorRayIntersect() override { return true; }; + bool SupportsEditorRayIntersect() override; + bool SupportsEditorRayIntersectViewport(const AzFramework::ViewportInfo& viewportInfo) override; // EditorComponentSelectionNotificationsBus overrides ... void OnAccentTypeChanged(AzToolsFramework::EntityAccentType accent) override { m_accentType = accent; } diff --git a/Gems/LmbrCentral/Code/Tests/EditorComponentIntersectionTests.cpp b/Gems/LmbrCentral/Code/Tests/EditorComponentIntersectionTests.cpp new file mode 100644 index 0000000000..92582844aa --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/EditorComponentIntersectionTests.cpp @@ -0,0 +1,169 @@ +/* + * 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 +#include +#include +#include + +#include "Shape/EditorSphereShapeComponent.h" +#include "Shape/EditorSplineComponent.h" + +namespace LmbrCentral +{ + using AzToolsFramework::ViewportInteraction::BuildMouseButtons; + using AzToolsFramework::ViewportInteraction::BuildMouseInteraction; + using AzToolsFramework::ViewportInteraction::BuildMousePick; + + class EditorIntersectionComponentFixture : public UnitTest::ToolsApplicationFixture + { + public: + void SetUpEditorFixtureImpl() override + { + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + + m_editorSphereShapeComponentDescriptor = + AZStd::unique_ptr(EditorSphereShapeComponent::CreateDescriptor()); + m_editorSphereShapeComponentDescriptor->Reflect(serializeContext); + m_editorSplineComponentDescriptor = AZStd::unique_ptr(EditorSplineComponent::CreateDescriptor()); + m_editorSplineComponentDescriptor->Reflect(serializeContext); + + m_entityId1 = UnitTest::CreateDefaultEditorEntity("Entity1"); + } + + void TearDownEditorFixtureImpl() override + { + bool entityDestroyed = false; + AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult( + entityDestroyed, &AzToolsFramework::EditorEntityContextRequestBus::Events::DestroyEditorEntity, m_entityId1); + + m_editorSplineComponentDescriptor.reset(); + m_editorSphereShapeComponentDescriptor.reset(); + } + + AZ::EntityId m_entityId1; + AZStd::unique_ptr m_editorSphereShapeComponentDescriptor; + AZStd::unique_ptr m_editorSplineComponentDescriptor; + }; + + struct IntersectionQueryOutcome + { + bool m_helpersVisible; + bool m_expectedIntersection; + }; + + using EditorComponentIndirectCallManipulatorViewportInteractionFixture = + UnitTest::IndirectCallManipulatorViewportInteractionFixtureMixin; + + class EditorComponentIndirectCallManipulatorViewportInteractionFixtureParam + : public EditorComponentIndirectCallManipulatorViewportInteractionFixture + , public ::testing::WithParamInterface + { + public: + virtual void CreateEditorComponent(AZ::Entity* entity) = 0; + virtual void SetupEditorComponent(AZ::EntityId entityId) = 0; + + void SetUpEditorFixtureImpl() override + { + EditorComponentIndirectCallManipulatorViewportInteractionFixture::SetUpEditorFixtureImpl(); + + auto* entity1 = AzToolsFramework::GetEntityById(m_entityId1); + AZ_Assert(entity1, "Entity1 could not be found"); + entity1->Deactivate(); + CreateEditorComponent(entity1); + entity1->Activate(); + + AZ::TransformBus::Event( + m_entityId1, &AZ::TransformBus::Events::SetWorldTM, AZ::Transform::CreateTranslation(AZ::Vector3(0.0f, 2.0f, 0.0f))); + + SetupEditorComponent(m_entityId1); + + m_cameraState = AzFramework::CreateDefaultCamera(AZ::Transform::CreateIdentity(), AZ::Vector2(1024.0f, 768.0f)); + } + + void VerifySelectionIntersection() + { + // given + m_viewportManipulatorInteraction->GetViewportInteraction().SetHelpersVisible(GetParam().m_helpersVisible); + + const auto entity1ScreenPosition = + AzFramework::WorldToScreen(AzToolsFramework::GetWorldTranslation(m_entityId1), m_cameraState); + const auto viewportId = m_viewportManipulatorInteraction->GetViewportInteraction().GetViewportId(); + const auto mouseInteraction = BuildMouseInteraction( + BuildMousePick(m_cameraState, entity1ScreenPosition), + BuildMouseButtons(AzToolsFramework::ViewportInteraction::MouseButton::None), + AzToolsFramework::ViewportInteraction::InteractionId(AZ::EntityId(), viewportId), + AzToolsFramework::ViewportInteraction::KeyboardModifiers()); + + // mimic mouse move + m_actionDispatcher->CameraState(m_cameraState)->MousePosition(entity1ScreenPosition); + + // when + float closestDistance = AZStd::numeric_limits::max(); + const bool entityPicked = AzToolsFramework::PickEntity(m_entityId1, mouseInteraction, closestDistance, viewportId); + + // then + EXPECT_THAT(entityPicked, ::testing::Eq(GetParam().m_expectedIntersection)); + } + }; + + class ShapeEditorComponentIndirectCallManipulatorViewportInteractionFixtureParam + : public EditorComponentIndirectCallManipulatorViewportInteractionFixtureParam + { + public: + void CreateEditorComponent(AZ::Entity* entity) override + { + entity->CreateComponent(); + } + + void SetupEditorComponent(AZ::EntityId entityId) override + { + LmbrCentral::SphereShapeComponentRequestsBus::Event( + entityId, &LmbrCentral::SphereShapeComponentRequestsBus::Events::SetRadius, 1.0f); + } + }; + + class SplineEditorComponentIndirectCallManipulatorViewportInteractionFixtureParam + : public EditorComponentIndirectCallManipulatorViewportInteractionFixtureParam + { + public: + void CreateEditorComponent(AZ::Entity* entity) override + { + entity->CreateComponent(); + } + + void SetupEditorComponent([[maybe_unused]] AZ::EntityId entityId) override + { + // unused + } + }; + + TEST_P(ShapeEditorComponentIndirectCallManipulatorViewportInteractionFixtureParam, ShapeIntersectionOnlyHappensWithHelpersEnabled) + { + VerifySelectionIntersection(); + } + + INSTANTIATE_TEST_CASE_P( + All, + ShapeEditorComponentIndirectCallManipulatorViewportInteractionFixtureParam, + testing::Values(IntersectionQueryOutcome{ true, true }, IntersectionQueryOutcome{ false, false })); + + TEST_P(SplineEditorComponentIndirectCallManipulatorViewportInteractionFixtureParam, SplineIntersectionOnlyHappensWithHelpersEnabled) + { + VerifySelectionIntersection(); + } + + INSTANTIATE_TEST_CASE_P( + All, + SplineEditorComponentIndirectCallManipulatorViewportInteractionFixtureParam, + testing::Values(IntersectionQueryOutcome{ true, true }, IntersectionQueryOutcome{ false, false })); +} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/Tests/EditorShapeComponentIntersectionTests.cpp b/Gems/LmbrCentral/Code/Tests/EditorShapeComponentIntersectionTests.cpp deleted file mode 100644 index a3e8865d5a..0000000000 --- a/Gems/LmbrCentral/Code/Tests/EditorShapeComponentIntersectionTests.cpp +++ /dev/null @@ -1,114 +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 -#include -#include -#include - -#include "Shape/EditorSphereShapeComponent.h" - -namespace LmbrCentral -{ - using AzToolsFramework::ViewportInteraction::BuildMouseButtons; - using AzToolsFramework::ViewportInteraction::BuildMouseInteraction; - using AzToolsFramework::ViewportInteraction::BuildMousePick; - - class EditorSphereShapeComponentFixture : public UnitTest::ToolsApplicationFixture - { - public: - void SetUpEditorFixtureImpl() override - { - AZ::SerializeContext* serializeContext = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - - m_editorSphereShapeComponentDescriptor = - AZStd::unique_ptr(EditorSphereShapeComponent::CreateDescriptor()); - m_editorSphereShapeComponentDescriptor->Reflect(serializeContext); - - m_entityId1 = UnitTest::CreateDefaultEditorEntity("Entity1"); - } - - void TearDownEditorFixtureImpl() override - { - bool entityDestroyed = false; - AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult( - entityDestroyed, &AzToolsFramework::EditorEntityContextRequestBus::Events::DestroyEditorEntity, m_entityId1); - - m_editorSphereShapeComponentDescriptor.reset(); - } - - AZ::EntityId m_entityId1; - AZStd::unique_ptr m_editorSphereShapeComponentDescriptor; - }; - - struct IntersectionQueryOutcome - { - bool m_helpersVisible; - bool m_expectedIntersection; - }; - - using ShapeComponentIndirectCallManipulatorViewportInteractionFixture = - UnitTest::IndirectCallManipulatorViewportInteractionFixtureMixin; - - class ShapeComponentIndirectCallManipulatorViewportInteractionFixtureParam - : public ShapeComponentIndirectCallManipulatorViewportInteractionFixture - , public ::testing::WithParamInterface - { - public: - void SetUpEditorFixtureImpl() override - { - ShapeComponentIndirectCallManipulatorViewportInteractionFixture::SetUpEditorFixtureImpl(); - - auto* entity1 = AzToolsFramework::GetEntityById(m_entityId1); - AZ_Assert(entity1, "Entity1 could not be found"); - entity1->Deactivate(); - entity1->CreateComponent(); - entity1->Activate(); - - AZ::TransformBus::Event( - m_entityId1, &AZ::TransformBus::Events::SetWorldTM, AZ::Transform::CreateTranslation(AZ::Vector3(0.0f, 2.0f, 0.0f))); - LmbrCentral::SphereShapeComponentRequestsBus::Event( - m_entityId1, &LmbrCentral::SphereShapeComponentRequestsBus::Events::SetRadius, 1.0f); - - m_cameraState = AzFramework::CreateDefaultCamera(AZ::Transform::CreateIdentity(), AZ::Vector2(1024.0f, 768.0f)); - } - }; - - TEST_P(ShapeComponentIndirectCallManipulatorViewportInteractionFixtureParam, ShapeIntersectionOnlyHappensWithHelpersEnabled) - { - // given - m_viewportManipulatorInteraction->GetViewportInteraction().SetHelpersVisible(GetParam().m_helpersVisible); - - const auto entity1ScreenPosition = AzFramework::WorldToScreen(AzToolsFramework::GetWorldTranslation(m_entityId1), m_cameraState); - const auto viewportId = m_viewportManipulatorInteraction->GetViewportInteraction().GetViewportId(); - const auto mouseInteraction = BuildMouseInteraction( - BuildMousePick(m_cameraState, entity1ScreenPosition), - BuildMouseButtons(AzToolsFramework::ViewportInteraction::MouseButton::None), - AzToolsFramework::ViewportInteraction::InteractionId(AZ::EntityId(), viewportId), - AzToolsFramework::ViewportInteraction::KeyboardModifiers()); - - // mimic mouse move - m_actionDispatcher->CameraState(m_cameraState)->MousePosition(entity1ScreenPosition); - - // when - float closestDistance = AZStd::numeric_limits::max(); - const bool entityPicked = AzToolsFramework::PickEntity(m_entityId1, mouseInteraction, closestDistance, viewportId); - - // then - EXPECT_THAT(entityPicked, ::testing::Eq(GetParam().m_expectedIntersection)); - } - - INSTANTIATE_TEST_CASE_P( - All, - ShapeComponentIndirectCallManipulatorViewportInteractionFixtureParam, - testing::Values(IntersectionQueryOutcome{ true, true }, IntersectionQueryOutcome{ false, false })); -} // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake index b667b4bf2e..950f43e80f 100644 --- a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake @@ -10,7 +10,7 @@ set(FILES LmbrCentralEditorTest.cpp LmbrCentralReflectionTest.h LmbrCentralReflectionTest.cpp - EditorShapeComponentIntersectionTests.cpp + EditorComponentIntersectionTests.cpp EditorBoxShapeComponentTests.cpp EditorSphereShapeComponentTests.cpp EditorCapsuleShapeComponentTests.cpp From c789814d75ca75002733d8ddcf83a7193d379458 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 26 Jan 2022 07:36:33 -0800 Subject: [PATCH 275/394] adds another maybe_unused to a new variable using assert Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/CryEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index fcc330b0b2..b9081c3f90 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -1820,7 +1820,7 @@ bool CCryEditApp::InitInstance() if (GetIEditor()->GetCommandManager()->IsRegistered("editor.open_lnm_editor")) { CCommand0::SUIInfo uiInfo; - bool ok = GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo); + [[maybe_unused]] bool ok = GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo); assert(ok); } From 1a7a350880e505b7e75355420dd25c677abc6e91 Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Wed, 26 Jan 2022 08:12:34 -0800 Subject: [PATCH 276/394] Introduce a new Focus Mode API function to retrieve full list of EntityIds that are in focus. (#7159) Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../FocusMode/FocusModeInterface.h | 5 ++ .../FocusMode/FocusModeSystemComponent.cpp | 62 +++++++++++++++++++ .../FocusMode/FocusModeSystemComponent.h | 15 +++++ .../Tests/FocusMode/EditorFocusModeTests.cpp | 53 ++++++++++++++++ 4 files changed, 135 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeInterface.h index 5455e8d773..74d207af64 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeInterface.h @@ -17,6 +17,8 @@ namespace AzToolsFramework { + using EntityIdList = AZStd::vector; + //! FocusModeInterface //! Interface to handle the Editor Focus Mode. class FocusModeInterface @@ -36,6 +38,9 @@ namespace AzToolsFramework //! @return The entity id of the root of the Editor focus, or an invalid entity id if no focus is set. virtual AZ::EntityId GetFocusRoot(AzFramework::EntityContextId entityContextId) = 0; + //! Returns a list of the ids of all the entities that are descendants of the focus root. + virtual EntityIdList GetFocusedEntities(AzFramework::EntityContextId entityContextId) = 0; + //! Returns whether the entity id provided is part of the focused sub-tree. virtual bool IsInFocusSubTree(AZ::EntityId entityId) const = 0; }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.cpp index 16640f4edf..3266daedb3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.cpp @@ -40,10 +40,14 @@ namespace AzToolsFramework void FocusModeSystemComponent::Activate() { AZ::Interface::Register(this); + EditorEntityInfoNotificationBus::Handler::BusConnect(); + Prefab::PrefabPublicNotificationBus::Handler::BusConnect(); } void FocusModeSystemComponent::Deactivate() { + Prefab::PrefabPublicNotificationBus::Handler::BusDisconnect(); + EditorEntityInfoNotificationBus::Handler::BusDisconnect(); AZ::Interface::Unregister(this); } @@ -89,6 +93,9 @@ namespace AzToolsFramework AZ::EntityId previousFocusEntityId = m_focusRoot; m_focusRoot = entityId; + + RefreshFocusedEntityIdList(); + FocusModeNotificationBus::Broadcast(&FocusModeNotifications::OnEditorFocusChanged, previousFocusEntityId, m_focusRoot); } @@ -102,6 +109,11 @@ namespace AzToolsFramework return m_focusRoot; } + EntityIdList FocusModeSystemComponent::GetFocusedEntities([[maybe_unused]] AzFramework::EntityContextId entityContextId) + { + return m_focusedEntityIdList; + } + bool FocusModeSystemComponent::IsInFocusSubTree(AZ::EntityId entityId) const { if (m_focusRoot == AZ::EntityId()) @@ -112,4 +124,54 @@ namespace AzToolsFramework return AzToolsFramework::IsInFocusSubTree(entityId, m_focusRoot); } + void FocusModeSystemComponent::OnEntityInfoUpdatedAddChildEnd(AZ::EntityId parentId, AZ::EntityId childId) + { + // If the parent's entityId is in the list, add the child. + if (auto iter = AZStd::find(m_focusedEntityIdList.begin(), m_focusedEntityIdList.end(), parentId); + iter != m_focusedEntityIdList.end()) + { + m_focusedEntityIdList.push_back(childId); + } + } + + void FocusModeSystemComponent::OnEntityInfoUpdatedRemoveChildEnd([[maybe_unused]] AZ::EntityId parentId, AZ::EntityId childId) + { + // If the removed entityId is in the list, remove it. + if (auto iter = AZStd::find(m_focusedEntityIdList.begin(), m_focusedEntityIdList.end(), childId); + iter != m_focusedEntityIdList.end()) + { + m_focusedEntityIdList.erase(iter); + } + } + + void FocusModeSystemComponent::OnPrefabInstancePropagationEnd() + { + // Can't rely on any of the entities in the list to still exist, refresh the whole thing. + RefreshFocusedEntityIdList(); + } + + void FocusModeSystemComponent::RefreshFocusedEntityIdList() + { + m_focusedEntityIdList.clear(); + + AZStd::queue entityIdQueue; + entityIdQueue.push(m_focusRoot); + + while (!entityIdQueue.empty()) + { + AZ::EntityId entityId = entityIdQueue.front(); + entityIdQueue.pop(); + + m_focusedEntityIdList.push_back(entityId); + + EntityIdList children; + EditorEntityInfoRequestBus::EventResult(children, entityId, &EditorEntityInfoRequestBus::Events::GetChildren); + + for (AZ::EntityId childEntityId : children) + { + entityIdQueue.push(childEntityId); + } + } + } + } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.h index dabaa6aaf4..eb246a387f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/FocusMode/FocusModeSystemComponent.h @@ -11,7 +11,9 @@ #include #include +#include #include +#include namespace AzToolsFramework { @@ -21,6 +23,8 @@ namespace AzToolsFramework class FocusModeSystemComponent final : public AZ::Component , private FocusModeInterface + , private EditorEntityInfoNotificationBus::Handler + , private Prefab::PrefabPublicNotificationBus::Handler { public: AZ_COMPONENT(FocusModeSystemComponent, "{6CE522FE-2057-4794-BD05-61E04BD8EA30}"); @@ -42,10 +46,21 @@ namespace AzToolsFramework void SetFocusRoot(AZ::EntityId entityId) override; void ClearFocusRoot(AzFramework::EntityContextId entityContextId) override; AZ::EntityId GetFocusRoot(AzFramework::EntityContextId entityContextId) override; + EntityIdList GetFocusedEntities(AzFramework::EntityContextId entityContextId) override; bool IsInFocusSubTree(AZ::EntityId entityId) const override; + // EditorEntityInfoNotificationBus overrides ... + void OnEntityInfoUpdatedAddChildEnd(AZ::EntityId parentId, AZ::EntityId childId) override; + void OnEntityInfoUpdatedRemoveChildEnd(AZ::EntityId parentId, AZ::EntityId childId) override; + + // PrefabPublicNotificationBus overrides ... + void OnPrefabInstancePropagationEnd() override; + private: + void RefreshFocusedEntityIdList(); + AZ::EntityId m_focusRoot; + EntityIdList m_focusedEntityIdList; }; } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeTests.cpp b/Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeTests.cpp index bac60230d6..524323230b 100644 --- a/Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeTests.cpp @@ -7,6 +7,7 @@ */ #include +#include namespace UnitTest { @@ -30,6 +31,58 @@ namespace UnitTest EXPECT_EQ(m_focusModeInterface->GetFocusRoot(m_editorEntityContextId), AZ::EntityId()); } + TEST_F(EditorFocusModeFixture, GetFocusedEntitiesBase) + { + m_focusModeInterface->SetFocusRoot(m_entityMap[StreetEntityName]); + + AzToolsFramework::EntityIdList entities = m_focusModeInterface->GetFocusedEntities(m_editorEntityContextId); + + EXPECT_EQ(entities.size(), 5); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[StreetEntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[CarEntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[Passenger1EntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[SportsCarEntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[Passenger2EntityName]) != entities.end()); + } + + TEST_F(EditorFocusModeFixture, GetFocusedEntitiesSiblings) + { + m_focusModeInterface->SetFocusRoot(m_entityMap[SportsCarEntityName]); + + AzToolsFramework::EntityIdList entities = m_focusModeInterface->GetFocusedEntities(m_editorEntityContextId); + + EXPECT_EQ(entities.size(), 2); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[SportsCarEntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[Passenger2EntityName]) != entities.end()); + } + + TEST_F(EditorFocusModeFixture, GetFocusedEntitiesAddEntity) + { + m_focusModeInterface->SetFocusRoot(m_entityMap[SportsCarEntityName]); + + AZ::EntityId testEntityId = CreateEditorEntity("Test", m_entityMap[Passenger2EntityName]); + + AzToolsFramework::EntityIdList entities = m_focusModeInterface->GetFocusedEntities(m_editorEntityContextId); + + EXPECT_EQ(entities.size(), 3); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[SportsCarEntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[Passenger2EntityName]) != entities.end()); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), testEntityId) != entities.end()); + } + + TEST_F(EditorFocusModeFixture, GetFocusedEntitiesRemoveEntity) + { + m_focusModeInterface->SetFocusRoot(m_entityMap[SportsCarEntityName]); + + AzToolsFramework::ToolsApplicationRequestBus::Broadcast( + &AzToolsFramework::ToolsApplicationRequests::DeleteEntityAndAllDescendants, m_entityMap[Passenger2EntityName]); + + AzToolsFramework::EntityIdList entities = m_focusModeInterface->GetFocusedEntities(m_editorEntityContextId); + + EXPECT_EQ(entities.size(), 1); + EXPECT_TRUE(AZStd::find(entities.begin(), entities.end(), m_entityMap[SportsCarEntityName]) != entities.end()); + } + TEST_F(EditorFocusModeFixture, IsInFocusSubTreeAncestorsDescendants) { // When the focus is set to an entity, all its descendants are in the focus subtree while the ancestors aren't. From 7ef9a01d245bdc03b6c89cdccda915d232e0ba3b Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 10:16:31 -0600 Subject: [PATCH 277/394] Fixed compile issue on Linux Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index dc9f0bbaa6..a3cfc581b6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -93,42 +93,6 @@ namespace AZ AZ::u16 h; }; - template - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - static_assert(false, "Unsupported pixel format"); - } - - template - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - static_assert(false, "Unsupported pixel format"); - } - - template - AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) - { - static_assert(false, "Unsupported pixel format"); - } - - template <> - float RetrieveFloatValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) - { - return 0.0f; - } - - template <> - AZ::u32 RetrieveUintValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) - { - return 0; - } - - template <> - AZ::s32 RetrieveIntValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) - { - return 0; - } - float ScaleValue(float value, float origMin, float origMax, float scaledMin, float scaledMax) { return ((value - origMin) / (origMax - origMin)) * (scaledMax - scaledMin) + scaledMin; @@ -180,7 +144,8 @@ namespace AZ return actualMem[index]; } default: - return RetrieveFloatValue(mem, index); + AZ_Assert(false, "Unsupported pixel format"); + return 0.0f; } } @@ -203,7 +168,8 @@ namespace AZ return actualMem[index]; } default: - return RetrieveUintValue(mem, index); + AZ_Assert(false, "Unsupported pixel format"); + return 0; } } @@ -226,7 +192,8 @@ namespace AZ return actualMem[index]; } default: - return RetrieveIntValue(mem, index); + AZ_Assert(false, "Unsupported pixel format"); + return 0; } } } From 62775add6d2a3a225b8d7dc975095e48990c929d Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:44:35 -0600 Subject: [PATCH 278/394] Implemented Support to allow project's to reference gems via the gem name (#7109) * Implemented Support to allow project's to reference gems via the gem name Updated the enable-gem command to add the name of the enabled gem to the "gem_names" array in the project.json Updated the enable-gem test to validate this functionality Centralized the CMake logic for locating external subdirectories to the Subdirectories.cmake script Added an option to the edit-project-properties and edit-engine-properties o3de.py commands to add/remove/replace the "gem_names" field in the project.json and engine.json respectively Added a CMake function to determine the root CMake "subdirectory" of any input path which is a parent of it. This logic has been used to improve the installation of external gems to the /External directory. Tested out the install layout before submitting PR fixes #7108 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed the enable-gem test on Linux to resolve the mock path. Renamed all of the o3de python test from "unit_test*.py" to "test*.py" to faciliate the python unittest module picking up the test automatically. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding test for the disable_gem command. Fixed some typos in engine_properties.py scrip. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- CMakeLists.txt | 56 +---- Gems/PhysXDebug/Code/CMakeLists.txt | 2 +- cmake/FileUtil.cmake | 44 +++- cmake/PAL.cmake | 46 +--- cmake/Platform/Common/Install_common.cmake | 55 +++-- cmake/Projects.cmake | 30 +-- cmake/Subdirectories.cmake | 197 +++++++++++++++++ cmake/cmake_files.cmake | 1 + engine.json | 2 +- scripts/o3de/o3de/cmake.py | 19 +- scripts/o3de/o3de/disable_gem.py | 17 +- scripts/o3de/o3de/enable_gem.py | 17 +- scripts/o3de/o3de/engine_properties.py | 46 +++- scripts/o3de/o3de/project_properties.py | 41 +++- scripts/o3de/tests/CMakeLists.txt | 27 ++- .../{unit_test_cmake.py => test_cmake.py} | 0 scripts/o3de/tests/test_disable_gem.py | 200 ++++++++++++++++++ ..._test_enable_gem.py => test_enable_gem.py} | 31 +-- ...roperties.py => test_engine_properties.py} | 0 ...ne_template.py => test_engine_template.py} | 0 ...m_properties.py => test_gem_properties.py} | 0 ...obal_project.py => test_global_project.py} | 0 ...unit_test_manifest.py => test_manifest.py} | 0 ...stration.py => test_print_registration.py} | 0 ...operties.py => test_project_properties.py} | 0 ...unit_test_register.py => test_register.py} | 0 .../{unit_test_utils.py => test_utils.py} | 0 27 files changed, 635 insertions(+), 196 deletions(-) create mode 100644 cmake/Subdirectories.cmake rename scripts/o3de/tests/{unit_test_cmake.py => test_cmake.py} (100%) create mode 100644 scripts/o3de/tests/test_disable_gem.py rename scripts/o3de/tests/{unit_test_enable_gem.py => test_enable_gem.py} (82%) rename scripts/o3de/tests/{unit_test_engine_properties.py => test_engine_properties.py} (100%) rename scripts/o3de/tests/{unit_test_engine_template.py => test_engine_template.py} (100%) rename scripts/o3de/tests/{unit_test_gem_properties.py => test_gem_properties.py} (100%) rename scripts/o3de/tests/{unit_test_global_project.py => test_global_project.py} (100%) rename scripts/o3de/tests/{unit_test_manifest.py => test_manifest.py} (100%) rename scripts/o3de/tests/{unit_test_print_registration.py => test_print_registration.py} (100%) rename scripts/o3de/tests/{unit_test_project_properties.py => test_project_properties.py} (100%) rename scripts/o3de/tests/{unit_test_register.py => test_register.py} (100%) rename scripts/o3de/tests/{unit_test_utils.py => test_utils.py} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index efcc866195..3f9f56a606 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,51 +44,11 @@ include(cmake/SettingsRegistry.cmake) include(cmake/TestImpactFramework/LYTestImpactFramework.cmake) include(cmake/CMakeFiles.cmake) include(cmake/O3DEJson.cmake) +include(cmake/Subdirectories.cmake) -################################################################################ -# Subdirectory processing -################################################################################ - -# this function is building up the LY_EXTERNAL_SUBDIRS global property -function(add_engine_gem_json_external_subdirectories gem_path) - set(gem_json_path ${gem_path}/gem.json) - if(EXISTS ${gem_json_path}) - read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) - foreach(gem_external_subdir ${gem_external_subdirs}) - file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) - add_engine_gem_json_external_subdirectories(${real_external_subdir}) - endforeach() - endif() -endfunction() - -function(add_engine_json_external_subdirectories) - read_json_external_subdirs(engine_external_subdirs ${LY_ROOT_FOLDER}/engine.json) - foreach(engine_external_subdir ${engine_external_subdirs}) - file(REAL_PATH ${engine_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) - add_engine_gem_json_external_subdirectories(${real_external_subdir}) - endforeach() -endfunction() - -function(add_subdirectory_on_externalsubdirs) - get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) - list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) - # Loop over the additional external subdirectories and invoke add_subdirectory on them - foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) - # Hash the external_directory name and append it to the Binary Directory section of add_subdirectory - # This is to deal with potential situations where multiple external directories has the same last directory name - # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory - file(REAL_PATH ${external_directory} full_directory_path) - string(SHA256 full_directory_hash ${full_directory_path}) - # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit - # when the external subdirectory contains relative paths of significant length - string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) - # Use the last directory as the suffix path to use for the Binary Directory - get_filename_component(directory_name ${external_directory} NAME) - add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) - endforeach() -endfunction() +# Gather the list of o3de_manifest external Subdirectories +# into the LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST_PROPERTY +add_o3de_manifest_json_external_subdirectories() # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) @@ -99,9 +59,11 @@ endif() if(NOT INSTALLED_ENGINE) # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra - # external subdirectories. This should go before adding the rest of the targets so the targets are availbe to the launcher. + # external subdirectories. This should go before adding the rest of the targets so the targets are available to the launcher. add_engine_json_external_subdirectories() - add_subdirectory_on_externalsubdirs() + + # Invoke add_subdirectory on external subdirectories that should be used a this point + add_subdirectory_on_external_subdirs() # Add the rest of the targets add_subdirectory(Assets) @@ -114,7 +76,7 @@ if(NOT INSTALLED_ENGINE) else() ly_find_o3de_packages() - add_subdirectory_on_externalsubdirs() + add_subdirectory_on_external_subdirs() endif() ################################################################################ diff --git a/Gems/PhysXDebug/Code/CMakeLists.txt b/Gems/PhysXDebug/Code/CMakeLists.txt index 0886f2bf34..1f5d266fbf 100644 --- a/Gems/PhysXDebug/Code/CMakeLists.txt +++ b/Gems/PhysXDebug/Code/CMakeLists.txt @@ -10,7 +10,7 @@ o3de_find_gem("PhysX" physx_gem_path) set(physx_gem_json ${physx_gem_path}/gem.json) o3de_restricted_path(${physx_gem_json} physx_gem_restricted_path physx_gem_parent_relative_path) -o3de_pal_dir(physx_pal_source_dir ${physx_gem_path}/Code/Source/Platform/${PAL_PLATFORM_NAME} ${physx_gem_restricted_path} ${physx_gem_path} ${physx_gem_parent_relative_path}) +o3de_pal_dir(physx_pal_source_dir ${physx_gem_path}/Code/Source/Platform/${PAL_PLATFORM_NAME} "${physx_gem_restricted_path}" "${physx_gem_path}" "${physx_gem_parent_relative_path}") include(${physx_pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_PHYSX_SUPPORTED diff --git a/cmake/FileUtil.cmake b/cmake/FileUtil.cmake index 5721cf452c..aa63b97c9d 100644 --- a/cmake/FileUtil.cmake +++ b/cmake/FileUtil.cmake @@ -153,6 +153,36 @@ function(ly_get_last_path_segment_concat_sha256 absolute_path output_path) set(${output_path} ${last_path_segment_sha256_path} PARENT_SCOPE) endfunction() +#! ly_get_root_subdirectory_which_is_parent: Locates the root source directory added the input directory +# as a subdirectory of the build, which an actual prefix of the input directory +# This is done by recursing through the PARENT_DIRECTORY "DIRECTORY" property +# The use for this is to locate the top most directory which called add_subdirectory from any input path +# i.e Given an +# LY_ROOT_FOLDER = D:\o3de +# EXTERNAL_SUBDIRS = [D:\TestGem, D:\o3de\Gems\MyGem] +# The LY_ROOT_FOLDER is responsible for invoking add_subdirectory on the external subdirectories +# so it in the PARENT_DIRECTORY property, of the subdirectory, though it might not be an actual "parent" +# If the input path to this function is D:\TestGem\Code, then the return value is D:\TestGem +# If the input path to this function is D:\o3de\Gems\MyGem, then the return value is D:\o3de + +# \arg:absolute_path - directory to locate top most parent "subdirectory", which is an "parent" of the input +# \return:output_path- top most parent subdirectory, which is actual parent(i.e a prefix) +function(ly_get_root_subdirectory_which_is_parent absolute_path output_path) + # Walk up the parent add_subdirectory calls until a parent directory which is not a prefix of the target directory + # is found + cmake_path(SET candidate_path ${absolute_path}) + get_property(parent_subdir DIRECTORY ${candidate_path} PROPERTY PARENT_DIRECTORY) + cmake_path(IS_PREFIX parent_subdir ${candidate_path} is_parent_subdir) + while(parent_subdir AND is_parent_subdir) + cmake_path(SET candidate_path "${parent_subdir}") + get_property(parent_subdir DIRECTORY ${candidate_path} PROPERTY PARENT_DIRECTORY) + cmake_path(IS_PREFIX parent_subdir ${candidate_path} is_parent_subdir) + endwhile() + + message(DEBUG "Root subdirectory of path \"${absolute_path}\" is \"${candidate_path}\"") + set(${output_path} ${candidate_path} PARENT_SCOPE) +endfunction() + #! ly_get_engine_relative_source_dir: Attempts to form a path relative to the BASE_DIRECTORY. # If that fails the last path segment of the absolute_target_source_dir concatenated with a SHA256 hash to form a target directory # \arg:BASE_DIRECTORY - Directory to base relative path against. Defaults to LY_ROOT_FOLDER @@ -167,14 +197,16 @@ function(ly_get_engine_relative_source_dir absolute_target_source_dir output_sou endif() # Get a relative target source directory to the LY root folder if possible - # Otherwise use the final component name + # Otherwise use the top most source directory which led to calling add_subdirectory on the input directory + ly_get_root_subdirectory_which_is_parent(${absolute_target_source_dir} root_subdir_of_target) + cmake_path(RELATIVE_PATH absolute_target_source_dir BASE_DIRECTORY ${root_subdir_of_target} OUTPUT_VARIABLE relative_target_source_dir) + cmake_path(IS_PREFIX LY_ROOT_FOLDER ${absolute_target_source_dir} is_target_source_dir_subdirectory_of_engine) - if(is_target_source_dir_subdirectory_of_engine) - cmake_path(RELATIVE_PATH absolute_target_source_dir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE relative_target_source_dir) - else() - ly_get_last_path_segment_concat_sha256(${absolute_target_source_dir} target_source_dir_last_path_segment) + if(NOT is_target_source_dir_subdirectory_of_engine) + cmake_path(GET root_subdir_of_target FILENAME root_subdir_dirname) + set(relative_subdir ${relative_target_source_dir}) unset(relative_target_source_dir) - cmake_path(APPEND relative_target_source_dir "External" ${target_source_dir_last_path_segment}) + cmake_path(APPEND relative_target_source_dir "External" ${root_subdir_dirname} ${relative_subdir}) endif() set(${output_source_dir} ${relative_target_source_dir} PARENT_SCOPE) diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index a43e601c74..b76fb8ac81 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -51,49 +51,21 @@ function(o3de_read_manifest o3de_manifest_json_data) endif() endfunction() -#! o3de_recurse_gems: returns the gem paths -# -# \arg:object json path -# \arg:gems returns the gems from the external subdirectory elements from the manifest -function(o3de_recurse_gems object_json_path gems) - get_filename_component(object_json_parent_path ${object_json_path} DIRECTORY) - ly_file_read(${object_json_path} json_data) - string(JSON external_subdirectories_count ERROR_VARIABLE json_error LENGTH ${json_data} "external_subdirectories") - if(NOT json_error) - if(external_subdirectories_count GREATER 0) - math(EXPR external_subdirectories_range "${external_subdirectories_count}-1") - foreach(external_subdirectories_index RANGE ${external_subdirectories_range}) - string(JSON external_subdirectories_entry ERROR_VARIABLE json_error GET ${json_data} "external_subdirectories" "${external_subdirectories_index}") - cmake_path(IS_RELATIVE external_subdirectories_entry is_relative) - if(${is_relative}) - cmake_path(ABSOLUTE_PATH external_subdirectories_entry BASE_DIRECTORY ${object_json_parent_path} NORMALIZE OUTPUT_VARIABLE external_subdirectories_entry) - endif() - if(EXISTS ${external_subdirectories_entry}/gem.json) - list(APPEND gem_entries ${external_subdirectories_entry}) - o3de_recurse_gems(${external_subdirectories_entry}/gem.json gem_entries) - endif() - endforeach() - endif() - endif() - set(${gems} ${gem_entries} PARENT_SCOPE) -endfunction() #! o3de_find_gem: returns the gem path # # \arg:gem_name the gem name to find # \arg:the path of the gem function(o3de_find_gem gem_name gem_path) - o3de_get_manifest_path(manifest_path) - if(EXISTS ${manifest_path}) - o3de_recurse_gems(${manifest_path} gems) - endif() - o3de_recurse_gems(${LY_ROOT_FOLDER}/engine.json gems) - foreach(gem ${gems}) - ly_file_read(${gem}/gem.json json_data) - string(JSON gem_json_name ERROR_VARIABLE json_error GET ${json_data} "gem_name") - if(gem_json_name STREQUAL gem_name) - set(${gem_path} ${gem} PARENT_SCOPE) - return() + get_all_external_subdirectories(all_external_subdirs) + foreach(external_subdir IN LISTS all_external_subdirs) + set(candidate_gem_path ${external_subdir}/gem.json) + if(EXISTS ${candidate_gem_path}) + o3de_read_json_key(gem_json_name ${candidate_gem_path} "gem_name") + if(gem_json_name STREQUAL gem_name) + set(${gem_path} ${external_subdir} PARENT_SCOPE) + return() + endif() endif() endforeach() endfunction() diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index e42664c107..5d92b9944e 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -448,9 +448,27 @@ function(ly_setup_cmake_install) # Transform the LY_EXTERNAL_SUBDIRS global property list into a json array set(indent " ") get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + list(REMOVE_DUPLICATES external_subdirs) foreach(external_subdir ${external_subdirs}) - cmake_path(RELATIVE_PATH external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE engine_rel_external_subdir) - list(APPEND relative_external_subdirs "\"${engine_rel_external_subdir}\"") + # If an external subdirectory is not a subdirectory of the engine root, then + # prepend "External" to its subdirectory root + ly_get_root_subdirectory_which_is_parent(${external_subdir} root_subdir_of_external_subdir) + cmake_path(RELATIVE_PATH external_subdir BASE_DIRECTORY ${root_subdir_of_external_subdir} OUTPUT_VARIABLE engine_rel_external_subdir) + + cmake_path(IS_PREFIX LY_ROOT_FOLDER ${external_subdir} is_subdirectory_of_engine) + if(NOT is_subdirectory_of_engine) + cmake_path(GET root_subdir_of_external_subdir FILENAME root_subdir_dirname) + set(relative_subdir ${engine_rel_external_subdir}) + unset(engine_rel_external_subdir) + cmake_path(APPEND engine_rel_external_subdir "External" ${root_subdir_dirname} ${relative_subdir}) + endif() + + set(quoted_engine_rel_external_subdir "\"${engine_rel_external_subdir}\"") + if (quoted_engine_rel_external_subdir IN_LIST relative_external_subdirs) + message(WARNING "An external subdirectory \"${external_subdir}\" has been found twice when generating the engine.json for the install layout") + else() + list(APPEND relative_external_subdirs "\"${engine_rel_external_subdir}\"") + endif() endforeach() list(JOIN relative_external_subdirs ",\n${indent}" LY_INSTALL_EXTERNAL_SUBDIRS) @@ -507,7 +525,17 @@ function(ly_setup_cmake_install) # Add to find_subdirectories all directories in which ly_add_target were called in get_property(all_subdirectories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES) foreach(target_subdirectory IN LISTS all_subdirectories) - cmake_path(RELATIVE_PATH target_subdirectory BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE relative_target_subdirectory) + ly_get_root_subdirectory_which_is_parent(${target_subdirectory} root_subdir_of_target) + cmake_path(RELATIVE_PATH target_subdirectory BASE_DIRECTORY ${root_subdir_of_target} OUTPUT_VARIABLE relative_target_subdirectory) + + cmake_path(IS_PREFIX LY_ROOT_FOLDER ${target_subdirectory} is_subdirectory_of_engine) + if(NOT is_subdirectory_of_engine) + cmake_path(GET root_subdir_of_target FILENAME root_subdir_dirname) + set(relative_subdir ${relative_target_subdirectory}) + unset(relative_target_subdirectory) + cmake_path(APPEND relative_target_subdirectory "External" ${root_subdir_dirname} ${relative_subdir}) + endif() + string(APPEND find_subdirectories "add_subdirectory(${relative_target_subdirectory})\n") endforeach() set(permutation_find_subdirectories ${CMAKE_CURRENT_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/o3de_subdirectories_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) @@ -657,12 +685,12 @@ function(ly_setup_assets) set_property(GLOBAL APPEND PROPERTY global_gem_candidate_dirs_prop ${gem_candidate_dir}) endforeach() - # Iterate over each gem candidate directories and read populate a directory property + # Iterate over each gem candidate directories and populate a directory property # containing the files to copy over get_property(gem_candidate_dirs GLOBAL PROPERTY global_gem_candidate_dirs_prop) foreach(gem_candidate_dir IN LISTS gem_candidate_dirs) get_property(filtered_asset_paths DIRECTORY ${gem_candidate_dir} PROPERTY directory_filtered_asset_paths) - ly_get_last_path_segment_concat_sha256(${gem_candidate_dir} last_gem_root_path_segment) + # Check if the gem is a subdirectory of the engine cmake_path(IS_PREFIX LY_ROOT_FOLDER ${gem_candidate_dir} is_gem_subdirectory_of_engine) @@ -697,15 +725,16 @@ function(ly_setup_assets) # gem directories and files to install get_property(gems_assets_paths DIRECTORY ${gem_candidate_dir} PROPERTY gems_assets_paths) foreach(gem_absolute_path IN LISTS gems_assets_paths) - if(is_gem_subdirectory_of_engine) - cmake_path(RELATIVE_PATH gem_absolute_path BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE gem_install_dest_dir) - else() - # The gem resides outside of the LY_ROOT_FOLDER, so the destination is made relative to the - # gem candidate directory and placed under the "External" directory" - # directory - cmake_path(RELATIVE_PATH gem_absolute_path BASE_DIRECTORY ${gem_candidate_dir} OUTPUT_VARIABLE gem_relative_path) + # If an external subdirectory is not a subdirectory of the engine root, then + # prepend "External" to its subdirectory root + ly_get_root_subdirectory_which_is_parent(${gem_candidate_dir} root_subdir_of_gem) + cmake_path(RELATIVE_PATH gem_absolute_path BASE_DIRECTORY ${root_subdir_of_gem} OUTPUT_VARIABLE gem_install_dest_dir) + + if(NOT is_gem_subdirectory_of_engine) + cmake_path(GET root_subdir_of_gem FILENAME root_subdir_dirname) + set(relative_subdir ${gem_install_dest_dir}) unset(gem_install_dest_dir) - cmake_path(APPEND gem_install_dest_dir "External" ${last_gem_root_path_segment} ${gem_relative_path}) + cmake_path(APPEND gem_install_dest_dir "External" ${root_subdir_dirname} ${relative_subdir}) endif() cmake_path(GET gem_install_dest_dir PARENT_PATH gem_install_dest_dir) diff --git a/cmake/Projects.cmake b/cmake/Projects.cmake index c6aa6c382a..acfa921ef1 100644 --- a/cmake/Projects.cmake +++ b/cmake/Projects.cmake @@ -118,30 +118,6 @@ function(ly_generate_project_build_path_setreg project_real_path) file(GENERATE OUTPUT ${project_user_build_path_setreg_file} CONTENT ${project_build_path_setreg_content}) endfunction() -function(add_gem_json_external_subdirectories gem_path) - set(gem_json_path ${gem_path}/gem.json) - if(EXISTS ${gem_json_path}) - read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) - foreach(gem_external_subdir ${gem_external_subdirs}) - file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) - add_gem_json_external_subdirectories(${real_external_subdir}) - endforeach() - endif() -endfunction() - -function(add_project_json_external_subdirectories project_path) - set(project_json_path ${project_path}/project.json) - if(EXISTS ${project_json_path}) - read_json_external_subdirs(project_external_subdirs ${project_path}/project.json) - foreach(project_external_subdir ${project_external_subdirs}) - file(REAL_PATH ${project_external_subdir} real_external_subdir BASE_DIRECTORY ${project_path}) - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) - add_gem_json_external_subdirectories(${real_external_subdir}) - endforeach() - endif() -endfunction() - function(install_project_asset_artifacts project_real_path) # The cmake tar command has a bit of a flaw # Any paths within the archive files it creates are relative to the current working directory. @@ -212,16 +188,16 @@ foreach(project ${LY_PROJECTS}) # when the external subdirectory contains relative paths of significant length string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) - get_filename_component(project_folder_name ${project} NAME) + cmake_path(GET project FILENAME project_folder_name ) list(APPEND LY_PROJECTS_FOLDER_NAME ${project_folder_name}) add_subdirectory(${project} "${project_folder_name}-${full_directory_hash}") ly_generate_project_build_path_setreg(${full_directory_path}) - add_project_json_external_subdirectories(${full_directory_path}) # Get project name o3de_read_json_key(project_name ${full_directory_path}/project.json "project_name") + add_project_json_external_subdirectories(${full_directory_path} "${project_name}") - install_project_asset_artifacts(${full_directory_path}) + install_project_asset_artifacts(${full_directory_path}) endforeach() diff --git a/cmake/Subdirectories.cmake b/cmake/Subdirectories.cmake new file mode 100644 index 0000000000..3580710c82 --- /dev/null +++ b/cmake/Subdirectories.cmake @@ -0,0 +1,197 @@ +# +# 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_guard() + +################################################################################ +# Subdirectory processing +################################################################################ + +# this function is building up the LY_EXTERNAL_SUBDIRS global property +function(add_engine_gem_json_external_subdirectories gem_path) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + + # Append external subdirectory if it is not in global property + get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + if(NOT real_external_subdir IN_LIST current_external_subdirs) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + # Also append the project external subdirectores to the LY_EXTERNAL_SUBDIRS_ENGINE property + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE ${real_external_subdir}) + add_engine_gem_json_external_subdirectories(${real_external_subdir}) + endif() + endforeach() + endif() +endfunction() + +function(add_engine_json_external_subdirectories) + set(engine_json_path ${LY_ROOT_FOLDER}/engine.json) + if(EXISTS ${engine_json_path}) + read_json_external_subdirs(engine_external_subdirs ${engine_json_path}) + foreach(engine_external_subdir ${engine_external_subdirs}) + file(REAL_PATH ${engine_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) + + # Append external subdirectory if it is not in global property + get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + if(NOT real_external_subdir IN_LIST current_external_subdirs) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + # Also append the project external subdirectores to the LY_EXTERNAL_SUBDIRS_ENGINE property + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_ENGINE ${real_external_subdir}) + add_engine_gem_json_external_subdirectories(${real_external_subdir}) + endif() + endforeach() + endif() +endfunction() + + +function(add_project_gem_json_external_subdirectories gem_path project_name) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + + # Append external subdirectory if it is not in global property + get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + if(NOT real_external_subdir IN_LIST current_external_subdirs) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + # Also append the project external subdirectores to the LY_EXTERNAL_SUBDIRS_${project_name} property + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_${project_name} ${real_external_subdir}) + add_project_gem_json_external_subdirectories(${real_external_subdir} "${project_name}") + endif() + endforeach() + endif() +endfunction() + +function(add_project_json_external_subdirectories project_path project_name) + set(project_json_path ${project_path}/project.json) + if(EXISTS ${project_json_path}) + read_json_external_subdirs(project_external_subdirs ${project_path}/project.json) + foreach(project_external_subdir ${project_external_subdirs}) + file(REAL_PATH ${project_external_subdir} real_external_subdir BASE_DIRECTORY ${project_path}) + + # Append external subdirectory if it is not in global property + get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + if(NOT real_external_subdir IN_LIST current_external_subdirs) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + # Also append the project external subdirectores to the LY_EXTERNAL_SUBDIRS_${project_name} property + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_${project_name} ${real_external_subdir}) + add_project_gem_json_external_subdirectories(${real_external_subdir} "${project_name}") + endif() + endforeach() + endif() +endfunction() + + +#! add_o3de_manifest_gem_json_external_subdirectories : Recurses through external subdirectories +#! originally found in the add_o3de_manifest_json_external_subdirectories command +function(add_o3de_manifest_gem_json_external_subdirectories gem_path) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + + # Append external subdirectory ONLY to LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST PROPERTY + # It is not appended to LY_EXTERNAL_SUBDIRS unless that gem is used by the project + get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST) + if(NOT real_external_subdir IN_LIST current_external_subdirs) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST ${real_external_subdir}) + add_o3de_manifest_gem_json_external_subdirectories(${real_external_subdir}) + endif() + endforeach() + endif() +endfunction() + +#! add_o3de_manifest_json_external_subdirectories : Adds the list of external_subdirectories +#! in the user o3de_manifest.json to the LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST property +function(add_o3de_manifest_json_external_subdirectories) + o3de_get_manifest_path(manifest_path) + if(EXISTS ${manifest_path}) + read_json_external_subdirs(o3de_manifest_external_subdirs ${manifest_path}) + foreach(manifest_external_subdir ${o3de_manifest_external_subdirs}) + file(REAL_PATH ${manifest_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) + + # Append external subdirectory ONLY to LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST PROPERTY + # It is not appended to LY_EXTERNAL_SUBDIRS unless that gem is used by the project + get_property(current_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST) + if(NOT real_external_subdir IN_LIST current_external_subdirs) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST ${real_external_subdir}) + add_o3de_manifest_gem_json_external_subdirectories(${real_external_subdir}) + endif() + endforeach() + endif() +endfunction() + +#! Gather unique_list of all external subdirectories that is union +#! of the engine.json, project.json, o3de_manifest.json and any gem.json files found visiting +function(get_all_external_subdirectories output_subdirs) + get_property(all_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + get_property(manifest_external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS_O3DE_MANIFEST) + list(APPEND all_external_subdirs ${manifest_external_subdirs}) + list(REMOVE_DUPLICATES all_external_subdirs) + set(${output_subdirs} ${all_external_subdirs} PARENT_SCOPE) +endfunction() + +#! add_registered_gems_to_external_subdirs: +#! Accepts a list of gem_names (which can be read from the project.json or engine.json) +#! and cross checks them against union of all external subdirectories to determine the gem path. +#! If that gem exist it is appended to LY_EXTERNAL_SUBDIRS so that that the build generator +#! adds to the generated build project. +#! Otherwise a fatal error is logged indicating that is not gem could not be found in the list of external subdirectories +function(add_registered_gems_to_external_subdirs gem_names) + if (gem_names) + get_all_external_subdirectories(all_external_subdirs) + foreach(gem_name IN LISTS gem_names) + unset(gem_path) + o3de_find_gem(${gem_name} gem_path) + if (gem_path) + set_property(GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS ${gem_path} APPEND) + else() + list(JOIN all_external_subdirs "\n" external_subdirs_formatted) + message(SEND_ERROR "The gem \"${gem_name}\" from the \"gem_names\" field in the engine.json/project.json " + " could not be found in any gem.json from the following list of registered external subdirectories:\n" + "${external_subdirs_formatted}") + break() + endif() + endforeach() + endif() +endfunction() + +function(add_subdirectory_on_external_subdirs) + # Lookup the paths of "gem_names" array all project.json files and engine.json + # and append them to the LY_EXTERNAL_SUBDIRS property + foreach(project ${LY_PROJECTS}) + file(REAL_PATH ${project} full_directory_path BASE_DIRECTORY ${CMAKE_SOURCE_DIR}) + o3de_read_json_array(gem_names ${full_directory_path}/project.json "gem_names") + add_registered_gems_to_external_subdirs("${gem_names}") + endforeach() + o3de_read_json_array(gem_names ${LY_ROOT_FOLDER}/engine.json "gem_names") + add_registered_gems_to_external_subdirs("${gem_names}") + + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) + list(REMOVE_DUPLICATES LY_EXTERNAL_SUBDIRS) + # Loop over the additional external subdirectories and invoke add_subdirectory on them + foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) + # Hash the external_directory name and append it to the Binary Directory section of add_subdirectory + # This is to deal with potential situations where multiple external directories has the same last directory name + # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory + file(REAL_PATH ${external_directory} full_directory_path) + string(SHA256 full_directory_hash ${full_directory_path}) + # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit + # when the external subdirectory contains relative paths of significant length + string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) + # Use the last directory as the suffix path to use for the Binary Directory + cmake_path(GET external_directory FILENAME directory_name) + add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) + endforeach() +endfunction() diff --git a/cmake/cmake_files.cmake b/cmake/cmake_files.cmake index caeab9d12e..90f1e9a2d8 100644 --- a/cmake/cmake_files.cmake +++ b/cmake/cmake_files.cmake @@ -35,6 +35,7 @@ set(FILES Projects.cmake RuntimeDependencies.cmake SettingsRegistry.cmake + Subdirectories.cmake UnitTest.cmake Version.cmake ) diff --git a/engine.json b/engine.json index 51b6738001..5c64eed308 100644 --- a/engine.json +++ b/engine.json @@ -54,7 +54,7 @@ "Gems/NvCloth", "Gems/PhysX", "Gems/PhysXDebug", - "Gems/Prefab", + "Gems/Prefab/PrefabBuilder", "Gems/Presence", "Gems/PrimitiveAssets", "Gems/Profiler", diff --git a/scripts/o3de/o3de/cmake.py b/scripts/o3de/o3de/cmake.py index 7a820a9677..163d77f2f4 100644 --- a/scripts/o3de/o3de/cmake.py +++ b/scripts/o3de/o3de/cmake.py @@ -150,7 +150,10 @@ def remove_gem_dependency(cmake_file: pathlib.Path, # If the in_gem_list was flipped to false, that means the currently parsed line contained the # line end marker, so append that to the result_line result_line += enable_gem_end_marker if not in_gem_list else '' - t_data.append(result_line + '\n') + # Strip of trailing whitespace. This also strips result lines which are empty of the indent + result_line = result_line.rstrip() + if result_line: + t_data.append(result_line + '\n') else: t_data.append(line) @@ -165,11 +168,6 @@ def remove_gem_dependency(cmake_file: pathlib.Path, return 0 -def get_project_gems(project_path: pathlib.Path, - platform: str = 'Common') -> set: - return get_gems_from_cmake_file(get_enabled_gem_cmake_file(project_path=project_path, platform=platform)) - - def get_enabled_gems(cmake_file: pathlib.Path) -> set: """ Gets a list of enabled gems from the cmake file @@ -206,15 +204,6 @@ def get_enabled_gems(cmake_file: pathlib.Path) -> set: return gem_target_set -def get_project_gem_paths(project_path: pathlib.Path, - platform: str = 'Common') -> set: - gem_names = get_project_gems(project_path, platform) - gem_paths = set() - for gem_name in gem_names: - gem_paths.add(manifest.get_registered(gem_name=gem_name, project_path=project_path)) - return gem_paths - - def get_enabled_gem_cmake_file(project_name: str = None, project_path: str or pathlib.Path = None, platform: str = 'Common') -> pathlib.Path or None: diff --git a/scripts/o3de/o3de/disable_gem.py b/scripts/o3de/o3de/disable_gem.py index eecc765d32..617ad8ba41 100644 --- a/scripts/o3de/o3de/disable_gem.py +++ b/scripts/o3de/o3de/disable_gem.py @@ -15,7 +15,7 @@ import os import pathlib import sys -from o3de import cmake, manifest, utils +from o3de import cmake, manifest, project_properties, utils logger = logging.getLogger('o3de.disable_gem') logging.basicConfig(format=utils.LOG_FORMAT) @@ -68,8 +68,8 @@ def disable_gem_in_project(gem_name: str = None, f' {project_path / "project.json"}, engine.json') return 1 gem_path = pathlib.Path(gem_path).resolve() - # make sure this gem already exists if we're adding. We can always remove a gem. - if not gem_path.exists(): + # make sure the gem path is a directory + if not gem_path.is_dir(): logger.error(f'Gem Path {gem_path} does not exist.') return 1 @@ -79,9 +79,6 @@ def disable_gem_in_project(gem_name: str = None, logger.error(f'Could not read gem.json content under {gem_path}.') return 1 - # when removing we will try to do as much as possible even with failures so ret_val will be the last error code - ret_val = 0 - if not enabled_gem_file: enabled_gem_file = cmake.get_enabled_gem_cmake_file(project_path=project_path) @@ -89,10 +86,14 @@ def disable_gem_in_project(gem_name: str = None, if not enabled_gem_file.is_file(): logger.error(f'Enabled gem file {enabled_gem_file} is not present.') return 1 + # remove the gem error_code = cmake.remove_gem_dependency(enabled_gem_file, gem_json_data['gem_name']) - if error_code: - ret_val = error_code + + # Remove the name of the gem from the project.json "gem_names" field if the gem is neither + # registered with the project.json nor engine.json + ret_val = project_properties.edit_project_props(project_path, + delete_gem_names=gem_json_data['gem_name']) or error_code return ret_val diff --git a/scripts/o3de/o3de/enable_gem.py b/scripts/o3de/o3de/enable_gem.py index ea79f6c73f..bcfcd7157a 100644 --- a/scripts/o3de/o3de/enable_gem.py +++ b/scripts/o3de/o3de/enable_gem.py @@ -16,7 +16,7 @@ import os import pathlib import sys -from o3de import cmake, manifest, register, validation, utils +from o3de import cmake, manifest, project_properties, register, validation, utils logger = logging.getLogger('o3de.enable_gem') logging.basicConfig(format=utils.LOG_FORMAT) @@ -33,7 +33,7 @@ def enable_gem_in_project(gem_name: str = None, :param gem_path: path to the gem to add :param project_name: name of to the project to add the gem to :param project_path: path to the project to add the gem to - :param enabled_gem_file_file: if this dependency goes/is in a specific file + :param enabled_gem_file: if this dependency goes/is in a specific file :return: 0 for success or non 0 failure code """ # we need either a project name or path @@ -80,8 +80,6 @@ def enable_gem_in_project(gem_name: str = None, logger.error(f'Could not read gem.json content under {gem_path}.') return 1 - - ret_val = 0 if enabled_gem_file: # make sure this is a project has an enabled gems file if not enabled_gem_file.is_file(): @@ -96,17 +94,16 @@ def enable_gem_in_project(gem_name: str = None, if not project_enabled_gem_file.is_file(): project_enabled_gem_file.touch() - # Before adding the gem_dependency check if the project is registered in either the project or engine - # manifest + # Before adding the gem_dependency check if the project is registered in either the project or engine manifest buildable_gems = manifest.get_engine_gems() buildable_gems.extend(manifest.get_project_gems(project_path)) - # Convert each path to pathlib.Path object and filter out duplictes using dict.fromkeys + # Convert each path to pathlib.Path object and filter out duplicates using dict.fromkeys buildable_gems = list(dict.fromkeys(map(lambda gem_path_string: pathlib.Path(gem_path_string), buildable_gems))) ret_val = 0 - # If the gem is not part of buildable set, it needs to be registered - if not gem_path in buildable_gems: - ret_val = register.register(gem_path=gem_path, external_subdir_project_path=project_path) + # If the gem is not part of buildable set, it's gem_name should be registered to the "gem_names" field + if gem_path not in buildable_gems: + ret_val = project_properties.edit_project_props(project_path, new_gem_names=gem_json_data['gem_name']) # add the gem if it is registered in either the project.json or engine.json ret_val = ret_val or cmake.add_gem_dependency(project_enabled_gem_file, gem_json_data['gem_name']) diff --git a/scripts/o3de/o3de/engine_properties.py b/scripts/o3de/o3de/engine_properties.py index 636e32704e..06bff88d64 100644 --- a/scripts/o3de/o3de/engine_properties.py +++ b/scripts/o3de/o3de/engine_properties.py @@ -18,11 +18,35 @@ from o3de import manifest, utils logger = logging.getLogger('o3de.engine_properties') logging.basicConfig(format=utils.LOG_FORMAT) +def _edit_gem_names(engine_json: dict, + new_gem_names: str or list = None, + delete_gem_names: str or list = None, + replace_gem_names: str or list = None): + if new_gem_names: + tag_list = new_gem_names.split() if isinstance(new_gem_names, str) else new_gem_names + engine_json.setdefault('gem_names', []).extend(tag_list) + if delete_gem_names: + removal_list = delete_gem_names.split() if isinstance(delete_gem_names, str) else delete_gem_names + if 'gem_names' in engine_json: + for tag in removal_list: + if tag in engine_json['gem_names']: + engine_json['gem_names'].remove(tag) + if replace_gem_names: + tag_list = replace_gem_names.split() if isinstance(replace_gem_names, str) else replace_gem_names + engine_json['gem_names'] = tag_list + + # Remove duplicates from list + engine_json['gem_names'] = list(dict.fromkeys(engine_json.get('gem_names', []))) + def edit_engine_props(engine_path: pathlib.Path = None, engine_name: str = None, new_name: str = None, - new_version: str = None) -> int: + new_version: str = None, + new_gem_names: str or list = None, + delete_gem_names: str or list = None, + replace_gem_names: str or list = None + ) -> int: if not engine_path and not engine_name: logger.error(f'Either a engine path or a engine name must be supplied to lookup engine.json') return 1 @@ -51,13 +75,20 @@ def edit_engine_props(engine_path: pathlib.Path = None, if new_version: engine_json_data['O3DEVersion'] = new_version + # Update the gem_names field in the engine.json + _edit_gem_names(engine_json_data, new_gem_names, delete_gem_names, replace_gem_names) + return 0 if manifest.save_o3de_manifest(engine_json_data, pathlib.Path(engine_path) / 'engine.json') else 1 def _edit_engine_props(args: argparse) -> int: return edit_engine_props(args.engine_path, - args.engine_name, - args.engine_new_name, - args.engine_version) + args.engine_name, + args.engine_new_name, + args.engine_version, + args.add_gem_names, + args.delete_gem_names, + args.replace_gem_names + ) def add_parser_args(parser): group = parser.add_mutually_exclusive_group(required=True) @@ -70,6 +101,13 @@ def add_parser_args(parser): help='Sets the name for the engine.') group.add_argument('-ev', '--engine-version', type=str, required=False, help='Sets the version for the engine.') + group = parser.add_mutually_exclusive_group(required=False) + group.add_argument('-agn', '--add-gem-names', type=str, nargs='*', required=False, + help='Adds gem name(s) to gem_names field. Space delimited list (ex. -at A B C)') + group.add_argument('-dgn', '--delete-gem-names', type=str, nargs='*', required=False, + help='Removes gem name(s) from the gem_names field. Space delimited list (ex. -dt A B C') + group.add_argument('-rgn', '--replace-gem-names', type=str, nargs='*', required=False, + help='Replace entirety of gem_names field with space delimited list of values') parser.set_defaults(func=_edit_engine_props) def add_args(subparsers) -> None: diff --git a/scripts/o3de/o3de/project_properties.py b/scripts/o3de/o3de/project_properties.py index 9ee55773b5..f809bc8153 100644 --- a/scripts/o3de/o3de/project_properties.py +++ b/scripts/o3de/o3de/project_properties.py @@ -28,6 +28,27 @@ def get_project_props(name: str = None, path: pathlib.Path = None) -> dict: return proj_json +def _edit_gem_names(proj_json: dict, + new_gem_names: str or list = None, + delete_gem_names: str or list = None, + replace_gem_names: str or list = None): + if new_gem_names: + tag_list = new_gem_names.split() if isinstance(new_gem_names, str) else new_gem_names + proj_json.setdefault('gem_names', []).extend(tag_list) + if delete_gem_names: + removal_list = delete_gem_names.split() if isinstance(delete_gem_names, str) else delete_gem_names + if 'gem_names' in proj_json: + for tag in removal_list: + if tag in proj_json['gem_names']: + proj_json['gem_names'].remove(tag) + if replace_gem_names: + tag_list = replace_gem_names.split() if isinstance(replace_gem_names, str) else replace_gem_names + proj_json['gem_names'] = tag_list + + # Remove duplicates from list + proj_json['gem_names'] = list(dict.fromkeys(proj_json.get('gem_names', []))) + + def edit_project_props(proj_path: pathlib.Path = None, proj_name: str = None, new_name: str = None, @@ -38,7 +59,11 @@ def edit_project_props(proj_path: pathlib.Path = None, new_icon: str = None, new_tags: str or list = None, delete_tags: str or list = None, - replace_tags: str or list = None) -> int: + replace_tags: str or list = None, + new_gem_names: str or list = None, + delete_gem_names: str or list = None, + replace_gem_names: str or list = None + ) -> int: proj_json = get_project_props(proj_name, proj_path) if not proj_json: @@ -74,6 +99,8 @@ def edit_project_props(proj_path: pathlib.Path = None, if replace_tags: tag_list = replace_tags.split() if isinstance(replace_tags, str) else replace_tags proj_json['user_tags'] = tag_list + # Update the gem_names field in the project.json + _edit_gem_names(proj_json, new_gem_names, delete_gem_names, replace_gem_names) return 0 if manifest.save_o3de_manifest(proj_json, pathlib.Path(proj_path) / 'project.json') else 1 @@ -89,7 +116,10 @@ def _edit_project_props(args: argparse) -> int: args.project_icon, args.add_tags, args.delete_tags, - args.replace_tags) + args.replace_tags, + args.add_gem_names, + args.delete_gem_names, + args.replace_gem_names) def add_parser_args(parser): @@ -118,6 +148,13 @@ def add_parser_args(parser): help='Removes tag(s) from the user_tags property. Space delimited list (ex. -dt A B C') group.add_argument('-rt', '--replace-tags', type=str, nargs ='*', required=False, help='Replace entirety of user_tags property with space delimited list of values') + group = parser.add_mutually_exclusive_group(required=False) + group.add_argument('-agn', '--add-gem-names', type=str, nargs='*', required=False, + help='Adds gem name(s) to gem_names field. Space delimited list (ex. -at A B C)') + group.add_argument('-dgn', '--delete-gem-names', type=str, nargs='*', required=False, + help='Removes gem name(s) from the gem_names field. Space delimited list (ex. -dt A B C') + group.add_argument('-rgn', '--replace-gem-names', type=str, nargs='*', required=False, + help='Replace entirety of gem_names field with space delimited list of values') parser.set_defaults(func=_edit_project_props) diff --git a/scripts/o3de/tests/CMakeLists.txt b/scripts/o3de/tests/CMakeLists.txt index de8e9e4974..4c75e5e7df 100644 --- a/scripts/o3de/tests/CMakeLists.txt +++ b/scripts/o3de/tests/CMakeLists.txt @@ -13,70 +13,77 @@ endif() # Add a test to test out the o3de package `o3de.py register` command ly_add_pytest( NAME o3de_register - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_register.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_register.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_cmake - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_cmake.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_cmake.py + TEST_SUITE smoke + EXCLUDE_TEST_RUN_TARGET_FROM_IDE +) + +ly_add_pytest( + NAME o3de_disable_gem + PATH ${CMAKE_CURRENT_LIST_DIR}/test_disable_gem.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_enable_gem - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_enable_gem.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_enable_gem.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_global_project - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_global_project.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_global_project.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_manifest - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_manifest.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_manifest.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_engine_properties - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_engine_properties.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_engine_properties.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_project_properties - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_project_properties.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_project_properties.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_gem_properties - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_gem_properties.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_gem_properties.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_template - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_engine_template.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_engine_template.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) ly_add_pytest( NAME o3de_register_show - PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_print_registration.py + PATH ${CMAKE_CURRENT_LIST_DIR}/test_print_registration.py TEST_SUITE smoke EXCLUDE_TEST_RUN_TARGET_FROM_IDE ) diff --git a/scripts/o3de/tests/unit_test_cmake.py b/scripts/o3de/tests/test_cmake.py similarity index 100% rename from scripts/o3de/tests/unit_test_cmake.py rename to scripts/o3de/tests/test_cmake.py diff --git a/scripts/o3de/tests/test_disable_gem.py b/scripts/o3de/tests/test_disable_gem.py new file mode 100644 index 0000000000..18e0402185 --- /dev/null +++ b/scripts/o3de/tests/test_disable_gem.py @@ -0,0 +1,200 @@ +# +# 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 json + +import pytest +import pathlib +from unittest.mock import patch + +from o3de import cmake, disable_gem, enable_gem + + +TEST_PROJECT_JSON_PAYLOAD = ''' +{ + "project_name": "TestProject", + "origin": "The primary repo for TestProject goes here: i.e. http://www.mydomain.com", + "license": "What license TestProject uses goes here: i.e. https://opensource.org/licenses/MIT", + "display_name": "TestProject", + "summary": "A short description of TestProject.", + "canonical_tags": [ + "Project" + ], + "user_tags": [ + "TestProject" + ], + "icon_path": "preview.png", + "engine": "o3de-install", + "restricted_name": "projects", + "external_subdirectories": [ + ] +} +''' + +TEST_GEM_JSON_PAYLOAD = ''' +{ + "gem_name": "TestGem", + "display_name": "TestGem", + "license": "Apache-2.0 Or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "type": "Code", + "summary": "A short description of TestGem.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "TestGem" + ], + "icon_path": "preview.png", + "requirements": "Any requirement goes here.", + "documentation_url": "The link to the documentation goes here.", + "dependencies": [ + ] +} +''' + +TEST_O3DE_MANIFEST_JSON_PAYLOAD = ''' +{ + "o3de_manifest_name": "testuser", + "origin": "C:/Users/testuser/.o3de", + "default_engines_folder": "C:/Users/testuser/.o3de/Engines", + "default_projects_folder": "C:/Users/testuser/.o3de/Projects", + "default_gems_folder": "C:/Users/testuser/.o3de/Gems", + "default_templates_folder": "C:/Users/testuser/.o3de/Templates", + "default_restricted_folder": "C:/Users/testuser/.o3de/Restricted", + "default_third_party_folder": "C:/Users/testuser/.o3de/3rdParty", + "projects": [ + "D:/MinimalProject" + ], + "external_subdirectories": [], + "templates": [], + "restricted": [], + "repos": [], + "engines": [ + "D:/o3de/o3de" + ], + "engines_path": { + "o3de": "D:/o3de/o3de" + } +} +''' + +@pytest.fixture(scope='class') +def init_disable_gem_data(request): + class DisableGemData: + def __init__(self): + self.project_data = json.loads(TEST_PROJECT_JSON_PAYLOAD) + self.gem_data = json.loads(TEST_GEM_JSON_PAYLOAD) + request.cls.disable_gem = DisableGemData() + + +@pytest.mark.usefixtures('init_disable_gem_data') +class TestDisableGemCommand: + @pytest.mark.parametrize("gem_path, project_path, gem_registered_with_project, gem_registered_with_engine," + "expected_result", [ + pytest.param(pathlib.PurePath('TestProject/TestGem'), pathlib.PurePath('TestProject'), False, True, 0), + pytest.param(pathlib.PurePath('TestProject/TestGem'), pathlib.PurePath('TestProject'), False, False, 0), + pytest.param(pathlib.PurePath('TestProject/TestGem'), pathlib.PurePath('TestProject'), True, False, 0), + pytest.param(pathlib.PurePath('TestGem'), pathlib.PurePath('TestProject'), False, False, 0), + ] + ) + def test_disable_gem_registers_gem_name_with_project_json(self, gem_path, project_path, gem_registered_with_project, + gem_registered_with_engine, expected_result): + + project_gem_dependencies = [] + + def get_registered_path(project_name: str = None, gem_name: str = None) -> pathlib.Path or None: + if project_name: + return project_path + elif gem_name: + return gem_path + return None + + def save_o3de_manifest(new_project_data: dict, manifest_path: pathlib.Path = None) -> bool: + if manifest_path == project_path / 'project.json': + self.disable_gem.project_data = new_project_data + return True + + def load_o3de_manifest(manifest_path: pathlib.Path = None) -> dict or None: + if not manifest_path: + return json.loads(TEST_O3DE_MANIFEST_JSON_PAYLOAD) + return None + + def get_project_json_data(project_name: str = None, project_path: pathlib.Path = None): + return self.disable_gem.project_data + + def get_gem_json_data(gem_path: pathlib.Path, project_path: pathlib.Path): + return self.disable_gem.gem_data + + def get_project_gems(project_path: pathlib.Path): + return [pathlib.Path(gem_path).resolve()] if gem_registered_with_project else [] + + def get_engine_gems(): + return [pathlib.Path(gem_path).resolve()] if gem_registered_with_engine else [] + + def add_gem_dependency(enable_gem_cmake_file: pathlib.Path, gem_name: str): + project_gem_dependencies.append(gem_name) + return 0 + + def remove_gem_dependency(enable_gem_cmake_file: pathlib.Path, gem_name: str): + project_gem_dependencies.remove(gem_name) + return 0 + + def get_enabled_gems(enable_gem_cmake_file: pathlib.Path) -> list: + return project_gem_dependencies + + + with patch('pathlib.Path.is_dir', return_value=True) as pathlib_is_dir_patch,\ + patch('pathlib.Path.is_file', return_value=True) as pathlib_is_file_patch, \ + patch('o3de.manifest.load_o3de_manifest', side_effect=load_o3de_manifest) as load_o3de_manifest_patch, \ + patch('o3de.manifest.save_o3de_manifest', side_effect=save_o3de_manifest) as save_o3de_manifest_patch,\ + patch('o3de.manifest.get_registered', side_effect=get_registered_path) as get_registered_patch,\ + patch('o3de.manifest.get_gem_json_data', side_effect=get_gem_json_data) as get_gem_json_data_patch,\ + patch('o3de.manifest.get_project_json_data', side_effect=get_project_json_data) as get_gem_json_data_patch,\ + patch('o3de.manifest.get_project_gems', side_effect=get_project_gems) as get_project_gems_patch,\ + patch('o3de.manifest.get_engine_gems', side_effect=get_engine_gems) as get_engine_gems_patch,\ + patch('o3de.cmake.add_gem_dependency', side_effect=add_gem_dependency) as add_gem_dependency_patch, \ + patch('o3de.cmake.remove_gem_dependency', + side_effect=remove_gem_dependency) as remove_gem_dependency_patch, \ + patch('o3de.cmake.get_enabled_gems', + side_effect=get_enabled_gems) as get_enabled_gems, \ + patch('o3de.validation.valid_o3de_gem_json', return_value=True) as valid_gem_json_patch: + + # Clear out any "gem_names" from the previous iterations + self.disable_gem.project_data.pop('gem_names', None) + + # First enable the gem + assert enable_gem.enable_gem_in_project(gem_path=gem_path, project_path=project_path) == 0 + + # Check that the gem is enabled + gem_json = get_gem_json_data(gem_path, project_path) + project_json = get_project_json_data(project_path=project_path) + enabled_gems_list = cmake.get_enabled_gems(project_path / "Gem/enabled_gems.cmake") + assert gem_json.get('gem_name', '') in enabled_gems_list + + # If the gem that is neither registered in the project.json nor engine.json, + # then it must appear in the "gem_names" field. + if not gem_registered_with_engine and not gem_registered_with_project: + assert gem_json.get('gem_name', '') in project_json.get('gem_names', []) + else: + assert gem_json.get('gem_name', '') not in project_json.get('gem_names', []) + + # Now disable the gem + result = disable_gem.disable_gem_in_project(gem_path=gem_path, project_path=project_path) + assert result == expected_result + + # Refresh the enabled_gems list and check for removal of the gem + gem_json = get_gem_json_data(gem_path, project_path) + project_json = get_project_json_data(project_path=project_path) + enabled_gems_list = cmake.get_enabled_gems(project_path / "Gem/enabled_gems.cmake") + assert gem_json.get('gem_name', '') not in enabled_gems_list + + # If gem name should no longer appear in the "gem_names" field + assert gem_json.get('gem_name', '') not in project_json.get('gem_names', []) diff --git a/scripts/o3de/tests/unit_test_enable_gem.py b/scripts/o3de/tests/test_enable_gem.py similarity index 82% rename from scripts/o3de/tests/unit_test_enable_gem.py rename to scripts/o3de/tests/test_enable_gem.py index 8067fc329d..9e9fe0a713 100644 --- a/scripts/o3de/tests/unit_test_enable_gem.py +++ b/scripts/o3de/tests/test_enable_gem.py @@ -104,10 +104,11 @@ class TestEnableGemCommand: pytest.param(pathlib.PurePath('TestProject/TestGem'), pathlib.PurePath('TestProject'), False, True, 0), pytest.param(pathlib.PurePath('TestProject/TestGem'), pathlib.PurePath('TestProject'), False, False, 0), pytest.param(pathlib.PurePath('TestProject/TestGem'), pathlib.PurePath('TestProject'), True, False, 0), + pytest.param(pathlib.PurePath('TestGem'), pathlib.PurePath('TestProject'), False, False, 0), ] ) - def test_enable_gem_registers_gem_as_well(self, gem_path, project_path, gem_registered_with_project, gem_registered_with_engine, - expected_result): + def test_enable_gem_registers_gem_name_with_project_json(self, gem_path, project_path, gem_registered_with_project, + gem_registered_with_engine, expected_result): def get_registered_path(project_name: str = None, gem_name: str = None) -> pathlib.Path: if project_name: @@ -116,11 +117,8 @@ class TestEnableGemCommand: return gem_path return None - def get_registered_gem_path(gem_name: str) -> pathlib.Path: - return gem_path - def save_o3de_manifest(new_project_data: dict, manifest_path: pathlib.Path = None) -> bool: - if manifest_path == project_path: + if manifest_path == project_path / 'project.json': self.enable_gem.project_data = new_project_data return True @@ -129,17 +127,17 @@ class TestEnableGemCommand: return json.loads(TEST_O3DE_MANIFEST_JSON_PAYLOAD) return None - def get_project_json_data(project_path: pathlib.Path): + def get_project_json_data(project_name: str = None, project_path: pathlib.Path = None): return self.enable_gem.project_data def get_gem_json_data(gem_path: pathlib.Path, project_path: pathlib.Path): return self.enable_gem.gem_data def get_project_gems(project_path: pathlib.Path): - return [gem_path] if gem_registered_with_project else [] + return [pathlib.Path(gem_path).resolve()] if gem_registered_with_project else [] def get_engine_gems(): - return [gem_path] if gem_registered_with_engine else [] + return [pathlib.Path(gem_path).resolve()] if gem_registered_with_engine else [] def add_gem_dependency(enable_gem_cmake_file: pathlib.Path, gem_name: str): return 0 @@ -155,11 +153,14 @@ class TestEnableGemCommand: patch('o3de.manifest.get_engine_gems', side_effect=get_engine_gems) as get_engine_gems_patch,\ patch('o3de.cmake.add_gem_dependency', side_effect=add_gem_dependency) as add_gem_dependency_patch,\ patch('o3de.validation.valid_o3de_gem_json', return_value=True) as valid_gem_json_patch: + + self.enable_gem.project_data.pop('gem_names', None) result = enable_gem.enable_gem_in_project(gem_path=gem_path, project_path=project_path) assert result == expected_result - # If the gem isn't registered with the engine or project already it should now be registered with the project - if not gem_registered_with_engine and gem_registered_with_project: - # Prepend the project path to each external subdirectory - project_relative_subdirs = map(lambda subdir: (pathlib.Path(project_path) / subdir).as_posix(), - self.enable_gem.project_data.get('external_subdirectories', [])) - assert gem_path.as_posix() in project_relative_subdirs + + gem_json = get_gem_json_data(gem_path, project_path) + project_json = get_project_json_data(project_path=project_path) + if not gem_registered_with_engine and not gem_registered_with_project: + assert gem_json.get('gem_name', '') in project_json.get('gem_names', []) + else: + assert gem_json.get('gem_name', '') not in project_json.get('gem_names', []) diff --git a/scripts/o3de/tests/unit_test_engine_properties.py b/scripts/o3de/tests/test_engine_properties.py similarity index 100% rename from scripts/o3de/tests/unit_test_engine_properties.py rename to scripts/o3de/tests/test_engine_properties.py diff --git a/scripts/o3de/tests/unit_test_engine_template.py b/scripts/o3de/tests/test_engine_template.py similarity index 100% rename from scripts/o3de/tests/unit_test_engine_template.py rename to scripts/o3de/tests/test_engine_template.py diff --git a/scripts/o3de/tests/unit_test_gem_properties.py b/scripts/o3de/tests/test_gem_properties.py similarity index 100% rename from scripts/o3de/tests/unit_test_gem_properties.py rename to scripts/o3de/tests/test_gem_properties.py diff --git a/scripts/o3de/tests/unit_test_global_project.py b/scripts/o3de/tests/test_global_project.py similarity index 100% rename from scripts/o3de/tests/unit_test_global_project.py rename to scripts/o3de/tests/test_global_project.py diff --git a/scripts/o3de/tests/unit_test_manifest.py b/scripts/o3de/tests/test_manifest.py similarity index 100% rename from scripts/o3de/tests/unit_test_manifest.py rename to scripts/o3de/tests/test_manifest.py diff --git a/scripts/o3de/tests/unit_test_print_registration.py b/scripts/o3de/tests/test_print_registration.py similarity index 100% rename from scripts/o3de/tests/unit_test_print_registration.py rename to scripts/o3de/tests/test_print_registration.py diff --git a/scripts/o3de/tests/unit_test_project_properties.py b/scripts/o3de/tests/test_project_properties.py similarity index 100% rename from scripts/o3de/tests/unit_test_project_properties.py rename to scripts/o3de/tests/test_project_properties.py diff --git a/scripts/o3de/tests/unit_test_register.py b/scripts/o3de/tests/test_register.py similarity index 100% rename from scripts/o3de/tests/unit_test_register.py rename to scripts/o3de/tests/test_register.py diff --git a/scripts/o3de/tests/unit_test_utils.py b/scripts/o3de/tests/test_utils.py similarity index 100% rename from scripts/o3de/tests/unit_test_utils.py rename to scripts/o3de/tests/test_utils.py From aa025a5e7d1d4e1a7837dd8157006cd3e0d3622b Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 10:48:08 -0600 Subject: [PATCH 279/394] Updated unit tests per PR feedback Signed-off-by: Chris Galvan --- Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp index f90702d948..28e5dbd9fe 100644 --- a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp @@ -745,7 +745,7 @@ namespace UnitTest auto pixelDataValue = imageAsset->GetSubImagePixelValue(x, y); auto pixelExpectedValue = static_cast(y * size.m_width + x) / static_cast(std::numeric_limits::max()); - EXPECT_TRUE(AZ::IsClose(pixelDataValue, pixelExpectedValue)); + EXPECT_NEAR(pixelDataValue, pixelExpectedValue, Constants::Tolerance); } } @@ -753,14 +753,13 @@ namespace UnitTest AZStd::vector pixelValues(size.m_width * size.m_height); auto topLeft = AZStd::make_pair(0, 0); auto bottomRight = AZStd::make_pair(size.m_width - 1, size.m_height - 1); - AZStd::span valueSpan(pixelValues.begin(), pixelValues.size()); - streamingImageAsset->GetSubImagePixelValues(topLeft, bottomRight, valueSpan); + streamingImageAsset->GetSubImagePixelValues(topLeft, bottomRight, pixelValues); for (uint32_t index = 0; index < pixelValues.size(); ++index) { - auto pixelDataValue = valueSpan[index]; + auto pixelDataValue = pixelValues[index]; auto pixelExpectedValue = static_cast(index) / static_cast(std::numeric_limits::max()); - EXPECT_TRUE(AZ::IsClose(pixelDataValue, pixelExpectedValue)); + EXPECT_NEAR(pixelDataValue, pixelExpectedValue, Constants::Tolerance); } } } From 921c1e2201a0a8da87735d13b3c447055d5e86b4 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 11:15:37 -0600 Subject: [PATCH 280/394] Modified GetSubImagePixelValues API to be exclusive with bottom right coordinate, and documented as such Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 3 +++ .../RPI.Reflect/Image/StreamingImageAsset.cpp | 17 +++++++++-------- .../Code/Tests/Image/StreamingImageTests.cpp | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 93d0392e38..2e01f99cd9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -91,12 +91,15 @@ namespace AZ T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (float) for specified mip and slice + //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (uint) for specified mip and slice + //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (int) for specified mip and slice + //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index a3cfc581b6..286b259696 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -315,9 +315,10 @@ namespace AZ { AZStd::array values = { aznumeric_cast(0) }; - auto position = AZStd::make_pair(x, y); + auto topLeft = AZStd::make_pair(x, y); + auto bottomRight = AZStd::make_pair(x + 1, y + 1); AZStd::span valueSpan(values.begin(), values.size()); - GetSubImagePixelValues(position, position, valueSpan, componentIndex, mip, slice); + GetSubImagePixelValues(topLeft, bottomRight, valueSpan, componentIndex, mip, slice); return values[0]; } @@ -354,9 +355,9 @@ namespace AZ const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) { - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { size_t imageDataIndex = (y * width + x) * pixelSize; @@ -381,9 +382,9 @@ namespace AZ const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) { - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { size_t imageDataIndex = (y * width + x) * pixelSize; @@ -408,9 +409,9 @@ namespace AZ const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) { - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { size_t imageDataIndex = (y * width + x) * pixelSize; diff --git a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp index 28e5dbd9fe..5efab95818 100644 --- a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp @@ -752,7 +752,7 @@ namespace UnitTest // Validate retrieving a region of pixels AZStd::vector pixelValues(size.m_width * size.m_height); auto topLeft = AZStd::make_pair(0, 0); - auto bottomRight = AZStd::make_pair(size.m_width - 1, size.m_height - 1); + auto bottomRight = AZStd::make_pair(size.m_width, size.m_height); streamingImageAsset->GetSubImagePixelValues(topLeft, bottomRight, pixelValues); for (uint32_t index = 0; index < pixelValues.size(); ++index) { From 8151856e83c7337121e2f7d159f721cb2219b3b8 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 13:01:30 -0600 Subject: [PATCH 281/394] Removed legacy Editor config spec Signed-off-by: Chris Galvan --- .../ReflectedPropertyItem.cpp | 18 +--- .../ReflectedVarWrapper.cpp | 36 -------- .../ReflectedVarWrapper.h | 17 ---- Code/Editor/CryEdit.cpp | 1 - Code/Editor/CryEditPy.cpp | 29 ------ Code/Editor/EditorPreferencesPageGeneral.cpp | 4 - Code/Editor/EditorPreferencesPageGeneral.h | 1 - Code/Editor/IEditor.h | 6 -- Code/Editor/IEditorImpl.cpp | 46 ---------- Code/Editor/IEditorImpl.h | 6 -- Code/Editor/Lib/Tests/IEditorMock.h | 4 - Code/Editor/Objects/BaseObject.cpp | 53 +---------- Code/Editor/Objects/BaseObject.h | 9 -- Code/Editor/Objects/EntityObject.cpp | 41 +-------- Code/Editor/Objects/EntityObject.h | 3 - Code/Editor/Settings.cpp | 44 --------- Code/Editor/Settings.h | 5 - Code/Editor/UIEnumsDatabase.cpp | 91 ------------------- Code/Editor/UIEnumsDatabase.h | 47 ---------- Code/Editor/UndoConfigSpec.cpp | 45 --------- Code/Editor/UndoConfigSpec.h | 37 -------- Code/Editor/Util/Variable.cpp | 47 ---------- Code/Editor/Util/Variable.h | 28 +----- Code/Editor/Util/VariablePropertyType.cpp | 8 -- Code/Editor/Util/VariablePropertyType.h | 1 - Code/Editor/editor_core_files.cmake | 2 - Code/Editor/editor_lib_files.cmake | 2 - Code/Legacy/CryCommon/ISystem.h | 13 --- 28 files changed, 6 insertions(+), 638 deletions(-) delete mode 100644 Code/Editor/UIEnumsDatabase.cpp delete mode 100644 Code/Editor/UIEnumsDatabase.h delete mode 100644 Code/Editor/UndoConfigSpec.cpp delete mode 100644 Code/Editor/UndoConfigSpec.h diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp index af418c6e0d..0fcbac3204 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyItem.cpp @@ -229,28 +229,16 @@ void ReflectedPropertyItem::SetVariable(IVariable *var) break; case ePropertyFloat: case ePropertyAngle: - //if the Description has a valid global enumDB lookup, edit as an enum, otherwise use normal float editor - if (desc.m_pEnumDBItem) - m_reflectedVarAdapter = new ReflectedVarDBEnumAdapter; - else - m_reflectedVarAdapter = new ReflectedVarFloatAdapter; + m_reflectedVarAdapter = new ReflectedVarFloatAdapter; break; case ePropertyInt: - //if the Description has a valid global enumDB lookup, edit as an enum, otherwise use normal int editor - if (desc.m_pEnumDBItem) - m_reflectedVarAdapter = new ReflectedVarDBEnumAdapter; - else - m_reflectedVarAdapter = new ReflectedVarIntAdapter; + m_reflectedVarAdapter = new ReflectedVarIntAdapter; break; case ePropertyBool: m_reflectedVarAdapter = new ReflectedVarBoolAdapter; break; case ePropertyString: - //if the Description has a valid global enumDB lookup, edit as an enum, otherwise use normal string editor - if (desc.m_pEnumDBItem) - m_reflectedVarAdapter = new ReflectedVarDBEnumAdapter; - else - m_reflectedVarAdapter = new ReflectedVarStringAdapter; + m_reflectedVarAdapter = new ReflectedVarStringAdapter; break; case ePropertySelection: m_reflectedVarAdapter = new ReflectedVarEnumAdapter; diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp index 2320938f08..8eefbbc8eb 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp @@ -15,7 +15,6 @@ // Editor #include "ReflectedPropertyCtrl.h" -#include "UIEnumsDatabase.h" namespace { @@ -254,41 +253,6 @@ void ReflectedVarEnumAdapter::OnVariableChange([[maybe_unused]] IVariable* pVari } } -void ReflectedVarDBEnumAdapter::SetVariable(IVariable *pVariable) -{ - Prop::Description desc(pVariable); - m_pEnumDBItem = desc.m_pEnumDBItem; - m_reflectedVar.reset(new CReflectedVarEnum(pVariable->GetHumanName().toUtf8().data())); - if (m_pEnumDBItem) - { - for (int i = 0; i < m_pEnumDBItem->strings.size(); i++) - { - QString name = m_pEnumDBItem->strings[i]; - m_reflectedVar->addEnum( m_pEnumDBItem->NameToValue(name).toUtf8().data(), name.toUtf8().data() ); - } - } -} - -void ReflectedVarDBEnumAdapter::SyncReflectedVarToIVar(IVariable *pVariable) -{ - const AZStd::string valueStr = pVariable->GetDisplayValue().toUtf8().data(); - const AZStd::string value = m_pEnumDBItem ? AZStd::string(m_pEnumDBItem->ValueToName(valueStr.c_str()).toUtf8().data()) : valueStr; - m_reflectedVar->setEnumByName(value); - -} - -void ReflectedVarDBEnumAdapter::SyncIVarToReflectedVar(IVariable *pVariable) -{ - QString iVarVal = m_reflectedVar->m_selectedEnumName.c_str(); - if (m_pEnumDBItem) - { - iVarVal = m_pEnumDBItem->NameToValue(iVarVal); - } - pVariable->SetDisplayValue(iVarVal); -} - - - void ReflectedVarVector2Adapter::SetVariable(IVariable *pVariable) { m_reflectedVar.reset(new CReflectedVarVector2(pVariable->GetHumanName().toUtf8().data())); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h index 4bcd6dcaa3..807413226c 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVarWrapper.h @@ -16,7 +16,6 @@ #include -struct CUIEnumsDatabase_SEnum; class ReflectedPropertyItem; // Class to wrap the CReflectedVars and sync them with corresponding IVariable. @@ -145,22 +144,6 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING bool m_updatingEnums; }; -class EDITOR_CORE_API ReflectedVarDBEnumAdapter - : public ReflectedVarAdapter -{ -public: - void SetVariable(IVariable* pVariable) override; - void SyncReflectedVarToIVar(IVariable* pVariable) override; - void SyncIVarToReflectedVar(IVariable* pVariable) override; - CReflectedVar* GetReflectedVar() override { return m_reflectedVar.data(); } -private: -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - QScopedPointer > m_reflectedVar; -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - CUIEnumsDatabase_SEnum* m_pEnumDBItem; -}; - class EDITOR_CORE_API ReflectedVarVector2Adapter : public ReflectedVarAdapter { diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index b9081c3f90..982f8ba411 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -1709,7 +1709,6 @@ bool CCryEditApp::InitInstance() mainWindow->Initialize(); GetIEditor()->GetCommandManager()->RegisterAutoCommands(); - GetIEditor()->AddUIEnums(); mainWindowWrapper->enableSaveRestoreGeometry("O3DE", "O3DE", "mainWindowGeometry"); m_pDocManager->OnFileNew(); diff --git a/Code/Editor/CryEditPy.cpp b/Code/Editor/CryEditPy.cpp index a25a497a4e..5dea57c1ed 100644 --- a/Code/Editor/CryEditPy.cpp +++ b/Code/Editor/CryEditPy.cpp @@ -26,7 +26,6 @@ #include "Core/QtEditorApplication.h" #include "CheckOutDialog.h" #include "GameEngine.h" -#include "UndoConfigSpec.h" #include "ViewManager.h" #include "EditorViewportCamera.h" @@ -369,21 +368,6 @@ namespace inline namespace Commands { - void PySetConfigSpec(int spec, int platform) - { - CUndo undo("Set Config Spec"); - if (CUndo::IsRecording()) - { - CUndo::Record(new CUndoConficSpec()); - } - GetIEditor()->SetEditorConfigSpec((ESystemConfigSpec)spec, (ESystemConfigPlatform)platform); - } - - int PyGetConfigSpec() - { - return static_cast(GetIEditor()->GetEditorConfigSpec()); - } - int PyGetConfigPlatform() { return static_cast(GetIEditor()->GetEditorConfigPlatform()); @@ -434,9 +418,7 @@ namespace AzToolsFramework addLegacyGeneral(behaviorContext->Method("set_current_view_rotation", PySetCurrentViewRotation, nullptr, "Sets the rotation of the current view as given x, y, z Euler angles in degrees.")); addLegacyGeneral(behaviorContext->Method("export_to_engine", CCryEditApp::Command_ExportToEngine, nullptr, "Exports the current level to the engine.")); - addLegacyGeneral(behaviorContext->Method("set_config_spec", PySetConfigSpec, nullptr, "Sets the system config spec and platform.")); addLegacyGeneral(behaviorContext->Method("get_config_platform", PyGetConfigPlatform, nullptr, "Gets the system config platform.")); - addLegacyGeneral(behaviorContext->Method("get_config_spec", PyGetConfigSpec, nullptr, "Gets the system config spec.")); addLegacyGeneral(behaviorContext->Method("set_result_to_success", PySetResultToSuccess, nullptr, "Sets the result of a script execution to success. Used only for Sandbox AutoTests.")); addLegacyGeneral(behaviorContext->Method("set_result_to_failure", PySetResultToFailure, nullptr, "Sets the result of a script execution to failure. Used only for Sandbox AutoTests.")); @@ -464,17 +446,6 @@ namespace AzToolsFramework }; addCheckoutDialog(behaviorContext->Method("enable_for_all", PyCheckOutDialogEnableForAll, nullptr, "Enables the 'Apply to all' button in the checkout dialog; useful for allowing the user to apply a decision to check out files to multiple, related operations.")); - behaviorContext->EnumProperty("SystemConfigSpec_Auto") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - behaviorContext->EnumProperty("SystemConfigSpec_Low") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - behaviorContext->EnumProperty("SystemConfigSpec_Medium") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - behaviorContext->EnumProperty("SystemConfigSpec_High") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - behaviorContext->EnumProperty("SystemConfigSpec_VeryHigh") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - behaviorContext->EnumProperty("SystemConfigPlatform_InvalidPlatform") ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); behaviorContext->EnumProperty("SystemConfigPlatform_Pc") diff --git a/Code/Editor/EditorPreferencesPageGeneral.cpp b/Code/Editor/EditorPreferencesPageGeneral.cpp index 95b3bc4c50..642b9c37e7 100644 --- a/Code/Editor/EditorPreferencesPageGeneral.cpp +++ b/Code/Editor/EditorPreferencesPageGeneral.cpp @@ -30,7 +30,6 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize) serialize.Class() ->Version(3) ->Field("PreviewPanel", &GeneralSettings::m_previewPanel) - ->Field("ApplyConfigSpec", &GeneralSettings::m_applyConfigSpec) ->Field("EnableSourceControl", &GeneralSettings::m_enableSourceControl) ->Field("ClearConsole", &GeneralSettings::m_clearConsoleOnGameModeStart) ->Field("ConsoleBackgroundColorTheme", &GeneralSettings::m_consoleBackgroundColorTheme) @@ -81,7 +80,6 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize) { editContext->Class("General Settings", "General Editor Preferences") ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_previewPanel, "Show Geometry Preview Panel", "Show Geometry Preview Panel") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_applyConfigSpec, "Hide objects by config spec", "Hide objects by config spec") ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSourceControl, "Enable Source Control", "Enable Source Control") ->DataElement( AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_clearConsoleOnGameModeStart, "Clear Console at game startup", "Clear Console when game mode starts") @@ -157,7 +155,6 @@ void CEditorPreferencesPage_General::OnApply() { //general settings gSettings.bPreviewGeometryWindow = m_generalSettings.m_previewPanel; - gSettings.bApplyConfigSpecInEditor = m_generalSettings.m_applyConfigSpec; gSettings.enableSourceControl = m_generalSettings.m_enableSourceControl; gSettings.clearConsoleOnGameModeStart = m_generalSettings.m_clearConsoleOnGameModeStart; gSettings.consoleBackgroundColorTheme = m_generalSettings.m_consoleBackgroundColorTheme; @@ -195,7 +192,6 @@ void CEditorPreferencesPage_General::InitializeSettings() { //general settings m_generalSettings.m_previewPanel = gSettings.bPreviewGeometryWindow; - m_generalSettings.m_applyConfigSpec = gSettings.bApplyConfigSpecInEditor; m_generalSettings.m_enableSourceControl = gSettings.enableSourceControl; m_generalSettings.m_clearConsoleOnGameModeStart = gSettings.clearConsoleOnGameModeStart; m_generalSettings.m_consoleBackgroundColorTheme = gSettings.consoleBackgroundColorTheme; diff --git a/Code/Editor/EditorPreferencesPageGeneral.h b/Code/Editor/EditorPreferencesPageGeneral.h index 01700dea88..ff2ebf79f8 100644 --- a/Code/Editor/EditorPreferencesPageGeneral.h +++ b/Code/Editor/EditorPreferencesPageGeneral.h @@ -45,7 +45,6 @@ private: AZ_TYPE_INFO(GeneralSettings, "{C2AE8F6D-7AA6-499E-A3E8-ECCD0AC6F3D2}") bool m_previewPanel; - bool m_applyConfigSpec; bool m_enableSourceControl; bool m_clearConsoleOnGameModeStart; AzToolsFramework::ConsoleColorTheme m_consoleBackgroundColorTheme; diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index 52f8c1ac6f..da29b00f2d 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -46,7 +46,6 @@ class ICommandManager; class CEditorCommandManager; class CHyperGraphManager; class CConsoleSynchronization; -class CUIEnumsDatabase; struct ISourceControl; struct IEditorClassFactory; struct ITransformManipulator; @@ -660,15 +659,10 @@ struct IEditor //! Only returns true if source control is both available AND currently connected and functioning virtual bool IsSourceControlConnected() = 0; - virtual CUIEnumsDatabase* GetUIEnumsDatabase() = 0; - virtual void AddUIEnums() = 0; virtual void ReduceMemory() = 0; //! Export manager for exporting objects and a terrain from the game to DCC tools virtual IExportManager* GetExportManager() = 0; - //! Set current configuration spec of the editor. - virtual void SetEditorConfigSpec(ESystemConfigSpec spec, ESystemConfigPlatform platform) = 0; - virtual ESystemConfigSpec GetEditorConfigSpec() const = 0; virtual ESystemConfigPlatform GetEditorConfigPlatform() const = 0; virtual void ReloadTemplates() = 0; virtual void ShowStatusText(bool bEnable) = 0; diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index d3f881a252..05b74f3b05 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -51,7 +51,6 @@ #include "GameEngine.h" #include "ToolBox.h" #include "MainWindow.h" -#include "UIEnumsDatabase.h" #include "RenderHelpers/AxisHelper.h" #include "Settings.h" #include "Include/IObjectManager.h" @@ -116,7 +115,6 @@ CEditorImpl::CEditorImpl() , m_pErrorsDlg(nullptr) , m_pSourceControl(nullptr) , m_pSelectionTreeManager(nullptr) - , m_pUIEnumsDatabase(nullptr) , m_pConsoleSync(nullptr) , m_pSettingsManager(nullptr) , m_pLevelIndependentFileMan(nullptr) @@ -146,7 +144,6 @@ CEditorImpl::CEditorImpl() regCtx.pCommandManager = m_pCommandManager; regCtx.pClassFactory = m_pClassFactory; m_pEditorFileMonitor.reset(new CEditorFileMonitor()); - m_pUIEnumsDatabase = new CUIEnumsDatabase; m_pDisplaySettings = new CDisplaySettings; m_pDisplaySettings->LoadRegistry(); m_pPluginManager = new CPluginManager; @@ -298,7 +295,6 @@ CEditorImpl::~CEditorImpl() SAFE_DELETE(m_pCommandManager) SAFE_DELETE(m_pClassFactory) SAFE_DELETE(m_pLasLoadedLevelErrorReport) - SAFE_DELETE(m_pUIEnumsDatabase) SAFE_DELETE(m_pSettingsManager); @@ -1473,48 +1469,6 @@ IExportManager* CEditorImpl::GetExportManager() return m_pExportManager; } -void CEditorImpl::AddUIEnums() -{ - // Spec settings for shadow casting lights - AZStd::string SpecString[4]; - QStringList types; - types.push_back("Never=0"); - SpecString[0] = AZStd::string::format("VeryHigh Spec=%d", CONFIG_VERYHIGH_SPEC); - types.push_back(SpecString[0].c_str()); - SpecString[1] = AZStd::string::format("High Spec=%d", CONFIG_HIGH_SPEC); - types.push_back(SpecString[1].c_str()); - SpecString[2] = AZStd::string::format("Medium Spec=%d", CONFIG_MEDIUM_SPEC); - types.push_back(SpecString[2].c_str()); - SpecString[3] = AZStd::string::format("Low Spec=%d", CONFIG_LOW_SPEC); - types.push_back(SpecString[3].c_str()); - m_pUIEnumsDatabase->SetEnumStrings("CastShadows", types); - - // Power-of-two percentages - AZStd::string percentStringPOT[5]; - types.clear(); - percentStringPOT[0] = AZStd::string::format("Default=%d", 0); - types.push_back(percentStringPOT[0].c_str()); - percentStringPOT[1] = AZStd::string::format("12.5=%d", 1); - types.push_back(percentStringPOT[1].c_str()); - percentStringPOT[2] = AZStd::string::format("25=%d", 2); - types.push_back(percentStringPOT[2].c_str()); - percentStringPOT[3] = AZStd::string::format("50=%d", 3); - types.push_back(percentStringPOT[3].c_str()); - percentStringPOT[4] = AZStd::string::format("100=%d", 4); - types.push_back(percentStringPOT[4].c_str()); - m_pUIEnumsDatabase->SetEnumStrings("ShadowMinResPercent", types); -} - -void CEditorImpl::SetEditorConfigSpec(ESystemConfigSpec spec, [[maybe_unused]]ESystemConfigPlatform platform) -{ - gSettings.editorConfigSpec = spec; -} - -ESystemConfigSpec CEditorImpl::GetEditorConfigSpec() const -{ - return (ESystemConfigSpec)gSettings.editorConfigSpec; -} - ESystemConfigPlatform CEditorImpl::GetEditorConfigPlatform() const { return m_pSystem->GetConfigPlatform(); diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 08629e434b..5e47a76802 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -268,14 +268,9 @@ public: bool IsSourceControlConnected() override; //! Setup Material Editor mode void SetMatEditMode(bool bIsMatEditMode); - CUIEnumsDatabase* GetUIEnumsDatabase() override { return m_pUIEnumsDatabase; }; - void AddUIEnums() override; void ReduceMemory() override; // Get Export manager IExportManager* GetExportManager() override; - // Set current configuration spec of the editor. - void SetEditorConfigSpec(ESystemConfigSpec spec, ESystemConfigPlatform platform) override; - ESystemConfigSpec GetEditorConfigSpec() const override; ESystemConfigPlatform GetEditorConfigPlatform() const override; void ReloadTemplates() override; void AddErrorMessage(const QString& text, const QString& caption); @@ -347,7 +342,6 @@ protected: CSelectionTreeManager* m_pSelectionTreeManager; - CUIEnumsDatabase* m_pUIEnumsDatabase; //! CConsole Synchronization CConsoleSynchronization* m_pConsoleSync; //! Editor Settings Manager diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index b2f7e2627f..99c05c7f4d 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -165,12 +165,8 @@ public: MOCK_METHOD0(GetSourceControl, ISourceControl* ()); MOCK_METHOD0(IsSourceControlAvailable, bool()); MOCK_METHOD0(IsSourceControlConnected, bool()); - MOCK_METHOD0(GetUIEnumsDatabase, CUIEnumsDatabase* ()); - MOCK_METHOD0(AddUIEnums, void()); MOCK_METHOD0(ReduceMemory, void()); MOCK_METHOD0(GetExportManager, IExportManager* ()); - MOCK_METHOD2(SetEditorConfigSpec, void(ESystemConfigSpec , ESystemConfigPlatform )); - MOCK_CONST_METHOD0(GetEditorConfigSpec, ESystemConfigSpec()); MOCK_CONST_METHOD0(GetEditorConfigPlatform, ESystemConfigPlatform()); MOCK_METHOD0(ReloadTemplates, void()); MOCK_METHOD1(ShowStatusText, void(bool )); diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp index c14547407b..1497f2440a 100644 --- a/Code/Editor/Objects/BaseObject.cpp +++ b/Code/Editor/Objects/BaseObject.cpp @@ -62,7 +62,7 @@ protected: ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -//! Undo object for CBaseObject that only stores its transform, color, area and minSpec +//! Undo object for CBaseObject that only stores its transform, color, area class CUndoBaseObjectMinimal : public IUndoObject { @@ -84,7 +84,6 @@ private: Vec3 scale; QColor color; float area; - int minSpec; }; void SetTransformsFromState(CBaseObject* pObject, const StateStruct& state, bool bUndo); @@ -253,7 +252,6 @@ CUndoBaseObjectMinimal::CUndoBaseObjectMinimal(CBaseObject* pObj, [[maybe_unused m_undoState.scale = pObj->GetScale(); m_undoState.color = pObj->GetColor(); m_undoState.area = pObj->GetArea(); - m_undoState.minSpec = pObj->GetMinSpec(); } ////////////////////////////////////////////////////////////////////////// @@ -284,14 +282,12 @@ void CUndoBaseObjectMinimal::Undo(bool bUndo) m_redoState.rotate = pObject->GetRotation(); m_redoState.color = pObject->GetColor(); m_redoState.area = pObject->GetArea(); - m_redoState.minSpec = pObject->GetMinSpec(); } SetTransformsFromState(pObject, m_undoState, bUndo); pObject->ChangeColor(m_undoState.color); pObject->SetArea(m_undoState.area); - pObject->SetMinSpec(m_undoState.minSpec, false); using namespace AzToolsFramework; ComponentEntityObjectRequestBus::Event(pObject, &ComponentEntityObjectRequestBus::Events::UpdatePreemptiveUndoCache); @@ -310,7 +306,6 @@ void CUndoBaseObjectMinimal::Redo() pObject->ChangeColor(m_redoState.color); pObject->SetArea(m_redoState.area); - pObject->SetMinSpec(m_redoState.minSpec, false); using namespace AzToolsFramework; ComponentEntityObjectRequestBus::Event(pObject, &ComponentEntityObjectRequestBus::Events::UpdatePreemptiveUndoCache); @@ -382,7 +377,6 @@ CBaseObject::CBaseObject() , m_bMatrixInWorldSpace(false) , m_bMatrixValid(false) , m_bWorldBoxValid(false) - , m_nMinSpec(0) , m_vDrawIconPos(0, 0, 0) , m_nIconFlags(0) { @@ -413,7 +407,6 @@ bool CBaseObject::Init([[maybe_unused]] IEditor* ie, CBaseObject* prev, [[maybe_ SetLocalTM(prev->GetPos(), prev->GetRotation(), prev->GetScale()); SetArea(prev->GetArea()); SetColor(prev->GetColor()); - SetMinSpec(prev->GetMinSpec(), false); // Copy all basic variables. EnableUpdateCallbacks(false); @@ -1053,17 +1046,6 @@ void CBaseObject::SetSelected(bool bSelect) } } -////////////////////////////////////////////////////////////////////////// -bool CBaseObject::IsHiddenBySpec() const -{ - if (!gSettings.bApplyConfigSpecInEditor) - { - return false; - } - - return (m_nMinSpec != 0 && gSettings.editorConfigSpec != 0 && m_nMinSpec > static_cast(gSettings.editorConfigSpec)); -} - ////////////////////////////////////////////////////////////////////////// //! Returns true if object hidden. bool CBaseObject::IsHidden() const @@ -1107,7 +1089,6 @@ void CBaseObject::Serialize(CObjectArchive& ar) Vec3 scale = m_scale; Quat quat = m_rotate; Ang3 angles(0, 0, 0); - uint32 nMinSpec = m_nMinSpec; QColor color = m_color; float flattenArea = m_flattenArea; @@ -1135,12 +1116,6 @@ void CBaseObject::Serialize(CObjectArchive& ar) xmlNode->getAttr("Parent", parentId); xmlNode->getAttr("LookAt", lookatId); xmlNode->getAttr("Material", mtlName); - xmlNode->getAttr("MinSpec", nMinSpec); - - if (nMinSpec <= CONFIG_VERYHIGH_SPEC) // Ignore invalid values. - { - m_nMinSpec = nMinSpec; - } bool bHidden = flags & OBJFLAG_HIDDEN; bool bFrozen = flags & OBJFLAG_FROZEN; @@ -1245,11 +1220,6 @@ void CBaseObject::Serialize(CObjectArchive& ar) { xmlNode->setAttr("Flags", flags); } - - if (m_nMinSpec != 0) - { - xmlNode->setAttr("MinSpec", (uint32)m_nMinSpec); - } } // Serialize variables after default entity parameters. @@ -1300,11 +1270,6 @@ XmlNodeRef CBaseObject::Export([[maybe_unused]] const QString& levelPath, XmlNod objNode->setAttr("Scale", scale); } - if (m_nMinSpec != 0) - { - objNode->setAttr("MinSpec", (uint32)m_nMinSpec); - } - // Save variables. CVarObject::Serialize(objNode, false); @@ -2134,22 +2099,6 @@ bool CBaseObject::IsSimilarObject(CBaseObject* pObject) return false; } -////////////////////////////////////////////////////////////////////////// -void CBaseObject::SetMinSpec(uint32 nSpec, bool bSetChildren) -{ - m_nMinSpec = nSpec; - UpdateVisibility(!IsHidden()); - - // Set min spec for all childs. - if (bSetChildren) - { - for (int i = static_cast(m_childs.size()) - 1; i >= 0; --i) - { - m_childs[i]->SetMinSpec(nSpec, true); - } - } -} - ////////////////////////////////////////////////////////////////////////// EScaleWarningLevel CBaseObject::GetScaleWarningLevel() const { diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h index 666d9f3e1d..aa748bade4 100644 --- a/Code/Editor/Objects/BaseObject.h +++ b/Code/Editor/Objects/BaseObject.h @@ -256,8 +256,6 @@ public: //! Returns true if object hidden. bool IsHidden() const; - //! Check against min spec. - bool IsHiddenBySpec() const; //! Returns true if object frozen. virtual bool IsFrozen() const; //! Returns true if object is shared between missions. @@ -465,12 +463,6 @@ public: //! Check if specified object is very similar to this one. virtual bool IsSimilarObject(CBaseObject* pObject); - ////////////////////////////////////////////////////////////////////////// - // Object minimal usage spec (All/Low/Medium/High) - ////////////////////////////////////////////////////////////////////////// - uint32 GetMinSpec() const { return m_nMinSpec; } - virtual void SetMinSpec(uint32 nSpec, bool bSetChildren = true); - //! In This function variables of the object must be initialized. virtual void InitVariables() {}; @@ -668,7 +660,6 @@ private: mutable uint32 m_bMatrixValid : 1; mutable uint32 m_bWorldBoxValid : 1; uint32 m_bInSelectionBox : 1; - uint32 m_nMinSpec : 8; Vec3 m_vDrawIconPos; AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/Objects/EntityObject.cpp b/Code/Editor/Objects/EntityObject.cpp index 86512377c6..450a15766c 100644 --- a/Code/Editor/Objects/EntityObject.cpp +++ b/Code/Editor/Objects/EntityObject.cpp @@ -200,7 +200,6 @@ CEntityObject::CEntityObject() // Init Variables. mv_castShadow = true; - mv_castShadowMinSpec = CONFIG_LOW_SPEC; mv_outdoor = false; mv_recvWind = false; mv_renderNearest = false; @@ -249,18 +248,10 @@ CEntityObject::~CEntityObject() ////////////////////////////////////////////////////////////////////////// void CEntityObject::InitVariables() { - mv_castShadowMinSpec.AddEnumItem("Never", END_CONFIG_SPEC_ENUM); - mv_castShadowMinSpec.AddEnumItem("Low", CONFIG_LOW_SPEC); - mv_castShadowMinSpec.AddEnumItem("Medium", CONFIG_MEDIUM_SPEC); - mv_castShadowMinSpec.AddEnumItem("High", CONFIG_HIGH_SPEC); - mv_castShadowMinSpec.AddEnumItem("VeryHigh", CONFIG_VERYHIGH_SPEC); - mv_castShadow.SetFlags(mv_castShadow.GetFlags() | IVariable::UI_INVISIBLE); - mv_castShadowMinSpec->SetFlags(mv_castShadowMinSpec->GetFlags() | IVariable::UI_UNSORTED); AddVariable(mv_outdoor, "OutdoorOnly", tr("Outdoor Only")); AddVariable(mv_castShadow, "CastShadow", tr("Cast Shadow")); - AddVariable(mv_castShadowMinSpec, "CastShadowMinspec", tr("Cast Shadow MinSpec")); AddVariable(mv_ratioLOD, "LodRatio"); AddVariable(mv_viewDistanceMultiplier, "ViewDistanceMultiplier"); @@ -361,7 +352,6 @@ bool CEntityObject::ConvertFromObject(CBaseObject* object) CEntityObject* pObject = ( CEntityObject* )object; mv_outdoor = pObject->mv_outdoor; - mv_castShadowMinSpec = pObject->mv_castShadowMinSpec; mv_ratioLOD = pObject->mv_ratioLOD; mv_viewDistanceMultiplier = pObject->mv_viewDistanceMultiplier; mv_hiddenInGame = pObject->mv_hiddenInGame; @@ -521,22 +511,6 @@ void CEntityObject::AdjustLightProperties(CVarBlockPtr& properties, const char* } } - if (IVariable* pCastShadowVar = FindVariableInSubBlock(properties, pSubBlockVar, "nCastShadows")) - { - if (bCastShadowLegacy) - { - pCastShadowVar->SetDisplayValue("1"); - } - pCastShadowVar->SetDataType(IVariable::DT_UIENUM); - pCastShadowVar->SetFlags(pCastShadowVar->GetFlags() | IVariable::UI_UNSORTED); - } - - if (IVariable* pShadowMinRes = FindVariableInSubBlock(properties, pSubBlockVar, "nShadowMinResPercent")) - { - pShadowMinRes->SetDataType(IVariable::DT_UIENUM); - pShadowMinRes->SetFlags(pShadowMinRes->GetFlags() | IVariable::UI_UNSORTED); - } - if (IVariable* pFade = FindVariableInSubBlock(properties, pSubBlockVar, "vFadeDimensionsLeft")) { pFade->SetFlags(pFade->GetFlags() | IVariable::UI_INVISIBLE); @@ -873,12 +847,6 @@ void CEntityObject::Serialize(CObjectArchive& ar) RemoveAllEntityLinks(); PostLoad(ar); } - - if ((mv_castShadowMinSpec == CONFIG_LOW_SPEC) && !mv_castShadow) // backwards compatibility check - { - mv_castShadowMinSpec = END_CONFIG_SPEC_ENUM; - mv_castShadow = true; - } } else { @@ -1033,8 +1001,6 @@ XmlNodeRef CEntityObject::Export([[maybe_unused]] const QString& levelPath, XmlN objNode->setAttr("ViewDistanceMultiplier", mv_viewDistanceMultiplier); } - objNode->setAttr("CastShadowMinSpec", mv_castShadowMinSpec); - if (mv_recvWind) { objNode->setAttr("RecvWind", true); @@ -1050,11 +1016,6 @@ XmlNodeRef CEntityObject::Export([[maybe_unused]] const QString& levelPath, XmlN objNode->setAttr("OutdoorOnly", true); } - if (GetMinSpec() != 0) - { - objNode->setAttr("MinSpec", ( uint32 )GetMinSpec()); - } - if (mv_hiddenInGame) { objNode->setAttr("HiddenInGame", true); @@ -1163,7 +1124,7 @@ void CEntityObject::UpdateVisibility(bool bVisible) { CBaseObject::UpdateVisibility(bVisible); - bool bVisibleWithSpec = bVisible && !IsHiddenBySpec(); + bool bVisibleWithSpec = bVisible; if (bVisibleWithSpec != static_cast(m_bVisible)) { m_bVisible = bVisibleWithSpec; diff --git a/Code/Editor/Objects/EntityObject.h b/Code/Editor/Objects/EntityObject.h index c6b7e4ce2d..2e8aeeabc7 100644 --- a/Code/Editor/Objects/EntityObject.h +++ b/Code/Editor/Objects/EntityObject.h @@ -174,8 +174,6 @@ public: ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// - int GetCastShadowMinSpec() const { return mv_castShadowMinSpec; } - float GetRatioLod() const { return static_cast(mv_ratioLOD); }; float GetViewDistanceMultiplier() const { return mv_viewDistanceMultiplier; } @@ -306,7 +304,6 @@ protected: ////////////////////////////////////////////////////////////////////////// CVariable mv_outdoor; CVariable mv_castShadow; // Legacy, required for backwards compatibility - CSmartVariableEnum mv_castShadowMinSpec; CVariable mv_ratioLOD; CVariable mv_viewDistanceMultiplier; CVariable mv_hiddenInGame; // Entity is hidden in game (on start). diff --git a/Code/Editor/Settings.cpp b/Code/Editor/Settings.cpp index 9514957795..9efe846b9e 100644 --- a/Code/Editor/Settings.cpp +++ b/Code/Editor/Settings.cpp @@ -129,8 +129,6 @@ SEditorSettings::SEditorSettings() bVisualizeNavigationAccessibility = false; navigationDebugAgentType = 0; - editorConfigSpec = CONFIG_VERYHIGH_SPEC; //arbitrary choice, but lets assume that we want things to initially look as good as possible in the editor. - viewports.bAlwaysShowRadiuses = false; viewports.bSync2DViews = false; viewports.fDefaultAspectRatio = 800.0f / 600.0f; @@ -166,7 +164,6 @@ SEditorSettings::SEditorSettings() bPreviewGeometryWindow = true; bBackupOnSave = true; backupOnSaveMaxCount = 3; - bApplyConfigSpecInEditor = true; showErrorDialogOnLoad = 1; consoleBackgroundColorTheme = AzToolsFramework::ConsoleColorTheme::Dark; @@ -433,40 +430,6 @@ void SEditorSettings::LoadValue(const char* sSection, const char* sKey, QString& } } -////////////////////////////////////////////////////////////////////////// -void SEditorSettings::LoadValue(const char* sSection, const char* sKey, ESystemConfigSpec& value) -{ - if (bSettingsManagerMode) - { - int valueCheck = 0; - - if (GetIEditor()->GetSettingsManager()) - { - GetIEditor()->GetSettingsManager()->LoadSetting(sSection, sKey, valueCheck); - } - - if (valueCheck >= CONFIG_AUTO_SPEC && valueCheck < END_CONFIG_SPEC_ENUM) - { - value = (ESystemConfigSpec)valueCheck; - SaveValue(sSection, sKey, value); - } - } - else - { - const SettingsGroup sg(sSection); - auto valuecheck = static_cast(s_editorSettings()->value(sKey, QVariant::fromValue(value)).toInt()); - if (valuecheck >= CONFIG_AUTO_SPEC && valuecheck < END_CONFIG_SPEC_ENUM) - { - value = valuecheck; - - if (GetIEditor()->GetSettingsManager()) - { - GetIEditor()->GetSettingsManager()->SaveSetting(sSection, sKey, value); - } - } - } -} - ////////////////////////////////////////////////////////////////////////// void SEditorSettings::Save(bool isEditorClosing) { @@ -503,9 +466,6 @@ void SEditorSettings::Save(bool isEditorClosing) SaveValue("Settings", "BackupOnSave", bBackupOnSave); SaveValue("Settings", "SaveBackupMaxCount", backupOnSaveMaxCount); - SaveValue("Settings", "ApplyConfigSpecInEditor", bApplyConfigSpecInEditor); - - SaveValue("Settings", "editorConfigSpec", editorConfigSpec); SaveValue("Settings", "TemporaryDirectory", strStandardTempDirectory); @@ -697,9 +657,6 @@ void SEditorSettings::Load() LoadValue("Settings", "BackupOnSave", bBackupOnSave); LoadValue("Settings", "SaveBackupMaxCount", backupOnSaveMaxCount); - LoadValue("Settings", "ApplyConfigSpecInEditor", bApplyConfigSpecInEditor); - LoadValue("Settings", "editorConfigSpec", editorConfigSpec); - LoadValue("Settings", "TemporaryDirectory", strStandardTempDirectory); @@ -894,7 +851,6 @@ void SEditorSettings::PostInitApply() REGISTER_CVAR2_CB("ed_toolbarIconSize", &gui.nToolbarIconSize, gui.nToolbarIconSize, VF_NULL, "Override size of the toolbar icons 0-default, 16,32,...", ToolbarIconSizeChanged); - GetIEditor()->SetEditorConfigSpec(editorConfigSpec, GetISystem()->GetConfigPlatform()); REGISTER_CVAR2("ed_backgroundUpdatePeriod", &backgroundUpdatePeriod, backgroundUpdatePeriod, 0, "Delay between frame updates (ms) when window is out of focus but not minimized. 0 = disable background update"); REGISTER_CVAR2("ed_showErrorDialogOnLoad", &showErrorDialogOnLoad, showErrorDialogOnLoad, 0, "Show error dialog on level load"); REGISTER_CVAR2_CB("ed_keepEditorActive", &keepEditorActive, 0, VF_NULL, "Keep the editor active, even if no focus is set", KeepEditorActiveChanged); diff --git a/Code/Editor/Settings.h b/Code/Editor/Settings.h index 0ebb70501d..e88f2f6550 100644 --- a/Code/Editor/Settings.h +++ b/Code/Editor/Settings.h @@ -378,10 +378,6 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING SGUI_Settings gui; - bool bApplyConfigSpecInEditor; - - ESystemConfigSpec editorConfigSpec; - //! Terrain Texture Export/Import filename. QString terrainTextureExport; @@ -451,7 +447,6 @@ private: void LoadValue(const char* sSection, const char* sKey, float& value); void LoadValue(const char* sSection, const char* sKey, bool& value); void LoadValue(const char* sSection, const char* sKey, QString& value); - void LoadValue(const char* sSection, const char* sKey, ESystemConfigSpec& value); void SaveCloudSettings(); diff --git a/Code/Editor/UIEnumsDatabase.cpp b/Code/Editor/UIEnumsDatabase.cpp deleted file mode 100644 index b859f54ffa..0000000000 --- a/Code/Editor/UIEnumsDatabase.cpp +++ /dev/null @@ -1,91 +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 "EditorDefs.h" - -#include "UIEnumsDatabase.h" - -////////////////////////////////////////////////////////////////////////// -QString CUIEnumsDatabase_SEnum::NameToValue(const QString& name) -{ - int n = (int)strings.size(); - for (int i = 0; i < n; i++) - { - if (name == strings[i]) - { - return values[i]; - } - } - return name; -} - -////////////////////////////////////////////////////////////////////////// -QString CUIEnumsDatabase_SEnum::ValueToName(const QString& value) -{ - int n = (int)strings.size(); - for (int i = 0; i < n; i++) - { - if (value == values[i]) - { - return strings[i]; - } - } - return value; -} - -////////////////////////////////////////////////////////////////////////// -CUIEnumsDatabase::CUIEnumsDatabase() -{ -} - -////////////////////////////////////////////////////////////////////////// -CUIEnumsDatabase::~CUIEnumsDatabase() -{ - // Free enums. - for (Enums::iterator it = m_enums.begin(); it != m_enums.end(); ++it) - { - delete it->second; - } -} - -////////////////////////////////////////////////////////////////////////// -void CUIEnumsDatabase::SetEnumStrings(const QString& enumName, const QStringList& sStringsArray) -{ - int nStringCount = sStringsArray.size(); - - CUIEnumsDatabase_SEnum* pEnum = stl::find_in_map(m_enums, enumName, nullptr); - if (!pEnum) - { - pEnum = new CUIEnumsDatabase_SEnum; - pEnum->m_name = enumName; - m_enums[enumName] = pEnum; - } - pEnum->strings.clear(); - pEnum->values.clear(); - for (int i = 0; i < nStringCount; i++) - { - QString str = sStringsArray[i]; - QString value = str; - int pos = str.indexOf('='); - if (pos >= 0) - { - value = str.mid(pos + 1); - str = str.mid(0, pos); - } - pEnum->strings.push_back(str); - pEnum->values.push_back(value); - } -} - -////////////////////////////////////////////////////////////////////////// -CUIEnumsDatabase_SEnum* CUIEnumsDatabase::FindEnum(const QString& enumName) const -{ - CUIEnumsDatabase_SEnum* pEnum = stl::find_in_map(m_enums, enumName, nullptr); - return pEnum; -} diff --git a/Code/Editor/UIEnumsDatabase.h b/Code/Editor/UIEnumsDatabase.h deleted file mode 100644 index 102b30a7c5..0000000000 --- a/Code/Editor/UIEnumsDatabase.h +++ /dev/null @@ -1,47 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_UIENUMSDATABASE_H -#define CRYINCLUDE_EDITOR_UIENUMSDATABASE_H -#pragma once - -#include "Include/EditorCoreAPI.h" - -struct EDITOR_CORE_API CUIEnumsDatabase_SEnum -{ - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - QString m_name; - QStringList strings; // Display Strings. - QStringList values; // Corresponding Values. - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - QString NameToValue(const QString& name); - QString ValueToName(const QString& value); -}; - -////////////////////////////////////////////////////////////////////////// -// Stores string associates to the enumeration collections for UI. -////////////////////////////////////////////////////////////////////////// -class EDITOR_CORE_API CUIEnumsDatabase -{ -public: - CUIEnumsDatabase(); - ~CUIEnumsDatabase(); - - void SetEnumStrings(const QString& enumName, const QStringList& sStringsArray); - CUIEnumsDatabase_SEnum* FindEnum(const QString& enumName) const; - -private: - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - typedef std::map Enums; - Enums m_enums; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -#endif // CRYINCLUDE_EDITOR_UIENUMSDATABASE_H diff --git a/Code/Editor/UndoConfigSpec.cpp b/Code/Editor/UndoConfigSpec.cpp deleted file mode 100644 index 93b73a90a1..0000000000 --- a/Code/Editor/UndoConfigSpec.cpp +++ /dev/null @@ -1,45 +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 - * - */ - - -// Description : Undo for Python function (PySetConfigSpec) - - -#include "EditorDefs.h" - -#include "UndoConfigSpec.h" - -CUndoConficSpec::CUndoConficSpec(const QString& pUndoDescription) -{ - m_undo = GetIEditor()->GetEditorConfigSpec(); - m_undoDescription = pUndoDescription; -} - -int CUndoConficSpec::GetSize() -{ - return sizeof(*this); -} - -QString CUndoConficSpec::GetDescription() -{ - return m_undoDescription; -} - -void CUndoConficSpec::Undo(bool bUndo) -{ - if (bUndo) - { - m_redo = GetIEditor()->GetEditorConfigSpec(); - } - GetIEditor()->SetEditorConfigSpec((ESystemConfigSpec)m_undo, GetIEditor()->GetEditorConfigPlatform()); -} - -void CUndoConficSpec::Redo() -{ - GetIEditor()->SetEditorConfigSpec((ESystemConfigSpec)m_redo, GetIEditor()->GetEditorConfigPlatform()); -} diff --git a/Code/Editor/UndoConfigSpec.h b/Code/Editor/UndoConfigSpec.h deleted file mode 100644 index f4aa80477e..0000000000 --- a/Code/Editor/UndoConfigSpec.h +++ /dev/null @@ -1,37 +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 - * - */ - - -// Description : Undo for Python function (PySetConfigSpec) - - -#ifndef CRYINCLUDE_EDITOR_UNDOCONFIGSPEC_H -#define CRYINCLUDE_EDITOR_UNDOCONFIGSPEC_H -#pragma once - -#include "Undo/IUndoObject.h" - -class CUndoConficSpec - : public IUndoObject -{ -public: - CUndoConficSpec(const QString& pUndoDescription = "Set Config Spec"); - -protected: - int GetSize(); - QString GetDescription(); - void Undo(bool bUndo); - void Redo(); - -private: - int m_undo; - int m_redo; - QString m_undoDescription; -}; - -#endif // CRYINCLUDE_EDITOR_UNDOCONFIGSPEC_H diff --git a/Code/Editor/Util/Variable.cpp b/Code/Editor/Util/Variable.cpp index 3d7c35ac1c..4f56743479 100644 --- a/Code/Editor/Util/Variable.cpp +++ b/Code/Editor/Util/Variable.cpp @@ -10,7 +10,6 @@ #include "EditorDefs.h" #include "Variable.h" -#include "UIEnumsDatabase.h" #include "UsedResources.h" // for CUsedResources @@ -496,49 +495,3 @@ void CVarObject::Serialize(XmlNodeRef node, bool load) m_vars->Serialize(node, load); } } - - -CVarGlobalEnumList::CVarGlobalEnumList(CUIEnumsDatabase_SEnum* pEnum) - : m_pEnum(pEnum) -{ -} - -CVarGlobalEnumList::CVarGlobalEnumList(const QString& enumName) -{ - m_pEnum = GetIEditor()->GetUIEnumsDatabase()->FindEnum(enumName); -} - -//! Get the name of specified value in enumeration. -QString CVarGlobalEnumList::GetItemName(uint index) -{ - if (!m_pEnum || index >= static_cast(m_pEnum->strings.size())) - { - return QString(); - } - return m_pEnum->strings[index]; -} - -QString CVarGlobalEnumList::NameToValue(const QString& name) -{ - if (m_pEnum) - { - return m_pEnum->NameToValue(name); - } - else - { - return name; - } -} - -QString CVarGlobalEnumList::ValueToName(const QString& value) -{ - if (m_pEnum) - { - return m_pEnum->ValueToName(value); - } - else - { - return value; - } -} - diff --git a/Code/Editor/Util/Variable.h b/Code/Editor/Util/Variable.h index 639161775c..0d8cbb1459 100644 --- a/Code/Editor/Util/Variable.h +++ b/Code/Editor/Util/Variable.h @@ -151,7 +151,7 @@ struct IVariable DT_SEQUENCE, // Movie Sequence (DEPRECATED, use DT_SEQUENCE_ID, instead.) DT_MISSIONOBJ, // Mission Objective DT_USERITEMCB, // Use a callback GetItemsCallback in user data of variable - DT_UIENUM, // Edit as enum, uses CUIEnumsDatabase to lookup the enum to value pairs and combobox in GUI. + DT_UIENUM, // DEPRECATED DT_SEQUENCE_ID, // Movie Sequence DT_LIGHT_ANIMATION, // Light Animation Node in the global Light Animation Set DT_PARTICLE_EFFECT, @@ -1451,32 +1451,6 @@ protected: friend class _smart_ptr >; }; -struct CUIEnumsDatabase_SEnum; - -////////////////////////////////////////////////////////////////////////// -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -class EDITOR_CORE_API CVarGlobalEnumList - : public CVarEnumListBase -{ -AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - CVarGlobalEnumList(CUIEnumsDatabase_SEnum* pEnum); - CVarGlobalEnumList(const QString& enumName); - - //! Get the name of specified value in enumeration. - virtual QString GetItemName(uint index); - - virtual QString NameToValue(const QString& name); - virtual QString ValueToName(const QString& value); - - //! Don't add anything to a global enum database - virtual void AddItem([[maybe_unused]] const QString& name, [[maybe_unused]] const QString& value) {} - -private: - CUIEnumsDatabase_SEnum* m_pEnum; -}; - - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// //! Selection list shown in combo box, for enumerated variable. diff --git a/Code/Editor/Util/VariablePropertyType.cpp b/Code/Editor/Util/VariablePropertyType.cpp index 3f472dde72..5af104b3fb 100644 --- a/Code/Editor/Util/VariablePropertyType.cpp +++ b/Code/Editor/Util/VariablePropertyType.cpp @@ -10,7 +10,6 @@ #include "VariablePropertyType.h" #include "Variable.h" -#include "UIEnumsDatabase.h" #include "IEditor.h" namespace Prop @@ -72,7 +71,6 @@ namespace Prop , m_bHardMin(false) , m_bHardMax(false) , m_valueMultiplier(1) - , m_pEnumDBItem(nullptr) { } @@ -86,7 +84,6 @@ namespace Prop , m_bHardMin(false) , m_bHardMax(false) , m_valueMultiplier(1) - , m_pEnumDBItem(nullptr) { if (!pVar) { @@ -160,11 +157,6 @@ namespace Prop m_rangeMin = max(-360.0f, m_rangeMin); m_rangeMax = min(360.0f, m_rangeMax); } - else if (type == IVariable::DT_UIENUM) - { - m_pEnumDBItem = GetIEditor()->GetUIEnumsDatabase()->FindEnum(m_name); - } - const bool useExplicitStep = (pVar->GetFlags() & IVariable::UI_EXPLICIT_STEP); if (!useExplicitStep) diff --git a/Code/Editor/Util/VariablePropertyType.h b/Code/Editor/Util/VariablePropertyType.h index decb930cb3..e37b38cdb7 100644 --- a/Code/Editor/Util/VariablePropertyType.h +++ b/Code/Editor/Util/VariablePropertyType.h @@ -73,7 +73,6 @@ namespace Prop bool m_bHardMax; QString m_name; float m_valueMultiplier; - CUIEnumsDatabase_SEnum* m_pEnumDBItem; }; EDITOR_CORE_API const char* GetName(int dataType); diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 7cb40927a4..4cf092e774 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -8,7 +8,6 @@ set(FILES UsedResources.h - UIEnumsDatabase.h Include/EditorCoreAPI.cpp Include/IErrorReport.h Include/IFileUtil.h @@ -31,7 +30,6 @@ set(FILES Controls/QToolTipWidget.h Controls/QToolTipWidget.cpp UsedResources.cpp - UIEnumsDatabase.cpp LyViewPaneNames.h QtViewPaneManager.cpp QtViewPaneManager.h diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index d1c903eb72..5812aae4bb 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -441,7 +441,6 @@ set(FILES IPostRenderer.h ToolBox.h TrackViewNewSequenceDialog.h - UndoConfigSpec.h Util/GeometryUtil.h LevelIndependentFileMan.cpp LevelIndependentFileMan.h @@ -528,7 +527,6 @@ set(FILES ToolBox.cpp TrackViewNewSequenceDialog.cpp TrackViewNewSequenceDialog.ui - UndoConfigSpec.cpp Dialogs/ErrorsDlg.cpp Dialogs/ErrorsDlg.h Dialogs/ErrorsDlg.ui diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index cb2ba0d5bc..b68dd2041c 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -87,19 +87,6 @@ enum ESystemUpdateFlags ESYSUPDATE_EDITOR = 0x0004 }; -// Description: -// Configuration specification, depends on user selected machine specification. -enum ESystemConfigSpec -{ - CONFIG_AUTO_SPEC = 0, - CONFIG_LOW_SPEC = 1, - CONFIG_MEDIUM_SPEC = 2, - CONFIG_HIGH_SPEC = 3, - CONFIG_VERYHIGH_SPEC = 4, - - END_CONFIG_SPEC_ENUM, // MUST BE LAST VALUE. USED FOR ERROR CHECKING. -}; - // Description: // Configuration platform. Autodetected at start, can be modified through the editor. enum ESystemConfigPlatform From 4c01c5b67fffaaaa4aa352b927a7f5046a67f2a5 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Wed, 26 Jan 2022 19:15:34 +0000 Subject: [PATCH 282/394] LYN-7637 Allow Terrain Physics Collider to assign a default physics material Signed-off-by: Sergey Pereslavtsev --- .../TerrainPhysicsColliderComponent.cpp | 11 ++- .../TerrainPhysicsColliderComponent.h | 2 +- .../Tests/TerrainPhysicsColliderTests.cpp | 92 +++++++++++++++++++ 3 files changed, 100 insertions(+), 5 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index c74a478dad..72f03230ac 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -70,8 +70,9 @@ namespace Terrain if (auto serialize = azrtti_cast(context)) { serialize->Class() - ->Version(2)->Field( - "Mappings", &TerrainPhysicsColliderConfig::m_surfaceMaterialMappings) + ->Version(3) + ->Field("DefaultMaterial", &TerrainPhysicsColliderConfig::m_defaultMaterialSelection) + ->Field("Mappings", &TerrainPhysicsColliderConfig::m_surfaceMaterialMappings) ; if (auto edit = serialize->GetEditContext()) @@ -82,6 +83,8 @@ namespace Terrain ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &TerrainPhysicsColliderConfig::m_defaultMaterialSelection, + "Default Surface Physics Material", "Select a material to be used by maps surfaces by default") ->DataElement( AZ::Edit::UIHandlers::Default, &TerrainPhysicsColliderConfig::m_surfaceMaterialMappings, "Surface to Material Mappings", "Maps surfaces to physics materials") @@ -319,7 +322,7 @@ namespace Terrain } // If this surface isn't mapped, use the default material. - return Physics::MaterialId(); + return m_configuration.m_defaultMaterialSelection.GetMaterialId(); } void TerrainPhysicsColliderComponent::GenerateHeightsAndMaterialsInBounds( @@ -417,7 +420,7 @@ namespace Terrain AZStd::vector materialList; // Ensure the list contains the default material as the first entry. - materialList.emplace_back(Physics::MaterialId()); + materialList.emplace_back(m_configuration.m_defaultMaterialSelection.GetMaterialId()); for (auto& mapping : m_configuration.m_surfaceMaterialMappings) { diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h index 8a70f282d0..5f79fa9103 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h @@ -48,7 +48,7 @@ namespace Terrain AZ_CLASS_ALLOCATOR(TerrainPhysicsColliderConfig, AZ::SystemAllocator, 0); AZ_RTTI(TerrainPhysicsColliderConfig, "{E9EADB8F-C3A5-4B9C-A62D-2DBC86B4CE59}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); - + Physics::MaterialSelection m_defaultMaterialSelection; AZStd::vector m_surfaceMaterialMappings; }; diff --git a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp index dc43544f05..6dc225f537 100644 --- a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp @@ -502,3 +502,95 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM m_entity.reset(); } + +TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMaterialAssignedWhenTagHasNoMapping) +{ + CreateEntity(); + + m_boxComponent = m_entity->CreateComponent(); + m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); + + // Create two SurfaceTag/Material mappings and add them to the collider. + Terrain::TerrainPhysicsColliderConfig config; + + const Physics::MaterialId defaultSurfaceMaterial = Physics::MaterialId::Create(); + const Physics::MaterialId mat1 = Physics::MaterialId::Create(); + + const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); + const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); + + Terrain::TerrainPhysicsSurfaceMaterialMapping mapping1; + mapping1.m_materialId = mat1; + mapping1.m_surfaceTag = tag1; + config.m_surfaceMaterialMappings.emplace_back(mapping1); + config.m_defaultMaterialSelection.SetMaterialId(defaultSurfaceMaterial); + + // Intentionally don't set the mapping for "tag2". It's expected the default material will substitute. + + m_colliderComponent = m_entity->CreateComponent(config); + m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); + + m_entity->Activate(); + + // Validate material list is generated with the default material + { + AZStd::vector materialList; + Physics::HeightfieldProviderRequestsBus::EventResult( + materialList, m_entity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetMaterialList); + + // The materialList should be 2 items long: the default material and mat1. + EXPECT_EQ(materialList.size(), 2); + EXPECT_EQ(materialList[0], defaultSurfaceMaterial); + EXPECT_EQ(materialList[1], mat1); + } + + const AZ::Vector3 boundsMin = AZ::Vector3(0.0f); + const AZ::Vector3 boundsMax = AZ::Vector3(256.0f, 256.0f, 32768.0f); + + NiceMock boxShape(m_entity->GetId()); + const AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(boundsMin, boundsMax); + ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); + + const float mockHeight = 32768.0f; + AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + + AzFramework::SurfaceData::SurfaceTagWeight return1; + return1.m_surfaceType = tag1; + return1.m_weight = 1.0f; + + AzFramework::SurfaceData::SurfaceTagWeight return2; + return2.m_surfaceType = tag2; + return2.m_weight = 1.0f; + + AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { return1, return2 }; + + NiceMock terrainListener; + ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); + ON_CALL(terrainListener, ProcessSurfacePointsFromRegion).WillByDefault( + [this, mockHeight, &surfaceTags](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + { + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, &surfaceTags, mockHeight); + } + ); + + // Validate material indices + { + AZStd::vector heightsAndMaterials; + Physics::HeightfieldProviderRequestsBus::EventResult( + heightsAndMaterials, m_entity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); + + // We set the bounds to 256, so check that the correct number of entries are present. + EXPECT_EQ(heightsAndMaterials.size(), 256 * 256); + + // Check an entry from the first half of the returned list. + EXPECT_EQ(heightsAndMaterials[0].m_materialIndex, 1); + + // Check an entry from the second half of the list. + // This should point to the default material (0) since we don't have a mapping for "tag2" + EXPECT_EQ(heightsAndMaterials[256 * 128].m_materialIndex, 0); + } + + m_entity.reset(); +} From 4312c636afb458cb630a23100186150a6324240a Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 12:19:49 -0800 Subject: [PATCH 283/394] Got the RPI unit tests building and working again after merge. There were some incorrectly resolved conflicts that I had to re-resolve, especially in MaterialTypeSourceData::CreateMaterialTypeAsset. I removed support for property rename version updates in MaterialTypeSourceData (i.e. ApplyPropertyRenames) because MaterialSourceData serialization no longer loads material property definitions from the .materialtype file, per a recent change on the development branch. The unit tests were broken and it wasn't worth updating them since we don't need this functionality anymore. Material property renames and other version updates are now exclusively applied by the MaterialAsset class. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.cpp | 327 +----------------- .../Material/MaterialSourceDataTests.cpp | 45 +-- .../Material/MaterialTypeSourceDataTests.cpp | 152 +------- 3 files changed, 38 insertions(+), 486 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 9e72e13b34..2504981273 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -132,32 +132,6 @@ namespace AZ const float MaterialTypeSourceData::PropertyDefinition::DefaultMax = std::numeric_limits::max(); const float MaterialTypeSourceData::PropertyDefinition::DefaultStep = 0.1f; - bool MaterialTypeSourceData::ApplyPropertyRenames(MaterialPropertyId& propertyId) const - { - bool renamed = false; - - for (const VersionUpdateDefinition& versionUpdate : m_versionUpdates) - { - for (const VersionUpdatesRenameOperationDefinition& action : versionUpdate.m_actions) - { - if (action.m_operation == "rename") - { - if (action.m_renameFrom == propertyId.GetStringView()) - { - propertyId = MaterialPropertyId::Parse(action.m_renameTo); - renamed = true; - } - } - else - { - AZ_Warning("Material source data", false, "Unsupported material version update operation '%s'", action.m_operation.c_str()); - } - } - } - - return renamed; - } - /*static*/ MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList) { auto iter = AZStd::find_if(toPropertySetList.begin(), toPropertySetList.end(), [name](const AZStd::unique_ptr& existingPropertySet) @@ -528,49 +502,6 @@ namespace AZ return groupDefinitions; } - // TODO: It looks like this function doesn't operate on MaterialTypeSourceData data, it belongs in MaterialUtils - bool MaterialTypeSourceData::ConvertPropertyValueToSourceDataFormat(const PropertyDefinition& propertyDefinition, MaterialPropertyValue& propertyValue) const - { - if (propertyDefinition.m_dataType == AZ::RPI::MaterialPropertyDataType::Enum && propertyValue.Is()) - { - const uint32_t index = propertyValue.GetValue(); - if (index >= propertyDefinition.m_enumValues.size()) - { - AZ_Error("Material source data", false, "Invalid value for material enum property: '%s'.", propertyDefinition.m_name.c_str()); - return false; - } - - propertyValue = propertyDefinition.m_enumValues[index]; - return true; - } - - // Image asset references must be converted from asset IDs to a relative source file path - if (propertyDefinition.m_dataType == AZ::RPI::MaterialPropertyDataType::Image && propertyValue.Is>()) - { - const Data::Asset& imageAsset = propertyValue.GetValue>(); - - Data::AssetInfo imageAssetInfo; - if (imageAsset.GetId().IsValid()) - { - bool result = false; - AZStd::string rootFilePath; - const AZStd::string platformName = ""; // Empty for default - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(result, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetAssetInfoById, - imageAsset.GetId(), imageAsset.GetType(), platformName, imageAssetInfo, rootFilePath); - if (!result) - { - AZ_Error("Material source data", false, "Image asset could not be found for property: '%s'.", propertyDefinition.m_name.c_str()); - return false; - } - } - - propertyValue = imageAssetInfo.m_relativePath; - return true; - } - - return true; - } - bool MaterialTypeSourceData::BuildPropertyList( const AZStd::string& materialTypeSourceFilePath, MaterialTypeAssetCreator& materialTypeAssetCreator, @@ -651,15 +582,20 @@ namespace AZ { case MaterialPropertyDataType::Image: { - Outcome> imageAssetResult = MaterialUtils::GetImageAssetReference(materialTypeSourceFilePath, property->m_value.GetValue()); + Data::Asset imageAsset; - if (imageAssetResult.IsSuccess()) + MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference( + imageAsset, materialTypeSourceFilePath, property->m_value.GetValue()); + + if (result == MaterialUtils::GetImageAssetResult::Missing) { - materialTypeAssetCreator.SetPropertyValue(propertyId, imageAssetResult.GetValue()); + materialTypeAssetCreator.ReportError( + "Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), + property->m_value.GetValue().data()); } else { - materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), property->m_value.GetValue().data()); + materialTypeAssetCreator.SetPropertyValue(propertyId, imageAsset); } } break; @@ -743,145 +679,6 @@ namespace AZ } - Outcome> MaterialTypeSourceData::CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath, bool elevateWarnings) const - { - MaterialTypeAssetCreator materialTypeAssetCreator; - materialTypeAssetCreator.SetElevateWarnings(elevateWarnings); - materialTypeAssetCreator.Begin(assetId); - - // Used to gather all the UV streams used in this material type from its shaders in alphabetical order. - auto semanticComp = [](const RHI::ShaderSemantic& lhs, const RHI::ShaderSemantic& rhs) -> bool - { - return lhs.ToString() < rhs.ToString(); - }; - AZStd::set uvsInThisMaterialType(semanticComp); - - for (const ShaderVariantReferenceData& shaderRef : m_shaderCollection) - { - const auto& shaderFile = shaderRef.m_shaderFilePath; - auto shaderAssetResult = AssetUtils::LoadAsset(materialTypeSourceFilePath, shaderFile, 0); - - if (shaderAssetResult) - { - auto shaderAsset = shaderAssetResult.GetValue(); - auto optionsLayout = shaderAsset->GetShaderOptionGroupLayout(); - ShaderOptionGroup options{ optionsLayout }; - for (auto& iter : shaderRef.m_shaderOptionValues) - { - if (!options.SetValue(iter.first, iter.second)) - { - return Failure(); - } - } - - materialTypeAssetCreator.AddShader( - shaderAsset, options.GetShaderVariantId(), - shaderRef.m_shaderTag.IsEmpty() ? Uuid::CreateRandom().ToString() : shaderRef.m_shaderTag); - - // Gather UV names - const ShaderInputContract& shaderInputContract = shaderAsset->GetInputContract(); - for (const ShaderInputContract::StreamChannelInfo& channel : shaderInputContract.m_streamChannels) - { - const RHI::ShaderSemantic& semantic = channel.m_semantic; - - if (semantic.m_name.GetStringView().starts_with(RHI::ShaderSemantic::UvStreamSemantic)) - { - uvsInThisMaterialType.insert(semantic); - } - } - } - else - { - materialTypeAssetCreator.ReportError("Shader '%s' not found", shaderFile.data()); - return Failure(); - } - } - - for (const AZStd::unique_ptr& propertySet : m_propertyLayout.m_propertySets) - { - AZStd::vector propertyNameContext; - propertyNameContext.push_back(propertySet->m_name); - materialTypeAssetCreator.BeginMaterialProperty(propertyId.GetFullName(), property.m_dataType); - - if (!success) - { - return Failure(); - Data::Asset imageAsset; - - MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference( - Outcome> imageAssetResult = MaterialUtils::GetImageAssetReference(materialTypeSourceFilePath, property.m_value.GetValue()); - if (imageAssetResult.IsSuccess()) - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAssetResult.GetValue()); - "Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), - property.m_value.GetValue().data()); - materialTypeAssetCreator.ReportError("Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), property.m_value.GetValue().data()); - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId.GetFullName()); - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); - materialTypeAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.m_value); - } - } - - // We cannot create the MaterialFunctor until after all the properties are added because - // CreateFunctor() may need to look up properties in the MaterialPropertiesLayout - for (auto& functorData : m_materialFunctorSourceData) - { - MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor( - MaterialFunctorSourceData::RuntimeContext( - materialTypeSourceFilePath, - materialTypeAssetCreator.GetMaterialPropertiesLayout(), - materialTypeAssetCreator.GetMaterialShaderResourceGroupLayout(), - materialTypeAssetCreator.GetShaderCollection() - ) - ); - - if (result.IsSuccess()) - { - Ptr& functor = result.GetValue(); - if (functor != nullptr) - { - materialTypeAssetCreator.AddMaterialFunctor(functor); - - for (const AZ::Name& optionName : functorData->GetActualSourceData()->GetShaderOptionDependencies()) - { - materialTypeAssetCreator.ClaimShaderOptionOwnership(optionName); - } - } - } - else - { - materialTypeAssetCreator.ReportError("Failed to create MaterialFunctor"); - return Failure(); - } - } - - // Only add the UV mapping related to this material type. - for (const auto& uvInput : uvsInThisMaterialType) - { - // We may have cases where the uv map is empty or inconsistent (exported from other projects), - // So we use semantic if mapping is not found. - auto iter = m_uvNameMap.find(uvInput.ToString()); - if (iter != m_uvNameMap.end()) - { - materialTypeAssetCreator.AddUvName(uvInput, Name(iter->second)); - } - else - { - materialTypeAssetCreator.AddUvName(uvInput, Name(uvInput.ToString())); - } - } - - Data::Asset materialTypeAsset; - if (materialTypeAssetCreator.End(materialTypeAsset)) - { - return Success(AZStd::move(materialTypeAsset)); - } - else - { - return Failure(); - } - } - - Outcome> MaterialTypeSourceData::CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath, bool elevateWarnings) const { MaterialTypeAssetCreator materialTypeAssetCreator; @@ -970,108 +767,16 @@ namespace AZ return Failure(); } } - - for (auto& groupIter : m_propertyLayout.m_properties) + + for (const AZStd::unique_ptr& propertySet : m_propertyLayout.m_propertySets) { - const AZStd::string& groupName = groupIter.first; + AZStd::vector propertyNameContext; + propertyNameContext.push_back(propertySet->m_name); + bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyNameContext, propertySet.get()); - for (const PropertyDefinition& property : groupIter.second) + if (!success) { - // Register the property... - - MaterialPropertyId propertyId{ groupName, property.m_name }; - - if (!propertyId.IsValid()) - { - materialTypeAssetCreator.ReportWarning("Cannot create material property with invalid ID '%s'.", propertyId.GetCStr()); - continue; - } - - materialTypeAssetCreator.BeginMaterialProperty(propertyId, property.m_dataType); - - if (property.m_dataType == MaterialPropertyDataType::Enum) - { - materialTypeAssetCreator.SetMaterialPropertyEnumNames(property.m_enumValues); - } - - for (auto& output : property.m_outputConnections) - { - switch (output.m_type) - { - case MaterialPropertyOutputType::ShaderInput: - materialTypeAssetCreator.ConnectMaterialPropertyToShaderInput(Name{ output.m_fieldName.data() }); - break; - case MaterialPropertyOutputType::ShaderOption: - if (output.m_shaderIndex >= 0) - { - materialTypeAssetCreator.ConnectMaterialPropertyToShaderOption(Name{ output.m_fieldName.data() }, output.m_shaderIndex); - } - else - { - materialTypeAssetCreator.ConnectMaterialPropertyToShaderOptions(Name{ output.m_fieldName.data() }); - } - break; - case MaterialPropertyOutputType::Invalid: - // Don't add any output mappings, this is the case when material functors are expected to process the property - break; - default: - AZ_Assert(false, "Unsupported MaterialPropertyOutputType"); - return Failure(); - } - } - - materialTypeAssetCreator.EndMaterialProperty(); - - // Parse and set the property's value... - if (!property.m_value.IsValid()) - { - AZ_Warning("Material source data", false, "Source data for material property value is invalid."); - } - else - { - switch (property.m_dataType) - { - case MaterialPropertyDataType::Image: - { - Data::Asset imageAsset; - - MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference( - imageAsset, materialTypeSourceFilePath, property.m_value.GetValue()); - - if (result == MaterialUtils::GetImageAssetResult::Missing) - { - materialTypeAssetCreator.ReportError( - "Material property '%s': Could not find the image '%s'", propertyId.GetCStr(), - property.m_value.GetValue().data()); - } - else - { - materialTypeAssetCreator.SetPropertyValue(propertyId, imageAsset); - } - } - break; - case MaterialPropertyDataType::Enum: - { - MaterialPropertyIndex propertyIndex = materialTypeAssetCreator.GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); - const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); - - AZ::Name enumName = AZ::Name(property.m_value.GetValue()); - uint32_t enumValue = propertyDescriptor ? propertyDescriptor->GetEnumValue(enumName) : MaterialPropertyDescriptor::InvalidEnumValue; - if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) - { - materialTypeAssetCreator.ReportError("Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); - } - else - { - materialTypeAssetCreator.SetPropertyValue(propertyId, enumValue); - } - } - break; - default: - materialTypeAssetCreator.SetPropertyValue(propertyId, property.m_value); - break; - } - } + return Failure(); } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index 808e312b71..1a3b46ac86 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -93,20 +93,23 @@ namespace UnitTest { "version": 10, "propertyLayout": { - "properties": { - "general": [ - {"name": "MyBool", "type": "bool"}, - {"name": "MyInt", "type": "Int"}, - {"name": "MyUInt", "type": "UInt"}, - {"name": "MyFloat", "type": "Float"}, - {"name": "MyFloat2", "type": "Vector2"}, - {"name": "MyFloat3", "type": "Vector3"}, - {"name": "MyFloat4", "type": "Vector4"}, - {"name": "MyColor", "type": "Color"}, - {"name": "MyImage", "type": "Image"}, - {"name": "MyEnum", "type": "Enum", "enumValues": ["Enum0", "Enum1", "Enum2"], "defaultValue": "Enum0"} - ] - } + "propertySets": [ + { + "name": "general", + "properties": [ + {"name": "MyBool", "type": "bool"}, + {"name": "MyInt", "type": "Int"}, + {"name": "MyUInt", "type": "UInt"}, + {"name": "MyFloat", "type": "Float"}, + {"name": "MyFloat2", "type": "Vector2"}, + {"name": "MyFloat3", "type": "Vector3"}, + {"name": "MyFloat4", "type": "Vector4"}, + {"name": "MyColor", "type": "Color"}, + {"name": "MyImage", "type": "Image"}, + {"name": "MyEnum", "type": "Enum", "enumValues": ["Enum0", "Enum1", "Enum2"], "defaultValue": "Enum0"} + ] + } + ] }, "shaders": [ { @@ -580,18 +583,12 @@ namespace UnitTest errorMessageFinder.Reset(); errorMessageFinder.AddExpectedErrorMessage("Could not find asset [DoesNotExist.materialtype]"); - "properties": { - [ - { - "general": [ - "properties": [ - ] result = material.CreateMaterialAsset(AZ::Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::PreBake, elevateWarnings); EXPECT_FALSE(result.IsSuccess()); errorMessageFinder.CheckExpectedErrorsFound(); errorMessageFinder.Reset(); - EXPECT_TRUE(loadResult.ContainsMessage("[simpleMaterialType.materialtype]/propertyLayout/properties", "Successfully read")); + errorMessageFinder.AddExpectedErrorMessage("Could not find asset [DoesNotExist.materialtype]"); errorMessageFinder.AddIgnoredErrorMessage("Failed to create material type asset ID", true); result = material.CreateMaterialAssetFromSourceData(AZ::Uuid::CreateRandom(), "test.material", elevateWarnings); EXPECT_FALSE(result.IsSuccess()); @@ -600,12 +597,6 @@ namespace UnitTest TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MaterialPropertyNotFound) { - "properties": { - [ - { - "general": [ - "properties": [ - ] MaterialSourceData material; material.m_materialType = "@exefolder@/Temp/test.materialtype"; AddPropertyGroup(material, "general"); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index 8e65b41e6c..f07e1da6c2 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -1911,157 +1911,13 @@ namespace UnitTest } - TEST_F(MaterialTypeSourceDataTests, FindPropertyUsingOldName) - { - const AZStd::string inputJson = R"( - { - "version": 10, - "versionUpdates": [ - { - "toVersion": 2, - "actions": [ - { "op": "rename", "from": "general.fooA", "to": "general.fooB" } - ] - }, - { - "toVersion": 4, - "actions": [ - { "op": "rename", "from": "general.barA", "to": "general.barB" } - ] - }, - { - "toVersion": 6, - "actions": [ - { "op": "rename", "from": "general.fooB", "to": "general.fooC" }, - { "op": "rename", "from": "general.barB", "to": "general.barC" } - ] - }, - { - "toVersion": 7, - "actions": [ - { "op": "rename", "from": "general.bazA", "to": "otherGroup.bazB" }, - { "op": "rename", "from": "onlyOneProperty.bopA", "to": "otherGroup.bopB" } // This tests a group 'onlyOneProperty' that no longer exists in the material type - ] - } - ], - "propertyLayout": { - "properties": { - "general": [ - { - "name": "fooC", - "type": "Bool" - }, - { - "name": "barC", - "type": "Float" - } - ], - "otherGroup": [ - { - "name": "dontMindMe", - "type": "Bool" - }, - { - "name": "bazB", - "type": "Float" - }, - { - "name": "bopB", - "type": "Float" - } - ] - } - } - } - )"; - - MaterialTypeSourceData materialType; - JsonTestResult loadResult = LoadTestDataFromJson(materialType, inputJson); - - EXPECT_EQ(materialType.m_version, 10); - - // First find the properties using their correct current names - const MaterialTypeSourceData::PropertyDefinition* foo = materialType.FindProperty("general", "fooC"); - const MaterialTypeSourceData::PropertyDefinition* bar = materialType.FindProperty("general", "barC"); - const MaterialTypeSourceData::PropertyDefinition* baz = materialType.FindProperty("otherGroup", "bazB"); - const MaterialTypeSourceData::PropertyDefinition* bop = materialType.FindProperty("otherGroup", "bopB"); - - EXPECT_TRUE(foo); - EXPECT_TRUE(bar); - EXPECT_TRUE(baz); - EXPECT_TRUE(bop); - EXPECT_EQ(foo->m_name, "fooC"); - EXPECT_EQ(bar->m_name, "barC"); - EXPECT_EQ(baz->m_name, "bazB"); - EXPECT_EQ(bop->m_name, "bopB"); - - // Now try doing the property lookup using old versions of the name and make sure the same property can be found - - EXPECT_EQ(foo, materialType.FindProperty("general", "fooA")); - EXPECT_EQ(foo, materialType.FindProperty("general", "fooB")); - EXPECT_EQ(bar, materialType.FindProperty("general", "barA")); - EXPECT_EQ(bar, materialType.FindProperty("general", "barB")); - EXPECT_EQ(baz, materialType.FindProperty("general", "bazA")); - EXPECT_EQ(bop, materialType.FindProperty("onlyOneProperty", "bopA")); - - EXPECT_EQ(nullptr, materialType.FindProperty("general", "fooX")); - EXPECT_EQ(nullptr, materialType.FindProperty("general", "barX")); - EXPECT_EQ(nullptr, materialType.FindProperty("general", "bazX")); - EXPECT_EQ(nullptr, materialType.FindProperty("general", "bazB")); - EXPECT_EQ(nullptr, materialType.FindProperty("otherGroup", "bazA")); - EXPECT_EQ(nullptr, materialType.FindProperty("onlyOneProperty", "bopB")); - EXPECT_EQ(nullptr, materialType.FindProperty("otherGroup", "bopA")); - } - - TEST_F(MaterialTypeSourceDataTests, FindPropertyUsingOldName_Error_UnsupportedVersionUpdate) - { - const AZStd::string inputJson = R"( - { - "version": 10, - "versionUpdates": [ - { - "toVersion": 2, - "actions": [ - { "op": "notRename", "from": "general.fooA", "to": "general.fooB" } - ] - } - ], - "propertyLayout": { - "properties": { - "general": [ - { - "name": "fooB", - "type": "Bool" - } - ] - } - } - } - )"; - - MaterialTypeSourceData materialType; - JsonTestResult loadResult = LoadTestDataFromJson(materialType, inputJson); - - ErrorMessageFinder errorMessageFinder; - errorMessageFinder.AddExpectedErrorMessage("Unsupported material version update operation 'notRename'"); - - - const MaterialTypeSourceData::PropertyDefinition* foo = materialType.FindProperty("general", "fooA"); - - EXPECT_EQ(nullptr, foo); - - errorMessageFinder.CheckExpectedErrorsFound(); - } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_UnsupportedVersionUpdate) { MaterialTypeSourceData sourceData; - - MaterialTypeSourceData::PropertyDefinition propertySource; - propertySource.m_name = "a"; - propertySource.m_dataType = MaterialPropertyDataType::Int; - propertySource.m_value = 0; - sourceData.m_propertyLayout.m_properties["general"].push_back(propertySource); + + MaterialTypeSourceData::PropertyDefinition* propertySource = sourceData.AddPropertySet("general")->AddProperty("a"); + propertySource->m_dataType = MaterialPropertyDataType::Int; + propertySource->m_value = 0; sourceData.m_version = 2; From 52f1ef84c7c9fb8801bb02e361e2b337253bcbd6 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Wed, 26 Jan 2022 14:20:01 -0600 Subject: [PATCH 284/394] Fixed string_view compilation in GCC 10+. (#7153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed string_view compilation in GCC 10+. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * More GCC 10+ Fixes. GCC 11 seems to have an issue with linkage regarding using a lambda as a default parameter in a function declaration. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * GCC10+ Fix - Fixed binding to a temporary references. > error: loop variable ‘pathName’ of type ‘const QString&’ binds to a temporary constructed from type ‘const char* const’ [-Werror=range-loop-construct] 415 | for (const QString& pathName : { "CrySystem", Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../AzCore/AzCore/std/string/string_view.h | 164 ++++++++++-------- .../native/utilities/ApplicationManager.cpp | 2 +- .../Include/Atom/RHI/ThreadLocalContext.h | 8 +- 3 files changed, 100 insertions(+), 74 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/std/string/string_view.h b/Code/Framework/AzCore/AzCore/std/string/string_view.h index c333e2cea1..daa00d98d3 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string_view.h +++ b/Code/Framework/AzCore/AzCore/std/string/string_view.h @@ -309,78 +309,87 @@ namespace AZStd } static constexpr bool eq(char_type left, char_type right) noexcept { return left == right; } static constexpr bool lt(char_type left, char_type right) noexcept { return left < right; } - static constexpr int compare(const char_type* s1, const char_type* s2, size_t count) noexcept - { - // In GCC versions prior to major version 10, __builtin_memcmp fails in valid checks in constexpr evaluation -#if !defined(AZ_COMPILER_GCC) || AZ_COMPILER_GCC >= 100000 - if constexpr (AZStd::is_same_v) - { - return __builtin_memcmp(s1, s2, count); - } - else if constexpr (AZStd::is_same_v) - { - return __builtin_wmemcmp(s1, s2, count); - } else -#endif - { - if (az_builtin_is_constant_evaluated()) - { - for (; count; --count, ++s1, ++s2) + static constexpr int compare(const char_type* s1, const char_type* s2, size_t count) noexcept + { + // In GCC versions , __builtin_memcmp fails in valid checks in constexpr evaluation +#if !defined(AZ_COMPILER_GCC) + if constexpr (AZStd::is_same_v) + { + return __builtin_memcmp(s1, s2, count); + } + else if constexpr (AZStd::is_same_v) + { + return __builtin_wmemcmp(s1, s2, count); + } + else +#endif + { + if (az_builtin_is_constant_evaluated()) + { + for (; count; --count, ++s1, ++s2) { - if (lt(*s1, *s2)) - { - return -1; - } - else if (lt(*s2, *s1)) - { - return 1; - } - } - return 0; - } - else - { - return ::memcmp(s1, s2, count * sizeof(char_type)); - } - } + if (lt(*s1, *s2)) + { + return -1; + } + else if (lt(*s2, *s1)) + { + return 1; + } + } + return 0; + } + else + { + return ::memcmp(s1, s2, count * sizeof(char_type)); + } + } } static constexpr size_t length(const char_type* s) noexcept { // For GCC versions less than 10, __builtin_strlen and __builtin_wcslen is not supported as const expressions // so for that case it will need to manually count the characters (at compile time) instead -#if defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000 if constexpr (AZStd::is_same_v) { +#if defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000 if (!az_builtin_is_constant_evaluated()) { return strlen(s); } + else + { + size_t strLength{}; + for (; *s; ++s, ++strLength) + { + ; + } + return strLength; + } +#else + return __builtin_strlen(s); +#endif } else if constexpr (AZStd::is_same_v) { +#if defined(AZ_COMPILER_GCC) if (!az_builtin_is_constant_evaluated()) { return wcslen(s); } - } - - size_t strLength{}; - for (; *s; ++s, ++strLength) - { - ; - } - return strLength; + else + { + size_t strLength{}; + for (; *s; ++s, ++strLength) + { + ; + } + return strLength; + } #else - - if constexpr (AZStd::is_same_v) - { - return __builtin_strlen(s); - } - else if constexpr (AZStd::is_same_v) - { return __builtin_wcslen(s); +#endif } else { @@ -391,46 +400,59 @@ namespace AZStd } return strLength; } -#endif // defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000 + } static constexpr const char_type* find(const char_type* s, size_t count, const char_type& ch) noexcept { - // For GCC versions less than 10, __builtin_char_memchr and __builtin_wmemchr is not supported, and - // __builtin_memchr is not supported as const expressions. In those cases we will manually locate and + // For GCC versions less than 10, __builtin_char_memchr and __builtin_wmemchr is not supported, and + // __builtin_memchr is not supported as const expressions. In those cases we will manually locate and // return the pointer to 's' (at compile time) -#if defined(AZ_COMPILER_GCC) && AZ_COMPILER_GCC < 100000 if constexpr (AZStd::is_same_v) { +#if defined(AZ_COMPILER_GCC) if (!az_builtin_is_constant_evaluated()) { return static_cast(__builtin_memchr(s, ch, count)); } + else + { + for (; count; --count, ++s) + { + if (eq(*s, ch)) + { + return s; + } + } + + return nullptr; + } +#else + return __builtin_char_memchr(s, ch, count); +#endif // defined(AZ_COMPILER_GCC)AZ_COMPILER_GCC < 100000 } else if constexpr (AZStd::is_same_v) { +#if defined(AZ_COMPILER_GCC) if (!az_builtin_is_constant_evaluated()) { return wmemchr(s, ch, count); } - } - - for (; count; --count, ++s) - { - if (eq(*s, ch)) + else { - return s; + for (; count; --count, ++s) + { + if (eq(*s, ch)) + { + return s; + } + } + + return nullptr; } - } - return nullptr; #else - if constexpr (AZStd::is_same_v) - { - return __builtin_char_memchr(s, ch, count); - } - else if constexpr (AZStd::is_same_v) - { return __builtin_wmemchr(s, ch, count); +#endif } else { @@ -441,9 +463,9 @@ namespace AZStd return s; } } + return nullptr; } -#endif } static constexpr char_type* move(char_type* dest, const char_type* src, size_t count) noexcept { @@ -453,7 +475,7 @@ namespace AZStd return dest; } - #if az_has_builtin_memmove + #if !defined(AZ_COMPILER_GCC) && az_has_builtin_memmove __builtin_memmove(dest, src, count * sizeof(char_type)); #else auto NonBuiltinMove = [](char_type* dest1, const char_type* src1, size_t count1) constexpr @@ -506,7 +528,7 @@ namespace AZStd } static constexpr char_type* copy(char_type* dest, const char_type* src, size_t count) noexcept { - #if az_has_builtin_memcpy + #if !defined(AZ_COMPILER_GCC) && az_has_builtin_memcpy __builtin_memcpy(dest, src, count * sizeof(char_type)); #else auto NonBuiltinCopy = [](char_type* dest1, const char_type* src1, size_t count1) constexpr @@ -536,7 +558,7 @@ namespace AZStd static constexpr char_type* copy_backward(char_type* dest, const char_type* src, size_t count) noexcept { char_type* result = dest; - #if az_has_builtin_memmove + #if !defined(AZ_COMPILER_GCC) && az_has_builtin_memmove __builtin_memmove(dest, src, count * sizeof(char_type)); #else if (az_builtin_is_constant_evaluated()) diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp index 57884b304f..06536921d9 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp @@ -412,7 +412,7 @@ void ApplicationManager::PopulateApplicationDependencies() // Note that its not necessary for any of these files to actually exist. It is considered a "change" if they // change their file modtime, or if they go from existing to not existing, or if they go from not existing, to existing. // any of those should cause AP to drop. - for (const QString& pathName : { "CrySystem", + for (QString pathName : { "CrySystem", "SceneCore", "SceneData", "SceneBuilder", "AzQtComponents" }) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/ThreadLocalContext.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/ThreadLocalContext.h index 4d3534b845..d45c7bf93e 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/ThreadLocalContext.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/ThreadLocalContext.h @@ -19,7 +19,7 @@ namespace AZ { /** * This class is a container of thread local storage. It allows for multiple instances - * of thread local storage to exist simultaneously (a property not possible with the + * of thread local storage to exist simultaneously (a property not possible with the * thread_local modifier, which is really a thread global). The context tracks AZ thread * lifetime through a bus in order to clean up storage for exiting threads. The context * allows thread-safe iteration of all thread contexts, which is also a property not possible @@ -36,7 +36,11 @@ namespace AZ public: using InitFunction = AZStd::function; - ThreadLocalContext(InitFunction initFunction = [] (Storage&) {}); + static void DefaultFunction(Storage&) + { + } + + ThreadLocalContext(InitFunction initFunction = &DefaultFunction); ~ThreadLocalContext(); // No copying or moving allowed. From 9b8bebbd70d96282ca06fbf0b8e64e0afee2a4e0 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 12:21:43 -0800 Subject: [PATCH 285/394] Bumped the MaterialBuilder version number. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index cadb182d03..d55f202c03 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -52,7 +52,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 116; // more material dependency improvements + materialBuilderDescriptor.m_version = 117; // new material type file format materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); From 453808eb908c9f45970cc42a87d30f3cad523173 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 26 Jan 2022 14:30:13 -0600 Subject: [PATCH 286/394] Clipmap bounds class (#7134) * ClipmapBounds class - This class is built to keep track of textures for clipmap like structures where there is a virtual center point and the edges need to be updated as the camera moves around the world Signed-off-by: Ken Pruiksma * Removing dead code Signed-off-by: Ken Pruiksma * Updates from PR feedback. Signed-off-by: Ken Pruiksma * comment update Signed-off-by: Ken Pruiksma * Updates from review suggestions Signed-off-by: Ken Pruiksma * More updates. Moved the snapped center point calculation out to a separate function so the constructor doesn't need to do unnecessary work. Signed-off-by: Ken Pruiksma * Removing unused variable. Signed-off-by: Ken Pruiksma * Fixing bug in unit test that was doing a comparison and throwing away the result instead of actually testing it. Signed-off-by: Ken Pruiksma * Adding some comments and constifying some functions. Signed-off-by: Ken Pruiksma * Fixing numeric casting issue on linux Signed-off-by: Ken Pruiksma --- .../Code/Source/TerrainRenderer/Aabb2i.cpp | 32 +- .../Code/Source/TerrainRenderer/Aabb2i.h | 4 + .../Source/TerrainRenderer/ClipmapBounds.cpp | 278 +++++++++++++++ .../Source/TerrainRenderer/ClipmapBounds.h | 159 +++++++++ .../Code/Source/TerrainRenderer/Vector2i.cpp | 71 +++- .../Code/Source/TerrainRenderer/Vector2i.h | 14 +- .../Terrain/Code/Tests/ClipmapBoundsTests.cpp | 336 ++++++++++++++++++ Gems/Terrain/Code/terrain_files.cmake | 6 +- Gems/Terrain/Code/terrain_tests_files.cmake | 9 +- 9 files changed, 892 insertions(+), 17 deletions(-) create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h create mode 100644 Gems/Terrain/Code/Tests/ClipmapBoundsTests.cpp diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp index c38651f296..82d5a6bf2d 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp @@ -18,12 +18,40 @@ namespace Terrain Aabb2i Aabb2i::operator+(const Vector2i& rhs) const { - return { m_min + rhs, m_max + rhs }; + Aabb2i returnValue = *this; + returnValue += rhs; + return returnValue; + } + + Aabb2i& Aabb2i::operator+=(const Vector2i& rhs) + { + m_min += rhs; + m_max += rhs; + return *this; } Aabb2i Aabb2i::operator-(const Vector2i& rhs) const { - return *this + -rhs; + Aabb2i returnValue = *this; + returnValue -= rhs; + return returnValue; + } + + Aabb2i& Aabb2i::operator-=(const Vector2i& rhs) + { + m_min -= rhs; + m_max -= rhs; + return *this; + } + + bool Aabb2i::operator==(const Aabb2i& other) const + { + return m_min == other.m_min && m_max == other.m_max; + } + + bool Aabb2i::operator!=(const Aabb2i& other) const + { + return !(*this == other); } Aabb2i Aabb2i::GetClamped(Aabb2i rhs) const diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h index 88f735564d..3d350c8c3a 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h @@ -21,7 +21,11 @@ namespace Terrain Aabb2i(const Vector2i& min, const Vector2i& max); Aabb2i operator+(const Vector2i& offset) const; + Aabb2i& operator+=(const Vector2i& offset); Aabb2i operator-(const Vector2i& offset) const; + Aabb2i& operator-=(const Vector2i& offset); + bool operator==(const Aabb2i& other) const; + bool operator!=(const Aabb2i& other) const; Aabb2i GetClamped(Aabb2i rhs) const; bool IsValid() const; diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.cpp new file mode 100644 index 0000000000..29cc853328 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.cpp @@ -0,0 +1,278 @@ +/* + * 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 Terrain +{ + bool ClipmapBoundsRegion::operator==(const ClipmapBoundsRegion& other) const + { + return m_localAabb == other.m_localAabb && m_worldAabb.IsClose(other.m_worldAabb); + } + + bool ClipmapBoundsRegion::operator!=(const ClipmapBoundsRegion& other) const + { + return !(*this == other); + } + + ClipmapBounds::ClipmapBounds(const ClipmapBoundsDescriptor& desc) + : m_size(desc.m_size) + , m_halfSize(desc.m_size >> 1) + , m_clipmapUpdateMultiple(AZ::GetMax(desc.m_clipmapUpdateMultiple, 1)) + , m_scale(desc.m_clipToWorldScale) + , m_rcpScale(1.0f / desc.m_clipToWorldScale) + { + AZ_Error("ClipmapBounds", m_scale > 0.0f, "ClipmapBounds should have a scale that is greater than 0.0f."); + m_scale = AZ::GetMax(m_scale, AZ::Constants::FloatEpsilon); + + // recalculate m_center + m_center = GetSnappedCenter(GetClipSpaceVector(desc.m_worldSpaceCenter)); + } + + auto ClipmapBounds::UpdateCenter(const AZ::Vector2& newCenter, AZ::Aabb* untouchedRegion) -> ClipmapBoundsRegionList + { + return UpdateCenter(GetClipSpaceVector(newCenter), untouchedRegion); + } + + auto ClipmapBounds::UpdateCenter(const Vector2i& newCenter, AZ::Aabb* untouchedRegion) -> ClipmapBoundsRegionList + { + AZStd::vector updateRegions; + + // If the new snapped center isn't the same as the old, then generate update regions in clipmap space + Vector2i updatedCenter = GetSnappedCenter(newCenter); + + int32_t xDiff = updatedCenter.m_x - m_center.m_x; + int32_t updateWidth = AZStd::GetMin(abs(xDiff), m_size); + + /* + Calculate the update regions. In the common case, there will be two update regions that form either + an L or inverted L shape. To avoid double-counting the corner, it is always put in the vertical box: + _ + | | + | |____ + |_|____| + + */ + + // Calculate the vertical box + if (updatedCenter.m_x != m_center.m_x) + { + updateRegions.push_back(); + Aabb2i& updateRegion = updateRegions.back(); + + if (updatedCenter.m_x < m_center.m_x) + { + updateRegion.m_min.m_x = updatedCenter.m_x - m_halfSize; + updateRegion.m_max.m_x = updateRegion.m_min.m_x + updateWidth; + } + else + { + updateRegion.m_max.m_x = updatedCenter.m_x + m_halfSize; + updateRegion.m_min.m_x = updateRegion.m_max.m_x - updateWidth; + } + updateRegion.m_min.m_y = updatedCenter.m_y - m_halfSize; + updateRegion.m_max.m_y = updatedCenter.m_y + m_halfSize; + } + + // Calculate the horizontal box + if (updatedCenter.m_y != m_center.m_y && updateWidth < m_size) + { + updateRegions.push_back(); + Aabb2i& updateRegion = updateRegions.back(); + + uint32_t updateHeight = AZStd::GetMin(abs(updatedCenter.m_y - m_center.m_y), m_size); + if (updatedCenter.m_y < m_center.m_y) + { + updateRegion.m_min.m_y = updatedCenter.m_y - m_halfSize; + updateRegion.m_max.m_y = updateRegion.m_min.m_y + updateHeight; + } + else + { + updateRegion.m_max.m_y = updatedCenter.m_y + m_halfSize; + updateRegion.m_min.m_y = updateRegion.m_max.m_y - updateHeight; + } + + // If there was a vertical box, then don't double-count the corner of the update. + if (xDiff < 0) + { + updateRegion.m_min.m_x = updatedCenter.m_x - m_halfSize + updateWidth; + updateRegion.m_max.m_x = updatedCenter.m_x + m_halfSize; + } + else if (xDiff > 0) + { + updateRegion.m_min.m_x = updatedCenter.m_x - m_halfSize; + updateRegion.m_max.m_x = updatedCenter.m_x + m_halfSize - updateWidth; + } + } + + if (untouchedRegion) + { + // Default to the entire area being untouched. + AZ::Aabb worldBounds = GetWorldBounds(); + float maxX = worldBounds.GetMax().GetX(); + float minX = worldBounds.GetMin().GetX(); + float maxY = worldBounds.GetMax().GetY(); + float minY = worldBounds.GetMin().GetY(); + + if (updatedCenter.m_x < m_center.m_x) + { + maxX = (updatedCenter.m_x + m_halfSize) * m_rcpScale; + } + else if (updatedCenter.m_x > m_center.m_x) + { + minX = (updatedCenter.m_x - m_halfSize) * m_rcpScale; + } + if (updatedCenter.m_y < m_center.m_y) + { + maxY = (updatedCenter.m_y + m_halfSize) * m_rcpScale; + } + else if (updatedCenter.m_y > m_center.m_y) + { + minY = (updatedCenter.m_y - m_halfSize) * m_rcpScale; + } + + untouchedRegion->Set(AZ::Vector3(minX, minY, 0.0f), AZ::Vector3(maxX, maxY, 0.0f)); + } + + m_center = updatedCenter; + + m_modCenter.m_x = (m_size + (m_center.m_x % m_size)) % m_size; + m_modCenter.m_y = (m_size + (m_center.m_y % m_size)) % m_size; + + ClipmapBoundsRegionList boundsUpdate; + for (Aabb2i& updateRegion : updateRegions) + { + ClipmapBoundsRegionList update = TransformRegion(updateRegion); + boundsUpdate.insert(boundsUpdate.end(), update.begin(), update.end()); + } + + return boundsUpdate; + } + + auto ClipmapBounds::TransformRegion(AZ::Aabb worldSpaceRegion) -> ClipmapBoundsRegionList + { + AZ::Vector2 worldMin = AZ::Vector2(worldSpaceRegion.GetMin().GetX(), worldSpaceRegion.GetMin().GetY()); + AZ::Vector2 worldMax = AZ::Vector2(worldSpaceRegion.GetMax().GetX(), worldSpaceRegion.GetMax().GetY()); + + Aabb2i clipSpaceRegion; + clipSpaceRegion.m_min = GetClipSpaceVector(worldMin); + clipSpaceRegion.m_max = GetClipSpaceVector(worldMax); + + return TransformRegion(clipSpaceRegion); + } + + auto ClipmapBounds::TransformRegion(Aabb2i region) -> ClipmapBoundsRegionList + { + ClipmapBoundsRegionList transformedRegions; + + Aabb2i clampedRegion = region.GetClamped(GetLocalBounds()); + if (!clampedRegion.IsValid()) + { + // Early out if the region is outside the bounds + return transformedRegions; + } + + Vector2i minCorner = m_center - m_halfSize; + + Vector2i minBoundary; + minBoundary.m_x = (minCorner.m_x / m_size - (minCorner.m_x < 0 ? 1 : 0)) * m_size; + minBoundary.m_y = (minCorner.m_y / m_size - (minCorner.m_y < 0 ? 1 : 0)) * m_size; + + Aabb2i bottomLeftTile = Aabb2i(minBoundary, minBoundary + m_size); + + // For each of the 4 quadrants: + auto calculateQuadrant = [&](Aabb2i tile) + { + Aabb2i regionClampedToTile = clampedRegion.GetClamped(tile); + if (regionClampedToTile.IsValid()) + { + transformedRegions.push_back( + ClipmapBoundsRegion({ + GetWorldSpaceAabb(regionClampedToTile), + regionClampedToTile - tile.m_min + }) + ); + } + }; + + calculateQuadrant(bottomLeftTile); + calculateQuadrant(bottomLeftTile + Vector2i(m_size, 0)); + calculateQuadrant(bottomLeftTile + Vector2i(0, m_size)); + calculateQuadrant(bottomLeftTile + Vector2i(m_size, m_size)); + + return transformedRegions; + } + + AZ::Aabb ClipmapBounds::GetWorldBounds() const + { + Aabb2i localBounds = GetLocalBounds(); + + return AZ::Aabb::CreateFromMinMaxValues( + localBounds.m_min.m_x * m_scale, localBounds.m_min.m_y * m_scale, 0.0f, + localBounds.m_max.m_x * m_scale, localBounds.m_max.m_y * m_scale, 0.0f); + } + + float ClipmapBounds::GetWorldSpaceSafeDistance() const + { + return (m_halfSize - m_clipmapUpdateMultiple) * m_scale; + } + + Vector2i ClipmapBounds::GetSnappedCenter(const Vector2i& center) + { + Vector2i updatedCenter = m_center; + + // Update the snapped center if the new center has drifted beyond the margin + auto UpdateDim = [&](int32_t centerDim, int32_t& snappedCenterDim) -> void + { + int32_t diff = centerDim - snappedCenterDim; + + int32_t scaledCenterDim = (centerDim / m_clipmapUpdateMultiple); + if (centerDim < 0) + { + // Force rounding down for negatives + scaledCenterDim--; + } + + if (diff >= m_clipmapUpdateMultiple) + { + snappedCenterDim = scaledCenterDim * m_clipmapUpdateMultiple; + } + if (diff < -m_clipmapUpdateMultiple) + { + snappedCenterDim = (scaledCenterDim + 1) * m_clipmapUpdateMultiple; + } + }; + UpdateDim(center.m_x, updatedCenter.m_x); + UpdateDim(center.m_y, updatedCenter.m_y); + + return updatedCenter; + } + + Aabb2i ClipmapBounds::GetLocalBounds() const + { + return Aabb2i(m_center - m_halfSize, m_center + m_halfSize); + } + + Vector2i ClipmapBounds::GetClipSpaceVector(const AZ::Vector2& worldSpaceVector) const + { + // Get rounded integer x/y coords in clipmap space. + int32_t x = AZStd::lround(worldSpaceVector.GetX() * m_rcpScale); + int32_t y = AZStd::lround(worldSpaceVector.GetY() * m_rcpScale); + return Vector2i(x, y); + } + + AZ::Aabb ClipmapBounds::GetWorldSpaceAabb(const Aabb2i& clipSpaceAabb) const + { + return AZ::Aabb::CreateFromMinMaxValues( + clipSpaceAabb.m_min.m_x * m_scale, clipSpaceAabb.m_min.m_y * m_scale, 0.0f, + clipSpaceAabb.m_max.m_x * m_scale, clipSpaceAabb.m_max.m_y * m_scale, 0.0f + ); + } +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h b/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h new file mode 100644 index 0000000000..1aac4d8c9e --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h @@ -0,0 +1,159 @@ +/* + * 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 +#include +#include +#include +#include + +namespace Terrain +{ + + struct ClipmapBoundsDescriptor + { + //! Width and height of the clipmap in texels. + uint32_t m_size = 1024; + + //! Current center location of the clipmap in world space + AZ::Vector2 m_worldSpaceCenter = AZ::Vector2::CreateZero(); + + // Updates to the clipmap will be produced in multiples of this value. This + // allows for larger but less frequent updates, and gives some wiggle room + // for each movement before an update is triggered. + // Note: This also means that whatever uses this clipmap should only ever + // display m_size - (2 * m_clipmapUpdateMultiple) pixels from the clipmap. + // Use GetWorldSpaceSafeDistance() to get the safe distance from center. + uint32_t m_clipmapUpdateMultiple = 4; + + //! Scale of the clip map compared to the world. A scale of 0.5 means that + //! a clipmap of size 1024 would cover 512 meters. + float m_clipToWorldScale = 1.0f; + }; + + struct ClipmapBoundsRegion + { + //! The world bounds of the updated region. Z is ignored. + AZ::Aabb m_worldAabb; + + //! The clipmaps bounds of the updated region. Will always be between 0 and size. + //! Min inclusive, max exclusive. + Aabb2i m_localAabb; + + bool operator==(const ClipmapBoundsRegion& other) const; + bool operator!=(const ClipmapBoundsRegion& other) const; + }; + + // This class manages a single clipmap region. A clipmap is a virtual view into a much larger + // region, where the clipmap view is centered around a point like the current camera position. + // The clipmap texture wraps to form a repeating grid and never moves, but only data within + // the clipmap bounds is actually valid. This makes looking up data in the clipmap trivial + // since it's just the world coordinate scaled by some amount. This technique also allows for + // only the edge areas of the clipmap to be updated as the center point moves around the world. + // + // The edges of the clipmap bounds will typically run through the texture, dividing it into 4 + // regions, except in cases where the clipmap bounds happen to be aligned with the underlying + // grid. This means whenever some bounding box needs to be updated in the clipmap, it may actually + // translate to 4 different areas of the underlying texture - one for each quadrant. + // + // This class aids in figuring out which areas of a clipmap need to be updated as its center point + // moves around in the world, and can map a single region that needs to be updated into several + // separate regions for each quadrant. + + /* + ___________________________ + | | | | | Clipmap Clipmap + | | | | | Bounds Texture (Tiled) + |______|______|______|______| ______ ______ + | | _|____ | | | | | |____|_| + | | | | | | | |_|_*__| | | | + |______|____|_|_*__|_|______| |_|____| |_*__|_| + | | |_|____| | | + | | | | | + |______|______|______|______| + | | | | | + | | | | | + |______|______|______|______| + + */ + + class ClipmapBounds + { + public: + + explicit ClipmapBounds(const ClipmapBoundsDescriptor& desc); + ~ClipmapBounds() = default; + + using ClipmapBoundsRegionList = AZStd::vector; + + //! Updates the clipmap bounds using a world coordinate center position and returns + //! 0-2 regions that need to be updated due to moving beyond the margins. These update + //! regions will always be at least the size of the margin, and will represent horizontal + //! and/or vertical strips along the edges of the clipmap. An optional untouched region + //! aabb can be passed to this function to get an aabb of areas inside the bounds of the + //! clipmap but not updated by the center moving. This can be useful in cases where part + //! of the bounds of the clipmap is dirty, but areas that will already be updated due + //! to the center moving shouldn't be updated twice. + ClipmapBoundsRegionList UpdateCenter(const AZ::Vector2& newCenter, AZ::Aabb* untouchedRegion = nullptr); + + //! Updates the clipmap bounds using a position in clipmap space (no scaling) and returns + //! 0-2 regions that need to be updated due to moving beyond the margins. These update + //! regions will always be at least the size of the margin, and will represent horizontal + //! and/or vertical strips along the edges of the clipmap. An optional untouched region + //! aabb can be passed to this function to get an aabb of areas inside the bounds of the + //! clipmap but not updated by the center moving. This can be useful in cases where part + //! of the bounds of the clipmap is dirty, but areas that will already be updated due + //! to the center moving shouldn't be updated twice. + ClipmapBoundsRegionList UpdateCenter(const Vector2i& newCenter, AZ::Aabb* untouchedRegion = nullptr); + + //! Takes in a single world space region and transforms it into 0-4 regions in the clipmap clamped + //! to the bounds of the clipmap. + ClipmapBoundsRegionList TransformRegion(AZ::Aabb worldSpaceRegion); + + //! Takes in a single unscaled clipmap space region and transforms it into 0-4 regions in the clipmap clamped + //! to the bounds of the clipmap. + ClipmapBoundsRegionList TransformRegion(Aabb2i clipSpaceRegion); + + //! Returns the bounds covered by this clipmap in world space. Z component is always 0. + AZ::Aabb GetWorldBounds() const; + + //! Returns the safe x and y distance from the center in world space. This is based on the scale, + //! clipmap size, and m_clipmapUpdateMultiple. For example, a clipmap size 1024 with scale + //! 0.25 and margin of 4 would have a safe distance of (1024 * 0.5 - 4) * 0.25 = 127.0f. + float GetWorldSpaceSafeDistance() const; + + private: + + //! Returns the center point snapped to a multiple of m_clipmapUpdateMultiple. This isn't + //! a simple rounding operation. The value returned will only be different from the curernt + //! center if the value passed in is greater than m_clipmapUpdateMultiple away from the center. + Vector2i GetSnappedCenter(const Vector2i& center); + + //! Returns the bounds covered by the clipmap in local space + Aabb2i GetLocalBounds() const; + + //! Applies scale and averages a world space vector to get a clip space vector. + Vector2i GetClipSpaceVector(const AZ::Vector2& worldSpaceVector) const; + + //! Applies inverse scale to get a world aabb from clip space aabb. + AZ::Aabb GetWorldSpaceAabb(const Aabb2i& clipSpaceAabb) const; + + Vector2i m_center; + Vector2i m_modCenter; + int32_t m_size; + int32_t m_halfSize; + int32_t m_clipmapUpdateMultiple; + float m_scale; + float m_rcpScale; + + }; + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp index 1df945b88c..058b9ae76f 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp @@ -7,35 +7,90 @@ */ #include +#include namespace Terrain { - auto Vector2i::operator+(const Vector2i& rhs) const -> Vector2i + + Vector2i::Vector2i(int32_t x, int32_t y) + : m_x(x) + , m_y(y) + {} + + Vector2i::Vector2i(uint32_t value) + : m_x(aznumeric_cast(value)) + , m_y(aznumeric_cast(value)) + {} + + Vector2i::Vector2i(int32_t value) + : m_x(value) + , m_y(value) + {} + + Vector2i Vector2i::operator+(const Vector2i& rhs) const { - Vector2i offsetPoint = *this; - offsetPoint += rhs; - return offsetPoint; + Vector2i returnPoint = *this; + returnPoint += rhs; + return returnPoint; } - auto Vector2i::operator+=(const Vector2i& rhs) -> Vector2i& + Vector2i& Vector2i::operator+=(const Vector2i& rhs) { m_x += rhs.m_x; m_y += rhs.m_y; return *this; } - auto Vector2i::operator-(const Vector2i& rhs) const -> Vector2i + Vector2i Vector2i::operator-(const Vector2i& rhs) const { return *this + -rhs; } - auto Vector2i::operator-=(const Vector2i& rhs) -> Vector2i& + Vector2i& Vector2i::operator-=(const Vector2i& rhs) { return *this += -rhs; } - auto Vector2i::operator-() const -> Vector2i + Vector2i Vector2i::operator-() const { return {-m_x, -m_y}; } + + Vector2i Vector2i::operator*(const Vector2i& rhs) const + { + Vector2i returnPoint = *this; + returnPoint *= rhs; + return returnPoint; + } + + Vector2i& Vector2i::operator*=(const Vector2i& rhs) + { + m_x *= rhs.m_x; + m_y *= rhs.m_y; + return *this; + } + + Vector2i Vector2i::operator/(const Vector2i& rhs) const + { + Vector2i returnPoint = *this; + returnPoint /= rhs; + return returnPoint; + } + + Vector2i& Vector2i::operator/=(const Vector2i& rhs) + { + m_x /= rhs.m_x; + m_y /= rhs.m_y; + return *this; + } + + bool Vector2i::operator==(const Vector2i& rhs) const + { + return rhs.m_x == m_x && rhs.m_y == m_y; + } + + bool Vector2i::operator!=(const Vector2i& rhs) const + { + return !(*this == rhs); + } } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h index 1244972fe9..a7c598a91f 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h @@ -16,14 +16,26 @@ namespace Terrain { public: + Vector2i() = default; + Vector2i(int32_t x, int32_t y); + Vector2i(uint32_t value); + Vector2i(int32_t value); + Vector2i operator+(const Vector2i& rhs) const; Vector2i& operator+=(const Vector2i& rhs); Vector2i operator-(const Vector2i& rhs) const; Vector2i& operator-=(const Vector2i& rhs); Vector2i operator-() const; + Vector2i operator*(const Vector2i& rhs) const; + Vector2i& operator*=(const Vector2i& rhs); + Vector2i operator/(const Vector2i& rhs) const; + Vector2i& operator/=(const Vector2i& rhs); + + bool operator==(const Vector2i& rhs) const; + bool operator!=(const Vector2i& rhs) const; + int32_t m_x{ 0 }; int32_t m_y{ 0 }; - }; } diff --git a/Gems/Terrain/Code/Tests/ClipmapBoundsTests.cpp b/Gems/Terrain/Code/Tests/ClipmapBoundsTests.cpp new file mode 100644 index 0000000000..9b09deb8f5 --- /dev/null +++ b/Gems/Terrain/Code/Tests/ClipmapBoundsTests.cpp @@ -0,0 +1,336 @@ +/* + * 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 + +#include +#include + +namespace UnitTest +{ + class ClipmapBoundsTests + : public UnitTest::AllocatorsTestFixture + { + public: + void CheckTransformRegionFullBounds(const Terrain::ClipmapBoundsDescriptor& desc); + }; + + void ClipmapBoundsTests::CheckTransformRegionFullBounds(const Terrain::ClipmapBoundsDescriptor& desc) + { + Terrain::ClipmapBounds bounds(desc); + + AZ::Aabb worldBounds = bounds.GetWorldBounds(); + float worldBoundsSize = worldBounds.GetXExtent(); + + auto output = bounds.TransformRegion(worldBounds); + ASSERT_EQ(output.size(), 4); + + AZ::Vector2 boundary = AZ::Vector2( + floorf(worldBounds.GetMax().GetX() / worldBoundsSize), + floorf(worldBounds.GetMax().GetY() / worldBoundsSize) + ) * worldBoundsSize; + + Terrain::Vector2i localMax = { + aznumeric_cast(AZStd::lround(desc.m_worldSpaceCenter.GetX() / desc.m_clipToWorldScale)), + aznumeric_cast(AZStd::lround(desc.m_worldSpaceCenter.GetY() / desc.m_clipToWorldScale)) + }; + localMax += aznumeric_cast(desc.m_size / 2ul); + + int32_t intSize = int32_t(desc.m_size); + Terrain::Vector2i localBoundary = { + ((localMax.m_x % intSize) + intSize) % intSize, + ((localMax.m_y % intSize) + intSize) % intSize + }; + + // Check each quadrant returned + AZStd::vector expected; + expected.resize(4); + + expected.at(0).m_localAabb = Terrain::Aabb2i({localBoundary.m_x, localBoundary.m_y}, {intSize, intSize}); + expected.at(0).m_worldAabb = AZ::Aabb::CreateFromMinMaxValues( + worldBounds.GetMin().GetX(), worldBounds.GetMin().GetY(), 0.0f, + boundary.GetX(), boundary.GetY(), 0.0f); + + expected.at(1).m_localAabb = Terrain::Aabb2i({0, localBoundary.m_y}, {localBoundary.m_x, intSize}); + expected.at(1).m_worldAabb = AZ::Aabb::CreateFromMinMaxValues( + boundary.GetX(), worldBounds.GetMin().GetY(), 0.0f, + worldBounds.GetMax().GetX(), boundary.GetY(), 0.0f); + + expected.at(2).m_localAabb = Terrain::Aabb2i({localBoundary.m_x, 0}, {intSize, localBoundary.m_y}); + expected.at(2).m_worldAabb = AZ::Aabb::CreateFromMinMaxValues( + worldBounds.GetMin().GetX(), boundary.GetY(), 0.0f, + boundary.GetX(), worldBounds.GetMax().GetY(), 0.0f); + + expected.at(3).m_localAabb = Terrain::Aabb2i({ 0, 0 }, { localBoundary.m_x, localBoundary.m_y }); + expected.at(3).m_worldAabb = AZ::Aabb::CreateFromMinMaxValues( + boundary.GetX(), boundary.GetY(), 0.0f, + worldBounds.GetMax().GetX(), worldBounds.GetMax().GetY(), 0.0f); + + EXPECT_THAT(output, ::testing::UnorderedElementsAreArray(expected)); + } + + TEST_F(ClipmapBoundsTests, Construction) + { + Terrain::ClipmapBoundsDescriptor desc; + Terrain::ClipmapBounds bounds(desc); + } + + TEST_F(ClipmapBoundsTests, BasicTransform) + { + // Create clipmap around 0.0, so it's perfectly divided into 4 quadrants + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(0.0f, 0.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 1.0f; + desc.m_size = 1024; + Terrain::ClipmapBounds bounds(desc); + + auto output = bounds.TransformRegion(AZ::Aabb::CreateFromMinMaxValues(-512.0f, -512.0f, 0.0f, 512.0f, 512.0f, 0.0f)); + + ASSERT_EQ(output.size(), 4); + + // Check each quadrant returned + EXPECT_EQ(output.at(0).m_localAabb, Terrain::Aabb2i({512, 512}, {1024, 1024})); + EXPECT_TRUE(output.at(0).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(-512.0f, -512.0f, 0.0f, 0.0f, 0.0f, 0.0f))); + EXPECT_EQ(output.at(1).m_localAabb, Terrain::Aabb2i({0, 512}, {512, 1024})); + EXPECT_TRUE(output.at(1).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(0.0f, -512.0f, 0.0f, 512.0f, 0.0f, 0.0f))); + EXPECT_EQ(output.at(2).m_localAabb, Terrain::Aabb2i({512, 0}, {1024, 512})); + EXPECT_TRUE(output.at(2).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(-512.0f, 0.0f, 0.0f, 0.0f, 512.0f, 0.0f))); + EXPECT_EQ(output.at(3).m_localAabb, Terrain::Aabb2i({0, 0}, {512, 512})); + EXPECT_TRUE(output.at(3).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(0.0f, 0.0f, 0.0f, 512.0f, 512.0f, 0.0f))); + } + + TEST_F(ClipmapBoundsTests, ScaledTransform) + { + // Create clipmap around 0.0, so it's perfectly divided into 4 quadrants, but half-scale + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(0.0f, 0.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 0.5f; + desc.m_size = 1024; + Terrain::ClipmapBounds bounds(desc); + + auto output = bounds.TransformRegion(AZ::Aabb::CreateFromMinMaxValues(-256.0f, -256.0f, 0.0f, 256.0f, 256.0f, 0.0f)); + + ASSERT_EQ(output.size(), 4); + + // Check each quadrant returned + EXPECT_EQ(output.at(0).m_localAabb, Terrain::Aabb2i({512, 512}, {1024, 1024})); + EXPECT_TRUE(output.at(0).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(-256.0f, -256.0f, 0.0f, 0.0f, 0.0f, 0.0f))); + EXPECT_EQ(output.at(1).m_localAabb, Terrain::Aabb2i({0, 512}, {512, 1024})); + EXPECT_TRUE(output.at(1).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(0.0f, -256.0f, 0.0f, 256.0f, 0.0f, 0.0f))); + EXPECT_EQ(output.at(2).m_localAabb, Terrain::Aabb2i({512, 0}, {1024, 512})); + EXPECT_TRUE(output.at(2).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(-256.0f, 0.0f, 0.0f, 0.0f, 256.0f, 0.0f))); + EXPECT_EQ(output.at(3).m_localAabb, Terrain::Aabb2i({0, 0}, {512, 512})); + EXPECT_TRUE(output.at(3).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(0.0f, 0.0f, 0.0f, 256.0f, 256.0f, 0.0f))); + } + + TEST_F(ClipmapBoundsTests, ComplexTransformsFullBounds) + { + // Check 4 different clipmaps - one in completely positive space, one in negative space, and two straddling the axis + + // Clipmap in negative space + { + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(-1234.0f, -5432.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 0.75f; + desc.m_size = 512; + CheckTransformRegionFullBounds(desc); + } + + // Clipmap in positive space + { + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(1234.0f, 5432.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 1.25f; + desc.m_size = 1024; + CheckTransformRegionFullBounds(desc); + } + + // Clipmap on x axis + { + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(1234.0f, -100.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 1.5f; + desc.m_size = 256; + CheckTransformRegionFullBounds(desc); + } + // Clipmap on y axis + { + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(-100.0f, 5432.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 1.0f; + desc.m_size = 2048; + CheckTransformRegionFullBounds(desc); + } + } + + TEST_F(ClipmapBoundsTests, TransformSmallBounds) + { + // Create clipmap around 0.0, so it's perfectly divided into 4 quadrants + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(0.0f, 0.0f); + desc.m_clipmapUpdateMultiple = 0; + desc.m_clipToWorldScale = 1.0f; + desc.m_size = 1024; + Terrain::ClipmapBounds bounds(desc); + + { + // Single quadrant positive + + AZ::Aabb smallArea = AZ::Aabb::CreateFromMinMaxValues( + 10.0f, 10.0f, 0.0f, 50.0f, 50.0f, 0.0f + ); + + auto output = bounds.TransformRegion(smallArea); + + ASSERT_EQ(output.size(), 1); + EXPECT_EQ(output.at(0).m_localAabb, Terrain::Aabb2i({10, 10}, {50, 50})); + EXPECT_TRUE(output.at(0).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(10.0f, 10.0f, 0.0f, 50.0f, 50.0f, 0.0f))); + } + + { + // Single quadrant negative + + AZ::Aabb smallArea = AZ::Aabb::CreateFromMinMaxValues( + -50.0f, -50.0f, 0.0f, -10.0f, -10.0f, 0.0f + ); + + auto output = bounds.TransformRegion(smallArea); + + ASSERT_EQ(output.size(), 1); + EXPECT_EQ(output.at(0).m_localAabb, Terrain::Aabb2i({974, 974}, {1014, 1014})); + EXPECT_TRUE(output.at(0).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(-50.0f, -50.0f, 0.0f, -10.0f, -10.0f, 0.0f))); + } + + { + // 2 quadrant positive + + AZ::Aabb smallArea = AZ::Aabb::CreateFromMinMaxValues( + 10.0f, -10.0f, 0.0f, 50.0f, 50.0f, 0.0f + ); + + auto output = bounds.TransformRegion(smallArea); + + ASSERT_EQ(output.size(), 2); + EXPECT_EQ(output.at(0).m_localAabb, Terrain::Aabb2i({10, 1014}, {50, 1024})); + EXPECT_TRUE(output.at(0).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(10.0f, -10.0f, 0.0f, 50.0f, 0.0f, 0.0f))); + EXPECT_EQ(output.at(1).m_localAabb, Terrain::Aabb2i({10, 0}, {50, 50})); + EXPECT_TRUE(output.at(1).m_worldAabb.IsClose(AZ::Aabb::CreateFromMinMaxValues(10.0f, 0.0f, 0.0f, 50.0f, 50.0f, 0.0f))); + } + } + + TEST_F(ClipmapBoundsTests, MarginReducesUpdates) + { + // With a margin defined, the bounds should only trigger updates when the camera moves outside the margins + + // Create clipmap around 0.0, so it's perfectly divided into 4 quadrants + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(0.0f, 0.0f); + desc.m_clipmapUpdateMultiple = 16; + desc.m_clipToWorldScale = 1.0f; + desc.m_size = 1024; + Terrain::ClipmapBounds bounds(desc); + + // center moved forward to 10, still within margin + auto output1 = bounds.UpdateCenter(AZ::Vector2(10.0f, 10.0f)); + EXPECT_EQ(output1.size(), 0); + // center moved forwrd to 20, beyond margin, triggers update + auto output2 = bounds.UpdateCenter(AZ::Vector2(20.0f, 20.0f)); + EXPECT_GT(output2.size(), 0); + // center moved back to 10, still within margin + auto output3 = bounds.UpdateCenter(AZ::Vector2(10.0f, 10.0f)); + EXPECT_EQ(output3.size(), 0); + // center moved back to 0, still within margin (on edge) + auto output4 = bounds.UpdateCenter(AZ::Vector2(0.0f, 0.0f)); + EXPECT_EQ(output4.size(), 0); + // center moved back to -10, beyond margin, triggers update + auto output5 = bounds.UpdateCenter(AZ::Vector2(-10.0f, -10.0f)); + EXPECT_GT(output5.size(), 0); + } + + TEST_F(ClipmapBoundsTests, CenterMovementUpdates) + { + // Create clipmap around 0.0, so it's perfectly divided into 4 quadrants + Terrain::ClipmapBoundsDescriptor desc; + desc.m_worldSpaceCenter = AZ::Vector2(0.0f, 0.0f); + desc.m_clipmapUpdateMultiple = 16; + desc.m_clipToWorldScale = 1.0f; + desc.m_size = 1024; + Terrain::ClipmapBounds bounds(desc); + + { + AZ::Aabb untouchedRegion = AZ::Aabb::CreateNull(); + auto output = bounds.UpdateCenter(AZ::Vector2(20.0f, 20.0f), &untouchedRegion); + ASSERT_EQ(output.size(), 4); + + // Instead of checking bounds directly, do several checks to make sure the bounds are appropriate. Since + // the center moved just outside the margin along the diagonal, we should expect two edges to be updated + // that are the width of the margin. + + // 1. The number of pixels updated in the bounds should be two sides of margin width + float pixelsCovered = 0; + for (auto& region : output) + { + // Note: GetSurfaceArea() returns the area of all 6 sides of the aabb. With a Z extent of 0, that + // means that only the top and bottom will be counted, so we need to multiply by 0.5. + pixelsCovered += region.m_worldAabb.GetSurfaceArea() * 0.5f; + } + + // Two edges of margin * size, minus the overlap in the corner. + const uint32_t updateMultiple = desc.m_clipmapUpdateMultiple; + float expectedCoverage = updateMultiple * desc.m_size * 2.0f - updateMultiple * updateMultiple; + EXPECT_NEAR(pixelsCovered, expectedCoverage, 0.0001f); + + // 2. The untouched region area should match what's expected + float untouchedRegionArea = untouchedRegion.GetSurfaceArea() * 0.5f; + float expectedUntouchedRegionSide = aznumeric_cast(desc.m_size - desc.m_clipmapUpdateMultiple); + float expectedUntouchedRegionArea = expectedUntouchedRegionSide * expectedUntouchedRegionSide; + EXPECT_NEAR(untouchedRegionArea, expectedUntouchedRegionArea, 0.0001f); + + // 3. All of the update regions should be inside the world bounds of the clipmap + AZ::Aabb worldBounds = bounds.GetWorldBounds(); + for (auto& region : output) + { + EXPECT_EQ(region.m_worldAabb.GetClamped(worldBounds), region.m_worldAabb); + } + + // 4. The untouched region should also be inside the world bounds of the clipmap; + EXPECT_EQ(untouchedRegion.GetClamped(worldBounds), untouchedRegion); + + // 5. None of the update regions should overlap each other or the untouched region + + // push the untouched region on the vector to make comparisons easier + output.push_back(Terrain::ClipmapBoundsRegion({untouchedRegion, Terrain::Aabb2i({}) })); + for (uint32_t i = 0; i < output.size(); ++i) + { + const AZ::Aabb boundsToCheck = output.at(i).m_worldAabb; + for (uint32_t j = i + 1; j < output.size(); ++j) + { + // AZ::Aabb::Overlaps() counts touching edges as overlapping, so we need a strict version + auto strictOverlaps = [](const AZ::Aabb& aabb1, const AZ::Aabb& aabb2) -> bool + { + return aabb1.GetMin().IsLessThan(aabb2.GetMax()) && + aabb1.GetMax().IsGreaterThan(aabb2.GetMin()); + }; + EXPECT_FALSE(strictOverlaps(boundsToCheck, output.at(j).m_worldAabb)); + } + } + + } + + } +} diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index 4b994c2587..53a7c6ac6d 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -35,6 +35,10 @@ set(FILES Source/TerrainRenderer/Components/TerrainMacroMaterialComponent.h Source/TerrainRenderer/Aabb2i.cpp Source/TerrainRenderer/Aabb2i.h + Source/TerrainRenderer/BindlessImageArrayHandler.cpp + Source/TerrainRenderer/BindlessImageArrayHandler.h + Source/TerrainRenderer/ClipmapBounds.cpp + Source/TerrainRenderer/ClipmapBounds.h Source/TerrainRenderer/TerrainFeatureProcessor.cpp Source/TerrainRenderer/TerrainFeatureProcessor.h Source/TerrainRenderer/TerrainDetailMaterialManager.cpp @@ -43,8 +47,6 @@ set(FILES Source/TerrainRenderer/TerrainMacroMaterialManager.h Source/TerrainRenderer/TerrainMeshManager.cpp Source/TerrainRenderer/TerrainMeshManager.h - Source/TerrainRenderer/BindlessImageArrayHandler.cpp - Source/TerrainRenderer/BindlessImageArrayHandler.h Source/TerrainRenderer/TerrainAreaMaterialRequestBus.h Source/TerrainRenderer/TerrainMacroMaterialBus.cpp Source/TerrainRenderer/TerrainMacroMaterialBus.h diff --git a/Gems/Terrain/Code/terrain_tests_files.cmake b/Gems/Terrain/Code/terrain_tests_files.cmake index 1a46fdd203..39cbe0861b 100644 --- a/Gems/Terrain/Code/terrain_tests_files.cmake +++ b/Gems/Terrain/Code/terrain_tests_files.cmake @@ -7,14 +7,15 @@ # set(FILES - Tests/TerrainTest.cpp - Tests/TerrainSystemTest.cpp + Tests/ClipmapBoundsTests.cpp Tests/LayerSpawnerTests.cpp - Tests/TerrainPhysicsColliderTests.cpp - Tests/SurfaceMaterialsListTest.cpp Tests/MockAxisAlignedBoxShapeComponent.h Tests/TerrainHeightGradientListTests.cpp Tests/TerrainMacroMaterialTests.cpp + Tests/SurfaceMaterialsListTest.cpp + Tests/TerrainPhysicsColliderTests.cpp Tests/TerrainSurfaceGradientListTests.cpp Tests/TerrainSystemBenchmarks.cpp + Tests/TerrainSystemTest.cpp + Tests/TerrainTest.cpp ) From 6eec5e1a21b75aaabede378649964a037cfc44f4 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Wed, 26 Jan 2022 13:00:46 -0800 Subject: [PATCH 287/394] EBS snapshot script (#6978) Adding snapshot script, modify Jenkinsfile and build_config.json for each platform to use the snapshot tag Signed-off-by: Mike Chang --- scripts/build/Jenkins/Jenkinsfile | 32 ++- .../build/Platform/Android/build_config.json | 9 +- scripts/build/Platform/Android/pipeline.json | 6 +- .../build/Platform/Linux/build_config.json | 3 +- scripts/build/Platform/Linux/pipeline.json | 4 + .../build/Platform/Windows/build_config.json | 9 +- scripts/build/Platform/Windows/pipeline.json | 6 +- scripts/build/tools/ebs_snapshot.py | 197 ++++++++++++++++++ 8 files changed, 255 insertions(+), 11 deletions(-) create mode 100644 scripts/build/tools/ebs_snapshot.py diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index b55689b871..e4957992a5 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -9,6 +9,7 @@ import groovy.json.JsonOutput PIPELINE_CONFIG_FILE = 'scripts/build/Jenkins/lumberyard.json' INCREMENTAL_BUILD_SCRIPT_PATH = 'scripts/build/bootstrap/incremental_build_util.py' +EBS_SNAPSHOT_SCRIPT_PATH = 'scripts/build/tools/ebs_snapshot.py' PIPELINE_RETRY_ATTEMPTS = 3 EMPTY_JSON = readJSON text: '{}' @@ -206,7 +207,8 @@ def CheckoutBootstrapScripts(String branchName) { [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [ [ $class: 'SparseCheckoutPath', path: 'scripts/build/Jenkins/' ], [ $class: 'SparseCheckoutPath', path: 'scripts/build/bootstrap/' ], - [ $class: 'SparseCheckoutPath', path: 'scripts/build/Platform' ] + [ $class: 'SparseCheckoutPath', path: 'scripts/build/Platform' ], + [ $class: 'SparseCheckoutPath', path: 'scripts/build/tools/' ] ]], // Shallow checkouts break changelog computation. Do not enable. [$class: 'CloneOption', noTags: false, reference: '', shallow: false] @@ -495,6 +497,19 @@ def PostBuildCommonSteps(String workspace, Map params, boolean mount = true) { } } +def HandleDriveSnapshots(String repositoryName, String projectName, String pipeline, String branchName, String platform, String buildType) { + unstash name: 'ebs_snapshot_script' + + catchError(message: "Error snapshotting volume (this won't fail the build)", buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + def pythonCmd = 'python3 -u ' + + mountName = "Name:${repositoryName}_${projectName}_${pipeline}_${branchName}_${platform}_${buildType}" + mountName = mountName.replace('/', '_').replace('\\', '_') + palSh("${pythonCmd} ${EBS_SNAPSHOT_SCRIPT_PATH} --action create --tags ${mountName} --execute", "Starting volume snapshots", true) + palSh("${pythonCmd} ${EBS_SNAPSHOT_SCRIPT_PATH} --action delete --tags ${mountName} --retention ${env.SNAP_RETENTION} --execute", "Cleaning up old snapshots", true) + } +} + def CreateSetupStage(Map pipelineConfig, String snapshot, String repositoryName, String projectName, String pipelineName, String branchName, String platformName, String jobName, Map environmentVars, boolean onlyMountEBSVolume = false) { return { stage('Setup') { @@ -564,6 +579,14 @@ def CreateTeardownStage(Map environmentVars, Map params) { } } +def CreateSnapshotStage(String repositoryName, String projectName, String pipelineName, String branchName, String platformName, String buildType, String jobName) { + return{ + stage("${jobName}_snapshot_ebs_volume") { + HandleDriveSnapshots(repositoryName, projectName, pipelineName, branchName, platformName, buildType) + } + } +} + def CreateSingleNode(Map pipelineConfig, def platform, def build_job, Map envVars, String branchName, String pipelineName, String repositoryName, String projectName, boolean onlyMountEBSVolume = false) { def nodeLabel = envVars['NODE_LABEL'] return { @@ -632,6 +655,9 @@ def CreateSingleNode(Map pipelineConfig, def platform, def build_job, Map envVar CreateExportTestScreenshotsStage(pipelineConfig, branchName, platform.key, build_job_name, envVars, params).call() } CreateTeardownStage(envVars, params).call() + if (envVars['CREATE_SNAPSHOT']?.toBoolean()) { + CreateSnapshotStage(repositoryName, projectName, pipelineName, branchName, platform.key, build_job.key, build_job_name).call() + } } } } @@ -816,9 +842,11 @@ try { pipelineProperties.add(parameters(pipelineParameters.unique())) properties(pipelineProperties) - // Stash the INCREMENTAL_BUILD_SCRIPT_PATH since all nodes will use it + // Stash the INCREMENTAL_BUILD_SCRIPT_PATH and EBS_SNAPSHOT_SCRIPT_PATH since all nodes will use it stash name: 'incremental_build_script', includes: INCREMENTAL_BUILD_SCRIPT_PATH + stash name: 'ebs_snapshot_script', + includes: EBS_SNAPSHOT_SCRIPT_PATH } } } diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index da538b22ec..e31aa4d5a0 100644 --- a/scripts/build/Platform/Android/build_config.json +++ b/scripts/build/Platform/Android/build_config.json @@ -9,7 +9,8 @@ }, "profile_pipe": { "TAGS": [ - "default" + "default", + "snapshot" ], "steps": [ "profile" @@ -77,7 +78,8 @@ "default", "weekly-build-metrics", "nightly-incremental", - "nightly-clean" + "nightly-clean", + "snapshot" ], "COMMAND":"../Windows/build_asset_windows.cmd", "PARAMETERS": { @@ -127,7 +129,8 @@ "gradle": { "TAGS":[ "default", - "weekly-build-metrics" + "weekly-build-metrics", + "snapshot" ], "COMMAND":"gradle_windows.cmd", "PARAMETERS": { diff --git a/scripts/build/Platform/Android/pipeline.json b/scripts/build/Platform/Android/pipeline.json index 2e426c7891..ca3a9f998e 100644 --- a/scripts/build/Platform/Android/pipeline.json +++ b/scripts/build/Platform/Android/pipeline.json @@ -14,6 +14,10 @@ }, "nightly-clean": { "CLEAN_WORKSPACE": true + }, + "snapshot": { + "CLEAN_WORKSPACE": true, + "CREATE_SNAPSHOT": true } } -} \ No newline at end of file +} diff --git a/scripts/build/Platform/Linux/build_config.json b/scripts/build/Platform/Linux/build_config.json index c8f8752609..c7c20dca28 100644 --- a/scripts/build/Platform/Linux/build_config.json +++ b/scripts/build/Platform/Linux/build_config.json @@ -9,7 +9,8 @@ }, "profile_nounity_pipe": { "TAGS": [ - "default" + "default", + "snapshot" ], "steps": [ "profile_nounity", diff --git a/scripts/build/Platform/Linux/pipeline.json b/scripts/build/Platform/Linux/pipeline.json index 605adf1837..e12d41294b 100644 --- a/scripts/build/Platform/Linux/pipeline.json +++ b/scripts/build/Platform/Linux/pipeline.json @@ -12,6 +12,10 @@ }, "nightly-clean": { "CLEAN_WORKSPACE": true + }, + "snapshot": { + "CLEAN_WORKSPACE": true, + "CREATE_SNAPSHOT": true } }, "PIPELINE_JENKINS_PARAMETERS": { diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index e3d5a4a3fc..017f56bb68 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -9,7 +9,8 @@ }, "validation_pipe": { "TAGS": [ - "default" + "default", + "snapshot" ], "steps": [ "validation" @@ -27,7 +28,8 @@ }, "profile_pipe": { "TAGS": [ - "default" + "default", + "snapshot" ], "steps": [ "profile", @@ -288,7 +290,8 @@ "default", "nightly-incremental", "nightly-clean", - "weekly-build-metrics" + "weekly-build-metrics", + "snapshot" ], "COMMAND": "build_windows.cmd", "PARAMETERS": { diff --git a/scripts/build/Platform/Windows/pipeline.json b/scripts/build/Platform/Windows/pipeline.json index 47e6af2d10..3b93da9713 100644 --- a/scripts/build/Platform/Windows/pipeline.json +++ b/scripts/build/Platform/Windows/pipeline.json @@ -12,6 +12,10 @@ }, "nightly-clean": { "CLEAN_WORKSPACE": true + }, + "snapshot": { + "CLEAN_WORKSPACE": true, + "CREATE_SNAPSHOT": true } }, "PIPELINE_JENKINS_PARAMETERS": { @@ -62,4 +66,4 @@ } ] } -} \ No newline at end of file +} diff --git a/scripts/build/tools/ebs_snapshot.py b/scripts/build/tools/ebs_snapshot.py new file mode 100644 index 0000000000..483bceb988 --- /dev/null +++ b/scripts/build/tools/ebs_snapshot.py @@ -0,0 +1,197 @@ +# +# 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 argparse +import boto3 +import logging +import sys +from botocore.config import Config + +log = logging.getLogger(__name__) +log.setLevel(logging.INFO) +log.addHandler(logging.StreamHandler()) + +DEFAULT_REGION = 'us-west-2' +DEFAULT_SNAPSHOT_RETAIN = 2 +DEFAULT_SNAPSHOT_DESCRIPTION = 'Created for Build Artifact Snapshots' +DEFAULT_DRYRUN = True + +def _kv_to_dict(kv_string): + """ + Simple splitting of a key value string to dictionary in "Name: , Values: []" form + + :param kv_string: String in the form of "key:value" + :return Dictionary of values + """ + dict = {} + + if ":" not in kv_string: + log.error(f'Keyvalue parameter not in the form of "key:value"') + raise ValueError + + kv = kv_string.split(':') + dict['Name'] = f'tag:{kv[0]}' + dict['Values'] = [kv[1]] + + return dict + +def _format_tags(tag_keyvalue): + """ + Format tags in list form + + :param tag_keyvalue: String of comma separated key value pairs + :return List of dictionary values + """ + tag_filter = [] + + for keyvalue in tag_keyvalue: + tag_filter.append(_kv_to_dict(keyvalue)) + + return tag_filter + +def get_ec2_resource(): + """ + Get the AWS EC2 resource object, with appropriate region + + :return The EC2 resource object + """ + session = boto3.session.Session() + region = session.region_name + if region is None: + region = DEFAULT_REGION + + resource_config = Config( + region_name=region, + retries={ + 'mode': 'standard' + } + ) + resource = boto3.resource('ec2', config=resource_config) + return resource + +def create_snapshot(ec2_resource, tag_keyvalue, snap_description, snap_dryrun=DEFAULT_DRYRUN): + """ + Find and snapshot all EBS volumes that have a matching tag value. Injects all volume tags into the snapshot, + including the name and adds a description + + :param ec2_resource: The EC2 resource object + :param tag_keyvalue: List of Strings with tag keyvalues in the form of "key:value" + :param snap_description: String with the snapshot description to write + :param snap_dryrun: Boolean to dryrun the action. Set to true by default (always dryrun) + :return: Number of EBS volumes that are snapshotted successfully, number of EBS volumes that failed to be snapshotted + """ + success = 0 + failure = 0 + + tags = _format_tags(tag_keyvalue) + + for tag in tags: + response = ec2_resource.volumes.filter(Filters=[tag]) + log.info(f'Snapshotting EBS volumes with tags that match {tag}...') + for volume in response: + try: + log.info(f'Snapshotting volume {volume.volume_id}') + volume.create_snapshot(Description=snap_description, TagSpecifications=[{'ResourceType': 'snapshot', 'Tags': volume.tags}], DryRun=snap_dryrun) + success += 1 + except Exception as e: + log.error(f'Failed to snapshot volume {volume.volume_id}.') + log.error(e) + failure += 1 + + return success, failure + +def delete_snapshot(ec2_resource, tag_keyvalue, snap_description, snap_retention, snap_dryrun=DEFAULT_DRYRUN): + """ + Find all EBS snapshots that have a matching tag value AND description. If the number of snapshots exceeds a retention amount, + delete the oldest snapshot until retention is achived. + + :param ec2_resource: The EC2 resource object + :param tag_keyvalue: List of Strings with tag keyvalues in the form of "key:value" + :param snap_description: String with the snapshot description to search + :param snap_retention: Integer with the number of snapshots to retain + :param snap_dryrun: Boolean to dryrun the action. Set to true by default (always dryrun) + :return: Number of EBS snapshots deleted successfully, number of EBS snapshots that failed to be deleted + """ + success = 0 + failure = 0 + description_filter = {"Name": "description", "Values": [snap_description]} + + tags = _format_tags(tag_keyvalue) + + for tag in tags: + response = list(ec2_resource.snapshots.filter(Filters=[tag,description_filter])) + log.info(f'Getting snapshots with tags that match {tag}...') + num_snaps = len(response) + log.info(f'Tag {tag} has {num_snaps} snapshots') + + if num_snaps > snap_retention: + log.info(f'Deleting oldest snapshots to keep retention of {snap_retention}') + snap_list = sorted(response, key=lambda k: k.start_time) # Get a sorted list of snapshots by start time in descending order + diff_snap = num_snaps - snap_retention + for n in range(diff_snap): + try: + log.info(f'Deleting snapshot {snap_list[n].snapshot_id}') + snap_list[n].delete(DryRun=snap_dryrun) + success += 1 + except Exception as e: + log.error(f'Failed to delete snapshot {snap_list[n].snapshot_id}.') + log.error(e) + failure += 1 + + return success, failure + +def list_snapshot(ec2_resource, tag_keyvalue, snap_description): + """ + Find all EBS snapshots that have a matching tag value AND description. Prints snap id, description, tags, and start time. + + :param ec2_resource: The EC2 resource object + :param tag_keyvalue: List of Strings with tag keyvalues in the form of "key:value" + :param snap_description: String with the snapshot description to search + :return: None + """ + + description_filter = {"Name": "description", "Values": [snap_description]} + + tags = _format_tags(tag_keyvalue) + + for tag in tags: + response = ec2_resource.snapshots.filter(Filters=[tag,description_filter]) + log.info(f'Getting snapshots with tags that match {tag}...') + num_snaps = len(list(response)) + log.info(f'Tag {tag} has {num_snaps} snapshots') + snap_list = sorted(response, key=lambda k: k.start_time) + for n in range(num_snaps): + print(f'Snap ID: {snap_list[n].snapshot_id} \n Description: {snap_list[n].description} \n Tags: {snap_list[n].tags} \n Start Time: {snap_list[n].start_time}') + + return None + +def parse_args(): + parser = argparse.ArgumentParser(description='Script to manage EBS snapshots for build artifacts') + parser.add_argument('--action', '-a', type=str, help='(create|delete|list) Creates, deletes, or lists EBS snapshots based on tag. Requires --tags argument') + parser.add_argument('--tags', '-t', type=str, required=True, help='Comma separated key value tags to search for in the form of "key:value", for example, "PipelineAndBranch:default_development","PipelineAndBranch:default_development"') + parser.add_argument('--description', '-d', default=DEFAULT_SNAPSHOT_DESCRIPTION, help=f'Snapshot description to write or search for. Defaults to "{DEFAULT_SNAPSHOT_DESCRIPTION}"') + parser.add_argument('--retention', '-r', nargs="?", const=DEFAULT_SNAPSHOT_RETAIN, type=int, help=f'Integer with the number of snapshots to retain. Defaults to {DEFAULT_SNAPSHOT_RETAIN}') + parser.add_argument('--execute', '-e', action='store_false', help=f'Execute the snapshot commands. This needs to be set, otherwise it will always dryrun') + return parser.parse_args() + +def main(): + args = parse_args() + tag_list = args.tags.split(",") + ec2_resource = get_ec2_resource() + if 'create' in args.action: + ret = create_snapshot(ec2_resource, tag_list, args.description, args.execute) + log.info(f'{ret[0]} snapshots created, {ret[1]} snapshots failed') + elif 'delete' in args.action: + ret = delete_snapshot(ec2_resource, tag_list, args.description, args.retention, args.execute) + log.info(f'{ret[0]} snapshots deleted, {ret[1]} snapshot deletions failed') + elif 'list' in args.action: + ret = list_snapshot(ec2_resource, tag_list, args.description) + +if __name__ == "__main__": + sys.exit(main()) + \ No newline at end of file From aeb43c4012fd23ebf9cbe1a4758250c86d15a8f9 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:04:28 -0800 Subject: [PATCH 288/394] Fixed up a few small things to get Material Editor working again. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Materials/Special/ShadowCatcher.materialtype | 1 - .../RPI.Edit/Material/MaterialTypeSourceData.h | 11 ++++------- .../Code/Source/Document/MaterialDocument.cpp | 14 +++++++------- .../Material/EditorMaterialComponentUtil.cpp | 6 +++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype index 937abe656d..973f8b2147 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype @@ -2,7 +2,6 @@ "description": "Base material for the reflection probe visualization model.", "version": 1, "propertyLayout": { - "version": 1, "propertySets": [ { "name": "settings", diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 4fae3f710e..b5e7eecd0d 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -76,6 +76,7 @@ namespace AZ static const float DefaultMax; static const float DefaultStep; + // TODO: Consider making this private and readonly because it is used as the key for lookups and collision validation. AZStd::string m_name; //!< The name of the property within the property group. The full property ID will be groupName.propertyName. MaterialPropertyVisibility m_visibility = MaterialPropertyVisibility::Default; @@ -213,9 +214,9 @@ namespace AZ AZStd::string m_description; //< TODO: Make this private //! Version 1 is the default and should not contain any version update. - uint32_t m_version = 1; + uint32_t m_version = 1; //< TODO: Make this private - VersionUpdates m_versionUpdates; + VersionUpdates m_versionUpdates; //< TODO: Make this private //! A list of shader variants that are always used at runtime; they cannot be turned off AZStd::vector m_shaderCollection; //< TODO: Make this private @@ -283,11 +284,7 @@ namespace AZ MaterialTypeAssetCreator& materialTypeAssetCreator, AZStd::vector& propertyNameContext, const MaterialTypeSourceData::PropertySet* propertySet) const; - - //! Possibly renames @propertyId based on the material version update steps. - //! @return true if the property was renamed - bool ApplyPropertyRenames(MaterialPropertyId& propertyId) const; - + //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data. //! Groups with the same name will be consolidated into a single entry. //! Operates on the old format PropertyLayout::m_groups, used for conversion to the new format. diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 8d6eaf0633..c9ae970215 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -585,11 +585,11 @@ namespace MaterialEditor bool result = true; // populate sourceData with properties that meet the filter - m_materialTypeSourceData.EnumerateProperties([this, &sourceData, &propertyFilter, &result](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { + m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { - const AZStd::string propertyId = propertyIdContext + propertyDefinition->m_name; + Name propertyId{propertyIdContext + propertyDefinition->m_name}; - const auto it = m_properties.find(Name{propertyId}); + const auto it = m_properties.find(propertyId); if (it != m_properties.end() && propertyFilter(it->second)) { MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); @@ -603,7 +603,7 @@ namespace MaterialEditor } // TODO: Support populating the Material Editor with nested property sets, not just the top level. - const AZStd::string groupName = propertyId.substr(0, propertyId.size() - propertyDefinition->m_name.size() - 1); + const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1); sourceData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; } } @@ -897,12 +897,12 @@ namespace MaterialEditor return false; } } - + bool enumerateResult = m_materialTypeSourceData.EnumeratePropertySets( - [this, &materialTypeSourceFilePath](const AZStd::string&, const MaterialTypeSourceData::PropertySet* propertySet) + [this](const AZStd::string&, const MaterialTypeSourceData::PropertySet* propertySet) { const MaterialFunctorSourceData::EditorContext editorContext = MaterialFunctorSourceData::EditorContext( - materialTypeSourceFilePath, m_materialAsset->GetMaterialPropertiesLayout()); + m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); for (Ptr functorData : propertySet->GetFunctors()) { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index 96cf02c6f9..d6342a2507 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -122,7 +122,7 @@ namespace AZ AZ::RPI::MaterialPropertyValue propertyValue = editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]; - AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition.m_value; + AZ::RPI::MaterialPropertyValue propertyValueDefault = propertyDefinition->m_value; if (editData.m_materialParentAsset.IsReady()) { propertyValueDefault = editData.m_materialParentAsset->GetPropertyValues()[propertyIndex.GetIndex()]; @@ -135,7 +135,7 @@ namespace AZ propertyValue = AZ::RPI::MaterialPropertyValue::FromAny(propertyOverrideItr->second); } - if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId, propertyDefinition, propertyValue)) + if (!AtomToolsFramework::ConvertToExportFormat(path, propertyId, *propertyDefinition, propertyValue)) { AZ_Error("AZ::Render::EditorMaterialComponentUtil", false, "Failed to export: %s", path.c_str()); result = false; @@ -151,7 +151,7 @@ namespace AZ // TODO: Support populating the Material Editor with nested property sets, not just the top level. const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1); - exportData.m_properties[groupName][propertyDefinition.m_name].m_value = propertyValue; + exportData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; return true; }); From 43219c7ab6f8452adebf8507a032afc11159b4c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:21:51 -0800 Subject: [PATCH 289/394] Bump jinja2 in /scripts/build/build_node/Platform/Common (#7167) Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/build/build_node/Platform/Common/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/build_node/Platform/Common/requirements.txt b/scripts/build/build_node/Platform/Common/requirements.txt index 1429c33731..6940f41805 100644 --- a/scripts/build/build_node/Platform/Common/requirements.txt +++ b/scripts/build/build_node/Platform/Common/requirements.txt @@ -40,9 +40,9 @@ idna==2.10 \ --hash=sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6 \ --hash=sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0 \ # via requests -jinja2==2.11.2 \ - --hash=sha256:89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0 \ - --hash=sha256:f0a4641d3cf955324a89c04f3d94663aa4d638abe8f733ecd3582848e1c37035 \ +jinja2==2.11.3 \ + --hash=sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419 \ + --hash=sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6 \ # via -r requirements.txt jmespath==0.10.0 \ --hash=sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9 \ From b9910ac188583b416a4f64dbe87b44bb1281db8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:22:07 -0800 Subject: [PATCH 290/394] Bump rsa from 4.5 to 4.7 in /scripts/build/build_node/Platform/Common (#7168) Bumps [rsa](https://github.com/sybrenstuvel/python-rsa) from 4.5 to 4.7. - [Release notes](https://github.com/sybrenstuvel/python-rsa/releases) - [Changelog](https://github.com/sybrenstuvel/python-rsa/blob/main/CHANGELOG.md) - [Commits](https://github.com/sybrenstuvel/python-rsa/compare/version-4.5...version-4.7) --- updated-dependencies: - dependency-name: rsa dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/build/build_node/Platform/Common/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/build_node/Platform/Common/requirements.txt b/scripts/build/build_node/Platform/Common/requirements.txt index 6940f41805..b1a95d5889 100644 --- a/scripts/build/build_node/Platform/Common/requirements.txt +++ b/scripts/build/build_node/Platform/Common/requirements.txt @@ -175,9 +175,9 @@ requests==2.25.0 \ --hash=sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8 \ --hash=sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998 \ # via -r requirements.txt -rsa==4.5 \ - --hash=sha256:35c5b5f6675ac02120036d97cf96f1fde4d49670543db2822ba5015e21a18032 \ - --hash=sha256:4d409f5a7d78530a4a2062574c7bd80311bc3af29b364e293aa9b03eea77714f \ +rsa==4.7 \ + --hash=sha256:a8774e55b59fd9fc893b0d05e9bfc6f47081f46ff5b46f39ccf24631b7be356b \ + --hash=sha256:69805d6b69f56eb05b62daea3a7dbd7aa44324ad1306445e05da8060232d00f4 \ # via -r requirements.txt s3transfer==0.3.3 \ --hash=sha256:2482b4259524933a022d59da830f51bd746db62f047d6eb213f2f8855dcb8a13 \ From 48cea8991091217375521f194dd9ac3233702f35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:22:21 -0800 Subject: [PATCH 291/394] Bump pywin32 in /scripts/build/build_node/Platform/Common (#7169) Bumps [pywin32](https://github.com/mhammond/pywin32) from 228 to 301. - [Release notes](https://github.com/mhammond/pywin32/releases) - [Changelog](https://github.com/mhammond/pywin32/blob/main/CHANGES.txt) - [Commits](https://github.com/mhammond/pywin32/commits) --- updated-dependencies: - dependency-name: pywin32 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Platform/Common/requirements.txt | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/build/build_node/Platform/Common/requirements.txt b/scripts/build/build_node/Platform/Common/requirements.txt index b1a95d5889..74ae31350c 100644 --- a/scripts/build/build_node/Platform/Common/requirements.txt +++ b/scripts/build/build_node/Platform/Common/requirements.txt @@ -131,19 +131,17 @@ pytz==2020.4 \ --hash=sha256:3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268 \ --hash=sha256:5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd \ # via -r requirements.txt -pywin32==228 \ - --hash=sha256:00eaf43dbd05ba6a9b0080c77e161e0b7a601f9a3f660727a952e40140537de7 \ - --hash=sha256:11cb6610efc2f078c9e6d8f5d0f957620c333f4b23466931a247fb945ed35e89 \ - --hash=sha256:1f45db18af5d36195447b2cffacd182fe2d296849ba0aecdab24d3852fbf3f80 \ - --hash=sha256:37dc9935f6a383cc744315ae0c2882ba1768d9b06700a70f35dc1ce73cd4ba9c \ - --hash=sha256:6e38c44097a834a4707c1b63efa9c2435f5a42afabff634a17f563bc478dfcc8 \ - --hash=sha256:8319bafdcd90b7202c50d6014efdfe4fde9311b3ff15fd6f893a45c0868de203 \ - --hash=sha256:9b3466083f8271e1a5eb0329f4e0d61925d46b40b195a33413e0905dccb285e8 \ - --hash=sha256:a60d795c6590a5b6baeacd16c583d91cce8038f959bd80c53bd9a68f40130f2d \ - --hash=sha256:af40887b6fc200eafe4d7742c48417529a8702dcc1a60bf89eee152d1d11209f \ - --hash=sha256:ec16d44b49b5f34e99eb97cf270806fdc560dff6f84d281eb2fcb89a014a56a9 \ - --hash=sha256:ed74b72d8059a6606f64842e7917aeee99159ebd6b8d6261c518d002837be298 \ - --hash=sha256:fa6ba028909cfc64ce9e24bcf22f588b14871980d9787f1e2002c99af8f1850c \ +pywin32==301 \ + --hash=sha256:93367c96e3a76dfe5003d8291ae16454ca7d84bb24d721e0b74a07610b7be4a7 \ + --hash=sha256:9635df6998a70282bd36e7ac2a5cef9ead1627b0a63b17c731312c7a0daebb72 \ + --hash=sha256:c866f04a182a8cb9b7855de065113bbd2e40524f570db73ef1ee99ff0a5cc2f0 \ + --hash=sha256:dafa18e95bf2a92f298fe9c582b0e205aca45c55f989937c52c454ce65b93c78 \ + --hash=sha256:98f62a3f60aa64894a290fb7494bfa0bfa0a199e9e052e1ac293b2ad3cd2818b \ + --hash=sha256:fb3b4933e0382ba49305cc6cd3fb18525df7fd96aa434de19ce0878133bf8e4a \ + --hash=sha256:88981dd3cfb07432625b180f49bf4e179fb8cbb5704cd512e38dd63636af7a17 \ + --hash=sha256:8c9d33968aa7fcddf44e47750e18f3d034c3e443a707688a008a2e52bbef7e96 \ + --hash=sha256:595d397df65f1b2e0beaca63a883ae6d8b6df1cdea85c16ae85f6d2e648133fe \ + --hash=sha256:87604a4087434cd814ad8973bd47d6524bd1fa9e971ce428e76b62a5e0860fdf \ # via -r requirements.txt pyxb==1.2.6 \ --hash=sha256:2a00f38dd1d87b88f92d79bc5a09718d730419b88e814545f472bbd5a3bf27b4 \ From 670777f0f2c8deba90f9bbba5f45d072064aef7a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 15:25:47 -0600 Subject: [PATCH 292/394] Moved the pixel value retrieval APIs from StreamingImageAsset to RPIUtils Signed-off-by: Chris Galvan --- .../Code/Include/Atom/RPI.Public/RPIUtils.h | 19 +- .../RPI.Reflect/Image/StreamingImageAsset.h | 20 -- .../RPI/Code/Source/RPI.Public/RPIUtils.cpp | 311 ++++++++++++++++++ .../RPI.Reflect/Image/StreamingImageAsset.cpp | 297 ----------------- .../Code/Tests/Image/StreamingImageTests.cpp | 5 +- 5 files changed, 332 insertions(+), 320 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h index 70754777c7..5b5c642047 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h @@ -16,6 +16,8 @@ #include #include +#include + namespace AZ { namespace RPI @@ -57,7 +59,22 @@ namespace AZ //! Same as above. Provided as a convenience when all arguments of the 'numthreads' attributes should be assigned to RHI::DispatchDirect::m_threadsPerGroup* variables. AZ::Outcome GetComputeShaderNumThreads(const Data::Asset& shaderAsset, RHI::DispatchDirect& dispatchDirect); - + + //! Get single image pixel value for specified mip and slice + template + T GetSubImagePixelValue(const AZ::Data::Asset& imageAsset, uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + + //! Retrieve a region of image pixel values (float) for specified mip and slice + //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive + void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + + //! Retrieve a region of image pixel values (uint) for specified mip and slice + //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive + void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + + //! Retrieve a region of image pixel values (int) for specified mip and slice + //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive + void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 2e01f99cd9..73af8370cb 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -12,7 +12,6 @@ #include #include #include -#include namespace AZ { @@ -86,22 +85,6 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); - //! Get single image pixel value for specified mip and slice - template - T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); - - //! Retrieve a region of image pixel values (float) for specified mip and slice - //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); - - //! Retrieve a region of image pixel values (uint) for specified mip and slice - //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); - - //! Retrieve a region of image pixel values (int) for specified mip and slice - //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); - //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; @@ -144,9 +127,6 @@ namespace AZ uint32_t m_totalImageDataSize = 0; StreamingImageFlags m_flags = StreamingImageFlags::None; - - template - T GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); }; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp index 7285273c3e..c36472dd8b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp @@ -20,6 +20,203 @@ namespace AZ { namespace RPI { + namespace Internal + { + // The original implementation was from cryhalf's CryConvertFloatToHalf and CryConvertHalfToFloat function + // Will be replaced with centralized half float API + struct SHalf + { + explicit SHalf(float floatValue) + { + AZ::u32 Result; + + AZ::u32 intValue = ((AZ::u32*)(&floatValue))[0]; + AZ::u32 Sign = (intValue & 0x80000000U) >> 16U; + intValue = intValue & 0x7FFFFFFFU; + + if (intValue > 0x47FFEFFFU) + { + // The number is too large to be represented as a half. Saturate to infinity. + Result = 0x7FFFU; + } + else + { + if (intValue < 0x38800000U) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + AZ::u32 Shift = 113U - (intValue >> 23U); + intValue = (0x800000U | (intValue & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized half. + intValue += 0xC8000000U; + } + + Result = ((intValue + 0x0FFFU + ((intValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; + } + h = static_cast(Result | Sign); + } + + operator float() const + { + AZ::u32 Mantissa; + AZ::u32 Exponent; + AZ::u32 Result; + + Mantissa = h & 0x03FF; + + if ((h & 0x7C00) != 0) // The value is normalized + { + Exponent = ((h >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result = ((h & 0x8000) << 16) | // Sign + ((Exponent + 112) << 23) | // Exponent + (Mantissa << 13); // Mantissa + + return *(float*)&Result; + } + + private: + AZ::u16 h; + }; + + float ScaleValue(float value, float origMin, float origMax, float scaledMin, float scaledMax) + { + return ((value - origMin) / (origMax - origMin)) * (scaledMax - scaledMin) + scaledMin; + } + + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R8_UNORM: + case AZ::RHI::Format::A8_UNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R8_SNORM: + { + // Scale the value from AZ::s8 min/max to -1 to 1 + // We need to treat -128 and -127 the same, so that we get a symmetric + // range of -127 to 127 with complementary scaled values of -1 to 1 + auto actualMem = reinterpret_cast(mem); + AZ::s8 signedMax = std::numeric_limits::max(); + AZ::s8 signedMin = aznumeric_cast(-signedMax); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); + } + case AZ::RHI::Format::D16_UNORM: + case AZ::RHI::Format::R16_UNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_SNORM: + { + // Scale the value from AZ::s16 min/max to -1 to 1 + // We need to treat -32768 and -32767 the same, so that we get a symmetric + // range of -32767 to 32767 with complementary scaled values of -1 to 1 + auto actualMem = reinterpret_cast(mem); + AZ::s16 signedMax = std::numeric_limits::max(); + AZ::s16 signedMin = aznumeric_cast(-signedMax); + return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); + } + case AZ::RHI::Format::R16_FLOAT: + { + auto actualMem = reinterpret_cast(mem); + return SHalf(actualMem[index]); + } + case AZ::RHI::Format::D32_FLOAT: + case AZ::RHI::Format::R32_FLOAT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } + default: + AZ_Assert(false, "Unsupported pixel format"); + return 0.0f; + } + } + + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R8_UINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } + default: + AZ_Assert(false, "Unsupported pixel format"); + return 0; + } + } + + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R8_SINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_SINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_SINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } + default: + AZ_Assert(false, "Unsupported pixel format"); + return 0; + } + } + + template + T GetSubImagePixelValueInternal(const AZ::Data::Asset& imageAsset, uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + AZStd::array values = { aznumeric_cast(0) }; + + auto topLeft = AZStd::make_pair(x, y); + auto bottomRight = AZStd::make_pair(x + 1, y + 1); + AZStd::span valueSpan(values.begin(), values.size()); + GetSubImagePixelValues(imageAsset, topLeft, bottomRight, valueSpan, componentIndex, mip, slice); + + return values[0]; + } + } Data::AssetId GetShaderAssetId(const AZStd::string& shaderFilePath, bool isCritical) { @@ -222,5 +419,119 @@ namespace AZ { return GetComputeShaderNumThreads(shaderAsset, &dispatchDirect.m_threadsPerGroupX, &dispatchDirect.m_threadsPerGroupY, &dispatchDirect.m_threadsPerGroupZ); } + + template<> + float GetSubImagePixelValue(const AZ::Data::Asset& imageAsset, uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return Internal::GetSubImagePixelValueInternal(imageAsset, x, y, componentIndex, mip, slice); + } + + template<> + AZ::u32 GetSubImagePixelValue(const AZ::Data::Asset& imageAsset, uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return Internal::GetSubImagePixelValueInternal(imageAsset, x, y, componentIndex, mip, slice); + } + + template<> + AZ::s32 GetSubImagePixelValue(const AZ::Data::Asset& imageAsset, uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return Internal::GetSubImagePixelValueInternal(imageAsset, x, y, componentIndex, mip, slice); + } + + void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + if (!imageAsset.IsReady()) + { + return; + } + + auto imageData = imageAsset->GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + + size_t outValuesIndex = 0; + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + size_t imageDataIndex = (y * width + x) * pixelSize; + + auto& outValue = outValues[outValuesIndex++]; + outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } + + void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + if (!imageAsset.IsReady()) + { + return; + } + + auto imageData = imageAsset->GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + + size_t outValuesIndex = 0; + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + size_t imageDataIndex = (y * width + x) * pixelSize; + + auto& outValue = outValues[outValuesIndex++]; + outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } + + void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + if (!imageAsset.IsReady()) + { + return; + } + + auto imageData = imageAsset->GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + + size_t outValuesIndex = 0; + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + size_t imageDataIndex = (y * width + x) * pixelSize; + + auto& outValue = outValues[outValuesIndex++]; + outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } + } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 286b259696..59f359e474 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -13,191 +13,6 @@ namespace AZ { - namespace Internal - { - // The original implementation was from cryhalf's CryConvertFloatToHalf and CryConvertHalfToFloat function - // Will be replaced with centralized half float API - struct SHalf - { - explicit SHalf(float floatValue) - { - AZ::u32 Result; - - AZ::u32 intValue = ((AZ::u32*)(&floatValue))[0]; - AZ::u32 Sign = (intValue & 0x80000000U) >> 16U; - intValue = intValue & 0x7FFFFFFFU; - - if (intValue > 0x47FFEFFFU) - { - // The number is too large to be represented as a half. Saturate to infinity. - Result = 0x7FFFU; - } - else - { - if (intValue < 0x38800000U) - { - // The number is too small to be represented as a normalized half. - // Convert it to a denormalized value. - AZ::u32 Shift = 113U - (intValue >> 23U); - intValue = (0x800000U | (intValue & 0x7FFFFFU)) >> Shift; - } - else - { - // Rebias the exponent to represent the value as a normalized half. - intValue += 0xC8000000U; - } - - Result = ((intValue + 0x0FFFU + ((intValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; - } - h = static_cast(Result | Sign); - } - - operator float() const - { - AZ::u32 Mantissa; - AZ::u32 Exponent; - AZ::u32 Result; - - Mantissa = h & 0x03FF; - - if ((h & 0x7C00) != 0) // The value is normalized - { - Exponent = ((h >> 10) & 0x1F); - } - else if (Mantissa != 0) // The value is denormalized - { - // Normalize the value in the resulting float - Exponent = 1; - - do - { - Exponent--; - Mantissa <<= 1; - } while ((Mantissa & 0x0400) == 0); - - Mantissa &= 0x03FF; - } - else // The value is zero - { - Exponent = static_cast(-112); - } - - Result = ((h & 0x8000) << 16) | // Sign - ((Exponent + 112) << 23) | // Exponent - (Mantissa << 13); // Mantissa - - return *(float*)&Result; - } - - private: - AZ::u16 h; - }; - - float ScaleValue(float value, float origMin, float origMax, float scaledMin, float scaledMax) - { - return ((value - origMin) / (origMax - origMin)) * (scaledMax - scaledMin) + scaledMin; - } - - float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) - { - switch (format) - { - case AZ::RHI::Format::R8_UNORM: - case AZ::RHI::Format::A8_UNORM: - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - case AZ::RHI::Format::R8_SNORM: - { - // Scale the value from AZ::s8 min/max to -1 to 1 - // We need to treat -128 and -127 the same, so that we get a symmetric - // range of -127 to 127 with complementary scaled values of -1 to 1 - auto actualMem = reinterpret_cast(mem); - AZ::s8 signedMax = std::numeric_limits::max(); - AZ::s8 signedMin = aznumeric_cast(-signedMax); - return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); - } - case AZ::RHI::Format::D16_UNORM: - case AZ::RHI::Format::R16_UNORM: - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - case AZ::RHI::Format::R16_SNORM: - { - // Scale the value from AZ::s16 min/max to -1 to 1 - // We need to treat -32768 and -32767 the same, so that we get a symmetric - // range of -32767 to 32767 with complementary scaled values of -1 to 1 - auto actualMem = reinterpret_cast(mem); - AZ::s16 signedMax = std::numeric_limits::max(); - AZ::s16 signedMin = aznumeric_cast(-signedMax); - return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); - } - case AZ::RHI::Format::R16_FLOAT: - { - auto actualMem = reinterpret_cast(mem); - return SHalf(actualMem[index]); - } - case AZ::RHI::Format::D32_FLOAT: - case AZ::RHI::Format::R32_FLOAT: - { - auto actualMem = reinterpret_cast(mem); - return actualMem[index]; - } - default: - AZ_Assert(false, "Unsupported pixel format"); - return 0.0f; - } - } - - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) - { - switch (format) - { - case AZ::RHI::Format::R8_UINT: - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - case AZ::RHI::Format::R16_UINT: - { - auto actualMem = reinterpret_cast(mem); - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - case AZ::RHI::Format::R32_UINT: - { - auto actualMem = reinterpret_cast(mem); - return actualMem[index]; - } - default: - AZ_Assert(false, "Unsupported pixel format"); - return 0; - } - } - - AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) - { - switch (format) - { - case AZ::RHI::Format::R8_SINT: - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - case AZ::RHI::Format::R16_SINT: - { - auto actualMem = reinterpret_cast(mem); - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - case AZ::RHI::Format::R32_SINT: - { - auto actualMem = reinterpret_cast(mem); - return actualMem[index]; - } - default: - AZ_Assert(false, "Unsupported pixel format"); - return 0; - } - } - } - namespace RPI { const char* StreamingImageAsset::DisplayName = "StreamingImage"; @@ -309,117 +124,5 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } - - template - T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - AZStd::array values = { aznumeric_cast(0) }; - - auto topLeft = AZStd::make_pair(x, y); - auto bottomRight = AZStd::make_pair(x + 1, y + 1); - AZStd::span valueSpan(values.begin(), values.size()); - GetSubImagePixelValues(topLeft, bottomRight, valueSpan, componentIndex, mip, slice); - - return values[0]; - } - - template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); - } - - template<> - AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); - } - - template<> - AZ::s32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); - } - - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - // TODO: Use the component index - (void)componentIndex; - - auto imageData = GetSubImageData(mip, slice); - - if (!imageData.empty()) - { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); - - size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) - { - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) - { - size_t imageDataIndex = (y * width + x) * pixelSize; - - auto& outValue = outValues[outValuesIndex++]; - outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); - } - } - } - } - - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - // TODO: Use the component index - (void)componentIndex; - - auto imageData = GetSubImageData(mip, slice); - - if (!imageData.empty()) - { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); - - size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) - { - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) - { - size_t imageDataIndex = (y * width + x) * pixelSize; - - auto& outValue = outValues[outValuesIndex++]; - outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); - } - } - } - } - - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) - { - // TODO: Use the component index - (void)componentIndex; - - auto imageData = GetSubImageData(mip, slice); - - if (!imageData.empty()) - { - const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); - - size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) - { - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) - { - size_t imageDataIndex = (y * width + x) * pixelSize; - - auto& outValue = outValues[outValuesIndex++]; - outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); - } - } - } - } } } diff --git a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp index 5efab95818..ef4a0a0e08 100644 --- a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -742,7 +743,7 @@ namespace UnitTest { for (uint32_t x = 0; x < size.m_width; ++x) { - auto pixelDataValue = imageAsset->GetSubImagePixelValue(x, y); + auto pixelDataValue = RPI::GetSubImagePixelValue(imageAsset, x, y); auto pixelExpectedValue = static_cast(y * size.m_width + x) / static_cast(std::numeric_limits::max()); EXPECT_NEAR(pixelDataValue, pixelExpectedValue, Constants::Tolerance); @@ -753,7 +754,7 @@ namespace UnitTest AZStd::vector pixelValues(size.m_width * size.m_height); auto topLeft = AZStd::make_pair(0, 0); auto bottomRight = AZStd::make_pair(size.m_width, size.m_height); - streamingImageAsset->GetSubImagePixelValues(topLeft, bottomRight, pixelValues); + RPI::GetSubImagePixelValues(imageAsset, topLeft, bottomRight, pixelValues); for (uint32_t index = 0; index < pixelValues.size(); ++index) { auto pixelDataValue = pixelValues[index]; From c2ae853d955e4938aa1a382db9dfd72cd625e209 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 15:37:30 -0600 Subject: [PATCH 293/394] Fixed python bindings unit test Signed-off-by: Chris Galvan --- Code/Editor/Lib/Tests/test_CryEditPythonBindings.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Code/Editor/Lib/Tests/test_CryEditPythonBindings.cpp b/Code/Editor/Lib/Tests/test_CryEditPythonBindings.cpp index 5246fcdee5..1d9b26dbbc 100644 --- a/Code/Editor/Lib/Tests/test_CryEditPythonBindings.cpp +++ b/Code/Editor/Lib/Tests/test_CryEditPythonBindings.cpp @@ -66,9 +66,7 @@ namespace CryEditPythonBindingsUnitTests EXPECT_TRUE(behaviorContext->m_methods.find("set_current_view_position") != behaviorContext->m_methods.end()); EXPECT_TRUE(behaviorContext->m_methods.find("set_current_view_rotation") != behaviorContext->m_methods.end()); EXPECT_TRUE(behaviorContext->m_methods.find("export_to_engine") != behaviorContext->m_methods.end()); - EXPECT_TRUE(behaviorContext->m_methods.find("set_config_spec") != behaviorContext->m_methods.end()); EXPECT_TRUE(behaviorContext->m_methods.find("get_config_platform") != behaviorContext->m_methods.end()); - EXPECT_TRUE(behaviorContext->m_methods.find("get_config_spec") != behaviorContext->m_methods.end()); EXPECT_TRUE(behaviorContext->m_methods.find("set_result_to_success") != behaviorContext->m_methods.end()); EXPECT_TRUE(behaviorContext->m_methods.find("set_result_to_failure") != behaviorContext->m_methods.end()); EXPECT_TRUE(behaviorContext->m_methods.find("idle_enable") != behaviorContext->m_methods.end()); From 048b068c8991501a476f06578a9a37bcff107f1c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:08:54 -0700 Subject: [PATCH 294/394] Updated StringFunc::Tokenize to support returning a list of string_view instead of string, which should be more efficient. string is still supported as well, but users should prefer the string_view version. Testing: Updated unit tests. Reprocessed Atom material assets. Ran AtomSampleViewer material screenshot test. Opened, edited, saved materail in the Material Editor. Opened a level, edited material property overrides, saved and reloaded. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../AzCore/AzCore/StringFunc/StringFunc.cpp | 24 ++++++++++---- .../AzCore/AzCore/StringFunc/StringFunc.h | 12 ++++--- Code/Framework/AzCore/Tests/StringFunc.cpp | 31 +++++++++++++++---- 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp index 8405424f7d..61a9096d5e 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp @@ -757,13 +757,18 @@ namespace AZ::StringFunc } return value; } - - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) + + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return Tokenize(in, tokens, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); } - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); + + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) { auto insertVisitor = [&tokens](AZStd::string_view token) { @@ -771,6 +776,9 @@ namespace AZ::StringFunc }; return TokenizeVisitor(in, insertVisitor, delimiters, keepEmptyStrings, keepSpaceStrings); } + + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); + template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); void TokenizeVisitor(AZStd::string_view in, const TokenVisitor& tokenVisitor, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { @@ -918,8 +926,9 @@ namespace AZ::StringFunc return found; } - - void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) + + template + void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) { if (input.empty()) { @@ -939,7 +948,7 @@ namespace AZ::StringFunc } // Take the substring, not including the separator, and increment our offset - AZStd::string nextSubstring = input.substr(offset, nextOffset - offset); + AZStd::string_view nextSubstring = input.substr(offset, nextOffset - offset); if (keepEmptyStrings || keepSpaceStrings || !nextSubstring.empty()) { tokens.push_back(nextSubstring); @@ -948,6 +957,9 @@ namespace AZ::StringFunc offset = nextOffset + delimiters[nextMatch].size(); } } + + template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); + template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); int ToInt(const char* in) { diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h index 55236a0fff..db26b364aa 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h @@ -258,17 +258,21 @@ namespace AZ bool Strip(AZStd::string& inout, const char* stripCharacters = " ", bool bCaseSensitive = false, bool bStripBeginning = false, bool bStripEnding = false); //! Tokenize - /*! Tokenize a c-string, into a vector of AZStd::string(s) optionally keeping empty string + /*! Tokenize a c-string, into a vector of strings optionally keeping empty string *! and optionally keeping space only strings + *! (The string type may be AZStd::string or AZStd::string_view. New code should use AZStd::string_view for better performance. AZStd::string version is preserved for compatibility.) Example: Tokenize the words of a sentence. StringFunc::Tokenize("Hello World", d, ' '); s[0] == "Hello", s[1] == "World" Example: Tokenize a comma and end line delimited string StringFunc::Tokenize("Hello,World\nHello,World", d, ' '); s[0] == "Hello", s[1] == "World" s[2] == "Hello", s[3] == "World" */ - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); + template + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); //! TokenizeVisitor /*! Tokenize a string_view and invoke a handler for each token found. diff --git a/Code/Framework/AzCore/Tests/StringFunc.cpp b/Code/Framework/AzCore/Tests/StringFunc.cpp index dc4bc40e5b..fd6fe7839d 100644 --- a/Code/Framework/AzCore/Tests/StringFunc.cpp +++ b/Code/Framework/AzCore/Tests/StringFunc.cpp @@ -199,7 +199,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 0); } @@ -207,7 +207,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter) { AZStd::string input = "a b,c"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 2); @@ -218,7 +218,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, " ,"); ASSERT_EQ(tokens.size(), 0); } @@ -226,7 +226,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); ASSERT_EQ(tokens.size(), 5); @@ -240,7 +240,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = {" -", " +"}; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); ASSERT_EQ(tokens.size(), 0); @@ -249,7 +249,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = { " -", " +" }; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); @@ -259,6 +259,25 @@ namespace AZ ASSERT_TRUE(tokens[2] == "c"); ASSERT_TRUE(tokens[3] == "d-e"); // Test for something like a guid, which contain typical separator characters } + + TEST_F(StringFuncTest, Tokenize_MultiDelimeters_String) + { + // Test with AZStd::string for backward compatibility. The functions + // use to only work with AZStd::string, and now they are templatized + // to support both AZStd::string and AZStd::string_view (the latter + // being perferred for performance). + + AZStd::string input = " -a +b +c -d-e"; + AZStd::vector tokens; + AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); + + ASSERT_EQ(tokens.size(), 5); + ASSERT_TRUE(tokens[0] == "a "); + ASSERT_TRUE(tokens[1] == "b "); + ASSERT_TRUE(tokens[2] == "c "); + ASSERT_TRUE(tokens[3] == "d"); + ASSERT_TRUE(tokens[4] == "e"); + } TEST_F(StringFuncTest, TokenizeVisitor_EmptyString_DoesNotInvokeVisitor) { From 0550167f9f4b524e4e12823d367a04a2518f1362 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 16:09:03 -0600 Subject: [PATCH 295/394] Updated API to return false if there is any issue retrieving the data Signed-off-by: Chris Galvan --- .../Code/Include/Atom/RPI.Public/RPIUtils.h | 6 +- .../RPI/Code/Source/RPI.Public/RPIUtils.cpp | 99 ++++++++++--------- 2 files changed, 57 insertions(+), 48 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h index 5b5c642047..546089ab1e 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h @@ -66,15 +66,15 @@ namespace AZ //! Retrieve a region of image pixel values (float) for specified mip and slice //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive - void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (uint) for specified mip and slice //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive - void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (int) for specified mip and slice //! NOTE: The topLeft coordinate is inclusive, whereas the bottomRight is exclusive - void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp index c36472dd8b..ecca215536 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp @@ -438,100 +438,109 @@ namespace AZ return Internal::GetSubImagePixelValueInternal(imageAsset, x, y, componentIndex, mip, slice); } - void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; if (!imageAsset.IsReady()) { - return; + return false; } auto imageData = imageAsset->GetSubImageData(mip, slice); - - if (!imageData.empty()) + if (imageData.empty()) { - const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + return false; + } - size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + + size_t outValuesIndex = 0; + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) - { - size_t imageDataIndex = (y * width + x) * pixelSize; + size_t imageDataIndex = (y * width + x) * pixelSize; - auto& outValue = outValues[outValuesIndex++]; - outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); - } + auto& outValue = outValues[outValuesIndex++]; + outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } + + return true; } - void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; if (!imageAsset.IsReady()) { - return; + return false; } auto imageData = imageAsset->GetSubImageData(mip, slice); - - if (!imageData.empty()) + if (imageData.empty()) { - const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + return false; + } - size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + + size_t outValuesIndex = 0; + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) - { - size_t imageDataIndex = (y * width + x) * pixelSize; + size_t imageDataIndex = (y * width + x) * pixelSize; - auto& outValue = outValues[outValuesIndex++]; - outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); - } + auto& outValue = outValues[outValuesIndex++]; + outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } + + return true; } - void GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; if (!imageAsset.IsReady()) { - return; + return false; } auto imageData = imageAsset->GetSubImageData(mip, slice); - - if (!imageData.empty()) + if (imageData.empty()) { - const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + return false; + } - size_t outValuesIndex = 0; - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + + size_t outValuesIndex = 0; + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) - { - size_t imageDataIndex = (y * width + x) * pixelSize; + size_t imageDataIndex = (y * width + x) * pixelSize; - auto& outValue = outValues[outValuesIndex++]; - outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); - } + auto& outValue = outValues[outValuesIndex++]; + outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } + + return true; } } } From b9824ed17296a1e4a48e6587e1f5d7ef7501ae35 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:15:47 -0600 Subject: [PATCH 296/394] Updated all array_view uses with the C++20 span. (#7157) * Updated all array_view uses with the C++20 span. The updates were done in the following order 1. `AZStd::array_view<([^>].+)\* ?>` -> `AZStd::span<\1 const>` 2. `AZStd::array_view<(?:const )(.+)>` -> `AZStd::span` 3. `AZStd::array_view` -> `AZStd::span` Removed the implementation of array_view. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added missing whitespace between `const` and the typename for spans. Updated the ShaderTest comparison of the ShaderResourceGroupLayout span to compare the sizes as well Updated comments on some of the methods that stated that they return "an array" to mention they return "a span". Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../AtomCore/AtomCore/atomcore_files.cmake | 1 - .../AtomCore/std/containers/array_view.h | 156 --------- Code/Framework/AtomCore/Tests/ArrayView.cpp | 300 ------------------ .../AtomCore/Tests/atomcore_tests_files.cmake | 1 - .../AzCore/AzCore/std/containers/span.h | 19 +- .../AzCore/Tests/AZStd/SpanTests.cpp | 12 + .../Code/Source/Processing/Utils.cpp | 2 +- .../Tests/SupervariantCmdArgumentTests.cpp | 22 +- .../SkinnedMesh/SkinnedMeshInputBuffers.h | 8 +- .../Atom/Feature/Utils/IndexedDataVector.h | 2 +- .../Feature/Utils/MultiIndexedDataVector.h | 2 +- .../CoreLights/CascadedShadowmapsPass.cpp | 4 +- .../CoreLights/CascadedShadowmapsPass.h | 4 +- .../DirectionalLightFeatureProcessor.cpp | 2 +- .../Source/CoreLights/EsmShadowmapsPass.cpp | 2 +- .../Source/CoreLights/EsmShadowmapsPass.h | 2 +- .../CoreLights/ProjectedShadowmapsPass.h | 2 +- .../Source/Decals/DecalFeatureProcessor.cpp | 10 +- .../Source/Decals/DecalFeatureProcessor.h | 8 +- .../Code/Source/Decals/DecalTextureArray.cpp | 2 +- .../Code/Source/Decals/DecalTextureArray.h | 4 +- .../DecalTextureArrayFeatureProcessor.cpp | 2 +- .../Code/Source/Mesh/MeshFeatureProcessor.cpp | 2 +- .../SkinnedMesh/SkinnedMeshDispatchItem.cpp | 4 +- .../SkinnedMesh/SkinnedMeshDispatchItem.h | 4 +- .../SkinnedMesh/SkinnedMeshInputBuffers.cpp | 4 +- .../SkinnedMesh/SkinnedMeshRenderProxy.cpp | 2 +- .../SkinnedMesh/SkinnedMeshRenderProxy.h | 2 +- .../SkinnedMesh/SkinnedMeshStatsCollector.cpp | 4 +- .../SkinnedMesh/SkinnedMeshStatsCollector.h | 4 +- .../Atom/RHI.Edit/ShaderCompilerArguments.h | 2 +- .../RHI/Code/Include/Atom/RHI.Edit/Utils.h | 2 +- .../Atom/RHI.Reflect/ConstantsLayout.h | 6 +- .../Atom/RHI.Reflect/IndirectBufferLayout.h | 4 +- .../Atom/RHI.Reflect/InputStreamLayout.h | 6 +- .../RHI.Reflect/PipelineLayoutDescriptor.h | 2 +- .../Atom/RHI.Reflect/PipelineLibraryData.h | 4 +- .../Atom/RHI.Reflect/RenderAttachmentLayout.h | 2 +- .../RHI.Reflect/ShaderResourceGroupLayout.h | 16 +- .../Code/Include/Atom/RHI/CommandListStates.h | 2 +- .../RHI/Code/Include/Atom/RHI/ConstantsData.h | 36 +-- .../Atom/RHI/Code/Include/Atom/RHI/DrawList.h | 4 +- .../Code/Include/Atom/RHI/DrawPacketBuilder.h | 10 +- .../RHI/Code/Include/Atom/RHI/FrameGraph.h | 8 +- .../Include/Atom/RHI/FrameGraphExecuter.h | 2 +- .../Include/Atom/RHI/FrameGraphInterface.h | 8 +- .../Code/Include/Atom/RHI/PipelineLibrary.h | 6 +- .../Atom/RHI/ShaderResourceGroupData.h | 76 ++--- .../Code/Include/Atom/RHI/StreamBufferView.h | 4 +- .../Include/Atom/RHI/StreamingImagePool.h | 10 +- .../Atom/RHI/TransientAttachmentPool.h | 2 +- Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp | 2 +- .../Source/RHI.Reflect/ConstantsLayout.cpp | 4 +- .../RHI.Reflect/IndirectBufferLayout.cpp | 4 +- .../Source/RHI.Reflect/InputStreamLayout.cpp | 4 +- .../RHI.Reflect/PipelineLibraryData.cpp | 2 +- .../RHI.Reflect/ShaderResourceGroupLayout.cpp | 14 +- .../RHI/Code/Source/RHI/ConstantsData.cpp | 34 +- .../RHI/Code/Source/RHI/DrawPacketBuilder.cpp | 10 +- Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp | 6 +- .../Code/Source/RHI/FrameGraphExecuter.cpp | 2 +- .../RHI/Code/Source/RHI/PipelineLibrary.cpp | 2 +- .../Source/RHI/ShaderResourceGroupData.cpp | 48 +-- .../Source/RHI/ShaderResourceGroupPool.cpp | 8 +- .../RHI/Code/Source/RHI/StreamBufferView.cpp | 2 +- .../Code/Source/RHI/StreamingImagePool.cpp | 2 +- .../Source/RHI/TransientAttachmentPool.cpp | 2 +- .../Tests/InputStreamLayoutBuilderTests.cpp | 4 +- Gems/Atom/RHI/Code/Tests/PipelineState.cpp | 2 +- Gems/Atom/RHI/Code/Tests/PipelineState.h | 2 +- .../RenderAttachmentLayoutBuilderTests.cpp | 4 +- .../Code/Tests/ShaderResourceGroupTests.cpp | 18 +- .../RHI.Reflect/DX12/ShaderStageFunction.h | 4 +- .../DX12/Code/Source/RHI/AsyncUploadQueue.h | 2 +- .../RHI/DX12/Code/Source/RHI/CommandList.cpp | 4 +- .../RHI/DX12/Code/Source/RHI/CommandList.h | 2 +- .../DX12/Code/Source/RHI/PipelineLibrary.cpp | 8 +- .../DX12/Code/Source/RHI/PipelineLibrary.h | 2 +- .../Source/RHI/ShaderResourceGroupPool.cpp | 26 +- .../Code/Source/RHI/ShaderResourceGroupPool.h | 8 +- .../RHI.Reflect/Metal/ShaderStageFunction.h | 2 +- .../RHI.Builders/ShaderPlatformInterface.cpp | 148 ++++----- .../Metal/Code/Source/RHI/ArgumentBuffer.cpp | 120 +++---- .../Metal/Code/Source/RHI/ArgumentBuffer.h | 46 +-- .../Metal/Code/Source/RHI/AsyncUploadQueue.h | 20 +- .../RHI/Metal/Code/Source/RHI/CommandList.cpp | 178 +++++------ .../Metal/Code/Source/RHI/PipelineLibrary.cpp | 2 +- .../Metal/Code/Source/RHI/PipelineLibrary.h | 2 +- .../Source/RHI/ShaderResourceGroupPool.cpp | 8 +- .../Null/Code/Source/RHI/PipelineLibrary.h | 2 +- .../RHI.Reflect/Vulkan/ShaderStageFunction.h | 4 +- .../Vulkan/Code/Source/RHI/CommandList.cpp | 6 +- .../RHI/Vulkan/Code/Source/RHI/CommandList.h | 4 +- .../Vulkan/Code/Source/RHI/DescriptorSet.cpp | 8 +- .../Vulkan/Code/Source/RHI/DescriptorSet.h | 10 +- .../Code/Source/RHI/DescriptorSetLayout.cpp | 14 +- .../Source/RHI/FrameGraphExecuteGroup.cpp | 6 +- .../Code/Source/RHI/FrameGraphExecuteGroup.h | 4 +- .../Source/RHI/FrameGraphExecuteGroupBase.h | 4 +- .../RHI/FrameGraphExecuteGroupMerged.cpp | 8 +- .../Source/RHI/FrameGraphExecuteGroupMerged.h | 8 +- .../Vulkan/Code/Source/RHI/PipelineLayout.cpp | 2 +- .../Code/Source/RHI/PipelineLibrary.cpp | 4 +- .../Vulkan/Code/Source/RHI/PipelineLibrary.h | 2 +- .../RHI/Vulkan/Code/Source/RHI/RenderPass.cpp | 10 +- .../RHI/Vulkan/Code/Source/RHI/RenderPass.h | 4 +- .../RPI.Edit/Material/MaterialPropertyId.h | 4 +- .../Atom/RPI.Public/GpuQuery/GpuQueryTypes.h | 4 +- .../Atom/RPI.Public/GpuQuery/QueryPool.h | 10 +- .../Include/Atom/RPI.Public/Model/Model.h | 2 +- .../Include/Atom/RPI.Public/Model/ModelLod.h | 4 +- .../Include/Atom/RPI.Public/Pass/ParentPass.h | 2 +- .../Code/Include/Atom/RPI.Public/Pass/Pass.h | 2 +- .../Atom/RPI.Public/Pass/PassAttachment.h | 2 +- .../Atom/RPI.Public/Pass/PassLibrary.h | 2 +- .../Include/Atom/RPI.Public/Shader/Shader.h | 2 +- .../RPI.Public/Shader/ShaderResourceGroup.h | 86 ++--- .../Atom/RPI.Reflect/Buffer/BufferAsset.h | 4 +- .../RPI.Reflect/Image/ImageMipChainAsset.h | 6 +- .../RPI.Reflect/Image/StreamingImageAsset.h | 2 +- .../Atom/RPI.Reflect/Material/MaterialAsset.h | 2 +- .../RPI.Reflect/Material/MaterialTypeAsset.h | 4 +- .../Material/MaterialTypeAssetCreator.h | 2 +- .../Atom/RPI.Reflect/Model/ModelAsset.h | 2 +- .../Atom/RPI.Reflect/Model/ModelKdTree.h | 6 +- .../Atom/RPI.Reflect/Model/ModelLodAsset.h | 22 +- .../RPI.Reflect/Pass/PassAttachmentReflect.h | 12 +- .../Atom/RPI.Reflect/Pass/PassRequest.h | 4 +- .../Atom/RPI.Reflect/Pass/PassTemplate.h | 2 +- .../Atom/RPI.Reflect/Shader/ShaderAsset.h | 4 +- .../RPI.Edit/Material/MaterialPropertyId.cpp | 2 +- .../RPI.Public/GpuQuery/GpuQueryTypes.cpp | 2 +- .../Source/RPI.Public/GpuQuery/QueryPool.cpp | 6 +- .../GpuQuery/TimestampQueryPool.cpp | 4 +- .../Code/Source/RPI.Public/Model/Model.cpp | 2 +- .../Code/Source/RPI.Public/Model/ModelLod.cpp | 2 +- .../Source/RPI.Public/Pass/ParentPass.cpp | 2 +- .../Code/Source/RPI.Public/Shader/Shader.cpp | 2 +- .../RPI.Public/Shader/ShaderResourceGroup.cpp | 58 ++-- .../Source/RPI.Reflect/Buffer/BufferAsset.cpp | 4 +- .../RPI.Reflect/Buffer/BufferAssetCreator.cpp | 2 +- .../RPI.Reflect/Image/ImageMipChainAsset.cpp | 8 +- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 6 +- .../Material/MaterialTypeAsset.cpp | 2 +- .../Source/RPI.Reflect/Model/ModelAsset.cpp | 10 +- .../RPI.Reflect/Model/ModelAssetCreator.cpp | 2 +- .../Source/RPI.Reflect/Model/ModelKdTree.cpp | 12 +- .../RPI.Reflect/Model/ModelLodAsset.cpp | 10 +- .../Model/ModelLodAssetCreator.cpp | 2 +- .../Source/RPI.Reflect/Shader/ShaderAsset.cpp | 2 +- Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h | 16 +- .../Code/Tests/Image/StreamingImageTests.cpp | 6 +- .../Material/MaterialSourceDataTests.cpp | 4 +- .../RPI/Code/Tests/Shader/ShaderTests.cpp | 6 +- ...ShaderResourceGroupConstantBufferTests.cpp | 20 +- .../Code/Source/Document/MaterialDocument.cpp | 2 +- .../Code/Include/Atom/Utils/ImageComparison.h | 6 +- .../Utils/Code/Include/Atom/Utils/PngFile.h | 6 +- .../Utils/Code/Include/Atom/Utils/PpmFile.h | 6 +- .../Utils/Code/Source/ImageComparison.cpp | 6 +- Gems/Atom/Utils/Code/Source/PngFile.cpp | 4 +- Gems/Atom/Utils/Code/Source/PpmFile.cpp | 4 +- .../Source/Mesh/MeshComponentController.cpp | 4 +- .../EMotionFXAtom/Code/Source/ActorAsset.cpp | 2 +- .../Code/Source/AtomActorInstance.cpp | 2 +- Gems/AtomTressFX/Code/Passes/HairParentPass.h | 2 +- .../EMotionFX/Code/EMotionFX/Source/Actor.cpp | 10 +- Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp | 2 +- Gems/LyShine/Code/Source/LyShinePass.h | 2 +- .../BindlessImageArrayHandler.cpp | 2 +- 170 files changed, 833 insertions(+), 1274 deletions(-) delete mode 100644 Code/Framework/AtomCore/AtomCore/std/containers/array_view.h delete mode 100644 Code/Framework/AtomCore/Tests/ArrayView.cpp diff --git a/Code/Framework/AtomCore/AtomCore/atomcore_files.cmake b/Code/Framework/AtomCore/AtomCore/atomcore_files.cmake index 9167c1e645..827d26ecf5 100644 --- a/Code/Framework/AtomCore/AtomCore/atomcore_files.cmake +++ b/Code/Framework/AtomCore/AtomCore/atomcore_files.cmake @@ -13,7 +13,6 @@ set(FILES Instance/InstanceData.h Instance/InstanceData.cpp Instance/InstanceDatabase.h - std/containers/array_view.h std/containers/fixed_vector_set.h std/containers/lru_cache.h std/containers/vector_set.h diff --git a/Code/Framework/AtomCore/AtomCore/std/containers/array_view.h b/Code/Framework/AtomCore/AtomCore/std/containers/array_view.h deleted file mode 100644 index 522b69bf9b..0000000000 --- a/Code/Framework/AtomCore/AtomCore/std/containers/array_view.h +++ /dev/null @@ -1,156 +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 -#include - -namespace AZStd -{ - /** - * Immutable wrapper for an array of data. It does not maintain storage for the data, - * but just holds pointers to mark the beginning and end of the array. It can be - * conveniently constructed from a variety of other container types like array, - * vector, and fixed_vector. - * - * Example: - * Given "void Func(AZStd::array_view a) {...}" you can call... - * - Func({1,2,3}); - * - AZStd::array a = {1,2,3}; - * Func(a); - * - AZStd::vector v = {1,2,3}; - * Func(v); - * - AZStd::fixed_vector fv = {1,2,3}; - * Func(fv); - * - * Since the array_view does not copy and store any data, it is only valid as long as the data used to create it is valid. - */ - template - class array_view final - { - public: - using value_type = Element; - - using pointer = value_type*; - using const_pointer = const value_type*; - - using reference = value_type&; - using const_reference = const value_type&; - - using size_type = AZStd::size_t; - using difference_type = AZStd::ptrdiff_t; - - using iterator = const value_type*; - using const_iterator = const value_type*; - using reverse_iterator = AZStd::reverse_iterator; - using const_reverse_iterator = AZStd::reverse_iterator; - - array_view() - : m_begin(nullptr) - , m_end(nullptr) - { } - - ~array_view() = default; - - array_view(const_pointer s, size_type length) - : m_begin(s) - , m_end(m_begin + length) - { - if (length == 0) erase(); - } - - array_view(const_pointer first, const_pointer last) - : m_begin(first) - , m_end(last) - { } - - // We explicitly delete this constructor because it's too easy to accidentally - // create an array_view to just the first element instead of an entire array. - array_view(const_pointer s) = delete; - - template - array_view(const AZStd::array& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - array_view(const AZStd::vector& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - array_view(const AZStd::fixed_vector& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - array_view(const array_view&) = default; - - array_view(array_view&& other) - : array_view(other.m_begin, other.m_end) - { -#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging - other.m_begin = nullptr; - other.m_end = nullptr; -#endif - } - - array_view& operator=(const array_view& other) = default; - - array_view& operator=(array_view&& other) - { - m_begin = other.m_begin; - m_end = other.m_end; -#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging - other.m_begin = nullptr; - other.m_end = nullptr; -#endif - return *this; - } - - size_type size() const { return m_end - m_begin; } - - bool empty() const { return m_end == m_begin; } - - const_pointer data() const { return m_begin; } - - const_reference operator[](size_type index) const - { - AZ_Assert(index < size(), "index value is out of range"); - return m_begin[index]; - } - - void erase() { m_begin = m_end = nullptr; } - - iterator begin() const { return m_begin; } - iterator end() const { return m_end; } - const_iterator cbegin() const { return m_begin; } - const_iterator cend() const { return m_end; } - reverse_iterator rbegin() const { return reverse_iterator(m_end); } - reverse_iterator rend() const { return reverse_iterator(m_begin); } - const_reverse_iterator crbegin() const { return const_reverse_iterator(cend()); } - const_reverse_iterator crend() const { return const_reverse_iterator(cbegin()); } - - friend bool operator==(array_view lhs, array_view rhs) - { - return lhs.m_begin == rhs.m_begin && lhs.m_end == rhs.m_end; - } - - friend bool operator!=(array_view lhs, array_view rhs) { return !(lhs == rhs); } - friend bool operator< (array_view lhs, array_view rhs) { return lhs.m_begin < rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end < rhs.m_end; } - friend bool operator> (array_view lhs, array_view rhs) { return lhs.m_begin > rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end > rhs.m_end; } - friend bool operator<=(array_view lhs, array_view rhs) { return lhs == rhs || lhs < rhs; } - friend bool operator>=(array_view lhs, array_view rhs) { return lhs == rhs || lhs > rhs; } - - private: - const_pointer m_begin; - const_pointer m_end; - }; -} // namespace AZStd diff --git a/Code/Framework/AtomCore/Tests/ArrayView.cpp b/Code/Framework/AtomCore/Tests/ArrayView.cpp deleted file mode 100644 index f0208ced3b..0000000000 --- a/Code/Framework/AtomCore/Tests/ArrayView.cpp +++ /dev/null @@ -1,300 +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 - -namespace UnitTest -{ - using namespace AZStd; - - class ArrayView : public AllocatorsTestFixture - { - protected: - template - void ExpectEqual(initializer_list expectedValues, array_view arrayView) - { - EXPECT_EQ(false, arrayView.empty()); - EXPECT_EQ(expectedValues.size(), arrayView.size()); - - typename AZStd::vector::const_iterator iterator = arrayView.begin(); - - for (int i = 0; i < expectedValues.size(); ++i, ++iterator) - { - EXPECT_EQ(expectedValues.begin()[i], arrayView[i]); - EXPECT_EQ(expectedValues.begin()[i], *iterator); - } - - EXPECT_EQ(iterator, arrayView.end()); - } - }; - - TEST_F(ArrayView, DefaultConstructor) - { - array_view defaultView; - - EXPECT_EQ(nullptr, defaultView.begin()); - EXPECT_EQ(nullptr, defaultView.end()); - EXPECT_EQ(0, defaultView.size()); - EXPECT_EQ(true, defaultView.empty()); - } - - TEST_F(ArrayView, PointerConstructor1) - { - int originalValues[4] = { 2,3,4,5 }; - array_view view(originalValues, AZ_ARRAY_SIZE(originalValues)); - - ExpectEqual({ 2,3,4,5 }, view); - - EXPECT_EQ(originalValues, view.begin()); - EXPECT_EQ(&originalValues[4], view.end()); - } - - TEST_F(ArrayView, PointerConstructor2) - { - int originalValues[3] = { 6,7,8 }; - array_view view(originalValues, &originalValues[3]); - - ExpectEqual({ 6,7,8 }, view); - - EXPECT_EQ(originalValues, view.begin()); - EXPECT_EQ(&originalValues[3], view.end()); - } - - TEST_F(ArrayView, ArrayConstructor) - { - array originalValues = { 9,10,11,12 }; - array_view view(originalValues); - - ExpectEqual({ 9,10,11,12 }, view); - - EXPECT_EQ(originalValues.begin(), view.begin()); - EXPECT_EQ(originalValues.end(), view.end()); - } - - - TEST_F(ArrayView, VectorConstructor) - { - vector originalValues = { 13,14,15,16,17,18 }; - array_view view(originalValues); - - ExpectEqual({ 13,14,15,16,17,18 }, view); - - EXPECT_EQ(originalValues.begin(), view.begin()); - EXPECT_EQ(originalValues.end(), view.end()); - } - - TEST_F(ArrayView, FixedVectorConstructor) - { - fixed_vector originalValues = { 17,18,19 }; // Note that even though the fixed_vector capacity is 10, it's size is 3, so the view size will be 3 as well - array_view view(originalValues); - - ExpectEqual({ 17,18,19 }, view); - - EXPECT_EQ(originalValues.begin(), view.begin()); - EXPECT_EQ(originalValues.end(), view.end()); - } - - TEST_F(ArrayView, CopyConstructor) - { - fixed_vector originalValues = { 27,28 }; - - array_view view1(originalValues); - array_view view2(view1); - - ExpectEqual({ 27,28 }, view2); - - EXPECT_EQ(view1.begin(), view2.begin()); - EXPECT_EQ(view1.end(), view2.end()); - } - - TEST_F(ArrayView, MoveConstructor) - { - int originalValues[] = { 29,30,31 }; - array_view view1(originalValues, AZ_ARRAY_SIZE(originalValues)); - array_view view2(AZStd::move(view1)); - - ExpectEqual({ 29,30,31 }, view2); - - EXPECT_EQ(originalValues, view2.begin()); - EXPECT_EQ(&originalValues[3], view2.end()); - - // This isn't strictly necessary but is a good way to make sure the move - // constructor actually exists and it itn't just calling the copy constructor -#if AZ_DEBUG_BUILD // The pointers are only cleared in debug - EXPECT_EQ(nullptr, view1.begin()); - EXPECT_EQ(nullptr, view1.end()); -#endif - } - - TEST_F(ArrayView, AssignmentOperator) - { - fixed_vector originalValues = { 32,33,34,35 }; - - array_view view1(originalValues); - array_view view2; - - view2 = view1; - - ExpectEqual({ 32,33,34,35 }, view2); - - EXPECT_EQ(view1.begin(), view2.begin()); - EXPECT_EQ(view1.end(), view2.end()); - } - - TEST_F(ArrayView, MoveAssignmentOperator) - { - int originalValues[] = { 36,37,38,39,40 }; - array_view view1(originalValues, AZ_ARRAY_SIZE(originalValues)); - array_view view2; - view2 = AZStd::move(view1); - - ExpectEqual({ 36,37,38,39,40 }, view2); - - EXPECT_EQ(originalValues, view2.begin()); - EXPECT_EQ(&originalValues[5], view2.end()); - - // This isn't strictly necessary but is a good way to make sure the move - // assignment operator actually exists and it itn't just calling the norm - // assignment operator -#if AZ_DEBUG_BUILD // The pointers are only cleared in debug - EXPECT_EQ(nullptr, view1.begin()); - EXPECT_EQ(nullptr, view1.end()); -#endif - } - - TEST_F(ArrayView, Erase) - { - fixed_vector originalValues = { 1,2,3,4 }; - - array_view view(originalValues); - view.erase(); - - EXPECT_EQ(nullptr, view.begin()); - EXPECT_EQ(nullptr, view.end()); - EXPECT_EQ(0, view.size()); - EXPECT_EQ(true, view.empty()); - } - - TEST_F(ArrayView, BeginAndEnd) - { - fixed_vector originalValues = { 1,2,3,4 }; - - array_view view(originalValues); - - EXPECT_EQ(1, view.begin()[0]); - EXPECT_EQ(4, view.end()[-1]); - EXPECT_EQ(1, view.cbegin()[0]); - EXPECT_EQ(4, view.cend()[-1]); - EXPECT_EQ(4, view.rbegin()[0]); - EXPECT_EQ(1, view.rend()[-1]); - EXPECT_EQ(4, view.crbegin()[0]); - EXPECT_EQ(1, view.crend()[-1]); - } - - TEST_F(ArrayView, ImplicitConstruction) - { - // This test verifies that we can pass in various non-array_view types - // into functions that take an array_view - - // The compile cannot detect the correct template type so that has to be specified explicitly - - ExpectEqual({ 1,2,3 }, vector({ 1,2,3 })); - ExpectEqual({ 1,2,3 }, fixed_vector({ 1,2,3 })); - ExpectEqual({ 1,2,3 }, array({ 1,2,3 })); - } - - void CheckComparisonOperators(bool areEqual, array_view a, array_view b) - { - EXPECT_EQ(areEqual, a == b); - - // For less/greater operators, the exact order doesn't really matter; - // We just check for internal consistency - if (areEqual) - { - EXPECT_EQ(false, a != b); - EXPECT_EQ(false, a < b); - EXPECT_EQ(false, a > b); - EXPECT_EQ(true, a <= b); - EXPECT_EQ(true, a >= b); - } - else - { - EXPECT_EQ(true, a != b); - - EXPECT_EQ(a > b, a >= b); - EXPECT_EQ(a < b, a <= b); - - EXPECT_NE(a > b, a < b); - EXPECT_NE(a >= b, a <= b); - EXPECT_NE(a >= b, a < b); - EXPECT_NE(a > b, a <= b); - EXPECT_NE(a <= b, a > b); - EXPECT_NE(a < b, a >= b); - } - } - - TEST_F(ArrayView, ComparisonOperators) - { - int arrayA[] = { 1,2,3 }; - int arrayB[] = { 1,2,3 }; - - array_view arrayA_view(arrayA, 3); - array_view arrayB_view(arrayB, 3); - array_view arrayA_otherView(arrayA, 3); - // view of a sub-array aligned to the beginning of the array - array_view arrayA_headView(arrayA, 2); - array_view arrayB_headView(arrayB, 2); - // view of a sub-array aligned to the end of the array - array_view arrayA_tailView(&arrayA[1], 2); - array_view arrayB_tailView(&arrayB[1], 2); - // view of a sub-array in the middle of the array - array_view arrayA_centerView(&arrayA[1], 1); - array_view arrayB_centerView(&arrayB[1], 1); - - // Same view - CheckComparisonOperators(true, arrayA_view, arrayA_view); - - // Different view, same array - CheckComparisonOperators(true, arrayA_view, arrayA_otherView); - CheckComparisonOperators(true, arrayA_otherView, arrayA_view); - - // Different arrays - CheckComparisonOperators(false, arrayA_view, arrayB_view); - CheckComparisonOperators(false, arrayB_view, arrayA_view); - - // Same arrays, but one is a just a subset of the array - CheckComparisonOperators(false, arrayA_view, arrayA_headView); - CheckComparisonOperators(false, arrayA_view, arrayA_tailView); - CheckComparisonOperators(false, arrayA_view, arrayA_centerView); - CheckComparisonOperators(false, arrayA_headView, arrayA_view); - CheckComparisonOperators(false, arrayA_tailView, arrayA_view); - CheckComparisonOperators(false, arrayA_centerView, arrayA_view); - - // Different arrays, different lengths - CheckComparisonOperators(false, arrayA_view, arrayB_headView); - CheckComparisonOperators(false, arrayB_view, arrayA_headView); - CheckComparisonOperators(false, arrayB_headView, arrayA_view); - CheckComparisonOperators(false, arrayA_headView, arrayB_view); - } - - TEST_F(ArrayView, AssertOutOfBounds) - { - array_view view({ 1,2,3,4 }); - - AZ_TEST_START_TRACE_SUPPRESSION; - - view[4]; - view[5]; - - AZ_TEST_STOP_TRACE_SUPPRESSION(2); - } - -} diff --git a/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake b/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake index 4522a4b7b6..c518371e8d 100644 --- a/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake +++ b/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake @@ -7,7 +7,6 @@ # set(FILES - ArrayView.cpp ConcurrencyCheckerTests.cpp InstanceDatabase.cpp lru_cache.cpp diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h index d0ac704fc3..807d87e634 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.h +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -42,12 +42,11 @@ namespace AZStd::Internal namespace AZStd { /** - * First pass partial implementation of span copied over from array_view. It - * returns non-const iterator/pointers. first(), last(), and subspan() - * are yet to be implemented. It does not maintain storage for the data, - * but just holds pointers to mark the beginning and end of the array. - * It can be conveniently constructed from a variety of other container - * types like array, vector, and fixed_vector. + * Full C++20 implementation of span done using the C++ draft at https://eel.is/c++draft/views. + * It does not maintain storage for the data, + * but just hold a pointer to mark the beginning and the size for the elements. + * It can be constructed any type that models the C++ contiguous_range concept + * such like array, vector, fixed_vector, raw-array, string_view, string, etc... . * * Example: * Given "void Func(AZStd::span a) {...}" you can call... @@ -84,7 +83,7 @@ namespace AZStd inline static constexpr size_t extent = Extent; - constexpr span() noexcept = default;; + constexpr span() noexcept = default; ~span() = default; @@ -110,12 +109,12 @@ namespace AZStd Extent != dynamic_extent, int> = 0> constexpr explicit span(It first, End last); - template> + template> constexpr span(type_identity_t (&arr)[N]) noexcept; - template > + template > constexpr span(array& data) noexcept; - template > + template > constexpr span(const array& data) noexcept; template && diff --git a/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp b/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp index f9861ae1f2..6fe0704491 100644 --- a/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/SpanTests.cpp @@ -246,4 +246,16 @@ namespace UnitTest AZ_TEST_STOP_TRACE_SUPPRESSION(1); } } + + TEST_F(SpanTestFixture, CanInitializeFixedArrayToDynamicExtentSpan) + { + constexpr size_t arrayElementCount = 5; + static constexpr AZStd::array intArray{ 4, 5, 6, 1, 7 }; + + constexpr AZStd::span arraySpan(intArray); + static_assert(intArray.data() == arraySpan.data()); + + constexpr AZStd::span arraySpanFixedExtent(intArray); + static_assert(intArray.data() == arraySpanFixedExtent.data()); + } } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 20e1b18e77..bcf330f7d3 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -286,7 +286,7 @@ namespace ImageProcessingAtom for (u32 slice = 0; slice < arraySize; slice++) { - AZStd::array_view imageData = imageAsset->GetSubImageData(mip, slice); + AZStd::span imageData = imageAsset->GetSubImageData(mip, slice); memcpy(imageBuf + slice * imageData.size(), imageData.data(), imageData.size()); } } diff --git a/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp b/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp index da80b15d79..df7dbc3186 100644 --- a/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp +++ b/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp @@ -71,7 +71,7 @@ namespace UnitTest //! Helper function. //! Given an input list of {Key, Value} pairs returns a list of strings where each string is of the form: "Key=Value". - AZStd::vector CreateListOfStringsFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + AZStd::vector CreateListOfStringsFromListOfKeyValues(AZStd::span listOfKeyValues) const { AZStd::vector listOfStrings; for (const auto& keyValue : listOfKeyValues) @@ -90,7 +90,7 @@ namespace UnitTest //! Helper function. //! Given an input list of {Key, Value} pairs returns a list of strings where each string is of the form: "Key1", "Value1", "Key2", "Value2". - AZStd::vector CreateListOfSingleStringsFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + AZStd::vector CreateListOfSingleStringsFromListOfKeyValues(AZStd::span listOfKeyValues) const { AZStd::vector listOfStrings; for (const auto& keyValue : listOfKeyValues) @@ -134,7 +134,7 @@ namespace UnitTest //! Returns a command line string that results of concatenating the input list of {Key, Value} pairs (with '='). //! Example of a returned string: //! "key1=value1 key2 key3 key4=value" - AZStd::string CreateCmdLineStringFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + AZStd::string CreateCmdLineStringFromListOfKeyValues(AZStd::span listOfKeyValues) const { AZStd::string cmdLineString; for (const auto& keyValueView : listOfKeyValues) @@ -148,7 +148,7 @@ namespace UnitTest //! Returns a command line string of macro definitions that results of concatenating the input list of {Key, Value} pairs. //! Example of a returned string: //! "-Dkey1=value1 -Dkey2 -Dkey3 -Dkey4=value" - AZStd::string CreateMacroDefinitionCmdLineStringFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + AZStd::string CreateMacroDefinitionCmdLineStringFromListOfKeyValues(AZStd::span listOfKeyValues) const { AZStd::string cmdLineString; for (const auto& keyValueView : listOfKeyValues) @@ -161,7 +161,7 @@ namespace UnitTest //! @param includePaths A List of folder paths //! @param predefinedMacros A List of strings with format: "name[=value]" ShaderBuilder::PreprocessorOptions CreatePreprocessorOptions( - AZStd::array_view includePaths, AZStd::array_view predefinedMacros) const + AZStd::span includePaths, AZStd::span predefinedMacros) const { ShaderBuilder::PreprocessorOptions preprocessorOptions; @@ -200,8 +200,8 @@ namespace UnitTest //! @param azslcAdditionalFreeArguments A string representing series of command line arguments for AZSLc. //! @param dxcAdditionalFreeArguments: A string representing series of command line arguments for DXC. ShaderBuilder::GlobalBuildOptions CreateGlobalBuildOptions( - AZStd::array_view includePaths, - AZStd::array_view predefinedMacros, + AZStd::span includePaths, + AZStd::span predefinedMacros, AZStd::string_view azslcAdditionalFreeArguments, AZStd::string_view dxcAdditionalFreeArguments) const { @@ -227,7 +227,7 @@ namespace UnitTest return supervariantInfo; } - bool StringContainsAllSubstrings(AZStd::string_view haystack, AZStd::array_view substrings) + bool StringContainsAllSubstrings(AZStd::string_view haystack, AZStd::span substrings) { return AZStd::all_of(AZ_BEGIN_END(substrings), [&](AZStd::string_view needle) -> bool @@ -237,7 +237,7 @@ namespace UnitTest ); } - bool StringDoesNotContainAnyOneOfTheSubstrings(AZStd::string_view haystack, AZStd::array_view substrings) + bool StringDoesNotContainAnyOneOfTheSubstrings(AZStd::string_view haystack, AZStd::span substrings) { return AZStd::all_of(AZ_BEGIN_END(substrings), [&](AZStd::string_view needle) -> bool { return (haystack.find(needle) == AZStd::string::npos); @@ -247,7 +247,7 @@ namespace UnitTest //! @returns: True if all strings in @substring appear in @vectorOfString. //! @remark: Keep in mind that this is not the same as saying that all strings in @vectorOfStrings appear in @substrings. bool VectorContainsAllSubstrings( - AZStd::array_view vectorOfStrings, AZStd::array_view substrings) + AZStd::span vectorOfStrings, AZStd::span substrings) { return AZStd::all_of( AZ_BEGIN_END(substrings), @@ -264,7 +264,7 @@ namespace UnitTest } //! @returns: True only if None of the strings in @vectorOfStrings contains any of the strings in @substrings. - bool VectorDoesNotContainAnyOneOfTheSubstrings(AZStd::array_view vectorOfStrings, AZStd::array_view substrings) + bool VectorDoesNotContainAnyOneOfTheSubstrings(AZStd::span vectorOfStrings, AZStd::span substrings) { return AZStd::all_of(AZ_BEGIN_END(vectorOfStrings), [&](AZStd::string_view haystack) -> bool { return StringDoesNotContainAnyOneOfTheSubstrings(haystack, substrings); diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h index c52bed8cf2..bb5f08c65e 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h @@ -27,13 +27,13 @@ namespace AZ class BufferView; class IndexBufferView; } - + namespace RPI { class Model; class ShaderResourceGroup; } - + namespace Render { //! Info needed to create per-submesh views into the skinned mesh buffers so that the target skinned model can be broken into multiple sub-meshes. @@ -212,8 +212,8 @@ namespace AZ //! Get an individual lod const SkinnedMeshInputLod& GetLod(size_t lodIndex) const; - //! Get an array_view of the buffer views for all the input streams - AZStd::array_view> GetInputBufferViews(size_t lodIndex) const; + //! Get a span of the buffer views for all the input streams + AZStd::span> GetInputBufferViews(size_t lodIndex) const; //! Get the buffer view for a specific input stream AZ::RHI::Ptr GetInputBufferView(size_t lodIndex, uint8_t inputStream) const; diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/IndexedDataVector.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/IndexedDataVector.h index b2d483e48c..5deecb990f 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/IndexedDataVector.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/IndexedDataVector.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include namespace AZ::Render diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiIndexedDataVector.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiIndexedDataVector.h index c0f11dd159..cc065680dc 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiIndexedDataVector.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiIndexedDataVector.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace AZ { diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp index 5529a2916b..4a5ea4a112 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.cpp @@ -71,7 +71,7 @@ namespace AZ } } - const AZStd::array_view CascadedShadowmapsPass::GetPipelineViewTags() + const AZStd::span CascadedShadowmapsPass::GetPipelineViewTags() { if (m_childrenPipelineViewTags.size() != Shadow::MaxNumberOfCascades) { @@ -181,7 +181,7 @@ namespace AZ RPI::Ptr CascadedShadowmapsPass::CreateChild(uint16_t cascadeIndex) { - const AZStd::array_view childrenViewTags = GetPipelineViewTags(); + const AZStd::span childrenViewTags = GetPipelineViewTags(); const Name passName{ AZStd::string::format("DirectionalLightShadowmapPass.%d", cascadeIndex) }; auto passData = AZStd::make_shared(); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.h index e673a77ddb..1f7acfadb2 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CascadedShadowmapsPass.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include @@ -36,7 +36,7 @@ namespace AZ void SetCameraViewName(const AZStd::string& viewName); //! This returns pipeline view tag for children. - const AZStd::array_view GetPipelineViewTags(); + const AZStd::span GetPipelineViewTags(); //! This exposes the shadowmap atlas. ShadowmapAtlas& GetShadowmapAtlas(); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp index 5cf65adcee..1b8ad72a4c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp @@ -1018,7 +1018,7 @@ namespace AZ for (const auto& passIt : m_cascadedShadowmapsPasses) { CascadedShadowmapsPass* shadowPass = passIt.second.front(); - const AZStd::array_view& viewTags = shadowPass->GetPipelineViewTags(); + const AZStd::span& viewTags = shadowPass->GetPipelineViewTags(); AZ_Assert(viewTags.size() >= cascadeCount, "DirectionalLightFeatureProcessor: There is not enough pipeline view tags."); RPI::RenderPipeline* pipeline = shadowPass->GetRenderPipeline(); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp index 553133aef7..722a8f3d23 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp @@ -112,7 +112,7 @@ namespace AZ m_shadowmapImageSize = inputBinding.m_attachment->m_descriptor.m_image.m_size; m_shadowmapArraySize = inputBinding.m_attachment->m_descriptor.m_image.m_arraySize; - const AZStd::array_view>& children = GetChildren(); + const AZStd::span>& children = GetChildren(); AZ_Assert(children.size() == EsmChildPassKindCount, "[EsmShadowmapsPass '%s'] The count of children is wrong.", GetPathName().GetCStr()); for (uint32_t childPassIndex = 0; childPassIndex < EsmChildPassKindCount; ++childPassIndex) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.h index 5a9898d507..3e4ec1735e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h index dc7df7de78..cc99cdb8f1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp index 8e446435fa..69681110c9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include namespace AZ @@ -114,14 +114,14 @@ namespace AZ } } - AZStd::array_view> DecalFeatureProcessor::GetImageArray() const + AZStd::span> DecalFeatureProcessor::GetImageArray() const { // [GFX TODO][ATOM-4445] Replace this hardcoded constant with atlasing / bindless so we can have far more than 8 decal textures // Note this constant also is defined in View.srg const size_t MaxDecals = 8; size_t numImages = AZStd::min(MaxDecals, m_decalData.GetDataCount()); - AZStd::array_view imageArrayView(m_decalData.GetDataVector<1>().begin(), m_decalData.GetDataVector<1>().begin() + numImages); + AZStd::span imageArrayView(m_decalData.GetDataVector<1>().begin(), m_decalData.GetDataVector<1>().begin() + numImages); return imageArrayView; } @@ -130,8 +130,8 @@ namespace AZ { AZ_PROFILE_SCOPE(RPI, "DecalFeatureProcessor: Render"); - AZStd::array_view> baseMaps = GetImagesFromDecalData<1>(); - AZStd::array_view> opacityMaps = GetImagesFromDecalData<2>(); + AZStd::span> baseMaps = GetImagesFromDecalData<1>(); + AZStd::span> opacityMaps = GetImagesFromDecalData<2>(); for (const RPI::ViewPtr& view : packet.m_views) { diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.h index f651b5cd2d..b2785b1770 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.h @@ -81,11 +81,11 @@ namespace AZ DecalFeatureProcessor(const DecalFeatureProcessor&) = delete; Data::Instance GetImageFromMaterial(const AZ::Name& mapName, Data::Instance materialInstance) const; - AZStd::array_view> GetImageArray() const; + AZStd::span> GetImageArray() const; void CacheShaderIndices(); template - AZStd::array_view> GetImagesFromDecalData(); + AZStd::span> GetImagesFromDecalData(); static constexpr const char* FeatureProcessorName = "DecalFeatureProcessor"; @@ -105,7 +105,7 @@ namespace AZ }; template - AZStd::array_view> + AZStd::span> AZ::Render::DecalFeatureProcessor::GetImagesFromDecalData() { // [GFX TODO][ATOM-4445] Replace this hardcoded constant with atlasing / bindless so we can have far more than 8 decal textures @@ -113,7 +113,7 @@ namespace AZ const size_t MaxDecals = 4; size_t numImages = AZStd::min(MaxDecals, m_decalData.GetDataCount()); - AZStd::array_view imageArrayView(m_decalData.GetDataVector().begin(), m_decalData.GetDataVector().begin() + numImages); + AZStd::span imageArrayView(m_decalData.GetDataVector().begin(), m_decalData.GetDataVector().begin() + numImages); return imageArrayView; } } // namespace Render diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp index 56ff1648d4..d570990be0 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp @@ -267,7 +267,7 @@ namespace AZ return AZ::RHI::GetImageSubresourceLayout(mipSize, descriptor.m_format); } - AZStd::array_view DecalTextureArray::GetRawImageData(const AZ::Name& mapName, int arrayLevel, const int mip) const + AZStd::span DecalTextureArray::GetRawImageData(const AZ::Name& mapName, int arrayLevel, const int mip) const { // We always want to provide valid data to the AssetCreator for each texture. // If this spot in the array is empty, just provide some random image as filler. diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h index 39e66176fd..a9bf994aac 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include @@ -81,7 +81,7 @@ namespace AZ RHI::Size GetImageDimensions(const DecalMapType mapType) const; RHI::Format GetFormat(const DecalMapType mapType) const; RHI::ImageSubresourceLayout GetLayout(const DecalMapType mapType, int mip) const; - AZStd::array_view GetRawImageData(const AZ::Name& mapName, int arrayLevel, int mip) const; + AZStd::span GetRawImageData(const AZ::Name& mapName, int arrayLevel, int mip) const; bool AreAllAssetsReady() const; bool IsAssetReady(const MaterialData& materialData) const; diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp index c6b4d4e754..681a316b91 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 6b9a3fc698..1aa79d1945 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -772,7 +772,7 @@ namespace AZ return; } - const AZStd::array_view>& modelLods = m_model->GetLods(); + const AZStd::span>& modelLods = m_model->GetLods(); if (modelLods.empty()) { return; diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp index 5ec26cebde..2ccfdd2c26 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp @@ -225,12 +225,12 @@ namespace AZ return m_boneTransforms; } - AZStd::array_view> SkinnedMeshDispatchItem::GetSourceUnskinnedBufferViews() const + AZStd::span> SkinnedMeshDispatchItem::GetSourceUnskinnedBufferViews() const { return m_inputBuffers->GetInputBufferViews(m_lodIndex); } - AZStd::array_view> SkinnedMeshDispatchItem::GetTargetSkinnedBufferViews() const + AZStd::span> SkinnedMeshDispatchItem::GetTargetSkinnedBufferViews() const { return m_actorInstanceBufferViews; } diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h index 739267d602..54b61f28c4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h @@ -65,8 +65,8 @@ namespace AZ const RHI::DispatchItem& GetRHIDispatchItem() const; Data::Instance GetBoneTransforms() const; - AZStd::array_view> GetSourceUnskinnedBufferViews() const; - AZStd::array_view> GetTargetSkinnedBufferViews() const; + AZStd::span> GetSourceUnskinnedBufferViews() const; + AZStd::span> GetTargetSkinnedBufferViews() const; size_t GetVertexCount() const; private: // SkinnedMeshShaderOptionNotificationBus::Handler diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp index 4146a669fe..e3219be597 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp @@ -212,7 +212,7 @@ namespace AZ void SkinnedMeshInputLod::CreateSharedSubMeshBufferViews() { - AZStd::array_view meshes = m_modelLodAsset->GetMeshes(); + AZStd::span meshes = m_modelLodAsset->GetMeshes(); m_sharedSubMeshViews.resize(meshes.size()); // The index and static buffer views will be shared by all instances that use the same SkinnedMeshInputBuffers, so set them here @@ -307,7 +307,7 @@ namespace AZ return m_lods[lodIndex]; } - AZStd::array_view> SkinnedMeshInputBuffers::GetInputBufferViews(size_t lodIndex) const + AZStd::span> SkinnedMeshInputBuffers::GetInputBufferViews(size_t lodIndex) const { return m_lods[lodIndex].m_bufferViews; } diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp index 2f8ccc12ed..6f1e636b85 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp @@ -145,7 +145,7 @@ namespace AZ } } - AZStd::array_view> SkinnedMeshRenderProxy::GetDispatchItems() const + AZStd::span> SkinnedMeshRenderProxy::GetDispatchItems() const { return m_dispatchItemsByLod; } diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.h index ffad21207e..275c8ea21d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.h @@ -45,7 +45,7 @@ namespace AZ void SetSkinningMatrices(const AZStd::vector& data) override; void SetMorphTargetWeights(uint32_t lodIndex, const AZStd::vector& weights) override; - AZStd::array_view< AZStd::unique_ptr> GetDispatchItems() const; + AZStd::span> GetDispatchItems() const; private: AZ_DISABLE_COPY_MOVE(SkinnedMeshRenderProxy); diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.cpp index abfdf4c101..124c697e4a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.cpp @@ -78,7 +78,7 @@ namespace AZ } } - void SkinnedMeshStatsCollector::AddReadOnlyBufferViewsToSceneStats(const AZStd::array_view>& sourceUnskinnedBufferViews) + void SkinnedMeshStatsCollector::AddReadOnlyBufferViewsToSceneStats(const AZStd::span>& sourceUnskinnedBufferViews) { for (const AZ::RHI::Ptr& bufferView : sourceUnskinnedBufferViews) { @@ -94,7 +94,7 @@ namespace AZ } } - void SkinnedMeshStatsCollector::AddWritableBufferViewsToSceneStats(const AZStd::array_view>& targetSkinnedBufferViews) + void SkinnedMeshStatsCollector::AddWritableBufferViewsToSceneStats(const AZStd::span>& targetSkinnedBufferViews) { for (const AZ::RHI::Ptr& bufferView : targetSkinnedBufferViews) { diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.h index f81cf0d5af..ef35a2aa65 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshStatsCollector.h @@ -33,8 +33,8 @@ namespace AZ void ResetAllStats(); void AddDispatchItemToSceneStats(const AZStd::unique_ptr& dispatchItem); void AddBonesToSceneStats(const Data::Instance& boneTransformBuffer); - void AddReadOnlyBufferViewsToSceneStats(const AZStd::array_view>& sourceUnskinnedBufferViews); - void AddWritableBufferViewsToSceneStats(const AZStd::array_view>& targetSkinnedBufferViews); + void AddReadOnlyBufferViewsToSceneStats(const AZStd::span>& sourceUnskinnedBufferViews); + void AddWritableBufferViewsToSceneStats(const AZStd::span>& targetSkinnedBufferViews); void AddVerticesToSceneStats(size_t vertexCount); SkinnedMeshSceneStats m_sceneStats; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h index 83a868ab65..012d9288a0 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include namespace AZ { diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h index d648f05b46..4b1f647102 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h @@ -129,7 +129,7 @@ namespace AZ //! @returns A new string based on @commandLineString but with the matching arguments and their values //! removed from it. AZStd::string RemoveArgumentsFromCommandLineString( - AZStd::array_view listOfArguments, AZStd::string_view commandLineString); + AZStd::span listOfArguments, AZStd::string_view commandLineString); //! @param commandLineString: " --arg1 -arg2 --arg3=foo --arg4=bar " //! @returns "--arg1 -arg2 --arg3=foo --arg4=bar" diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ConstantsLayout.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ConstantsLayout.h index 653e8e4474..eae84e7970 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ConstantsLayout.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ConstantsLayout.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -72,7 +72,7 @@ namespace AZ //! Returns the full lists of shader input added to the layout. Inputs //! maintain their original order with respect to AddShaderInput. - AZStd::array_view GetShaderInputList() const; + AZStd::span GetShaderInputList() const; //! Returns the total size in bytes used by the constants. uint32_t GetDataSize() const; @@ -84,7 +84,7 @@ namespace AZ //! Prints to the console the shader input names specified by input list of indices //! Will ignore any indices outside of the inputs array bounds - void DebugPrintNames(AZStd::array_view constantList) const; + void DebugPrintNames(AZStd::span constantList) const; protected: ConstantsLayout() = default; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/IndirectBufferLayout.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/IndirectBufferLayout.h index fd26d845f7..a645cfc7b3 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/IndirectBufferLayout.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/IndirectBufferLayout.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace AZ { @@ -137,7 +137,7 @@ namespace AZ bool AddIndirectCommand(const IndirectCommandDescriptor& command); /// Returns the list of indirect commands of the layout. Must be called after the layout is finalized. - AZStd::array_view GetCommands() const; + AZStd::span GetCommands() const; //! Returns the position of a command. //! Must be called after the layout is finalized. diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/InputStreamLayout.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/InputStreamLayout.h index 879584f224..914709a60f 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/InputStreamLayout.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/InputStreamLayout.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -158,10 +158,10 @@ namespace AZ const PrimitiveTopology GetTopology() const; /// Returns the list of stream channels. - AZStd::array_view GetStreamChannels() const; + AZStd::span GetStreamChannels() const; /// Returns the list of stream buffers. - AZStd::array_view GetStreamBuffers() const; + AZStd::span GetStreamBuffers() const; /// Returns the hash computed in Finalize(), which must be called first. HashValue64 GetHash() const; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLayoutDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLayoutDescriptor.h index 216021a316..86bc059c1a 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLayoutDescriptor.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLayoutDescriptor.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLibraryData.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLibraryData.h index c86d38fdeb..38f3cb0c51 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLibraryData.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PipelineLibraryData.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include @@ -47,7 +47,7 @@ namespace AZ static ConstPtr Create(AZStd::vector&& data); /// Returns the data payload which describes the platform-specific pipeline library data. - AZStd::array_view GetData() const; + AZStd::span GetData() const; private: PipelineLibraryData(AZStd::vector&& data); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RenderAttachmentLayout.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RenderAttachmentLayout.h index 9a3c3dd226..bb3c2156c2 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RenderAttachmentLayout.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RenderAttachmentLayout.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace AZ { diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h index 34737019ca..5510fc039f 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -116,7 +116,7 @@ namespace AZ // The following methods are only permitted on a finalized layout. /// Returns the full list of static samplers descriptors declared on the layout. - AZStd::array_view GetStaticSamplers() const; + AZStd::span GetStaticSamplers() const; /** * Resolves an shader input name to an index for each type of shader input. To maximize performance, @@ -148,13 +148,13 @@ namespace AZ * maintain their original order with respect to AddShaderInput. Each type * of shader input has its own separate list. */ - AZStd::array_view GetShaderInputListForBuffers() const; - AZStd::array_view GetShaderInputListForImages() const; - AZStd::array_view GetShaderInputListForSamplers() const; - AZStd::array_view GetShaderInputListForConstants() const; + AZStd::span GetShaderInputListForBuffers() const; + AZStd::span GetShaderInputListForImages() const; + AZStd::span GetShaderInputListForSamplers() const; + AZStd::span GetShaderInputListForConstants() const; - AZStd::array_view GetShaderInputListForBufferUnboundedArrays() const; - AZStd::array_view GetShaderInputListForImageUnboundedArrays() const; + AZStd::span GetShaderInputListForBufferUnboundedArrays() const; + AZStd::span GetShaderInputListForImageUnboundedArrays() const; /** * Each shader input may contain multiple shader resources. The layout computes diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/CommandListStates.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/CommandListStates.h index 34a25eb8b6..1937631f13 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/CommandListStates.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/CommandListStates.h @@ -20,7 +20,7 @@ namespace AZ struct CommandListRenderTargetsState { using StateList = AZStd::fixed_vector; - void Set(AZStd::array_view newElements) + void Set(AZStd::span newElements) { m_states = StateList(newElements.begin(), newElements.end()); m_isDirty = true; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h index fd38e4c08d..04aa97a189 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/ConstantsData.h @@ -20,11 +20,11 @@ namespace AZ { namespace RHI { - //! The intent of this class is to provide fast and thin access to the underlying constant - //! data (inline or from an SRG), with basic validation to protect the user. As a secondary objective, it provides type-specific convenience - //! operations as long as they don't violate the primary "fast" and "thin" objectives. To clarify, thin means - //! we don't make assumptions about the data or how the user wants to operate on the data, and the convenience - //! operations boil down to thin wrappers for single calls to SetConstantRaw and GetConstantRaw. So these + //! The intent of this class is to provide fast and thin access to the underlying constant + //! data (inline or from an SRG), with basic validation to protect the user. As a secondary objective, it provides type-specific convenience + //! operations as long as they don't violate the primary "fast" and "thin" objectives. To clarify, thin means + //! we don't make assumptions about the data or how the user wants to operate on the data, and the convenience + //! operations boil down to thin wrappers for single calls to SetConstantRaw and GetConstantRaw. So these //! convenience functions are provided in situations that are "low-hanging-fruit". class ConstantsData { @@ -53,7 +53,7 @@ namespace AZ //! Assigns an array of type T to the constant shader input. template - bool SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::array_view values); + bool SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::span values); //! Assigns constant data as a whole. bool SetConstantData(const void* bytes, size_t byteCount); @@ -64,7 +64,7 @@ namespace AZ //! of elements in the returned array is the number of evenly divisible elements. //! If the strides do not match, an empty array is returned. template - AZStd::array_view GetConstantArray(ShaderInputConstantIndex inputIndex) const; + AZStd::span GetConstantArray(ShaderInputConstantIndex inputIndex) const; //! Returns the constant data as type 'T' returned by value. The size of the constant region //! must match the size of T exactly. Otherwise, an empty instance is returned. @@ -77,11 +77,11 @@ namespace AZ template T GetConstant(ShaderInputConstantIndex inputIndex, uint32_t arrayIndex) const; - //! Returns constant data for the given shader input index as an array of bytes. - AZStd::array_view GetConstantRaw(ShaderInputConstantIndex inputIndex) const; + //! Returns constant data for the given shader input index as a span of bytes. + AZStd::span GetConstantRaw(ShaderInputConstantIndex inputIndex) const; //! Returns the opaque constant data populated by calls to SetConstant and SetConstantData. - AZStd::array_view GetConstantData() const; + AZStd::span GetConstantData() const; //! Returns the constants layout. const ConstantsLayout* GetLayout() const; @@ -123,7 +123,7 @@ namespace AZ template bool ConstantsData::SetConstant(ShaderInputConstantIndex inputIndex, const T& value) { - AZStd::array_view valueArray(&value, 1); + AZStd::span valueArray(&value, 1); return SetConstantArray(inputIndex, valueArray); } @@ -152,7 +152,7 @@ namespace AZ bool ConstantsData::SetConstant(ShaderInputConstantIndex inputIndex, const Color& value); template <> - bool ConstantsData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::array_view values); + bool ConstantsData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::span values); template <> bool ConstantsData::GetConstant(ShaderInputConstantIndex inputIndex) const; @@ -213,7 +213,7 @@ namespace AZ } template - bool ConstantsData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::array_view values) + bool ConstantsData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::span values) { const size_t sizeInBytes = values.size() * sizeof(T); if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) @@ -224,15 +224,15 @@ namespace AZ } template - AZStd::array_view ConstantsData::GetConstantArray(ShaderInputConstantIndex inputIndex) const + AZStd::span ConstantsData::GetConstantArray(ShaderInputConstantIndex inputIndex) const { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); const size_t elementSize = sizeof(T); const size_t elementCount = DivideByMultiple(constantBytes.size(), elementSize); const size_t sizeInBytes = elementCount * elementSize; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) { - return AZStd::array_view(reinterpret_cast(constantBytes.data()), elementCount); + return AZStd::span(reinterpret_cast(constantBytes.data()), elementCount); } return {}; } @@ -240,7 +240,7 @@ namespace AZ template T ConstantsData::GetConstant(ShaderInputConstantIndex inputIndex) const { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); const size_t sizeInBytes = sizeof(T); if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) { @@ -252,7 +252,7 @@ namespace AZ template T ConstantsData::GetConstant(ShaderInputConstantIndex inputIndex, uint32_t arrayIndex) const { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); const size_t elementSize = sizeof(T); const size_t elementOffset = arrayIndex * elementSize; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::ArrayElement, elementOffset, elementSize)) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawList.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawList.h index 72bfed3300..dfb458217f 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawList.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawList.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include @@ -36,7 +36,7 @@ namespace AZ using DrawListMask = AZStd::bitset; using DrawList = AZStd::vector; - using DrawListView = AZStd::array_view; + using DrawListView = AZStd::span; /// Contains a table of draw lists, indexed by the tag. using DrawListsByTag = AZStd::array; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h index 30e013d486..fdaa2b594a 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h @@ -32,7 +32,7 @@ namespace AZ uint8_t m_stencilRef = 0; //! The array of stream buffers to bind for this draw item. - AZStd::array_view m_streamBufferViews; + AZStd::span m_streamBufferViews; //! Shader resource group unique for this draw request const ShaderResourceGroup* m_uniqueShaderResourceGroup = nullptr; @@ -56,13 +56,13 @@ namespace AZ void SetIndexBufferView(const IndexBufferView& indexBufferView); - void SetRootConstants(AZStd::array_view rootConstants); + void SetRootConstants(AZStd::span rootConstants); - void SetScissors(AZStd::array_view scissors); + void SetScissors(AZStd::span scissors); void SetScissor(const Scissor& scissor); - void SetViewports(AZStd::array_view viewports); + void SetViewports(AZStd::span viewports); void SetViewport(const Viewport& viewport); @@ -85,7 +85,7 @@ namespace AZ IndexBufferView m_indexBufferView; AZStd::fixed_vector m_drawRequests; AZStd::fixed_vector m_shaderResourceGroups; - AZStd::array_view m_rootConstants; + AZStd::span m_rootConstants; AZStd::fixed_vector m_scissors; AZStd::fixed_vector m_viewports; }; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraph.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraph.h index c361750bc6..ac7a224594 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraph.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraph.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include #include #include @@ -105,11 +105,11 @@ namespace AZ // See RHI::FrameGraphInterface for detailed comments ResultCode UseAttachment(const BufferScopeAttachmentDescriptor& descriptor, ScopeAttachmentAccess access, ScopeAttachmentUsage usage); ResultCode UseAttachment(const ImageScopeAttachmentDescriptor& descriptor, ScopeAttachmentAccess access, ScopeAttachmentUsage usage); - ResultCode UseAttachments(AZStd::array_view descriptors, ScopeAttachmentAccess access, ScopeAttachmentUsage usage); + ResultCode UseAttachments(AZStd::span descriptors, ScopeAttachmentAccess access, ScopeAttachmentUsage usage); ResultCode UseResolveAttachment(const ResolveScopeAttachmentDescriptor& descriptor); - ResultCode UseColorAttachments(AZStd::array_view descriptors); + ResultCode UseColorAttachments(AZStd::span descriptors); ResultCode UseDepthStencilAttachment(const ImageScopeAttachmentDescriptor& descriptor, ScopeAttachmentAccess access); - ResultCode UseSubpassInputAttachments(AZStd::array_view descriptors); + ResultCode UseSubpassInputAttachments(AZStd::span descriptors); ResultCode UseShaderAttachment(const BufferScopeAttachmentDescriptor& descriptor, ScopeAttachmentAccess access); ResultCode UseShaderAttachment(const ImageScopeAttachmentDescriptor& descriptor, ScopeAttachmentAccess access); ResultCode UseCopyAttachment(const BufferScopeAttachmentDescriptor& descriptor, ScopeAttachmentAccess access); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphExecuter.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphExecuter.h index fa05428967..72fe29d0d5 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphExecuter.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphExecuter.h @@ -124,7 +124,7 @@ namespace AZ FrameGraphExecuteGroupType* AddGroup(); //! Returns a list of the registered execute groups. - AZStd::array_view> GetGroups() const; + AZStd::span> GetGroups() const; private: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphInterface.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphInterface.h index a9bf2130cd..ed14783c56 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphInterface.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameGraphInterface.h @@ -18,7 +18,7 @@ #include #include -#include +#include namespace AZ { @@ -79,7 +79,7 @@ namespace AZ //! Declares an array of image attachments for use on the current scope. ResultCode UseAttachments( - AZStd::array_view descriptors, + AZStd::span descriptors, ScopeAttachmentAccess access, ScopeAttachmentUsage usage) { @@ -87,7 +87,7 @@ namespace AZ } //! Declares an array of color attachments for use on the current scope. - ResultCode UseColorAttachments(AZStd::array_view descriptors) + ResultCode UseColorAttachments(AZStd::span descriptors) { return m_frameGraph.UseColorAttachments(descriptors); } @@ -100,7 +100,7 @@ namespace AZ //! Declares an array of subpass input attachments for use on the current scope. //! See UseSubpassInputAttachment for a definition about a SubpassInput. - ResultCode UseSubpassInputAttachments(AZStd::array_view descriptors) + ResultCode UseSubpassInputAttachments(AZStd::span descriptors) { return m_frameGraph.UseSubpassInputAttachments(descriptors); } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h index 3a49b121cd..687038f52e 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h @@ -19,7 +19,7 @@ namespace AZ /// A handle typed to the pipeline library. Used by the PipelineStateCache to abstract access. using PipelineLibraryHandle = Handle; - + //! PipelineState initialization is an expensive operation on certain platforms. If multiple pipeline states //! are created with little variation between them, the contents are still duplicated. This class is an allocation //! context for pipeline states, provided at PipelineState::Init, which will perform de-duplication of @@ -58,7 +58,7 @@ namespace AZ //! libraries and merge them into a single unified library. The serialized data can then be //! extracted from the unified library. An error code is returned on failure and the behavior //! is as if the method was never called. - ResultCode MergeInto(AZStd::array_view librariesToMerge); + ResultCode MergeInto(AZStd::span librariesToMerge); //! Serializes the platform-specific data and returns it as a new PipelineLibraryData instance. //! The data is opaque to the user and can only be used to re-initialize the library. Use @@ -85,7 +85,7 @@ namespace AZ virtual void ShutdownInternal() = 0; /// Called when libraries are being merged into this one. - virtual ResultCode MergeIntoInternal(AZStd::array_view libraries) = 0; + virtual ResultCode MergeIntoInternal(AZStd::span libraries) = 0; /// Called when the library is serializing out platform-specific data. virtual ConstPtr GetSerializedDataInternal() const = 0; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/ShaderResourceGroupData.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/ShaderResourceGroupData.h index ef4e734c01..8904924c41 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/ShaderResourceGroupData.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/ShaderResourceGroupData.h @@ -24,16 +24,16 @@ namespace AZ //! and shader constants. It utilizes basic reflection information from the shader resource group layout //! to construct the table in the correct format for the platform-specific compile phase. The user //! is expected to create instances of this class, fill data, and then push it to an SRG instance. - //! + //! //! The shader resource group (SRG) includes a set of built-in SRG constants in a single internally-managed //! constant buffer. This is separate from any custom constant buffers that some SRG layouts may include //! as shader resources. SRG constants can be conveniently accessed through a variety of SetConstant. - //! + //! //! This data structure holds strong references to the resource views bound onto it. - //! + //! //! NOTE [Performance Warning]: This data structure allocates memory. If compiling several SRG's in a batch, //! prefer to share the data between them (i.e. within a single job). - //! + //! //! NOTE [SRG Constants]: The ConstantsData class is used for efficiently setting/getting the constants values of the SRG. class ShaderResourceGroupData { @@ -65,25 +65,25 @@ namespace AZ bool SetImageView(ShaderInputImageIndex inputIndex, const ImageView* imageView, uint32_t arrayIndex); //! Sets an array of image view for the given shader input index. - bool SetImageViewArray(ShaderInputImageIndex inputIndex, AZStd::array_view imageViews, uint32_t arrayIndex = 0); + bool SetImageViewArray(ShaderInputImageIndex inputIndex, AZStd::span imageViews, uint32_t arrayIndex = 0); //! Sets an unbounded array of image view for the given shader input index. - bool SetImageViewUnboundedArray(ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::array_view imageViews); + bool SetImageViewUnboundedArray(ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::span imageViews); //! Sets one buffer view for the given shader input index. bool SetBufferView(ShaderInputBufferIndex inputIndex, const BufferView* bufferView, uint32_t arrayIndex = 0); //! Sets an array of image view for the given shader input index. - bool SetBufferViewArray(ShaderInputBufferIndex inputIndex, AZStd::array_view bufferViews, uint32_t arrayIndex = 0); + bool SetBufferViewArray(ShaderInputBufferIndex inputIndex, AZStd::span bufferViews, uint32_t arrayIndex = 0); //! Sets an unbounded array of buffer view for the given shader input index. - bool SetBufferViewUnboundedArray(ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::array_view bufferViews); + bool SetBufferViewUnboundedArray(ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::span bufferViews); //! Sets one sampler for the given shader input index, using the bindingIndex as the key. bool SetSampler(ShaderInputSamplerIndex inputIndex, const SamplerState& sampler, uint32_t arrayIndex = 0); //! Sets an array of samplers for the given shader input index. - bool SetSamplerArray(ShaderInputSamplerIndex inputIndex, AZStd::array_view samplers, uint32_t arrayIndex = 0); + bool SetSamplerArray(ShaderInputSamplerIndex inputIndex, AZStd::span samplers, uint32_t arrayIndex = 0); //! Assigns constant data for the given constant shader input index. bool SetConstantRaw(ShaderInputConstantIndex inputIndex, const void* bytes, uint32_t byteCount); @@ -96,17 +96,17 @@ namespace AZ //! Assigns a specified number of rows from a Matrix template bool SetConstantMatrixRows(ShaderInputConstantIndex inputIndex, const T& value, uint32_t rowCount); - + //! Assigns a value of type T to the constant shader input, at an array offset. template bool SetConstant(ShaderInputConstantIndex inputIndex, const T& value, uint32_t arrayIndex); //! Assigns an array of type T to the constant shader input. template - bool SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::array_view values); + bool SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::span values); //! Assigns constant data as a whole. - //! + //! //! CAUTION! //! Different platforms might follow different packing rules for the internally-managed SRG constant buffer. //! To set manually a constant buffer as a whole please use Constant Buffers in AZSL, @@ -118,33 +118,33 @@ namespace AZ //! Returns a single image view associated with the image shader input index and array offset. const ConstPtr& GetImageView(ShaderInputImageIndex inputIndex, uint32_t arrayIndex) const; - //! Returns an array of image views associated with the given image shader input index. - AZStd::array_view> GetImageViewArray(ShaderInputImageIndex inputIndex) const; + //! Returns a span of image views associated with the given image shader input index. + AZStd::span> GetImageViewArray(ShaderInputImageIndex inputIndex) const; - //! Returns an unbounded array of image views associated with the given buffer shader input index. - AZStd::array_view> GetImageViewUnboundedArray(ShaderInputImageUnboundedArrayIndex inputIndex) const; + //! Returns an unbounded span of image views associated with the given buffer shader input index. + AZStd::span> GetImageViewUnboundedArray(ShaderInputImageUnboundedArrayIndex inputIndex) const; //! Returns a single buffer view associated with the buffer shader input index and array offset. const ConstPtr& GetBufferView(ShaderInputBufferIndex inputIndex, uint32_t arrayIndex) const; - //! Returns an array of buffer views associated with the given buffer shader input index. - AZStd::array_view> GetBufferViewArray(ShaderInputBufferIndex inputIndex) const; + //! Returns a span of buffer views associated with the given buffer shader input index. + AZStd::span> GetBufferViewArray(ShaderInputBufferIndex inputIndex) const; - //! Returns an unbounded array of buffer views associated with the given buffer shader input index. - AZStd::array_view> GetBufferViewUnboundedArray(ShaderInputBufferUnboundedArrayIndex inputIndex) const; + //! Returns an unbounded span of buffer views associated with the given buffer shader input index. + AZStd::span> GetBufferViewUnboundedArray(ShaderInputBufferUnboundedArrayIndex inputIndex) const; //! Returns a single sampler associated with the sampler shader input index and array offset. const SamplerState& GetSampler(ShaderInputSamplerIndex inputIndex, uint32_t arrayIndex) const; - //! Returns an array of samplers associated with the sampler shader input index. - AZStd::array_view GetSamplerArray(ShaderInputSamplerIndex inputIndex) const; + //! Returns a span of samplers associated with the sampler shader input index. + AZStd::span GetSamplerArray(ShaderInputSamplerIndex inputIndex) const; //! Returns constant data for the given shader input index as a template type. //! The stride of T must match the size of the constant input region. The number - //! of elements in the returned array is the number of evenly divisible elements. - //! If the strides do not match, an empty array is returned. + //! of elements in the returned span is the number of evenly divisible elements. + //! If the strides do not match, an empty span is returned. template - AZStd::array_view GetConstantArray(ShaderInputConstantIndex inputIndex) const; + AZStd::span GetConstantArray(ShaderInputConstantIndex inputIndex) const; //! Returns the constant data as type 'T' returned by value. The size of the constant region //! must match the size of T exactly. Otherwise, an empty instance is returned. @@ -157,25 +157,25 @@ namespace AZ template T GetConstant(ShaderInputConstantIndex inputIndex, uint32_t arrayIndex) const; - //! Returns constant data for the given shader input index as an array of bytes. - AZStd::array_view GetConstantRaw(ShaderInputConstantIndex inputIndex) const; + //! Returns constant data for the given shader input index as a span of bytes. + AZStd::span GetConstantRaw(ShaderInputConstantIndex inputIndex) const; //! Returns a {Buffer, Image, Sampler} shader resource group. Each resource type has its own separate group. //! - The size of this group matches the size provided by ShaderResourceGroupLayout::GetGroupSizeFor{Buffer, Image, Sampler}. - //! - Use ShaderResourceGroupLayout::GetGroupInterval to retrieve a [min, max) interval into the array. - AZStd::array_view> GetImageGroup() const; - AZStd::array_view> GetBufferGroup() const; - AZStd::array_view GetSamplerGroup() const; - + //! - Use ShaderResourceGroupLayout::GetGroupInterval to retrieve a [min, max) interval into the span. + AZStd::span> GetImageGroup() const; + AZStd::span> GetBufferGroup() const; + AZStd::span GetSamplerGroup() const; + //! Reset image and buffer views setup for this ShaderResourceGroupData //! So it won't hold references for any RHI resources void ResetViews(); //! Returns the opaque constant data populated by calls to SetConstant and SetConstantData. - //! + //! //! CAUTION! //! Different platforms might follow different packing rules for the internally-managed SRG constant buffer. - AZStd::array_view GetConstantData() const; + AZStd::span GetConstantData() const; //! Returns the underlying ConstantsData struct const ConstantsData& GetConstantsData() const; @@ -213,7 +213,7 @@ namespace AZ //! times in order to ensure all SRG buffers are updated. void DisableCompilationForAllResourceTypes(); - //! Returns true if any of the resource type has been enabled for compilation. + //! Returns true if any of the resource type has been enabled for compilation. bool IsAnyResourceTypeUpdated() const; //! Enable compilation for a resourceType specified by resourceType/resourceTypeMask @@ -265,7 +265,7 @@ namespace AZ EnableResourceTypeCompilation(ResourceTypeMask::ConstantDataMask, ResourceType::ConstantData); return m_constantsData.SetConstant(inputIndex, value, arrayIndex); } - + template bool ShaderResourceGroupData::SetConstantMatrixRows(ShaderInputConstantIndex inputIndex, const T& value, uint32_t rowCount) { @@ -274,7 +274,7 @@ namespace AZ } template - bool ShaderResourceGroupData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::array_view values) + bool ShaderResourceGroupData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::span values) { if (!values.empty()) { @@ -284,7 +284,7 @@ namespace AZ } template - AZStd::array_view ShaderResourceGroupData::GetConstantArray(ShaderInputConstantIndex inputIndex) const + AZStd::span ShaderResourceGroupData::GetConstantArray(ShaderInputConstantIndex inputIndex) const { return m_constantsData.GetConstantArray(inputIndex); } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h index 4efc7da002..f1138804ab 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamBufferView.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include namespace AZ @@ -65,6 +65,6 @@ namespace AZ }; /// Utility function for checking that the set of StreamBufferViews aligns with the InputStreamLayout - bool ValidateStreamBufferViews(const InputStreamLayout& inputStreamLayout, AZStd::array_view streamBufferViews); + bool ValidateStreamBufferViews(const InputStreamLayout& inputStreamLayout, AZStd::span streamBufferViews); } } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamingImagePool.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamingImagePool.h index ee139b6dc2..a719ce5a7a 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamingImagePool.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/StreamingImagePool.h @@ -11,7 +11,7 @@ #include #include -#include +#include namespace AZ { @@ -34,7 +34,7 @@ namespace AZ struct StreamingImageMipSlice { /// An array of subresource datas. The size of this array must match the array size of the image. - AZStd::array_view m_subresources; + AZStd::span m_subresources; /// The layout of each image in the array. ImageSubresourceLayout m_subresourceLayout; @@ -52,7 +52,7 @@ namespace AZ StreamingImageInitRequest( Image& image, const ImageDescriptor& descriptor, - AZStd::array_view tailMipSlices); + AZStd::span tailMipSlices); /// The image to initialize. Image* m_image = nullptr; @@ -65,7 +65,7 @@ namespace AZ * This should only include the baseline set of mips necessary to render the image at * its lowest resolution. The uploads is performed synchronously. */ - AZStd::array_view m_tailMipSlices; + AZStd::span m_tailMipSlices; }; /** @@ -83,7 +83,7 @@ namespace AZ * remain valid for the duration of the upload (until m_completeCallback * is triggered). */ - AZStd::array_view m_mipSlices; + AZStd::span m_mipSlices; /// Whether the function need to wait until the upload is finished. bool m_waitForUpload = false; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/TransientAttachmentPool.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/TransientAttachmentPool.h index 334568154c..49317250f4 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/TransientAttachmentPool.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/TransientAttachmentPool.h @@ -123,7 +123,7 @@ namespace AZ protected: // Adds the stats of a list of heaps into the Pool's TransientAttachmentStatistics. - void CollectHeapStats(AliasedResourceTypeFlags typeMask, AZStd::array_view heapStats); + void CollectHeapStats(AliasedResourceTypeFlags typeMask, AZStd::span heapStats); Scope* m_currentScope = nullptr; RHI::TransientAttachmentStatistics m_statistics; diff --git a/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp b/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp index 6b5b9cc3a5..b3a6b01ebb 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp @@ -496,7 +496,7 @@ namespace AZ } AZStd::string RemoveArgumentsFromCommandLineString( - AZStd::array_view listOfArgumentsToRemove, AZStd::string_view commandLineString) + AZStd::span listOfArgumentsToRemove, AZStd::string_view commandLineString) { AZStd::string customizedArguments = commandLineString; for (const AZStd::string& azslcArgumentName : listOfArgumentsToRemove) diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ConstantsLayout.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ConstantsLayout.cpp index 8b9d6ae668..cdbd74ca17 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ConstantsLayout.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ConstantsLayout.cpp @@ -106,7 +106,7 @@ namespace AZ return m_inputs[inputIndex.GetIndex()]; } - AZStd::array_view ConstantsLayout::GetShaderInputList() const + AZStd::span ConstantsLayout::GetShaderInputList() const { return m_inputs; } @@ -145,7 +145,7 @@ namespace AZ return true; } - void ConstantsLayout::DebugPrintNames(AZStd::array_view constantList) const + void ConstantsLayout::DebugPrintNames(AZStd::span constantList) const { AZStd::string output; for (const ShaderInputConstantIndex& constantIdx : constantList) diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/IndirectBufferLayout.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/IndirectBufferLayout.cpp index 4eb5ca0abb..467d9f5cb1 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/IndirectBufferLayout.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/IndirectBufferLayout.cpp @@ -137,11 +137,11 @@ namespace AZ return true; } - AZStd::array_view IndirectBufferLayout::GetCommands() const + AZStd::span IndirectBufferLayout::GetCommands() const { if (!ValidateFinalizeState(ValidateFinalizeStateExpect::Finalized)) { - return AZStd::array_view(); + return AZStd::span(); } return m_commands; } diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/InputStreamLayout.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/InputStreamLayout.cpp index 3b548446b9..1ddb41ac8e 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/InputStreamLayout.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/InputStreamLayout.cpp @@ -159,12 +159,12 @@ namespace AZ return m_topology; } - AZStd::array_view InputStreamLayout::GetStreamChannels() const + AZStd::span InputStreamLayout::GetStreamChannels() const { return m_streamChannels; } - AZStd::array_view InputStreamLayout::GetStreamBuffers() const + AZStd::span InputStreamLayout::GetStreamBuffers() const { return m_streamBuffers; } diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/PipelineLibraryData.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/PipelineLibraryData.cpp index 1efe5d895a..1f0458032f 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/PipelineLibraryData.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/PipelineLibraryData.cpp @@ -31,7 +31,7 @@ namespace AZ : m_data{AZStd::move(data)} {} - AZStd::array_view PipelineLibraryData::GetData() const + AZStd::span PipelineLibraryData::GetData() const { return m_data; } diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp index 6028593017..357d6da51a 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp @@ -432,7 +432,7 @@ namespace AZ m_bindingSlot = Handle(bindingSlot); } - AZStd::array_view ShaderResourceGroupLayout::GetStaticSamplers() const + AZStd::span ShaderResourceGroupLayout::GetStaticSamplers() const { return m_staticSamplers; } @@ -497,32 +497,32 @@ namespace AZ return m_constantsDataLayout->GetShaderInput(index); } - AZStd::array_view ShaderResourceGroupLayout::GetShaderInputListForBuffers() const + AZStd::span ShaderResourceGroupLayout::GetShaderInputListForBuffers() const { return m_inputsForBuffers; } - AZStd::array_view ShaderResourceGroupLayout::GetShaderInputListForImages() const + AZStd::span ShaderResourceGroupLayout::GetShaderInputListForImages() const { return m_inputsForImages; } - AZStd::array_view ShaderResourceGroupLayout::GetShaderInputListForSamplers() const + AZStd::span ShaderResourceGroupLayout::GetShaderInputListForSamplers() const { return m_inputsForSamplers; } - AZStd::array_view ShaderResourceGroupLayout::GetShaderInputListForConstants() const + AZStd::span ShaderResourceGroupLayout::GetShaderInputListForConstants() const { return m_constantsDataLayout->GetShaderInputList(); } - AZStd::array_view ShaderResourceGroupLayout::GetShaderInputListForBufferUnboundedArrays() const + AZStd::span ShaderResourceGroupLayout::GetShaderInputListForBufferUnboundedArrays() const { return m_inputsForBufferUnboundedArrays; } - AZStd::array_view ShaderResourceGroupLayout::GetShaderInputListForImageUnboundedArrays() const + AZStd::span ShaderResourceGroupLayout::GetShaderInputListForImageUnboundedArrays() const { return m_inputsForImageUnboundedArrays; } diff --git a/Gems/Atom/RHI/Code/Source/RHI/ConstantsData.cpp b/Gems/Atom/RHI/Code/Source/RHI/ConstantsData.cpp index a86f278ee2..bff7c7e626 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/ConstantsData.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/ConstantsData.cpp @@ -144,7 +144,7 @@ namespace AZ } template <> - bool ConstantsData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::array_view values) + bool ConstantsData::SetConstantArray(ShaderInputConstantIndex inputIndex, AZStd::span values) { // The shader packs type bool as 4 bytes const size_t elementSize = 4; @@ -310,7 +310,7 @@ namespace AZ template <> bool ConstantsData::GetConstant(ShaderInputConstantIndex inputIndex) const { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); // The shader packs bool data as 4 bytes const size_t sizeInBytes = 4; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) @@ -328,7 +328,7 @@ namespace AZ const size_t sizeInBytes = sizeof(float) * 11; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) { - const AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + const AZStd::span constantBytes = GetConstantRaw(inputIndex); // As per shader packing rules the Matrix3x3 is stored as 11 floats (2 are padding). float localData[12]; @@ -348,7 +348,7 @@ namespace AZ const uint32_t sizeInBytes = sizeof(Matrix3x4); if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) { - const AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + const AZStd::span constantBytes = GetConstantRaw(inputIndex); const Matrix3x4& resultMatrix = Matrix3x4::CreateFromRowMajorFloat12(reinterpret_cast(constantBytes.data())); return resultMatrix; } @@ -361,7 +361,7 @@ namespace AZ const size_t sizeInBytes = sizeof(float) * 16; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, sizeInBytes)) { - const AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + const AZStd::span constantBytes = GetConstantRaw(inputIndex); const Matrix4x4& resultMatrix = Matrix4x4::CreateFromRowMajorFloat16(reinterpret_cast(constantBytes.data())); return resultMatrix; } @@ -374,7 +374,7 @@ namespace AZ constexpr size_t vector2Size = 8; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, aznumeric_caster(vector2Size))) { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); return Vector2::CreateFromFloat2(reinterpret_cast(constantBytes.data())); } return Vector2(); @@ -387,7 +387,7 @@ namespace AZ constexpr size_t vector3Size = sizeof(float) * 3; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, vector3Size)) { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); return Vector3::CreateFromFloat3(reinterpret_cast(constantBytes.data())); } return Vector3(); @@ -399,7 +399,7 @@ namespace AZ constexpr size_t vector4Size = 16; if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, aznumeric_caster(vector4Size))) { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); return Vector4::CreateFromFloat4(reinterpret_cast(constantBytes.data())); } return Vector4(); @@ -411,19 +411,19 @@ namespace AZ constexpr size_t colorSize = sizeof(Color); if (ValidateConstantAccess(inputIndex, ValidateConstantAccessExpect::Complete, 0, aznumeric_caster(colorSize))) { - AZStd::array_view constantBytes = GetConstantRaw(inputIndex); + AZStd::span constantBytes = GetConstantRaw(inputIndex); return Color::CreateFromFloat4(reinterpret_cast(constantBytes.data())); } return Color(); } - AZStd::array_view ConstantsData::GetConstantRaw(ShaderInputConstantIndex inputIndex) const + AZStd::span ConstantsData::GetConstantRaw(ShaderInputConstantIndex inputIndex) const { const Interval interval = GetLayout()->GetInterval(inputIndex); - return AZStd::array_view(&m_constantData[interval.m_min], interval.m_max - interval.m_min); + return AZStd::span(&m_constantData[interval.m_min], interval.m_max - interval.m_min); } - AZStd::array_view ConstantsData::GetConstantData() const + AZStd::span ConstantsData::GetConstantData() const { return m_constantData; } @@ -436,11 +436,11 @@ namespace AZ bool ConstantsData::ConstantIsEqual(const ConstantsData& other, ShaderInputConstantIndex inputIndex) const { - AZStd::array_view myConstant = GetConstantRaw(inputIndex); - AZStd::array_view otherConstant = other.GetConstantRaw(inputIndex); + AZStd::span myConstant = GetConstantRaw(inputIndex); + AZStd::span otherConstant = other.GetConstantRaw(inputIndex); // If they point to the same data, they are equal - if (myConstant == otherConstant) + if (myConstant.data() == otherConstant.data() && myConstant.size() == otherConstant.size()) { return true; } @@ -474,8 +474,8 @@ namespace AZ return differingIndices; } - AZStd::array_view myShaderInputs = m_layout->GetShaderInputList(); - AZStd::array_view otherShaderInputs = other.m_layout->GetShaderInputList(); + AZStd::span myShaderInputs = m_layout->GetShaderInputList(); + AZStd::span otherShaderInputs = other.m_layout->GetShaderInputList(); size_t minSize = AZStd::min(myShaderInputs.size(), otherShaderInputs.size()); size_t maxSize = AZStd::max(myShaderInputs.size(), otherShaderInputs.size()); diff --git a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp index ec9dd1a14f..1cfd745227 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp @@ -33,29 +33,29 @@ namespace AZ m_indexBufferView = indexBufferView; } - void DrawPacketBuilder::SetRootConstants(AZStd::array_view rootConstants) + void DrawPacketBuilder::SetRootConstants(AZStd::span rootConstants) { m_rootConstants = rootConstants; } - void DrawPacketBuilder::SetScissors(AZStd::array_view scissors) + void DrawPacketBuilder::SetScissors(AZStd::span scissors) { m_scissors = decltype(m_scissors)(scissors.begin(), scissors.end()); } void DrawPacketBuilder::SetScissor(const Scissor& scissor) { - SetScissors(AZStd::array_view(&scissor, 1)); + SetScissors(AZStd::span(&scissor, 1)); } - void DrawPacketBuilder::SetViewports(AZStd::array_view viewports) + void DrawPacketBuilder::SetViewports(AZStd::span viewports) { m_viewports = decltype(m_viewports)(viewports.begin(), viewports.end()); } void DrawPacketBuilder::SetViewport(const Viewport& viewport) { - SetViewports(AZStd::array_view(&viewport, 1)); + SetViewports(AZStd::span(&viewport, 1)); } void DrawPacketBuilder::AddShaderResourceGroup(const ShaderResourceGroup* shaderResourceGroup) diff --git a/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp b/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp index 25158b1b3d..08840670a0 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/FrameGraph.cpp @@ -327,7 +327,7 @@ namespace AZ return ResultCode::InvalidArgument; } - ResultCode FrameGraph::UseAttachments(AZStd::array_view descriptors, ScopeAttachmentAccess access, ScopeAttachmentUsage usage) + ResultCode FrameGraph::UseAttachments(AZStd::span descriptors, ScopeAttachmentAccess access, ScopeAttachmentUsage usage) { for (const ImageScopeAttachmentDescriptor& descriptor : descriptors) { @@ -354,7 +354,7 @@ namespace AZ return ResultCode::InvalidArgument; } - ResultCode FrameGraph::UseColorAttachments(AZStd::array_view descriptors) + ResultCode FrameGraph::UseColorAttachments(AZStd::span descriptors) { return UseAttachments(descriptors, ScopeAttachmentAccess::Write, ScopeAttachmentUsage::RenderTarget); } @@ -364,7 +364,7 @@ namespace AZ return UseAttachment(descriptor, access, ScopeAttachmentUsage::DepthStencil); } - ResultCode FrameGraph::UseSubpassInputAttachments(AZStd::array_view descriptors) + ResultCode FrameGraph::UseSubpassInputAttachments(AZStd::span descriptors) { return UseAttachments(descriptors, ScopeAttachmentAccess::Read, ScopeAttachmentUsage::SubpassInput); } diff --git a/Gems/Atom/RHI/Code/Source/RHI/FrameGraphExecuter.cpp b/Gems/Atom/RHI/Code/Source/RHI/FrameGraphExecuter.cpp index 7599e9c8f6..a27d34b4c2 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/FrameGraphExecuter.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/FrameGraphExecuter.cpp @@ -19,7 +19,7 @@ namespace AZ m_jobPolicy = jobPolicy; } - AZStd::array_view> FrameGraphExecuter::GetGroups() const + AZStd::span> FrameGraphExecuter::GetGroups() const { return m_groups; } diff --git a/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp index be0428bc91..6a05565c38 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp @@ -44,7 +44,7 @@ namespace AZ return resultCode; } - ResultCode PipelineLibrary::MergeInto(AZStd::array_view librariesToMerge) + ResultCode PipelineLibrary::MergeInto(AZStd::span librariesToMerge) { if (!ValidateIsInitialized()) { diff --git a/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp b/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp index eed14b41b7..09006f0a60 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupData.cpp @@ -112,7 +112,7 @@ namespace AZ return SetImageViewArray(inputIndex, imageViews, arrayIndex); } - bool ShaderResourceGroupData::SetImageViewArray(ShaderInputImageIndex inputIndex, AZStd::array_view imageViews, uint32_t arrayIndex) + bool ShaderResourceGroupData::SetImageViewArray(ShaderInputImageIndex inputIndex, AZStd::span imageViews, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, static_cast(arrayIndex + imageViews.size() - 1))) { @@ -132,13 +132,13 @@ namespace AZ { EnableResourceTypeCompilation(ResourceTypeMask::ImageViewMask, ResourceType::ImageView); } - + return isValidAll; } return false; } - bool ShaderResourceGroupData::SetImageViewUnboundedArray(ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::array_view imageViews) + bool ShaderResourceGroupData::SetImageViewUnboundedArray(ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::span imageViews) { if (GetLayout()->ValidateAccess(inputIndex)) { @@ -169,7 +169,7 @@ namespace AZ return SetBufferViewArray(inputIndex, bufferViews, arrayIndex); } - bool ShaderResourceGroupData::SetBufferViewArray(ShaderInputBufferIndex inputIndex, AZStd::array_view bufferViews, uint32_t arrayIndex) + bool ShaderResourceGroupData::SetBufferViewArray(ShaderInputBufferIndex inputIndex, AZStd::span bufferViews, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, static_cast(arrayIndex + bufferViews.size() - 1))) { @@ -194,7 +194,7 @@ namespace AZ return false; } - bool ShaderResourceGroupData::SetBufferViewUnboundedArray(ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::array_view bufferViews) + bool ShaderResourceGroupData::SetBufferViewUnboundedArray(ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::span bufferViews) { if (GetLayout()->ValidateAccess(inputIndex)) { @@ -221,10 +221,10 @@ namespace AZ bool ShaderResourceGroupData::SetSampler(ShaderInputSamplerIndex inputIndex, const SamplerState& sampler, uint32_t arrayIndex) { - return SetSamplerArray(inputIndex, AZStd::array_view(&sampler, 1), arrayIndex); + return SetSamplerArray(inputIndex, AZStd::span(&sampler, 1), arrayIndex); } - bool ShaderResourceGroupData::SetSamplerArray(ShaderInputSamplerIndex inputIndex, AZStd::array_view samplers, uint32_t arrayIndex) + bool ShaderResourceGroupData::SetSamplerArray(ShaderInputSamplerIndex inputIndex, AZStd::span samplers, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, static_cast(arrayIndex + samplers.size() - 1))) { @@ -241,7 +241,7 @@ namespace AZ return true; } return false; - } + } bool ShaderResourceGroupData::SetConstantRaw(ShaderInputConstantIndex inputIndex, const void* bytes, uint32_t byteCount) { @@ -265,7 +265,7 @@ namespace AZ EnableResourceTypeCompilation(ResourceTypeMask::ConstantDataMask, ResourceType::ConstantData); return m_constantsData.SetConstantData(bytes, byteOffset, byteCount); } - + const RHI::ConstPtr& ShaderResourceGroupData::GetImageView(RHI::ShaderInputImageIndex inputIndex, uint32_t arrayIndex) const { if (GetLayout()->ValidateAccess(inputIndex, arrayIndex)) @@ -276,21 +276,21 @@ namespace AZ return s_nullImageView; } - AZStd::array_view> ShaderResourceGroupData::GetImageViewArray(RHI::ShaderInputImageIndex inputIndex) const + AZStd::span> ShaderResourceGroupData::GetImageViewArray(RHI::ShaderInputImageIndex inputIndex) const { if (GetLayout()->ValidateAccess(inputIndex, 0)) { const Interval interval = GetLayout()->GetGroupInterval(inputIndex); - return AZStd::array_view>(&m_imageViews[interval.m_min], interval.m_max - interval.m_min); + return AZStd::span>(&m_imageViews[interval.m_min], interval.m_max - interval.m_min); } return {}; } - AZStd::array_view> ShaderResourceGroupData::GetImageViewUnboundedArray(RHI::ShaderInputImageUnboundedArrayIndex inputIndex) const + AZStd::span> ShaderResourceGroupData::GetImageViewUnboundedArray(RHI::ShaderInputImageUnboundedArrayIndex inputIndex) const { if (GetLayout()->ValidateAccess(inputIndex)) { - return AZStd::array_view>(m_imageViewsUnboundedArray.data(), m_imageViewsUnboundedArray.size()); + return AZStd::span>(m_imageViewsUnboundedArray.data(), m_imageViewsUnboundedArray.size()); } return {}; } @@ -305,21 +305,21 @@ namespace AZ return s_nullBufferView; } - AZStd::array_view> ShaderResourceGroupData::GetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex) const + AZStd::span> ShaderResourceGroupData::GetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex) const { if (GetLayout()->ValidateAccess(inputIndex, 0)) { const Interval interval = GetLayout()->GetGroupInterval(inputIndex); - return AZStd::array_view>(&m_bufferViews[interval.m_min], interval.m_max - interval.m_min); + return AZStd::span>(&m_bufferViews[interval.m_min], interval.m_max - interval.m_min); } return {}; } - AZStd::array_view> ShaderResourceGroupData::GetBufferViewUnboundedArray(RHI::ShaderInputBufferUnboundedArrayIndex inputIndex) const + AZStd::span> ShaderResourceGroupData::GetBufferViewUnboundedArray(RHI::ShaderInputBufferUnboundedArrayIndex inputIndex) const { if (GetLayout()->ValidateAccess(inputIndex)) { - return AZStd::array_view>(m_bufferViewsUnboundedArray.data(), m_bufferViewsUnboundedArray.size()); + return AZStd::span>(m_bufferViewsUnboundedArray.data(), m_bufferViewsUnboundedArray.size()); } return {}; } @@ -334,28 +334,28 @@ namespace AZ return s_nullSamplerState; } - AZStd::array_view ShaderResourceGroupData::GetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex) const + AZStd::span ShaderResourceGroupData::GetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex) const { const Interval interval = GetLayout()->GetGroupInterval(inputIndex); - return AZStd::array_view(&m_samplers[interval.m_min], interval.m_max - interval.m_min); + return AZStd::span(&m_samplers[interval.m_min], interval.m_max - interval.m_min); } - AZStd::array_view ShaderResourceGroupData::GetConstantRaw(ShaderInputConstantIndex inputIndex) const + AZStd::span ShaderResourceGroupData::GetConstantRaw(ShaderInputConstantIndex inputIndex) const { return m_constantsData.GetConstantRaw(inputIndex); } - AZStd::array_view> ShaderResourceGroupData::GetImageGroup() const + AZStd::span> ShaderResourceGroupData::GetImageGroup() const { return m_imageViews; } - AZStd::array_view> ShaderResourceGroupData::GetBufferGroup() const + AZStd::span> ShaderResourceGroupData::GetBufferGroup() const { return m_bufferViews; } - AZStd::array_view ShaderResourceGroupData::GetSamplerGroup() const + AZStd::span ShaderResourceGroupData::GetSamplerGroup() const { return m_samplers; } @@ -368,7 +368,7 @@ namespace AZ m_bufferViewsUnboundedArray.assign(m_bufferViewsUnboundedArray.size(), nullptr); } - AZStd::array_view ShaderResourceGroupData::GetConstantData() const + AZStd::span ShaderResourceGroupData::GetConstantData() const { return m_constantsData.GetConstantData(); } diff --git a/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupPool.cpp index 5d1da487ab..797fdec089 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -202,8 +202,8 @@ namespace AZ // Generate diffs for image views. if (HasImageGroup()) { - AZStd::array_view> viewGroupOld = shaderResourceGroup.GetData().GetImageGroup(); - AZStd::array_view> viewGroupNew = groupData.GetImageGroup(); + AZStd::span> viewGroupOld = shaderResourceGroup.GetData().GetImageGroup(); + AZStd::span> viewGroupNew = groupData.GetImageGroup(); AZ_Assert(viewGroupOld.size() == viewGroupNew.size(), "ShaderResourceGroupData layouts do not match."); for (size_t i = 0; i < viewGroupOld.size(); ++i) { @@ -214,8 +214,8 @@ namespace AZ // Generate diffs for buffer views. if (HasBufferGroup()) { - AZStd::array_view> viewGroupOld = shaderResourceGroup.GetData().GetBufferGroup(); - AZStd::array_view> viewGroupNew = groupData.GetBufferGroup(); + AZStd::span> viewGroupOld = shaderResourceGroup.GetData().GetBufferGroup(); + AZStd::span> viewGroupNew = groupData.GetBufferGroup(); AZ_Assert(viewGroupOld.size() == viewGroupNew.size(), "ShaderResourceGroupData layouts do not match."); for (size_t i = 0; i < viewGroupOld.size(); ++i) { diff --git a/Gems/Atom/RHI/Code/Source/RHI/StreamBufferView.cpp b/Gems/Atom/RHI/Code/Source/RHI/StreamBufferView.cpp index 0d4a826362..b88f58e8ff 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/StreamBufferView.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/StreamBufferView.cpp @@ -56,7 +56,7 @@ namespace AZ return m_byteStride; } - bool ValidateStreamBufferViews(const RHI::InputStreamLayout& inputStreamLayout, AZStd::array_view streamBufferViews) + bool ValidateStreamBufferViews(const RHI::InputStreamLayout& inputStreamLayout, AZStd::span streamBufferViews) { bool ok = true; diff --git a/Gems/Atom/RHI/Code/Source/RHI/StreamingImagePool.cpp b/Gems/Atom/RHI/Code/Source/RHI/StreamingImagePool.cpp index 6db8da3b55..7bddb4d2f4 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/StreamingImagePool.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/StreamingImagePool.cpp @@ -14,7 +14,7 @@ namespace AZ StreamingImageInitRequest::StreamingImageInitRequest( Image& image, const ImageDescriptor& descriptor, - AZStd::array_view tailMipSlices) + AZStd::span tailMipSlices) : m_image{&image} , m_descriptor{descriptor} , m_tailMipSlices{tailMipSlices} diff --git a/Gems/Atom/RHI/Code/Source/RHI/TransientAttachmentPool.cpp b/Gems/Atom/RHI/Code/Source/RHI/TransientAttachmentPool.cpp index 4e5f83fa8c..2169fcd5d7 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/TransientAttachmentPool.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/TransientAttachmentPool.cpp @@ -117,7 +117,7 @@ namespace AZ return m_compileFlags; } - void TransientAttachmentPool::CollectHeapStats(AliasedResourceTypeFlags typeMask, AZStd::array_view heapStats) + void TransientAttachmentPool::CollectHeapStats(AliasedResourceTypeFlags typeMask, AZStd::span heapStats) { // [GFX_TODO][ATOM-4162] Report the memory allocated stat correctly (or as close as possible) when the heap // supports multiple resource types. Right now we are assigning all the memory used to one resource type. diff --git a/Gems/Atom/RHI/Code/Tests/InputStreamLayoutBuilderTests.cpp b/Gems/Atom/RHI/Code/Tests/InputStreamLayoutBuilderTests.cpp index 07b9078a4c..8b5bac4374 100644 --- a/Gems/Atom/RHI/Code/Tests/InputStreamLayoutBuilderTests.cpp +++ b/Gems/Atom/RHI/Code/Tests/InputStreamLayoutBuilderTests.cpp @@ -20,7 +20,7 @@ namespace UnitTest { protected: - void ExpectEq(AZStd::array_view expected, AZStd::array_view actual) + void ExpectEq(AZStd::span expected, AZStd::span actual) { EXPECT_EQ(expected.size(), actual.size()); for (int i = 0; i < expected.size() && i < actual.size(); ++i) @@ -31,7 +31,7 @@ namespace UnitTest } } - void ExpectEq(AZStd::array_view expected, AZStd::array_view actual) + void ExpectEq(AZStd::span expected, AZStd::span actual) { EXPECT_EQ(expected.size(), actual.size()); for (int i = 0; i < expected.size() && i < actual.size(); ++i) diff --git a/Gems/Atom/RHI/Code/Tests/PipelineState.cpp b/Gems/Atom/RHI/Code/Tests/PipelineState.cpp index 248f4d4b60..eefd6931a1 100644 --- a/Gems/Atom/RHI/Code/Tests/PipelineState.cpp +++ b/Gems/Atom/RHI/Code/Tests/PipelineState.cpp @@ -28,7 +28,7 @@ namespace UnitTest { } - RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::array_view libraries) + RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::span libraries) { return RHI::ResultCode::Success; } diff --git a/Gems/Atom/RHI/Code/Tests/PipelineState.h b/Gems/Atom/RHI/Code/Tests/PipelineState.h index 93478a8d73..ddaedfd73b 100644 --- a/Gems/Atom/RHI/Code/Tests/PipelineState.h +++ b/Gems/Atom/RHI/Code/Tests/PipelineState.h @@ -25,7 +25,7 @@ namespace UnitTest private: AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, const AZ::RHI::PipelineLibraryData*) override { return AZ::RHI::ResultCode::Success; } void ShutdownInternal() override; - AZ::RHI::ResultCode MergeIntoInternal(AZStd::array_view) override; + AZ::RHI::ResultCode MergeIntoInternal(AZStd::span) override; AZ::RHI::ConstPtr GetSerializedDataInternal() const override { return nullptr; } }; diff --git a/Gems/Atom/RHI/Code/Tests/RenderAttachmentLayoutBuilderTests.cpp b/Gems/Atom/RHI/Code/Tests/RenderAttachmentLayoutBuilderTests.cpp index fef484a3cd..2ed68750ad 100644 --- a/Gems/Atom/RHI/Code/Tests/RenderAttachmentLayoutBuilderTests.cpp +++ b/Gems/Atom/RHI/Code/Tests/RenderAttachmentLayoutBuilderTests.cpp @@ -21,13 +21,13 @@ namespace UnitTest protected: template - void ExpectEqMemory(AZStd::array_view expected, AZStd::array_view actual) + void ExpectEqMemory(AZStd::span expected, AZStd::span actual) { EXPECT_EQ(expected.size(), actual.size()); EXPECT_TRUE(memcmp(expected.data(), actual.data(), expected.size() * sizeof(T)) == 0); } - void ExpectEq(AZStd::array_view expected, AZStd::array_view actual) + void ExpectEq(AZStd::span expected, AZStd::span actual) { EXPECT_EQ(expected.size(), actual.size()); for (int i = 0; i < expected.size() && i < actual.size(); ++i) diff --git a/Gems/Atom/RHI/Code/Tests/ShaderResourceGroupTests.cpp b/Gems/Atom/RHI/Code/Tests/ShaderResourceGroupTests.cpp index 83b3b68b25..9544bd971a 100644 --- a/Gems/Atom/RHI/Code/Tests/ShaderResourceGroupTests.cpp +++ b/Gems/Atom/RHI/Code/Tests/ShaderResourceGroupTests.cpp @@ -316,7 +316,7 @@ namespace UnitTest const auto ValidateFloat4Values = [&]() { - AZStd::array_view float4ValueResult = srgData.GetConstantArray(float4ValueIndex); + AZStd::span float4ValueResult = srgData.GetConstantArray(float4ValueIndex); EXPECT_EQ(float4ValueResult.size(), 4); EXPECT_EQ(float4ValueResult[0], float4Values[0]); EXPECT_EQ(float4ValueResult[1], float4Values[1]); @@ -324,13 +324,13 @@ namespace UnitTest EXPECT_EQ(float4ValueResult[3], float4Values[3]); }; - AZStd::array_view uintValuesResult = srgData.GetConstantArray(uintValueIndex); + AZStd::span uintValuesResult = srgData.GetConstantArray(uintValueIndex); EXPECT_EQ(uintValuesResult.size(), 3); EXPECT_EQ(uintValuesResult[0], uintValues[0]); EXPECT_EQ(uintValuesResult[1], uintValues[1]); EXPECT_EQ(uintValuesResult[2], uintValues[2]); - AZStd::array_view nestedDataResult = srgData.GetConstantArray(nestedDataIndex); + AZStd::span nestedDataResult = srgData.GetConstantArray(nestedDataIndex); EXPECT_EQ(nestedDataResult.size(), 16); ValidateFloat4Values(); @@ -484,17 +484,17 @@ namespace UnitTest const Vector4 vector4 = Vector4::CreateFromFloat4(vector4values); EXPECT_TRUE(srgData.SetConstant(vector2index, vector2)); - AZStd::array_view resultVector2 = srgData.GetConstantRaw(vector2index); + AZStd::span resultVector2 = srgData.GetConstantRaw(vector2index); const Vector2 vector2result = *reinterpret_cast(resultVector2.data()); EXPECT_EQ(vector2result, vector2); EXPECT_TRUE(srgData.SetConstant(vector3index, vector3)); - AZStd::array_view resutVector3 = srgData.GetConstantRaw(vector3index); + AZStd::span resutVector3 = srgData.GetConstantRaw(vector3index); const Vector3 vector3result = *reinterpret_cast(resutVector3.data()); EXPECT_EQ(vector3result, vector3); EXPECT_TRUE(srgData.SetConstant(vector4index, vector4)); - AZStd::array_view resutVector4 = srgData.GetConstantRaw(vector4index); + AZStd::span resutVector4 = srgData.GetConstantRaw(vector4index); const Vector4 vector4result = *reinterpret_cast(resutVector4.data()); EXPECT_EQ(vector4result, vector4); } @@ -524,7 +524,7 @@ namespace UnitTest AZ_TEST_START_ASSERTTEST; EXPECT_FALSE(srgData.SetConstant(vector2index, vector3)); AZ_TEST_STOP_ASSERTTEST(1); - AZStd::array_view resutV3 = srgData.GetConstantRaw(vector2index); + AZStd::span resutV3 = srgData.GetConstantRaw(vector2index); const Vector3 v3result = *reinterpret_cast(resutV3.data()); EXPECT_NE(v3result, vector3); @@ -534,7 +534,7 @@ namespace UnitTest AZ_TEST_START_ASSERTTEST; EXPECT_FALSE(srgData.SetConstant(vector3index, vector4)); AZ_TEST_STOP_ASSERTTEST(1); - AZStd::array_view resutV4 = srgData.GetConstantRaw(vector3index); + AZStd::span resutV4 = srgData.GetConstantRaw(vector3index); const Vector4 v4result = *reinterpret_cast(resutV4.data()); EXPECT_NE(v4result, vector4); @@ -544,7 +544,7 @@ namespace UnitTest AZ_TEST_START_ASSERTTEST; EXPECT_FALSE(srgData.SetConstant(vector4index, vector3)); AZ_TEST_STOP_ASSERTTEST(1); - AZStd::array_view resutV3FromIndex4 = srgData.GetConstantRaw(vector4index); + AZStd::span resutV3FromIndex4 = srgData.GetConstantRaw(vector4index); const Vector4 v4resultFromIndex4 = *reinterpret_cast(resutV3FromIndex4.data()); EXPECT_NE(v4resultFromIndex4, vector4); } diff --git a/Gems/Atom/RHI/DX12/Code/Include/Atom/RHI.Reflect/DX12/ShaderStageFunction.h b/Gems/Atom/RHI/DX12/Code/Include/Atom/RHI.Reflect/DX12/ShaderStageFunction.h index e2c325d406..fa04c3a241 100644 --- a/Gems/Atom/RHI/DX12/Code/Include/Atom/RHI.Reflect/DX12/ShaderStageFunction.h +++ b/Gems/Atom/RHI/DX12/Code/Include/Atom/RHI.Reflect/DX12/ShaderStageFunction.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include #include @@ -19,7 +19,7 @@ namespace AZ namespace DX12 { using ShaderByteCode = AZStd::vector; - using ShaderByteCodeView = AZStd::array_view; + using ShaderByteCodeView = AZStd::span; /** * A set of indices used to access physical sub-stages within a virtual stage. diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.h index a468ee4bc2..870d8eef19 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.h @@ -9,7 +9,7 @@ #include -#include +#include namespace AZ { diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.cpp index 25b412fbe1..a3026b592e 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.cpp @@ -129,14 +129,14 @@ namespace AZ const RHI::Viewport* viewports, uint32_t count) { - m_state.m_viewportState.Set(AZStd::array_view(viewports, count)); + m_state.m_viewportState.Set(AZStd::span(viewports, count)); } void CommandList::SetScissors( const RHI::Scissor* scissors, uint32_t count) { - m_state.m_scissorState.Set(AZStd::array_view(scissors, count)); + m_state.m_scissorState.Set(AZStd::span(scissors, count)); } void CommandList::SetShaderResourceGroupForDraw(const RHI::ShaderResourceGroup& shaderResourceGroup) diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h index da71d669b4..1c02af1fdf 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandList.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp index ae3053f446..0f1fab642a 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp @@ -46,7 +46,7 @@ namespace AZ ID3D12DeviceX* dx12Device = device.GetDevice(); #if defined (AZ_DX12_USE_PIPELINE_LIBRARY) - AZStd::array_view bytes; + AZStd::span bytes; bool shouldCreateLibFromSerializedData = true; if (RHI::Factory::Get().IsRenderDocModuleLoaded() || @@ -214,7 +214,7 @@ namespace AZ #endif } - RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::array_view pipelineLibraries) + RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::span pipelineLibraries) { if (RHI::Factory::Get().IsRenderDocModuleLoaded() || RHI::Factory::Get().IsPixModuleLoaded()) @@ -239,14 +239,14 @@ namespace AZ } } #endif - return RHI::ResultCode::Success; + return RHI::ResultCode::Success; } RHI::ConstPtr PipelineLibrary::GetSerializedDataInternal() const { #if defined (AZ_DX12_USE_PIPELINE_LIBRARY) AZStd::lock_guard lock(m_mutex); - + AZStd::vector serializedData(m_library->GetSerializedSize()); HRESULT hr = m_library->Serialize(serializedData.data(), serializedData.size()); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h index b970882246..f34c5bf8ae 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h @@ -33,7 +33,7 @@ namespace AZ // RHI::PipelineLibrary RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryData* serializedData) override; void ShutdownInternal() override; - RHI::ResultCode MergeIntoInternal(AZStd::array_view libraries) override; + RHI::ResultCode MergeIntoInternal(AZStd::span libraries) override; RHI::ConstPtr GetSerializedDataInternal() const override; bool IsMergeRequired() const; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp index e2573c72d9..9ec074cd81 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -20,7 +20,7 @@ namespace AZ namespace DX12 { template - AZStd::vector ShaderResourceGroupPool::GetSRVsFromImageViews(const AZStd::array_view>& imageViews, D3D12_SRV_DIMENSION dimension) + AZStd::vector ShaderResourceGroupPool::GetSRVsFromImageViews(const AZStd::span>& imageViews, D3D12_SRV_DIMENSION dimension) { AZStd::vector cpuSourceDescriptors(imageViews.size(), m_descriptorContext->GetNullHandleSRV(dimension)); @@ -36,7 +36,7 @@ namespace AZ } template - AZStd::vector ShaderResourceGroupPool::GetUAVsFromImageViews(const AZStd::array_view>& imageViews, D3D12_UAV_DIMENSION dimension) + AZStd::vector ShaderResourceGroupPool::GetUAVsFromImageViews(const AZStd::span>& imageViews, D3D12_UAV_DIMENSION dimension) { AZStd::vector cpuSourceDescriptors(imageViews.size(), m_descriptorContext->GetNullHandleUAV(dimension)); for (size_t i = 0; i < cpuSourceDescriptors.size(); ++i) @@ -50,7 +50,7 @@ namespace AZ return cpuSourceDescriptors; } - AZStd::vector ShaderResourceGroupPool::GetCBVsFromBufferViews(const AZStd::array_view>& bufferViews) + AZStd::vector ShaderResourceGroupPool::GetCBVsFromBufferViews(const AZStd::span>& bufferViews) { AZStd::vector cpuSourceDescriptors(bufferViews.size(), m_descriptorContext->GetNullHandleCBV()); @@ -278,7 +278,7 @@ namespace AZ { const RHI::ShaderInputBufferIndex bufferInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); + AZStd::span> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); D3D12_DESCRIPTOR_RANGE_TYPE descriptorRangeType = ConvertShaderInputBufferAccess(shaderInputBuffer.m_access); AZStd::vector descriptorHandles; switch (descriptorRangeType) @@ -313,7 +313,7 @@ namespace AZ { const RHI::ShaderInputImageIndex imageInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = groupData.GetImageViewArray(imageInputIndex); + AZStd::span> imageViews = groupData.GetImageViewArray(imageInputIndex); D3D12_DESCRIPTOR_RANGE_TYPE descriptorRangeType = ConvertShaderInputImageAccess(shaderInputImage.m_access); AZStd::vector descriptorHandles; @@ -349,7 +349,7 @@ namespace AZ { const RHI::ShaderInputSamplerIndex samplerInputIndex(shaderInputIndex); - AZStd::array_view samplers = groupData.GetSamplerArray(samplerInputIndex); + AZStd::span samplers = groupData.GetSamplerArray(samplerInputIndex); UpdateDescriptorTableRange(descriptorTable, samplerInputIndex, samplers); } } @@ -364,7 +364,7 @@ namespace AZ for (const RHI::ShaderInputBufferUnboundedArrayDescriptor& shaderInputBufferUnboundedArray : groupLayout.GetShaderInputListForBufferUnboundedArrays()) { const RHI::ShaderInputBufferUnboundedArrayIndex bufferUnboundedArrayInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = groupData.GetBufferViewUnboundedArray(bufferUnboundedArrayInputIndex); + AZStd::span> bufferViews = groupData.GetBufferViewUnboundedArray(bufferUnboundedArrayInputIndex); uint32_t tableIndex = shaderInputIndex * RHI::Limits::Device::FrameCountMax + group.m_compiledDataIndex; @@ -403,7 +403,7 @@ namespace AZ for (const RHI::ShaderInputImageUnboundedArrayDescriptor& shaderInputImageUnboundedArray : groupLayout.GetShaderInputListForImageUnboundedArrays()) { const RHI::ShaderInputImageUnboundedArrayIndex imageUnboundedArrayInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = groupData.GetImageViewUnboundedArray(imageUnboundedArrayInputIndex); + AZStd::span> imageViews = groupData.GetImageViewUnboundedArray(imageUnboundedArrayInputIndex); uint32_t tableIndex = shaderInputIndex * RHI::Limits::Device::FrameCountMax + group.m_compiledDataIndex; @@ -447,7 +447,7 @@ namespace AZ RHI::ShaderInputBufferAccess bufferAccess) { const RHI::ShaderInputBufferUnboundedArrayIndex bufferUnboundedArrayInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = + AZStd::span> bufferViews = groupData.GetBufferViewUnboundedArray(bufferUnboundedArrayInputIndex); if (bufferViews.empty()) @@ -488,7 +488,7 @@ namespace AZ RHI::ShaderInputImageType imageType) { const RHI::ShaderInputImageUnboundedArrayIndex imageUnboundedArrayInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = + AZStd::span> imageViews = groupData.GetImageViewUnboundedArray(imageUnboundedArrayInputIndex); if (imageViews.empty()) @@ -565,7 +565,7 @@ namespace AZ for (const RHI::ShaderInputBufferUnboundedArrayDescriptor& shaderInputBufferUnboundedArray : groupLayout.GetShaderInputListForBufferUnboundedArrays()) { const RHI::ShaderInputBufferUnboundedArrayIndex bufferUnboundedArrayInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = groupData.GetBufferViewUnboundedArray(bufferUnboundedArrayInputIndex); + AZStd::span> bufferViews = groupData.GetBufferViewUnboundedArray(bufferUnboundedArrayInputIndex); uint32_t tableIndex = shaderInputIndex * RHI::Limits::Device::FrameCountMax + group.m_compiledDataIndex; if (!bufferViews.empty()) @@ -597,7 +597,7 @@ namespace AZ groupLayout.GetShaderInputListForImageUnboundedArrays()) { const RHI::ShaderInputImageUnboundedArrayIndex imageUnboundedArrayInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = + AZStd::span> imageViews = groupData.GetImageViewUnboundedArray(imageUnboundedArrayInputIndex); uint32_t tableIndex = shaderInputIndex * RHI::Limits::Device::FrameCountMax + group.m_compiledDataIndex; @@ -675,7 +675,7 @@ namespace AZ void ShaderResourceGroupPool::UpdateDescriptorTableRange( DescriptorTable descriptorTable, RHI::ShaderInputSamplerIndex samplerInputIndex, - AZStd::array_view samplerStates) + AZStd::span samplerStates) { const DescriptorHandle nullHandle = m_descriptorContext->GetNullHandleSampler(); AZStd::vector cpuSourceDescriptors(aznumeric_caster(samplerStates.size()), nullHandle); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.h index e1b2145097..2c375f7385 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.h @@ -82,7 +82,7 @@ namespace AZ void UpdateDescriptorTableRange( DescriptorTable descriptorTable, RHI::ShaderInputSamplerIndex samplerIndex, - AZStd::array_view samplerStates); + AZStd::span samplerStates); //Cache all the gpu handles for the Descriptor tables related to all the views void CacheGpuHandlesForViews(ShaderResourceGroup& group); @@ -93,12 +93,12 @@ namespace AZ DescriptorTable GetSamplerTable(DescriptorTable descriptorTable, RHI::ShaderInputSamplerIndex samplerInputIndex) const; template - AZStd::vector GetSRVsFromImageViews(const AZStd::array_view>& imageViews, D3D12_SRV_DIMENSION dimension); + AZStd::vector GetSRVsFromImageViews(const AZStd::span>& imageViews, D3D12_SRV_DIMENSION dimension); template - AZStd::vector GetUAVsFromImageViews(const AZStd::array_view>& bufferViews, D3D12_UAV_DIMENSION dimension); + AZStd::vector GetUAVsFromImageViews(const AZStd::span>& bufferViews, D3D12_UAV_DIMENSION dimension); - AZStd::vector GetCBVsFromBufferViews(const AZStd::array_view>& bufferViews); + AZStd::vector GetCBVsFromBufferViews(const AZStd::span>& bufferViews); MemoryPoolSubAllocator m_constantAllocator; DescriptorContext* m_descriptorContext = nullptr; diff --git a/Gems/Atom/RHI/Metal/Code/Include/Atom/RHI.Reflect/Metal/ShaderStageFunction.h b/Gems/Atom/RHI/Metal/Code/Include/Atom/RHI.Reflect/Metal/ShaderStageFunction.h index cb655cd1b6..8069e32644 100644 --- a/Gems/Atom/RHI/Metal/Code/Include/Atom/RHI.Reflect/Metal/ShaderStageFunction.h +++ b/Gems/Atom/RHI/Metal/Code/Include/Atom/RHI.Reflect/Metal/ShaderStageFunction.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp index 8c80205c17..79660f6382 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp @@ -53,7 +53,7 @@ namespace AZ { return AZ::Metal::PipelineLayoutDescriptor::Create(); } - + bool ShaderPlatformInterface::BuildPipelineLayoutDescriptor( RHI::Ptr pipelineLayoutDescriptor, const ShaderResourceGroupInfoList& srgInfoList, @@ -62,10 +62,10 @@ namespace AZ { AZ::Metal::PipelineLayoutDescriptor* metalDescriptor = azrtti_cast(pipelineLayoutDescriptor.get()); AZ_Assert(metalDescriptor, "PipelineLayoutDescriptor should have been created by now"); - + const uint32_t groupLayoutCount = static_cast(srgInfoList.size()); AZ_Assert(groupLayoutCount <= RHI::Limits::Pipeline::ShaderResourceGroupCountMax, "Exceeded ShaderResourceGroupLayout count limit."); - + // Slot to index mapping AZ::Metal::SlotToIndexTable slotToIndexTable; AZ::Metal::IndexToSlotTable indexToSlotTable; @@ -81,17 +81,17 @@ namespace AZ { return first.m_layout->GetBindingSlot() < second.m_layout->GetBindingSlot(); }); - + for (uint32_t groupLayoutIndex = 0; groupLayoutIndex < groupLayoutCount; ++groupLayoutIndex) { const auto& srgInfo = sortedSrgInfos[groupLayoutIndex]; const RHI::ShaderResourceGroupLayout& groupLayout = *srgInfo.m_layout; const uint32_t srgLayoutSlot = groupLayout.GetBindingSlot(); - + AZ_Assert(srgLayoutSlot <= RHI::Limits::Pipeline::ShaderResourceGroupCountMax, "Cannot exceed the array limit"); slotToIndexTable[srgLayoutSlot] = groupLayoutIndex; indexToSlotTable[groupLayoutIndex] = srgLayoutSlot; - + ShaderResourceGroupVisibility srgVisibility; for (const auto& resourceBindInfo : srgInfo.m_bindingInfo.m_resourcesRegisterMap) { @@ -99,24 +99,24 @@ namespace AZ } srgVisibility.m_constantDataStageMask = srgInfo.m_bindingInfo.m_constantDataBindingInfo.m_shaderStageMask; metalDescriptor->AddShaderResourceGroupVisibility(srgVisibility); - + //cache the layout in order to fill out unused variables m_srgLayouts[groupLayoutIndex] = srgInfo.m_layout; } - + if (rootConstantsInfo.m_totalSizeInBytes > 0) { metalDescriptor->SetRootConstantBinding(RootConstantBinding{ rootConstantsInfo.m_registerId, rootConstantsInfo.m_spaceId }); } - + metalDescriptor->SetBindingTables(slotToIndexTable, indexToSlotTable); return metalDescriptor->Finalize() == RHI::ResultCode::Success; } - + RHI::Ptr ShaderPlatformInterface::CreateShaderStageFunction(const StageDescriptor& stageDescriptor) { RHI::Ptr newShaderStageFunction = ShaderStageFunction::Create(RHI::ToRHIShaderStage(stageDescriptor.m_stageType)); - + const Metal::ShaderSourceCode& sourceCode = stageDescriptor.m_sourceCode; //Metal sourceCode is great for debugging but it is not needed as we are also packing the bytecode. This @@ -127,7 +127,7 @@ namespace AZ const AZStd::string& entryFunctionName = stageDescriptor.m_entryFunctionName; newShaderStageFunction->SetByteCode(byteCode); newShaderStageFunction->SetEntryFunctionName(entryFunctionName); - + newShaderStageFunction->Finalize(); return newShaderStageFunction; } @@ -159,7 +159,7 @@ namespace AZ return shaderCompilerArguments.MakeAdditionalAzslcCommandLineString() + " --use-spaces --unique-idx --namespace=mt,vk --root-const=128 --pad-root-const"; } - + AZStd::string ShaderPlatformInterface::GetAzslCompilerWarningParameters(const RHI::ShaderCompilerArguments& shaderCompilerArguments) const { return shaderCompilerArguments.MakeAdditionalAzslcWarningCommandLineString(); @@ -255,7 +255,7 @@ namespace AZ // Stage profile name parameter const AZStd::string shaderModelVersion = "6_2"; - + const AZStd::unordered_map stageToProfileName = { {RHI::ShaderHardwareStage::Vertex, "vs_" + shaderModelVersion}, @@ -268,15 +268,15 @@ namespace AZ AZ_Error(MetalShaderPlatformName, false, "Unsupported shader stage"); return false; } - + // For this approach we will be doing hlsl->spirv(through dxc) and spirv->metalSL(through spirv cross) // Output spirv file AZStd::string shaderSpirvOutputFile = RHI::BuildFileNameWithExtension(shaderSourceFile, tempFolder, "spirv"); - + // Compilation parameters AZStd::string params = shaderCompilerArguments.MakeAdditionalDxcCommandLineString(); params += " -spirv"; // Generate SPIRV shader - + // Enable half precision types when shader model >= 6.2 int shaderModelMajor = 0; int shaderModelMinor = 0; @@ -318,7 +318,7 @@ namespace AZ params.c_str(), // 3 shaderSpirvOutputFile.c_str(), // 4 dxcInputFile.c_str()); // 5 - + // Run dxc Compiler if (!RHI::ExecuteShaderCompiler(dxcRelativePath, dxcCommandOptions, shaderSourceFile, "DXC")) { @@ -329,9 +329,9 @@ namespace AZ { byProducts.m_intermediatePaths.insert(shaderSpirvOutputFile); // the spirv spit by DXC } - + IO::FileIOStream spirvOutFileStream(shaderSpirvOutputFile.data(), AZ::IO::OpenMode::ModeRead | AZ::IO::OpenMode::ModeBinary); - + if (!spirvOutFileStream.IsOpen()) { AZ_Error(MetalShaderPlatformName, false, "Failed because the shader file \"%s\" could not be opened", shaderSpirvOutputFile.data()); @@ -343,12 +343,12 @@ namespace AZ spirvOutFileStream.Close(); return false; } - + // spirv cross compiler executable static const char* spirvCrossRelativePath = "Builders/SPIRVCross/spirv-cross"; - + AZStd::string spirvCrossCommandOptions = AZStd::string::format("--msl --msl-version 20100 --msl-invariant-float-math --msl-argument-buffers --msl-decoration-binding --msl-texture-buffer-native --output \"%s\" \"%s\"", shaderMSLOutputFile.c_str(), shaderSpirvOutputFile.c_str()); - + // Run spirv cross if (!RHI::ExecuteShaderCompiler(spirvCrossRelativePath, spirvCrossCommandOptions, shaderSpirvOutputFile, "SpirvCross")) { @@ -357,7 +357,7 @@ namespace AZ return false; } spirvOutFileStream.Close(); - + IO::FileIOStream outFileStream(shaderMSLOutputFile.data(), IO::OpenMode::ModeRead); bool finalizeShaderResult = UpdateCompiledShader(outFileStream, MetalShaderPlatformName, shaderMSLOutputFile.data(), sourceMetalShader); AZ_Assert(finalizeShaderResult, "Final compiled shader was not created. Check if %s was created", shaderMSLOutputFile.c_str()); @@ -366,7 +366,7 @@ namespace AZ { byProducts.m_intermediatePaths.emplace(AZStd::move(shaderMSLOutputFile)); // .msl metal out of sv-cross } - + bool compileMetalSL = CreateMetalLib(MetalShaderPlatformName, shaderSourceFile, tempFolder, compiledByteCode, sourceMetalShader, platform); if (!compileMetalSL) { @@ -376,7 +376,7 @@ namespace AZ return finalizeShaderResult; } - + bool ShaderPlatformInterface::UpdateCompiledShader(AZ::IO::FileIOStream& fileStream, const char* platformName, const char* fileName, AZStd::vector& compiledShader) const { if (!fileStream.IsOpen()) @@ -390,16 +390,16 @@ namespace AZ fileStream.Close(); return false; } - + compiledShader.resize(fileStream.GetLength() + 1); // +1 to add end of string memset(compiledShader.data(), 0, fileStream.GetLength() + 1); fileStream.Read(fileStream.GetLength(), compiledShader.data()); fileStream.Close(); - + //Ensure that the argument buffer declaration in the shader matches the srg layout return AddUnusedResources(compiledShader); } - + bool ShaderPlatformInterface::CreateMetalLib(const char* platformName, const AZStd::string& shaderSourceFile, const AZStd::string& tempFolder, @@ -408,22 +408,22 @@ namespace AZ const AssetBuilderSDK::PlatformInfo& platform) const { AZStd::string inputMetalFile = RHI::BuildFileNameWithExtension(shaderSourceFile, tempFolder, "metal"); - + AZ::IO::FileIOStream sourceMtlfileStream(inputMetalFile.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeBinary); if (!sourceMtlfileStream.IsOpen()) { AZ_Error(platformName, false, "Failed because the shader file \"%s\" could not be opened", inputMetalFile.c_str()); return false; } - + AZStd::string mtlSource = AZStd::string(sourceMetalShader.begin(), sourceMetalShader.end()); sourceMtlfileStream.Write(mtlSource.size(), mtlSource.data()); sourceMtlfileStream.Close(); - + AZStd::string outputAirFile = RHI::BuildFileNameWithExtension(shaderSourceFile, tempFolder, "air"); AZStd::string outMetalLibFile = RHI::BuildFileNameWithExtension(shaderSourceFile, tempFolder, "metallib"); - - //Debug symbols are always enabled at the moment. Need to turn them off for optimized shader assets. + + //Debug symbols are always enabled at the moment. Need to turn them off for optimized shader assets. AZStd::string shaderDebugInfo = "-gline-tables-only -MO"; AZStd::string shaderMslToAirOptions = "-fpreserve-invariance"; @@ -434,47 +434,47 @@ namespace AZ { platformSdk = "iphoneos"; } - + //Convert to air file AZStd::string mslToAirCommandOptions = AZStd::string::format("-sdk %s metal \"%s\" %s %s -c -o \"%s\"", platformSdk.c_str(), inputMetalFile.c_str(), shaderDebugInfo.c_str(), shaderMslToAirOptions.c_str(), outputAirFile.c_str()); - + if (!RHI::ExecuteShaderCompiler("/usr/bin/xcrun", mslToAirCommandOptions, inputMetalFile, "MslToAir")) { AZ_Error(MetalShaderPlatformName, false, "Failed to convert to AIR file %s", inputMetalFile.c_str()); return false; } - + //convert to metallib AZStd::string airToMetalLibCommandOptions = AZStd::string::format("-sdk %s metallib \"%s\" -o \"%s\"", platformSdk.c_str(), outputAirFile.c_str(), outMetalLibFile.c_str()); - + if (!RHI::ExecuteShaderCompiler("/usr/bin/xcrun", airToMetalLibCommandOptions, outputAirFile, "AirToMetallib")) { AZ_Error(MetalShaderPlatformName, false, "Failed to convert to metallib file"); return false; } - + AZ::IO::FileIOStream fileStream(outMetalLibFile.data(), AZ::IO::OpenMode::ModeRead); compiledByteCode.resize(fileStream.GetLength()); memset(compiledByteCode.data(), 0, fileStream.GetLength() ); fileStream.Read(fileStream.GetLength(), compiledByteCode.data()); fileStream.Close(); - + return true; } - + bool ShaderPlatformInterface::AddUnusedResources(AZStd::vector& compiledShader) const { AZStd::string finalMetalSLStr = AZStd::string(compiledShader.begin(), compiledShader.end()); - + const uint32_t groupLayoutCount = static_cast(m_srgLayouts.size()); AZStd::string constantBufferTempStructs = "\n"; AZStd::string structuredBufferTempStructs = "\n"; - + for (uint32_t groupLayoutIndex = 0; groupLayoutIndex < groupLayoutCount; ++groupLayoutIndex) { //const auto& srgInfo = m_srgInfoList[groupLayoutIndex]; const RHI::ShaderResourceGroupLayout& groupLayout = *m_srgLayouts[groupLayoutIndex]; - + //Check if an argument buffer declaration exists for this srg layout. AZStd::string srgBuffer = AZStd::string::format("spvDescriptorSetBuffer%i", groupLayoutIndex); size_t startOfArgBufferPos = finalMetalSLStr.find(srgBuffer); @@ -485,7 +485,7 @@ namespace AZ size_t endOfArgBufferPos = finalMetalSLStr.find("}", startOfArgBufferPos); AZStd::string fullArgBufferDeclarationStr = finalMetalSLStr.substr(startOfArgBufferPos,endOfArgBufferPos - startOfArgBufferPos + 1); - + //Add all the existing or dummy entries into m_argBufferEntries which is a set. The reason for using a set //is because we need the entries to be sorted based on the register and we do not want duplicates. bool result = AddConstantBufferEntries(groupLayout, constantBufferTempStructs, fullArgBufferDeclarationStr, groupLayoutIndex); @@ -494,44 +494,44 @@ namespace AZ AZ_Error(MetalShaderPlatformName, false, "Failed because adding constant buffer entries within AddUnusedResources failed"); return false; } - + result = AddImageEntries(groupLayout, fullArgBufferDeclarationStr); if(!result) { AZ_Error(MetalShaderPlatformName, false, "Failed because adding image entries within AddUnusedResources failed"); return false; } - + result = AddSamplerEntries(groupLayout, fullArgBufferDeclarationStr); if(!result) { AZ_Error(MetalShaderPlatformName, false, "Failed because adding static sampler entries within AddUnusedResources failed"); return false; } - + result = AddBufferEntries(groupLayout, structuredBufferTempStructs, fullArgBufferDeclarationStr, groupLayoutIndex); if(!result) { AZ_Error(MetalShaderPlatformName, false, "Failed because adding buffer entries within AddUnusedResources failed"); return false; } - + //Create a new spvDescriptorSetBuffer which matches the layout. AZStd::string newArgBufferLayoutStr = "\n"; for (const ArgBufferEntries &entry : m_argBufferEntries ) { newArgBufferLayoutStr += " " + entry.first + "\n"; } - + //Replace the existing declaration with the new one just generated. //We look for '{' and '}' to find out boundaries of the argument buffer declaration to replace size_t startOfArgBufferBracketPos = finalMetalSLStr.find("{", startOfArgBufferPos) + 1; size_t endOfArgBufferBracketPos = finalMetalSLStr.find("}", startOfArgBufferBracketPos) - 1; finalMetalSLStr.replace(startOfArgBufferBracketPos, endOfArgBufferBracketPos - startOfArgBufferBracketPos, newArgBufferLayoutStr); - + m_argBufferEntries.clear(); } - + //Add dummy definitions of constant buffer and structured buffer types to the top of the file AZStd::string startOfShaderTag = "using namespace metal;"; const size_t startOfShaderPos = finalMetalSLStr.find(startOfShaderTag); @@ -540,28 +540,28 @@ namespace AZ finalMetalSLStr.insert(startOfShaderPos + startOfShaderTag.length() + 1, constantBufferTempStructs); finalMetalSLStr.insert(startOfShaderPos + startOfShaderTag.length() + 1, structuredBufferTempStructs); } - + compiledShader = AZStd::vector(finalMetalSLStr.begin(), finalMetalSLStr.end()); return true; } - + bool ShaderPlatformInterface::AddConstantBufferEntries(const RHI::ShaderResourceGroupLayout& groupLayout, AZStd::string& constantBufferTempStructs, AZStd::string& argBufferStr, uint32_t groupLayoutIndex) const { - AZStd::array_view shaderInputConstantList = groupLayout.GetShaderInputListForConstants(); + AZStd::span shaderInputConstantList = groupLayout.GetShaderInputListForConstants(); if (shaderInputConstantList.empty()) { return true; } - + //Only need the information from the first element of the constant buffer. const RHI::ShaderInputConstantDescriptor& shaderInputConstant = shaderInputConstantList[0]; - + uint32_t regId = shaderInputConstant.m_registerId; AZStd::string srgResource = AZStd::string::format("id(%i)", regId); - + size_t resourceStartPos = argBufferStr.find(srgResource); //Check if we need to create a dummy entry if (resourceStartPos == AZStd::string::npos) @@ -578,7 +578,7 @@ namespace AZ * */ constantBufferTempStructs += AZStd::string::format("struct type_DummyStruct%i_DescSet%i\n{\n float dummyArray[%i];\n};\n", regId, groupLayoutIndex, numElements); - + //Create the final resource entry to be added to the set AZStd::string dummyResource = AZStd::string::format("constant type_DummyStruct%i_DescSet%i* dummyConstantBuffer%i [[id(%i)]];", regId, groupLayoutIndex, regId, regId); m_argBufferEntries.insert(AZStd::make_pair(dummyResource, regId)); @@ -590,7 +590,7 @@ namespace AZ return AddExistingResourceEntry("constant type_ConstantBuffer", resourceStartPos, regId, argBufferStr); } } - + bool ShaderPlatformInterface::AddImageEntries(const RHI::ShaderResourceGroupLayout& groupLayout, AZStd::string& argBufferStr) const { @@ -599,7 +599,7 @@ namespace AZ { uint32_t regId = shaderInputImage.m_registerId; AZStd::string srgResource = AZStd::string::format("id(%i)", regId); - + const size_t resourceStartPos = argBufferStr.find(srgResource); //Check if we need to create a dummy entry if (resourceStartPos == AZStd::string::npos) @@ -652,7 +652,7 @@ namespace AZ AZ_Assert(false, "Invalid texture type."); } } - + //Create the resource entry to be added to the set. Handle arrays by checking the shaderInputImage.m_count AZStd::string dummyResource; if(shaderInputImage.m_count > 1) @@ -678,11 +678,11 @@ namespace AZ } return result; } - + bool ShaderPlatformInterface::ProcessSamplerEntry(uint32_t regId, AZStd::string& argBufferStr, uint32_t samplercount) const { AZStd::string srgResource = AZStd::string::format("id(%i)", regId); - + const size_t resourceStartPos = argBufferStr.find(srgResource); //Check if we need to create a dummy entry if (resourceStartPos == AZStd::string::npos) @@ -705,7 +705,7 @@ namespace AZ return AddExistingResourceEntry("sampler", resourceStartPos, regId, argBufferStr); } } - + bool ShaderPlatformInterface::AddSamplerEntries(const RHI::ShaderResourceGroupLayout& groupLayout, AZStd::string& argBufferStr) const { @@ -714,15 +714,15 @@ namespace AZ { result &= ProcessSamplerEntry(staticSampler.m_registerId, argBufferStr, 0); } - + for (const RHI::ShaderInputSamplerDescriptor& dynamicSampler : groupLayout.GetShaderInputListForSamplers()) { result &= ProcessSamplerEntry(dynamicSampler.m_registerId, argBufferStr, dynamicSampler.m_count); } - + return result; } - + bool ShaderPlatformInterface::AddBufferEntries(const RHI::ShaderResourceGroupLayout& groupLayout, AZStd::string& structuredBufferTempStructs, AZStd::string& argBufferStr, @@ -733,7 +733,7 @@ namespace AZ { uint32_t regId = shaderInputBuffer.m_registerId; AZStd::string srgResource = AZStd::string::format("id(%i)", regId); - + size_t resourceStartPos = argBufferStr.find(srgResource); //Check if we need to create a dummy entry if (resourceStartPos == AZStd::string::npos) @@ -755,7 +755,7 @@ namespace AZ */ structuredBufferTempStructs += AZStd::string::format("struct DummySRG_%s_DescSet%i\n{\n float dummyArray[%i];\n};\n", shaderInputBuffer.m_name.GetCStr(), groupLayoutIndex, numElements); structuredBufferTempStructs += AZStd::string::format("struct type_RWStructuredDummyBuffer%i_DescSet%i\n{\n DummySRG_%s_DescSet%i _m0[%i];\n};\n", regId, groupLayoutIndex, shaderInputBuffer.m_name.GetCStr(), groupLayoutIndex, shaderInputBuffer.m_count); - + //Create the final resource entry to be added to the set AZStd::string dummyResource = AZStd::string::format("device type_RWStructuredDummyBuffer%i_DescSet%i* dummyStructuredBuffer%i [[id(%i)]];", regId, groupLayoutIndex, regId, regId); m_argBufferEntries.insert(AZStd::make_pair(dummyResource, regId)); @@ -823,7 +823,7 @@ namespace AZ } return result; } - + bool ShaderPlatformInterface::AddExistingResourceEntry(const char* resourceStr, size_t resourceStartPos, uint32_t regId, @@ -832,8 +832,8 @@ namespace AZ size_t prevEndOfLine = argBufferStr.rfind("\n", resourceStartPos); size_t nextEndOfLine = argBufferStr.find("\n", resourceStartPos); size_t startOfEntryPos = argBufferStr.find(resourceStr, prevEndOfLine); - - //Check to see if a valid entry is found. + + //Check to see if a valid entry is found. if(startOfEntryPos == AZStd::string::npos || startOfEntryPos > nextEndOfLine) { AZ_Error(MetalShaderPlatformName, startOfEntryPos != AZStd::string::npos, "Entry-> %s not found within Descriptor set %s", resourceStr, argBufferStr.c_str()); @@ -843,7 +843,7 @@ namespace AZ { size_t endOfEntryPos = argBufferStr.find("\n", startOfEntryPos); AZ_Assert(endOfEntryPos != AZStd::string::npos, "Resource entry missing"); - + AZStd::string existingEntry = argBufferStr.substr(prevEndOfLine,endOfEntryPos - prevEndOfLine); m_argBufferEntries.insert(AZStd::make_pair(existingEntry, regId)); return true; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.cpp index b820a6bf76..6775258032 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.cpp @@ -23,14 +23,14 @@ namespace AZ { return aznew ArgumentBuffer(); } - + void ArgumentBuffer::Init(Device* device, RHI::ConstPtr srgLayout, ShaderResourceGroup& group, ShaderResourceGroupPool* srgPool) { @autoreleasepool { m_device = device; m_srgLayout = srgLayout; - + m_constantBufferSize = srgLayout->GetConstantDataSize(); if (m_constantBufferSize) { @@ -47,23 +47,23 @@ namespace AZ m_constantBuffer.SetName(constantBufferName.c_str()); AZ_Assert(m_constantBuffer.IsValid(), "Couldnt allocate memory for Constant buffer") } - - + + NSMutableArray* argBufferDecriptors = [[[NSMutableArray alloc] init] autorelease]; bool argDescriptorsCreated = CreateArgumentDescriptors(argBufferDecriptors); - + if(argDescriptorsCreated) { NSSortDescriptor* sortDescriptor; sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"index" ascending:YES] autorelease]; NSArray* sortedArgDescriptors = [argBufferDecriptors sortedArrayUsingDescriptors:@[sortDescriptor]]; - + m_argumentEncoder = [m_device->GetMtlDevice() newArgumentEncoderWithArguments:sortedArgDescriptors]; NSUInteger argumentBufferLength = m_argumentEncoder.encodedLength; - + RHI::BufferDescriptor bufferDescriptor; - + bufferDescriptor.m_byteCount = argumentBufferLength; bufferDescriptor.m_bindFlags = RHI::BufferBindFlags::Constant; AZStd::string argBufferName = "ArgumentBuffer"; @@ -77,24 +77,24 @@ namespace AZ m_argumentBuffer.SetName(argBufferName.c_str()); SetName(Name(argBufferName.c_str())); - + //Attach the argument buffer to the argument encoder [m_argumentEncoder setArgumentBuffer:m_argumentBuffer.GetGpuAddress>() offset:m_argumentBuffer.GetOffset()]; - + //Attach the static samplers AttachStaticSamplers(); - + //Attach the constant buffer AttachConstantBuffer(); } } } - + bool ArgumentBuffer::CreateArgumentDescriptors(NSMutableArray* argBufferDecriptors) { bool resourceAdded = false; - + for (const RHI::ShaderInputBufferDescriptor& shaderInputBuffer : m_srgLayout->GetShaderInputListForBuffers()) { MTLArgumentDescriptor* bufferArgDescriptor = [[[MTLArgumentDescriptor alloc] init] autorelease]; @@ -102,7 +102,7 @@ namespace AZ [argBufferDecriptors addObject:bufferArgDescriptor]; resourceAdded = true; } - + for (const RHI::ShaderInputImageDescriptor& shaderInputImage : m_srgLayout->GetShaderInputListForImages()) { MTLArgumentDescriptor* imgArgDescriptor = [[[MTLArgumentDescriptor alloc] init] autorelease]; @@ -110,7 +110,7 @@ namespace AZ [argBufferDecriptors addObject:imgArgDescriptor]; resourceAdded = true; } - + for (const RHI::ShaderInputSamplerDescriptor& shaderInputSampler : m_srgLayout->GetShaderInputListForSamplers()) { MTLArgumentDescriptor* samplerArgDescriptor = [[[MTLArgumentDescriptor alloc] init] autorelease]; @@ -121,7 +121,7 @@ namespace AZ [argBufferDecriptors addObject:samplerArgDescriptor]; resourceAdded = true; } - + for (const RHI::ShaderInputStaticSamplerDescriptor& staticSamplerInput : m_srgLayout->GetStaticSamplers()) { MTLArgumentDescriptor* staticSamplerArgDescriptor = [[[MTLArgumentDescriptor alloc] init] autorelease]; @@ -131,8 +131,8 @@ namespace AZ [argBufferDecriptors addObject:staticSamplerArgDescriptor]; resourceAdded = true; } - - AZStd::array_view shaderInputConstantList = m_srgLayout->GetShaderInputListForConstants(); + + AZStd::span shaderInputConstantList = m_srgLayout->GetShaderInputListForConstants(); if (!shaderInputConstantList.empty()) { const RHI::ShaderInputConstantDescriptor& shaderInputConstant = shaderInputConstantList[0]; @@ -143,10 +143,10 @@ namespace AZ [argBufferDecriptors addObject:constBufferArgDescriptor]; resourceAdded = true; } - + return resourceAdded; } - + void ArgumentBuffer::AttachStaticSamplers() { for (const RHI::ShaderInputStaticSamplerDescriptor& staticSampler : m_srgLayout->GetStaticSamplers()) @@ -157,17 +157,17 @@ namespace AZ [m_argumentEncoder setSamplerState:mtlSamplerState atIndex:staticSampler.m_registerId]; } } - + void ArgumentBuffer::AttachConstantBuffer() { - AZStd::array_view shaderInputConstantList = m_srgLayout->GetShaderInputListForConstants(); + AZStd::span shaderInputConstantList = m_srgLayout->GetShaderInputListForConstants(); if (!shaderInputConstantList.empty()) { const RHI::ShaderInputConstantDescriptor& shaderInputConstant = shaderInputConstantList[0]; [m_argumentEncoder setBuffer:m_constantBuffer.GetGpuAddress>() offset:m_constantBuffer.GetOffset() atIndex:shaderInputConstant.m_registerId]; } } - + void ArgumentBuffer::BindNullSamplers(uint32_t registerId, uint32_t samplerCount) { AZStd::array, MaxEntriesInArgTable> mtlSamplers; @@ -177,25 +177,25 @@ namespace AZ { mtlSamplers[i] = nullMtlSampler; } - + NSRange range = {registerId, samplerCount}; [m_argumentEncoder setSamplerStates : mtlSamplers.data() withRange : range]; } - + void ArgumentBuffer::UpdateImageViews(const RHI::ShaderInputImageDescriptor& shaderInputImage, const RHI::ShaderInputImageIndex shaderInputIndex, - const AZStd::array_view>& imageViews) + const AZStd::span>& imageViews) { int imageArrayLen = 0; AZStd::array, MaxEntriesInArgTable> mtlTextures; - + for (const RHI::ConstPtr& imageViewBase : imageViews) { if (imageViewBase && !imageViewBase->IsStale()) { const auto& imageView = static_cast(*imageViewBase); - + RHI::Ptr textureMemPtr = imageView.GetMemoryView().GetMemory(); mtlTextures[imageArrayLen] = textureMemPtr->GetGpuAddress>(); m_resourceBindings[shaderInputImage.m_name].insert(ResourceBindingData{textureMemPtr, .m_imageAccess = shaderInputImage.m_access}); @@ -208,7 +208,7 @@ namespace AZ } imageArrayLen++; } - + AZ_Assert(imageArrayLen==shaderInputImage.m_count, "Make sure we have created the correct length of texture array"); if(imageArrayLen > 0) { @@ -217,10 +217,10 @@ namespace AZ withRange : range]; } } - + void ArgumentBuffer::UpdateSamplers(const RHI::ShaderInputSamplerDescriptor& shaderInputSampler, const RHI::ShaderInputSamplerIndex shaderInputIndex, - const AZStd::array_view& samplerStates) + const AZStd::span& samplerStates) { int samplerArrayLen = 0; AZStd::array, MaxEntriesInArgTable> mtlSamplers; @@ -232,7 +232,7 @@ namespace AZ mtlSamplers[samplerArrayLen] = GetMtlSampler(samplerDesc); samplerArrayLen++; } - + AZ_Assert(samplerArrayLen==shaderInputSampler.m_count, "Make sure we dont have a nil sampler within mtlSamplers"); if(samplerArrayLen > 0) { @@ -245,16 +245,16 @@ namespace AZ BindNullSamplers(shaderInputSampler.m_registerId, shaderInputSampler.m_count); } } - + void ArgumentBuffer::UpdateBufferViews(const RHI::ShaderInputBufferDescriptor& shaderInputBuffer, const RHI::ShaderInputBufferIndex shaderInputIndex, - const AZStd::array_view>& bufferViews) + const AZStd::span>& bufferViews) { int bufferArrayLen = 0; AZStd::array, MaxEntriesInArgTable> mtlBuffers; AZStd::array mtlBufferOffsets; AZStd::array, MaxEntriesInArgTable> mtlTextures; - + for (const RHI::ConstPtr& bufferViewBase : bufferViews) { if (bufferViewBase && !bufferViewBase->IsStale()) @@ -298,12 +298,12 @@ namespace AZ bufferArrayLen++; } - + AZ_Assert(bufferArrayLen==shaderInputBuffer.m_count, "Make sure we have created the correct length of buffer array"); if(bufferArrayLen > 0) { NSRange range = {shaderInputBuffer.m_registerId, bufferArrayLen}; - + if(shaderInputBuffer.m_type == RHI::ShaderInputBufferType::Typed) { [m_argumentEncoder setTextures : mtlTextures.data() @@ -317,8 +317,8 @@ namespace AZ } } } - - void ArgumentBuffer::UpdateConstantBufferViews(AZStd::array_view rawData) + + void ArgumentBuffer::UpdateConstantBufferViews(AZStd::span rawData) { AZ_Assert(rawData.size() <= m_constantBufferSize, "rawData size can not be bigger than constant Buffer Size"); if ( (m_constantBufferSize > 0) && (rawData.size() <= m_constantBufferSize)) @@ -326,11 +326,11 @@ namespace AZ memcpy(m_constantBuffer.GetCpuAddress(), rawData.data(), rawData.size()); } } - + void ArgumentBuffer::Shutdown() { ClearResourceTracking(); - + #if defined(ARGUMENTBUFFER_PAGEALLOCATOR) if(m_constantBuffer.IsValid()) { @@ -339,13 +339,13 @@ namespace AZ if(m_argumentBuffer.IsValid()) { m_device->GetArgumentBufferAllocator().DeAllocate(m_argumentBuffer); - } + } #else if(m_argumentBuffer.IsValid()) { m_device->QueueForRelease(m_argumentBuffer); } - + if(m_constantBuffer.IsValid()) { m_device->QueueForRelease(m_constantBuffer); @@ -354,28 +354,28 @@ namespace AZ m_argumentBuffer = {}; m_constantBuffer = {}; - + [m_argumentEncoder release]; m_argumentEncoder = nil; - + Base::Shutdown(); } - + id ArgumentBuffer::GetArgEncoderBuffer() const { return m_argumentBuffer.GetGpuAddress>(); }; - + size_t ArgumentBuffer::GetOffset() const { return m_argumentBuffer.GetOffset(); }; - + void ArgumentBuffer::ClearResourceTracking() { m_resourceBindings.clear(); } - + id ArgumentBuffer::GetMtlSampler(MTLSamplerDescriptor* samplerDesc) { const NSCache* samplerCache = m_device->GetSamplerCache(); @@ -385,10 +385,10 @@ namespace AZ mtlSamplerState = [m_device->GetMtlDevice() newSamplerStateWithDescriptor:samplerDesc]; [samplerCache setObject:mtlSamplerState forKey:samplerDesc]; } - + return mtlSamplerState; } - + void ArgumentBuffer::CollectUntrackedResources(id commandEncoder, const ShaderResourceGroupVisibility& srgResourcesVisInfo, ComputeResourcesToMakeResidentMap& resourcesToMakeResidentCompute, @@ -408,19 +408,19 @@ namespace AZ else { MTLRenderStages mtlRenderStages = GetRenderStages(srgResourcesVisInfo.m_constantDataStageMask); - AZStd::pair key = AZStd::make_pair(MTLResourceUsageRead, mtlRenderStages); + AZStd::pair key = AZStd::make_pair(MTLResourceUsageRead, mtlRenderStages); resourcesToMakeResidentGraphics[key].emplace(mtlconstantBufferResource); } } } - + //Cach all the resources within a srg that are used by the shader based on the visibility information for (const auto& it : m_resourceBindings) { //Extract the visibility mask for the give resource auto visMaskIt = srgResourcesVisInfo.m_resourcesStageMask.find(it.first); AZ_Assert(visMaskIt != srgResourcesVisInfo.m_resourcesStageMask.end(), "No Visibility information available") - + uint8_t numBitsSet = RHI::CountBitsSet(static_cast(visMaskIt->second)); //Only use this resource if it is used in one of the shaders if (numBitsSet > 0) @@ -464,7 +464,7 @@ namespace AZ AZ_Assert(false, "Undefined Resource type"); } } - + id mtlResourceToBind = resourceBindingData.m_resourcPtr->GetGpuAddress>(); resourcesToMakeResidentMap[resourceUsage].emplace(mtlResourceToBind); } @@ -475,7 +475,7 @@ namespace AZ const ResourceBindingsSet& resourceBindingDataSet, GraphicsResourcesToMakeResidentMap& resourcesToMakeResidentMap) const { - + MTLRenderStages mtlRenderStages = GetRenderStages(visShaderMask); MTLResourceUsage resourceUsage = MTLResourceUsageRead; for (const auto& resourceBindingData : resourceBindingDataSet) @@ -498,17 +498,17 @@ namespace AZ AZ_Assert(false, "Undefined Resource type"); } } - + AZStd::pair key = AZStd::make_pair(resourceUsage, mtlRenderStages); id mtlResourceToBind = resourceBindingData.m_resourcPtr->GetGpuAddress>(); resourcesToMakeResidentMap[key].emplace(mtlResourceToBind); } } - + bool ArgumentBuffer::IsNullHeapNeededForVertexStage(const ShaderResourceGroupVisibility& srgResourcesVisInfo) const { bool isUsedByVertexStage = false; - + //Iterate over all the SRG entries for (const auto& it : srgResourcesVisInfo.m_resourcesStageMask) { @@ -520,7 +520,7 @@ namespace AZ } return isUsedByVertexStage; } - + bool ArgumentBuffer::IsNullDescHeapNeeded() const { return m_useNullDescriptorHeap; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.h b/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.h index a680516dc6..03d8cdd439 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.h +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/ArgumentBuffer.h @@ -26,12 +26,12 @@ struct ResourceBindingData AZ::RHI::ShaderInputImageAccess m_imageAccess; AZ::RHI::ShaderInputBufferAccess m_bufferAccess; }; - + bool operator==(const ResourceBindingData& other) const { return this->m_resourcPtr == other.m_resourcPtr; }; - + size_t GetHash() const { return static_cast(m_resourcPtr->GetHash()); @@ -58,12 +58,12 @@ namespace AZ class BufferMemoryAllocator; class ShaderResourceGroup; struct ShaderResourceGroupCompiledData; - + class ArgumentBuffer final : public RHI::DeviceObject { using Base = RHI::DeviceObject; - + public: AZ_CLASS_ALLOCATOR(ArgumentBuffer, AZ::SystemAllocator, 0); AZ_RTTI(ArgumentBuffer, "FEFE8823-7772-4EA0-9241-65C49ADFF6B3", Base); @@ -78,21 +78,21 @@ namespace AZ void UpdateImageViews(const RHI::ShaderInputImageDescriptor& shaderInputImage, const RHI::ShaderInputImageIndex shaderInputIndex, - const AZStd::array_view>& imageViews); - + const AZStd::span>& imageViews); + void UpdateSamplers(const RHI::ShaderInputSamplerDescriptor& shaderInputSampler, const RHI::ShaderInputSamplerIndex shaderInputIndex, - const AZStd::array_view& samplerStates); - + const AZStd::span& samplerStates); + void UpdateBufferViews(const RHI::ShaderInputBufferDescriptor& shaderInputBuffer, const RHI::ShaderInputBufferIndex shaderInputIndex, - const AZStd::array_view>& bufferViews); - - void UpdateConstantBufferViews(AZStd::array_view rawData); - + const AZStd::span>& bufferViews); + + void UpdateConstantBufferViews(AZStd::span rawData); + id GetArgEncoderBuffer() const; size_t GetOffset() const; - + //Map to cache all the resources based on the usage as we can batch all the resources for a given usage. using ComputeResourcesToMakeResidentMap = AZStd::unordered_map>>; //Map to cache all the resources based on the usage and shader stage as we can batch all the resources for a given usage/shader usage. @@ -102,31 +102,31 @@ namespace AZ const ShaderResourceGroupVisibility& srgResourcesVisInfo, ComputeResourcesToMakeResidentMap& resourcesToMakeResidentCompute, GraphicsResourcesToMakeResidentMap& resourcesToMakeResidentGraphics) const; - + void ClearResourceTracking(); bool IsNullHeapNeededForVertexStage(const ShaderResourceGroupVisibility& srgResourcesVisInfo) const; bool IsNullDescHeapNeeded() const; - + ////////////////////////////////////////////////////////////////////////// // RHI::DeviceObject void Shutdown() override; ////////////////////////////////////////////////////////////////////////// - + private: - + bool CreateArgumentDescriptors(NSMutableArray * argBufferDecriptors); void AttachStaticSamplers(); void AttachConstantBuffer(); - + // Use a cache to store and retrieve samplers id GetMtlSampler(MTLSamplerDescriptor* samplerDesc); using ResourceBindingsSet = AZStd::unordered_set; using ResourceBindingsMap = AZStd::unordered_map; ResourceBindingsMap m_resourceBindings; - + static const int MaxEntriesInArgTable = 31; - + void CollectResourcesForCompute(id encoder, const ResourceBindingsSet& resourceBindingData, ComputeResourcesToMakeResidentMap& resourcesToMakeResidentMap) const; @@ -139,13 +139,13 @@ namespace AZ const ResourceBindingsMap& resourceMap, const ShaderResourceGroupVisibility& srgResourcesVisInfo) const; void BindNullSamplers(uint32_t registerId, uint32_t samplerCount); - + Device* m_device = nullptr; RHI::ConstPtr m_srgLayout; - + id m_argumentEncoder; uint32_t m_constantBufferSize = 0; - + #if defined(ARGUMENTBUFFER_PAGEALLOCATOR) BufferMemoryView m_argumentBuffer; BufferMemoryView m_constantBuffer; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/AsyncUploadQueue.h b/Gems/Atom/RHI/Metal/Code/Source/RHI/AsyncUploadQueue.h index 7ae4a75764..3db15eca4c 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/AsyncUploadQueue.h +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/AsyncUploadQueue.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ namespace AZ : public RHI::DeviceObject { using Base = RHI::DeviceObject; - + public: AsyncUploadQueue() = default; @@ -57,13 +57,13 @@ namespace AZ uint64_t QueueUpload(const RHI::BufferStreamRequest& request); //! Queue copy commands to upload image subresources. - //! @param residentMip is the resident mip level the expand request starts from. + //! @param residentMip is the resident mip level the expand request starts from. //! @return queue id which can be use to check whether upload finished or wait for upload finish RHI::AsyncWorkHandle QueueUpload(const RHI::StreamingImageExpandRequest& request, uint32_t residentMip); bool IsUploadFinished(uint64_t fenceValue); void WaitForUpload(const RHI::AsyncWorkHandle& workHandle); - + private: struct FramePacket; RHI::AsyncWorkHandle CreateAsyncWork(Fence& fence, RHI::Fence::SignalCallback callback = nullptr); @@ -84,26 +84,26 @@ namespace AZ Fence m_fence; // Using persistent mapping for the staging resource so the Map function only need to be called called once. - uint8_t* m_stagingResourceData = nullptr; + uint8_t* m_stagingResourceData = nullptr; uint32_t m_dataOffset = 0; }; - + RHI::Ptr m_copyQueue; - // Begin the frame packet which m_frameIndex point to and get ready to start recording copy command by using this frame packet + // Begin the frame packet which m_frameIndex point to and get ready to start recording copy command by using this frame packet FramePacket* BeginFramePacket(CommandQueue* commandQueue); void EndFramePacket(CommandQueue* commandQueue); bool m_recordingFrame = false; - AZStd::vector m_framePackets; + AZStd::vector m_framePackets; size_t m_frameIndex = 0; Descriptor m_descriptor; // Fence for external upload request Fence m_uploadFence; - + RHI::Ptr m_device; - + //Command Buffer associated with the async copy queue CommandQueueCommandBuffer m_commandBuffer; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp index 2b8be3d1ab..c0277152b6 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp @@ -28,7 +28,7 @@ namespace AZ { return aznew CommandList(); } - + void CommandList::Init(RHI::HardwareQueueClass hardwareQueueClass, Device* device) { CommandListBase::Init(hardwareQueueClass, device); @@ -39,13 +39,13 @@ namespace AZ //Undefined symbols for architecture arm64: // "_objc_memmove_collectable", referenced from: //We can come back and revisit this after upgrading the build server machines to Mojave. - + m_state.m_pipelineState = nullptr; m_state.m_pipelineLayout = nullptr; m_state.m_streamsHash = AZ::HashValue64{0}; m_state.m_indicesHash = AZ::HashValue64{0}; m_state.m_stencilRef = -1; - + CommandListBase::Reset(); } @@ -59,11 +59,11 @@ namespace AZ Reset(); CommandListBase::FlushEncoder(); } - + void CommandList::Submit(const RHI::CopyItem& copyItem) { CreateEncoder(CommandEncoderType::Blit); - + id blitEncoder = GetEncoder>(); switch (copyItem.m_type) { @@ -78,7 +78,7 @@ namespace AZ toBuffer:destinationBuffer->GetMemoryView().GetGpuAddress>() destinationOffset:descriptor.m_destinationOffset size:descriptor.m_size]; - + Platform::SynchronizeBufferOnGPU(blitEncoder, destinationBuffer->GetMemoryView().GetGpuAddress>()); break; } @@ -87,19 +87,19 @@ namespace AZ const RHI::CopyImageDescriptor& descriptor = copyItem.m_image; const Image* sourceImage = static_cast(descriptor.m_sourceImage); const Image* destinationImage = static_cast(descriptor.m_destinationImage); - + MTLOrigin sourceOrigin = MTLOriginMake(descriptor.m_sourceOrigin.m_left, descriptor.m_sourceOrigin.m_top, descriptor.m_sourceOrigin.m_front); - + MTLSize sourceSize = MTLSizeMake(descriptor.m_sourceSize.m_width, descriptor.m_sourceSize.m_height, descriptor.m_sourceSize.m_depth); - + MTLOrigin destinationOrigin = MTLOriginMake(descriptor.m_destinationOrigin.m_left, descriptor.m_destinationOrigin.m_top, descriptor.m_destinationOrigin.m_front); - + [blitEncoder copyFromTexture: sourceImage->GetMemoryView().GetGpuAddress>() sourceSlice: descriptor.m_sourceSubresource.m_arraySlice sourceLevel: descriptor.m_sourceSubresource.m_mipSlice @@ -109,7 +109,7 @@ namespace AZ destinationSlice: descriptor.m_destinationSubresource.m_arraySlice destinationLevel: descriptor.m_destinationSubresource.m_mipSlice destinationOrigin: destinationOrigin]; - + Platform::SynchronizeTextureOnGPU(blitEncoder, destinationImage->GetMemoryView().GetGpuAddress>()); break; } @@ -122,11 +122,11 @@ namespace AZ MTLOrigin destinationOrigin = MTLOriginMake(descriptor.m_destinationOrigin.m_left, descriptor.m_destinationOrigin.m_top, descriptor.m_destinationOrigin.m_front); - + MTLSize sourceSize = MTLSizeMake(descriptor.m_sourceSize.m_width, descriptor.m_sourceSize.m_height, descriptor.m_sourceSize.m_depth); - + [blitEncoder copyFromBuffer:sourceBuffer->GetMemoryView().GetGpuAddress>() sourceOffset:sourceBuffer->GetMemoryView().GetOffset() + descriptor.m_sourceOffset sourceBytesPerRow:descriptor.m_sourceBytesPerRow @@ -136,7 +136,7 @@ namespace AZ destinationSlice:descriptor.m_destinationSubresource.m_arraySlice destinationLevel:descriptor.m_destinationSubresource.m_mipSlice destinationOrigin:destinationOrigin]; - + Platform::SynchronizeTextureOnGPU(blitEncoder, destinationImage->GetMemoryView().GetGpuAddress>()); break; } @@ -145,15 +145,15 @@ namespace AZ const RHI::CopyImageToBufferDescriptor& descriptor = copyItem.m_imageToBuffer; const auto* sourceImage = static_cast(descriptor.m_sourceImage); const auto* destinationBuffer = static_cast(descriptor.m_destinationBuffer); - + MTLOrigin sourceOrigin = MTLOriginMake(descriptor.m_sourceOrigin.m_left, descriptor.m_sourceOrigin.m_top, descriptor.m_sourceOrigin.m_front); - + MTLSize sourceSize = MTLSizeMake(descriptor.m_sourceSize.m_width, descriptor.m_sourceSize.m_height, descriptor.m_sourceSize.m_depth); - + [blitEncoder copyFromTexture:sourceImage->GetMemoryView().GetGpuAddress>() sourceSlice:descriptor.m_sourceSubresource.m_arraySlice sourceLevel:descriptor.m_sourceSubresource.m_mipSlice @@ -163,7 +163,7 @@ namespace AZ destinationOffset:destinationBuffer->GetMemoryView().GetOffset() + descriptor.m_destinationOffset destinationBytesPerRow:descriptor.m_destinationBytesPerRow destinationBytesPerImage:descriptor.m_destinationBytesPerImage]; - + Platform::SynchronizeBufferOnGPU(blitEncoder, destinationBuffer->GetMemoryView().GetGpuAddress>()); break; } @@ -173,27 +173,27 @@ namespace AZ } } } - + void CommandList::Submit(const RHI::DispatchItem& dispatchItem) { AZ_PROFILE_FUNCTION(RHI); - + CreateEncoder(CommandEncoderType::Compute); bool bindResourceSuccessfull = CommitShaderResources(dispatchItem); - + if(!bindResourceSuccessfull) { AZ_Assert(false, "Resource binding was unsuccessfully."); return; } const RHI::DispatchDirect& arguments = dispatchItem.m_arguments.m_direct; - MTLSize threadsPerGroup = {arguments.m_threadsPerGroupX, arguments.m_threadsPerGroupY, arguments.m_threadsPerGroupZ}; + MTLSize threadsPerGroup = {arguments.m_threadsPerGroupX, arguments.m_threadsPerGroupY, arguments.m_threadsPerGroupZ}; MTLSize numThreadGroup = {arguments.GetNumberOfGroupsX(), arguments.GetNumberOfGroupsY(), arguments.GetNumberOfGroupsZ()}; - + id computeEncoder = GetEncoder>(); [computeEncoder dispatchThreadgroups: numThreadGroup threadsPerThreadgroup: threadsPerGroup]; - + } void CommandList::Submit(const RHI::DispatchRaysItem& dispatchRaysItem) @@ -204,14 +204,14 @@ namespace AZ void CommandList::SetViewports(const RHI::Viewport* rhiViewports, uint32_t count) { - m_state.m_viewportState.Set(AZStd::array_view(rhiViewports, count)); + m_state.m_viewportState.Set(AZStd::span(rhiViewports, count)); } void CommandList::SetScissors(const RHI::Scissor* rhiScissors, uint32_t count) { - m_state.m_scissorState.Set(AZStd::array_view(rhiScissors, count)); + m_state.m_scissorState.Set(AZStd::span(rhiScissors, count)); } - + template void CommandList::SetRootConstants(const Item& item, const PipelineState* pipelineState) { @@ -221,15 +221,15 @@ namespace AZ if(m_commandEncoderType == CommandEncoderType::Render) { id renderEncoder = GetEncoder>(); - + [renderEncoder setVertexBytes: item.m_rootConstants length: pipelineLayout.GetRootConstantsSize() atIndex: pipelineLayout.GetRootConstantsSlotIndex()]; - + [renderEncoder setFragmentBytes: item.m_rootConstants length: pipelineLayout.GetRootConstantsSize() atIndex: pipelineLayout.GetRootConstantsSlotIndex()]; - + } else if(m_commandEncoderType == CommandEncoderType::Compute) { @@ -237,39 +237,39 @@ namespace AZ [computeEncoder setBytes: item.m_rootConstants length: pipelineLayout.GetRootConstantsSize() atIndex: pipelineLayout.GetRootConstantsSlotIndex()]; - + } } } - + bool CommandList::SetArgumentBuffers(const PipelineState* pipelineState, RHI::PipelineStateType stateType) { bool bindNullDescriptorHeap = false; MTLRenderStages mtlRenderStagesForNullDescHeap = 0; ShaderResourceBindings& bindings = GetShaderResourceBindingsByPipelineType(stateType); const PipelineLayout& pipelineLayout = pipelineState->GetPipelineLayout(); - + uint32_t bufferVertexRegisterIdMin = RHI::Limits::Pipeline::ShaderResourceGroupCountMax; uint32_t bufferFragmentOrComputeRegisterIdMin = RHI::Limits::Pipeline::ShaderResourceGroupCountMax; uint32_t bufferVertexRegisterIdMax = 0; uint32_t bufferFragmentOrComputeRegisterIdMax = 0; - + //Arrays to cache all the buffers and offsets in order to make batch calls MetalArgumentBufferArray mtlVertexArgBuffers; MetalArgumentBufferArrayOffsets mtlVertexArgBufferOffsets; MetalArgumentBufferArray mtlFragmentOrComputeArgBuffers; MetalArgumentBufferArrayOffsets mtlFragmentOrComputeArgBufferOffsets; - + mtlVertexArgBuffers.fill(nil); mtlFragmentOrComputeArgBuffers.fill(nil); mtlVertexArgBufferOffsets.fill(0); mtlFragmentOrComputeArgBufferOffsets.fill(0); - + //Map to cache all the resources based on the usage as we can batch all the resources for a given usage ArgumentBuffer::ComputeResourcesToMakeResidentMap resourcesToMakeResidentCompute; //Map to cache all the resources based on the usage and shader stage as we can batch all the resources for a given usage/shader usage ArgumentBuffer::GraphicsResourcesToMakeResidentMap resourcesToMakeResidentGraphics; - + for (uint32_t slot = 0; slot < RHI::Limits::Pipeline::ShaderResourceGroupCountMax; ++slot) { const ShaderResourceGroup* shaderResourceGroup = bindings.m_srgsBySlot[slot]; @@ -282,7 +282,7 @@ namespace AZ uint32_t srgVisIndex = pipelineLayout.GetIndexBySlot(shaderResourceGroup->GetBindingSlot()); const RHI::ShaderStageMask& srgVisInfo = pipelineLayout.GetSrgVisibility(srgVisIndex); const ShaderResourceGroupVisibility& srgResourcesVisInfo = pipelineLayout.GetSrgResourcesVisibility(srgVisIndex); - + bool isSrgUpdatd = bindings.m_srgsByIndex[slot] != shaderResourceGroup; if(isSrgUpdatd) { @@ -290,12 +290,12 @@ namespace AZ auto& compiledArgBuffer = shaderResourceGroup->GetCompiledArgumentBuffer(); id argBuffer = compiledArgBuffer.GetArgEncoderBuffer(); size_t argBufferOffset = compiledArgBuffer.GetOffset(); - + if(srgVisInfo != RHI::ShaderStageMask::None) { bool isNullDescHeapNeeded = compiledArgBuffer.IsNullDescHeapNeeded(); bindNullDescriptorHeap |= isNullDescHeapNeeded; - + //For graphics and compute shader stages, cache all the argument buffers, offsets and track the min/max indices if(m_commandEncoderType == CommandEncoderType::Render) { @@ -305,11 +305,11 @@ namespace AZ mtlVertexArgBuffers[slotIndex] = argBuffer; mtlVertexArgBufferOffsets[slotIndex] = argBufferOffset; bufferVertexRegisterIdMin = AZStd::min(slotIndex, bufferVertexRegisterIdMin); - bufferVertexRegisterIdMax = AZStd::max(slotIndex, bufferVertexRegisterIdMax); + bufferVertexRegisterIdMax = AZStd::max(slotIndex, bufferVertexRegisterIdMax); mtlRenderStagesForNullDescHeap = shaderResourceGroup->IsNullHeapNeededForVertexStage(srgResourcesVisInfo) ? mtlRenderStagesForNullDescHeap | MTLRenderStageVertex : mtlRenderStagesForNullDescHeap; } - + if( numBitsSet > 1 || srgVisInfo == RHI::ShaderStageMask::Fragment) { mtlFragmentOrComputeArgBuffers[slotIndex] = argBuffer; @@ -328,7 +328,7 @@ namespace AZ } } } - + //Check if the srg has been updated or if the srg resources visibility hash has been updated //as it is possible for draw items to have different PSOs in the same pass. const AZ::HashValue64 srgResourcesVisHash = pipelineLayout.GetSrgResourcesVisibilityHash(srgVisIndex); @@ -337,8 +337,8 @@ namespace AZ bindings.m_srgVisHashByIndex[slot] = srgResourcesVisHash; if(srgVisInfo != RHI::ShaderStageMask::None) { - - + + //For graphics and compute encoder make the resource resident (call UseResource) for the duration //of the work associated with the current scope and ensure that it's in a //format compatible with the appropriate metal function. @@ -353,7 +353,7 @@ namespace AZ } } } - + //For graphics and compute encoder bind all the argument buffers if(m_commandEncoderType == CommandEncoderType::Render) { @@ -362,7 +362,7 @@ namespace AZ bufferVertexRegisterIdMax, mtlVertexArgBuffers, mtlVertexArgBufferOffsets); - + BindArgumentBuffers(RHI::ShaderStage::Fragment, bufferFragmentOrComputeRegisterIdMin, bufferFragmentOrComputeRegisterIdMax, @@ -377,40 +377,40 @@ namespace AZ mtlFragmentOrComputeArgBuffers, mtlFragmentOrComputeArgBufferOffsets); } - + id renderEncoder = GetEncoder>(); id computeEncoder = GetEncoder>(); - + //Call UseResource on all resources for Compute stage for (const auto& key : resourcesToMakeResidentCompute) { AZStd::vector> resourcesToProcessVec(key.second.begin(), key.second.end()); - + [computeEncoder useResources: &resourcesToProcessVec[0] count: resourcesToProcessVec.size() usage: key.first]; - + } - + //Call UseResource on all resources for Vertex and Fragment stages for (const auto& key : resourcesToMakeResidentGraphics) { - + AZStd::vector> resourcesToProcessVec(key.second.begin(), key.second.end()); - + [renderEncoder useResources: &resourcesToProcessVec[0] count: resourcesToProcessVec.size() usage: key.first.first stages: key.first.second]; } - + if(bindNullDescriptorHeap) { MakeHeapsResident(mtlRenderStagesForNullDescHeap); } return true; } - + void CommandList::BindArgumentBuffers(RHI::ShaderStage shaderStage, uint16_t registerIdMin, uint16_t registerIdMax, @@ -428,7 +428,7 @@ namespace AZ if(mtlArgBuffers[i] == nil) { NSRange range = { startingIndex, i-startingIndex }; - + switch(shaderStage) { case RHI::ShaderStage::Vertex: @@ -462,7 +462,7 @@ namespace AZ } trackingRange = false; - + } } else @@ -475,13 +475,13 @@ namespace AZ } } } - + void CommandList::Submit(const RHI::DrawItem& drawItem) { AZ_PROFILE_FUNCTION(RHI); - + CreateEncoder(CommandEncoderType::Render); - + RHI::CommandListScissorState scissorState; if (drawItem.m_scissorsCount) { @@ -496,15 +496,15 @@ namespace AZ } CommitViewportState(); CommitScissorState(); - + const PipelineState* pipelineState = static_cast(drawItem.m_pipelineState); AZ_Assert(pipelineState, "PipelineState can not be null"); - + if(m_renderPassMultiSampleState != pipelineState->m_pipelineStateMultiSampleState) { AZ_Assert(false,"MultisampleState in the image descriptor needs to match the one provided in the pipeline state"); } - + id renderEncoder = GetEncoder>(); bool bindResourceSuccessfull = CommitShaderResources(drawItem); if(!bindResourceSuccessfull) @@ -512,21 +512,21 @@ namespace AZ AZ_Assert(false, "Resource binding was unsuccessfully."); return; } - + SetStreamBuffers(drawItem.m_streamBufferViews, drawItem.m_streamBufferViewCount); SetStencilRef(drawItem.m_stencilRef); MTLPrimitiveType mtlPrimType = pipelineState->GetPipelineTopology(); - + switch (drawItem.m_arguments.m_type) { case RHI::DrawType::Indexed: { const RHI::DrawIndexed& indexed = drawItem.m_arguments.m_indexed; - + const RHI::IndexBufferView& indexBuffDescriptor = *drawItem.m_indexBufferView; AZ::HashValue64 indicesHash = indexBuffDescriptor.GetHash(); - + m_state.m_indicesHash = indicesHash; const Buffer * buff = static_cast(indexBuffDescriptor.GetBuffer()); id mtlBuff = buff->GetMemoryView().GetGpuAddress>(); @@ -534,7 +534,7 @@ namespace AZ MTLIndexTypeUInt16 : MTLIndexTypeUInt32; uint32_t indexTypeSize = 0; GetIndexTypeSizeInBytes(mtlIndexType, indexTypeSize); - + uint32_t indexOffset = indexBuffDescriptor.GetByteOffset() + (indexed.m_indexOffset * indexTypeSize) + buff->GetMemoryView().GetOffset(); [renderEncoder drawIndexedPrimitives: mtlPrimType indexCount: indexed.m_indexCount @@ -546,15 +546,15 @@ namespace AZ baseInstance: indexed.m_instanceOffset]; break; } - + case RHI::DrawType::Linear: - { + { const RHI::DrawLinear& linear = drawItem.m_arguments.m_linear; [renderEncoder drawPrimitives: mtlPrimType vertexStart: linear.m_vertexOffset vertexCount: linear.m_vertexCount instanceCount: linear.m_instanceCount - baseInstance: linear.m_instanceOffset]; + baseInstance: linear.m_instanceOffset]; break; } } @@ -576,7 +576,7 @@ namespace AZ { CommandListBase::Shutdown(); } - + void CommandList::SetPipelineState(const PipelineState* pipelineState) { if (m_state.m_pipelineState != pipelineState) @@ -608,7 +608,7 @@ namespace AZ AZ_Assert(false, "Type not supported."); } } - + ShaderResourceBindings& bindings = GetShaderResourceBindingsByPipelineType(pipelineState->GetType()); for (size_t i = 0; i < bindings.m_srgsByIndex.size(); ++i) { @@ -623,7 +623,7 @@ namespace AZ } } } - + void CommandList::SetStencilRef(uint8_t stencilRef) { if (m_state.m_stencilRef != stencilRef) @@ -633,24 +633,24 @@ namespace AZ m_state.m_stencilRef = stencilRef; } } - + void CommandList::SetStreamBuffers(const RHI::StreamBufferView* streams, uint32_t count) { uint16_t bufferArrayLen = 0; AZStd::array, METAL_MAX_ENTRIES_BUFFER_ARG_TABLE> mtlStreamBuffers; AZStd::array mtlStreamBufferOffsets; - + AZ::HashValue64 streamsHash = AZ::HashValue64{0}; for (uint32_t i = 0; i < count; ++i) { streamsHash = AZ::TypeHash64(streamsHash, streams[i].GetHash()); } - + if (streamsHash != m_state.m_streamsHash) { m_state.m_streamsHash = streamsHash; AZ_Assert(count <= METAL_MAX_ENTRIES_BUFFER_ARG_TABLE , "Slots needed cannot exceed METAL_MAX_ENTRIES_BUFFER_ARG_TABLE"); - + NSRange range = {METAL_MAX_ENTRIES_BUFFER_ARG_TABLE - count, count}; //The stream buffers are populated from bottom to top as the top slots are taken by argument buffers for (int i = count-1; i >= 0; --i) @@ -671,7 +671,7 @@ namespace AZ withRange: range]; } } - + void CommandList::SetRasterizerState(const RasterizerState& rastState) { id renderEncoder = GetEncoder>(); @@ -681,17 +681,17 @@ namespace AZ [renderEncoder setTriangleFillMode: rastState.m_triangleFillMode]; [renderEncoder setDepthClipMode: rastState.m_depthClipMode]; } - + void CommandList::SetShaderResourceGroupForDraw(const RHI::ShaderResourceGroup& shaderResourceGroup) { SetShaderResourceGroup(static_cast(&shaderResourceGroup)); } - + void CommandList::SetShaderResourceGroupForDispatch(const RHI::ShaderResourceGroup& shaderResourceGroup) { SetShaderResourceGroup(static_cast(&shaderResourceGroup)); } - + CommandList::ShaderResourceBindings& CommandList::GetShaderResourceBindingsByPipelineType(RHI::PipelineStateType pipelineType) { return m_state.m_bindingsByPipe[static_cast(pipelineType)]; @@ -706,15 +706,15 @@ namespace AZ AZ_Assert(false, "Pipeline state not provided"); return false; } - + SetPipelineState(pipelineState); - + // Assign shader resource groups from the item to slot bindings. for (uint32_t srgIndex = 0; srgIndex < item.m_shaderResourceGroupCount; ++srgIndex) { SetShaderResourceGroup(static_cast(item.m_shaderResourceGroups[srgIndex])); } - + if (item.m_uniqueShaderResourceGroup) { SetShaderResourceGroup(static_cast(item.m_uniqueShaderResourceGroup)); @@ -730,7 +730,7 @@ namespace AZ { return; } - + AZ_PROFILE_FUNCTION(RHI); const auto& viewports = m_state.m_viewportState.m_states; MTLViewport metalViewports[viewports.size()]; @@ -744,7 +744,7 @@ namespace AZ metalViewports[i].znear = viewports[i].m_minZ; metalViewports[i].zfar = viewports[i].m_maxZ; } - + id renderEncoder = GetEncoder>(); [renderEncoder setViewports: metalViewports count: viewports.size()]; @@ -760,7 +760,7 @@ namespace AZ AZStd::array metalScissorRects; const auto& scissors = m_state.m_scissorState.m_states; - + AZ_Assert(scissors.size() <= MaxScissorsAllowed , "Number of scissors violate the maximum number of scissors allowed"); for (uint32_t i = 0; i < scissors.size(); ++i) { diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp index cd0d152f7c..63d741dffd 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp @@ -27,7 +27,7 @@ namespace AZ { } - RHI::ResultCode PipelineLibrary::MergeIntoInternal(AZStd::array_view pipelineLibraries) + RHI::ResultCode PipelineLibrary::MergeIntoInternal(AZStd::span pipelineLibraries) { return RHI::ResultCode::Success; } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h index 8ec5f257c9..f462e20a8e 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h @@ -30,7 +30,7 @@ namespace AZ // RHI::PipelineLibrary RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryData* serializedData) override; void ShutdownInternal() override; - RHI::ResultCode MergeIntoInternal(AZStd::array_view libraries) override; + RHI::ResultCode MergeIntoInternal(AZStd::span libraries) override; RHI::ConstPtr GetSerializedDataInternal() const override; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp index fa962697e1..fac4c5621b 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -37,7 +37,7 @@ namespace AZ RHI::ResultCode ShaderResourceGroupPool::InitGroupInternal(RHI::ShaderResourceGroup& groupBase) { ShaderResourceGroup& group = static_cast(groupBase); - + for (size_t i = 0; i < RHI::Limits::Device::FrameCountMax; ++i) { auto argBuffer = ArgumentBuffer::Create(); @@ -82,7 +82,7 @@ namespace AZ for (const RHI::ShaderInputImageDescriptor& shaderInputImage : layout->GetShaderInputListForImages()) { const RHI::ShaderInputImageIndex imageInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = groupData.GetImageViewArray(imageInputIndex); + AZStd::span> imageViews = groupData.GetImageViewArray(imageInputIndex); argBuffer.UpdateImageViews(shaderInputImage, imageInputIndex, imageViews); ++shaderInputIndex; } @@ -91,7 +91,7 @@ namespace AZ for (const RHI::ShaderInputSamplerDescriptor& shaderInputSampler : layout->GetShaderInputListForSamplers()) { const RHI::ShaderInputSamplerIndex samplerInputIndex(shaderInputIndex); - AZStd::array_view samplerStates = groupData.GetSamplerArray(samplerInputIndex); + AZStd::span samplerStates = groupData.GetSamplerArray(samplerInputIndex); argBuffer.UpdateSamplers(shaderInputSampler, samplerInputIndex, samplerStates); ++shaderInputIndex; } @@ -100,7 +100,7 @@ namespace AZ for (const RHI::ShaderInputBufferDescriptor& shaderInputBuffer : layout->GetShaderInputListForBuffers()) { const RHI::ShaderInputBufferIndex bufferInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); + AZStd::span> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); argBuffer.UpdateBufferViews(shaderInputBuffer, bufferInputIndex, bufferViews); ++shaderInputIndex; } diff --git a/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h index 1edd1ee8bc..e30b4c0ac7 100644 --- a/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h @@ -30,7 +30,7 @@ namespace AZ // RHI::PipelineLibrary RHI::ResultCode InitInternal([[maybe_unused]] RHI::Device& device, [[maybe_unused]] const RHI::PipelineLibraryData* serializedData) override { return RHI::ResultCode::Success;} void ShutdownInternal() override {} - RHI::ResultCode MergeIntoInternal([[maybe_unused]] AZStd::array_view libraries) override { return RHI::ResultCode::Success;} + RHI::ResultCode MergeIntoInternal([[maybe_unused]] AZStd::span libraries) override { return RHI::ResultCode::Success;} RHI::ConstPtr GetSerializedDataInternal() const override { return nullptr;} ////////////////////////////////////////////////////////////////////////// }; diff --git a/Gems/Atom/RHI/Vulkan/Code/Include/Atom/RHI.Reflect/Vulkan/ShaderStageFunction.h b/Gems/Atom/RHI/Vulkan/Code/Include/Atom/RHI.Reflect/Vulkan/ShaderStageFunction.h index 799e4f3b89..7627100a05 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Include/Atom/RHI.Reflect/Vulkan/ShaderStageFunction.h +++ b/Gems/Atom/RHI/Vulkan/Code/Include/Atom/RHI.Reflect/Vulkan/ShaderStageFunction.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include @@ -21,7 +21,7 @@ namespace AZ namespace Vulkan { using ShaderByteCode = AZStd::vector; - using ShaderByteCodeView = AZStd::array_view; + using ShaderByteCodeView = AZStd::span; /** * A set of indices used to access physical sub-stages within a virtual stage. diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp index c74b9d4d13..c1d87b0211 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp @@ -76,12 +76,12 @@ namespace AZ void CommandList::SetViewports(const RHI::Viewport* rhiViewports, uint32_t count) { - m_state.m_viewportState.Set(AZStd::array_view(rhiViewports, count)); + m_state.m_viewportState.Set(AZStd::span(rhiViewports, count)); } void CommandList::SetScissors(const RHI::Scissor* rhiScissors, uint32_t count) { - m_state.m_scissorState.Set(AZStd::array_view(rhiScissors, count)); + m_state.m_scissorState.Set(AZStd::span(rhiScissors, count)); } void CommandList::SetShaderResourceGroupForDraw(const RHI::ShaderResourceGroup& shaderResourceGroup) @@ -625,7 +625,7 @@ namespace AZ return ConvertResult(vkResult); } - void CommandList::ExecuteSecondaryCommandLists(const AZStd::array_view>& commands) + void CommandList::ExecuteSecondaryCommandLists(const AZStd::span>& commands) { AZ_Assert(m_isUpdating, "Secondary command buffers must be executed between BeginCommandBuffer() and EndCommandBuffer()."); AZ_Assert(m_descriptor.m_level == VK_COMMAND_BUFFER_LEVEL_PRIMARY, "Trying to execute commands from a secondary command list"); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.h index 799c706d60..651842e081 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -103,7 +103,7 @@ namespace AZ bool IsInsideRenderPass() const; const Framebuffer* GetActiveFramebuffer() const; const RenderPass* GetActiveRenderpass() const; - void ExecuteSecondaryCommandLists(const AZStd::array_view>& commands); + void ExecuteSecondaryCommandLists(const AZStd::span>& commands); uint32_t GetQueueFamilyIndex() const; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp index 815eba086c..9a759d1842 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp @@ -39,7 +39,7 @@ namespace AZ } } - void DescriptorSet::UpdateBufferViews(uint32_t layoutIndex, const AZStd::array_view>& bufViews) + void DescriptorSet::UpdateBufferViews(uint32_t layoutIndex, const AZStd::span>& bufViews) { const DescriptorSetLayout& layout = *m_descriptor.m_descriptorSetLayout; VkDescriptorType type = layout.GetDescriptorType(layoutIndex); @@ -119,7 +119,7 @@ namespace AZ m_updateData.push_back(AZStd::move(data)); } - void DescriptorSet::UpdateImageViews(uint32_t layoutIndex, const AZStd::array_view>& imageViews, RHI::ShaderInputImageType imageType) + void DescriptorSet::UpdateImageViews(uint32_t layoutIndex, const AZStd::span>& imageViews, RHI::ShaderInputImageType imageType) { const DescriptorSetLayout& layout = *m_descriptor.m_descriptorSetLayout; @@ -169,7 +169,7 @@ namespace AZ m_updateData.push_back(AZStd::move(data)); } - void DescriptorSet::UpdateSamplers(uint32_t layoutIndex, const AZStd::array_view& samplers) + void DescriptorSet::UpdateSamplers(uint32_t layoutIndex, const AZStd::span& samplers) { auto& device = static_cast(GetDevice()); @@ -189,7 +189,7 @@ namespace AZ m_updateData.push_back(AZStd::move(data)); } - void DescriptorSet::UpdateConstantData(AZStd::array_view rawData) + void DescriptorSet::UpdateConstantData(AZStd::span rawData) { AZ_Assert(m_constantDataBuffer, "Null constant buffer"); const DescriptorSetLayout& layout = *m_descriptor.m_descriptorSetLayout; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.h index 24fb587ade..1610a09418 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -57,10 +57,10 @@ namespace AZ void CommitUpdates(); - void UpdateBufferViews(uint32_t index, const AZStd::array_view>& bufViews); - void UpdateImageViews(uint32_t index, const AZStd::array_view>& imageViews, RHI::ShaderInputImageType imageType); - void UpdateSamplers(uint32_t index, const AZStd::array_view& samplers); - void UpdateConstantData(AZStd::array_view data); + void UpdateBufferViews(uint32_t index, const AZStd::span>& bufViews); + void UpdateImageViews(uint32_t index, const AZStd::span>& imageViews, RHI::ShaderInputImageType imageType); + void UpdateSamplers(uint32_t index, const AZStd::span& samplers); + void UpdateConstantData(AZStd::span data); RHI::Ptr GetConstantDataBufferView() const; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSetLayout.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSetLayout.cpp index 564614a0a8..1c8e21b22f 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSetLayout.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSetLayout.cpp @@ -152,12 +152,12 @@ namespace AZ RHI::ResultCode DescriptorSetLayout::BuildDescriptorSetLayoutBindings() { - const AZStd::array_view bufferDescs = m_shaderResourceGroupLayout->GetShaderInputListForBuffers(); - const AZStd::array_view imageDescs = m_shaderResourceGroupLayout->GetShaderInputListForImages(); - const AZStd::array_view bufferUnboundedArrayDescs = m_shaderResourceGroupLayout->GetShaderInputListForBufferUnboundedArrays(); - const AZStd::array_view imageUnboundedArrayDescs = m_shaderResourceGroupLayout->GetShaderInputListForImageUnboundedArrays(); - const AZStd::array_view samplerDescs = m_shaderResourceGroupLayout->GetShaderInputListForSamplers(); - const AZStd::array_view& staticSamplerDescs = m_shaderResourceGroupLayout->GetStaticSamplers(); + const AZStd::span bufferDescs = m_shaderResourceGroupLayout->GetShaderInputListForBuffers(); + const AZStd::span imageDescs = m_shaderResourceGroupLayout->GetShaderInputListForImages(); + const AZStd::span bufferUnboundedArrayDescs = m_shaderResourceGroupLayout->GetShaderInputListForBufferUnboundedArrays(); + const AZStd::span imageUnboundedArrayDescs = m_shaderResourceGroupLayout->GetShaderInputListForImageUnboundedArrays(); + const AZStd::span samplerDescs = m_shaderResourceGroupLayout->GetShaderInputListForSamplers(); + const AZStd::span& staticSamplerDescs = m_shaderResourceGroupLayout->GetStaticSamplers(); // The + 1 is for Constant Data. m_descriptorSetLayoutBindings.reserve( @@ -173,7 +173,7 @@ namespace AZ m_constantDataSize = m_shaderResourceGroupLayout->GetConstantDataSize(); if (m_constantDataSize) { - AZStd::array_view inputListForConstants = m_shaderResourceGroupLayout->GetShaderInputListForConstants(); + AZStd::span inputListForConstants = m_shaderResourceGroupLayout->GetShaderInputListForConstants(); AZ_Assert(!inputListForConstants.empty(), "Empty constant input list"); m_descriptorSetLayoutBindings.emplace_back(VkDescriptorSetLayoutBinding{}); VkDescriptorSetLayoutBinding& vbinding = m_descriptorSetLayoutBindings.back(); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.cpp index 12efb488fb..8df7aac253 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.cpp @@ -81,12 +81,12 @@ namespace AZ { } - AZStd::array_view FrameGraphExecuteGroup::GetScopes() const + AZStd::span FrameGraphExecuteGroup::GetScopes() const { - return AZStd::array_view(&m_scope, 1); + return AZStd::span(&m_scope, 1); } - AZStd::array_view> FrameGraphExecuteGroup::GetCommandLists() const + AZStd::span> FrameGraphExecuteGroup::GetCommandLists() const { return m_secondaryCommands; } diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.h index c7726beb76..f33775a9fa 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroup.h @@ -44,8 +44,8 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // FrameGraphExecuteGroupBase - AZStd::array_view GetScopes() const override; - AZStd::array_view> GetCommandLists() const override; + AZStd::span GetScopes() const override; + AZStd::span> GetCommandLists() const override; ////////////////////////////////////////////////////////////////////////// //! Set the render context and subpass that will be used by this execute group. diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupBase.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupBase.h index 529c452658..c1666d5ef2 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupBase.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupBase.h @@ -37,9 +37,9 @@ namespace AZ const RHI::GraphGroupId& GetGroupId() const; - virtual AZStd::array_view GetScopes() const = 0; + virtual AZStd::span GetScopes() const = 0; - virtual AZStd::array_view> GetCommandLists() const = 0; + virtual AZStd::span> GetCommandLists() const = 0; protected: RHI::Ptr AcquireCommandList(VkCommandBufferLevel level) const; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.cpp index 84b6cafa7d..053afc802e 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.cpp @@ -113,14 +113,14 @@ namespace AZ scope->EmitScopeBarriers(*m_commandList, Scope::BarrierSlot::Epilogue); } - AZStd::array_view FrameGraphExecuteGroupMerged::GetScopes() const + AZStd::span FrameGraphExecuteGroupMerged::GetScopes() const { return m_scopes; } - AZStd::array_view> FrameGraphExecuteGroupMerged::GetCommandLists() const + AZStd::span> FrameGraphExecuteGroupMerged::GetCommandLists() const { - return AZStd::array_view>(&m_commandList, 1); + return AZStd::span>(&m_commandList, 1); } void FrameGraphExecuteGroupMerged::SetPrimaryCommandList(CommandList& commandList) @@ -128,7 +128,7 @@ namespace AZ m_commandList = &commandList; } - void FrameGraphExecuteGroupMerged::SetRenderPasscontexts(AZStd::array_view renderPassContexts) + void FrameGraphExecuteGroupMerged::SetRenderPasscontexts(AZStd::span renderPassContexts) { m_renderPassContexts = renderPassContexts; } diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.h index 82c85ce3fe..47f97806a2 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/FrameGraphExecuteGroupMerged.h @@ -33,12 +33,12 @@ namespace AZ //! Set the command list that the group will use. void SetPrimaryCommandList(CommandList& commandList); //! Set the list of renderpasses that the group will use. - void SetRenderPasscontexts(AZStd::array_view renderPassContexts); + void SetRenderPasscontexts(AZStd::span renderPassContexts); ////////////////////////////////////////////////////////////////////////// // FrameGraphExecuteGroupBase - AZStd::array_view GetScopes() const override; - AZStd::array_view> GetCommandLists() const override; + AZStd::span GetScopes() const override; + AZStd::span> GetCommandLists() const override; ////////////////////////////////////////////////////////////////////////// private: @@ -60,7 +60,7 @@ namespace AZ // Primary command list used to record the work. RHI::Ptr m_commandList; // List of renderpasses and framebuffers used by the scopes in the group. - AZStd::array_view m_renderPassContexts; + AZStd::span m_renderPassContexts; }; } } diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp index f627ddf2cc..e61fc7817a 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp @@ -48,7 +48,7 @@ namespace AZ template void AddShaderInputs( RHI::ShaderResourceGroupLayout& srgLayout, - AZStd::array_view shaderInputs, + AZStd::span shaderInputs, const uint32_t bindingSlot, const RHI::ShaderResourceGroupBindingInfo& srgBidingInfo) { diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp index a797285981..c9e35a481b 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp @@ -31,7 +31,7 @@ namespace AZ VkPipelineCacheCreateInfo createInfo{}; createInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO; createInfo.pNext = nullptr; - createInfo.flags = 0; + createInfo.flags = 0; createInfo.initialDataSize = 0; createInfo.pInitialData = nullptr; @@ -59,7 +59,7 @@ namespace AZ } } - RHI::ResultCode PipelineLibrary::MergeIntoInternal(AZStd::array_view libraries) + RHI::ResultCode PipelineLibrary::MergeIntoInternal(AZStd::span libraries) { auto& device = static_cast(GetDevice()); if (libraries.empty()) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h index 03d78970da..34c254ec65 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h @@ -42,7 +42,7 @@ namespace AZ // RHI::PipelineLibrary RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryData* serializedData) override; void ShutdownInternal() override; - RHI::ResultCode MergeIntoInternal(AZStd::array_view libraries) override; + RHI::ResultCode MergeIntoInternal(AZStd::span libraries) override; RHI::ConstPtr GetSerializedDataInternal() const override; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.cpp index a3282067a7..6b629c675d 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.cpp @@ -77,20 +77,20 @@ namespace AZ return m_descriptor.m_attachmentCount; } - AZStd::array_view RenderPass::GetSubpassAttachments(const uint32_t subpassIndex, const AttachmentType type) const + AZStd::span RenderPass::GetSubpassAttachments(const uint32_t subpassIndex, const AttachmentType type) const { const SubpassDescriptor& descriptor = m_descriptor.m_subpassDescriptors[subpassIndex]; switch (type) { case AttachmentType::Color: - return AZStd::array_view(descriptor.m_rendertargetAttachments.begin(), descriptor.m_rendertargetCount); + return AZStd::span(descriptor.m_rendertargetAttachments.begin(), descriptor.m_rendertargetCount); case AttachmentType::DepthStencil: return descriptor.m_depthStencilAttachment.IsValid() ? - AZStd::array_view(&descriptor.m_depthStencilAttachment, 1) : AZStd::array_view(); + AZStd::span(&descriptor.m_depthStencilAttachment, 1) : AZStd::span(); case AttachmentType::InputAttachment: - return AZStd::array_view(descriptor.m_subpassInputAttachments.begin(), descriptor.m_subpassInputCount); + return AZStd::span(descriptor.m_subpassInputAttachments.begin(), descriptor.m_subpassInputCount); case AttachmentType::Resolve: - return AZStd::array_view(descriptor.m_resolveAttachments.begin(), descriptor.m_rendertargetCount); + return AZStd::span(descriptor.m_resolveAttachments.begin(), descriptor.m_rendertargetCount); default: AZ_Assert(false, "Invalid attachment type %d", type); return {}; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.h index 8aaef51bd0..1fb3018f3a 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RenderPass.h @@ -147,7 +147,7 @@ namespace AZ void BuildSubpassDescriptions(const AZStd::vector& subpassReferences, AZStd::vector& subpassDescriptions) const; void BuildSubpassDependencies(AZStd::vector& subpassDependencies) const; - AZStd::array_view GetSubpassAttachments(const uint32_t subpassIndex, const AttachmentType type) const; + AZStd::span GetSubpassAttachments(const uint32_t subpassIndex, const AttachmentType type) const; Descriptor m_descriptor; VkRenderPass m_nativeRenderPass = VK_NULL_HANDLE; @@ -157,7 +157,7 @@ namespace AZ template void RenderPass::BuildAttachmentReferences(uint32_t subpassIndex, SubpassReferences& subpasReferences) const { - AZStd::array_view subpassAttachmentList = GetSubpassAttachments(subpassIndex, type); + AZStd::span subpassAttachmentList = GetSubpassAttachments(subpassIndex, type); AZStd::vector& attachmentReferenceList = subpasReferences.m_attachmentReferences[static_cast(type)]; attachmentReferenceList.resize(subpassAttachmentList.size()); for (uint32_t index = 0; index < subpassAttachmentList.size(); ++index) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index fd63494f30..f669406172 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace AZ { @@ -34,7 +34,7 @@ namespace AZ explicit MaterialPropertyId(AZStd::string_view propertyName); MaterialPropertyId(AZStd::string_view groupName, AZStd::string_view propertyName); MaterialPropertyId(const Name& groupName, const Name& propertyName); - explicit MaterialPropertyId(const AZStd::array_view names); + explicit MaterialPropertyId(const AZStd::span names); AZ_DEFAULT_COPY_MOVE(MaterialPropertyId); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/GpuQueryTypes.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/GpuQueryTypes.h index 0a06c48989..9c20de36bb 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/GpuQueryTypes.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/GpuQueryTypes.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include @@ -65,7 +65,7 @@ namespace AZ static void Reflect(AZ::ReflectContext* context); PipelineStatisticsResult() = default; - PipelineStatisticsResult(AZStd::array_view&& statisticsResultArray); + PipelineStatisticsResult(AZStd::span&& statisticsResultArray); PipelineStatisticsResult& operator+=(const PipelineStatisticsResult& rhs); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/QueryPool.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/QueryPool.h index f152d92973..0ca88b3d33 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/QueryPool.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/GpuQuery/QueryPool.h @@ -15,7 +15,7 @@ #include -#include +#include namespace AZ { @@ -59,15 +59,15 @@ namespace AZ protected: QueryPool(uint32_t queryCapacity, uint32_t queriesPerResult, RHI::QueryType queryType, RHI::PipelineStatisticsFlags statisticsFlags); - // Returns the RHI Query array. - AZStd::array_view> GetRhiQueryArray() const; + // Returns the RHI Query array as a span. + AZStd::span> GetRhiQueryArray() const; private: // Distributes the RHI Query indices into sub-intervals. Each sub interval is assigned to a RPI Query. void CreateRhiQueryIntervals(); - // Returns an array of RHI Queries depending on the indices that are provided. - AZStd::array_view> GetRhiQueriesFromInterval(const RHI::Interval& rhiQueryIndices) const; + // Returns a span of RHI Queries depending on the indices that are provided. + AZStd::span> GetRhiQueriesFromInterval(const RHI::Interval& rhiQueryIndices) const; // Returns an array of raw RHI Query pointers depending on the indices that are provided. AZStd::vector GetRawRhiQueriesFromInterval(const RHI::Interval& rhiQueryIndices) const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/Model.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/Model.h index 91a9a2d009..a3de586e76 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/Model.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/Model.h @@ -51,7 +51,7 @@ namespace AZ size_t GetLodCount() const; //! Returns the full list of Lods, where index 0 is the most detailed, and N-1 is the least. - AZStd::array_view> GetLods() const; + AZStd::span> GetLods() const; //! Returns whether a buffer upload is pending. bool IsUploadPending() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h index 0d0304a04e..9ad6edf2ce 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -92,7 +92,7 @@ namespace AZ //! Blocks the CPU until pending buffer uploads have completed. void WaitForUpload(); - AZStd::array_view GetMeshes() const; + AZStd::span GetMeshes() const; //! Compares a ShaderInputContract to the mesh's available streams, and if any of them are optional, sets the corresponding "*_isBound" shader option. //! Call this function to update the ShaderOptionKey before fetching a ShaderVariant, to find a variant that is compatible with this mesh's streams. diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h index f5bf11a438..c9db343203 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h @@ -73,7 +73,7 @@ namespace AZ Ptr FindChildPass() const; //! Gets the list of children. Useful for validating hierarchies - AZStd::array_view> GetChildren() const; + AZStd::span> GetChildren() const; //! Searches the tree for the first pass that uses the given DrawListTag. const Pass* FindPass(RHI::DrawListTag drawListTag) const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h index be7ac9e7a4..a3b739ade7 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassAttachment.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassAttachment.h index d60a5a8064..8ee4270373 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassAttachment.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassAttachment.h @@ -192,7 +192,7 @@ namespace AZ }; using PassAttachmentBindingList = AZStd::vector; - using PassAttachmentBindingListView = AZStd::array_view; + using PassAttachmentBindingListView = AZStd::span; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassLibrary.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassLibrary.h index f79da54636..8db633509d 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassLibrary.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/PassLibrary.h @@ -15,7 +15,7 @@ #include #include -#include +#include namespace AZ { diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h index be20d89d65..07354e7bfc 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h @@ -127,7 +127,7 @@ namespace AZ const RHI::Ptr& FindFallbackShaderResourceGroupLayout() const; /// Returns the set of shader resource groups referenced by all variants in the shader asset. - AZStd::array_view> GetShaderResourceGroupLayouts() const; + AZStd::span> GetShaderResourceGroupLayouts() const; /// Returns a reference to the asset used to initialize this shader. const Data::Asset& GetAsset() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h index 99f1f5f598..771ea5ab31 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -104,16 +104,16 @@ namespace AZ bool SetImage(RHI::ShaderInputImageIndex inputIndex, const Data::Instance& image, uint32_t arrayIndex = 0); /// Sets multiple RPI images for the given shader input index. - bool SetImageArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view> images, uint32_t arrayIndex = 0); - bool SetImageArray(RHI::ShaderInputImageIndex inputIndex, AZStd::array_view> images, uint32_t arrayIndex = 0); + bool SetImageArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span> images, uint32_t arrayIndex = 0); + bool SetImageArray(RHI::ShaderInputImageIndex inputIndex, AZStd::span> images, uint32_t arrayIndex = 0); /// Returns a single RPI image associated with the image shader input index and array offset. const Data::Instance& GetImage(RHI::ShaderInputNameIndex& inputIndex, uint32_t arrayIndex = 0) const; const Data::Instance& GetImage(RHI::ShaderInputImageIndex inputIndex, uint32_t arrayIndex = 0) const; - /// Returns an array of RPI images associated with the image shader input index. - AZStd::array_view> GetImageArray(RHI::ShaderInputNameIndex& inputIndex) const; - AZStd::array_view> GetImageArray(RHI::ShaderInputImageIndex inputIndex) const; + /// Returns a span of RPI images associated with the image shader input index. + AZStd::span> GetImageArray(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span> GetImageArray(RHI::ShaderInputImageIndex inputIndex) const; ////////////////////////////////////////////////////////////////////////// // Methods for assignment / access of RPI Buffer types. @@ -123,17 +123,17 @@ namespace AZ bool SetBuffer(RHI::ShaderInputBufferIndex inputIndex, const Data::Instance& buffer, uint32_t arrayIndex = 0); /// Sets multiple RPI buffers for the given shader input index. - bool SetBufferArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view> buffers, uint32_t arrayIndex = 0); - bool SetBufferArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::array_view> buffers, uint32_t arrayIndex = 0); + bool SetBufferArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span> buffers, uint32_t arrayIndex = 0); + bool SetBufferArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::span> buffers, uint32_t arrayIndex = 0); /// Returns a single RPI buffer associated with the buffer shader input index and array offset. const Data::Instance& GetBuffer(RHI::ShaderInputNameIndex& inputIndex, uint32_t arrayIndex = 0) const; const Data::Instance& GetBuffer(RHI::ShaderInputBufferIndex inputIndex, uint32_t arrayIndex = 0) const; - /// Returns an array of RPI buffers associated with the buffer shader input index. - AZStd::array_view> GetBufferArray(RHI::ShaderInputNameIndex& inputIndex) const; - AZStd::array_view> GetBufferArray(RHI::ShaderInputBufferIndex inputIndex) const; - + /// Returns a span of RPI buffers associated with the buffer shader input index. + AZStd::span> GetBufferArray(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span> GetBufferArray(RHI::ShaderInputBufferIndex inputIndex) const; + //! Reset image and buffer views so that it won't hold references for any RHI resources void ResetViews(); @@ -145,19 +145,19 @@ namespace AZ bool SetImageView(RHI::ShaderInputImageIndex inputIndex, const RHI::ImageView* imageView, uint32_t arrayIndex = 0); /// Sets an array of image view for the given shader input index. - bool SetImageViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view imageViews, uint32_t arrayIndex = 0); - bool SetImageViewArray(RHI::ShaderInputImageIndex inputIndex, AZStd::array_view imageViews, uint32_t arrayIndex = 0); + bool SetImageViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span imageViews, uint32_t arrayIndex = 0); + bool SetImageViewArray(RHI::ShaderInputImageIndex inputIndex, AZStd::span imageViews, uint32_t arrayIndex = 0); /// Sets an unbounded array of image views for the given shader input index. - bool SetImageViewUnboundedArray(RHI::ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::array_view imageViews); + bool SetImageViewUnboundedArray(RHI::ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::span imageViews); /// Returns a single image view associated with the image shader input index and array offset. const RHI::ConstPtr& GetImageView(RHI::ShaderInputNameIndex& inputIndex, uint32_t arrayIndex = 0) const; const RHI::ConstPtr& GetImageView(RHI::ShaderInputImageIndex inputIndex, uint32_t arrayIndex = 0) const; - /// Returns an array of image views associated with the given image shader input index. - AZStd::array_view> GetImageViewArray(RHI::ShaderInputNameIndex& inputIndex) const; - AZStd::array_view> GetImageViewArray(RHI::ShaderInputImageIndex inputIndex) const; + /// Returns a span of image views associated with the given image shader input index. + AZStd::span> GetImageViewArray(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span> GetImageViewArray(RHI::ShaderInputImageIndex inputIndex) const; ////////////////////////////////////////////////////////////////////////// // Methods for assignment / access of RHI Buffer types. @@ -167,19 +167,19 @@ namespace AZ bool SetBufferView(RHI::ShaderInputBufferIndex inputIndex, const RHI::BufferView* bufferView, uint32_t arrayIndex = 0); /// Sets an array of buffer view for the given shader input index. - bool SetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view bufferViews, uint32_t arrayIndex = 0); - bool SetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::array_view bufferViews, uint32_t arrayIndex = 0); + bool SetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span bufferViews, uint32_t arrayIndex = 0); + bool SetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::span bufferViews, uint32_t arrayIndex = 0); /// Sets an unbounded array of buffer views for the given shader input index. - bool SetBufferViewUnboundedArray(RHI::ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::array_view bufferViews); + bool SetBufferViewUnboundedArray(RHI::ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::span bufferViews); /// Returns a single buffer view associated with the buffer shader input index and array offset. const RHI::ConstPtr& GetBufferView(RHI::ShaderInputNameIndex& inputIndex, uint32_t arrayIndex = 0) const; const RHI::ConstPtr& GetBufferView(RHI::ShaderInputBufferIndex inputIndex, uint32_t arrayIndex = 0) const; - /// Returns an array of buffer views associated with the given buffer shader input index. - AZStd::array_view> GetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex) const; - AZStd::array_view> GetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex) const; + /// Returns a span of buffer views associated with the given buffer shader input index. + AZStd::span> GetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span> GetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex) const; ////////////////////////////////////////////////////////////////////////// // Methods for assignment / access of RHI Sampler types. @@ -189,16 +189,16 @@ namespace AZ bool SetSampler(RHI::ShaderInputSamplerIndex inputIndex, const RHI::SamplerState& sampler, uint32_t arrayIndex = 0); /// Sets an array of samplers for the given shader input index. - bool SetSamplerArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view samplers, uint32_t arrayIndex = 0); - bool SetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex, AZStd::array_view samplers, uint32_t arrayIndex = 0); + bool SetSamplerArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span samplers, uint32_t arrayIndex = 0); + bool SetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex, AZStd::span samplers, uint32_t arrayIndex = 0); /// Returns a single sampler associated with the sampler shader input index and array offset. const RHI::SamplerState& GetSampler(RHI::ShaderInputNameIndex& inputIndex, uint32_t arrayIndex) const; const RHI::SamplerState& GetSampler(RHI::ShaderInputSamplerIndex inputIndex, uint32_t arrayIndex) const; - /// Returns an array of samplers associated with the sampler shader input index. - AZStd::array_view GetSamplerArray(RHI::ShaderInputNameIndex& inputIndex) const; - AZStd::array_view GetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex) const; + /// Returns a span of samplers associated with the sampler shader input index. + AZStd::span GetSamplerArray(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span GetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex) const; ////////////////////////////////////////////////////////////////////////// // Methods for assignment / access SRG constants. @@ -227,11 +227,11 @@ namespace AZ template bool SetConstant(RHI::ShaderInputConstantIndex inputIndex, const T& value, uint32_t arrayIndex); - /// Assigns an array of type T to the constant shader input. + /// Assigns a span of type T to the constant shader input. template - bool SetConstantArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view values); + bool SetConstantArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span values); template - bool SetConstantArray(RHI::ShaderInputConstantIndex inputIndex, AZStd::array_view values); + bool SetConstantArray(RHI::ShaderInputConstantIndex inputIndex, AZStd::span values); /// Assigns an array of type T to the constant shader input. template @@ -253,9 +253,9 @@ namespace AZ * If the strides do not match, an empty array is returned. */ template - AZStd::array_view GetConstantArray(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span GetConstantArray(RHI::ShaderInputNameIndex& inputIndex) const; template - AZStd::array_view GetConstantArray(RHI::ShaderInputConstantIndex inputIndex) const; + AZStd::span GetConstantArray(RHI::ShaderInputConstantIndex inputIndex) const; /** * Returns the constant data as type 'T' returned by value. The size of the constant region @@ -276,9 +276,9 @@ namespace AZ template T GetConstant(RHI::ShaderInputConstantIndex inputIndex, uint32_t arrayIndex) const; - /// Returns constant data for the given shader input index as an array of bytes. - AZStd::array_view GetConstantRaw(RHI::ShaderInputNameIndex& inputIndex) const; - AZStd::array_view GetConstantRaw(RHI::ShaderInputConstantIndex inputIndex) const; + /// Returns constant data for the given shader input index as a span of bytes. + AZStd::span GetConstantRaw(RHI::ShaderInputNameIndex& inputIndex) const; + AZStd::span GetConstantRaw(RHI::ShaderInputConstantIndex inputIndex) const; private: ShaderResourceGroup() = default; @@ -415,13 +415,13 @@ namespace AZ } template - bool ShaderResourceGroup::SetConstantArray(RHI::ShaderInputConstantIndex inputIndex, AZStd::array_view values) + bool ShaderResourceGroup::SetConstantArray(RHI::ShaderInputConstantIndex inputIndex, AZStd::span values) { return m_data.SetConstantArray(inputIndex, values); } template - bool ShaderResourceGroup::SetConstantArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view values) + bool ShaderResourceGroup::SetConstantArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span values) { if (inputIndex.ValidateOrFindConstantIndex(GetLayout())) { @@ -433,7 +433,7 @@ namespace AZ template bool ShaderResourceGroup::SetConstantArray(RHI::ShaderInputConstantIndex inputIndex, const AZStd::array& values) { - return SetConstantArray(inputIndex, AZStd::array_view(values)); + return SetConstantArray(inputIndex, AZStd::span(values)); } template @@ -441,19 +441,19 @@ namespace AZ { if (inputIndex.ValidateOrFindConstantIndex(GetLayout())) { - return SetConstantArray(inputIndex.GetConstantIndex(), AZStd::array_view(values)); + return SetConstantArray(inputIndex.GetConstantIndex(), AZStd::span(values)); } return false; } template - AZStd::array_view ShaderResourceGroup::GetConstantArray(RHI::ShaderInputConstantIndex inputIndex) const + AZStd::span ShaderResourceGroup::GetConstantArray(RHI::ShaderInputConstantIndex inputIndex) const { return m_data.GetConstantArray(inputIndex); } template - AZStd::array_view ShaderResourceGroup::GetConstantArray(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span ShaderResourceGroup::GetConstantArray(RHI::ShaderInputNameIndex& inputIndex) const { if (inputIndex.ValidateOrFindConstantIndex(GetLayout())) { diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Buffer/BufferAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Buffer/BufferAsset.h index e6fe68b21e..75556887e1 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Buffer/BufferAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Buffer/BufferAsset.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include @@ -46,7 +46,7 @@ namespace AZ BufferAsset() = default; ~BufferAsset() = default; - AZStd::array_view GetBuffer() const; + AZStd::span GetBuffer() const; const RHI::BufferDescriptor& GetBufferDescriptor() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageMipChainAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageMipChainAsset.h index 69c1933bd6..397b47b5d2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageMipChainAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageMipChainAsset.h @@ -14,7 +14,7 @@ #include -#include +#include #include @@ -64,10 +64,10 @@ namespace AZ size_t GetSubImageCount() const; //! Returns the sub-image data blob for a given mip slice and array slice (local to the group). - AZStd::array_view GetSubImageData(uint32_t mipSlice, uint32_t arraySlice) const; + AZStd::span GetSubImageData(uint32_t mipSlice, uint32_t arraySlice) const; //! Returns the sub-image data blob for a linear index (local to the group). - AZStd::array_view GetSubImageData(uint32_t subImageIndex) const; + AZStd::span GetSubImageData(uint32_t subImageIndex) const; //! Returns the sub-image layout for a single sub-image by index. const RHI::ImageSubresourceLayout& GetSubImageLayout(uint32_t subImageIndex) const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 73af8370cb..76e49edbb4 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -83,7 +83,7 @@ namespace AZ size_t GetMipCount(size_t mipChainIndex) const; //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded - AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); + AZStd::span GetSubImageData(uint32_t mip, uint32_t slice); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index b7cc51dcc4..63c42a3882 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h index 9065b17254..f2302065e2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -118,7 +118,7 @@ namespace AZ //! The entries in this list align with the entries in the MaterialPropertiesLayout. Each AZStd::any is guaranteed //! to have a value of type that matches the corresponding MaterialPropertyDescriptor. //! For images, the value will be of type ImageBinding. - AZStd::array_view GetDefaultPropertyValues() const; + AZStd::span GetDefaultPropertyValues() const; //! Returns a map from the UV shader inputs to a custom name. MaterialUvNameMap GetUvNameMap() const; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h index 6bd84b5546..ce6fbbae23 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h @@ -9,7 +9,7 @@ #include #include -#include +#include namespace AZ { diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelAsset.h index 91d89ce719..ea02e87405 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelAsset.h @@ -59,7 +59,7 @@ namespace AZ //! Returns the number of Lods in the model size_t GetLodCount() const; - AZStd::array_view> GetLodAssets() const; + AZStd::span> GetLodAssets() const; //! Checks a ray for intersection against this model. The ray must be in the same coordinate space as the model. //! Important: only to be used in the Editor, it may kick off a job to calculate spatial information. diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelKdTree.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelKdTree.h index 134f1c767d..2e51a37488 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelKdTree.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelKdTree.h @@ -50,9 +50,9 @@ namespace AZ eSA_Invalid }; - static AZStd::array_view GetPositionsBuffer(const ModelLodAsset::Mesh& mesh); + static AZStd::span GetPositionsBuffer(const ModelLodAsset::Mesh& mesh); - static AZStd::array_view GetIndexBuffer(const ModelLodAsset::Mesh& mesh); + static AZStd::span GetIndexBuffer(const ModelLodAsset::Mesh& mesh); private: @@ -75,7 +75,7 @@ namespace AZ struct MeshData { const ModelLodAsset::Mesh* m_mesh = nullptr; - AZStd::array_view m_vertexData; + AZStd::span m_vertexData; }; AZStd::vector m_meshes; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelLodAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelLodAsset.h index 4b09cf8d91..d7b4979e06 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelLodAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/ModelLodAsset.h @@ -101,10 +101,10 @@ namespace AZ //! A helper method for returning this mesh's index buffer using a specific type for the elements. //! @note It's the caller's responsibility to choose the right type for the buffer. template - AZStd::array_view GetIndexBufferTyped() const; + AZStd::span GetIndexBufferTyped() const; //! Return an array view of the list of all stream buffer info (not including the index buffer) - AZStd::array_view GetStreamBufferInfoList() const; + AZStd::span GetStreamBufferInfoList() const; //! A helper method for returning a specific buffer asset view. //! It will return nullptr if the semantic buffer is not found. @@ -117,11 +117,11 @@ namespace AZ //! In perf loop, re-use AZ::Name instance. //! @note It's the caller's responsibility to choose the right type for the buffer. template - AZStd::array_view GetSemanticBufferTyped(const AZ::Name& semantic) const; + AZStd::span GetSemanticBufferTyped(const AZ::Name& semantic) const; private: template - AZStd::array_view GetBufferTyped(const BufferAssetView& bufferAssetView) const; + AZStd::span GetBufferTyped(const BufferAssetView& bufferAssetView) const; AZ::Name m_name; AZ::Aabb m_aabb = AZ::Aabb::CreateNull(); @@ -143,7 +143,7 @@ namespace AZ }; //! Returns an array view into the collection of meshes owned by this lod - AZStd::array_view GetMeshes() const; + AZStd::span GetMeshes() const; //! Returns the model-space axis-aligned bounding box of all meshes in the lod const AZ::Aabb& GetAabb() const; @@ -173,24 +173,24 @@ namespace AZ using ModelLodAssetHandler = AssetHandler; template - AZStd::array_view ModelLodAsset::Mesh::GetIndexBufferTyped() const + AZStd::span ModelLodAsset::Mesh::GetIndexBufferTyped() const { return GetBufferTyped(GetIndexBufferAssetView()); } template - AZStd::array_view ModelLodAsset::Mesh::GetSemanticBufferTyped(const AZ::Name& semantic) const + AZStd::span ModelLodAsset::Mesh::GetSemanticBufferTyped(const AZ::Name& semantic) const { const BufferAssetView* bufferAssetView = GetSemanticBufferAssetView(semantic); - return bufferAssetView ? GetBufferTyped(*bufferAssetView) : AZStd::array_view{}; + return bufferAssetView ? GetBufferTyped(*bufferAssetView) : AZStd::span{}; } template - AZStd::array_view ModelLodAsset::Mesh::GetBufferTyped(const BufferAssetView& bufferAssetView) const + AZStd::span ModelLodAsset::Mesh::GetBufferTyped(const BufferAssetView& bufferAssetView) const { if (const BufferAsset* bufferAsset = bufferAssetView.GetBufferAsset().Get()) { - const AZStd::array_view rawBuffer = bufferAsset->GetBuffer(); + const AZStd::span rawBuffer = bufferAsset->GetBuffer(); if (!rawBuffer.empty()) { const auto& bufferViewDescriptor = bufferAssetView.GetBufferViewDescriptor(); @@ -202,7 +202,7 @@ namespace AZ "Size of buffer (%d) is not a multiple of the type's size specified (%d)", endMeshRawBuffer - beginMeshRawBuffer, sizeof(T)); - return AZStd::array_view(reinterpret_cast(beginMeshRawBuffer), reinterpret_cast(endMeshRawBuffer)); + return AZStd::span(reinterpret_cast(beginMeshRawBuffer), reinterpret_cast(endMeshRawBuffer)); } } return {}; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassAttachmentReflect.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassAttachmentReflect.h index 0de3676abe..b0008c44d1 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassAttachmentReflect.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassAttachmentReflect.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -130,7 +130,7 @@ namespace AZ }; using PassSlotList = AZStd::vector; - using PassSlotListView = AZStd::array_view; + using PassSlotListView = AZStd::span; //! Refers to a PassAttachment or a PassAttachmentBinding on an adjacent Pass in the hierarchy. Specifies the //! name of attachment or binding/slot as well as the name of the Pass on which the attachment or binding lives. @@ -166,7 +166,7 @@ namespace AZ }; using PassConnectionList = AZStd::vector; - using PassConnectionListView = AZStd::array_view; + using PassConnectionListView = AZStd::span; //! Specifies a connection from a Pass's output slot to one of it's input slots. This is used as a fallback //! for the output when the pass is disabled so the output can present a valid attachments to subsequent passes. @@ -183,7 +183,7 @@ namespace AZ }; using PassFallbackConnectionList = AZStd::vector; - using PassFallbackConnectionListView = AZStd::array_view; + using PassFallbackConnectionListView = AZStd::span; // --- Pass Attachment Descriptor Classes --- @@ -269,7 +269,7 @@ namespace AZ }; using PassImageAttachmentDescList = AZStd::vector; - using PassImageAttachmentDescListView = AZStd::array_view; + using PassImageAttachmentDescListView = AZStd::span; //! A PassAttachmentDesc used for buffers struct PassBufferAttachmentDesc final @@ -283,7 +283,7 @@ namespace AZ }; using PassBufferAttachmentDescList = AZStd::vector; - using PassBufferAttachmentDescListView = AZStd::array_view; + using PassBufferAttachmentDescListView = AZStd::span; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassRequest.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassRequest.h index 28d9fcc812..92067938b6 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassRequest.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassRequest.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -75,7 +75,7 @@ namespace AZ }; using PassRequestList = AZStd::vector; - using PassRequestListView = AZStd::array_view; + using PassRequestListView = AZStd::span; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassTemplate.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassTemplate.h index d33b632848..f6bcd019cc 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassTemplate.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/PassTemplate.h @@ -11,7 +11,7 @@ #include -#include +#include #include #include diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h index 70451bd055..bea7cb4b26 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h @@ -158,8 +158,8 @@ namespace AZ //! Returns the set of shader resource group layouts owned by a given supervariant. - AZStd::array_view> GetShaderResourceGroupLayouts( SupervariantIndex supervariantIndex) const; - AZStd::array_view> GetShaderResourceGroupLayouts() const + AZStd::span> GetShaderResourceGroupLayouts( SupervariantIndex supervariantIndex) const; + AZStd::span> GetShaderResourceGroupLayouts() const { return GetShaderResourceGroupLayouts(DefaultSupervariantIndex); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index d123fe33b7..3b0d6d79b8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -88,7 +88,7 @@ namespace AZ { } - MaterialPropertyId::MaterialPropertyId(const AZStd::array_view names) + MaterialPropertyId::MaterialPropertyId(const AZStd::span names) { for (const auto& name : names) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/GpuQueryTypes.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/GpuQueryTypes.cpp index 1c8c504aad..69637bce4e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/GpuQueryTypes.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/GpuQueryTypes.cpp @@ -54,7 +54,7 @@ namespace AZ // --- PipelineStatisticsResult --- - PipelineStatisticsResult::PipelineStatisticsResult(AZStd::array_view&& statisticsResultArray) + PipelineStatisticsResult::PipelineStatisticsResult(AZStd::span&& statisticsResultArray) { for (const PipelineStatisticsResult& result : statisticsResultArray) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/QueryPool.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/QueryPool.cpp index 755b4e8cea..d4411b57c0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/QueryPool.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/QueryPool.cpp @@ -147,7 +147,7 @@ namespace AZ return endQuery->End(commandList); } - AZStd::array_view> RPI::QueryPool::GetRhiQueryArray() const + AZStd::span> RPI::QueryPool::GetRhiQueryArray() const { return m_rhiQueryArray; } @@ -230,12 +230,12 @@ namespace AZ return m_queriesPerResult; } - AZStd::array_view> QueryPool::GetRhiQueriesFromInterval(const RHI::Interval& rhiQueryIndices) const + AZStd::span> QueryPool::GetRhiQueriesFromInterval(const RHI::Interval& rhiQueryIndices) const { const uint32_t queryCount = rhiQueryIndices.m_max - rhiQueryIndices.m_min + 1u; AZ_Assert(rhiQueryIndices.m_max < m_rhiQueryCapacity, "Query array index is going over the limit"); - return AZStd::array_view>(m_rhiQueryArray.begin() + rhiQueryIndices.m_min, queryCount); + return AZStd::span>(m_rhiQueryArray.begin() + rhiQueryIndices.m_min, queryCount); } AZStd::vector QueryPool::GetRawRhiQueriesFromInterval(const RHI::Interval& rhiQueryIndices) const diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/TimestampQueryPool.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/TimestampQueryPool.cpp index 7edc325b9e..33b776671a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/TimestampQueryPool.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/TimestampQueryPool.cpp @@ -26,7 +26,7 @@ namespace AZ RHI::ResultCode TimestampQueryPool::BeginQueryInternal(RHI::Interval rhiQueryIndices, RHI::CommandList& commandList) { - AZStd::array_view> rhiQueryArray = GetRhiQueryArray(); + AZStd::span> rhiQueryArray = GetRhiQueryArray(); AZ::RHI::Ptr beginQuery = rhiQueryArray[rhiQueryIndices.m_min]; return beginQuery->WriteTimestamp(commandList); @@ -34,7 +34,7 @@ namespace AZ RHI::ResultCode TimestampQueryPool::EndQueryInternal(RHI::Interval rhiQueryIndices, RHI::CommandList& commandList) { - AZStd::array_view> rhiQueryArray = GetRhiQueryArray(); + AZStd::span> rhiQueryArray = GetRhiQueryArray(); AZ::RHI::Ptr endQuery = rhiQueryArray[rhiQueryIndices.m_max]; return endQuery->WriteTimestamp(commandList); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp index 4f3cf52dad..b5d1c06d8d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp @@ -57,7 +57,7 @@ namespace AZ return m_lods.size(); } - AZStd::array_view> Model::GetLods() const + AZStd::span> Model::GetLods() const { return m_lods; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp index a928aec12f..0af1893a71 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp @@ -28,7 +28,7 @@ namespace AZ &modelAssetAny); } - AZStd::array_view ModelLod::GetMeshes() const + AZStd::span ModelLod::GetMeshes() const { return m_meshes; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp index 55f3e44173..77a3e1524a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp @@ -398,7 +398,7 @@ namespace AZ // --- Debug functions --- - AZStd::array_view> ParentPass::GetChildren() const + AZStd::span> ParentPass::GetChildren() const { return m_children; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index 130c0158d1..de79931ed0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -490,7 +490,7 @@ namespace AZ return m_asset->FindFallbackShaderResourceGroupLayout(m_supervariantIndex); } - AZStd::array_view> Shader::GetShaderResourceGroupLayouts() const + AZStd::span> Shader::GetShaderResourceGroupLayouts() const { return m_asset->GetShaderResourceGroupLayouts(m_supervariantIndex); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp index b927e864fc..383ddddf19 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -76,7 +76,7 @@ namespace AZ { const auto& lay = shaderAsset.FindShaderResourceGroupLayout(srgName, supervariantIndex); m_layout = lay.get(); - + if (!m_layout) { AZ_Assert(false, "ShaderResourceGroup cannot be initialized due to invalid ShaderResourceGroupLayout"); @@ -188,7 +188,7 @@ namespace AZ { return GetLayout()->HasShaderVariantKeyFallbackEntry(); } - + bool ShaderResourceGroup::SetImage(RHI::ShaderInputNameIndex& inputIndex, const Data::Instance& image, uint32_t arrayIndex) { if (inputIndex.ValidateOrFindImageIndex(GetLayout())) @@ -215,7 +215,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetImageArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view> images, uint32_t arrayIndex) + bool ShaderResourceGroup::SetImageArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span> images, uint32_t arrayIndex) { if (inputIndex.ValidateOrFindImageIndex(GetLayout())) { @@ -224,7 +224,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetImageArray(RHI::ShaderInputImageIndex inputIndex, AZStd::array_view> images, uint32_t arrayIndex) + bool ShaderResourceGroup::SetImageArray(RHI::ShaderInputImageIndex inputIndex, AZStd::span> images, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, arrayIndex + static_cast(images.size()) - 1)) { @@ -257,7 +257,7 @@ namespace AZ return s_nullImage; } - AZStd::array_view> ShaderResourceGroup::GetImageArray(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span> ShaderResourceGroup::GetImageArray(RHI::ShaderInputNameIndex& inputIndex) const { if (inputIndex.ValidateOrFindImageIndex(GetLayout())) { @@ -266,12 +266,12 @@ namespace AZ return {}; } - AZStd::array_view> ShaderResourceGroup::GetImageArray(RHI::ShaderInputImageIndex inputIndex) const + AZStd::span> ShaderResourceGroup::GetImageArray(RHI::ShaderInputImageIndex inputIndex) const { if (m_layout->ValidateAccess(inputIndex, 0)) { const RHI::Interval interval = m_layout->GetGroupInterval(inputIndex); - return AZStd::array_view>(&m_imageGroup[interval.m_min], interval.m_max - interval.m_min); + return AZStd::span>(&m_imageGroup[interval.m_min], interval.m_max - interval.m_min); } return {}; } @@ -299,7 +299,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetImageViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view imageViews, uint32_t arrayIndex) + bool ShaderResourceGroup::SetImageViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span imageViews, uint32_t arrayIndex) { if (inputIndex.ValidateOrFindImageIndex(GetLayout())) { @@ -308,7 +308,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetImageViewArray(RHI::ShaderInputImageIndex inputIndex, AZStd::array_view imageViews, uint32_t arrayIndex) + bool ShaderResourceGroup::SetImageViewArray(RHI::ShaderInputImageIndex inputIndex, AZStd::span imageViews, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, arrayIndex + static_cast(imageViews.size()) - 1)) { @@ -322,7 +322,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetImageViewUnboundedArray(RHI::ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::array_view imageViews) + bool ShaderResourceGroup::SetImageViewUnboundedArray(RHI::ShaderInputImageUnboundedArrayIndex inputIndex, AZStd::span imageViews) { return m_data.SetImageViewUnboundedArray(inputIndex, imageViews); } @@ -350,7 +350,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view bufferViews, uint32_t arrayIndex) + bool ShaderResourceGroup::SetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span bufferViews, uint32_t arrayIndex) { if (inputIndex.ValidateOrFindBufferIndex(GetLayout())) { @@ -359,7 +359,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::array_view bufferViews, uint32_t arrayIndex) + bool ShaderResourceGroup::SetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::span bufferViews, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, arrayIndex + static_cast(bufferViews.size()) - 1)) { @@ -373,7 +373,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetBufferViewUnboundedArray(RHI::ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::array_view bufferViews) + bool ShaderResourceGroup::SetBufferViewUnboundedArray(RHI::ShaderInputBufferUnboundedArrayIndex inputIndex, AZStd::span bufferViews) { return m_data.SetBufferViewUnboundedArray(inputIndex, bufferViews); } @@ -392,7 +392,7 @@ namespace AZ return m_data.SetSampler(inputIndex, sampler, arrayIndex); } - bool ShaderResourceGroup::SetSamplerArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view samplers, uint32_t arrayIndex) + bool ShaderResourceGroup::SetSamplerArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span samplers, uint32_t arrayIndex) { if (inputIndex.ValidateOrFindSamplerIndex(GetLayout())) { @@ -401,7 +401,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex, AZStd::array_view samplers, uint32_t arrayIndex) + bool ShaderResourceGroup::SetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex, AZStd::span samplers, uint32_t arrayIndex) { return m_data.SetSamplerArray(inputIndex, samplers, arrayIndex); } @@ -437,7 +437,7 @@ namespace AZ bool ShaderResourceGroup::ApplyDataMappings(const RHI::ShaderDataMappings& mappings) { bool success = true; - + success = success && ApplyDataMappingArray(mappings.m_colorMappings); success = success && ApplyDataMappingArray(mappings.m_uintMappings); success = success && ApplyDataMappingArray(mappings.m_floatMappings); @@ -461,13 +461,13 @@ namespace AZ return m_data.GetImageView(inputIndex, arrayIndex); } - AZStd::array_view> ShaderResourceGroup::GetImageViewArray(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span> ShaderResourceGroup::GetImageViewArray(RHI::ShaderInputNameIndex& inputIndex) const { inputIndex.ValidateOrFindImageIndex(GetLayout()); return GetImageViewArray(inputIndex.GetImageIndex()); } - AZStd::array_view> ShaderResourceGroup::GetImageViewArray(RHI::ShaderInputImageIndex inputIndex) const + AZStd::span> ShaderResourceGroup::GetImageViewArray(RHI::ShaderInputImageIndex inputIndex) const { return m_data.GetImageViewArray(inputIndex); } @@ -483,13 +483,13 @@ namespace AZ return m_data.GetBufferView(inputIndex, arrayIndex); } - AZStd::array_view> ShaderResourceGroup::GetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span> ShaderResourceGroup::GetBufferViewArray(RHI::ShaderInputNameIndex& inputIndex) const { inputIndex.ValidateOrFindBufferIndex(GetLayout()); return GetBufferViewArray(inputIndex.GetBufferIndex()); } - AZStd::array_view> ShaderResourceGroup::GetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex) const + AZStd::span> ShaderResourceGroup::GetBufferViewArray(RHI::ShaderInputBufferIndex inputIndex) const { return m_data.GetBufferViewArray(inputIndex); } @@ -520,7 +520,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetBufferArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::array_view> buffers, uint32_t arrayIndex) + bool ShaderResourceGroup::SetBufferArray(RHI::ShaderInputNameIndex& inputIndex, AZStd::span> buffers, uint32_t arrayIndex) { if (inputIndex.ValidateOrFindBufferIndex(GetLayout())) { @@ -529,7 +529,7 @@ namespace AZ return false; } - bool ShaderResourceGroup::SetBufferArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::array_view> buffers, uint32_t arrayIndex) + bool ShaderResourceGroup::SetBufferArray(RHI::ShaderInputBufferIndex inputIndex, AZStd::span> buffers, uint32_t arrayIndex) { if (GetLayout()->ValidateAccess(inputIndex, arrayIndex + static_cast(buffers.size()) - 1)) { @@ -562,7 +562,7 @@ namespace AZ return s_nullBuffer; } - AZStd::array_view> ShaderResourceGroup::GetBufferArray(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span> ShaderResourceGroup::GetBufferArray(RHI::ShaderInputNameIndex& inputIndex) const { if (inputIndex.ValidateOrFindBufferIndex(GetLayout())) { @@ -571,12 +571,12 @@ namespace AZ return {}; } - AZStd::array_view> ShaderResourceGroup::GetBufferArray(RHI::ShaderInputBufferIndex inputIndex) const + AZStd::span> ShaderResourceGroup::GetBufferArray(RHI::ShaderInputBufferIndex inputIndex) const { if (m_layout->ValidateAccess(inputIndex, 0)) { const RHI::Interval interval = m_layout->GetGroupInterval(inputIndex); - return AZStd::array_view>(&m_bufferGroup[interval.m_min], interval.m_max - interval.m_min); + return AZStd::span>(&m_bufferGroup[interval.m_min], interval.m_max - interval.m_min); } return {}; } @@ -597,24 +597,24 @@ namespace AZ return m_data.GetSampler(inputIndex, arrayIndex); } - AZStd::array_view ShaderResourceGroup::GetSamplerArray(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span ShaderResourceGroup::GetSamplerArray(RHI::ShaderInputNameIndex& inputIndex) const { inputIndex.ValidateOrFindSamplerIndex(GetLayout()); return GetSamplerArray(inputIndex.GetSamplerIndex()); } - AZStd::array_view ShaderResourceGroup::GetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex) const + AZStd::span ShaderResourceGroup::GetSamplerArray(RHI::ShaderInputSamplerIndex inputIndex) const { return m_data.GetSamplerArray(inputIndex); } - AZStd::array_view ShaderResourceGroup::GetConstantRaw(RHI::ShaderInputNameIndex& inputIndex) const + AZStd::span ShaderResourceGroup::GetConstantRaw(RHI::ShaderInputNameIndex& inputIndex) const { inputIndex.ValidateOrFindConstantIndex(GetLayout()); return GetConstantRaw(inputIndex.GetConstantIndex()); } - AZStd::array_view ShaderResourceGroup::GetConstantRaw(RHI::ShaderInputConstantIndex inputIndex) const + AZStd::span ShaderResourceGroup::GetConstantRaw(RHI::ShaderInputConstantIndex inputIndex) const { return m_data.GetConstantRaw(inputIndex); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAsset.cpp index 95f47d7393..92508162a5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAsset.cpp @@ -49,9 +49,9 @@ namespace AZ } } - AZStd::array_view BufferAsset::GetBuffer() const + AZStd::span BufferAsset::GetBuffer() const { - return AZStd::array_view(m_buffer); + return AZStd::span(m_buffer); } const RHI::BufferDescriptor& BufferAsset::GetBufferDescriptor() const diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAssetCreator.cpp index feeeff36cf..ec8292a52e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Buffer/BufferAssetCreator.cpp @@ -165,7 +165,7 @@ namespace AZ creator.SetPoolAsset(sourceAsset->GetPoolAsset()); creator.SetBufferViewDescriptor(sourceAsset->GetBufferViewDescriptor()); - const AZStd::array_view sourceBuffer = sourceAsset->GetBuffer(); + const AZStd::span sourceBuffer = sourceAsset->GetBuffer(); creator.SetBuffer(sourceBuffer.data(), sourceBuffer.size(), sourceAsset->GetBufferDescriptor()); return creator.End(clonedResult); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageMipChainAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageMipChainAsset.cpp index f86200485a..e86cfb7c82 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageMipChainAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageMipChainAsset.cpp @@ -49,19 +49,19 @@ namespace AZ return m_subImageDatas.size(); } - AZStd::array_view ImageMipChainAsset::GetSubImageData(uint32_t mipSlice, uint32_t arraySlice) const + AZStd::span ImageMipChainAsset::GetSubImageData(uint32_t mipSlice, uint32_t arraySlice) const { return GetSubImageData(mipSlice * m_arraySize + arraySlice); } - AZStd::array_view ImageMipChainAsset::GetSubImageData(uint32_t subImageIndex) const + AZStd::span ImageMipChainAsset::GetSubImageData(uint32_t subImageIndex) const { AZ_Assert(subImageIndex < m_subImageDataOffsets.size() && subImageIndex < m_subImageDatas.size(), "subImageIndex is out of range"); // The offset vector contains an extra sentinel value. const size_t dataSize = m_subImageDataOffsets[subImageIndex + 1] - m_subImageDataOffsets[subImageIndex]; - return AZStd::array_view(reinterpret_cast(m_subImageDatas[subImageIndex].m_data), dataSize); + return AZStd::span(reinterpret_cast(m_subImageDatas[subImageIndex].m_data), dataSize); } const RHI::ImageSubresourceLayout& ImageMipChainAsset::GetSubImageLayout(uint32_t mipSlice) const @@ -111,7 +111,7 @@ namespace AZ for (uint16_t mipSliceIndex = 0; mipSliceIndex < m_mipLevels; ++mipSliceIndex) { RHI::StreamingImageMipSlice mipSlice; - mipSlice.m_subresources = AZStd::array_view(&m_subImageDatas[m_arraySize * mipSliceIndex], m_arraySize); + mipSlice.m_subresources = AZStd::span(&m_subImageDatas[m_arraySize * mipSliceIndex], m_arraySize); mipSlice.m_subresourceLayout = m_subImageLayouts[mipSliceIndex]; m_mipSlices.push_back(mipSlice); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 59f359e474..a67ed6f4bc 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -94,11 +94,11 @@ namespace AZ return m_totalImageDataSize; } - AZStd::array_view StreamingImageAsset::GetSubImageData(uint32_t mip, uint32_t slice) + AZStd::span StreamingImageAsset::GetSubImageData(uint32_t mip, uint32_t slice) { if (mip >= m_mipLevelToChainIndex.size()) { - return AZStd::array_view(); + return AZStd::span(); } size_t mipChainIndex = m_mipLevelToChainIndex[mip]; @@ -119,7 +119,7 @@ namespace AZ if (mipChainAsset == nullptr) { AZ_Warning("Streaming Image", false, "MipChain asset wasn't loaded"); - return AZStd::array_view(); + return AZStd::span(); } return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAsset.cpp index 48654d7769..bf765b1178 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAsset.cpp @@ -154,7 +154,7 @@ namespace AZ return m_materialPropertiesLayout.get(); } - AZStd::array_view MaterialTypeAsset::GetDefaultPropertyValues() const + AZStd::span MaterialTypeAsset::GetDefaultPropertyValues() const { return m_propertyValues; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp index 0574803591..6780763d7c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp @@ -82,9 +82,9 @@ namespace AZ return m_lodAssets.size(); } - AZStd::array_view> ModelAsset::GetLodAssets() const + AZStd::span> ModelAsset::GetLodAssets() const { - return AZStd::array_view>(m_lodAssets); + return AZStd::span>(m_lodAssets); } void ModelAsset::SetReady() @@ -213,7 +213,7 @@ namespace AZ } RHI::BufferViewDescriptor positionBufferViewDesc = positionBufferView->GetBufferViewDescriptor(); - AZStd::array_view positionRawBuffer = bufferAssetViewPtr->GetBuffer(); + AZStd::span positionRawBuffer = bufferAssetViewPtr->GetBuffer(); const uint32_t positionElementSize = positionBufferViewDesc.m_elementSize; const uint32_t positionElementCount = positionBufferViewDesc.m_elementCount; @@ -227,7 +227,7 @@ namespace AZ } RHI::BufferViewDescriptor indexBufferViewDesc = indexBufferView.GetBufferViewDescriptor(); - AZStd::array_view indexRawBuffer = indexAssetViewPtr->GetBuffer(); + AZStd::span indexRawBuffer = indexAssetViewPtr->GetBuffer(); const AZ::Vector3 rayEnd = rayStart + rayDir; AZ::Vector3 a, b, c; @@ -297,7 +297,7 @@ namespace AZ { for (const ModelLodAsset::Mesh& mesh : loadAssetPtr->GetMeshes()) { - const AZStd::array_view& streamBufferList = mesh.GetStreamBufferInfoList(); + const AZStd::span& streamBufferList = mesh.GetStreamBufferInfoList(); // find position semantic const ModelLodAsset::Mesh::StreamBufferInfo* positionBuffer = nullptr; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAssetCreator.cpp index 524ef9e910..f6fb9455d7 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAssetCreator.cpp @@ -101,7 +101,7 @@ namespace AZ creator.SetName(sourceAsset->GetName().GetStringView()); AZ::Data::AssetId lastUsedId = cloneAssetId; - const AZStd::array_view> sourceLodAssets = sourceAsset->GetLodAssets(); + const AZStd::span> sourceLodAssets = sourceAsset->GetLodAssets(); for (const Data::Asset& sourceLodAsset : sourceLodAssets) { Data::Asset lodAsset; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp index b84390a318..5681cf71c1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelKdTree.cpp @@ -61,7 +61,7 @@ namespace AZ { const auto& [first, second, third] = triangleIndices; - const AZStd::array_view& positionBuffer = m_meshes[nObjIndex].m_vertexData; + const AZStd::span& positionBuffer = m_meshes[nObjIndex].m_vertexData; if (positionBuffer.empty()) { @@ -114,7 +114,7 @@ namespace AZ for (AZ::u8 meshIndex = 0, meshCount = aznumeric_caster(m_meshes.size()); meshIndex < meshCount; ++meshIndex) { - const AZStd::array_view positionBuffer = m_meshes[meshIndex].m_vertexData; + const AZStd::span positionBuffer = m_meshes[meshIndex].m_vertexData; for (size_t positionIndex = 0; positionIndex < positionBuffer.size(); positionIndex += 3) { entireBoundBox.AddPoint({positionBuffer[positionIndex], positionBuffer[positionIndex + 1], positionBuffer[positionIndex + 2]}); @@ -137,14 +137,14 @@ namespace AZ return true; } - AZStd::array_view ModelKdTree::GetPositionsBuffer(const ModelLodAsset::Mesh& mesh) + AZStd::span ModelKdTree::GetPositionsBuffer(const ModelLodAsset::Mesh& mesh) { - AZStd::array_view positionBuffer = mesh.GetSemanticBufferTyped(AZ::Name{"POSITION"}); + AZStd::span positionBuffer = mesh.GetSemanticBufferTyped(AZ::Name{"POSITION"}); AZ_Warning("ModelKdTree", !positionBuffer.empty(), "Could not find position buffers in a mesh"); return positionBuffer; } - AZStd::array_view ModelKdTree::GetIndexBuffer(const ModelLodAsset::Mesh& mesh) + AZStd::span ModelKdTree::GetIndexBuffer(const ModelLodAsset::Mesh& mesh) { return mesh.GetIndexBufferTyped(); } @@ -264,7 +264,7 @@ namespace AZ const auto& [first, second, third] = pNode->GetVertexIndex(i); const AZ::u32 nObjIndex = pNode->GetObjIndex(i); - const AZStd::array_view positionBuffer = m_meshes[nObjIndex].m_vertexData; + const AZStd::span positionBuffer = m_meshes[nObjIndex].m_vertexData; if (positionBuffer.empty()) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAsset.cpp index ccf0d49b46..7dffaccf0a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAsset.cpp @@ -95,9 +95,9 @@ namespace AZ return m_indexBufferAssetView; } - AZStd::array_view ModelLodAsset::Mesh::GetStreamBufferInfoList() const + AZStd::span ModelLodAsset::Mesh::GetStreamBufferInfoList() const { - return AZStd::array_view(m_streamBufferInfo); + return AZStd::span(m_streamBufferInfo); } void ModelLodAsset::AddMesh(const Mesh& mesh) @@ -109,9 +109,9 @@ namespace AZ m_aabb.AddAabb(meshAabb); } - AZStd::array_view ModelLodAsset::GetMeshes() const + AZStd::span ModelLodAsset::GetMeshes() const { - return AZStd::array_view(m_meshes); + return AZStd::span(m_meshes); } const AZ::Aabb& ModelLodAsset::GetAabb() const @@ -121,7 +121,7 @@ namespace AZ const BufferAssetView* ModelLodAsset::Mesh::GetSemanticBufferAssetView(const AZ::Name& semantic) const { - const AZStd::array_view& streamBufferList = GetStreamBufferInfoList(); + const AZStd::span& streamBufferList = GetStreamBufferInfoList(); for (const ModelLodAsset::Mesh::StreamBufferInfo& streamBufferInfo : streamBufferList) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAssetCreator.cpp index f94116db70..94d20ed6ea 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelLodAssetCreator.cpp @@ -243,7 +243,7 @@ namespace AZ bool ModelLodAssetCreator::Clone(const Data::Asset& sourceAsset, Data::Asset& clonedResult, Data::AssetId& inOutLastCreatedAssetId) { - AZStd::array_view sourceMeshes = sourceAsset->GetMeshes(); + AZStd::span sourceMeshes = sourceAsset->GetMeshes(); if (sourceMeshes.empty()) { return true; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp index 6daca5553e..ca1188a70e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp @@ -383,7 +383,7 @@ namespace AZ return RHI::NullSrgLayout; } - AZStd::array_view> ShaderAsset::GetShaderResourceGroupLayouts( + AZStd::span> ShaderAsset::GetShaderResourceGroupLayouts( SupervariantIndex supervariantIndex) const { auto supervariant = GetSupervariant(supervariantIndex); diff --git a/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h b/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h index b8d1cfa050..400eb9521c 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h +++ b/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h @@ -132,7 +132,7 @@ namespace UnitTest { return m_data; } - + private: bool m_isMapped = false; AZStd::vector m_data; @@ -146,7 +146,7 @@ namespace UnitTest private: AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, const AZ::RHI::BufferPoolDescriptor&) override { return AZ::RHI::ResultCode::Success;} - + AZ::RHI::ResultCode InitBufferInternal(AZ::RHI::Buffer& bufferBase, const AZ::RHI::BufferDescriptor& descriptor) override { AZ_Assert(IsInitialized(), "Buffer Pool is not initialized"); @@ -264,7 +264,7 @@ namespace UnitTest private: AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, const AZ::RHI::PipelineLibraryData*) override { return AZ::RHI::ResultCode::Success; } void ShutdownInternal() override {} - AZ::RHI::ResultCode MergeIntoInternal(AZStd::array_view) override { return AZ::RHI::ResultCode::Success; } + AZ::RHI::ResultCode MergeIntoInternal(AZStd::span) override { return AZ::RHI::ResultCode::Success; } AZ::RHI::ConstPtr GetSerializedDataInternal() const override { return nullptr; } }; @@ -372,11 +372,11 @@ namespace UnitTest AZ::RHI::ResultCode InitInternal([[maybe_unused]] AZ::RHI::Device& device, [[maybe_unused]] const AZ::RHI::QueryPoolDescriptor& descriptor) override { return AZ::RHI::ResultCode::Success; } AZ::RHI::ResultCode InitQueryInternal([[maybe_unused]] AZ::RHI::Query& query) override { return AZ::RHI::ResultCode::Success; } AZ::RHI::ResultCode GetResultsInternal( - [[maybe_unused]] uint32_t startIndex, - [[maybe_unused]] uint32_t queryCount, - [[maybe_unused]] uint64_t* results, - [[maybe_unused]] uint32_t resultsCount, - [[maybe_unused]] AZ::RHI::QueryResultFlagBits flags) override + [[maybe_unused]] uint32_t startIndex, + [[maybe_unused]] uint32_t queryCount, + [[maybe_unused]] uint64_t* results, + [[maybe_unused]] uint32_t resultsCount, + [[maybe_unused]] AZ::RHI::QueryResultFlagBits flags) override { return AZ::RHI::ResultCode::Success; } }; diff --git a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp index f7476c0bc4..cb8d903673 100644 --- a/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Image/StreamingImageTests.cpp @@ -214,7 +214,7 @@ namespace UnitTest return image; } - void ValidateImageData(AZStd::array_view data, const AZ::RHI::ImageSubresourceLayout& layout) + void ValidateImageData(AZStd::span data, const AZ::RHI::ImageSubresourceLayout& layout) { const uint32_t pixelSize = layout.m_size.m_width / layout.m_bytesPerRow; @@ -259,7 +259,7 @@ namespace UnitTest for (uint16_t arrayIndex = 0; arrayIndex < mipChain->GetArraySize(); ++arrayIndex) { - AZStd::array_view imageData = mipChain->GetSubImageData(mipLevel, arrayIndex); + AZStd::span imageData = mipChain->GetSubImageData(mipLevel, arrayIndex); ValidateImageData(imageData, layout); } } @@ -573,7 +573,7 @@ namespace UnitTest EXPECT_EQ(mipChain->GetArraySize(), arraySize); EXPECT_EQ(mipChain->GetSubImageCount(), mipLevels * arraySize); - AZStd::array_view dataView = mipChain->GetSubImageData(0); + AZStd::span dataView = mipChain->GetSubImageData(0); EXPECT_EQ(dataView[0], data[0]); EXPECT_EQ(dataView[1], data[1]); EXPECT_EQ(dataView[2], data[2]); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index 94518c6aef..133592e72c 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -646,7 +646,7 @@ namespace UnitTest MaterialPropertyIndex myFloat2 = layout->FindPropertyIndex(Name("general.MyFloat2")); MaterialPropertyIndex myColor = layout->FindPropertyIndex(Name("general.MyColor")); - AZStd::array_view properties; + AZStd::span properties; // Check level 1 properties properties = materialAssetLevel1.GetValue()->GetPropertyValues(); @@ -736,7 +736,7 @@ namespace UnitTest // The properties will finalize automatically when we call GetPropertyValues()... - AZStd::array_view properties; + AZStd::span properties; // Check level 1 properties properties = materialAssetLevel1->GetPropertyValues(); diff --git a/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp b/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp index 38b3fa9eb2..74f79ad80a 100644 --- a/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp @@ -538,7 +538,11 @@ namespace UnitTest auto shaderAsset = shader->GetAsset(); EXPECT_EQ(shader->GetPipelineStateType(), shaderAsset->GetPipelineStateType()); - EXPECT_EQ(shader->GetShaderResourceGroupLayouts(), shaderAsset->GetShaderResourceGroupLayouts()); + using ShaderResourceGroupLayoutSpan = AZStd::span>; + ShaderResourceGroupLayoutSpan shaderResourceGroupLayoutSpan = shader->GetShaderResourceGroupLayouts(); + ShaderResourceGroupLayoutSpan shaderAssetResourceGroupLayoutSpan = shader->GetShaderResourceGroupLayouts(); + EXPECT_EQ(shaderResourceGroupLayoutSpan.data(), shaderAssetResourceGroupLayoutSpan.data()); + EXPECT_EQ(shaderResourceGroupLayoutSpan.size(), shaderAssetResourceGroupLayoutSpan.size()); const RPI::ShaderVariant& rootShaderVariant = shader->GetVariant( RPI::ShaderVariantStableId{0} ); diff --git a/Gems/Atom/RPI/Code/Tests/ShaderResourceGroup/ShaderResourceGroupConstantBufferTests.cpp b/Gems/Atom/RPI/Code/Tests/ShaderResourceGroup/ShaderResourceGroupConstantBufferTests.cpp index 0c3c82933b..f69cfe180a 100644 --- a/Gems/Atom/RPI/Code/Tests/ShaderResourceGroup/ShaderResourceGroupConstantBufferTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/ShaderResourceGroup/ShaderResourceGroupConstantBufferTests.cpp @@ -57,7 +57,7 @@ namespace UnitTest } template - void ExpectEqual(AZStd::initializer_list expectedValues, AZStd::array_view arrayView) + void ExpectEqual(AZStd::initializer_list expectedValues, AZStd::span arrayView) { EXPECT_EQ(expectedValues.size(), arrayView.size()); @@ -215,14 +215,14 @@ namespace UnitTest EXPECT_TRUE(m_srg->SetConstant(inputIndex, true)); EXPECT_EQ(true, m_srg->GetConstant(inputIndex)); - AZStd::array_view result = m_srg->GetConstantRaw(inputIndex); - AZStd::array_view resultInUint = AZStd::array_view(reinterpret_cast(result.data()), 1); + AZStd::span result = m_srg->GetConstantRaw(inputIndex); + AZStd::span resultInUint = AZStd::span(reinterpret_cast(result.data()), 1); ExpectEqual({ 1 /*true*/ }, resultInUint); EXPECT_TRUE(m_srg->SetConstant(inputIndex, false)); EXPECT_EQ(false, m_srg->GetConstant(inputIndex)); result = m_srg->GetConstantRaw(inputIndex); - resultInUint = AZStd::array_view(reinterpret_cast(result.data()), 1); + resultInUint = AZStd::span(reinterpret_cast(result.data()), 1); ExpectEqual({ 0 /*false*/ }, resultInUint); } @@ -232,13 +232,13 @@ namespace UnitTest // Check using inputIndex EXPECT_TRUE(m_srg->SetConstantArray(inputIndex, AZStd::array({ true, false }))); - AZStd::array_view result = m_srg->GetConstantRaw(inputIndex); - AZStd::array_view resultInUint = AZStd::array_view(reinterpret_cast(result.data()), 2); + AZStd::span result = m_srg->GetConstantRaw(inputIndex); + AZStd::span resultInUint = AZStd::span(reinterpret_cast(result.data()), 2); ExpectEqual({ 1 /*true*/, 0 /*false*/ }, resultInUint); EXPECT_TRUE(m_srg->SetConstantArray(inputIndex, AZStd::array({ false, true }))); result = m_srg->GetConstantRaw(inputIndex); - resultInUint = AZStd::array_view(reinterpret_cast(result.data()), 2); + resultInUint = AZStd::span(reinterpret_cast(result.data()), 2); ExpectEqual({ 0 /*false*/, 1 /*true*/ }, resultInUint); } } @@ -263,8 +263,8 @@ namespace UnitTest const RHI::ShaderInputConstantIndex inputIndex(1); EXPECT_TRUE(m_srg->SetConstantArray(inputIndex, AZStd::array({ asBools[1], asBools[2] }))); - AZStd::array_view result = m_srg->GetConstantRaw(inputIndex); - AZStd::array_view resultInUint = AZStd::array_view(reinterpret_cast(result.data()), 2); + AZStd::span result = m_srg->GetConstantRaw(inputIndex); + AZStd::span resultInUint = AZStd::span(reinterpret_cast(result.data()), 2); EXPECT_THAT(resultInUint, testing::ElementsAre(testing::IsTrue(), testing::IsFalse())); } } @@ -356,7 +356,7 @@ namespace UnitTest { using namespace AZ; - AZStd::array_view values; + AZStd::span values; const RHI::ShaderInputConstantIndex inputIndex(17); // Demonstrate the syntax of setting with a variable, and inputIndex... diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 2a0d91d0ad..6ec809e871 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -734,7 +734,7 @@ namespace MaterialEditor return false; } - AZStd::array_view parentPropertyValues = materialTypeAsset->GetDefaultPropertyValues(); + AZStd::span parentPropertyValues = materialTypeAsset->GetDefaultPropertyValues(); AZ::Data::Asset parentMaterialAsset; if (!m_materialSourceData.m_parentMaterial.empty()) { diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h index cbd4a3c30a..4126e9eb4a 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include #include #include @@ -31,8 +31,8 @@ namespace AZ //! @param filteredDiff [out] an alternate RMS value calculated after removing any diffs less than @minDiffFilter. //! @param minDiffFilter diff values less than this will be filtered out before calculating @filteredDiff. ImageDiffResultCode CalcImageDiffRms( - AZStd::array_view bufferA, const RHI::Size& sizeA, RHI::Format formatA, - AZStd::array_view bufferB, const RHI::Size& sizeB, RHI::Format formatB, + AZStd::span bufferA, const RHI::Size& sizeA, RHI::Format formatA, + AZStd::span bufferB, const RHI::Size& sizeB, RHI::Format formatB, float* diffScore = nullptr, float* filteredDiffScore = nullptr, float minDiffFilter = 0.0); diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h index b862786c2f..01e9134b4d 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include @@ -55,7 +55,7 @@ namespace AZ static PngFile Load(const char* path, LoadSettings loadSettings = {}); //! @return the loaded PngFile or an invalid PngFile if there was an error. - static PngFile LoadFromBuffer(AZStd::array_view data, LoadSettings loadSettings = {}); + static PngFile LoadFromBuffer(AZStd::span data, LoadSettings loadSettings = {}); //! Create a PngFile from an RHI data buffer. //! @param size the dimensions of the image (m_depth is not used, assumed to be 1) @@ -63,7 +63,7 @@ namespace AZ //! @param data the buffer of image data. The size of the buffer must match the @size and @format parameters. //! @param errorHandler optional callback function describing any errors that are encountered //! @return the created PngFile or an invalid PngFile if there was an error. - static PngFile Create(const RHI::Size& size, RHI::Format format, AZStd::array_view data, ErrorHandler errorHandler = {}); + static PngFile Create(const RHI::Size& size, RHI::Format format, AZStd::span data, ErrorHandler errorHandler = {}); static PngFile Create(const RHI::Size& size, RHI::Format format, AZStd::vector&& data, ErrorHandler errorHandler = {}); PngFile() = default; diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/PpmFile.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/PpmFile.h index 77b0049df8..e50b83dc4b 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/PpmFile.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/PpmFile.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include @@ -26,7 +26,7 @@ namespace AZ //! @param size image dimensions //! @param format only R8G8B8A8_UNORM and B8G8R8A8_UNORM are supported at this time //! @return the buffer is ppm binary with RGB payload (alpha is omitted as it is not supported by .ppm format) - static AZStd::vector CreatePpmFromImageBuffer(AZStd::array_view buffer, const RHI::Size& size, RHI::Format format); + static AZStd::vector CreatePpmFromImageBuffer(AZStd::span buffer, const RHI::Size& size, RHI::Format format); //! Fills an image buffer with data from ppm file contents. //! @param ppmData the data loaded from a ppm file @@ -34,7 +34,7 @@ namespace AZ //! @param size output image dimensions //! @param format output image format //! @return true if the data was parsed successfully - static bool CreateImageBufferFromPpm(AZStd::array_view ppmData, AZStd::vector& buffer, RHI::Size& size, RHI::Format& format); + static bool CreateImageBufferFromPpm(AZStd::span ppmData, AZStd::vector& buffer, RHI::Size& size, RHI::Format& format); }; } } // namespace AZ diff --git a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp index a17d07ed3f..0bad268ba5 100644 --- a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp +++ b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp @@ -8,13 +8,15 @@ #include +#include + namespace AZ { namespace Utils { ImageDiffResultCode CalcImageDiffRms( - AZStd::array_view bufferA, const RHI::Size& sizeA, RHI::Format formatA, - AZStd::array_view bufferB, const RHI::Size& sizeB, RHI::Format formatB, + AZStd::span bufferA, const RHI::Size& sizeA, RHI::Format formatA, + AZStd::span bufferB, const RHI::Size& sizeB, RHI::Format formatB, float* diffScore, float* filteredDiffScore, float minDiffFilter) diff --git a/Gems/Atom/Utils/Code/Source/PngFile.cpp b/Gems/Atom/Utils/Code/Source/PngFile.cpp index 1454dc68c9..7c1673221e 100644 --- a/Gems/Atom/Utils/Code/Source/PngFile.cpp +++ b/Gems/Atom/Utils/Code/Source/PngFile.cpp @@ -28,7 +28,7 @@ namespace AZ } } - PngFile PngFile::Create(const RHI::Size& size, RHI::Format format, AZStd::array_view data, ErrorHandler errorHandler) + PngFile PngFile::Create(const RHI::Size& size, RHI::Format format, AZStd::span data, ErrorHandler errorHandler) { return Create(size, format, AZStd::vector{data.begin(), data.end()}, errorHandler); } @@ -89,7 +89,7 @@ namespace AZ return pngFile; } - PngFile PngFile::LoadFromBuffer(AZStd::array_view data, LoadSettings loadSettings) + PngFile PngFile::LoadFromBuffer(AZStd::span data, LoadSettings loadSettings) { if (!loadSettings.m_errorHandler) { diff --git a/Gems/Atom/Utils/Code/Source/PpmFile.cpp b/Gems/Atom/Utils/Code/Source/PpmFile.cpp index 8fe40339f3..4e586f5df1 100644 --- a/Gems/Atom/Utils/Code/Source/PpmFile.cpp +++ b/Gems/Atom/Utils/Code/Source/PpmFile.cpp @@ -11,7 +11,7 @@ namespace AZ { - AZStd::vector Utils::PpmFile::CreatePpmFromImageBuffer(AZStd::array_view buffer, const RHI::Size& size, RHI::Format format) + AZStd::vector Utils::PpmFile::CreatePpmFromImageBuffer(AZStd::span buffer, const RHI::Size& size, RHI::Format format) { AZ_Assert(format == RHI::Format::R8G8B8A8_UNORM || format == RHI::Format::B8G8R8A8_UNORM, "CreatePpmFromImageReadbackResult only supports R8G8B8A8_UNORM"); @@ -46,7 +46,7 @@ namespace AZ return outBuffer; } - bool Utils::PpmFile::CreateImageBufferFromPpm(AZStd::array_view ppmData, AZStd::vector& buffer, RHI::Size& size, RHI::Format& format) + bool Utils::PpmFile::CreateImageBufferFromPpm(AZStd::span ppmData, AZStd::vector& buffer, RHI::Size& size, RHI::Format& format) { if (ppmData.size() < 2) { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index e26d328e17..9718d6b598 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -356,10 +356,10 @@ namespace AZ bool MeshComponentController::RequiresCloning(const Data::Asset& modelAsset) { // Is the model asset containing a cloth buffer? If yes, we need to clone the model asset for instancing. - const AZStd::array_view> lodAssets = modelAsset->GetLodAssets(); + const AZStd::span> lodAssets = modelAsset->GetLodAssets(); for (const AZ::Data::Asset& lodAsset : lodAssets) { - const AZStd::array_view meshes = lodAsset->GetMeshes(); + const AZStd::span meshes = lodAsset->GetMeshes(); for (const AZ::RPI::ModelLodAsset::Mesh& mesh : meshes) { if (mesh.GetSemanticBufferAssetView(AZ::Name("CLOTH_DATA")) != nullptr) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp index 18b09b6eb1..996405ed4a 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp @@ -59,7 +59,7 @@ namespace AZ lodVertexCount = 0; const Data::Asset& lodAsset = actor->GetMeshAsset()->GetLodAssets()[lodIndex]; - const AZStd::array_view modelMeshes = lodAsset->GetMeshes(); + const AZStd::span modelMeshes = lodAsset->GetMeshes(); for (const RPI::ModelLodAsset::Mesh& modelMesh : modelMeshes) { const size_t subMeshIndexCount = modelMesh.GetIndexCount(); diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index d2b675684f..35aea57702 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -810,7 +810,7 @@ namespace AZ::Render if (m_wrinkleMasks.size()) { - wrinkleMaskObjectSrg->SetImageArray(wrinkleMasksIndex, AZStd::array_view>(m_wrinkleMasks.data(), m_wrinkleMasks.size())); + wrinkleMaskObjectSrg->SetImageArray(wrinkleMasksIndex, AZStd::span>(m_wrinkleMasks.data(), m_wrinkleMasks.size())); // Set the weights for any active masks for (size_t i = 0; i < m_wrinkleMaskWeights.size(); ++i) diff --git a/Gems/AtomTressFX/Code/Passes/HairParentPass.h b/Gems/AtomTressFX/Code/Passes/HairParentPass.h index e494e92e1d..05574bfd52 100644 --- a/Gems/AtomTressFX/Code/Passes/HairParentPass.h +++ b/Gems/AtomTressFX/Code/Passes/HairParentPass.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include namespace AZ diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp index 0c05da6981..39ff278c46 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp @@ -2551,7 +2551,7 @@ namespace EMotionFX Node* Actor::FindMeshJoint(const AZ::Data::Asset& lodModelAsset) const { - const AZStd::array_view& sourceMeshes = lodModelAsset->GetMeshes(); + const AZStd::span& sourceMeshes = lodModelAsset->GetMeshes(); // Use the first joint that we can find for any of the Atom sub meshes and use it as owner of our mesh. for (const AZ::RPI::ModelLodAsset::Mesh& sourceMesh : sourceMeshes) @@ -2574,7 +2574,7 @@ namespace EMotionFX AZ_Assert(m_meshAsset.IsReady(), "Mesh asset should be fully loaded and ready."); AZStd::vector& lodLevels = m_meshLodData.m_lodLevels; - const AZStd::array_view>& lodAssets = m_meshAsset->GetLodAssets(); + const AZStd::span>& lodAssets = m_meshAsset->GetLodAssets(); const size_t numLODLevels = lodAssets.size(); lodLevels.clear(); @@ -2700,7 +2700,7 @@ namespace EMotionFX AZ_Assert(m_meshAsset.IsReady() && m_morphTargetMetaAsset.IsReady(), "Mesh as well as morph target meta asset asset should be fully loaded and ready."); AZStd::vector& lodLevels = m_meshLodData.m_lodLevels; - const AZStd::array_view>& lodAssets = m_meshAsset->GetLodAssets(); + const AZStd::span>& lodAssets = m_meshAsset->GetLodAssets(); const size_t numLODLevels = lodAssets.size(); AZ_Assert(m_morphSetups.size() == numLODLevels, "There needs to be a morph setup for every single LOD level."); @@ -2708,7 +2708,7 @@ namespace EMotionFX for (size_t lodLevel = 0; lodLevel < numLODLevels; ++lodLevel) { const AZ::Data::Asset& lodAsset = lodAssets[lodLevel]; - const AZStd::array_view& sourceMeshes = lodAsset->GetMeshes(); + const AZStd::span& sourceMeshes = lodAsset->GetMeshes(); MorphSetup* morphSetup = m_morphSetups[static_cast(lodLevel)]; if (!morphSetup) @@ -2744,7 +2744,7 @@ namespace EMotionFX // The lod has shared buffers that combine the data from each submesh. In case any of the submeshes has a // morph target buffer view we can access the entire morph target buffer via the buffer asset. - AZStd::array_view morphTargetDeltaView; + AZStd::span morphTargetDeltaView; for (const AZ::RPI::ModelLodAsset::Mesh& sourceMesh : sourceMeshes) { if (const auto* bufferAssetView = sourceMesh.GetSemanticBufferAssetView(AZ::Name("MORPHTARGET_VERTEXDELTAS"))) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp index 9908cb0f58..6adbf05c15 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp @@ -187,7 +187,7 @@ namespace EMotionFX const AZ::RPI::ModelLodAsset::Mesh& sourceMesh = sourceModelLod->GetMeshes()[0]; // Copy the index buffer for the entire lod - AZStd::array_view indexBuffer = sourceMesh.GetIndexBufferAssetView().GetBufferAsset()->GetBuffer(); + AZStd::span indexBuffer = sourceMesh.GetIndexBufferAssetView().GetBufferAsset()->GetBuffer(); const AZ::RHI::BufferViewDescriptor& indexBufferViewDescriptor = sourceMesh.GetIndexBufferAssetView().GetBufferAsset()->GetBufferViewDescriptor(); AZ_ErrorOnce("EMotionFX", indexBufferViewDescriptor.m_elementSize == 4, "Index buffer must stored as 4 bytes."); const size_t indexBufferCountsInBytes = indexBufferViewDescriptor.m_elementCount * indexBufferViewDescriptor.m_elementSize; diff --git a/Gems/LyShine/Code/Source/LyShinePass.h b/Gems/LyShine/Code/Source/LyShinePass.h index 6275353641..c93f6db0a6 100644 --- a/Gems/LyShine/Code/Source/LyShinePass.h +++ b/Gems/LyShine/Code/Source/LyShinePass.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include "LyShinePassDataBus.h" diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp index 595877c88b..81095eb800 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp @@ -94,7 +94,7 @@ namespace AZ::Render return false; } - AZStd::array_view imageViews(m_bindlessImageViews.data(), m_bindlessImageViews.size()); + AZStd::span imageViews(m_bindlessImageViews.data(), m_bindlessImageViews.size()); return srg->SetImageViewUnboundedArray(m_texturesIndex, imageViews); } From 50982b82831a8dbf3b3cb9849ee9e09f334f495d Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:04:12 -0800 Subject: [PATCH 297/394] Exposing / Unifying the rasterstate depth bias values for all the shadowmap shaders (#7150) Signed-off-by: mrieggeramzn --- .../Types/EnhancedPBR_Shadowmap_WithPS.shader | 8 ++++++++ .../StandardMultilayerPBR_Shadowmap_WithPS.shader | 8 ++++++++ .../Types/StandardPBR_Shadowmap_WithPS.shader | 10 +++++++++- .../Common/Assets/Shaders/Shadow/Shadowmap.shader | 2 ++ .../Common/Assets/Shaders/Shadow/ShadowmapSkin.shader | 2 ++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.shader index 09d793e822..a2568e85ac 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.shader @@ -7,6 +7,14 @@ "DrawList" : "shadow", + // Note that lights now expose their own bias controls. + // It may be worth increasing their default values in the future and reducing the depthBias values encoded here. + "RasterState" : + { + "depthBias" : "10", + "depthBiasSlopeScale" : "4" + }, + "ProgramSettings": { "EntryPoints": diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.shader index eb0d6dc40c..59c0b72d28 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.shader @@ -7,6 +7,14 @@ "DrawList" : "shadow", + // Note that lights now expose their own bias controls. + // It may be worth increasing their default values in the future and reducing the depthBias values encoded here. + "RasterState" : + { + "depthBias" : "10", + "depthBiasSlopeScale" : "4" + }, + "ProgramSettings": { "EntryPoints": diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.shader index b9074dae4b..c73af2c1ed 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.shader @@ -6,7 +6,15 @@ }, "DrawList" : "shadow", - + + // Note that lights now expose their own bias controls. + // It may be worth increasing their default values in the future and reducing the depthBias values encoded here. + "RasterState" : + { + "depthBias" : "10", + "depthBiasSlopeScale" : "4" + }, + "ProgramSettings": { "EntryPoints": diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/Shadowmap.shader b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/Shadowmap.shader index d56f40ccdb..5fc7917b40 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/Shadowmap.shader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/Shadowmap.shader @@ -7,6 +7,8 @@ "DrawList" : "shadow", + // Note that lights now expose their own bias controls. + // It may be worth increasing their default values in the future and reducing the depthBias values encoded here. "RasterState" : { "depthBias" : "10", diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/ShadowmapSkin.shader b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/ShadowmapSkin.shader index 40379d9193..c5c11d0b2b 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/ShadowmapSkin.shader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/Shadow/ShadowmapSkin.shader @@ -7,6 +7,8 @@ "DrawList" : "shadow", + // Note that lights now expose their own bias controls. + // It may be worth increasing their default values in the future and reducing the depthBias values encoded here. "RasterState" : { "depthBias" : "10", From 498e5b738f935569b5b770bfbcefd9c75b9b32b8 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:40:53 -0800 Subject: [PATCH 298/394] Removed SetAutoLoadBehavior from InMemorySpawnableAssetContainer. These calls didn't have any practical effect and created confusion, so they were removed. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index a927f60789..f0fbd1a299 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -259,9 +259,6 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { // Only assets that are preloaded need to be waited on. blockingAssets.push_back(asset); - // Queue any pending request in parallel. Assets that were set to PreLoad will be waited for resulting - // in the same overall load guarantees. - asset->SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::QueueLoad); } if (!asset->QueueLoad()) { @@ -297,10 +294,6 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils continue; } - - // Reset the load behavior back to preload because the async load will have caused the behavior to be set to queued. Some assets - // will complain if they're not set to the correct loading behavior. - asset->SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); } } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils From 68e4970a2d5e71b4ce038aeeefb481f5257051da Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:47:10 -0800 Subject: [PATCH 299/394] Reverted the new Tokenize function I added, and used TokenizeVisitor instead. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../AzCore/AzCore/StringFunc/StringFunc.cpp | 24 ++++---------- .../AzCore/AzCore/StringFunc/StringFunc.h | 12 +++---- Code/Framework/AzCore/Tests/StringFunc.cpp | 33 ++++--------------- .../Material/MaterialTypeSourceData.cpp | 8 ++++- 4 files changed, 24 insertions(+), 53 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp index 61a9096d5e..e4d132afef 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp @@ -758,17 +758,12 @@ namespace AZ::StringFunc return value; } - template - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return Tokenize(in, tokens, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); } - - template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); - template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings); - - template - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) + + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) { auto insertVisitor = [&tokens](AZStd::string_view token) { @@ -776,10 +771,7 @@ namespace AZ::StringFunc }; return TokenizeVisitor(in, insertVisitor, delimiters, keepEmptyStrings, keepSpaceStrings); } - - template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); - template void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings); - + void TokenizeVisitor(AZStd::string_view in, const TokenVisitor& tokenVisitor, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return TokenizeVisitor(in, tokenVisitor, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); @@ -927,8 +919,7 @@ namespace AZ::StringFunc return found; } - template - void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) + void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) { if (input.empty()) { @@ -948,7 +939,7 @@ namespace AZ::StringFunc } // Take the substring, not including the separator, and increment our offset - AZStd::string_view nextSubstring = input.substr(offset, nextOffset - offset); + AZStd::string nextSubstring = input.substr(offset, nextOffset - offset); if (keepEmptyStrings || keepSpaceStrings || !nextSubstring.empty()) { tokens.push_back(nextSubstring); @@ -958,9 +949,6 @@ namespace AZ::StringFunc } } - template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); - template void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/); - int ToInt(const char* in) { if (!in) diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h index db26b364aa..55236a0fff 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h @@ -258,21 +258,17 @@ namespace AZ bool Strip(AZStd::string& inout, const char* stripCharacters = " ", bool bCaseSensitive = false, bool bStripBeginning = false, bool bStripEnding = false); //! Tokenize - /*! Tokenize a c-string, into a vector of strings optionally keeping empty string + /*! Tokenize a c-string, into a vector of AZStd::string(s) optionally keeping empty string *! and optionally keeping space only strings - *! (The string type may be AZStd::string or AZStd::string_view. New code should use AZStd::string_view for better performance. AZStd::string version is preserved for compatibility.) Example: Tokenize the words of a sentence. StringFunc::Tokenize("Hello World", d, ' '); s[0] == "Hello", s[1] == "World" Example: Tokenize a comma and end line delimited string StringFunc::Tokenize("Hello,World\nHello,World", d, ' '); s[0] == "Hello", s[1] == "World" s[2] == "Hello", s[3] == "World" */ - template - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); - template - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); - template - void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings = false, bool keepSpaceStrings = false); + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters = "\\//, \t\n", bool keepEmptyStrings = false, bool keepSpaceStrings = false); + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings = false, bool keepSpaceStrings = false); //! TokenizeVisitor /*! Tokenize a string_view and invoke a handler for each token found. diff --git a/Code/Framework/AzCore/Tests/StringFunc.cpp b/Code/Framework/AzCore/Tests/StringFunc.cpp index fd6fe7839d..760cadb2c6 100644 --- a/Code/Framework/AzCore/Tests/StringFunc.cpp +++ b/Code/Framework/AzCore/Tests/StringFunc.cpp @@ -199,15 +199,15 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SingleDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 0); - } + } TEST_F(StringFuncTest, Tokenize_SingleDelimeter) { AZStd::string input = "a b,c"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 2); @@ -218,7 +218,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeter_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, " ,"); ASSERT_EQ(tokens.size(), 0); } @@ -226,7 +226,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_MultiDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); ASSERT_EQ(tokens.size(), 5); @@ -240,7 +240,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters_Empty) { AZStd::string input = ""; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = {" -", " +"}; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); ASSERT_EQ(tokens.size(), 0); @@ -249,7 +249,7 @@ namespace AZ TEST_F(StringFuncTest, Tokenize_SubstringDelimeters) { AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; + AZStd::vector tokens; AZStd::vector delimeters = { " -", " +" }; AZ::StringFunc::Tokenize(input.c_str(), tokens, delimeters); @@ -260,25 +260,6 @@ namespace AZ ASSERT_TRUE(tokens[3] == "d-e"); // Test for something like a guid, which contain typical separator characters } - TEST_F(StringFuncTest, Tokenize_MultiDelimeters_String) - { - // Test with AZStd::string for backward compatibility. The functions - // use to only work with AZStd::string, and now they are templatized - // to support both AZStd::string and AZStd::string_view (the latter - // being perferred for performance). - - AZStd::string input = " -a +b +c -d-e"; - AZStd::vector tokens; - AZ::StringFunc::Tokenize(input.c_str(), tokens, "-+"); - - ASSERT_EQ(tokens.size(), 5); - ASSERT_TRUE(tokens[0] == "a "); - ASSERT_TRUE(tokens[1] == "b "); - ASSERT_TRUE(tokens[2] == "c "); - ASSERT_TRUE(tokens[3] == "d"); - ASSERT_TRUE(tokens[4] == "e"); - } - TEST_F(StringFuncTest, TokenizeVisitor_EmptyString_DoesNotInvokeVisitor) { int visitedCount{}; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 2504981273..bf24b98ac8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -327,7 +327,13 @@ namespace AZ AZStd::vector MaterialTypeSourceData::TokenizeId(AZStd::string_view id) { AZStd::vector tokens; - AzFramework::StringFunc::Tokenize(id, tokens, "./", true, true); + + AzFramework::StringFunc::TokenizeVisitor(id, [&tokens](AZStd::string_view t) + { + tokens.push_back(t); + }, + "./", true, true); + return tokens; } From ed21e97dcd07f8543e707e0c028e3f1d26542bdd Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:55:45 -0800 Subject: [PATCH 300/394] Fixed StringFunc whitespace differences. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp | 10 +++++----- Code/Framework/AzCore/Tests/StringFunc.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp index e4d132afef..8405424f7d 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.cpp @@ -757,12 +757,12 @@ namespace AZ::StringFunc } return value; } - + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return Tokenize(in, tokens, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); } - + void Tokenize(AZStd::string_view in, AZStd::vector& tokens, AZStd::string_view delimiters, bool keepEmptyStrings, bool keepSpaceStrings) { auto insertVisitor = [&tokens](AZStd::string_view token) @@ -771,7 +771,7 @@ namespace AZ::StringFunc }; return TokenizeVisitor(in, insertVisitor, delimiters, keepEmptyStrings, keepSpaceStrings); } - + void TokenizeVisitor(AZStd::string_view in, const TokenVisitor& tokenVisitor, const char delimiter, bool keepEmptyStrings, bool keepSpaceStrings) { return TokenizeVisitor(in, tokenVisitor, { &delimiter, 1 }, keepEmptyStrings, keepSpaceStrings); @@ -918,7 +918,7 @@ namespace AZ::StringFunc return found; } - + void Tokenize(AZStd::string_view input, AZStd::vector& tokens, const AZStd::vector& delimiters, bool keepEmptyStrings /*= false*/, bool keepSpaceStrings /*= false*/) { if (input.empty()) @@ -948,7 +948,7 @@ namespace AZ::StringFunc offset = nextOffset + delimiters[nextMatch].size(); } } - + int ToInt(const char* in) { if (!in) diff --git a/Code/Framework/AzCore/Tests/StringFunc.cpp b/Code/Framework/AzCore/Tests/StringFunc.cpp index 760cadb2c6..dc4bc40e5b 100644 --- a/Code/Framework/AzCore/Tests/StringFunc.cpp +++ b/Code/Framework/AzCore/Tests/StringFunc.cpp @@ -202,7 +202,7 @@ namespace AZ AZStd::vector tokens; AZ::StringFunc::Tokenize(input.c_str(), tokens, ' '); ASSERT_EQ(tokens.size(), 0); - } + } TEST_F(StringFuncTest, Tokenize_SingleDelimeter) { @@ -259,7 +259,7 @@ namespace AZ ASSERT_TRUE(tokens[2] == "c"); ASSERT_TRUE(tokens[3] == "d-e"); // Test for something like a guid, which contain typical separator characters } - + TEST_F(StringFuncTest, TokenizeVisitor_EmptyString_DoesNotInvokeVisitor) { int visitedCount{}; From f368997deb955101e5ffef66d988959fe6b10ba9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 26 Jan 2022 19:06:57 -0600 Subject: [PATCH 301/394] Modified the passing of span in test Signed-off-by: Chris Galvan --- Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp index ecca215536..2dd2885dff 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp @@ -207,12 +207,11 @@ namespace AZ template T GetSubImagePixelValueInternal(const AZ::Data::Asset& imageAsset, uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::array values = { aznumeric_cast(0) }; + AZStd::array values{ aznumeric_cast(0) }; auto topLeft = AZStd::make_pair(x, y); auto bottomRight = AZStd::make_pair(x + 1, y + 1); - AZStd::span valueSpan(values.begin(), values.size()); - GetSubImagePixelValues(imageAsset, topLeft, bottomRight, valueSpan, componentIndex, mip, slice); + GetSubImagePixelValues(imageAsset, topLeft, bottomRight, AZStd::span(values), componentIndex, mip, slice); return values[0]; } From 5ebe3d12dfce0f5203993abe21cb13f7b4857696 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Wed, 26 Jan 2022 17:11:58 -0800 Subject: [PATCH 302/394] Add file exists conditional for ebs_snapshot stash command (#7178) Signed-off-by: Mike Chang --- scripts/build/Jenkins/Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index e4957992a5..b21d9d832d 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -845,8 +845,10 @@ try { // Stash the INCREMENTAL_BUILD_SCRIPT_PATH and EBS_SNAPSHOT_SCRIPT_PATH since all nodes will use it stash name: 'incremental_build_script', includes: INCREMENTAL_BUILD_SCRIPT_PATH - stash name: 'ebs_snapshot_script', + if (fileExists(EBS_SNAPSHOT_SCRIPT_PATH)) { + stash name: 'ebs_snapshot_script', includes: EBS_SNAPSHOT_SCRIPT_PATH + } } } } From 75d39d9ce5ebe2a091277f5dd1b4dcc95c7a1e11 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 26 Jan 2022 17:51:20 -0800 Subject: [PATCH 303/394] makes bucket variables atomic (#7179) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp index 6891eb4248..5e0e3e2de8 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp @@ -719,8 +719,12 @@ namespace AZ { #endif // DEBUG_ALLOCATOR - size_t mTotalAllocatedSizeBuckets = 0; - size_t mTotalCapacitySizeBuckets = 0; + // Bucket-dependent counters need to atomic since the locks that protect bucket allocations are per bucket + // So multiple threads could be updating these counters + AZStd::atomic mTotalAllocatedSizeBuckets = 0; + AZStd::atomic mTotalCapacitySizeBuckets = 0; + // In the case of tree allocations, there is a lock on the tree, so these counters are protected from multiple + // threads through that lock size_t mTotalAllocatedSizeTree = 0; size_t mTotalCapacitySizeTree = 0; public: From 413ce5a6ab4f1cdd61d150921830a8a67b2de3ea Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Wed, 26 Jan 2022 16:13:31 -0600 Subject: [PATCH 304/394] Atom Tools: move performance metrics status bar widgets to base window Signed-off-by: Guthrie Adams --- .../Window/AtomToolsMainWindow.h | 8 ++++ .../Source/Window/AtomToolsMainWindow.cpp | 38 +++++++++++++++++ .../Source/Window/MaterialEditorWindow.cpp | 41 ------------------- .../Code/Source/Window/MaterialEditorWindow.h | 9 ---- 4 files changed, 46 insertions(+), 50 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h index 92218d2542..86e9e2f291 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h @@ -16,6 +16,7 @@ #include #include +#include namespace AtomToolsFramework { @@ -45,9 +46,16 @@ namespace AtomToolsFramework virtual void OpenHelp(); virtual void OpenAbout(); + virtual void SetupMetrics(); + virtual void UpdateMetrics(); + AzQtComponents::FancyDocking* m_advancedDockManager = {}; QLabel* m_statusMessage = {}; + QLabel* m_statusBarFps = {}; + QLabel* m_statusBarCpuTime = {}; + QLabel* m_statusBarGpuTime = {}; + QTimer m_metricsTimer; QMenu* m_menuFile = {}; QMenu* m_menuEdit = {}; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp index 6a30ffc421..b6d519bd84 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -46,11 +47,15 @@ namespace AtomToolsFramework AddDockWidget("Python Terminal", new AzToolsFramework::CScriptTermDialog, Qt::BottomDockWidgetArea, Qt::Horizontal); SetDockWidgetVisible("Python Terminal", false); + SetupMetrics(); + AtomToolsMainWindowRequestBus::Handler::BusConnect(); } AtomToolsMainWindow::~AtomToolsMainWindow() { + AtomToolsFramework::PerformanceMonitorRequestBus::Broadcast( + &AtomToolsFramework::PerformanceMonitorRequestBus::Handler::SetProfilerEnabled, false); AtomToolsMainWindowRequestBus::Handler::BusDisconnect(); } @@ -192,4 +197,37 @@ namespace AtomToolsFramework void AtomToolsMainWindow::OpenAbout() { } + + + void AtomToolsMainWindow::SetupMetrics() + { + m_statusBarCpuTime = new QLabel(this); + statusBar()->addPermanentWidget(m_statusBarCpuTime); + m_statusBarGpuTime = new QLabel(this); + statusBar()->addPermanentWidget(m_statusBarGpuTime); + m_statusBarFps = new QLabel(this); + statusBar()->addPermanentWidget(m_statusBarFps); + + static constexpr int UpdateIntervalMs = 1000; + m_metricsTimer.setInterval(UpdateIntervalMs); + m_metricsTimer.start(); + connect(&m_metricsTimer, &QTimer::timeout, this, &AtomToolsMainWindow::UpdateMetrics); + + AtomToolsFramework::PerformanceMonitorRequestBus::Broadcast( + &AtomToolsFramework::PerformanceMonitorRequestBus::Handler::SetProfilerEnabled, true); + + UpdateMetrics(); + } + + void AtomToolsMainWindow::UpdateMetrics() + { + AtomToolsFramework::PerformanceMetrics metrics = {}; + AtomToolsFramework::PerformanceMonitorRequestBus::BroadcastResult( + metrics, &AtomToolsFramework::PerformanceMonitorRequestBus::Handler::GetMetrics); + + m_statusBarCpuTime->setText(tr("CPU Time %1 ms").arg(QString::number(metrics.m_cpuFrameTimeMs, 'f', 2))); + m_statusBarGpuTime->setText(tr("GPU Time %1 ms").arg(QString::number(metrics.m_gpuFrameTimeMs, 'f', 2))); + int frameRate = metrics.m_cpuFrameTimeMs > 0 ? aznumeric_cast(1000 / metrics.m_cpuFrameTimeMs) : 0; + m_statusBarFps->setText(tr("FPS %1").arg(QString::number(frameRate))); + } } // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index 49356e6735..bed28d146c 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -112,14 +111,6 @@ namespace MaterialEditor } OnDocumentOpened(AZ::Uuid::CreateNull()); - - SetupMetrics(); - } - - MaterialEditorWindow::~MaterialEditorWindow() - { - AtomToolsFramework::PerformanceMonitorRequestBus::Broadcast( - &AtomToolsFramework::PerformanceMonitorRequestBus::Handler::SetProfilerEnabled, false); } void MaterialEditorWindow::ResizeViewportRenderTarget(uint32_t width, uint32_t height) @@ -213,38 +204,6 @@ namespace MaterialEditor Base::closeEvent(closeEvent); } - - void MaterialEditorWindow::SetupMetrics() - { - m_statusBarCpuTime = new QLabel(this); - statusBar()->addPermanentWidget(m_statusBarCpuTime); - m_statusBarGpuTime = new QLabel(this); - statusBar()->addPermanentWidget(m_statusBarGpuTime); - m_statusBarFps = new QLabel(this); - statusBar()->addPermanentWidget(m_statusBarFps); - - static constexpr int UpdateIntervalMs = 1000; - m_metricsTimer.setInterval(UpdateIntervalMs); - m_metricsTimer.start(); - connect(&m_metricsTimer, &QTimer::timeout, this, &MaterialEditorWindow::UpdateMetrics); - - AtomToolsFramework::PerformanceMonitorRequestBus::Broadcast( - &AtomToolsFramework::PerformanceMonitorRequestBus::Handler::SetProfilerEnabled, true); - - UpdateMetrics(); - } - - void MaterialEditorWindow::UpdateMetrics() - { - AtomToolsFramework::PerformanceMetrics metrics = {}; - AtomToolsFramework::PerformanceMonitorRequestBus::BroadcastResult( - metrics, &AtomToolsFramework::PerformanceMonitorRequestBus::Handler::GetMetrics); - - m_statusBarCpuTime->setText(tr("CPU Time %1 ms").arg(QString::number(metrics.m_cpuFrameTimeMs, 'f', 2))); - m_statusBarGpuTime->setText(tr("GPU Time %1 ms").arg(QString::number(metrics.m_gpuFrameTimeMs, 'f', 2))); - int frameRate = metrics.m_cpuFrameTimeMs > 0 ? aznumeric_cast(1000 / metrics.m_cpuFrameTimeMs) : 0; - m_statusBarFps->setText(tr("FPS %1").arg(QString::number(frameRate))); - } } // namespace MaterialEditor #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h index 3cf08e0374..33b60add5b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h @@ -14,7 +14,6 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include #include -#include AZ_POP_DISABLE_WARNING #endif @@ -34,7 +33,6 @@ namespace MaterialEditor using Base = AtomToolsFramework::AtomToolsDocumentMainWindow; MaterialEditorWindow(QWidget* parent = 0); - ~MaterialEditorWindow(); protected: void ResizeViewportRenderTarget(uint32_t width, uint32_t height) override; @@ -49,14 +47,7 @@ namespace MaterialEditor void closeEvent(QCloseEvent* closeEvent) override; - void SetupMetrics(); - void UpdateMetrics(); - MaterialViewportWidget* m_materialViewport = {}; MaterialEditorToolBar* m_toolBar = {}; - QLabel* m_statusBarFps = {}; - QLabel* m_statusBarCpuTime = {}; - QLabel* m_statusBarGpuTime = {}; - QTimer m_metricsTimer; }; } // namespace MaterialEditor From e0cee13747befb882d405b6ce61d68d153331348 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 18:10:02 -0800 Subject: [PATCH 305/394] Code cleanup. Made PropertyDefinition::m_name private. Moved code around for a cleaner diff in MaterialTypeSourceData.h. Added API comments. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.h | 156 +++++++++++------- .../Material/MaterialTypeSourceData.cpp | 15 +- .../MaterialPropertySerializerTests.cpp | 16 +- .../Material/MaterialTypeSourceDataTests.cpp | 20 +-- 4 files changed, 118 insertions(+), 89 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index b5e7eecd0d..0daa0a4c24 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -23,8 +23,10 @@ namespace AZ { class MaterialTypeAsset; class MaterialFunctorSourceDataHolder; + class JsonMaterialPropertySerializer; //! This is a simple data structure for serializing in/out material type source files. + //! Note that there may be a mixture of public and private members, as we are gradually introducing a proper API. class MaterialTypeSourceData final { public: @@ -69,15 +71,22 @@ namespace AZ struct PropertyDefinition { + friend class JsonMaterialPropertySerializer; + AZ_CLASS_ALLOCATOR(PropertyDefinition, SystemAllocator, 0); AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyDefinition, "{E0DB3C0D-75DB-4ADB-9E79-30DA63FA18B7}"); static const float DefaultMin; static const float DefaultMax; static const float DefaultStep; + + PropertyDefinition() = default; - // TODO: Consider making this private and readonly because it is used as the key for lookups and collision validation. - AZStd::string m_name; //!< The name of the property within the property group. The full property ID will be groupName.propertyName. + explicit PropertyDefinition(AZStd::string_view name) : m_name(name) + { + } + + const AZStd::string& GetName() const { return m_name; } MaterialPropertyVisibility m_visibility = MaterialPropertyVisibility::Default; @@ -99,6 +108,51 @@ namespace AZ MaterialPropertyValue m_softMin; MaterialPropertyValue m_softMax; MaterialPropertyValue m_step; + + private: + + // We are gradually moving toward having a more proper API for MaterialTypeSourceData code, but we still some public members + // like above. However, it's important for m_name to be private because it is used as the key for lookups, collision validation, etc. + AZStd::string m_name; //!< The name of the property within the property group. The full property ID will be groupName.propertyName. + }; + + using PropertyList = AZStd::vector>; + + struct PropertySet + { + friend class MaterialTypeSourceData; + + AZ_CLASS_ALLOCATOR(PropertySet, SystemAllocator, 0); + AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertySet, "{BA3AA0E4-C74D-4FD0-ADB2-00B060F06314}"); + + public: + + PropertySet() = default; + AZ_DISABLE_COPY(PropertySet) + + const AZStd::string& GetName() const { return m_name; } + const AZStd::string& GetDisplayName() const { return m_displayName; } + const AZStd::string& GetDescription() const { return m_description; } + const PropertyList& GetProperties() const { return m_properties; } + const AZStd::vector>& GetPropertySets() const { return m_propertySets; } + const AZStd::vector>& GetFunctors() const { return m_materialFunctorSourceData; } + + void SetDisplayName(AZStd::string_view displayName) { m_displayName = displayName; } + void SetDescription(AZStd::string_view description) { m_description = description; } + + PropertyDefinition* AddProperty(AZStd::string_view name); + PropertySet* AddPropertySet(AZStd::string_view name); + + private: + + static PropertySet* AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList); + + AZStd::string m_name; + AZStd::string m_displayName; + AZStd::string m_description; + PropertyList m_properties; + AZStd::vector> m_propertySets; + AZStd::vector> m_materialFunctorSourceData; }; struct ShaderVariantReferenceData @@ -144,47 +198,6 @@ namespace AZ using VersionUpdates = AZStd::vector; - using PropertyList = AZStd::vector>; - - struct PropertySet - { - friend class MaterialTypeSourceData; - - AZ_CLASS_ALLOCATOR(PropertySet, SystemAllocator, 0); - AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertySet, "{BA3AA0E4-C74D-4FD0-ADB2-00B060F06314}"); - - public: - - PropertySet() = default; - AZ_DISABLE_COPY(PropertySet) - - const AZStd::string& GetName() const { return m_name; } - const AZStd::string& GetDisplayName() const { return m_displayName; } - const AZStd::string& GetDescription() const { return m_description; } - const PropertyList& GetProperties() const { return m_properties; } - const AZStd::vector>& GetPropertySets() const { return m_propertySets; } - const AZStd::vector>& GetFunctors() const { return m_materialFunctorSourceData; } - - void SetDisplayName(AZStd::string_view displayName) { m_displayName = displayName; } - void SetDescription(AZStd::string_view description) { m_description = description; } - - PropertyDefinition* AddProperty(AZStd::string_view name); - PropertySet* AddPropertySet(AZStd::string_view name); - - private: - - static PropertySet* AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList); - - AZStd::string m_name; - AZStd::string m_displayName; - AZStd::string m_description; - PropertyList m_properties; - AZStd::vector> m_propertySets; - AZStd::vector> m_materialFunctorSourceData; - }; - - using VersionUpdates = AZStd::vector; - struct PropertyLayout { AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyLayout, "{AE53CF3F-5C3B-44F5-B2FB-306F0EB06393}"); @@ -206,52 +219,69 @@ namespace AZ AZStd::vector> m_propertySets; }; - PropertySet* AddPropertySet(AZStd::string_view propertySetId); - PropertyDefinition* AddProperty(AZStd::string_view propertyId); - - const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } - - AZStd::string m_description; //< TODO: Make this private + AZStd::string m_description; //! Version 1 is the default and should not contain any version update. - uint32_t m_version = 1; //< TODO: Make this private - - VersionUpdates m_versionUpdates; //< TODO: Make this private + uint32_t m_version = 1; + + VersionUpdates m_versionUpdates; //! A list of shader variants that are always used at runtime; they cannot be turned off - AZStd::vector m_shaderCollection; //< TODO: Make this private + AZStd::vector m_shaderCollection; //! Material functors provide custom logic and calculations to configure shaders, render states, and more. See MaterialFunctor.h for details. - AZStd::vector> m_materialFunctorSourceData; //< TODO: Make this private + AZStd::vector> m_materialFunctorSourceData; //! Override names for UV input in the shaders of this material type. //! Using ordered map to sort names on loading. using UvNameMap = AZStd::map; - UvNameMap m_uvNameMap; //< TODO: Make this private + UvNameMap m_uvNameMap; //! Copy over UV custom names to the properties enum values. void ResolveUvEnums(); - - const PropertySet* FindPropertySet(AZStd::string_view propertySetId) const; + //! Add a new PropertySet for containing properties or other PropertySets. + //! @param propertySetId The ID of the new property set. To add as a nested PropertySet, use a full path ID like "levelA.levelB.levelC"; in this case a property set "levelA.levelB" must already exist. + //! @return a pointer to the new PropertySet or null if there was a problem (an AZ_Error will be reported). + PropertySet* AddPropertySet(AZStd::string_view propertySetId); + + //! Add a new property to a PropertySet. + //! @param propertyId The ID of the new property, like "layerBlend.factor" or "layer2.roughness.texture". The indicated property set must already exist. + //! @return a pointer to the new PropertyDefinition or null if there was a problem (an AZ_Error will be reported). + PropertyDefinition* AddProperty(AZStd::string_view propertyId); + + //! Return the PropertyLayout containing the tree of property sets and property definitions. + const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } + + //! Find the PropertySet with the given ID. + //! @param propertySetId The full ID of a property set to find, like "levelA.levelB.levelC". + //! @return the found PropertySet or null if it doesn't exist. + const PropertySet* FindPropertySet(AZStd::string_view propertySetId) const; + + //! Find the definition for a property with the given ID. + //! @param propertyId The full ID of a property to find, like "baseColor.texture". + //! @return the found PropertyDefinition or null if it doesn't exist. const PropertyDefinition* FindProperty(AZStd::string_view propertyId) const; - //! Tokenizes an ID string like "itemA.itemB.itemC" into a vector like ["itemA", "itemB", "itemC"] + //! Tokenizes an ID string like "itemA.itemB.itemC" into a vector like ["itemA", "itemB", "itemC"]. static AZStd::vector TokenizeId(AZStd::string_view id); - //! Splits an ID string like "itemA.itemB.itemC" into a vector like ["itemA.itemB", "itemC"] + //! Splits an ID string like "itemA.itemB.itemC" into a vector like ["itemA.itemB", "itemC"]. static AZStd::vector SplitId(AZStd::string_view id); - //! Call back function type used with the enumeration functions + //! Call back function type used with the enumeration functions. + //! Return false to terminate the traversal. using EnumeratePropertySetsCallback = AZStd::function; + //! Recursively traverses all of the property sets contained in the material type, executing a callback function for each. //! @return false if the enumeration was terminated early by the callback returning false. bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const; - //! Call back function type used with the numeration functions + //! Call back function type used with the numeration functions. + //! Return false to terminate the traversal. using EnumeratePropertiesCallback = AZStd::function> CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath = "", bool elevateWarnings = true) const; + //! If the data was loaded from an old format file (i.e. where "groups" and "properties" were separate sections), + //! this converts to the new format where properties are listed inside property sets. bool ConvertToNewDataFormat(); private: diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index bf24b98ac8..046dee9507 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -160,7 +160,7 @@ namespace AZ { auto propertyIter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) { - return existingProperty->m_name == name; + return existingProperty->GetName() == name; }); if (propertyIter != m_properties.end()) @@ -186,8 +186,7 @@ namespace AZ return nullptr; } - m_properties.emplace_back(AZStd::make_unique()); - m_properties.back()->m_name = name; + m_properties.emplace_back(AZStd::make_unique(name)); return m_properties.back().get(); } @@ -195,7 +194,7 @@ namespace AZ { auto iter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) { - return existingProperty->m_name == name; + return existingProperty->GetName() == name; }); if (iter != m_properties.end()) @@ -298,7 +297,7 @@ namespace AZ { for (AZStd::unique_ptr& property : propertySet->m_properties) { - if (property->m_name == subPath[0]) + if (property->GetName() == subPath[0]) { return property.get(); } @@ -440,7 +439,7 @@ namespace AZ propertySet = m_propertyLayout.m_propertySets.back().get(); } - PropertyDefinition* newProperty = propertySet->AddProperty(propertyDefinition.m_name); + PropertyDefinition* newProperty = propertySet->AddProperty(propertyDefinition.GetName()); *newProperty = propertyDefinition; } @@ -518,7 +517,7 @@ namespace AZ { // Register the property... - MaterialPropertyId propertyId{propertyNameContext, property->m_name}; + MaterialPropertyId propertyId{propertyNameContext, property->GetName()}; if (!propertyId.IsValid()) { @@ -529,7 +528,7 @@ namespace AZ auto propertySetIter = AZStd::find_if(propertySet->GetPropertySets().begin(), propertySet->GetPropertySets().end(), [&property](const AZStd::unique_ptr& existingPropertySet) { - return existingPropertySet->GetName() == property->m_name; + return existingPropertySet->GetName() == property->GetName(); }); if (propertySetIter != propertySet->GetPropertySets().end()) diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp index 9afc05a237..904860d4fc 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp @@ -45,8 +45,7 @@ namespace JsonSerializationTests AZStd::shared_ptr CreatePartialDefaultInstance() override { - auto result = AZStd::make_shared(); - result->m_name = "testProperty"; + auto result = AZStd::make_shared("testProperty"); result->m_dataType = AZ::RPI::MaterialPropertyDataType::Float; result->m_step = 1.0f; result->m_value = 0.0f; @@ -65,8 +64,7 @@ namespace JsonSerializationTests AZStd::shared_ptr CreateFullySetInstance() override { - auto result = AZStd::make_shared(); - result->m_name = "testProperty"; + auto result = AZStd::make_shared("testProperty"); result->m_description = "description"; result->m_displayName = "display_name"; result->m_dataType = AZ::RPI::MaterialPropertyDataType::Float; @@ -135,7 +133,7 @@ namespace JsonSerializationTests const AZ::RPI::MaterialTypeSourceData::PropertyDefinition& lhs, const AZ::RPI::MaterialTypeSourceData::PropertyDefinition& rhs) override { - if (lhs.m_name != rhs.m_name) { return false; } + if (lhs.GetName() != rhs.GetName()) { return false; } if (lhs.m_description != rhs.m_description) { return false; } if (lhs.m_displayName != rhs.m_displayName) { return false; } if (lhs.m_dataType != rhs.m_dataType) { return false; } @@ -216,7 +214,7 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); EXPECT_EQ(AZ::JsonSerializationResult::Outcomes::PartialDefaults, loadResult.m_jsonResultCode.GetOutcome()); - EXPECT_EQ("testProperty", propertyData.m_name); + EXPECT_EQ("testProperty", propertyData.GetName()); EXPECT_EQ("Test Property", propertyData.m_displayName); EXPECT_EQ("This is a property description", propertyData.m_description); EXPECT_EQ(MaterialPropertyDataType::Float, propertyData.m_dataType); @@ -851,7 +849,7 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - EXPECT_EQ("testProperty", propertyData.m_name); + EXPECT_EQ("testProperty", propertyData.GetName()); EXPECT_EQ(1, propertyData.m_outputConnections.size()); EXPECT_EQ(MaterialPropertyOutputType::ShaderOption, propertyData.m_outputConnections[0].m_type); @@ -934,7 +932,7 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - EXPECT_EQ(propertyData.m_name, "testProperty"); + EXPECT_EQ(propertyData.GetName(), "testProperty"); EXPECT_EQ(propertyData.m_dataType, MaterialPropertyDataType::Float); EXPECT_EQ(propertyData.m_outputConnections.size(), 0); @@ -964,7 +962,7 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - EXPECT_EQ(propertyData.m_name, "testProperty"); + EXPECT_EQ(propertyData.GetName(), "testProperty"); EXPECT_EQ(propertyData.m_dataType, MaterialPropertyDataType::Float); EXPECT_EQ(propertyData.m_outputConnections.size(), 1); EXPECT_EQ(propertyData.m_outputConnections[0].m_fieldName, "o_foo"); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index f07e1da6c2..2ecf2369f9 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -1645,12 +1645,12 @@ namespace UnitTest EXPECT_NE(material.FindProperty("groupC.groupD.foo"), nullptr); EXPECT_NE(material.FindProperty("groupC.groupE.bar"), nullptr); - EXPECT_EQ(material.FindProperty("groupA.foo")->m_name, "foo"); - EXPECT_EQ(material.FindProperty("groupA.bar")->m_name, "bar"); - EXPECT_EQ(material.FindProperty("groupB.foo")->m_name, "foo"); - EXPECT_EQ(material.FindProperty("groupB.bar")->m_name, "bar"); - EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_name, "foo"); - EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupA.foo")->GetName(), "foo"); + EXPECT_EQ(material.FindProperty("groupA.bar")->GetName(), "bar"); + EXPECT_EQ(material.FindProperty("groupB.foo")->GetName(), "foo"); + EXPECT_EQ(material.FindProperty("groupB.bar")->GetName(), "bar"); + EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->GetName(), "foo"); + EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->GetName(), "bar"); EXPECT_EQ(material.FindProperty("groupA.foo")->m_dataType, MaterialPropertyDataType::Bool); EXPECT_EQ(material.FindProperty("groupA.bar")->m_dataType, MaterialPropertyDataType::Image); EXPECT_EQ(material.FindProperty("groupB.foo")->m_dataType, MaterialPropertyDataType::Float); @@ -1823,10 +1823,10 @@ namespace UnitTest EXPECT_TRUE(material.FindProperty("groupB.foo") != nullptr); EXPECT_TRUE(material.FindProperty("groupB.bar") != nullptr); - EXPECT_EQ(material.FindProperty("groupA.foo")->m_name, "foo"); - EXPECT_EQ(material.FindProperty("groupA.bar")->m_name, "bar"); - EXPECT_EQ(material.FindProperty("groupB.foo")->m_name, "foo"); - EXPECT_EQ(material.FindProperty("groupB.bar")->m_name, "bar"); + EXPECT_EQ(material.FindProperty("groupA.foo")->GetName(), "foo"); + EXPECT_EQ(material.FindProperty("groupA.bar")->GetName(), "bar"); + EXPECT_EQ(material.FindProperty("groupB.foo")->GetName(), "foo"); + EXPECT_EQ(material.FindProperty("groupB.bar")->GetName(), "bar"); EXPECT_EQ(material.FindProperty("groupA.foo")->m_dataType, MaterialPropertyDataType::Bool); EXPECT_EQ(material.FindProperty("groupA.bar")->m_dataType, MaterialPropertyDataType::Image); EXPECT_EQ(material.FindProperty("groupB.foo")->m_dataType, MaterialPropertyDataType::Float); From e2c4c0e5e3e0b7bd4a3adf2fe0ffee6c9b454483 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:41:38 -0800 Subject: [PATCH 306/394] Atom viewport render option bugfix (#7158) * Render option bugfix Signed-off-by: rhhong * add aznumeric_cast Signed-off-by: rhhong --- .../EMotionFXAtom/Assets/Icons/Cloth.svg | 9 ++++++ .../Assets/Icons/HitDetection.svg | 12 +++++++ .../Assets/Icons/RagdollCollider.svg | 9 ++++++ .../Assets/Icons/RagdollJointLimit.svg | 8 +++++ .../EMotionFXAtom/Assets/Icons/Resources.qrc | 5 +++ .../Assets/Icons/SimulatedObjectCollider.svg | 9 ++++++ .../Code/Source/AtomActorDebugDraw.cpp | 32 +++++++++---------- .../Tools/EMStudio/AnimViewportToolBar.cpp | 17 ++++++---- .../Code/Tools/EMStudio/AnimViewportToolBar.h | 2 +- 9 files changed, 80 insertions(+), 23 deletions(-) create mode 100644 Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Cloth.svg create mode 100644 Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/HitDetection.svg create mode 100644 Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollCollider.svg create mode 100644 Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollJointLimit.svg create mode 100644 Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/SimulatedObjectCollider.svg diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Cloth.svg b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Cloth.svg new file mode 100644 index 0000000000..d19fad50ae --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Cloth.svg @@ -0,0 +1,9 @@ + + + Icons / Actor / Cloth / On-2 + + + + + + diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/HitDetection.svg b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/HitDetection.svg new file mode 100644 index 0000000000..58056c2819 --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/HitDetection.svg @@ -0,0 +1,12 @@ + + + Icons / Actor / Hit Detection / On-2 + + + + + + + + + diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollCollider.svg b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollCollider.svg new file mode 100644 index 0000000000..e1468f3f9d --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollCollider.svg @@ -0,0 +1,9 @@ + + + Icons / Actor / Physics / On-236 + + + + + + diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollJointLimit.svg b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollJointLimit.svg new file mode 100644 index 0000000000..1a28021533 --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/RagdollJointLimit.svg @@ -0,0 +1,8 @@ + + + Icons / Actor / Joint / On-2 + + + + + diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Resources.qrc b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Resources.qrc index d035b84479..cbb07c7ee0 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Resources.qrc +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/Resources.qrc @@ -1,8 +1,13 @@ Camera_category.svg + Cloth.svg + HitDetection.svg + RagdollCollider.svg + RagdollJointLimit.svg Rotate.svg Scale.svg + SimulatedObjectCollider.svg Translate.svg Visualization.svg diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/SimulatedObjectCollider.svg b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/SimulatedObjectCollider.svg new file mode 100644 index 0000000000..cd59987d4a --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Assets/Icons/SimulatedObjectCollider.svg @@ -0,0 +1,9 @@ + + + Icons / Actor / Physics / On-2 + + + + + + diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp index 21f9f69f7c..deb668d12a 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp @@ -301,7 +301,7 @@ namespace AZ::Render RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = static_cast(m_auxVertices.size()); + lineArgs.m_vertCount = aznumeric_cast(m_auxVertices.size()); lineArgs.m_colors = m_auxColors.data(); lineArgs.m_colorCount = lineArgs.m_vertCount; lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; @@ -393,9 +393,9 @@ namespace AZ::Render RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = static_cast(m_auxVertices.size()); + lineArgs.m_vertCount = aznumeric_cast(m_auxVertices.size()); lineArgs.m_colors = m_auxColors.data(); - lineArgs.m_colorCount = static_cast(m_auxColors.size()); + lineArgs.m_colorCount = aznumeric_cast(m_auxColors.size()); lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; auxGeom->DrawLines(lineArgs); } @@ -464,15 +464,15 @@ namespace AZ::Render m_auxVertices.emplace_back(normalPos); m_auxVertices.emplace_back(normalPos + (normalDir * faceNormalsScale * scaleMultiplier)); } - } - RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; - lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = static_cast(m_auxVertices.size()); - lineArgs.m_colors = &faceNormalsColor; - lineArgs.m_colorCount = 1; - lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; - auxGeom->DrawLines(lineArgs); + RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; + lineArgs.m_verts = m_auxVertices.data(); + lineArgs.m_vertCount = aznumeric_cast(m_auxVertices.size()); + lineArgs.m_colors = &faceNormalsColor; + lineArgs.m_colorCount = 1; + lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; + auxGeom->DrawLines(lineArgs); + } } // render vertex normals @@ -501,7 +501,7 @@ namespace AZ::Render RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = static_cast(m_auxVertices.size()); + lineArgs.m_vertCount = aznumeric_cast(m_auxVertices.size()); lineArgs.m_colors = &vertexNormalsColor; lineArgs.m_colorCount = 1; lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; @@ -589,9 +589,9 @@ namespace AZ::Render RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = static_cast(m_auxVertices.size()); + lineArgs.m_vertCount = aznumeric_cast(m_auxVertices.size()); lineArgs.m_colors = m_auxColors.data(); - lineArgs.m_colorCount = static_cast(m_auxColors.size()); + lineArgs.m_colorCount = aznumeric_cast(m_auxColors.size()); lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; auxGeom->DrawLines(lineArgs); } @@ -649,7 +649,7 @@ namespace AZ::Render RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = static_cast(m_auxVertices.size()); + lineArgs.m_vertCount = aznumeric_cast(m_auxVertices.size()); lineArgs.m_colors = &wireframeColor; lineArgs.m_colorCount = 1; lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; @@ -688,7 +688,7 @@ namespace AZ::Render m_drawParams.m_drawViewportId = viewportContext->GetId(); AzFramework::WindowSize viewportSize = viewportContext->GetViewportSize(); - m_drawParams.m_position = AZ::Vector3(static_cast(viewportSize.m_width), 0.0f, 1.0f) + + m_drawParams.m_position = AZ::Vector3(aznumeric_cast(viewportSize.m_width), 0.0f, 1.0f) + TopRightBorderPadding * viewportContext->GetDpiScalingFactor(); m_drawParams.m_scale = AZ::Vector2(BaseFontSize); m_drawParams.m_hAlign = AzFramework::TextHorizontalAlignment::Right; diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.cpp index 455c587818..d9de41f54b 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.cpp @@ -79,11 +79,16 @@ namespace EMStudio // [EMFX-TODO] Add those option once implemented. // CreateViewOptionEntry(contextMenu, "Actor Bind Pose", EMotionFX::ActorRenderFlag::RENDER_ACTORBINDPOSE); contextMenu->addSeparator(); - CreateViewOptionEntry(contextMenu, "Hit Detection Colliders", EMotionFX::ActorRenderFlag::RENDER_HITDETECTION_COLLIDERS); - CreateViewOptionEntry(contextMenu, "Ragdoll Colliders", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_COLLIDERS); - CreateViewOptionEntry(contextMenu, "Ragdoll Joint Limits", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_JOINTLIMITS); - CreateViewOptionEntry(contextMenu, "Cloth Colliders", EMotionFX::ActorRenderFlag::RENDER_CLOTH_COLLIDERS); - CreateViewOptionEntry(contextMenu, "Simulated Object Colliders", EMotionFX::ActorRenderFlag::RENDER_SIMULATEDOBJECT_COLLIDERS); + CreateViewOptionEntry(contextMenu, "Hit Detection Colliders", EMotionFX::ActorRenderFlag::RENDER_HITDETECTION_COLLIDERS, true, + ":/EMotionFXAtom/HitDetection.svg"); + CreateViewOptionEntry(contextMenu, "Ragdoll Colliders", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_COLLIDERS, true, + ":/EMotionFXAtom/RagdollCollider.svg"); + CreateViewOptionEntry(contextMenu, "Ragdoll Joint Limits", EMotionFX::ActorRenderFlag::RENDER_RAGDOLL_JOINTLIMITS, true, + ":/EMotionFXAtom/RagdollJointLimit.svg"); + CreateViewOptionEntry(contextMenu, "Cloth Colliders", EMotionFX::ActorRenderFlag::RENDER_CLOTH_COLLIDERS, true, + ":/EMotionFXAtom/Cloth.svg"); + CreateViewOptionEntry(contextMenu, "Simulated Object Colliders", EMotionFX::ActorRenderFlag::RENDER_SIMULATEDOBJECT_COLLIDERS, true, + ":/EMotionFXAtom/SimulatedObjectCollider.svg"); CreateViewOptionEntry(contextMenu, "Simulated Joints", EMotionFX::ActorRenderFlag::RENDER_SIMULATEJOINTS); } @@ -153,7 +158,7 @@ namespace EMStudio } void AnimViewportToolBar::CreateViewOptionEntry( - QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible, char* iconFileName) + QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible, const char* iconFileName) { QAction* action = menu->addAction( menuEntryName, diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.h index 30f2c6b80c..f516b9df28 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportToolBar.h @@ -30,7 +30,7 @@ namespace EMStudio private: void CreateViewOptionEntry( - QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible = true, char* iconFileName = nullptr); + QMenu* menu, const char* menuEntryName, uint32_t actionIndex, bool visible = true, const char* iconFileName = nullptr); AtomRenderPlugin* m_plugin = nullptr; QAction* m_manipulatorActions[RenderOptions::ManipulatorMode::NUM_MODES] = { nullptr }; From a4346de65845b26fc827f3e5aea036c27f872f03 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 26 Jan 2022 23:54:25 -0800 Subject: [PATCH 307/394] Code cleanup. New comments. Added some non-const find functions to MaterialTypeSourceData. Fixed places where I forgot to change m_name to GetName(). Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.h | 16 ++++++++-- .../Material/MaterialTypeSourceData.cpp | 30 ++++++++++++++++--- .../Code/Tests/Common/ErrorMessageFinder.cpp | 2 +- .../Code/Source/Util/MaterialPropertyUtil.cpp | 2 +- .../Code/Source/Document/MaterialDocument.cpp | 12 ++++---- .../MaterialInspector/MaterialInspector.cpp | 2 +- .../EditorMaterialComponentInspector.cpp | 3 +- .../Material/EditorMaterialComponentUtil.cpp | 7 ++--- 8 files changed, 54 insertions(+), 20 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 0daa0a4c24..6c439195f1 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -140,7 +140,14 @@ namespace AZ void SetDisplayName(AZStd::string_view displayName) { m_displayName = displayName; } void SetDescription(AZStd::string_view description) { m_description = description; } + //! Add a new property to this PropertySet. + //! @param name a unique for the property. Must be a C-style identifier. + //! @return the new PropertyDefinition, or null if the name was not valid. PropertyDefinition* AddProperty(AZStd::string_view name); + + //! Add a new nested PropertySet to this PropertySet. + //! @param name a unique for the property set. Must be a C-style identifier. + //! @return the new PropertySet, or null if the name was not valid. PropertySet* AddPropertySet(AZStd::string_view name); private: @@ -213,9 +220,9 @@ namespace AZ AZStd::vector m_groupsOld; //! [Deprecated] Use m_propertySets instead - //! Collection of all available user-facing properties AZStd::map> m_propertiesOld; - + + //! Collection of all available user-facing properties AZStd::vector> m_propertySets; }; @@ -257,11 +264,13 @@ namespace AZ //! @param propertySetId The full ID of a property set to find, like "levelA.levelB.levelC". //! @return the found PropertySet or null if it doesn't exist. const PropertySet* FindPropertySet(AZStd::string_view propertySetId) const; + PropertySet* FindPropertySet(AZStd::string_view propertySetId); //! Find the definition for a property with the given ID. //! @param propertyId The full ID of a property to find, like "baseColor.texture". //! @return the found PropertyDefinition or null if it doesn't exist. const PropertyDefinition* FindProperty(AZStd::string_view propertyId) const; + PropertyDefinition* FindProperty(AZStd::string_view propertyId); //! Tokenizes an ID string like "itemA.itemB.itemC" into a vector like ["itemA", "itemB", "itemC"]. static AZStd::vector TokenizeId(AZStd::string_view id); @@ -300,7 +309,10 @@ namespace AZ private: const PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const; + PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList); + const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const; + PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList); // Function overloads for recursion, returns false to indicate that recursion should end. bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 046dee9507..032d36636e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -215,7 +215,7 @@ namespace AZ return PropertySet::AddPropertySet(propertySetId, m_propertyLayout.m_propertySets); } - PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertySetId[0])); + PropertySet* parentPropertySet = FindPropertySet(splitPropertySetId[0]); if (!parentPropertySet) { @@ -235,8 +235,8 @@ namespace AZ AZ_Error("Material source data", false, "Property id '%.*s' is invalid. Properties must be added to a PropertySet (i.e. \"general.%.*s\").", AZ_STRING_ARG(propertyId), AZ_STRING_ARG(propertyId)); return nullptr; } - - PropertySet* parentPropertySet = const_cast(const_cast(this)->FindPropertySet(splitPropertyId[0])); + + PropertySet* parentPropertySet = FindPropertySet(splitPropertyId[0]); if (!parentPropertySet) { @@ -276,12 +276,23 @@ namespace AZ return nullptr; } + + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) + { + return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); + } const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) const { AZStd::vector tokens = TokenizeId(propertySetId); return FindPropertySet(tokens, m_propertyLayout.m_propertySets); } + + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) + { + AZStd::vector tokens = TokenizeId(propertySetId); + return FindPropertySet(tokens, m_propertyLayout.m_propertySets); + } const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( AZStd::array_view parsedPropertyId, @@ -316,12 +327,23 @@ namespace AZ return nullptr; } + + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) + { + return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); + } const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) const { AZStd::vector tokens = TokenizeId(propertyId); return FindProperty(tokens, m_propertyLayout.m_propertySets); } + + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) + { + AZStd::vector tokens = TokenizeId(propertyId); + return FindProperty(tokens, m_propertyLayout.m_propertySets); + } AZStd::vector MaterialTypeSourceData::TokenizeId(AZStd::string_view id) { @@ -428,7 +450,7 @@ namespace AZ const auto& propertyList = propertyListItr->second; for (auto& propertyDefinition : propertyList) { - PropertySet* propertySet = const_cast(const_cast(this)->FindPropertySet(group.m_name)); + PropertySet* propertySet = FindPropertySet(group.m_name); if (!propertySet) { diff --git a/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp b/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp index 06cdb073e9..fa88f145a6 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp +++ b/Gems/Atom/RPI/Code/Tests/Common/ErrorMessageFinder.cpp @@ -84,7 +84,7 @@ namespace UnitTest } } - m_checked = true; + m_checked = true; } void ErrorMessageFinder::ReportFailure(const AZStd::string& failureMessage) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp index 568e701e3c..377fd46d69 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp @@ -78,7 +78,7 @@ namespace AtomToolsFramework void ConvertToPropertyConfig(AtomToolsFramework::DynamicPropertyConfig& propertyConfig, const AZ::RPI::MaterialTypeSourceData::PropertyDefinition& propertyDefinition) { propertyConfig.m_dataType = ConvertToEditableType(propertyDefinition.m_dataType); - propertyConfig.m_name = propertyDefinition.m_name; + propertyConfig.m_name = propertyDefinition.GetName(); propertyConfig.m_displayName = propertyDefinition.m_displayName; propertyConfig.m_description = propertyDefinition.m_description; propertyConfig.m_defaultValue = ConvertToEditableType(propertyDefinition.m_value); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index c9ae970215..aa14b02bbe 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -587,7 +587,7 @@ namespace MaterialEditor // populate sourceData with properties that meet the filter m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { - Name propertyId{propertyIdContext + propertyDefinition->m_name}; + Name propertyId{propertyIdContext + propertyDefinition->GetName()}; const auto it = m_properties.find(propertyId); if (it != m_properties.end() && propertyFilter(it->second)) @@ -603,8 +603,8 @@ namespace MaterialEditor } // TODO: Support populating the Material Editor with nested property sets, not just the top level. - const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1); - sourceData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; + const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->GetName().size() - 1); + sourceData.m_properties[groupName][propertyDefinition->GetName()].m_value = propertyValue; } } return true; @@ -788,7 +788,7 @@ namespace MaterialEditor for (const auto& propertyDefinition : propertySet->GetProperties()) { // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = propertyIdContext + propertySet->GetName() + "." + propertyDefinition->m_name; + propertyConfig.m_id = propertyIdContext + propertySet->GetName() + "." + propertyDefinition->GetName(); const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); @@ -877,6 +877,7 @@ namespace MaterialEditor m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); } + // Add material functors that are in the top-level functors list. const MaterialFunctorSourceData::EditorContext editorContext = MaterialFunctorSourceData::EditorContext(m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); for (Ptr functorData : m_materialTypeSourceData.m_materialFunctorSourceData) @@ -897,7 +898,8 @@ namespace MaterialEditor return false; } } - + + // Add any material functors that are located inside each property set. bool enumerateResult = m_materialTypeSourceData.EnumeratePropertySets( [this](const AZStd::string&, const MaterialTypeSourceData::PropertySet* propertySet) { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index 98e4ede2a9..3208683bf0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -185,7 +185,7 @@ namespace MaterialEditor AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( property, m_documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetProperty, - AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->m_name)); + AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->GetName())); group.m_properties.push_back(property); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index 9e990e2fc8..37fba346b8 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -307,7 +307,7 @@ namespace AZ AtomToolsFramework::DynamicPropertyConfig propertyConfig; // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->m_name); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(groupName, propertyDefinition->GetName()); AtomToolsFramework::ConvertToPropertyConfig(propertyConfig, *propertyDefinition.get()); @@ -323,7 +323,6 @@ namespace AZ // assigned material asset. Its values should be treated as parent, for comparison, in this case. propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType( m_editData.m_materialTypeAsset->GetDefaultPropertyValues()[propertyIndex.GetIndex()]); - propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType( m_editData.m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); group.m_properties.emplace_back(propertyConfig); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index d6342a2507..62982e4b4d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -115,7 +115,7 @@ namespace AZ bool result = true; editData.m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const AZ::RPI::MaterialTypeSourceData::PropertyDefinition* propertyDefinition) { - AZ::Name propertyId(propertyIdContext + propertyDefinition->m_name); + AZ::Name propertyId(propertyIdContext + propertyDefinition->GetName()); const AZ::RPI::MaterialPropertyIndex propertyIndex = editData.m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyId); @@ -148,10 +148,9 @@ namespace AZ return true; } - // TODO: Support populating the Material Editor with nested property sets, not just the top level. - const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->m_name.size() - 1); - exportData.m_properties[groupName][propertyDefinition->m_name].m_value = propertyValue; + const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->GetName().size() - 1); + exportData.m_properties[groupName][propertyDefinition->GetName()].m_value = propertyValue; return true; }); From bbd91755ea8c8177b34ab44434cf85a6224abb96 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Thu, 27 Jan 2022 13:23:39 +0100 Subject: [PATCH 308/394] EMotion FX: Recent files menu in Animation Editor also shows files from external gems (#7160) Recent files were only shown from sub-folders of the project and assets from gems (inside project and external) were not visible. Signed-off-by: Benjamin Jillich --- .../Code/MysticQt/Source/RecentFiles.cpp | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/Gems/EMotionFX/Code/MysticQt/Source/RecentFiles.cpp b/Gems/EMotionFX/Code/MysticQt/Source/RecentFiles.cpp index b5dfd2ead1..26f0bb8e57 100644 --- a/Gems/EMotionFX/Code/MysticQt/Source/RecentFiles.cpp +++ b/Gems/EMotionFX/Code/MysticQt/Source/RecentFiles.cpp @@ -11,13 +11,13 @@ #include #include #include +#include #include #include #include #include #include - namespace MysticQt { class ToolTipMenu @@ -128,56 +128,52 @@ namespace MysticQt { m_recentFilesMenu->clear(); - AZStd::string sourceFolder = EMotionFX::GetEMotionFX().GetAssetSourceFolder(); AZStd::string cacheFolder = EMotionFX::GetEMotionFX().GetAssetCacheFolder(); - AzFramework::StringFunc::Path::Normalize(sourceFolder); AzFramework::StringFunc::Path::Normalize(cacheFolder); - AzFramework::StringFunc::Strip(sourceFolder, AZ_CORRECT_FILESYSTEM_SEPARATOR, true, false, true); AzFramework::StringFunc::Strip(cacheFolder, AZ_CORRECT_FILESYSTEM_SEPARATOR, true, false, true); int recentFilesAdded = 0; - QString menuItemText; - AZStd::string folder; const int recentFileCount = m_recentFiles.size(); for (int i = 0; i < recentFileCount; ++i) { - const QFileInfo fileInfo(m_recentFiles[i]); - folder = fileInfo.absolutePath().toUtf8().data(); - AzFramework::StringFunc::Path::Normalize(folder); - AzFramework::StringFunc::Strip(folder, AZ_CORRECT_FILESYSTEM_SEPARATOR, true, false, true); - - auto CharacterCompareIgnoreCase = [](const char lhs, const char rhs) + const QString recentFilePath = m_recentFiles[i]; + if (!QFile::exists(recentFilePath)) { - return tolower(lhs) == tolower(rhs); - }; - auto PathCompareIgnoreCase = [&CharacterCompareIgnoreCase](const AZ::IO::PathView& lhs, const AZ::IO::PathView& rhs) - { - AZStd::string_view lhsStringView = lhs.Native(); - AZStd::string_view rhsStringView = rhs.Native(); - return AZStd::equal(lhsStringView.begin(), lhsStringView.end(), rhsStringView.begin(), rhsStringView.end(), - CharacterCompareIgnoreCase); - }; + continue; + } - AZ::IO::PathView folderPathView(folder); - AZ::IO::PathView assetSourceView(sourceFolder); - AZ::IO::PathView assetCacheView(cacheFolder); - // The source folder is case-sensitive, so use the normal path compare - auto [folderPathIter, assetSourceIter] = AZStd::mismatch(folderPathView.begin(), folderPathView.end(), - assetSourceView.begin(), assetSourceView.end()); - // The Cache folder is always lowercase, so compare while ignoring case - auto [folderPathIter2, assetCacheIter] = AZStd::mismatch(folderPathView.begin(), folderPathView.end(), - assetCacheView.begin(), assetCacheView.end(), PathCompareIgnoreCase); - // Both of the above mismatch checks if folder path is a sub-directory of the asset source path or - // the asset cache path. If either asset source path or asset cache path PathView reaches the end - // iterator, then the folder path is either equal to one of them or a sub-directory of one of them + AZStd::string normalizedPath = recentFilePath.toUtf8().data(); + AzFramework::StringFunc::Path::Normalize(normalizedPath); - // Skip files that are not part of the current game directory. - if (sourceFolder == folder - || assetSourceIter == assetSourceView.end() - || cacheFolder == folder - || assetCacheIter == assetCacheView.end()) + // Check if the file can be found in any of the scan folders (Project asset paths, gem asset paths, etc.) + bool foundInScanFolders = false; { - menuItemText = QString("&%1 %2").arg(i + 1).arg(fileInfo.fileName()); + bool getScanFoldersSuccess = false; + AZStd::vector scanFolders; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(getScanFoldersSuccess, &AzToolsFramework::AssetSystemRequestBus::Events::GetScanFolders, scanFolders); + if (getScanFoldersSuccess) + { + for (AZStd::string& scanFolder : scanFolders) + { + AzFramework::StringFunc::Path::Normalize(scanFolder); + if (AzFramework::StringFunc::Contains(normalizedPath, scanFolder)) + { + foundInScanFolders = true; + } + } + } + + // Is the file part of the asset cache folder? + if (AzFramework::StringFunc::Contains(normalizedPath, cacheFolder)) + { + foundInScanFolders = true; + } + } + + if (foundInScanFolders) + { + const QFileInfo fileInfo(m_recentFiles[i]); + const QString menuItemText = QString("&%1 %2").arg(i + 1).arg(fileInfo.fileName()); QAction* action = new QAction(m_recentFilesMenu); action->setText(menuItemText); From 61b494a3c78ab9f3610104baf1a13a7ca88f6466 Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 27 Jan 2022 13:56:24 +0000 Subject: [PATCH 309/394] fix for changes in non-uniform scale component mode not persisting Signed-off-by: greerdv --- .../ToolsComponents/EditorNonUniformScaleComponentMode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp index 2e02b820b8..63334a893b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp @@ -27,6 +27,7 @@ namespace AzToolsFramework worldFromLocal.ExtractUniformScale(); m_manipulators = AZStd::make_unique(worldFromLocal); m_manipulators->Register(g_mainManipulatorManagerId); + m_manipulators->AddEntityComponentIdPair(entityComponentIdPair); m_manipulators->SetAxes(AZ::Vector3::CreateAxisX(), AZ::Vector3::CreateAxisY(), AZ::Vector3::CreateAxisZ()); const float axisLength = 2.0f; m_manipulators->ConfigureView( From bb93dd33159ba2e9a5002d1d8b91296af11a0381 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Thu, 27 Jan 2022 16:08:22 +0000 Subject: [PATCH 310/394] PR feedback + refactored some code duplication in tests Signed-off-by: Sergey Pereslavtsev --- .../TerrainPhysicsColliderComponent.cpp | 2 +- .../Tests/TerrainPhysicsColliderTests.cpp | 189 +++++++++--------- 2 files changed, 94 insertions(+), 97 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 72f03230ac..09db7d4124 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -84,7 +84,7 @@ namespace Terrain ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(AZ::Edit::UIHandlers::Default, &TerrainPhysicsColliderConfig::m_defaultMaterialSelection, - "Default Surface Physics Material", "Select a material to be used by maps surfaces by default") + "Default Surface Physics Material", "Select a material to be used by unmapped surfaces by default") ->DataElement( AZ::Edit::UIHandlers::Default, &TerrainPhysicsColliderConfig::m_surfaceMaterialMappings, "Surface to Material Mappings", "Maps surfaces to physics materials") diff --git a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp index 6dc225f537..bc4818e62a 100644 --- a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp @@ -46,10 +46,17 @@ protected: appDesc.m_stackRecordLevels = 20; m_app.Create(appDesc); + + CreateEntity(); + + m_boxComponent = m_entity->CreateComponent(); + m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); } void TearDown() override { + m_entity.reset(); + m_app.Destroy(); } @@ -61,12 +68,9 @@ protected: m_entity->Init(); } - void AddTerrainPhysicsColliderAndShapeComponentToEntity() + void AddTerrainPhysicsColliderToEntity(const Terrain::TerrainPhysicsColliderConfig& configuration) { - m_boxComponent = m_entity->CreateComponent(); - m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); - - m_colliderComponent = m_entity->CreateComponent(Terrain::TerrainPhysicsColliderConfig()); + m_colliderComponent = m_entity->CreateComponent(configuration); m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); } @@ -113,21 +117,17 @@ protected: TEST_F(TerrainPhysicsColliderComponentTest, ActivateEntityActivateSuccess) { // Check that the entity activates with a collider and the required shape attached. - CreateEntity(); - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); EXPECT_EQ(m_entity->GetState(), AZ::Entity::State::Active); - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderTransformChangedNotifiesHeightfieldBus) { // Check that the HeightfieldBus is notified when the transform of the entity changes. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -138,16 +138,12 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderTransformChang LmbrCentral::ShapeComponentNotificationsBus::Event( m_entity->GetId(), &LmbrCentral::ShapeComponentNotificationsBus::Events::OnShapeChanged, LmbrCentral::ShapeComponentNotifications::ShapeChangeReasons::TransformChanged); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderShapeChangedNotifiesHeightfieldBus) { // Check that the Heightfield bus is notified when the shape component changes. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -157,16 +153,12 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderShapeChangedNo LmbrCentral::ShapeComponentNotificationsBus::Event( m_entity->GetId(), &LmbrCentral::ShapeComponentNotificationsBus::Events::OnShapeChanged, LmbrCentral::ShapeComponentNotifications::ShapeChangeReasons::ShapeChanged); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsAlignedRowBoundsCorrectly) { // Check that the heightfield grid size is correct when the shape bounds match the grid resolution. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -188,17 +180,13 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsAligned // With the bounds set at 0-1024 and a resolution of 1.0, the heightfield grid should be 1024x1024. EXPECT_EQ(cols, 1024); EXPECT_EQ(rows, 1024); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderExpandsMinBoundsCorrectly) { // Check that the heightfield grid is correctly expanded if the minimum value of the bounds needs expanding // to correctly encompass it. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -221,17 +209,13 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderExpandsMinBoun // the values returned would be 1023. EXPECT_EQ(cols, 1024); EXPECT_EQ(rows, 1024); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderExpandsMaxBoundsCorrectly) { // Check that the heightfield grid is correctly expanded if the maximum value of the bounds needs expanding // to correctly encompass it. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -254,16 +238,12 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderExpandsMaxBoun // the values returned would be 1023. EXPECT_EQ(cols, 1024); EXPECT_EQ(rows, 1024); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsReturnsHeights) { // Check that the TerrainPhysicsCollider returns a heightfield of the expected size. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -298,16 +278,12 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsRetu EXPECT_EQ(cols, 1024); EXPECT_EQ(rows, 1024); EXPECT_EQ(heights.size(), cols * rows); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsRelativeHeightsCorrectly) { // Check that the values stored in the heightfield returned by the TerrainPhysicsCollider are correct. - CreateEntity(); - - AddTerrainPhysicsColliderAndShapeComponentToEntity(); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -341,18 +317,11 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsRelativ const float expectedHeightValue = 16384.0f; EXPECT_NEAR(heights[0], expectedHeightValue, 0.01f); - - m_entity->Reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsMaterials) { // Check that the TerrainPhysicsCollider returns all the assigned materials. - CreateEntity(); - - m_boxComponent = m_entity->CreateComponent(); - m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); - // Create two SurfaceTag/Material mappings and add them to the collider. Terrain::TerrainPhysicsColliderConfig config; @@ -372,8 +341,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsMateria mapping2.m_surfaceTag = tag2; config.m_surfaceMaterialMappings.emplace_back(mapping2); - m_colliderComponent = m_entity->CreateComponent(config); - m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); + AddTerrainPhysicsColliderToEntity(config); m_entity->Activate(); @@ -388,20 +356,12 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsMateria EXPECT_EQ(materialList[0], defaultMaterial); EXPECT_EQ(materialList[1], mat1); EXPECT_EQ(materialList[2], mat2); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsMaterialsWhenNotMapped) { // Check that the TerrainPhysicsCollider returns a default material when no surfaces are mapped. - CreateEntity(); - - m_boxComponent = m_entity->CreateComponent(); - m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); - - m_colliderComponent = m_entity->CreateComponent(); - m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); + AddTerrainPhysicsColliderToEntity(Terrain::TerrainPhysicsColliderConfig()); m_entity->Activate(); @@ -414,18 +374,11 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsMateria Physics::MaterialId defaultMaterial = Physics::MaterialId(); EXPECT_EQ(materialList[0], defaultMaterial); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndMaterialsReturnsCorrectly) { // Check that the TerrainPhysicsCollider returns a heightfield of the expected size. - CreateEntity(); - - m_boxComponent = m_entity->CreateComponent(); - m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); - // Create two SurfaceTag/Material mappings and add them to the collider. Terrain::TerrainPhysicsColliderConfig config; @@ -445,8 +398,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM mapping2.m_surfaceTag = tag2; config.m_surfaceMaterialMappings.emplace_back(mapping2); - m_colliderComponent = m_entity->CreateComponent(config); - m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); + AddTerrainPhysicsColliderToEntity(config); m_entity->Activate(); @@ -460,15 +412,10 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM const float mockHeight = 32768.0f; AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); - AzFramework::SurfaceData::SurfaceTagWeight return1; - return1.m_surfaceType = tag1; - return1.m_weight = 1.0f; + AzFramework::SurfaceData::SurfaceTagWeight tagWeight1(tag1, 1.0f); + AzFramework::SurfaceData::SurfaceTagWeight tagWeight2(tag2, 1.0f); - AzFramework::SurfaceData::SurfaceTagWeight return2; - return2.m_surfaceType = tag2; - return2.m_weight = 1.0f; - - AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { return1, return2 }; + AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { tagWeight1, tagWeight2 }; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); @@ -499,17 +446,10 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM // Check an entry from the second half of the list EXPECT_EQ(heightsAndMaterials[256 * 128].m_materialIndex, 2); EXPECT_NEAR(heightsAndMaterials[256 * 128].m_height, expectedHeightValue, 0.01f); - - m_entity.reset(); } TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMaterialAssignedWhenTagHasNoMapping) { - CreateEntity(); - - m_boxComponent = m_entity->CreateComponent(); - m_app.RegisterComponentDescriptor(m_boxComponent->CreateDescriptor()); - // Create two SurfaceTag/Material mappings and add them to the collider. Terrain::TerrainPhysicsColliderConfig config; @@ -526,9 +466,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMateria config.m_defaultMaterialSelection.SetMaterialId(defaultSurfaceMaterial); // Intentionally don't set the mapping for "tag2". It's expected the default material will substitute. - - m_colliderComponent = m_entity->CreateComponent(config); - m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); + AddTerrainPhysicsColliderToEntity(config); m_entity->Activate(); @@ -554,15 +492,10 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMateria const float mockHeight = 32768.0f; AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); - AzFramework::SurfaceData::SurfaceTagWeight return1; - return1.m_surfaceType = tag1; - return1.m_weight = 1.0f; + AzFramework::SurfaceData::SurfaceTagWeight tagWeight1(tag1, 1.0f); + AzFramework::SurfaceData::SurfaceTagWeight tagWeight2(tag2, 1.0f); - AzFramework::SurfaceData::SurfaceTagWeight return2; - return2.m_surfaceType = tag2; - return2.m_weight = 1.0f; - - AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { return1, return2 }; + AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { tagWeight1, tagWeight2 }; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); @@ -591,6 +524,70 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMateria // This should point to the default material (0) since we don't have a mapping for "tag2" EXPECT_EQ(heightsAndMaterials[256 * 128].m_materialIndex, 0); } - - m_entity.reset(); +} + +TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMaterialAssignedWhenNoMappingsExist) +{ + // Create only the default material with no mapping for the tags. It's expected the default material will be assigned to both tags. + Terrain::TerrainPhysicsColliderConfig config; + const Physics::MaterialId defaultSurfaceMaterial = Physics::MaterialId::Create(); + config.m_defaultMaterialSelection.SetMaterialId(defaultSurfaceMaterial); + AddTerrainPhysicsColliderToEntity(config); + + m_entity->Activate(); + + // Validate material list is generated with the default material + { + AZStd::vector materialList; + Physics::HeightfieldProviderRequestsBus::EventResult( + materialList, m_entity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetMaterialList); + + EXPECT_EQ(materialList.size(), 1); + EXPECT_EQ(materialList[0], defaultSurfaceMaterial); + } + + const AZ::Vector3 boundsMin = AZ::Vector3(0.0f); + const AZ::Vector3 boundsMax = AZ::Vector3(256.0f, 256.0f, 32768.0f); + + NiceMock boxShape(m_entity->GetId()); + const AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(boundsMin, boundsMax); + ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); + + const float mockHeight = 32768.0f; + AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + + const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); + AzFramework::SurfaceData::SurfaceTagWeight tagWeight1(tag1, 1.0f); + + const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); + AzFramework::SurfaceData::SurfaceTagWeight tagWeight2(tag2, 1.0f); + + AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { tagWeight1, tagWeight2 }; + + NiceMock terrainListener; + ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); + ON_CALL(terrainListener, ProcessSurfacePointsFromRegion).WillByDefault( + [this, mockHeight, &surfaceTags](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + { + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, &surfaceTags, mockHeight); + } + ); + + // Validate material indices + { + AZStd::vector heightsAndMaterials; + Physics::HeightfieldProviderRequestsBus::EventResult( + heightsAndMaterials, m_entity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); + + // We set the bounds to 256, so check that the correct number of entries are present. + EXPECT_EQ(heightsAndMaterials.size(), 256 * 256); + + // Check an entry from the first half of the returned list. Should be the default material index 0. + EXPECT_EQ(heightsAndMaterials[0].m_materialIndex, 0); + + // Check an entry from the second half of the list. Should be the default material index 0. + EXPECT_EQ(heightsAndMaterials[256 * 128].m_materialIndex, 0); + } } From 94919fe270b0332cb9323b27ba8f4a4bb62ebc0e Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 27 Jan 2022 09:47:12 -0800 Subject: [PATCH 311/394] Moved Serialize Context retrieval out of a loop and expanded an error message in InMemorySpawnableAssetContainer::LoadReferencedAssets. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/InMemorySpawnableAssetContainer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index f0fbd1a299..fa7bebfaea 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -219,13 +219,12 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils // 2. Gets the exact asset to load to avoid issues with assets that don't reload. AZStd::vector*> blockingAssets; + AZ::SerializeContext* sc = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(sc, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + AZ_Assert(sc, "Unable to locate Serialize Context while resolving asset references in the in-memory spawnable asset container."); + for (AZ::Data::Asset& asset : spawnable.m_assets) { - AZ::SerializeContext* sc = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(sc, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - AZ_Assert( - sc, "Unable to locate Serialize Context while resolving asset references in the in-memory spawnable asset container."); - auto callback = [&blockingAssets]( void* object, const AZ::SerializeContext::ClassData* classData, [[maybe_unused]]const AZ::SerializeContext::ClassElement* elementData) -> bool @@ -236,7 +235,10 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils if (!asset->GetId().IsValid()) { - AZ_Error("Prefab", false, "Invalid asset found referenced in scene while entering game mode"); + AZ_Error( + "Prefab", false, + "Invalid asset found referenced in scene while entering game mode. The asset was stored in an instance of %s.", + classData->m_name); return false; } From f7f17c98b4cf43583a679be38ea8fa480147a731 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Thu, 27 Jan 2022 11:12:15 -0800 Subject: [PATCH 312/394] [development] fixed ambiguous 'byte' type MSVC build error (#7184) - fully quality 'byte' type in AZStd::span - remove unnecessary 'using namespace AZStd;' statement from AssetCatalog tests Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/std/containers/span.h | 4 ++-- Code/Framework/AzCore/AzCore/std/containers/span.inl | 12 ++++++------ Code/Framework/AzFramework/Tests/AssetCatalog.cpp | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h index 807d87e634..e511b49bd5 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.h +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -189,11 +189,11 @@ namespace AZStd // [span.objectrep], views of object representation template auto as_bytes(span s) noexcept - -> span; + -> span; template auto as_writable_bytes(span s) noexcept - -> enable_if_t, span>; + -> enable_if_t, span>; } // namespace AZStd diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl index 765056cb67..1b7cbd6094 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -197,18 +197,18 @@ namespace AZStd template inline auto as_bytes(span s) noexcept - -> span + -> span { - return span( - reinterpret_cast(s.data()), s.size_bytes()); + return span( + reinterpret_cast(s.data()), s.size_bytes()); } template inline auto as_writable_bytes(span s) noexcept - -> enable_if_t, span> + -> enable_if_t, span> { - return span( - reinterpret_cast(s.data()), s.size_bytes()); + return span( + reinterpret_cast(s.data()), s.size_bytes()); } } // namespace AZStd diff --git a/Code/Framework/AzFramework/Tests/AssetCatalog.cpp b/Code/Framework/AzFramework/Tests/AssetCatalog.cpp index e731b633f0..728df29a7f 100644 --- a/Code/Framework/AzFramework/Tests/AssetCatalog.cpp +++ b/Code/Framework/AzFramework/Tests/AssetCatalog.cpp @@ -34,7 +34,6 @@ #include "AZTestShared/Utils/Utils.h" -using namespace AZStd; using namespace AZ::Data; namespace UnitTest From 3a08a3b325430359ed41041d4d198069724bfa9b Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 27 Jan 2022 12:38:57 -0800 Subject: [PATCH 313/394] Removed some unused local variables. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index fa7bebfaea..567ccc3619 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -254,9 +254,6 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return false; } - AZ::Data::AssetId assetId = asset->GetId(); - AZ::Data::AssetType assetType = asset->GetType(); - if (loadBehavior == AZ::Data::AssetLoadBehavior::PreLoad) { // Only assets that are preloaded need to be waited on. From e2f041b1ae717b9d863f77d863b7ed459d1123ad Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 27 Jan 2022 13:17:37 -0800 Subject: [PATCH 314/394] Replacing an out-dated script node Signed-off-by: Gene Walters --- ...oComponent_RPC_NetLevelEntity.scriptcanvas | 972 +++++++++--------- 1 file changed, 485 insertions(+), 487 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas index 3869dfdfcb..5d61fea3e7 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -5,15 +5,118 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 1685762441320719908 + "id": 7369225496155711251 }, "Name": "AutoComponent_RPC_NetLevelEntity", "Components": { "Component_[2936040539888065977]": { - "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "$type": "EditorGraph", "Id": 2936040539888065977, "m_graphData": { "m_nodes": [ + { + "Id": { + "id": 11993350262154 + }, + "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", + "Components": { + "Component_[103174496050601676]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 103174496050601676, + "Slots": [ + { + "id": { + "m_id": "{AE2A0AA3-99DD-4DE4-AFEA-7560F078943C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{4D460DFD-82A1-4A92-8EAE-D32A96E79FA0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3FD9A3D0-FFAA-475E-89CB-D24EB4FEB952}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F120FEE1-448B-4D61-8439-10511C797707}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", + "className": "NetworkTestLevelEntityComponent", + "inputSlots": [ + { + "m_id": "{AE2A0AA3-99DD-4DE4-AFEA-7560F078943C}" + } + ], + "prettyClassName": "NetworkTestLevelEntityComponent" + } + } + }, { "Id": { "id": 56986727032248 @@ -338,7 +441,7 @@ "isNullPointer": false, "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", "value": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx", - "label": "Color" + "label": "Text" }, { "scriptCanvasType": { @@ -352,7 +455,7 @@ 0.0, 1.0 ], - "label": "Color: 2" + "label": "Color" }, { "scriptCanvasType": { @@ -361,7 +464,7 @@ "isNullPointer": false, "$type": "double", "value": 2.0, - "label": "Number: 3" + "label": "Duration" } ], "methodType": 0, @@ -486,153 +589,6 @@ } } }, - { - "Id": { - "id": 8318619017825 - }, - "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", - "Components": { - "Component_[15772128920819427182]": { - "$type": "AzEventHandler", - "Id": 15772128920819427182, - "Slots": [ - { - "id": { - "m_id": "{2A42C379-8E3B-46EF-BC63-C1D5395CB583}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 7820402811489 - } - } - ], - "slotName": "Connect", - "toolTip": "Connect the AZ Event to this AZ Event Handler.", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{3DB9829E-6088-49B9-A56D-4D1884C679BD}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Disconnect", - "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{9AC3CF57-B648-4B43-8FCA-8576B6EA350B}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "On Connected", - "toolTip": "Signaled when a connection has taken place.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{5FB8D529-6FC6-4543-99B5-5B147EBD7BE6}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "On Disconnected", - "toolTip": "Signaled when this event handler is disconnected.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "OnEvent", - "toolTip": "Triggered when the AZ Event invokes Signal() function.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - }, - "IsLatent": true - }, - { - "id": { - "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 7820402811489 - } - } - ], - "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 - } - ], - "Datums": [ - { - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" - }, - "isNullPointer": true, - "label": "AuthorityToClientNoParams_PlayFx Notify Event" - } - ], - "m_azEventEntry": { - "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", - "m_eventSlotId": { - "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" - } - } - } - } - }, { "Id": { "id": 56991021999544 @@ -868,17 +824,17 @@ }, { "Id": { - "id": 8400576252253 + "id": 16962627423626 }, "Name": "SC-Node(AuthorityToClientNoParams_PlayFxByEntityId)", "Components": { - "Component_[6332803108634970671]": { + "Component_[3643560316791874936]": { "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 6332803108634970671, + "Id": 3643560316791874936, "Slots": [ { "id": { - "m_id": "{87B7266B-D7B1-4CAD-9898-4D7F0274DAB0}" + "m_id": "{029728DF-0939-4D64-A9A1-3DB4B8AF127E}" }, "contracts": [ { @@ -886,7 +842,7 @@ } ], "slotName": "Source", - "toolTip": "The Source containing the NetworkTestPlayerComponentController", + "toolTip": "The Source containing the NetworkTestLevelEntityComponentController", "Descriptor": { "ConnectionType": 1, "SlotType": 2 @@ -895,7 +851,7 @@ }, { "id": { - "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" + "m_id": "{2C322CF8-1A5C-48D4-8CD2-9723E2DD4A4D}" }, "contracts": [ { @@ -910,7 +866,7 @@ }, { "id": { - "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" + "m_id": "{51F7773F-90F9-4465-8A0E-627EFC30E696}" }, "contracts": [ { @@ -926,6 +882,7 @@ ], "Datums": [ { + "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -939,16 +896,161 @@ ], "methodType": 2, "methodName": "AuthorityToClientNoParams_PlayFxByEntityId", - "className": "NetworkTestPlayerComponent", - "resultSlotIDs": [ - {} - ], + "className": "NetworkTestLevelEntityComponent", "inputSlots": [ { - "m_id": "{87B7266B-D7B1-4CAD-9898-4D7F0274DAB0}" + "m_id": "{029728DF-0939-4D64-A9A1-3DB4B8AF127E}" } ], - "prettyClassName": "NetworkTestPlayerComponent" + "prettyClassName": "NetworkTestLevelEntityComponent" + } + } + }, + { + "Id": { + "id": 12482976533898 + }, + "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", + "Components": { + "Component_[3959674633056578794]": { + "$type": "AzEventHandler", + "Id": 3959674633056578794, + "Slots": [ + { + "id": { + "m_id": "{D9C7482D-62F3-494B-ABD8-DEE1EC423F5B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 11993350262154 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{79E07161-43E8-46B6-A402-ACEF441621ED}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0DA1B9BC-BAA1-4144-B9A8-C64A3C1EF3B7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F978B3BE-22DC-48EA-B004-D9C7FA7B32E8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{27F4E9A2-F450-4519-8358-D13D823DA33F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{3CCA270B-6726-48D0-8523-154B42269D61}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 11993350262154 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlayFx Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", + "m_eventSlotId": { + "m_id": "{3CCA270B-6726-48D0-8523-154B42269D61}" + } + } } } }, @@ -1090,111 +1192,6 @@ } } } - }, - { - "Id": { - "id": 7820402811489 - }, - "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", - "Components": { - "Component_[9263945554457190064]": { - "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 9263945554457190064, - "Slots": [ - { - "id": { - "m_id": "{F22A7438-E72F-4757-90D9-99F03C91E10D}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "EntityId: 0", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 - }, - { - "id": { - "m_id": "{510F56FD-6778-4DB8-BDDE-258335431CC6}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "In", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{94C2AF04-6BFA-4E5A-9490-C7479A7AF61E}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{9C6DDF96-6BF0-45ED-B15F-2E6C2FF5F886}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Event<>", - "DisplayDataType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" - }, - "Descriptor": { - "ConnectionType": 2, - "SlotType": 2 - }, - "DataType": 1 - } - ], - "Datums": [ - { - "scriptCanvasType": { - "m_type": 1 - }, - "isNullPointer": false, - "$type": "EntityId", - "value": { - "id": 2901262558 - }, - "label": "EntityId: 0" - } - ], - "methodType": 2, - "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", - "className": "NetworkTestPlayerComponent", - "resultSlotIDs": [ - {} - ], - "inputSlots": [ - { - "m_id": "{F22A7438-E72F-4757-90D9-99F03C91E10D}" - } - ], - "prettyClassName": "NetworkTestPlayerComponent" - } - } } ], "m_connections": [ @@ -1254,34 +1251,6 @@ } } }, - { - "Id": { - "id": 9392713697629 - }, - "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", - "Components": { - "Component_[17811480012084226596]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17811480012084226596, - "sourceEndpoint": { - "nodeId": { - "id": 56986727032248 - }, - "slotId": { - "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 8400576252253 - }, - "slotId": { - "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" - } - } - } - } - }, { "Id": { "id": 10269167405311 @@ -1366,146 +1335,6 @@ } } }, - { - "Id": { - "id": 9022993654369 - }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", - "Components": { - "Component_[4910818715692868417]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 4910818715692868417, - "sourceEndpoint": { - "nodeId": { - "id": 7820402811489 - }, - "slotId": { - "m_id": "{9C6DDF96-6BF0-45ED-B15F-2E6C2FF5F886}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 8318619017825 - }, - "slotId": { - "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" - } - } - } - } - }, - { - "Id": { - "id": 9078828229217 - }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", - "Components": { - "Component_[16758724763058723803]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 16758724763058723803, - "sourceEndpoint": { - "nodeId": { - "id": 7820402811489 - }, - "slotId": { - "m_id": "{94C2AF04-6BFA-4E5A-9490-C7479A7AF61E}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 8318619017825 - }, - "slotId": { - "m_id": "{2A42C379-8E3B-46EF-BC63-C1D5395CB583}" - } - } - } - } - }, - { - "Id": { - "id": 9808972669537 - }, - "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", - "Components": { - "Component_[597205010205160938]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 597205010205160938, - "sourceEndpoint": { - "nodeId": { - "id": 57012496836024 - }, - "slotId": { - "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 7820402811489 - }, - "slotId": { - "m_id": "{510F56FD-6778-4DB8-BDDE-258335431CC6}" - } - } - } - } - }, - { - "Id": { - "id": 10148275085921 - }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(Print: In)", - "Components": { - "Component_[1594149632687531010]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 1594149632687531010, - "sourceEndpoint": { - "nodeId": { - "id": 8318619017825 - }, - "slotId": { - "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 56995316966840 - }, - "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" - } - } - } - } - }, - { - "Id": { - "id": 10629311423073 - }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", - "Components": { - "Component_[17976200298405988971]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17976200298405988971, - "sourceEndpoint": { - "nodeId": { - "id": 8318619017825 - }, - "slotId": { - "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 57003906901432 - }, - "slotId": { - "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" - } - } - } - } - }, { "Id": { "id": 42045766425613 @@ -1533,6 +1362,174 @@ } } } + }, + { + "Id": { + "id": 13187351170442 + }, + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", + "Components": { + "Component_[16956267859815935178]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16956267859815935178, + "sourceEndpoint": { + "nodeId": { + "id": 11993350262154 + }, + "slotId": { + "m_id": "{F120FEE1-448B-4D61-8439-10511C797707}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 12482976533898 + }, + "slotId": { + "m_id": "{3CCA270B-6726-48D0-8523-154B42269D61}" + } + } + } + } + }, + { + "Id": { + "id": 13243185745290 + }, + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", + "Components": { + "Component_[8562287491617113016]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8562287491617113016, + "sourceEndpoint": { + "nodeId": { + "id": 11993350262154 + }, + "slotId": { + "m_id": "{3FD9A3D0-FFAA-475E-89CB-D24EB4FEB952}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 12482976533898 + }, + "slotId": { + "m_id": "{D9C7482D-62F3-494B-ABD8-DEE1EC423F5B}" + } + } + } + } + }, + { + "Id": { + "id": 14252503059850 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", + "Components": { + "Component_[2852756465133807472]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2852756465133807472, + "sourceEndpoint": { + "nodeId": { + "id": 57012496836024 + }, + "slotId": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 11993350262154 + }, + "slotId": { + "m_id": "{4D460DFD-82A1-4A92-8EAE-D32A96E79FA0}" + } + } + } + } + }, + { + "Id": { + "id": 14690589724042 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Components": { + "Component_[5236071663388486964]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5236071663388486964, + "sourceEndpoint": { + "nodeId": { + "id": 12482976533898 + }, + "slotId": { + "m_id": "{27F4E9A2-F450-4519-8358-D13D823DA33F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57003906901432 + }, + "slotId": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + } + } + } + } + }, + { + "Id": { + "id": 14943992794506 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[3230673372890452861]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3230673372890452861, + "sourceEndpoint": { + "nodeId": { + "id": 12482976533898 + }, + "slotId": { + "m_id": "{27F4E9A2-F450-4519-8358-D13D823DA33F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + } + } + } + } + }, + { + "Id": { + "id": 18109383691658 + }, + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", + "Components": { + "Component_[12099207352632363628]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12099207352632363628, + "sourceEndpoint": { + "nodeId": { + "id": 56986727032248 + }, + "slotId": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 16962627423626 + }, + "slotId": { + "m_id": "{2C322CF8-1A5C-48D4-8CD2-9723E2DD4A4D}" + } + } + } + } } ] }, @@ -1543,37 +1540,6 @@ "_fileVersion": 1 }, "GraphCanvasData": [ - { - "Key": { - "id": 7820402811489 - }, - "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": [ - -100.0, - 400.0 - ] - }, - "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" - }, - "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { - "$type": "PersistentIdComponentSaveData", - "PersistentId": "{F35F8202-B5EE-4ADD-9FF6-AF214A094266}" - } - } - } - }, { "Key": { "id": 8310662318335 @@ -1607,7 +1573,38 @@ }, { "Key": { - "id": 8318619017825 + "id": 11993350262154 + }, + "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": [ + -120.0, + 340.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{AF658C01-E781-416E-B719-70C171E3FA18}" + } + } + } + }, + { + "Key": { + "id": 12482976533898 }, "Value": { "ComponentData": { @@ -1622,7 +1619,7 @@ "$type": "GeometrySaveData", "Position": [ 340.0, - 400.0 + 360.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1631,14 +1628,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{67499699-CA73-48B4-87E0-C66F4A3EA7CB}" + "PersistentId": "{404C56EB-23C4-4AC8-A08A-752725B19703}" } } } }, { "Key": { - "id": 8400576252253 + "id": 16962627423626 }, "Value": { "ComponentData": { @@ -1652,8 +1649,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 420.0, - -60.0 + 440.0, + -40.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1662,7 +1659,7 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" + "PersistentId": "{E06094C1-8911-4FB6-9D28-E02B808F1DB1}" } } } @@ -1880,15 +1877,16 @@ }, { "Key": { - "id": 1685762441320719908 + "id": 7369225496155711251 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "AnchorX": -349.0, - "AnchorY": 10.0 + "Scale": 0.7585823890144868, + "AnchorX": -205.64674377441406, + "AnchorY": -467.9781799316406 } } } @@ -1897,6 +1895,10 @@ ], "StatisticsHelper": { "InstanceCounter": [ + { + "Key": 435784057388502002, + "Value": 1 + }, { "Key": 4199610336680704683, "Value": 1 @@ -1905,18 +1907,14 @@ "Key": 4847610523576971761, "Value": 1 }, + { + "Key": 5317247366618270757, + "Value": 1 + }, { "Key": 6462358712820489356, "Value": 1 }, - { - "Key": 7087687843968394353, - "Value": 1 - }, - { - "Key": 8679770052035517025, - "Value": 1 - }, { "Key": 10684225535275896474, "Value": 3 From c36b2fbbd6f65c050a05530b40b927628b27b924 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 27 Jan 2022 15:22:47 -0600 Subject: [PATCH 315/394] SurfaceData cleanups to prepare for bulk APIs (#7166) * Initial cleanup of GetSurfacePointsFromRegion in prep for bulk API support. * Removed the generated lookup point from the output structure. Nothing was using it, and by keeping it separate, I can pass it in as a list of points that can be passed throughout the terrain, gradient, and surface data APIs. * Clarified on the SurfaceProvider bus that GetSurfacePoints() only gets valid XY values on the inPosition. * Simplified the TerrainSurfaceDataSystemComponent implementation a bit. The EnumerateHandlers() and the terrain Aabb checks were overkill. Also, the terrain Aabb check assumed that the Z value on the inPosition was valid, which it isn't always. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove CryCommon dependency. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/SurfaceData/Code/CMakeLists.txt | 6 +- .../SurfaceDataProviderRequestBus.h | 4 ++ .../SurfaceData/SurfaceDataSystemRequestBus.h | 2 +- .../Include/SurfaceData/SurfaceDataTypes.h | 2 +- .../SurfaceData/Tests/SurfaceDataTestMocks.h | 2 +- .../Source/SurfaceDataSystemComponent.cpp | 48 +++++++------ .../Code/Source/SurfaceDataSystemComponent.h | 4 +- .../Code/Tests/SurfaceDataTest.cpp | 68 +++++-------------- .../TerrainSurfaceDataSystemComponent.cpp | 63 ++++++++--------- .../Code/Source/AreaSystemComponent.cpp | 4 +- Gems/Vegetation/Code/Tests/VegetationMocks.h | 2 +- 11 files changed, 87 insertions(+), 118 deletions(-) diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index 54363d265e..860053ca42 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -18,9 +18,10 @@ ly_add_target( Include BUILD_DEPENDENCIES PRIVATE - Legacy::CryCommon Gem::LmbrCentral PUBLIC + AZ::AzCore + AZ::AzFramework Gem::Atom_RPI.Public Gem::Atom_Feature_Common.Static ) @@ -37,7 +38,6 @@ ly_add_target( Include BUILD_DEPENDENCIES PRIVATE - Legacy::CryCommon Gem::SurfaceData.Static Gem::LmbrCentral RUNTIME_DEPENDENCIES @@ -66,7 +66,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Include BUILD_DEPENDENCIES PRIVATE - Legacy::CryCommon AZ::AzToolsFramework Gem::SurfaceData.Static Gem::LmbrCentral.Editor @@ -97,7 +96,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - Legacy::CryCommon Gem::SurfaceData.Static Gem::LmbrCentral ) diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataProviderRequestBus.h b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataProviderRequestBus.h index c6b9ba3390..b3c8667679 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataProviderRequestBus.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataProviderRequestBus.h @@ -30,6 +30,10 @@ namespace SurfaceData //! allows multiple threads to call using MutexType = AZStd::recursive_mutex; + //! Get all of the surface points that this provider has at the given input position. + //! @param inPosition - The input position to query. Only XY are guaranteed to be valid, Z should be ignored. + //! @param surfacePointList - The output list of surface points generated, if any. Each provider is expected to + //! append to this list, not overwrite it. virtual void GetSurfacePoints(const AZ::Vector3& inPosition, SurfacePointList& surfacePointList) const = 0; }; diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h index 709650f428..8dd3e02a53 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h @@ -39,7 +39,7 @@ namespace SurfaceData // The input positions are chosen by starting at the min sides of inRegion and incrementing by stepSize. This method is inclusive // on the min sides of the AABB, and exclusive on the max sides (i.e. for a box of (0,0) - (4,4), the point (0,0) is included but (4,4) isn't). virtual void GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, - SurfacePointListPerPosition& surfacePointListPerPosition) const = 0; + SurfacePointLists& surfacePointLists) const = 0; virtual SurfaceDataRegistryHandle RegisterSurfaceDataProvider(const SurfaceDataRegistryEntry& entry) = 0; virtual void UnregisterSurfaceDataProvider(const SurfaceDataRegistryHandle& handle) = 0; diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataTypes.h b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataTypes.h index 0adc208962..6d39efaa9f 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataTypes.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataTypes.h @@ -34,7 +34,7 @@ namespace SurfaceData }; using SurfacePointList = AZStd::vector; - using SurfacePointListPerPosition = AZStd::vector>; + using SurfacePointLists = AZStd::vector; struct SurfaceDataRegistryEntry { diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h b/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h index 11171215f7..5e8acdc4c5 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h @@ -200,7 +200,7 @@ namespace UnitTest } void GetSurfacePointsFromRegion([[maybe_unused]] const AZ::Aabb& inRegion, [[maybe_unused]] const AZ::Vector2 stepSize, [[maybe_unused]] const SurfaceData::SurfaceTagVector& desiredTags, - [[maybe_unused]] SurfaceData::SurfacePointListPerPosition& surfacePointListPerPosition) const override + [[maybe_unused]] SurfaceData::SurfacePointLists& surfacePointListPerPosition) const override { } diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp index 9038d2f082..9c53b13fdc 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp @@ -195,12 +195,11 @@ namespace SurfaceData { const AZ::u32 entryAddress = entryPair.first; const SurfaceDataRegistryEntry& entry = entryPair.second; - AZ::Vector3 point2d(inPosition.GetX(), inPosition.GetY(), entry.m_bounds.GetMax().GetZ()); - if (!entry.m_bounds.IsValid() || entry.m_bounds.Contains(point2d)) + if (!entry.m_bounds.IsValid() || AabbContains2D(entry.m_bounds, inPosition)) { if (!hasDesiredTags || hasModifierTags || HasMatchingTags(desiredTags, entry.m_tags)) { - SurfaceDataProviderRequestBus::Event(entryAddress, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, point2d, surfacePointList); + SurfaceDataProviderRequestBus::Event(entryAddress, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, inPosition, surfacePointList); } } } @@ -212,8 +211,7 @@ namespace SurfaceData { const AZ::u32 entryAddress = entryPair.first; const SurfaceDataRegistryEntry& entry = entryPair.second; - AZ::Vector3 point2d(inPosition.GetX(), inPosition.GetY(), entry.m_bounds.GetMax().GetZ()); - if (!entry.m_bounds.IsValid() || entry.m_bounds.Contains(point2d)) + if (!entry.m_bounds.IsValid() || AabbContains2D(entry.m_bounds, inPosition)) { SurfaceDataModifierRequestBus::Event(entryAddress, &SurfaceDataModifierRequestBus::Events::ModifySurfacePoints, surfacePointList); } @@ -227,12 +225,19 @@ namespace SurfaceData } } - void SurfaceDataSystemComponent::GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, SurfacePointListPerPosition& surfacePointListPerPosition) const + void SurfaceDataSystemComponent::GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, + const SurfaceTagVector& desiredTags, SurfacePointLists& surfacePointLists) const { AZStd::lock_guard registrationLock(m_registrationMutex); - surfacePointListPerPosition.clear(); - surfacePointListPerPosition.reserve(aznumeric_cast(ceil(inRegion.GetXExtent() / stepSize.GetX())) * aznumeric_cast(ceil(inRegion.GetYExtent() / stepSize.GetY()))); + const size_t totalQueryPositions = aznumeric_cast(ceil(inRegion.GetXExtent() / stepSize.GetX())) * + aznumeric_cast(ceil(inRegion.GetYExtent() / stepSize.GetY())); + + AZStd::vector inPositions; + inPositions.reserve(totalQueryPositions); + + surfacePointLists.clear(); + surfacePointLists.reserve(totalQueryPositions); // Initialize our list-per-position list with every input position to query from the region. // This is inclusive on the min sides of inRegion, and exclusive on the max sides. @@ -240,7 +245,8 @@ namespace SurfaceData { for (float x = inRegion.GetMin().GetX(); x < inRegion.GetMax().GetX(); x += stepSize.GetX()) { - surfacePointListPerPosition.emplace_back(AZ::Vector3(x, y, AZ::Constants::FloatMax), SurfaceData::SurfacePointList{}); + inPositions.emplace_back(AZ::Vector3(x, y, AZ::Constants::FloatMax)); + surfacePointLists.emplace_back(SurfaceData::SurfacePointList{}); } } @@ -259,14 +265,14 @@ namespace SurfaceData ( alwaysApplies || AabbOverlaps2D(entry.m_bounds, inRegion) ) ) { - for (auto& surfacePointListAndPoint : surfacePointListPerPosition) + for (size_t index = 0; index < totalQueryPositions; index++) { - const auto& point2d = surfacePointListAndPoint.first; - SurfacePointList& surfacePointList = surfacePointListAndPoint.second; - AZ::Vector3 point3d(point2d.GetX(), point2d.GetY(), entry.m_bounds.GetMax().GetZ()); - if (alwaysApplies || entry.m_bounds.Contains(point3d)) + const auto& inPosition = inPositions[index]; + SurfacePointList& surfacePointList = surfacePointLists[index]; + if (alwaysApplies || AabbContains2D(entry.m_bounds, inPosition)) { - SurfaceDataProviderRequestBus::Event(entryPair.first, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, point3d, surfacePointList); + SurfaceDataProviderRequestBus::Event( + entryPair.first, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, inPosition, surfacePointList); } } } @@ -284,14 +290,13 @@ namespace SurfaceData if (alwaysApplies || AabbOverlaps2D(entry.m_bounds, inRegion)) { - for (auto& surfacePointListAndPoint : surfacePointListPerPosition) + for (size_t index = 0; index < totalQueryPositions; index++) { - const auto& point2d = surfacePointListAndPoint.first; - SurfacePointList& surfacePointList = surfacePointListAndPoint.second; + const auto& inPosition = inPositions[index]; + SurfacePointList& surfacePointList = surfacePointLists[index]; if (!surfacePointList.empty()) { - AZ::Vector3 point3d(point2d.GetX(), point2d.GetY(), entry.m_bounds.GetMax().GetZ()); - if (alwaysApplies || entry.m_bounds.Contains(point3d)) + if (alwaysApplies || AabbContains2D(entry.m_bounds, inPosition)) { SurfaceDataModifierRequestBus::Event(entryPair.first, &SurfaceDataModifierRequestBus::Events::ModifySurfacePoints, surfacePointList); } @@ -304,9 +309,8 @@ namespace SurfaceData // same XY coordinates and extremely similar Z values. This produces results that are sorted in decreasing Z order. // Also, this filters out any remaining points that don't match the desired tag list. This can happen when a surface provider // doesn't add a desired tag, and a surface modifier has the *potential* to add it, but then doesn't. - for (auto& surfacePointListAndPoint : surfacePointListPerPosition) + for (auto& surfacePointList : surfacePointLists) { - auto& surfacePointList = surfacePointListAndPoint.second; if (!surfacePointList.empty()) { CombineSortAndFilterNeighboringPoints(surfacePointList, hasDesiredTags, desiredTags); diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h index 70c20b9643..c329103efb 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h @@ -39,7 +39,9 @@ namespace SurfaceData //////////////////////////////////////////////////////////////////////// // SurfaceDataSystemRequestBus implementation void GetSurfacePoints(const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags, SurfacePointList& surfacePointList) const override; - void GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, SurfacePointListPerPosition& surfacePointListPerPosition) const override; + void GetSurfacePointsFromRegion( + const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, + SurfacePointLists& surfacePointListPerPosition) const override; SurfaceDataRegistryHandle RegisterSurfaceDataProvider(const SurfaceDataRegistryEntry& entry) override; void UnregisterSurfaceDataProvider(const SurfaceDataRegistryHandle& handle) override; diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 9d182312a4..177abd3824 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -7,9 +7,6 @@ */ #include -#include -#include -#include #include #include @@ -26,28 +23,6 @@ #include #include -struct MockGlobalEnvironment -{ - MockGlobalEnvironment() - { - m_stubEnv.pCryPak = &m_stubPak; - m_stubEnv.pConsole = &m_stubConsole; - m_stubEnv.pSystem = &m_stubSystem; - gEnv = &m_stubEnv; - } - - ~MockGlobalEnvironment() - { - gEnv = nullptr; - } - -private: - SSystemGlobalEnvironment m_stubEnv; - testing::NiceMock m_stubPak; - testing::NiceMock m_stubConsole; - testing::NiceMock m_stubSystem; -}; - // Simple class for mocking out a surface provider, so that we can control exactly what points we expect to query in our tests. // This can be used to either provide a surface or modify a surface. class MockSurfaceProvider @@ -210,8 +185,6 @@ TEST(SurfaceDataTest, ComponentsWithComponentApplication) appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; appDesc.m_stackRecordLevels = 20; - MockGlobalEnvironment mocks; - AZ::ComponentApplication app; AZ::Entity* systemEntity = app.Create(appDesc); ASSERT_TRUE(systemEntity != nullptr); @@ -259,18 +232,17 @@ public: m_application.Destroy(); } - bool ValidateRegionListSize(AZ::Aabb bounds, AZ::Vector2 stepSize, const SurfaceData::SurfacePointListPerPosition& outputList) + bool ValidateRegionListSize(AZ::Aabb bounds, AZ::Vector2 stepSize, const SurfaceData::SurfacePointLists& outputLists) { // We expect the output list to contain width * height output entries. // The right edge of the AABB should be treated as exclusive, so a 4x4 box with 1 step size will produce 16 entries (0, 1, 2, 3 on each dimension), // but a 4.1 x 4.1 box with 1 step size will produce 25 entries (0, 1, 2, 3, 4 on each dimension). - return (outputList.size() == aznumeric_cast(ceil(bounds.GetXExtent() * stepSize.GetX()) * ceil(bounds.GetYExtent() * stepSize.GetY()))); + return (outputLists.size() == aznumeric_cast(ceil(bounds.GetXExtent() * stepSize.GetX()) * ceil(bounds.GetYExtent() * stepSize.GetY()))); } AZ::ComponentApplication m_application; AZ::Entity* m_systemEntity; - MockGlobalEnvironment m_mocks; // Test Surface Data tags that we can use for testing query functionality const AZ::Crc32 m_testSurface1Crc = AZ::Crc32("test_surface1"); @@ -501,7 +473,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion) // Query for all the surface points from (0, 0, 16) - (4, 4, 16) with a step size of 1. // Note that the Z range is deliberately chosen to be outside the surface provider range to demonstrate // that it is ignored when selecting points. - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(1.0f, 1.0f); AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f, 0.0f, 16.0f), AZ::Vector3(4.0f, 4.0f, 16.0f)); SurfaceData::SurfaceTagVector testTags = providerTags; @@ -513,19 +485,15 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion) EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); // We expect every entry in the output list to have two surface points, at heights 0 and 4, sorted in - // decreasing height order. The XY positions should match the query positions, and the masks list should - // be the same size as the set of masks the provider owns. We *could* check every mask as well for completeness, - // but that seems like overkill. - for (auto& queryPosition : availablePointsPerPosition) + // decreasing height order. The masks list should be the same size as the set of masks the provider owns. + // We *could* check every mask as well for completeness, but that seems like overkill. + for (auto& pointList : availablePointsPerPosition) { - const SurfaceData::SurfacePointList& pointList = queryPosition.second; EXPECT_TRUE(pointList.size() == 2); EXPECT_TRUE(pointList[0].m_position.GetZ() == 4.0f); EXPECT_TRUE(pointList[1].m_position.GetZ() == 0.0f); for (auto& point : pointList) { - EXPECT_TRUE(queryPosition.first.GetX() == point.m_position.GetX()); - EXPECT_TRUE(queryPosition.first.GetY() == point.m_position.GetY()); EXPECT_TRUE(point.m_masks.size() == providerTags.size()); } } @@ -543,7 +511,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_NoMatchingMas // Query for all the surface points from (0, 0, 0) - (4, 4, 4) with a step size of 1. // We only include a surface tag that does NOT exist in the surface provider. - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(1.0f, 1.0f); AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(4.0f)); SurfaceData::SurfaceTagVector testTags = { SurfaceData::SurfaceTag(m_testSurfaceNoMatchCrc) }; @@ -558,7 +526,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_NoMatchingMas // any of the masks from our mock surface provider. for (auto& queryPosition : availablePointsPerPosition) { - EXPECT_TRUE(queryPosition.second.size() == 0); + EXPECT_TRUE(queryPosition.size() == 0); } } @@ -573,7 +541,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_NoMatchingReg AZ::Vector3(0.0f), AZ::Vector3(8.0f), AZ::Vector3(0.25f, 0.25f, 4.0f)); // Query for all the surface points from (16, 16) - (20, 20) with a step size of 1. - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(1.0f, 1.0f); AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(16.0f), AZ::Vector3(20.0f)); SurfaceData::SurfaceTagVector testTags = providerTags; @@ -586,9 +554,8 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_NoMatchingReg // We expect every entry in the output list to have no surface points, since the input points don't overlap with // our surface provider. - for (auto& queryPosition : availablePointsPerPosition) + for (auto& pointList : availablePointsPerPosition) { - const SurfaceData::SurfacePointList& pointList = queryPosition.second; EXPECT_TRUE(pointList.size() == 0); } } @@ -626,7 +593,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_ProviderModif for (auto& tagTest : tagTests) { - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(1.0f, 1.0f); AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(4.0f)); SurfaceData::SurfaceTagVector testTags = tagTest; @@ -639,9 +606,8 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_ProviderModif // We expect every entry in the output list to have two surface points (with heights 0 and 4), // and each point should have both the "test_surface1" and "test_surface2" tag. - for (auto& queryPosition : availablePointsPerPosition) + for (auto& pointList : availablePointsPerPosition) { - const SurfaceData::SurfacePointList& pointList = queryPosition.second; EXPECT_TRUE(pointList.size() == 2); for (auto& point : pointList) { @@ -673,7 +639,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_SimilarPoints // Query for all the surface points from (0, 0) - (4, 4) with a step size of 1. - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(1.0f, 1.0f); AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(4.0f)); SurfaceData::SurfaceTagVector testTags = { SurfaceData::SurfaceTag(m_testSurface1Crc), SurfaceData::SurfaceTag(m_testSurface2Crc) }; @@ -686,9 +652,8 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_SimilarPoints // We expect every entry in the output list to have two surface points, not four. The two points // should have both surface tags on them. - for (auto& queryPosition : availablePointsPerPosition) + for (auto& pointList : availablePointsPerPosition) { - const SurfaceData::SurfacePointList& pointList = queryPosition.second; EXPECT_TRUE(pointList.size() == 2); for (auto& point : pointList) { @@ -718,7 +683,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_DissimilarPoi // Query for all the surface points from (0, 0) - (4, 4) with a step size of 1. - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(1.0f, 1.0f); AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(4.0f)); SurfaceData::SurfaceTagVector testTags = { SurfaceData::SurfaceTag(m_testSurface1Crc), SurfaceData::SurfaceTag(m_testSurface2Crc) }; @@ -731,9 +696,8 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_DissimilarPoi // We expect every entry in the output list to have four surface points with one tag each, // because the points are far enough apart that they won't merge. - for (auto& queryPosition : availablePointsPerPosition) + for (auto& pointList : availablePointsPerPosition) { - const SurfaceData::SurfacePointList& pointList = queryPosition.second; EXPECT_TRUE(pointList.size() == 4); for (auto& point : pointList) { diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index dbaae0118a..03011db2f3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -146,41 +146,38 @@ namespace Terrain void TerrainSurfaceDataSystemComponent::GetSurfacePoints( const AZ::Vector3& inPosition, SurfaceData::SurfacePointList& surfacePointList) const { - if (m_terrainBoundsIsValid) + if (!m_terrainBoundsIsValid) { - auto enumerationCallback = [&](AzFramework::Terrain::TerrainDataRequests* terrain) -> bool - { - if (terrain->GetTerrainAabb().Contains(inPosition)) - { - bool isTerrainValidAtPoint = false; - AzFramework::SurfaceData::SurfacePoint terrainSurfacePoint; - terrain->GetSurfacePoint( - inPosition, terrainSurfacePoint, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR, - &isTerrainValidAtPoint); - - const bool isHole = !isTerrainValidAtPoint; - - SurfaceData::SurfacePoint point; - point.m_entityId = GetEntityId(); - point.m_position = terrainSurfacePoint.m_position; - point.m_normal = terrainSurfacePoint.m_normal; - - // Always add a "terrain" or "terrainHole" tag. - const AZ::Crc32 terrainTag = isHole ? Constants::s_terrainHoleTagCrc : Constants::s_terrainTagCrc; - SurfaceData::AddMaxValueForMasks(point.m_masks, terrainTag, 1.0f); - - // Add all of the surface tags that the terrain has at this point. - for (auto& tag : terrainSurfacePoint.m_surfaceTags) - { - SurfaceData::AddMaxValueForMasks(point.m_masks, tag.m_surfaceType, tag.m_weight); - } - surfacePointList.push_back(point); - } - // Only one handler should exist. - return false; - }; - AzFramework::Terrain::TerrainDataRequestBus::EnumerateHandlers(enumerationCallback); + return; } + + bool isTerrainValidAtPoint = false; + AzFramework::SurfaceData::SurfacePoint terrainSurfacePoint; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequestBus::Events::GetSurfacePoint, + inPosition, terrainSurfacePoint, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR, + &isTerrainValidAtPoint); + + const bool isHole = !isTerrainValidAtPoint; + + SurfaceData::SurfacePoint point; + point.m_entityId = GetEntityId(); + point.m_position = terrainSurfacePoint.m_position; + point.m_normal = terrainSurfacePoint.m_normal; + + // Preallocate enough space for all of our terrain's surface tags, plus the default "terrain" / "terrainHole" tag. + point.m_masks.reserve(terrainSurfacePoint.m_surfaceTags.size() + 1); + + // Add all of the surface tags that the terrain has at this point. + for (auto& tag : terrainSurfacePoint.m_surfaceTags) + { + point.m_masks[tag.m_surfaceType] = tag.m_weight; + } + + // Always add a "terrain" or "terrainHole" tag. + const AZ::Crc32 terrainTag = isHole ? Constants::s_terrainHoleTagCrc : Constants::s_terrainTagCrc; + point.m_masks[terrainTag] = 1.0f; + + surfacePointList.push_back(point); } AZ::Aabb TerrainSurfaceDataSystemComponent::GetSurfaceAabb() const diff --git a/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp b/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp index e497fcec12..9cd9c1a7cb 100644 --- a/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp +++ b/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp @@ -1099,7 +1099,7 @@ namespace Vegetation // 0 = lower left corner, 0.5 = center const float texelOffset = (sectorPointSnapMode == SnapMode::Center) ? 0.5f : 0.0f; - SurfaceData::SurfacePointListPerPosition availablePointsPerPosition; + SurfaceData::SurfacePointLists availablePointsPerPosition; AZ::Vector2 stepSize(vegStep, vegStep); AZ::Vector3 regionOffset(texelOffset * vegStep, texelOffset * vegStep, 0.0f); AZ::Aabb regionBounds = sectorInfo.m_bounds; @@ -1127,7 +1127,7 @@ namespace Vegetation uint claimIndex = 0; for (auto& availablePoints : availablePointsPerPosition) { - for (auto& surfacePoint : availablePoints.second) + for (auto& surfacePoint : availablePoints) { sectorInfo.m_baseContext.m_availablePoints.push_back(); ClaimPoint& claimPoint = sectorInfo.m_baseContext.m_availablePoints.back(); diff --git a/Gems/Vegetation/Code/Tests/VegetationMocks.h b/Gems/Vegetation/Code/Tests/VegetationMocks.h index a3bd80392d..8a8bfe6b76 100644 --- a/Gems/Vegetation/Code/Tests/VegetationMocks.h +++ b/Gems/Vegetation/Code/Tests/VegetationMocks.h @@ -341,7 +341,7 @@ namespace UnitTest } void GetSurfacePointsFromRegion([[maybe_unused]] const AZ::Aabb& inRegion, [[maybe_unused]] const AZ::Vector2 stepSize, [[maybe_unused]] const SurfaceData::SurfaceTagVector& desiredTags, - [[maybe_unused]] SurfaceData::SurfacePointListPerPosition& surfacePointListPerPosition) const override + [[maybe_unused]] SurfaceData::SurfacePointLists& surfacePointListPerPosition) const override { } From cc1e86ccdecd776b7d2fe53ca65a9d7027db6d47 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Thu, 27 Jan 2022 13:26:01 -0800 Subject: [PATCH 316/394] Fix failing scene compilations on Linux (#7187) * -Moved substitution of '.' to '_' in the relativeSourcePath AFTER the relativeSourcePath is computed * Update PrefabeBehaviorTests to support updates for this fix Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- .../PrefabGroup/PrefabBehaviorTests.cpp | 30 +++++++++++++++---- .../PrefabGroup/PrefabGroupBehavior.cpp | 2 +- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabBehaviorTests.cpp b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabBehaviorTests.cpp index 631c6a1596..7187bdf081 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabBehaviorTests.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabBehaviorTests.cpp @@ -138,14 +138,17 @@ namespace UnitTest return true; } - AZStd::shared_ptr CreateMockScene() + AZStd::shared_ptr CreateMockScene( + const AZStd::string manifestFilename = "ManifestFilename", + const AZStd::string sourceFileName = "Source", + const AZStd::string watchFolder = "WatchFolder") { using namespace AZ::SceneAPI; auto scene = AZStd::make_shared("mock_scene"); - scene->SetManifestFilename("ManifestFilename"); - scene->SetSource("Source", AZ::Uuid::CreateRandom()); - scene->SetWatchFolder("WatchFolder"); + scene->SetManifestFilename(manifestFilename); + scene->SetSource(sourceFileName, AZ::Uuid::CreateRandom()); + scene->SetWatchFolder(watchFolder); /*---------------------------------------\ Root @@ -319,18 +322,35 @@ namespace UnitTest using namespace AZ::SceneAPI; using namespace AZ::SceneAPI::Events; - auto scene = CreateMockScene(); + #if AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS + auto scene = CreateMockScene("Manifest", "C:/o3de/watch.folder/manifest_src_file.xml", "C:/o3de/watch.folder"); + #else + auto scene = CreateMockScene("Manifest", "//o3de/watch.folder/manifest_src_file.xml", "//o3de/watch.folder"); + #endif AssetImportRequest::ManifestAction action = AssetImportRequest::ManifestAction::ConstructDefault; AssetImportRequest::RequestingApplication requester = {}; Behaviors::PrefabGroupBehavior prefabGroupBehavior; ProcessingResult result = ProcessingResult::Failure; AssetImportRequestBus::BroadcastResult(result, &AssetImportRequestBus::Events::UpdateManifest, *scene, action, requester); + EXPECT_EQ(result, ProcessingResult::Success); EXPECT_EQ(scene->GetManifest().GetEntryCount(), 3); + EXPECT_TRUE(azrtti_istypeof(scene->GetManifest().GetValue(0).get())); EXPECT_TRUE(azrtti_istypeof(scene->GetManifest().GetValue(1).get())); EXPECT_TRUE(azrtti_istypeof(scene->GetManifest().GetValue(2).get())); + + // The mesh group names are expected to be just the file name relative to the watch folder and not any absolute path + for (size_t i = 0; i < scene->GetManifest().GetEntryCount(); i++) + { + if (azrtti_istypeof(scene->GetManifest().GetValue(i).get())) + { + AZ::SceneAPI::DataTypes::IMeshGroup* meshGroup = reinterpret_cast(scene->GetManifest().GetValue(i).get()); + AZStd::string groupName = meshGroup->GetName(); + EXPECT_TRUE(groupName.starts_with("manifest_src_file_xml")); + } + } } TEST_F(PrefabBehaviorTests, PrefabBehavior_UpdateManifest_ToggleWorks) diff --git a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp index 292d7a2822..6bd8f0d049 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp @@ -400,10 +400,10 @@ namespace AZ::SceneAPI::Behaviors // compute the filenames of the scene file AZStd::string relativeSourcePath = scene.GetSourceFilename(); - AZ::StringFunc::Replace(relativeSourcePath, ".", "_"); // the watch folder and forward slash is used to in the asset hint path of the file AZStd::string watchFolder = scene.GetWatchFolder() + "/"; AZ::StringFunc::Replace(relativeSourcePath, watchFolder.c_str(), ""); + AZ::StringFunc::Replace(relativeSourcePath, ".", "_"); AZStd::string filenameOnly{ relativeSourcePath }; AZ::StringFunc::Path::GetFileName(filenameOnly.c_str(), filenameOnly); AZ::StringFunc::Path::ReplaceExtension(filenameOnly, "prefab"); From 7946886126e784371a855f0b5eeef883eb7b9391 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 27 Jan 2022 15:33:23 -0600 Subject: [PATCH 317/394] TerrainDetailMaterialManager to use ClipmapBounds for its detail mateiral id texture. (#7182) * Switching TerrainDetailMaterialManager to use ClipmapBounds for its detail mateiral id texture. This results in a lot of code removal and some simplifications for the shader. Signed-off-by: Ken Pruiksma * Changing some names to be clearer Signed-off-by: Ken Pruiksma * Reducing the update multiple back to 1 since this texture is updated purely on the CPU Signed-off-by: Ken Pruiksma * Updates from PR review Signed-off-by: Ken Pruiksma --- .../Terrain/TerrainDetailHelpers.azsli | 19 +- .../Terrain/TerrainPBR_ForwardPass.azsl | 11 +- .../Assets/Shaders/Terrain/TerrainSrg.azsli | 4 +- .../Source/TerrainRenderer/ClipmapBounds.h | 1 + .../TerrainDetailMaterialManager.cpp | 363 +++++------------- .../TerrainDetailMaterialManager.h | 21 +- 6 files changed, 116 insertions(+), 303 deletions(-) diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli index b18f2885db..b566b727ff 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli @@ -274,25 +274,20 @@ instance, if detailMaterialIdUv falls perfectly in-between all 4 samples, then e Each sample can have two different detail materials defined with a blend value to determine their relative contribution. The detailUv is used for sampling the textures of each detail material. */ -bool GetDetailSurface(inout DetailSurface surface, float2 detailMaterialIdUv, float2 detailUv) +bool GetDetailSurface(inout DetailSurface surface, float2 detailMaterialIdCoord, float2 detailUv) { float2 textureSize; TerrainSrg::m_detailMaterialIdImage.GetDimensions(textureSize.x, textureSize.y); - float2 detailMaterialIdCoord = detailMaterialIdUv * textureSize; // uv -> pixel coordinate - - // detailMaterialIdCoord could be negative, so add textureSize to ensure it is positive - detailMaterialIdCoord += textureSize; - // The detail material id texture wraps since the "center" point can be anywhere in the texture, so mod by texturesize - int2 detailMaterailIdTopLeft = int2(detailMaterialIdCoord) % textureSize; - int2 detailMaterailIdBottomRight = (int2(detailMaterialIdCoord) + 1) % textureSize; + int2 detailMaterialIdTopLeft = ((int2(detailMaterialIdCoord) % textureSize) + textureSize) % textureSize; + int2 detailMaterialIdBottomRight = (detailMaterialIdTopLeft + 1) % textureSize; // Using Load() to gather the nearest 4 samples (Gather4() isn't used because of precision issues with uvs). - uint4 s1 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterailIdTopLeft.x, detailMaterailIdBottomRight.y, 0)); - uint4 s2 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterailIdBottomRight, 0)); - uint4 s3 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterailIdBottomRight.x, detailMaterailIdTopLeft.y, 0)); - uint4 s4 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterailIdTopLeft, 0)); + uint4 s1 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterialIdTopLeft.x, detailMaterialIdBottomRight.y, 0)); + uint4 s2 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterialIdBottomRight, 0)); + uint4 s3 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterialIdBottomRight.x, detailMaterialIdTopLeft.y, 0)); + uint4 s4 = TerrainSrg::m_detailMaterialIdImage.Load(int3(detailMaterialIdTopLeft, 0)); uint4 material1 = uint4(s1.x, s2.x, s3.x, s4.x); uint4 material2 = uint4(s1.y, s2.y, s3.y, s4.y); diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl index 741f45d775..c9c3e0ab00 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl @@ -143,16 +143,13 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) // ------- Base Color ------- DetailSurface detailSurface = GetDefaultDetailSurface(); - float2 detailRegionMin = TerrainSrg::m_detailAabb.xy; - float2 detailRegionMax = TerrainSrg::m_detailAabb.zw; - float2 detailRegionUv = (surface.position.xy - detailRegionMin) / (detailRegionMax - detailRegionMin); + float2 detailRegionCoord = surface.position.xy * TerrainSrg::m_detailMaterialIdScale; bool hasDetailSurface = false; - // Check to make sure we're inside the detail texture's bounds and within where detail textures should be drawn. - if (detailFactor < 1.0 && all(detailRegionUv > TerrainSrg::m_detailHalfPixelUv) && all(detailRegionUv < 1.0 - TerrainSrg::m_detailHalfPixelUv)) + // Only sample detail textures if inside where detail materials should be drawn. + if (detailFactor < 1.0) { - detailRegionUv += TerrainSrg::m_detailMaterialIdImageCenter - 0.5; - hasDetailSurface = GetDetailSurface(detailSurface, detailRegionUv, detailUv); + hasDetailSurface = GetDetailSurface(detailSurface, detailRegionCoord, detailUv); } const float macroRoughness = 1.0; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli index 3fcf8d75ca..bbf060a1ec 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli @@ -81,9 +81,7 @@ ShaderResourceGroup TerrainSrg : SRG_Terrain MacroMaterialGrid m_macroMaterialGrid; Texture2D m_textures[]; // bindless array of all textures for detail and macro materials - float2 m_detailMaterialIdImageCenter; - float m_detailHalfPixelUv; - float4 m_detailAabb; + float m_detailMaterialIdScale; } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h b/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h index 1aac4d8c9e..7c11f4b3a5 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/ClipmapBounds.h @@ -89,6 +89,7 @@ namespace Terrain { public: + ClipmapBounds() = default; explicit ClipmapBounds(const ClipmapBoundsDescriptor& desc); ~ClipmapBounds() = default; diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp index 1f43b476a1..96b363d8c6 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp @@ -62,9 +62,7 @@ namespace Terrain { static const char* const DetailMaterialIdImage("m_detailMaterialIdImage"); static const char* const DetailMaterialData("m_detailMaterialData"); - static const char* const DetailMaterialIdImageCenter("m_detailMaterialIdImageCenter"); - static const char* const DetailHalfPixelUv("m_detailHalfPixelUv"); - static const char* const DetailAabb("m_detailAabb"); + static const char* const DetailMaterialScale("m_detailMaterialIdScale"); } AZ_CVAR(bool, @@ -98,6 +96,14 @@ namespace Terrain { return; } + + ClipmapBoundsDescriptor desc; + desc.m_clipmapUpdateMultiple = 1; + desc.m_clipToWorldScale = DetailTextureScale; + desc.m_size = DetailTextureSize; + // Initialize world space to a value that won't match the initial camera position. + desc.m_worldSpaceCenter = AZ::Vector2(AZStd::numeric_limits::max(), 0.0f); + m_detailMaterialIdBounds = ClipmapBounds(desc); if (UpdateSrgIndices(terrainSrg)) { @@ -144,14 +150,8 @@ namespace Terrain m_detailMaterialIdPropertyIndex = terrainSrgLayout->FindShaderInputImageIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImage)); AZ_Error(TerrainDetailMaterialManagerName, m_detailMaterialIdPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImage); - m_detailCenterPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImageCenter)); - AZ_Error(TerrainDetailMaterialManagerName, m_detailCenterPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImageCenter); - - m_detailHalfPixelUvPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailHalfPixelUv)); - AZ_Error(TerrainDetailMaterialManagerName, m_detailHalfPixelUvPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailHalfPixelUv); - - m_detailAabbPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailAabb)); - AZ_Error(TerrainDetailMaterialManagerName, m_detailAabbPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailAabb); + m_detailScalePropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailMaterialScale)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailScalePropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialScale); // Set up the gpu buffer for detail material data AZ::Render::GpuBufferHandler::Descriptor desc; @@ -163,9 +163,7 @@ namespace Terrain bool IndicesValid = m_detailMaterialIdPropertyIndex.IsValid() && - m_detailCenterPropertyIndex.IsValid() && - m_detailHalfPixelUvPropertyIndex.IsValid() && - m_detailAabbPropertyIndex.IsValid(); + m_detailScalePropertyIndex.IsValid(); m_detailImageNeedsUpdate = true; m_detailMaterialBufferNeedsUpdate = true; @@ -214,9 +212,6 @@ namespace Terrain m_detailMaterialDataBuffer.Release(); m_dirtyDetailRegion = AZ::Aabb::CreateNull(); - m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); - m_detailTextureBounds = {}; - m_detailTextureCenter = {}; m_detailMaterialBufferNeedsUpdate = false; m_detailImageNeedsUpdate = false; @@ -234,54 +229,19 @@ namespace Terrain m_detailMaterialBufferNeedsUpdate = false; m_detailMaterialDataBuffer.UpdateBuffer(m_detailMaterialShaderData.GetRawData(), aznumeric_cast(m_detailMaterialShaderData.GetSize())); } + + CheckUpdateDetailTexture(cameraPosition); - if (m_dirtyDetailRegion.IsValid() || !cameraPosition.IsClose(m_previousCameraPosition) || m_detailImageNeedsUpdate) + if (m_detailImageNeedsUpdate) { - if (r_terrainDebugDetailImageUpdates) - { - AZ_Printf("TerrainDetailMaterialManager", "Previous Camera: (%f, %f, %f) New Cameara: (%f, %f, %f)", - m_previousCameraPosition.GetX(), m_previousCameraPosition.GetY(), m_previousCameraPosition.GetZ(), - cameraPosition.GetX(), cameraPosition.GetY(), cameraPosition.GetZ()); - } - int32_t newDetailTexturePosX = aznumeric_cast(AZStd::roundf(cameraPosition.GetX() / DetailTextureScale)); - int32_t newDetailTexturePosY = aznumeric_cast(AZStd::roundf(cameraPosition.GetY() / DetailTextureScale)); - - Aabb2i newBounds; - newBounds.m_min.m_x = newDetailTexturePosX - DetailTextureSizeHalf; - newBounds.m_min.m_y = newDetailTexturePosY - DetailTextureSizeHalf; - newBounds.m_max.m_x = newDetailTexturePosX + DetailTextureSizeHalf; - newBounds.m_max.m_y = newDetailTexturePosY + DetailTextureSizeHalf; - - // Use modulo to find the center point in texture space. Care must be taken so negative values are - // handled appropriately (ie, we want -1 % 1024 to equal 1023, not -1) - Vector2i newCenter; - newCenter.m_x = (DetailTextureSize + (newDetailTexturePosX % DetailTextureSize)) % DetailTextureSize; - newCenter.m_y = (DetailTextureSize + (newDetailTexturePosY % DetailTextureSize)) % DetailTextureSize; - - CheckUpdateDetailTexture(newBounds, newCenter); - - m_detailTextureBounds = newBounds; - m_dirtyDetailRegion = AZ::Aabb::CreateNull(); - - m_previousCameraPosition = cameraPosition; - - AZ::Vector4 detailAabb = AZ::Vector4( - m_detailTextureBounds.m_min.m_x * DetailTextureScale, - m_detailTextureBounds.m_min.m_y * DetailTextureScale, - m_detailTextureBounds.m_max.m_x * DetailTextureScale, - m_detailTextureBounds.m_max.m_y * DetailTextureScale - ); - AZ::Vector2 detailUvOffset = AZ::Vector2(float(newCenter.m_x) / DetailTextureSize, float(newCenter.m_y) / DetailTextureSize); - - terrainSrg->SetConstant(m_detailAabbPropertyIndex, detailAabb); - terrainSrg->SetConstant(m_detailHalfPixelUvPropertyIndex, 0.5f / DetailTextureSize); - terrainSrg->SetConstant(m_detailCenterPropertyIndex, detailUvOffset); + terrainSrg->SetConstant(m_detailScalePropertyIndex, 1.0f / DetailTextureScale); terrainSrg->SetImage(m_detailMaterialIdPropertyIndex, m_detailTextureImage); m_detailMaterialDataBuffer.UpdateSrg(terrainSrg.get()); + + m_detailImageNeedsUpdate = false; } - - m_detailImageNeedsUpdate = false; + } void TerrainDetailMaterialManager::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) @@ -591,15 +551,13 @@ namespace Terrain m_detailMaterialBufferNeedsUpdate = true; } - void TerrainDetailMaterialManager::CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter) + void TerrainDetailMaterialManager::CheckUpdateDetailTexture(const AZ::Vector3& cameraPosition) { - if (r_terrainDebugDetailImageUpdates) - { - AZ_Printf("TerrainDetailMaterialManager", "Old Bounds: m(%i, %i)M(%i, %i) New Bounds: m(%i, %i)M(%i, %i)", - m_detailTextureBounds.m_min.m_x, m_detailTextureBounds.m_min.m_y, m_detailTextureBounds.m_max.m_x, m_detailTextureBounds.m_max.m_y, - newBounds.m_min.m_x, newBounds.m_min.m_y, newBounds.m_max.m_x, newBounds.m_max.m_y - ); - } + + AZ::Aabb untouchedRegion = AZ::Aabb::CreateNull(); + ClipmapBounds::ClipmapBoundsRegionList edgeUpdatedRegions = + m_detailMaterialIdBounds.UpdateCenter(AZ::Vector2(cameraPosition.GetX(), cameraPosition.GetY()), &untouchedRegion); + if (!m_detailTextureImage) { // If the m_detailTextureImage doesn't exist, create it and populate the entire texture @@ -611,111 +569,36 @@ namespace Terrain const AZ::Name TerrainDetailName = AZ::Name(TerrainDetailChars); m_detailTextureImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainDetailName, nullptr, nullptr); AZ_Error(TerrainDetailMaterialManagerName, m_detailTextureImage, "Failed to initialize the detail texture image."); - - UpdateDetailTexture(newBounds, newBounds, newCenter); + + ClipmapBounds::ClipmapBoundsRegionList updateRegions = m_detailMaterialIdBounds.TransformRegion(m_detailMaterialIdBounds.GetWorldBounds()); + for (auto& region : updateRegions) + { + UpdateDetailTexture(region.m_worldAabb, region.m_localAabb); + } } else { - // If the new bounds of the detail texture are different than the old bounds, then the edges of the texture need to be updated. - - int32_t offsetX = m_detailTextureBounds.m_min.m_x - newBounds.m_min.m_x; - - // Horizontal edge update - if (newBounds.m_min.m_x != m_detailTextureBounds.m_min.m_x) + // Update the edge regions + for (auto& region : edgeUpdatedRegions) { - Aabb2i updateBounds; - if (newBounds.m_min.m_x < m_detailTextureBounds.m_min.m_x) - { - updateBounds.m_min.m_x = newBounds.m_min.m_x; - updateBounds.m_max.m_x = m_detailTextureBounds.m_min.m_x; - } - else - { - updateBounds.m_min.m_x = m_detailTextureBounds.m_max.m_x; - updateBounds.m_max.m_x = newBounds.m_max.m_x; - } - updateBounds.m_min.m_y = newBounds.m_min.m_y; - updateBounds.m_max.m_y = newBounds.m_max.m_y; - - if (r_terrainDebugDetailImageUpdates) - { - AZ_Printf("TerrainDetailMaterialManager", "Updating horizontal edge: m(%i, %i)M(%i, %i)", - updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); - } - UpdateDetailTexture(updateBounds, newBounds, newCenter); + UpdateDetailTexture(region.m_worldAabb, region.m_localAabb); } - // Vertical edge update - if (newBounds.m_min.m_y != m_detailTextureBounds.m_min.m_y) - { - Aabb2i updateBounds; - // Don't update areas that have already been updated in the horizontal update. - updateBounds.m_min.m_x = newBounds.m_min.m_x + AZ::GetMax(0, offsetX); - updateBounds.m_max.m_x = newBounds.m_max.m_x + AZ::GetMin(0, offsetX); - if (newBounds.m_min.m_y < m_detailTextureBounds.m_min.m_y) - { - updateBounds.m_min.m_y = newBounds.m_min.m_y; - updateBounds.m_max.m_y = m_detailTextureBounds.m_min.m_y; - } - else - { - updateBounds.m_min.m_y = m_detailTextureBounds.m_max.m_y; - updateBounds.m_max.m_y = newBounds.m_max.m_y; - } - - if (r_terrainDebugDetailImageUpdates) - { - AZ_Printf("TerrainDetailMaterialManager", "Updating vertical edge: m(%i, %i)M(%i, %i)", - updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); - } - UpdateDetailTexture(updateBounds, newBounds, newCenter); - } + m_dirtyDetailRegion = m_dirtyDetailRegion.GetClamped(untouchedRegion); if (m_dirtyDetailRegion.IsValid()) { - if (r_terrainDebugDetailImageUpdates) + ClipmapBounds::ClipmapBoundsRegionList updateRegions = m_detailMaterialIdBounds.TransformRegion(m_dirtyDetailRegion); + for (auto& region : updateRegions) { - AZ_Printf("TerrainDetailMaterialManager", "m_dirtyDetailRegion: m(%f, %f)M(%f, %f)", - m_dirtyDetailRegion.GetMin().GetX(), m_dirtyDetailRegion.GetMin().GetY(), m_dirtyDetailRegion.GetMax().GetX(), m_dirtyDetailRegion.GetMax().GetY()); - } - // If any regions are marked as dirty, then they should be updated. - - AZ::Vector3 currentMin = AZ::Vector3(newBounds.m_min.m_x * DetailTextureScale, newBounds.m_min.m_y * DetailTextureScale, -0.5f); - AZ::Vector3 currentMax = AZ::Vector3(newBounds.m_max.m_x * DetailTextureScale, newBounds.m_max.m_y * DetailTextureScale, 0.5f); - AZ::Aabb detailTextureCoverage = AZ::Aabb::CreateFromMinMax(currentMin, currentMax); - AZ::Vector3 previousMin = AZ::Vector3(m_detailTextureBounds.m_min.m_x * DetailTextureScale, m_detailTextureBounds.m_min.m_y * DetailTextureScale, -0.5f); - AZ::Vector3 previousMax = AZ::Vector3(m_detailTextureBounds.m_max.m_x * DetailTextureScale, m_detailTextureBounds.m_max.m_y * DetailTextureScale, 0.5f); - AZ::Aabb previousCoverage = AZ::Aabb::CreateFromMinMax(previousMin, previousMax); - - // Area of texture not already updated by camera movement above. - AZ::Aabb clampedCoverage = previousCoverage.GetClamped(detailTextureCoverage); - - // Clamp the dirty region to the area of the detail texture that is visible and not already updated. - clampedCoverage.Clamp(m_dirtyDetailRegion); - - if (clampedCoverage.IsValid()) - { - Aabb2i updateBounds; - updateBounds.m_min.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetX() / DetailTextureScale)); - updateBounds.m_min.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetY() / DetailTextureScale)); - updateBounds.m_max.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetX() / DetailTextureScale)); - updateBounds.m_max.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetY() / DetailTextureScale)); - if (updateBounds.m_min.m_x < updateBounds.m_max.m_x && updateBounds.m_min.m_y < updateBounds.m_max.m_y) - { - - if (r_terrainDebugDetailImageUpdates) - { - AZ_Printf("TerrainDetailMaterialManager", "Updating dirty region: m(%i, %i)M(%i, %i)", - updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); - } - UpdateDetailTexture(updateBounds, newBounds, newCenter); - } + UpdateDetailTexture(region.m_worldAabb, region.m_localAabb); } } + m_dirtyDetailRegion = AZ::Aabb::CreateNull(); } } - void TerrainDetailMaterialManager::UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel) + void TerrainDetailMaterialManager::UpdateDetailTexture(const AZ::Aabb& worldUpdateAabb, const Aabb2i& textureUpdateAabb) { if (!m_detailTextureImage) { @@ -729,129 +612,77 @@ namespace Terrain uint8_t m_blend{ 0 }; // 0 = full weight on material1, 255 = full weight on material2 uint8_t m_padding{ 0 }; }; + + const int32_t width = textureUpdateAabb.m_max.m_x - textureUpdateAabb.m_min.m_x; + const int32_t height = textureUpdateAabb.m_max.m_y - textureUpdateAabb.m_min.m_y; - // Because the center of the detail texture may be offset, each update area may actually need to be split into - // up to 4 separate update areas in each sector of the quadrant. - AZStd::array textureSpaceAreas; - AZStd::array scaledWorldSpaceAreas; - uint8_t updateAreaCount = CalculateUpdateRegions(updateArea, textureBounds, centerPixel, textureSpaceAreas, scaledWorldSpaceAreas); + AZStd::vector pixels(width * height); + uint32_t index = 0; - if (updateAreaCount > 0) + auto perPositionCallback = [this, &pixels, &index]( + [[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, + [[maybe_unused]] bool terrainExists) { - m_detailImageNeedsUpdate = true; - } - - // Pull the data for each area updated and use it to construct an update for the detail material id texture. - for (uint8_t i = 0; i < updateAreaCount; ++i) - { - const Aabb2i& quadrantTextureArea = textureSpaceAreas[i]; - const Aabb2i& quadrantWorldArea = scaledWorldSpaceAreas[i]; - - AZStd::vector pixels; - pixels.resize((quadrantWorldArea.m_max.m_x - quadrantWorldArea.m_min.m_x) * (quadrantWorldArea.m_max.m_y - quadrantWorldArea.m_min.m_y)); - uint32_t index = 0; - - auto perPositionCallback = [this, &pixels, &index]( - [[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, - const AzFramework::SurfaceData::SurfacePoint& surfacePoint, - [[maybe_unused]] bool terrainExists) + // Store the top two surface weights in the texture with m_blend storing the relative weight. + bool isFirstMaterial = true; + float firstWeight = 0.0f; + AZ::Vector2 position(surfacePoint.m_position.GetX(), surfacePoint.m_position.GetY()); + for (const auto& surfaceTagWeight : surfacePoint.m_surfaceTags) { - // Store the top two surface weights in the texture with m_blend storing the relative weight. - bool isFirstMaterial = true; - float firstWeight = 0.0f; - AZ::Vector2 position(surfacePoint.m_position.GetX(), surfacePoint.m_position.GetY()); - for (const auto& surfaceTagWeight : surfacePoint.m_surfaceTags) + if (surfaceTagWeight.m_weight > 0.0f) { - if (surfaceTagWeight.m_weight > 0.0f) + AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; + uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); + if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) { - AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; - uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); - if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) + if (isFirstMaterial) { - if (isFirstMaterial) - { - pixels.at(index).m_material1 = aznumeric_cast(materialId); - firstWeight = surfaceTagWeight.m_weight; - // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. - isFirstMaterial = false; - } - else - { - pixels.at(index).m_material2 = aznumeric_cast(materialId); - float totalWeight = firstWeight + surfaceTagWeight.m_weight; - float blendWeight = 1.0f - (firstWeight / totalWeight); - pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); - break; - } + pixels.at(index).m_material1 = aznumeric_cast(materialId); + firstWeight = surfaceTagWeight.m_weight; + // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. + isFirstMaterial = false; + } + else + { + pixels.at(index).m_material2 = aznumeric_cast(materialId); + float totalWeight = firstWeight + surfaceTagWeight.m_weight; + float blendWeight = 1.0f - (firstWeight / totalWeight); + pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); + break; } } - else - { - break; // since the list is ordered, no other materials are in the list with positive weights. - } } - ++index; - }; - - AZ::Vector3 worldMin(quadrantWorldArea.m_min.m_x * DetailTextureScale, quadrantWorldArea.m_min.m_y * DetailTextureScale, 0.0f); - AZ::Vector3 worldMax(quadrantWorldArea.m_max.m_x * DetailTextureScale, quadrantWorldArea.m_max.m_y * DetailTextureScale, 0.0f); - AZ::Vector2 stepSize(DetailTextureScale); - AZ::Aabb region; - region.Set(worldMin, worldMax); - - AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, - region, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); - - const int32_t left = quadrantTextureArea.m_min.m_x; - const int32_t top = quadrantTextureArea.m_min.m_y; - const int32_t width = quadrantTextureArea.m_max.m_x - quadrantTextureArea.m_min.m_x; - const int32_t height = quadrantTextureArea.m_max.m_y - quadrantTextureArea.m_min.m_y; - - AZ::RHI::ImageUpdateRequest imageUpdateRequest; - imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); - imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = width * sizeof(DetailMaterialPixel); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = width * height * sizeof(DetailMaterialPixel); - imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = height; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = width; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = height; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; - imageUpdateRequest.m_sourceData = pixels.data(); - imageUpdateRequest.m_image = m_detailTextureImage->GetRHIImage(); - - m_detailTextureImage->UpdateImageContents(imageUpdateRequest); - } - } - - uint8_t TerrainDetailMaterialManager::CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, - AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas) - { - Vector2i centerOffset = { centerPixel.m_x - DetailTextureSizeHalf, centerPixel.m_y - DetailTextureSizeHalf }; - - int32_t quadrantXOffset = centerPixel.m_x < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; - int32_t quadrantYOffset = centerPixel.m_y < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; - - uint8_t numQuadrants = 0; - - // For each of the 4 quadrants: - auto calculateQuadrant = [&](Vector2i quadrantOffset) - { - Aabb2i offsetUpdateArea = updateArea + centerOffset + quadrantOffset; - Aabb2i updateSectionBounds = textureBounds.GetClamped(offsetUpdateArea); - if (updateSectionBounds.IsValid()) - { - textureSpaceAreas[numQuadrants] = updateSectionBounds - textureBounds.m_min; - scaledWorldSpaceAreas[numQuadrants] = updateSectionBounds - centerOffset - quadrantOffset; - ++numQuadrants; + else + { + break; // since the list is ordered, no other materials are in the list with positive weights. + } } + ++index; }; + + AZ::Vector2 stepSize(DetailTextureScale); + AZ::Aabb offsetWorldAabb = worldUpdateAabb.GetTranslated(AZ::Vector3(DetailTextureScale * 0.5f)); // offset by half a pixel - calculateQuadrant({ 0, 0 }); - calculateQuadrant({ quadrantXOffset, 0 }); - calculateQuadrant({ 0, quadrantYOffset }); - calculateQuadrant({ quadrantXOffset, quadrantYOffset }); + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, + offsetWorldAabb, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); - return numQuadrants; + const int32_t left = textureUpdateAabb.m_min.m_x; + const int32_t top = textureUpdateAabb.m_min.m_y; + + AZ::RHI::ImageUpdateRequest imageUpdateRequest; + imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); + imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = width * sizeof(DetailMaterialPixel); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = width * height * sizeof(DetailMaterialPixel); + imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = height; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = width; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = height; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; + imageUpdateRequest.m_sourceData = pixels.data(); + imageUpdateRequest.m_image = m_detailTextureImage->GetRHIImage(); + + m_detailTextureImage->UpdateImageContents(imageUpdateRequest); } uint16_t TerrainDetailMaterialManager::GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position) diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h index 98f2c26dd8..667b1b2e85 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -178,22 +179,16 @@ namespace Terrain //! Updates a specific detail material with settings from a material instance void UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material); - //! Checks to see if the detail material id texture needs to update based on new center and bounds. Any + //! Checks to see if the detail material id texture needs to update based on the camera position. Any //! required updates are then executed. - void CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter); + void CheckUpdateDetailTexture(const AZ::Vector3& cameraPosition); //! Updates the detail texture in a given area - void UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel); + void UpdateDetailTexture(const AZ::Aabb& worldUpdateAabb, const Aabb2i& textureUpdateAabb); //! Finds the detail material Id for a surface type and position uint16_t GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position); - //! Calculates which regions of the detail material id texture need to be updated based on the update area. Since - //! the "center" of the detail material id texture can move, a single update region in contiguous world space may - //! map to up to 4 different areas on teh detail material id texture. - uint8_t CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, - AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas); - DetailMaterialListRegion* FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); DetailMaterialListRegion& FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); void RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); @@ -208,15 +203,11 @@ namespace Terrain AZ::Render::GpuBufferHandler m_detailMaterialDataBuffer; AZ::Aabb m_dirtyDetailRegion{ AZ::Aabb::CreateNull() }; - AZ::Vector3 m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); - Aabb2i m_detailTextureBounds; - Vector2i m_detailTextureCenter; + ClipmapBounds m_detailMaterialIdBounds; AZ::RHI::ShaderInputImageIndex m_detailMaterialIdPropertyIndex; AZ::RHI::ShaderInputBufferIndex m_detailMaterialDataIndex; - AZ::RHI::ShaderInputConstantIndex m_detailCenterPropertyIndex; - AZ::RHI::ShaderInputConstantIndex m_detailAabbPropertyIndex; - AZ::RHI::ShaderInputConstantIndex m_detailHalfPixelUvPropertyIndex; + AZ::RHI::ShaderInputConstantIndex m_detailScalePropertyIndex; bool m_isInitialized{ false }; bool m_detailMaterialBufferNeedsUpdate{ false }; From 5e2bf1a46822a613d4db7ae8736c77f96345b99d Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 27 Jan 2022 14:14:50 -0800 Subject: [PATCH 318/394] Reverted changes to most of the material type files. I'll update those in a separate PR. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Special/ShadowCatcher.materialtype | 58 +- .../Materials/Types/EnhancedPBR.materialtype | 2763 +++++++++-------- .../Assets/Materials/Types/Skin.materialtype | 1846 +++++------ .../Materials/Types/StandardPBR.materialtype | 1907 ++++++------ .../Materials/Types/AutoBrick.materialtype | 327 +- 5 files changed, 3456 insertions(+), 3445 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype index 973f8b2147..d05f03c9a9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Special/ShadowCatcher.materialtype @@ -2,40 +2,38 @@ "description": "Base material for the reflection probe visualization model.", "version": 1, "propertyLayout": { - "propertySets": [ - { - "name": "settings", - "properties": [ - { - "name": "opacity", - "displayName": "Opacity", - "description": "Opacity of the shadow effect.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacity" - } - }, - { - "name": "shadeAll", - "displayName": "Shade All", - "description": "Shades the entire geometry with the shadow color, not just what's in shadow. For debugging.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_shadeAll" - } + "properties": { + "settings": [ + { + "name": "opacity", + "displayName": "Opacity", + "description": "Opacity of the shadow effect.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacity" } - ] - } - ] + }, + { + "name": "shadeAll", + "displayName": "Shade All", + "description": "Shades the entire geometry with the shadow color, not just what's in shadow. For debugging.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_shadeAll" + } + } + ] + } }, "shaders": [ { "file": "ShadowCatcher.shader" } ] -} \ No newline at end of file +} + diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index a6af04fb89..eee9a0fc88 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -10,1453 +10,1456 @@ } ], "propertyLayout": { - "propertySets": [ + "groups": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", - "properties": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ] + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not.", - "properties": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ] + "description": "Properties for configuring whether the surface is metallic or not." }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears.", - "properties": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ] + "description": "Properties for configuring how rough the surface appears." }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", - "properties": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ] + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal.", - "properties": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ] + "description": "Properties related to configuring surface normal." }, { "name": "detailLayerGroup", "displayName": "Detail Layer", - "description": "Properties for Fine Details Layer.", - "properties": [ - { - "name": "enableDetailLayer", - "displayName": "Enable Detail Layer", - "description": "Enable detail layer for fine details and scratches", - "type": "Bool", - "defaultValue": false - }, - { - "name": "blendDetailFactor", - "displayName": "Blend Factor", - "description": "Scales the overall impact of the detail layer.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendFactor" - } - }, - { - "name": "blendDetailMask", - "displayName": "Blend Mask", - "description": "Detailed blend mask for application of the detail maps.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_texture" - } - }, - { - "name": "enableDetailMaskTexture", - "displayName": " Use Texture", - "description": "Enable detail blend mask", - "type": "Bool", - "defaultValue": true - }, - { - "name": "blendDetailMaskUv", - "displayName": " Blend Mask UV", - "description": "Which UV set to use for sampling the detail blend mask", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_uvIndex" - } - }, - { - "name": "textureMapUv", - "displayName": "Detail Map UVs", - "description": "Which UV set to use for detail map sampling", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_detail_allMapsUvIndex" - } - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color", - "description": "Enable detail blending for base color", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorDetailMap", - "displayName": " Texture", - "description": "Detailed Base Color Texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_texture" - } - }, - { - "name": "baseColorDetailBlend", - "displayName": " Blend Factor", - "description": "How much to blend the detail layer into the base color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_factor" - } - }, - { - "name": "enableNormals", - "displayName": "Enable Normal", - "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalDetailStrength", - "displayName": " Factor", - "description": "Strength factor for scaling the Detail Normal", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_factor" - } - }, - { - "name": "normalDetailMap", - "displayName": " Texture", - "description": "Detailed Normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_texture" - } - }, - { - "name": "normalDetailFlipX", - "displayName": " Flip X Channel", - "description": "Flip Detail tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipX" - } - }, - { - "name": "normalDetailFlipY", - "displayName": " Flip Y Channel", - "description": "Flip Detail bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipY" - } - } - ] + "description": "Properties for Fine Details Layer." }, { "name": "detailUV", "displayName": "Detail Layer UV", - "description": "Properties for modifying detail layer UV.", - "properties": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] + "description": "Properties for modifying detail layer UV." }, { "name": "anisotropy", "displayName": "Anisotropic Material Response", - "description": "How much is this material response anisotropic.", - "properties": [ - { - "name": "enableAnisotropy", - "displayName": "Enable Anisotropy", - "description": "Enable anisotropic surface response for non uniform reflection along the axis", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableAnisotropy" - } - }, - { - "name": "factor", - "displayName": "Anisotropy Factor", - "description": "Strength factor for the anisotropy: negative = along v, positive = along u", - "type": "Float", - "defaultValue": 0.0, - "min": -0.95, - "max": 0.95, - "connection": { - "type": "ShaderInput", - "name": "m_anisotropicFactor" - } - }, - { - "name": "anisotropyAngle", - "displayName": "Anisotropy Angle", - "description": "Anisotropy direction of major reflection axis: 0 = 0 degrees, 1.0 = 180 degrees", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_anisotropicAngle" - } - } - ] + "description": "How much is this material response anisotropic." }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light.", - "properties": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ] + "description": "Properties for baked textures that represent geometric occlusion of light." }, { "name": "emissive", "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene.", - "properties": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ] + "description": "Properties to add light emission, independent of other lights in the scene." }, { "name": "subsurfaceScattering", "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects.", - "properties": [ - { - "name": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableSubsurfaceScattering" - } - }, - { - "name": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Texture for controlling the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the influence map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "name": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "name": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringQuality" - } - }, - { - "name": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "name": "o_transmission_mode" - } - }, - { - "name": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "name": "thicknessMap", - "displayName": " Thickness Map", - "description": "Texture for controlling per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMap" - } - }, - { - "name": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMapUvIndex" - } - }, - { - "name": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light traveling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "name": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "name": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ] + "description": "Properties for configuring subsurface scattering effects." }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat", - "properties": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ] - }, + "description": "Properties for configuring gloss clear coat" + }, { "name": "parallax", "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map.", - "properties": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ] + "description": "Properties for parallax effect produced by a height map." }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency.", - "properties": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ] + "description": "Properties for configuring the materials transparency." }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms.", - "properties": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] + "description": "Properties for configuring UV transforms." }, { // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination.", - "properties": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] + "description": "Properties for configuring the irradiance used in global illumination." }, { "name": "general", "displayName": "General Settings", - "description": "General settings.", - "properties": [ - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ] + "description": "General settings." } - ] + ], + "properties": { + "general": [ + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ], + "baseColor": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ], + "metallic": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ], + "roughness": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ], + "anisotropy": [ + { + "name": "enableAnisotropy", + "displayName": "Enable Anisotropy", + "description": "Enable anisotropic surface response for non uniform reflection along the axis", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableAnisotropy" + } + }, + { + "name": "factor", + "displayName": "Anisotropy Factor", + "description": "Strength factor for the anisotropy: negative = along v, positive = along u", + "type": "Float", + "defaultValue": 0.0, + "min": -0.95, + "max": 0.95, + "connection": { + "type": "ShaderInput", + "name": "m_anisotropicFactor" + } + }, + { + "name": "anisotropyAngle", + "displayName": "Anisotropy Angle", + "description": "Anisotropy direction of major reflection axis: 0 = 0 degrees, 1.0 = 180 degrees", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_anisotropicAngle" + } + } + ], + "specularF0": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ], + "clearCoat": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ], + "normal": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ], + "opacity": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ], + "uv": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ], + "occlusion": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ], + "emissive": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ], + "parallax": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ], + "subsurfaceScattering": [ + { + "name": "enableSubsurfaceScattering", + "displayName": "Subsurface Scattering", + "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableSubsurfaceScattering" + } + }, + { + "name": "subsurfaceScatterFactor", + "displayName": " Factor", + "description": "Strength factor for scaling percentage of subsurface scattering effect applied", + "type": "float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Texture for controlling the strength of subsurface scattering", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Influence Map", + "description": "Whether to use the influence map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, + { + "name": "scatterColor", + "displayName": " Scatter color", + "description": "Color of volume light traveled through", + "type": "Color", + "defaultValue": [ 1.0, 0.27, 0.13 ] + }, + { + "name": "scatterDistance", + "displayName": " Scatter distance", + "description": "How far light traveled inside the volume", + "type": "float", + "defaultValue": 8, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "quality", + "displayName": " Quality", + "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", + "type": "float", + "defaultValue": 0.4, + "min": 0.2, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringQuality" + } + }, + { + "name": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "name": "o_transmission_mode" + } + }, + { + "name": "thickness", + "displayName": " Thickness", + "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "type": "float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0 + }, + { + "name": "thicknessMap", + "displayName": " Thickness Map", + "description": "Texture for controlling per pixel thickness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMap" + } + }, + { + "name": "useThicknessMap", + "displayName": " Use Thickness Map", + "description": "Whether to use the thickness map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMapUvIndex" + } + }, + { + "name": "transmissionTint", + "displayName": " Transmission Tint", + "description": "Color of the volume light traveling through", + "type": "Color", + "defaultValue": [ 1.0, 0.8, 0.6 ] + }, + { + "name": "transmissionPower", + "displayName": " Power", + "description": "How much transmitted light scatter radially ", + "type": "float", + "defaultValue": 6.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionDistortion", + "displayName": " Distortion", + "description": "How much light direction distorted towards surface normal", + "type": "float", + "defaultValue": 0.1, + "min": 0.0, + "max": 1.0 + }, + { + "name": "transmissionAttenuation", + "displayName": " Attenuation", + "description": "How fast transmitted light fade with thickness", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionScale", + "displayName": " Scale", + "description": "Strength of transmission", + "type": "float", + "defaultValue": 3.0, + "min": 0.0, + "softMax": 20.0 + } + ], + "detailLayerGroup": [ + { + "name": "enableDetailLayer", + "displayName": "Enable Detail Layer", + "description": "Enable detail layer for fine details and scratches", + "type": "Bool", + "defaultValue": false + }, + { + "name": "blendDetailFactor", + "displayName": "Blend Factor", + "description": "Scales the overall impact of the detail layer.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendFactor" + } + }, + { + "name": "blendDetailMask", + "displayName": "Blend Mask", + "description": "Detailed blend mask for application of the detail maps.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_texture" + } + }, + { + "name": "enableDetailMaskTexture", + "displayName": " Use Texture", + "description": "Enable detail blend mask", + "type": "Bool", + "defaultValue": true + }, + { + "name": "blendDetailMaskUv", + "displayName": " Blend Mask UV", + "description": "Which UV set to use for sampling the detail blend mask", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_uvIndex" + } + }, + { + "name": "textureMapUv", + "displayName": "Detail Map UVs", + "description": "Which UV set to use for detail map sampling", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_detail_allMapsUvIndex" + } + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color", + "description": "Enable detail blending for base color", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorDetailMap", + "displayName": " Texture", + "description": "Detailed Base Color Texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_texture" + } + }, + { + "name": "baseColorDetailBlend", + "displayName": " Blend Factor", + "description": "How much to blend the detail layer into the base color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_factor" + } + }, + { + "name": "enableNormals", + "displayName": "Enable Normal", + "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalDetailStrength", + "displayName": " Factor", + "description": "Strength factor for scaling the Detail Normal", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_factor" + } + }, + { + "name": "normalDetailMap", + "displayName": " Texture", + "description": "Detailed Normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_texture" + } + }, + { + "name": "normalDetailFlipX", + "displayName": " Flip X Channel", + "description": "Flip Detail tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipX" + } + }, + { + "name": "normalDetailFlipY", + "displayName": " Flip Y Channel", + "description": "Flip Detail bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipY" + } + } + ], + "detailUV": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ], + "irradiance": [ + // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] + } }, "shaders": [ { @@ -1684,4 +1687,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 6366bddff0..15eaf94df6 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -2,968 +2,970 @@ "description": "Material Type tailored for rendering skin, with support for blended wrinkle maps that work with animated vertex blend shapes.", "version": 3, "propertyLayout": { - "propertySets": [ + "groups": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", - "properties": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ] + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears.", - "properties": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ] + "description": "Properties for configuring how rough the surface appears." }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", - "properties": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ] + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal.", - "properties": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ] + "description": "Properties related to configuring surface normal." }, { "name": "detailLayerGroup", "displayName": "Detail Layer", - "description": "Properties for Fine Details Layer.", - "properties": [ - { - "name": "enableDetailLayer", - "displayName": "Enable Detail Layer", - "description": "Enable detail layer for fine details and scratches", - "type": "Bool", - "defaultValue": false - }, - { - "name": "blendDetailFactor", - "displayName": "Blend Factor", - "description": "Scales the overall impact of the detail layer.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendFactor" - } - }, - { - "name": "blendDetailMask", - "displayName": "Blend Mask", - "description": "Detailed blend mask for application of the detail maps.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_texture" - } - }, - { - "name": "enableDetailMaskTexture", - "displayName": " Use Texture", - "description": "Enable detail blend mask", - "type": "Bool", - "defaultValue": true - }, - { - "name": "blendDetailMaskUv", - "displayName": " Blend Mask UV", - "description": "Which UV set to use for sampling the detail blend mask", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_detail_blendMask_uvIndex" - } - }, - { - "name": "textureMapUv", - "displayName": "Detail Map UVs", - "description": "Which UV set to use for detail map sampling", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_detail_allMapsUvIndex" - } - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color", - "description": "Enable detail blending for base color", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorDetailMap", - "displayName": " Texture", - "description": "Detailed Base Color Texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_texture" - } - }, - { - "name": "baseColorDetailBlend", - "displayName": " Blend Factor", - "description": "How much to blend the detail layer into the base color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_baseColor_factor" - } - }, - { - "name": "enableNormals", - "displayName": "Enable Normal", - "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalDetailStrength", - "displayName": " Factor", - "description": "Strength factor for scaling the Detail Normal", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_factor" - } - }, - { - "name": "normalDetailMap", - "displayName": " Texture", - "description": "Detailed Normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_texture" - } - }, - { - "name": "normalDetailFlipX", - "displayName": " Flip X Channel", - "description": "Flip Detail tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipX" - } - }, - { - "name": "normalDetailFlipY", - "displayName": " Flip Y Channel", - "description": "Flip Detail bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_detail_normal_flipY" - } - } - ] + "description": "Properties for Fine Details Layer." }, { "name": "detailUV", "displayName": "Detail Layer UV", - "description": "Properties for modifying detail layer UV.", - "properties": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] + "description": "Properties for modifying detail layer UV." }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light.", - "properties": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ] + "description": "Properties for baked textures that represent geometric occlusion of light." }, { "name": "subsurfaceScattering", "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects.", - "properties": [ - { - "name": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_enableSubsurfaceScattering" - } - }, - { - "name": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Texture for controlling the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the influence map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "name": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "name": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_subsurfaceScatteringQuality" - } - }, - { - "name": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "name": "o_transmission_mode" - } - }, - { - "name": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "name": "thicknessMap", - "displayName": " Thickness Map", - "description": "Texture for controlling per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMap" - } - }, - { - "name": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Unwrapped", - "connection": { - "type": "ShaderInput", - "name": "m_transmissionThicknessMapUvIndex" - } - }, - { - "name": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light traveling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "name": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "name": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "name": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ] + "description": "Properties for configuring subsurface scattering effects." }, { "name": "wrinkleLayers", "displayName": "Wrinkle Layers", - "description": "Properties for wrinkle maps to support morph animation, using vertex color blend weights.", - "properties": [ - { - "name": "enable", - "displayName": "Enable Wrinkle Layers", - "description": "Enable wrinkle layers for morph animations, using vertex color blend weights.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "count", - "displayName": "Number Of Layers", - "description": "The number of wrinkle map layers to use. The blend values come from the 'COLOR0' vertex stream, where R/G/B/A correspond to wrinkle layers 1/2/3/4 respectively.", - "type": "UInt", - "defaultValue": 4, - "min": 1, - "max": 4 - }, - { - "name": "showBlendValues", - "displayName": "Show Blend Values", - "description": "Enable a debug mode that draws the blend values as red, green, blue, and white overlays.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "enableBaseColor", - "displayName": "Enable Base Color Maps", - "description": "Enable support for blending the base color according to morph animations.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "baseColorMap1", - "displayName": " Base Color 1", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture1" - } - }, - { - "name": "baseColorMap2", - "displayName": " Base Color 2", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture2" - } - }, - { - "name": "baseColorMap3", - "displayName": " Base Color 3", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture3" - } - }, - { - "name": "baseColorMap4", - "displayName": " Base Color 4", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_baseColor_texture4" - } - }, - { - "name": "enableNormal", - "displayName": "Enable Normal Maps", - "description": "Enable support for blending the normal maps according to morph animations.", - "type": "Bool", - "defaultValue": false - }, - { - "name": "normalMap1", - "displayName": " Normals 1", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture1" - } - }, - { - "name": "normalMap2", - "displayName": " Normals 2", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture2" - } - }, - { - "name": "normalMap3", - "displayName": " Normals 3", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture3" - } - }, - { - "name": "normalMap4", - "displayName": " Normals 4", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_wrinkle_normal_texture4" - } - } - ] + "description": "Properties for wrinkle maps to support morph animation, using vertex color blend weights." }, { "name": "general", "displayName": "General Settings", - "description": "General settings.", - "properties": [ - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - } - ] + "description": "General settings." } - ] + ], + "properties": { + "general": [ + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + } + ], + "baseColor": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ], + "roughness": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ], + "specularF0": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ], + "normal": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ], + "occlusion": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ], + "subsurfaceScattering": [ + { + "name": "enableSubsurfaceScattering", + "displayName": "Subsurface Scattering", + "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_enableSubsurfaceScattering" + } + }, + { + "name": "subsurfaceScatterFactor", + "displayName": " Factor", + "description": "Strength factor for scaling percentage of subsurface scattering effect applied", + "type": "float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Texture for controlling the strength of subsurface scattering", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Influence Map", + "description": "Whether to use the influence map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, + { + "name": "scatterColor", + "displayName": " Scatter color", + "description": "Color of volume light traveled through", + "type": "Color", + "defaultValue": [ 1.0, 0.27, 0.13 ] + }, + { + "name": "scatterDistance", + "displayName": " Scatter distance", + "description": "How far light traveled inside the volume", + "type": "float", + "defaultValue": 8, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "quality", + "displayName": " Quality", + "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", + "type": "float", + "defaultValue": 0.4, + "min": 0.2, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_subsurfaceScatteringQuality" + } + }, + { + "name": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "name": "o_transmission_mode" + } + }, + { + "name": "thickness", + "displayName": " Thickness", + "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", + "type": "float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0 + }, + { + "name": "thicknessMap", + "displayName": " Thickness Map", + "description": "Texture for controlling per pixel thickness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMap" + } + }, + { + "name": "useThicknessMap", + "displayName": " Use Thickness Map", + "description": "Whether to use the thickness map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_transmissionThicknessMapUvIndex" + } + }, + { + "name": "transmissionTint", + "displayName": " Transmission Tint", + "description": "Color of the volume light traveling through", + "type": "Color", + "defaultValue": [ 1.0, 0.8, 0.6 ] + }, + { + "name": "transmissionPower", + "displayName": " Power", + "description": "How much transmitted light scatter radially ", + "type": "float", + "defaultValue": 6.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionDistortion", + "displayName": " Distortion", + "description": "How much light direction distorted towards surface normal", + "type": "float", + "defaultValue": 0.1, + "min": 0.0, + "max": 1.0 + }, + { + "name": "transmissionAttenuation", + "displayName": " Attenuation", + "description": "How fast transmitted light fade with thickness", + "type": "float", + "defaultValue": 4.0, + "min": 0.0, + "softMax": 20.0 + }, + { + "name": "transmissionScale", + "displayName": " Scale", + "description": "Strength of transmission", + "type": "float", + "defaultValue": 3.0, + "min": 0.0, + "softMax": 20.0 + } + ], + "wrinkleLayers": [ + { + "name": "enable", + "displayName": "Enable Wrinkle Layers", + "description": "Enable wrinkle layers for morph animations, using vertex color blend weights.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "count", + "displayName": "Number Of Layers", + "description": "The number of wrinkle map layers to use. The blend values come from the 'COLOR0' vertex stream, where R/G/B/A correspond to wrinkle layers 1/2/3/4 respectively.", + "type": "UInt", + "defaultValue": 4, + "min": 1, + "max": 4 + }, + { + "name": "showBlendValues", + "displayName": "Show Blend Values", + "description": "Enable a debug mode that draws the blend values as red, green, blue, and white overlays.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color Maps", + "description": "Enable support for blending the base color according to morph animations.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorMap1", + "displayName": " Base Color 1", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture1" + } + }, + { + "name": "baseColorMap2", + "displayName": " Base Color 2", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture2" + } + }, + { + "name": "baseColorMap3", + "displayName": " Base Color 3", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture3" + } + }, + { + "name": "baseColorMap4", + "displayName": " Base Color 4", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_baseColor_texture4" + } + }, + { + "name": "enableNormal", + "displayName": "Enable Normal Maps", + "description": "Enable support for blending the normal maps according to morph animations.", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalMap1", + "displayName": " Normals 1", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture1" + } + }, + { + "name": "normalMap2", + "displayName": " Normals 2", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture2" + } + }, + { + "name": "normalMap3", + "displayName": " Normals 3", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture3" + } + }, + { + "name": "normalMap4", + "displayName": " Normals 4", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_wrinkle_normal_texture4" + } + } + ], + "detailLayerGroup": [ + { + "name": "enableDetailLayer", + "displayName": "Enable Detail Layer", + "description": "Enable detail layer for fine details and scratches", + "type": "Bool", + "defaultValue": false + }, + { + "name": "blendDetailFactor", + "displayName": "Blend Factor", + "description": "Scales the overall impact of the detail layer.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendFactor" + } + }, + { + "name": "blendDetailMask", + "displayName": "Blend Mask", + "description": "Detailed blend mask for application of the detail maps.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_texture" + } + }, + { + "name": "enableDetailMaskTexture", + "displayName": " Use Texture", + "description": "Enable detail blend mask", + "type": "Bool", + "defaultValue": true + }, + { + "name": "blendDetailMaskUv", + "displayName": " Blend Mask UV", + "description": "Which UV set to use for sampling the detail blend mask", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_detail_blendMask_uvIndex" + } + }, + { + "name": "textureMapUv", + "displayName": "Detail Map UVs", + "description": "Which UV set to use for detail map sampling", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Unwrapped", + "connection": { + "type": "ShaderInput", + "name": "m_detail_allMapsUvIndex" + } + }, + { + "name": "enableBaseColor", + "displayName": "Enable Base Color", + "description": "Enable detail blending for base color", + "type": "Bool", + "defaultValue": false + }, + { + "name": "baseColorDetailMap", + "displayName": " Texture", + "description": "Detailed Base Color Texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_texture" + } + }, + { + "name": "baseColorDetailBlend", + "displayName": " Blend Factor", + "description": "How much to blend the detail layer into the base color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_baseColor_factor" + } + }, + { + "name": "enableNormals", + "displayName": "Enable Normal", + "description": "Enable detail normal map to be used for fine detail normal such as scratches and small dents", + "type": "Bool", + "defaultValue": false + }, + { + "name": "normalDetailStrength", + "displayName": " Factor", + "description": "Strength factor for scaling the Detail Normal", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_factor" + } + }, + { + "name": "normalDetailMap", + "displayName": " Texture", + "description": "Detailed Normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_texture" + } + }, + { + "name": "normalDetailFlipX", + "displayName": " Flip X Channel", + "description": "Flip Detail tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipX" + } + }, + { + "name": "normalDetailFlipY", + "displayName": " Flip Y Channel", + "description": "Flip Detail bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_detail_normal_flipY" + } + } + ], + "detailUV": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] + } }, "shaders": [ { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index 0789d758b8..88e845ddf0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -10,1010 +10,1013 @@ } ], "propertyLayout": { - "propertySets": [ + "groups": [ { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", - "properties": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ] + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not.", - "properties": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ] + "description": "Properties for configuring whether the surface is metallic or not." }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears.", - "properties": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ] + "description": "Properties for configuring how rough the surface appears." }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", - "properties": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ] + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." }, { "name": "normal", "displayName": "Normal", - "description": "Properties related to configuring surface normal.", - "properties": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ] + "description": "Properties related to configuring surface normal." }, { "name": "occlusion", "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light.", - "properties": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ] + "description": "Properties for baked textures that represent geometric occlusion of light." }, { "name": "emissive", "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene.", - "properties": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ] + "description": "Properties to add light emission, independent of other lights in the scene." }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat", - "properties": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ] - }, + "description": "Properties for configuring gloss clear coat" + }, { "name": "parallax", "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map.", - "properties": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ] + "description": "Properties for parallax effect produced by a height map." }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency.", - "properties": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ] + "description": "Properties for configuring the materials transparency." }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms.", - "properties": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] + "description": "Properties for configuring UV transforms." }, { // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination.", - "properties": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] + "description": "Properties for configuring the irradiance used in global illumination." }, { "name": "general", "displayName": "General Settings", - "description": "General settings.", - "properties": [ - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ] + "description": "General settings." } - ] + ], + "properties": { + "general": [ + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ], + "baseColor": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ], + "metallic": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ], + "roughness": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ], + "specularF0": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ], + "clearCoat": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ], + "normal": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ], + "opacity": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ], + "uv": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ], + "occlusion": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ], + "emissive": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ], + "parallax": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ], + "irradiance": [ + // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] + } }, "shaders": [ { diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype index e29599c45c..cf0bffa058 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick.materialtype @@ -2,174 +2,176 @@ "description": "This is an example of a custom material type using Atom's PBR shading model: procedurally generated brick or tile.", "version": 3, "propertyLayout": { - "propertySets": [ + "groups": [ { "name": "shape", "displayName": "Shape", - "description": "Properties for configuring size, shape, and position of the bricks.", - "properties": [ - { - "name": "brickWidth", - "displayName": "Brick Width", - "description": "The width of each brick.", - "type": "Float", - "defaultValue": 0.1, - "min": 0.0, - "softMax": 0.2, - "step": 0.001, - "connection": { - "type": "ShaderInput", - "name": "m_brickWidth" - } - }, - { - "name": "brickHeight", - "displayName": "Brick Height", - "description": "The height of each brick.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.2, - "step": 0.001, - "connection": { - "type": "ShaderInput", - "name": "m_brickHeight" - } - }, - { - "name": "brickOffset", - "displayName": "Offset", - "description": "The offset of each stack of bricks as a percentage of brick width.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickOffset" - } - }, - { - "name": "lineWidth", - "displayName": "Line Width", - "description": "The width of the grout lines.", - "type": "Float", - "defaultValue": 0.01, - "min": 0.0, - "softMax": 0.02, - "step": 0.0001, - "connection": { - "type": "ShaderInput", - "name": "m_lineWidth" - } - }, - { - "name": "lineDepth", - "displayName": "Line Depth", - "description": "The depth of the grout lines.", - "type": "Float", - "defaultValue": 0.01, - "min": 0.0, - "softMax": 0.02, - "connection": { - "type": "ShaderInput", - "name": "m_lineDepth" - } - } - ] + "description": "Properties for configuring size, shape, and position of the bricks." }, { "name": "appearance", "displayName": "Appearance", - "description": "Properties for configuring the appearance of the bricks and grout lines.", - "properties": [ - { - "name": "noiseTexture", - "type": "Image", - "defaultValue": "TestData/Textures/noise512.png", - "visibility": "Hidden", - "connection": { - "type": "ShaderInput", - "name": "m_noise" - } - }, - { - "name": "brickColor", - "displayName": "Brick Color", - "description": "The color of the bricks.", - "type": "Color", - "defaultValue": [1.0,1.0,1.0], - "connection": { - "type": "ShaderInput", - "name": "m_brickColor" - } - }, - { - "name": "brickColorNoise", - "displayName": "Brick Color Noise", - "description": "Scale the variation of brick color.", - "type": "Float", - "defaultValue": 0.25, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickNoiseFactor" - } - }, - { - "name": "lineColor", - "displayName": "Line Color", - "description": "The color of the grout lines.", - "type": "Color", - "defaultValue": [0.5,0.5,0.5], - "connection": { - "type": "ShaderInput", - "name": "m_lineColor" - } - }, - { - "name": "lineColorNoise", - "displayName": "Line Color Noise", - "description": "Scale the variation of grout line color.", - "type": "Float", - "defaultValue": 0.25, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_lineNoiseFactor" - } - }, - { - "name": "brickColorBleed", - "displayName": "Brick Color Bleed", - "description": "Distance into the grout line that the brick color will continue.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_brickColorBleed" - } - }, - { - "name": "ao", - "displayName": "Ambient Occlusion", - "description": "The strength of baked ambient occlusion in the grout lines.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_aoFactor" - } - } - ] + "description": "Properties for configuring the appearance of the bricks and grout lines." } - ] + ], + "properties": { + "shape": [ + { + "name": "brickWidth", + "displayName": "Brick Width", + "description": "The width of each brick.", + "type": "Float", + "defaultValue": 0.1, + "min": 0.0, + "softMax": 0.2, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "name": "m_brickWidth" + } + }, + { + "name": "brickHeight", + "displayName": "Brick Height", + "description": "The height of each brick.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.2, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "name": "m_brickHeight" + } + }, + { + "name": "brickOffset", + "displayName": "Offset", + "description": "The offset of each stack of bricks as a percentage of brick width.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickOffset" + } + }, + { + "name": "lineWidth", + "displayName": "Line Width", + "description": "The width of the grout lines.", + "type": "Float", + "defaultValue": 0.01, + "min": 0.0, + "softMax": 0.02, + "step": 0.0001, + "connection": { + "type": "ShaderInput", + "name": "m_lineWidth" + } + }, + { + "name": "lineDepth", + "displayName": "Line Depth", + "description": "The depth of the grout lines.", + "type": "Float", + "defaultValue": 0.01, + "min": 0.0, + "softMax": 0.02, + "connection": { + "type": "ShaderInput", + "name": "m_lineDepth" + } + } + ], + "appearance": [ + { + "name": "noiseTexture", + "type": "Image", + "defaultValue": "TestData/Textures/noise512.png", + "visibility": "Hidden", + "connection": { + "type": "ShaderInput", + "name": "m_noise" + } + }, + { + "name": "brickColor", + "displayName": "Brick Color", + "description": "The color of the bricks.", + "type": "Color", + "defaultValue": [1.0,1.0,1.0], + "connection": { + "type": "ShaderInput", + "name": "m_brickColor" + } + }, + { + "name": "brickColorNoise", + "displayName": "Brick Color Noise", + "description": "Scale the variation of brick color.", + "type": "Float", + "defaultValue": 0.25, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickNoiseFactor" + } + }, + { + "name": "lineColor", + "displayName": "Line Color", + "description": "The color of the grout lines.", + "type": "Color", + "defaultValue": [0.5,0.5,0.5], + "connection": { + "type": "ShaderInput", + "name": "m_lineColor" + } + }, + { + "name": "lineColorNoise", + "displayName": "Line Color Noise", + "description": "Scale the variation of grout line color.", + "type": "Float", + "defaultValue": 0.25, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_lineNoiseFactor" + } + }, + { + "name": "brickColorBleed", + "displayName": "Brick Color Bleed", + "description": "Distance into the grout line that the brick color will continue.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_brickColorBleed" + } + }, + { + "name": "ao", + "displayName": "Ambient Occlusion", + "description": "The strength of baked ambient occlusion in the grout lines.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_aoFactor" + } + } + ] + } }, "shaders": [ { @@ -185,5 +187,8 @@ { "file": "Shaders/Depth/DepthPass.shader" } + ], + "functors": [ ] -} \ No newline at end of file +} + From b9a80dee325164cc035cbd1728de7f4a364905b3 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 27 Jan 2022 14:17:09 -0800 Subject: [PATCH 319/394] Fixed newline at end of file. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Common/Assets/Materials/Types/EnhancedPBR.materialtype | 2 +- .../Feature/Common/Assets/Materials/Types/Skin.materialtype | 2 +- .../Common/Assets/Materials/Types/StandardPBR.materialtype | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index eee9a0fc88..d4b5882f21 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1687,4 +1687,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} \ No newline at end of file +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index 15eaf94df6..a49eba7975 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -1101,4 +1101,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} \ No newline at end of file +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index 88e845ddf0..f324394309 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -1199,4 +1199,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} \ No newline at end of file +} From 8ecaaf36c0fa320a81e8cff61a3f031e0273ad02 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Thu, 27 Jan 2022 14:43:52 -0800 Subject: [PATCH 320/394] [development] updated Profiler interface to allow the forwarding of format string arguments (#7173) Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Debug/Profiler.h | 10 ++++------ Code/Framework/AzCore/AzCore/Debug/Profiler.inl | 6 +++--- Gems/Profiler/Code/Source/CpuProfilerImpl.cpp | 2 +- Gems/Profiler/Code/Source/CpuProfilerImpl.h | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Debug/Profiler.h b/Code/Framework/AzCore/AzCore/Debug/Profiler.h index 6b27b35f53..6557743de8 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Profiler.h +++ b/Code/Framework/AzCore/AzCore/Debug/Profiler.h @@ -67,8 +67,7 @@ namespace AZ::Debug Profiler() = default; virtual ~Profiler() = default; - // support for the extra macro args (e.g. format strings) will come in a later PR - virtual void BeginRegion(const Budget* budget, const char* eventName) = 0; + virtual void BeginRegion(const Budget* budget, const char* eventName, size_t eventNameArgCount, ...) = 0; virtual void EndRegion(const Budget* budget) = 0; }; @@ -76,12 +75,11 @@ namespace AZ::Debug { public: template - static void BeginRegion([[maybe_unused]] Budget* budget, [[maybe_unused]] const char* eventName, [[maybe_unused]] T const&... args); - - static void EndRegion([[maybe_unused]] Budget* budget); + static void BeginRegion(Budget* budget, const char* eventName, T const&... args); + static void EndRegion(Budget* budget); template - ProfileScope(Budget* budget, char const* eventName, T const&... args); + ProfileScope(Budget* budget, const char* eventName, T const&... args); ~ProfileScope(); diff --git a/Code/Framework/AzCore/AzCore/Debug/Profiler.inl b/Code/Framework/AzCore/AzCore/Debug/Profiler.inl index c820639b09..a0917d6130 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Profiler.inl +++ b/Code/Framework/AzCore/AzCore/Debug/Profiler.inl @@ -31,10 +31,10 @@ namespace AZ::Debug if (auto profiler = AZ::Interface::Get(); profiler) { - profiler->BeginRegion(budget, eventName); + profiler->BeginRegion(budget, eventName, sizeof...(T), args...); } } - #endif // #if !defined(_RELEASE) + #endif // !defined(_RELEASE) } inline void ProfileScope::EndRegion([[maybe_unused]] Budget* budget) @@ -55,7 +55,7 @@ namespace AZ::Debug } template - ProfileScope::ProfileScope(Budget* budget, char const* eventName, T const&... args) + ProfileScope::ProfileScope(Budget* budget, const char* eventName, T const&... args) : m_budget{ budget } { BeginRegion(budget, eventName, args...); diff --git a/Gems/Profiler/Code/Source/CpuProfilerImpl.cpp b/Gems/Profiler/Code/Source/CpuProfilerImpl.cpp index c9b32565d9..b0082bd046 100644 --- a/Gems/Profiler/Code/Source/CpuProfilerImpl.cpp +++ b/Gems/Profiler/Code/Source/CpuProfilerImpl.cpp @@ -96,7 +96,7 @@ namespace Profiler AZ::SystemTickBus::Handler::BusDisconnect(); } - void CpuProfilerImpl::BeginRegion(const AZ::Debug::Budget* budget, const char* eventName) + void CpuProfilerImpl::BeginRegion(const AZ::Debug::Budget* budget, const char* eventName, [[maybe_unused]] size_t eventNameArgCount, ...) { // Try to lock here, the shutdownMutex will only be contested when the CpuProfiler is shutting down. if (m_shutdownMutex.try_lock_shared()) diff --git a/Gems/Profiler/Code/Source/CpuProfilerImpl.h b/Gems/Profiler/Code/Source/CpuProfilerImpl.h index c97e45e69c..48b972bc49 100644 --- a/Gems/Profiler/Code/Source/CpuProfilerImpl.h +++ b/Gems/Profiler/Code/Source/CpuProfilerImpl.h @@ -111,7 +111,7 @@ namespace Profiler void OnSystemTick() final override; //! AZ::Debug::Profiler overrides... - void BeginRegion(const AZ::Debug::Budget* budget, const char* eventName) final override; + void BeginRegion(const AZ::Debug::Budget* budget, const char* eventName, size_t eventNameArgCount, ...) final override; void EndRegion(const AZ::Debug::Budget* budget) final override; //! CpuProfiler overrides... From 1de540ae3f2adb73650a740a8251bd37b8b0d8a2 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 27 Jan 2022 14:48:50 -0800 Subject: [PATCH 321/394] Updated code to use span instead of array_view as this was replaced on the development branch. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialTypeSourceData.h | 8 ++++---- .../RPI.Edit/Material/MaterialPropertyId.cpp | 4 ++-- .../RPI.Edit/Material/MaterialTypeSourceData.cpp | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 6c439195f1..35cc7fe09a 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -308,11 +308,11 @@ namespace AZ private: - const PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const; - PropertySet* FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList); + const PropertySet* FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList) const; + PropertySet* FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList); - const PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) const; - PropertyDefinition* FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList); + const PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertySetList) const; + PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertySetList); // Function overloads for recursion, returns false to indicate that recursion should end. bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index 1a9b91f431..1f5581e417 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -88,7 +88,7 @@ namespace AZ { } - MaterialPropertyId::MaterialPropertyId(const AZStd::array_view groupNames, AZStd::string_view propertyName) + MaterialPropertyId::MaterialPropertyId(const AZStd::span groupNames, AZStd::string_view propertyName) { for (const auto& name : groupNames) { @@ -118,7 +118,7 @@ namespace AZ } } - MaterialPropertyId::MaterialPropertyId(const AZStd::array_view names) + MaterialPropertyId::MaterialPropertyId(const AZStd::span names) { for (const auto& name : names) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 032d36636e..4aa0a77370 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -247,7 +247,7 @@ namespace AZ return parentPropertySet->AddProperty(splitPropertyId[1]); } - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) const + const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList) const { for (const auto& propertySet : inPropertySetList) { @@ -261,7 +261,7 @@ namespace AZ } else { - AZStd::array_view subPath{parsedPropertySetId.begin() + 1, parsedPropertySetId.end()}; + AZStd::span subPath{parsedPropertySetId.begin() + 1, parsedPropertySetId.end()}; if (!subPath.empty()) { @@ -277,7 +277,7 @@ namespace AZ return nullptr; } - MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::array_view parsedPropertySetId, AZStd::array_view> inPropertySetList) + MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList) { return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); } @@ -295,14 +295,14 @@ namespace AZ } const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( - AZStd::array_view parsedPropertyId, - AZStd::array_view> inPropertySetList) const + AZStd::span parsedPropertyId, + AZStd::span> inPropertySetList) const { for (const auto& propertySet : inPropertySetList) { if (propertySet->m_name == parsedPropertyId[0]) { - AZStd::array_view subPath {parsedPropertyId.begin() + 1, parsedPropertyId.end()}; + AZStd::span subPath {parsedPropertyId.begin() + 1, parsedPropertyId.end()}; if (subPath.size() == 1) { @@ -328,7 +328,7 @@ namespace AZ return nullptr; } - MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::array_view parsedPropertyId, AZStd::array_view> inPropertySetList) + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertySetList) { return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); } From 1a8fdd9c84d3fd60867b26d3648f566599e63c01 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Thu, 27 Jan 2022 15:45:33 -0800 Subject: [PATCH 322/394] Script Canvas: Added take screenshot button to toolbar Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 14 +++++++++++++- .../Code/Editor/View/Windows/MainWindow.h | 1 + .../Windows/Resources/scriptcanvas_screenshot.png | 3 +++ .../View/Windows/ScriptCanvasEditorResources.qrc | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/scriptcanvas_screenshot.png diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index c0b6758147..c6ac85d314 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -513,7 +513,6 @@ namespace ScriptCanvasEditor m_editorToolbar->AddCustomAction(m_createFunctionOutput); connect(m_createFunctionOutput, &QToolButton::clicked, this, &MainWindow::CreateFunctionOutput); - { m_validateGraphToolButton = new QToolButton(); m_validateGraphToolButton->setToolTip("Will run a validation check on the current graph and report any warnings/errors discovered."); @@ -523,6 +522,18 @@ namespace ScriptCanvasEditor m_editorToolbar->AddCustomAction(m_validateGraphToolButton); + // Screenshot + { + m_takeScreenshot = new QToolButton(); + m_takeScreenshot->setToolTip("Captures a full resolution screenshot of the entire graph or selected nodes into the clipboard"); + m_takeScreenshot->setIcon(QIcon(":/ScriptCanvasEditorResources/Resources/scriptcanvas_screenshot.png")); + m_takeScreenshot->setEnabled(false); + } + + m_editorToolbar->AddCustomAction(m_takeScreenshot); + connect(m_takeScreenshot, &QToolButton::clicked, this, &MainWindow::OnScreenshot); + + connect(m_validateGraphToolButton, &QToolButton::clicked, this, &MainWindow::OnValidateCurrentGraph); m_layout->addWidget(m_editorToolbar); @@ -3211,6 +3222,7 @@ namespace ScriptCanvasEditor m_createFunctionOutput->setEnabled(enabled); m_createFunctionInput->setEnabled(enabled); + m_takeScreenshot->setEnabled(enabled); // File Menu ui->action_Close->setEnabled(enabled); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 75c798a0d3..d05792c4ec 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -648,6 +648,7 @@ namespace ScriptCanvasEditor QToolButton* m_createFunctionInput = nullptr; QToolButton* m_createFunctionOutput = nullptr; + QToolButton* m_takeScreenshot = nullptr; QToolButton* m_createScriptCanvas = nullptr; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/scriptcanvas_screenshot.png b/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/scriptcanvas_screenshot.png new file mode 100644 index 0000000000..7daa11d945 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Resources/scriptcanvas_screenshot.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef1d048b1ef82137424b6c346e7f87f156e97402ecc89eca8c0dc0e2b6acc395 +size 400 diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc index be90d229dc..9244f71ca3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasEditorResources.qrc @@ -34,6 +34,7 @@ Resources/scriptcanvas_nodes.png Resources/scriptcanvas_outliner.png Resources/scriptcanvas_properties.png + Resources/scriptcanvas_screenshot.png Resources/scriptcanvas_variables.png Resources/settings_icon.png Resources/settings_dropdown_icon.png From c2e220ce491f69b5764e2199e5b223b3dc088e4d Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:11:26 -0800 Subject: [PATCH 323/394] Renamed property 'set' to property 'group' for consistency with the prior naming. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.h | 86 ++--- .../Material/MaterialTypeSourceData.cpp | 200 +++++----- .../Material/MaterialSourceDataTests.cpp | 4 +- .../Material/MaterialTypeSourceDataTests.cpp | 346 +++++++++--------- .../Materials/Types/MinimalPBR.materialtype | 2 +- .../Code/Source/Document/MaterialDocument.cpp | 26 +- .../MaterialInspector/MaterialInspector.cpp | 14 +- .../EditorMaterialComponentInspector.cpp | 14 +- .../Material/EditorMaterialComponentUtil.cpp | 2 +- 9 files changed, 347 insertions(+), 347 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 35cc7fe09a..40f82c8ec7 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -118,47 +118,47 @@ namespace AZ using PropertyList = AZStd::vector>; - struct PropertySet + struct PropertyGroup { friend class MaterialTypeSourceData; - AZ_CLASS_ALLOCATOR(PropertySet, SystemAllocator, 0); - AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertySet, "{BA3AA0E4-C74D-4FD0-ADB2-00B060F06314}"); + AZ_CLASS_ALLOCATOR(PropertyGroup, SystemAllocator, 0); + AZ_TYPE_INFO(AZ::RPI::MaterialTypeSourceData::PropertyGroup, "{BA3AA0E4-C74D-4FD0-ADB2-00B060F06314}"); public: - PropertySet() = default; - AZ_DISABLE_COPY(PropertySet) + PropertyGroup() = default; + AZ_DISABLE_COPY(PropertyGroup) const AZStd::string& GetName() const { return m_name; } const AZStd::string& GetDisplayName() const { return m_displayName; } const AZStd::string& GetDescription() const { return m_description; } const PropertyList& GetProperties() const { return m_properties; } - const AZStd::vector>& GetPropertySets() const { return m_propertySets; } + const AZStd::vector>& GetPropertyGroups() const { return m_propertyGroups; } const AZStd::vector>& GetFunctors() const { return m_materialFunctorSourceData; } void SetDisplayName(AZStd::string_view displayName) { m_displayName = displayName; } void SetDescription(AZStd::string_view description) { m_description = description; } - //! Add a new property to this PropertySet. + //! Add a new property to this PropertyGroup. //! @param name a unique for the property. Must be a C-style identifier. //! @return the new PropertyDefinition, or null if the name was not valid. PropertyDefinition* AddProperty(AZStd::string_view name); - //! Add a new nested PropertySet to this PropertySet. - //! @param name a unique for the property set. Must be a C-style identifier. - //! @return the new PropertySet, or null if the name was not valid. - PropertySet* AddPropertySet(AZStd::string_view name); + //! Add a new nested PropertyGroup to this PropertyGroup. + //! @param name a unique for the property group. Must be a C-style identifier. + //! @return the new PropertyGroup, or null if the name was not valid. + PropertyGroup* AddPropertyGroup(AZStd::string_view name); private: - static PropertySet* AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList); + static PropertyGroup* AddPropertyGroup(AZStd::string_view name, AZStd::vector>& toPropertyGroupList); AZStd::string m_name; AZStd::string m_displayName; AZStd::string m_description; PropertyList m_properties; - AZStd::vector> m_propertySets; + AZStd::vector> m_propertyGroups; AZStd::vector> m_materialFunctorSourceData; }; @@ -215,15 +215,15 @@ namespace AZ //! This field is unused, and has been replaced by MaterialTypeSourceData::m_version below. It is kept for legacy file compatibility to suppress warnings and errors. uint32_t m_versionOld = 0; - //! [Deprecated] Use m_propertySets instead + //! [Deprecated] Use m_propertyGroups instead //! List of groups that will contain the available properties AZStd::vector m_groupsOld; - //! [Deprecated] Use m_propertySets instead + //! [Deprecated] Use m_propertyGroups instead AZStd::map> m_propertiesOld; //! Collection of all available user-facing properties - AZStd::vector> m_propertySets; + AZStd::vector> m_propertyGroups; }; AZStd::string m_description; @@ -247,24 +247,24 @@ namespace AZ //! Copy over UV custom names to the properties enum values. void ResolveUvEnums(); - //! Add a new PropertySet for containing properties or other PropertySets. - //! @param propertySetId The ID of the new property set. To add as a nested PropertySet, use a full path ID like "levelA.levelB.levelC"; in this case a property set "levelA.levelB" must already exist. - //! @return a pointer to the new PropertySet or null if there was a problem (an AZ_Error will be reported). - PropertySet* AddPropertySet(AZStd::string_view propertySetId); + //! Add a new PropertyGroup for containing properties or other PropertyGroups. + //! @param propertyGroupId The ID of the new property group. To add as a nested PropertyGroup, use a full path ID like "levelA.levelB.levelC"; in this case a property group "levelA.levelB" must already exist. + //! @return a pointer to the new PropertyGroup or null if there was a problem (an AZ_Error will be reported). + PropertyGroup* AddPropertyGroup(AZStd::string_view propertyGroupId); - //! Add a new property to a PropertySet. - //! @param propertyId The ID of the new property, like "layerBlend.factor" or "layer2.roughness.texture". The indicated property set must already exist. + //! Add a new property to a PropertyGroup. + //! @param propertyId The ID of the new property, like "layerBlend.factor" or "layer2.roughness.texture". The indicated property group must already exist. //! @return a pointer to the new PropertyDefinition or null if there was a problem (an AZ_Error will be reported). PropertyDefinition* AddProperty(AZStd::string_view propertyId); - //! Return the PropertyLayout containing the tree of property sets and property definitions. + //! Return the PropertyLayout containing the tree of property groups and property definitions. const PropertyLayout& GetPropertyLayout() const { return m_propertyLayout; } - //! Find the PropertySet with the given ID. - //! @param propertySetId The full ID of a property set to find, like "levelA.levelB.levelC". - //! @return the found PropertySet or null if it doesn't exist. - const PropertySet* FindPropertySet(AZStd::string_view propertySetId) const; - PropertySet* FindPropertySet(AZStd::string_view propertySetId); + //! Find the PropertyGroup with the given ID. + //! @param propertyGroupId The full ID of a property group to find, like "levelA.levelB.levelC". + //! @return the found PropertyGroup or null if it doesn't exist. + const PropertyGroup* FindPropertyGroup(AZStd::string_view propertyGroupId) const; + PropertyGroup* FindPropertyGroup(AZStd::string_view propertyGroupId); //! Find the definition for a property with the given ID. //! @param propertyId The full ID of a property to find, like "baseColor.texture". @@ -280,14 +280,14 @@ namespace AZ //! Call back function type used with the enumeration functions. //! Return false to terminate the traversal. - using EnumeratePropertySetsCallback = AZStd::function; - //! Recursively traverses all of the property sets contained in the material type, executing a callback function for each. + //! Recursively traverses all of the property groups contained in the material type, executing a callback function for each. //! @return false if the enumeration was terminated early by the callback returning false. - bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const; + bool EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback) const; //! Call back function type used with the numeration functions. //! Return false to terminate the traversal. @@ -303,31 +303,31 @@ namespace AZ Outcome> CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath = "", bool elevateWarnings = true) const; //! If the data was loaded from an old format file (i.e. where "groups" and "properties" were separate sections), - //! this converts to the new format where properties are listed inside property sets. + //! this converts to the new format where properties are listed inside property groups. bool ConvertToNewDataFormat(); private: - const PropertySet* FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList) const; - PropertySet* FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList); + const PropertyGroup* FindPropertyGroup(AZStd::span parsedPropertyGroupId, AZStd::span> inPropertyGroupList) const; + PropertyGroup* FindPropertyGroup(AZStd::span parsedPropertyGroupId, AZStd::span> inPropertyGroupList); - const PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertySetList) const; - PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertySetList); + const PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertyGroupList) const; + PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertyGroupList); // Function overloads for recursion, returns false to indicate that recursion should end. - bool EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; - bool EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertySetList) const; + bool EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertyGroupList) const; + bool EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertyGroupList) const; - //! Recursively populates a material asset with properties from the tree of material property sets. + //! Recursively populates a material asset with properties from the tree of material property groups. //! @param materialTypeSourceFilePath path to the material type file that is being processed, used to look up relative paths - //! @param propertyNameContext the accumulated prefix that should be applied to any property names encountered in the current @propertySet - //! @param propertySet the current PropertySet that is being processed + //! @param propertyNameContext the accumulated prefix that should be applied to any property names encountered in the current @propertyGroup + //! @param propertyGroup the current PropertyGroup that is being processed //! @return false if errors are detected and processing should abort bool BuildPropertyList( const AZStd::string& materialTypeSourceFilePath, MaterialTypeAssetCreator& materialTypeAssetCreator, AZStd::vector& propertyNameContext, - const MaterialTypeSourceData::PropertySet* propertySet) const; + const MaterialTypeSourceData::PropertyGroup* propertyGroup) const; //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data. //! Groups with the same name will be consolidated into a single entry. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 4aa0a77370..b9a5754732 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -58,9 +58,9 @@ namespace AZ serializeContext->Class()->Version(4); serializeContext->Class()->Version(1); - serializeContext->RegisterGenericType>(); + serializeContext->RegisterGenericType>(); serializeContext->RegisterGenericType>(); - serializeContext->RegisterGenericType>>(); + serializeContext->RegisterGenericType>>(); serializeContext->RegisterGenericType>>(); serializeContext->RegisterGenericType(); @@ -88,22 +88,22 @@ namespace AZ ->Field("options", &ShaderVariantReferenceData::m_shaderOptionValues) ; - serializeContext->Class() + serializeContext->Class() ->Version(1) - ->Field("name", &PropertySet::m_name) - ->Field("displayName", &PropertySet::m_displayName) - ->Field("description", &PropertySet::m_description) - ->Field("properties", &PropertySet::m_properties) - ->Field("propertySets", &PropertySet::m_propertySets) - ->Field("functors", &PropertySet::m_materialFunctorSourceData) + ->Field("name", &PropertyGroup::m_name) + ->Field("displayName", &PropertyGroup::m_displayName) + ->Field("description", &PropertyGroup::m_description) + ->Field("properties", &PropertyGroup::m_properties) + ->Field("propertyGroups", &PropertyGroup::m_propertyGroups) + ->Field("functors", &PropertyGroup::m_materialFunctorSourceData) ; serializeContext->Class() - ->Version(3) // Added propertySets + ->Version(3) // Added propertyGroups ->Field("version", &PropertyLayout::m_versionOld) //< Deprecated, preserved for backward compatibility, replaced by MaterialTypeSourceData::version - ->Field("groups", &PropertyLayout::m_groupsOld) //< Deprecated, preserved for backward compatibility, replaced by propertySets - ->Field("properties", &PropertyLayout::m_propertiesOld) //< Deprecated, preserved for backward compatibility, replaced by propertySets - ->Field("propertySets", &PropertyLayout::m_propertySets) + ->Field("groups", &PropertyLayout::m_groupsOld) //< Deprecated, preserved for backward compatibility, replaced by propertyGroups + ->Field("properties", &PropertyLayout::m_propertiesOld) //< Deprecated, preserved for backward compatibility, replaced by propertyGroups + ->Field("propertyGroups", &PropertyLayout::m_propertyGroups) ; serializeContext->RegisterGenericType(); @@ -132,16 +132,16 @@ namespace AZ const float MaterialTypeSourceData::PropertyDefinition::DefaultMax = std::numeric_limits::max(); const float MaterialTypeSourceData::PropertyDefinition::DefaultStep = 0.1f; - /*static*/ MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name, AZStd::vector>& toPropertySetList) + /*static*/ MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::PropertyGroup::AddPropertyGroup(AZStd::string_view name, AZStd::vector>& toPropertyGroupList) { - auto iter = AZStd::find_if(toPropertySetList.begin(), toPropertySetList.end(), [name](const AZStd::unique_ptr& existingPropertySet) + auto iter = AZStd::find_if(toPropertyGroupList.begin(), toPropertyGroupList.end(), [name](const AZStd::unique_ptr& existingPropertyGroup) { - return existingPropertySet->m_name == name; + return existingPropertyGroup->m_name == name; }); - if (iter != toPropertySetList.end()) + if (iter != toPropertyGroupList.end()) { - AZ_Error("Material source data", false, "PropertySet named '%.*s' already exists", AZ_STRING_ARG(name)); + AZ_Error("Material source data", false, "PropertyGroup named '%.*s' already exists", AZ_STRING_ARG(name)); return nullptr; } @@ -151,12 +151,12 @@ namespace AZ return nullptr; } - toPropertySetList.push_back(AZStd::make_unique()); - toPropertySetList.back()->m_name = name; - return toPropertySetList.back().get(); + toPropertyGroupList.push_back(AZStd::make_unique()); + toPropertyGroupList.back()->m_name = name; + return toPropertyGroupList.back().get(); } - MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::PropertySet::AddProperty(AZStd::string_view name) + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::PropertyGroup::AddProperty(AZStd::string_view name) { auto propertyIter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) { @@ -165,18 +165,18 @@ namespace AZ if (propertyIter != m_properties.end()) { - AZ_Error("Material source data", false, "PropertySet '%s' already contains a property named '%.*s'", m_name.c_str(), AZ_STRING_ARG(name)); + AZ_Error("Material source data", false, "PropertyGroup '%s' already contains a property named '%.*s'", m_name.c_str(), AZ_STRING_ARG(name)); return nullptr; } - auto propertySetIter = AZStd::find_if(m_propertySets.begin(), m_propertySets.end(), [name](const AZStd::unique_ptr& existingPropertySet) + auto propertyGroupIter = AZStd::find_if(m_propertyGroups.begin(), m_propertyGroups.end(), [name](const AZStd::unique_ptr& existingPropertyGroup) { - return existingPropertySet->m_name == name; + return existingPropertyGroup->m_name == name; }); - if (propertySetIter != m_propertySets.end()) + if (propertyGroupIter != m_propertyGroups.end()) { - AZ_Error("Material source data", false, "Property name '%.*s' collides with a PropertySet of the same name", AZ_STRING_ARG(name)); + AZ_Error("Material source data", false, "Property name '%.*s' collides with a PropertyGroup of the same name", AZ_STRING_ARG(name)); return nullptr; } @@ -190,7 +190,7 @@ namespace AZ return m_properties.back().get(); } - MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::PropertySet::AddPropertySet(AZStd::string_view name) + MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::PropertyGroup::AddPropertyGroup(AZStd::string_view name) { auto iter = AZStd::find_if(m_properties.begin(), m_properties.end(), [name](const AZStd::unique_ptr& existingProperty) { @@ -199,31 +199,31 @@ namespace AZ if (iter != m_properties.end()) { - AZ_Error("Material source data", false, "PropertySet name '%.*s' collides with a Property of the same name", AZ_STRING_ARG(name)); + AZ_Error("Material source data", false, "PropertyGroup name '%.*s' collides with a Property of the same name", AZ_STRING_ARG(name)); return nullptr; } - return AddPropertySet(name, m_propertySets); + return AddPropertyGroup(name, m_propertyGroups); } - MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::AddPropertySet(AZStd::string_view propertySetId) + MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::AddPropertyGroup(AZStd::string_view propertyGroupId) { - AZStd::vector splitPropertySetId = SplitId(propertySetId); + AZStd::vector splitPropertyGroupId = SplitId(propertyGroupId); - if (splitPropertySetId.size() == 1) + if (splitPropertyGroupId.size() == 1) { - return PropertySet::AddPropertySet(propertySetId, m_propertyLayout.m_propertySets); + return PropertyGroup::AddPropertyGroup(propertyGroupId, m_propertyLayout.m_propertyGroups); } - PropertySet* parentPropertySet = FindPropertySet(splitPropertySetId[0]); + PropertyGroup* parentPropertyGroup = FindPropertyGroup(splitPropertyGroupId[0]); - if (!parentPropertySet) + if (!parentPropertyGroup) { - AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(splitPropertySetId[0])); + AZ_Error("Material source data", false, "PropertyGroup '%.*s' does not exists", AZ_STRING_ARG(splitPropertyGroupId[0])); return nullptr; } - return parentPropertySet->AddPropertySet(splitPropertySetId[1]); + return parentPropertyGroup->AddPropertyGroup(splitPropertyGroupId[1]); } MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::AddProperty(AZStd::string_view propertyId) @@ -232,40 +232,40 @@ namespace AZ if (splitPropertyId.size() == 1) { - AZ_Error("Material source data", false, "Property id '%.*s' is invalid. Properties must be added to a PropertySet (i.e. \"general.%.*s\").", AZ_STRING_ARG(propertyId), AZ_STRING_ARG(propertyId)); + AZ_Error("Material source data", false, "Property id '%.*s' is invalid. Properties must be added to a PropertyGroup (i.e. \"general.%.*s\").", AZ_STRING_ARG(propertyId), AZ_STRING_ARG(propertyId)); return nullptr; } - PropertySet* parentPropertySet = FindPropertySet(splitPropertyId[0]); + PropertyGroup* parentPropertyGroup = FindPropertyGroup(splitPropertyId[0]); - if (!parentPropertySet) + if (!parentPropertyGroup) { - AZ_Error("Material source data", false, "PropertySet '%.*s' does not exists", AZ_STRING_ARG(splitPropertyId[0])); + AZ_Error("Material source data", false, "PropertyGroup '%.*s' does not exists", AZ_STRING_ARG(splitPropertyId[0])); return nullptr; } - return parentPropertySet->AddProperty(splitPropertyId[1]); + return parentPropertyGroup->AddProperty(splitPropertyId[1]); } - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList) const + const MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::FindPropertyGroup(AZStd::span parsedPropertyGroupId, AZStd::span> inPropertyGroupList) const { - for (const auto& propertySet : inPropertySetList) + for (const auto& propertyGroup : inPropertyGroupList) { - if (propertySet->m_name != parsedPropertySetId[0]) + if (propertyGroup->m_name != parsedPropertyGroupId[0]) { continue; } - else if (parsedPropertySetId.size() == 1) + else if (parsedPropertyGroupId.size() == 1) { - return propertySet.get(); + return propertyGroup.get(); } else { - AZStd::span subPath{parsedPropertySetId.begin() + 1, parsedPropertySetId.end()}; + AZStd::span subPath{parsedPropertyGroupId.begin() + 1, parsedPropertyGroupId.end()}; if (!subPath.empty()) { - const MaterialTypeSourceData::PropertySet* propertySubset = FindPropertySet(subPath, propertySet->m_propertySets); + const MaterialTypeSourceData::PropertyGroup* propertySubset = FindPropertyGroup(subPath, propertyGroup->m_propertyGroups); if (propertySubset) { return propertySubset; @@ -277,36 +277,36 @@ namespace AZ return nullptr; } - MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::span parsedPropertySetId, AZStd::span> inPropertySetList) + MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::FindPropertyGroup(AZStd::span parsedPropertyGroupId, AZStd::span> inPropertyGroupList) { - return const_cast(const_cast(this)->FindPropertySet(parsedPropertySetId, inPropertySetList)); + return const_cast(const_cast(this)->FindPropertyGroup(parsedPropertyGroupId, inPropertyGroupList)); } - const MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) const + const MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::FindPropertyGroup(AZStd::string_view propertyGroupId) const { - AZStd::vector tokens = TokenizeId(propertySetId); - return FindPropertySet(tokens, m_propertyLayout.m_propertySets); + AZStd::vector tokens = TokenizeId(propertyGroupId); + return FindPropertyGroup(tokens, m_propertyLayout.m_propertyGroups); } - MaterialTypeSourceData::PropertySet* MaterialTypeSourceData::FindPropertySet(AZStd::string_view propertySetId) + MaterialTypeSourceData::PropertyGroup* MaterialTypeSourceData::FindPropertyGroup(AZStd::string_view propertyGroupId) { - AZStd::vector tokens = TokenizeId(propertySetId); - return FindPropertySet(tokens, m_propertyLayout.m_propertySets); + AZStd::vector tokens = TokenizeId(propertyGroupId); + return FindPropertyGroup(tokens, m_propertyLayout.m_propertyGroups); } const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty( AZStd::span parsedPropertyId, - AZStd::span> inPropertySetList) const + AZStd::span> inPropertyGroupList) const { - for (const auto& propertySet : inPropertySetList) + for (const auto& propertyGroup : inPropertyGroupList) { - if (propertySet->m_name == parsedPropertyId[0]) + if (propertyGroup->m_name == parsedPropertyId[0]) { AZStd::span subPath {parsedPropertyId.begin() + 1, parsedPropertyId.end()}; if (subPath.size() == 1) { - for (AZStd::unique_ptr& property : propertySet->m_properties) + for (AZStd::unique_ptr& property : propertyGroup->m_properties) { if (property->GetName() == subPath[0]) { @@ -316,7 +316,7 @@ namespace AZ } else if(subPath.size() > 1) { - const MaterialTypeSourceData::PropertyDefinition* property = FindProperty(subPath, propertySet->m_propertySets); + const MaterialTypeSourceData::PropertyDefinition* property = FindProperty(subPath, propertyGroup->m_propertyGroups); if (property) { return property; @@ -328,21 +328,21 @@ namespace AZ return nullptr; } - MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertySetList) + MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertyGroupList) { - return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertySetList)); + return const_cast(const_cast(this)->FindProperty(parsedPropertyId, inPropertyGroupList)); } const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) const { AZStd::vector tokens = TokenizeId(propertyId); - return FindProperty(tokens, m_propertyLayout.m_propertySets); + return FindProperty(tokens, m_propertyLayout.m_propertyGroups); } MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view propertyId) { AZStd::vector tokens = TokenizeId(propertyId); - return FindProperty(tokens, m_propertyLayout.m_propertySets); + return FindProperty(tokens, m_propertyLayout.m_propertyGroups); } AZStd::vector MaterialTypeSourceData::TokenizeId(AZStd::string_view id) @@ -376,18 +376,18 @@ namespace AZ return parts; } - bool MaterialTypeSourceData::EnumeratePropertySets(const EnumeratePropertySetsCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertySetList) const + bool MaterialTypeSourceData::EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertyGroupList) const { - for (auto& propertySet : inPropertySetList) + for (auto& propertyGroup : inPropertyGroupList) { - if (!callback(propertyNameContext, propertySet.get())) + if (!callback(propertyNameContext, propertyGroup.get())) { return false; // Stop processing } - const AZStd::string propertyNameContext2 = propertyNameContext + propertySet->m_name + "."; + const AZStd::string propertyNameContext2 = propertyNameContext + propertyGroup->m_name + "."; - if (!EnumeratePropertySets(callback, propertyNameContext2, propertySet->m_propertySets)) + if (!EnumeratePropertyGroups(callback, propertyNameContext2, propertyGroup->m_propertyGroups)) { return false; // Stop processing } @@ -396,24 +396,24 @@ namespace AZ return true; } - bool MaterialTypeSourceData::EnumeratePropertySets(const EnumeratePropertySetsCallback& callback) const + bool MaterialTypeSourceData::EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback) const { if (!callback) { return false; } - return EnumeratePropertySets(callback, {}, m_propertyLayout.m_propertySets); + return EnumeratePropertyGroups(callback, {}, m_propertyLayout.m_propertyGroups); } - bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertySetList) const + bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertyGroupList) const { - for (auto& propertySet : inPropertySetList) + for (auto& propertyGroup : inPropertyGroupList) { - const AZStd::string propertyNameContext2 = propertyNameContext + propertySet->m_name + "."; + const AZStd::string propertyNameContext2 = propertyNameContext + propertyGroup->m_name + "."; - for (auto& property : propertySet->m_properties) + for (auto& property : propertyGroup->m_properties) { if (!callback(propertyNameContext2, property.get())) { @@ -421,7 +421,7 @@ namespace AZ } } - if (!EnumerateProperties(callback, propertyNameContext2, propertySet->m_propertySets)) + if (!EnumerateProperties(callback, propertyNameContext2, propertyGroup->m_propertyGroups)) { return false; // Stop processing } @@ -437,7 +437,7 @@ namespace AZ return false; } - return EnumerateProperties(callback, {}, m_propertyLayout.m_propertySets); + return EnumerateProperties(callback, {}, m_propertyLayout.m_propertyGroups); } bool MaterialTypeSourceData::ConvertToNewDataFormat() @@ -450,18 +450,18 @@ namespace AZ const auto& propertyList = propertyListItr->second; for (auto& propertyDefinition : propertyList) { - PropertySet* propertySet = FindPropertySet(group.m_name); + PropertyGroup* propertyGroup = FindPropertyGroup(group.m_name); - if (!propertySet) + if (!propertyGroup) { - m_propertyLayout.m_propertySets.emplace_back(AZStd::make_unique()); - m_propertyLayout.m_propertySets.back()->m_name = group.m_name; - m_propertyLayout.m_propertySets.back()->m_displayName = group.m_displayName; - m_propertyLayout.m_propertySets.back()->m_description = group.m_description; - propertySet = m_propertyLayout.m_propertySets.back().get(); + m_propertyLayout.m_propertyGroups.emplace_back(AZStd::make_unique()); + m_propertyLayout.m_propertyGroups.back()->m_name = group.m_name; + m_propertyLayout.m_propertyGroups.back()->m_displayName = group.m_displayName; + m_propertyLayout.m_propertyGroups.back()->m_description = group.m_description; + propertyGroup = m_propertyLayout.m_propertyGroups.back().get(); } - PropertyDefinition* newProperty = propertySet->AddProperty(propertyDefinition.GetName()); + PropertyDefinition* newProperty = propertyGroup->AddProperty(propertyDefinition.GetName()); *newProperty = propertyDefinition; } @@ -533,9 +533,9 @@ namespace AZ const AZStd::string& materialTypeSourceFilePath, MaterialTypeAssetCreator& materialTypeAssetCreator, AZStd::vector& propertyNameContext, - const MaterialTypeSourceData::PropertySet* propertySet) const + const MaterialTypeSourceData::PropertyGroup* propertyGroup) const { - for (const AZStd::unique_ptr& property : propertySet->m_properties) + for (const AZStd::unique_ptr& property : propertyGroup->m_properties) { // Register the property... @@ -547,15 +547,15 @@ namespace AZ return false; } - auto propertySetIter = AZStd::find_if(propertySet->GetPropertySets().begin(), propertySet->GetPropertySets().end(), - [&property](const AZStd::unique_ptr& existingPropertySet) + auto propertyGroupIter = AZStd::find_if(propertyGroup->GetPropertyGroups().begin(), propertyGroup->GetPropertyGroups().end(), + [&property](const AZStd::unique_ptr& existingPropertyGroup) { - return existingPropertySet->GetName() == property->GetName(); + return existingPropertyGroup->GetName() == property->GetName(); }); - if (propertySetIter != propertySet->GetPropertySets().end()) + if (propertyGroupIter != propertyGroup->GetPropertyGroups().end()) { - AZ_Error("Material source data", false, "Material property '%s' collides with a PropertySet with the same ID.", propertyId.GetCStr()); + AZ_Error("Material source data", false, "Material property '%s' collides with a PropertyGroup with the same ID.", propertyId.GetCStr()); return false; } @@ -650,7 +650,7 @@ namespace AZ } } - for (const AZStd::unique_ptr& propertySubset : propertySet->m_propertySets) + for (const AZStd::unique_ptr& propertySubset : propertyGroup->m_propertyGroups) { propertyNameContext.push_back(propertySubset->m_name); @@ -670,7 +670,7 @@ namespace AZ // We cannot create the MaterialFunctor until after all the properties are added because // CreateFunctor() may need to look up properties in the MaterialPropertiesLayout - for (auto& functorData : propertySet->m_materialFunctorSourceData) + for (auto& functorData : propertyGroup->m_materialFunctorSourceData) { MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor( MaterialFunctorSourceData::RuntimeContext( @@ -795,11 +795,11 @@ namespace AZ } } - for (const AZStd::unique_ptr& propertySet : m_propertyLayout.m_propertySets) + for (const AZStd::unique_ptr& propertyGroup : m_propertyLayout.m_propertyGroups) { AZStd::vector propertyNameContext; - propertyNameContext.push_back(propertySet->m_name); - bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyNameContext, propertySet.get()); + propertyNameContext.push_back(propertyGroup->m_name); + bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyNameContext, propertyGroup.get()); if (!success) { diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index 7b8475bf69..2bd257d55b 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -93,7 +93,7 @@ namespace UnitTest { "version": 10, "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "general", "properties": [ @@ -471,7 +471,7 @@ namespace UnitTest const AZStd::string simpleMaterialTypeJson = R"( { "propertyLayout": { - "propertySets": + "propertyGroups": [ { "name": "general", diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index 2ecf2369f9..206073e96a 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -360,18 +360,18 @@ namespace UnitTest { MaterialTypeSourceData sourceData; - // Here we are building up multiple layers of property sets and properties, using a variety of different Add functions, - // going through the MaterialTypeSourceData or going to the PropertySet directly. + // Here we are building up multiple layers of property groups and properties, using a variety of different Add functions, + // going through the MaterialTypeSourceData or going to the PropertyGroup directly. - MaterialTypeSourceData::PropertySet* layer1 = sourceData.AddPropertySet("layer1"); - MaterialTypeSourceData::PropertySet* layer2 = sourceData.AddPropertySet("layer2"); - MaterialTypeSourceData::PropertySet* blend = sourceData.AddPropertySet("blend"); + MaterialTypeSourceData::PropertyGroup* layer1 = sourceData.AddPropertyGroup("layer1"); + MaterialTypeSourceData::PropertyGroup* layer2 = sourceData.AddPropertyGroup("layer2"); + MaterialTypeSourceData::PropertyGroup* blend = sourceData.AddPropertyGroup("blend"); - MaterialTypeSourceData::PropertySet* layer1_baseColor = layer1->AddPropertySet("baseColor"); - MaterialTypeSourceData::PropertySet* layer2_baseColor = layer2->AddPropertySet("baseColor"); + MaterialTypeSourceData::PropertyGroup* layer1_baseColor = layer1->AddPropertyGroup("baseColor"); + MaterialTypeSourceData::PropertyGroup* layer2_baseColor = layer2->AddPropertyGroup("baseColor"); - MaterialTypeSourceData::PropertySet* layer1_roughness = sourceData.AddPropertySet("layer1.roughness"); - MaterialTypeSourceData::PropertySet* layer2_roughness = sourceData.AddPropertySet("layer2.roughness"); + MaterialTypeSourceData::PropertyGroup* layer1_roughness = sourceData.AddPropertyGroup("layer1.roughness"); + MaterialTypeSourceData::PropertyGroup* layer2_roughness = sourceData.AddPropertyGroup("layer2.roughness"); MaterialTypeSourceData::PropertyDefinition* layer1_baseColor_texture = layer1_baseColor->AddProperty("texture"); MaterialTypeSourceData::PropertyDefinition* layer2_baseColor_texture = layer2_baseColor->AddProperty("texture"); @@ -380,9 +380,9 @@ namespace UnitTest MaterialTypeSourceData::PropertyDefinition* layer2_roughness_texture = sourceData.AddProperty("layer2.roughness.texture"); // We're doing clear coat only on layer2, for brevity - MaterialTypeSourceData::PropertySet* layer2_clearCoat = layer2->AddPropertySet("clearCoat"); - MaterialTypeSourceData::PropertySet* layer2_clearCoat_roughness = layer2_clearCoat->AddPropertySet("roughness"); - MaterialTypeSourceData::PropertySet* layer2_clearCoat_normal = layer2_clearCoat->AddPropertySet("normal"); + MaterialTypeSourceData::PropertyGroup* layer2_clearCoat = layer2->AddPropertyGroup("clearCoat"); + MaterialTypeSourceData::PropertyGroup* layer2_clearCoat_roughness = layer2_clearCoat->AddPropertyGroup("roughness"); + MaterialTypeSourceData::PropertyGroup* layer2_clearCoat_normal = layer2_clearCoat->AddPropertyGroup("normal"); MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_enabled = layer2_clearCoat->AddProperty("enabled"); MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_roughness_texture = layer2_clearCoat_roughness->AddProperty("texture"); MaterialTypeSourceData::PropertyDefinition* layer2_clearCoat_normal_texture = layer2_clearCoat_normal->AddProperty("texture"); @@ -396,27 +396,27 @@ namespace UnitTest EXPECT_EQ(nullptr, sourceData.FindProperty("layer1.DoesNotExist")); EXPECT_EQ(nullptr, sourceData.FindProperty("layer1.baseColor.DoesNotExist")); EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor.texture")); - EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor")); // This is a property set, not a property - EXPECT_EQ(nullptr, sourceData.FindPropertySet("baseColor.texture")); // This is a property, not a property set + EXPECT_EQ(nullptr, sourceData.FindProperty("baseColor")); // This is a property group, not a property + EXPECT_EQ(nullptr, sourceData.FindPropertyGroup("baseColor.texture")); // This is a property, not a property group - EXPECT_EQ(layer1, sourceData.FindPropertySet("layer1")); - EXPECT_EQ(layer2, sourceData.FindPropertySet("layer2")); - EXPECT_EQ(blend, sourceData.FindPropertySet("blend")); + EXPECT_EQ(layer1, sourceData.FindPropertyGroup("layer1")); + EXPECT_EQ(layer2, sourceData.FindPropertyGroup("layer2")); + EXPECT_EQ(blend, sourceData.FindPropertyGroup("blend")); - EXPECT_EQ(layer1_baseColor, sourceData.FindPropertySet("layer1.baseColor")); - EXPECT_EQ(layer2_baseColor, sourceData.FindPropertySet("layer2.baseColor")); + EXPECT_EQ(layer1_baseColor, sourceData.FindPropertyGroup("layer1.baseColor")); + EXPECT_EQ(layer2_baseColor, sourceData.FindPropertyGroup("layer2.baseColor")); - EXPECT_EQ(layer1_roughness, sourceData.FindPropertySet("layer1.roughness")); - EXPECT_EQ(layer2_roughness, sourceData.FindPropertySet("layer2.roughness")); + EXPECT_EQ(layer1_roughness, sourceData.FindPropertyGroup("layer1.roughness")); + EXPECT_EQ(layer2_roughness, sourceData.FindPropertyGroup("layer2.roughness")); EXPECT_EQ(layer1_baseColor_texture, sourceData.FindProperty("layer1.baseColor.texture")); EXPECT_EQ(layer2_baseColor_texture, sourceData.FindProperty("layer2.baseColor.texture")); EXPECT_EQ(layer1_roughness_texture, sourceData.FindProperty("layer1.roughness.texture")); EXPECT_EQ(layer2_roughness_texture, sourceData.FindProperty("layer2.roughness.texture")); - EXPECT_EQ(layer2_clearCoat, sourceData.FindPropertySet("layer2.clearCoat")); - EXPECT_EQ(layer2_clearCoat_roughness, sourceData.FindPropertySet("layer2.clearCoat.roughness")); - EXPECT_EQ(layer2_clearCoat_normal, sourceData.FindPropertySet("layer2.clearCoat.normal")); + EXPECT_EQ(layer2_clearCoat, sourceData.FindPropertyGroup("layer2.clearCoat")); + EXPECT_EQ(layer2_clearCoat_roughness, sourceData.FindPropertyGroup("layer2.clearCoat.roughness")); + EXPECT_EQ(layer2_clearCoat_normal, sourceData.FindPropertyGroup("layer2.clearCoat.normal")); EXPECT_EQ(layer2_clearCoat_enabled, sourceData.FindProperty("layer2.clearCoat.enabled")); EXPECT_EQ(layer2_clearCoat_roughness_texture, sourceData.FindProperty("layer2.clearCoat.roughness.texture")); @@ -425,39 +425,39 @@ namespace UnitTest EXPECT_EQ(blend_factor, sourceData.FindProperty("blend.factor")); - // Check EnumeratePropertySets + // Check EnumeratePropertyGroups - struct EnumeratePropertySetsResult + struct EnumeratePropertyGroupsResult { AZStd::string m_propertyIdContext; - const MaterialTypeSourceData::PropertySet* m_propertySet; + const MaterialTypeSourceData::PropertyGroup* m_propertyGroup; - void Check(AZStd::string expectedIdContext, const MaterialTypeSourceData::PropertySet* expectedPropertySet) + void Check(AZStd::string expectedIdContext, const MaterialTypeSourceData::PropertyGroup* expectedPropertyGroup) { EXPECT_EQ(expectedIdContext, m_propertyIdContext); - EXPECT_EQ(expectedPropertySet, m_propertySet); + EXPECT_EQ(expectedPropertyGroup, m_propertyGroup); } }; - AZStd::vector enumeratePropertySetsResults; + AZStd::vector enumeratePropertyGroupsResults; - sourceData.EnumeratePropertySets([&enumeratePropertySetsResults](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertySet* propertySet) + sourceData.EnumeratePropertyGroups([&enumeratePropertyGroupsResults](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertyGroup* propertyGroup) { - enumeratePropertySetsResults.push_back(EnumeratePropertySetsResult{propertyIdContext, propertySet}); + enumeratePropertyGroupsResults.push_back(EnumeratePropertyGroupsResult{propertyIdContext, propertyGroup}); return true; }); int resultIndex = 0; - enumeratePropertySetsResults[resultIndex++].Check("", layer1); - enumeratePropertySetsResults[resultIndex++].Check("layer1.", layer1_baseColor); - enumeratePropertySetsResults[resultIndex++].Check("layer1.", layer1_roughness); - enumeratePropertySetsResults[resultIndex++].Check("", layer2); - enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_baseColor); - enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_roughness); - enumeratePropertySetsResults[resultIndex++].Check("layer2.", layer2_clearCoat); - enumeratePropertySetsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_roughness); - enumeratePropertySetsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_normal); - enumeratePropertySetsResults[resultIndex++].Check("", blend); - EXPECT_EQ(resultIndex, enumeratePropertySetsResults.size()); + enumeratePropertyGroupsResults[resultIndex++].Check("", layer1); + enumeratePropertyGroupsResults[resultIndex++].Check("layer1.", layer1_baseColor); + enumeratePropertyGroupsResults[resultIndex++].Check("layer1.", layer1_roughness); + enumeratePropertyGroupsResults[resultIndex++].Check("", layer2); + enumeratePropertyGroupsResults[resultIndex++].Check("layer2.", layer2_baseColor); + enumeratePropertyGroupsResults[resultIndex++].Check("layer2.", layer2_roughness); + enumeratePropertyGroupsResults[resultIndex++].Check("layer2.", layer2_clearCoat); + enumeratePropertyGroupsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_roughness); + enumeratePropertyGroupsResults[resultIndex++].Check("layer2.clearCoat.", layer2_clearCoat_normal); + enumeratePropertyGroupsResults[resultIndex++].Check("", blend); + EXPECT_EQ(resultIndex, enumeratePropertyGroupsResults.size()); // Check EnumerateProperties @@ -497,39 +497,39 @@ namespace UnitTest { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("main"); ErrorMessageFinder errorMessageFinder; errorMessageFinder.AddExpectedErrorMessage("'' is not a valid identifier"); errorMessageFinder.AddExpectedErrorMessage("'main.' is not a valid identifier"); errorMessageFinder.AddExpectedErrorMessage("'base-color' is not a valid identifier"); - EXPECT_FALSE(propertySet->AddProperty("")); - EXPECT_FALSE(propertySet->AddProperty("main.")); + EXPECT_FALSE(propertyGroup->AddProperty("")); + EXPECT_FALSE(propertyGroup->AddProperty("main.")); EXPECT_FALSE(sourceData.AddProperty("main.base-color")); - EXPECT_TRUE(propertySet->GetProperties().empty()); + EXPECT_TRUE(propertyGroup->GetProperties().empty()); errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_InvalidName) + TEST_F(MaterialTypeSourceDataTests, AddPropertyGroup_Error_InvalidName) { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); ErrorMessageFinder errorMessageFinder; errorMessageFinder.AddExpectedErrorMessage("'' is not a valid identifier", 2); errorMessageFinder.AddExpectedErrorMessage("'base-color' is not a valid identifier"); errorMessageFinder.AddExpectedErrorMessage("'look@it' is not a valid identifier"); - EXPECT_FALSE(propertySet->AddPropertySet("")); - EXPECT_FALSE(sourceData.AddPropertySet("")); - EXPECT_FALSE(sourceData.AddPropertySet("base-color")); - EXPECT_FALSE(sourceData.AddPropertySet("general.look@it")); + EXPECT_FALSE(propertyGroup->AddPropertyGroup("")); + EXPECT_FALSE(sourceData.AddPropertyGroup("")); + EXPECT_FALSE(sourceData.AddPropertyGroup("base-color")); + EXPECT_FALSE(sourceData.AddPropertyGroup("general.look@it")); - EXPECT_TRUE(propertySet->GetProperties().empty()); + EXPECT_TRUE(propertyGroup->GetProperties().empty()); errorMessageFinder.CheckExpectedErrorsFound(); } @@ -538,16 +538,16 @@ namespace UnitTest { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("main"); ErrorMessageFinder errorMessageFinder; - errorMessageFinder.AddExpectedErrorMessage("PropertySet 'main' already contains a property named 'foo'", 2); + errorMessageFinder.AddExpectedErrorMessage("PropertyGroup 'main' already contains a property named 'foo'", 2); - EXPECT_TRUE(propertySet->AddProperty("foo")); - EXPECT_FALSE(propertySet->AddProperty("foo")); + EXPECT_TRUE(propertyGroup->AddProperty("foo")); + EXPECT_FALSE(propertyGroup->AddProperty("foo")); EXPECT_FALSE(sourceData.AddProperty("main.foo")); - EXPECT_EQ(propertySet->GetProperties().size(), 1); + EXPECT_EQ(propertyGroup->GetProperties().size(), 1); errorMessageFinder.CheckExpectedErrorsFound(); } @@ -555,66 +555,66 @@ namespace UnitTest TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_AddLooseProperty) { MaterialTypeSourceData sourceData; - ErrorMessageFinder errorMessageFinder("Property id 'foo' is invalid. Properties must be added to a PropertySet"); + ErrorMessageFinder errorMessageFinder("Property id 'foo' is invalid. Properties must be added to a PropertyGroup"); EXPECT_FALSE(sourceData.AddProperty("foo")); errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_PropertySetDoesNotExist ) + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_PropertyGroupDoesNotExist ) { MaterialTypeSourceData sourceData; - ErrorMessageFinder errorMessageFinder("PropertySet 'DNE' does not exists"); + ErrorMessageFinder errorMessageFinder("PropertyGroup 'DNE' does not exists"); EXPECT_FALSE(sourceData.AddProperty("DNE.foo")); errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_PropertySetDoesNotExist ) + TEST_F(MaterialTypeSourceDataTests, AddPropertyGroup_Error_PropertyGroupDoesNotExist ) { MaterialTypeSourceData sourceData; - ErrorMessageFinder errorMessageFinder("PropertySet 'DNE' does not exists"); - EXPECT_FALSE(sourceData.AddPropertySet("DNE.foo")); + ErrorMessageFinder errorMessageFinder("PropertyGroup 'DNE' does not exists"); + EXPECT_FALSE(sourceData.AddPropertyGroup("DNE.foo")); errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_AddDuplicatePropertySet) + TEST_F(MaterialTypeSourceDataTests, AddPropertyGroup_Error_AddDuplicatePropertyGroup) { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("main"); - sourceData.AddPropertySet("main.level2"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("main"); + sourceData.AddPropertyGroup("main.level2"); ErrorMessageFinder errorMessageFinder; - errorMessageFinder.AddExpectedErrorMessage("PropertySet named 'main' already exists", 1); - errorMessageFinder.AddExpectedErrorMessage("PropertySet named 'level2' already exists", 2); + errorMessageFinder.AddExpectedErrorMessage("PropertyGroup named 'main' already exists", 1); + errorMessageFinder.AddExpectedErrorMessage("PropertyGroup named 'level2' already exists", 2); - EXPECT_FALSE(sourceData.AddPropertySet("main")); - EXPECT_FALSE(sourceData.AddPropertySet("main.level2")); - EXPECT_FALSE(propertySet->AddPropertySet("level2")); + EXPECT_FALSE(sourceData.AddPropertyGroup("main")); + EXPECT_FALSE(sourceData.AddPropertyGroup("main.level2")); + EXPECT_FALSE(propertyGroup->AddPropertyGroup("level2")); errorMessageFinder.CheckExpectedErrorsFound(); - EXPECT_EQ(sourceData.GetPropertyLayout().m_propertySets.size(), 1); - EXPECT_EQ(propertySet->GetPropertySets().size(), 1); + EXPECT_EQ(sourceData.GetPropertyLayout().m_propertyGroups.size(), 1); + EXPECT_EQ(propertyGroup->GetPropertyGroups().size(), 1); } - TEST_F(MaterialTypeSourceDataTests, AddPropertySet_Error_NameCollidesWithProperty ) + TEST_F(MaterialTypeSourceDataTests, AddPropertyGroup_Error_NameCollidesWithProperty ) { MaterialTypeSourceData sourceData; - sourceData.AddPropertySet("main"); + sourceData.AddPropertyGroup("main"); sourceData.AddProperty("main.foo"); - ErrorMessageFinder errorMessageFinder("PropertySet name 'foo' collides with a Property of the same name"); - EXPECT_FALSE(sourceData.AddPropertySet("main.foo")); + ErrorMessageFinder errorMessageFinder("PropertyGroup name 'foo' collides with a Property of the same name"); + EXPECT_FALSE(sourceData.AddPropertyGroup("main.foo")); errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_NameCollidesWithPropertySet ) + TEST_F(MaterialTypeSourceDataTests, AddProperty_Error_NameCollidesWithPropertyGroup ) { MaterialTypeSourceData sourceData; - sourceData.AddPropertySet("main"); - sourceData.AddPropertySet("main.foo"); + sourceData.AddPropertyGroup("main"); + sourceData.AddPropertyGroup("main.foo"); - ErrorMessageFinder errorMessageFinder("Property name 'foo' collides with a PropertySet of the same name"); + ErrorMessageFinder errorMessageFinder("Property name 'foo' collides with a PropertyGroup of the same name"); EXPECT_FALSE(sourceData.AddProperty("main.foo")); errorMessageFinder.CheckExpectedErrorsFound(); } @@ -627,11 +627,11 @@ namespace UnitTest sourceData.m_uvNameMap["UV1"] = "Unwrapped"; sourceData.m_uvNameMap["UV2"] = "Other"; - sourceData.AddPropertySet("a"); - sourceData.AddPropertySet("a.b"); - sourceData.AddPropertySet("c"); - sourceData.AddPropertySet("c.d"); - sourceData.AddPropertySet("c.d.e"); + sourceData.AddPropertyGroup("a"); + sourceData.AddPropertyGroup("a.b"); + sourceData.AddPropertyGroup("c"); + sourceData.AddPropertyGroup("c.d"); + sourceData.AddPropertyGroup("c.d.e"); MaterialTypeSourceData::PropertyDefinition* enum1 = sourceData.AddProperty("a.enum1"); MaterialTypeSourceData::PropertyDefinition* enum2 = sourceData.AddProperty("a.b.enum2"); @@ -820,8 +820,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyBool"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyBool"); property->m_displayName = "My Bool"; property->m_description = "This is a bool"; property->m_dataType = MaterialPropertyDataType::Bool; @@ -845,8 +845,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyFloat"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyFloat"); property->m_displayName = "My Float"; property->m_description = "This is a float"; property->m_min = 0.0f; @@ -874,8 +874,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ TestShaderFilename }); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyImage"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyImage"); property->m_displayName = "My Image"; property->m_description = "This is an image"; property->m_dataType = MaterialPropertyDataType::Image; @@ -898,8 +898,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyInt"); property->m_displayName = "My Integer"; property->m_dataType = MaterialPropertyDataType::Int; property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("o_foo"), 0}); @@ -920,8 +920,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyInt"); property->m_dataType = MaterialPropertyDataType::Int; property->m_outputConnections.push_back(MaterialTypeSourceData::PropertyConnection{MaterialPropertyOutputType::ShaderOption, AZStd::string("DoesNotExist"), 0}); @@ -937,7 +937,7 @@ namespace UnitTest const AZStd::string inputJson = R"( { "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "not a valid name because it has spaces", "properties": [ @@ -967,7 +967,7 @@ namespace UnitTest const AZStd::string inputJson = R"( { "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "general", "properties": [ @@ -997,7 +997,7 @@ namespace UnitTest const AZStd::string inputJson = R"( { "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "general", "properties": [ @@ -1027,12 +1027,12 @@ namespace UnitTest errorMessageFinder.CheckExpectedErrorsFound(); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_PropertyAndPropertySetNameCollision) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_Error_PropertyAndPropertyGroupNameCollision) { const AZStd::string inputJson = R"( { "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "general", "properties": [ @@ -1041,7 +1041,7 @@ namespace UnitTest "type": "Bool" } ], - "propertySets": [ + "propertyGroups": [ { "name": "foo", "properties": [ @@ -1062,7 +1062,7 @@ namespace UnitTest JsonTestResult loadResult = LoadTestDataFromJson(sourceData, inputJson); EXPECT_EQ(loadResult.m_jsonResultCode.GetProcessing(), JsonSerializationResult::Processing::Completed); - ErrorMessageFinder errorMessageFinder("Material property 'general.foo' collides with a PropertySet with the same ID"); + ErrorMessageFinder errorMessageFinder("Material property 'general.foo' collides with a PropertyGroup with the same ID"); auto materialTypeOutcome = sourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()); EXPECT_FALSE(materialTypeOutcome.IsSuccess()); errorMessageFinder.CheckExpectedErrorsFound(); @@ -1117,8 +1117,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderB.shader" }); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{ "shaderC.shader" }); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyInt"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyInt"); property->m_displayName = "Integer"; property->m_description = "Integer property that is connected to multiple shader settings"; @@ -1176,8 +1176,8 @@ namespace UnitTest { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("floatForFunctor"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("floatForFunctor"); property->m_displayName = "Float for Functor"; property->m_description = "This float is processed by a functor, not with a direct connection"; @@ -1221,9 +1221,9 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property1 = propertySet->AddProperty("EnableSpecialPassA"); - MaterialTypeSourceData::PropertyDefinition* property2 = propertySet->AddProperty("EnableSpecialPassB"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property1 = propertyGroup->AddProperty("EnableSpecialPassA"); + MaterialTypeSourceData::PropertyDefinition* property2 = propertyGroup->AddProperty("EnableSpecialPassB"); property1->m_displayName = property2->m_displayName = "Enable Special Pass"; property1->m_description = property2->m_description = "This is a bool to enable an extra shader/pass"; @@ -1279,8 +1279,8 @@ namespace UnitTest sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); sourceData.m_shaderCollection.push_back(MaterialTypeSourceData::ShaderVariantReferenceData{TestShaderFilename}); - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("MyProperty"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("MyProperty"); property->m_dataType = MaterialPropertyDataType::Bool; // Note that we don't fill property->m_outputConnections because this is not a direct-connected property @@ -1307,12 +1307,12 @@ namespace UnitTest EXPECT_TRUE(materialTypeAsset->GetShaderCollection()[0].MaterialOwnsShaderOption(Name{"o_bar"})); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_FunctorIsInsidePropertySet) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_FunctorIsInsidePropertyGroup) { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertySet* propertySet = sourceData.AddPropertySet("general"); - MaterialTypeSourceData::PropertyDefinition* property = propertySet->AddProperty("floatForFunctor"); + MaterialTypeSourceData::PropertyGroup* propertyGroup = sourceData.AddPropertyGroup("general"); + MaterialTypeSourceData::PropertyDefinition* property = propertyGroup->AddProperty("floatForFunctor"); property->m_dataType = MaterialPropertyDataType::Float; @@ -1360,7 +1360,7 @@ namespace UnitTest property->m_value = value; }; - sourceData.AddPropertySet("general"); + sourceData.AddPropertyGroup("general"); addProperty(MaterialPropertyDataType::Bool, "general.MyBool", "m_bool", true); addProperty(MaterialPropertyDataType::Float, "general.MyFloat", "m_float", 1.2f); @@ -1387,7 +1387,7 @@ namespace UnitTest CheckPropertyValue>(materialTypeAsset, Name{"general.MyImage"}, m_testImageAsset); } - TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_NestedPropertySets) + TEST_F(MaterialTypeSourceDataTests, CreateMaterialTypeAsset_NestedPropertyGroups) { RHI::Ptr layeredMaterialSrgLayout = RHI::ShaderResourceGroupLayout::Create(); layeredMaterialSrgLayout->SetName(Name{"MaterialSrg"}); @@ -1428,16 +1428,16 @@ namespace UnitTest property->m_value = value; }; - sourceData.AddPropertySet("layer1"); - sourceData.AddPropertySet("layer2"); - sourceData.AddPropertySet("blend"); - sourceData.AddPropertySet("layer1.baseColor"); - sourceData.AddPropertySet("layer2.baseColor"); - sourceData.AddPropertySet("layer1.roughness"); - sourceData.AddPropertySet("layer2.roughness"); - sourceData.AddPropertySet("layer2.clearCoat"); - sourceData.AddPropertySet("layer2.clearCoat.roughness"); - sourceData.AddPropertySet("layer2.clearCoat.normal"); + sourceData.AddPropertyGroup("layer1"); + sourceData.AddPropertyGroup("layer2"); + sourceData.AddPropertyGroup("blend"); + sourceData.AddPropertyGroup("layer1.baseColor"); + sourceData.AddPropertyGroup("layer2.baseColor"); + sourceData.AddPropertyGroup("layer1.roughness"); + sourceData.AddPropertyGroup("layer2.roughness"); + sourceData.AddPropertyGroup("layer2.clearCoat"); + sourceData.AddPropertyGroup("layer2.clearCoat.roughness"); + sourceData.AddPropertyGroup("layer2.clearCoat.normal"); addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer1.baseColor.texture", "m_layer1_baseColor_texture", AZStd::string{TestImageFilename}); addSrgProperty(MaterialPropertyDataType::Image, MaterialPropertyOutputType::ShaderInput, "layer1.roughness.texture", "m_layer1_roughness_texture", AZStd::string{TestImageFilename}); @@ -1487,7 +1487,7 @@ namespace UnitTest } ], "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "groupA", "displayName": "Property Group A", @@ -1545,8 +1545,8 @@ namespace UnitTest { "name": "groupC", "displayName": "Property Group C", - "description": "Property group C has a nested property set", - "propertySets": [ + "description": "Property group C has a nested property group", + "propertyGroups": [ { "name": "groupD", "displayName": "Property Group D", @@ -1616,27 +1616,27 @@ namespace UnitTest EXPECT_EQ(material.m_versionUpdates[0].m_actions[0].m_renameTo, "groupA.foo"); - EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 3); - EXPECT_TRUE(material.FindPropertySet("groupA") != nullptr); - EXPECT_TRUE(material.FindPropertySet("groupB") != nullptr); - EXPECT_TRUE(material.FindPropertySet("groupC") != nullptr); - EXPECT_TRUE(material.FindPropertySet("groupC.groupD") != nullptr); - EXPECT_TRUE(material.FindPropertySet("groupC.groupE") != nullptr); - EXPECT_EQ(material.FindPropertySet("groupA")->GetDisplayName(), "Property Group A"); - EXPECT_EQ(material.FindPropertySet("groupB")->GetDisplayName(), "Property Group B"); - EXPECT_EQ(material.FindPropertySet("groupC")->GetDisplayName(), "Property Group C"); - EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetDisplayName(), "Property Group D"); - EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetDisplayName(), "Property Group E"); - EXPECT_EQ(material.FindPropertySet("groupA")->GetDescription(), "Description of property group A"); - EXPECT_EQ(material.FindPropertySet("groupB")->GetDescription(), "Description of property group B"); - EXPECT_EQ(material.FindPropertySet("groupC")->GetDescription(), "Property group C has a nested property set"); - EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetDescription(), "Description of property group D"); - EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetDescription(), "Description of property group E"); - EXPECT_EQ(material.FindPropertySet("groupA")->GetProperties().size(), 2); - EXPECT_EQ(material.FindPropertySet("groupB")->GetProperties().size(), 2); - EXPECT_EQ(material.FindPropertySet("groupC")->GetProperties().size(), 0); - EXPECT_EQ(material.FindPropertySet("groupC.groupD")->GetProperties().size(), 1); - EXPECT_EQ(material.FindPropertySet("groupC.groupE")->GetProperties().size(), 1); + EXPECT_EQ(material.GetPropertyLayout().m_propertyGroups.size(), 3); + EXPECT_TRUE(material.FindPropertyGroup("groupA") != nullptr); + EXPECT_TRUE(material.FindPropertyGroup("groupB") != nullptr); + EXPECT_TRUE(material.FindPropertyGroup("groupC") != nullptr); + EXPECT_TRUE(material.FindPropertyGroup("groupC.groupD") != nullptr); + EXPECT_TRUE(material.FindPropertyGroup("groupC.groupE") != nullptr); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetDisplayName(), "Property Group A"); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetDisplayName(), "Property Group B"); + EXPECT_EQ(material.FindPropertyGroup("groupC")->GetDisplayName(), "Property Group C"); + EXPECT_EQ(material.FindPropertyGroup("groupC.groupD")->GetDisplayName(), "Property Group D"); + EXPECT_EQ(material.FindPropertyGroup("groupC.groupE")->GetDisplayName(), "Property Group E"); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetDescription(), "Description of property group A"); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetDescription(), "Description of property group B"); + EXPECT_EQ(material.FindPropertyGroup("groupC")->GetDescription(), "Property group C has a nested property group"); + EXPECT_EQ(material.FindPropertyGroup("groupC.groupD")->GetDescription(), "Description of property group D"); + EXPECT_EQ(material.FindPropertyGroup("groupC.groupE")->GetDescription(), "Description of property group E"); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertyGroup("groupC")->GetProperties().size(), 0); + EXPECT_EQ(material.FindPropertyGroup("groupC.groupD")->GetProperties().size(), 1); + EXPECT_EQ(material.FindPropertyGroup("groupC.groupE")->GetProperties().size(), 1); EXPECT_NE(material.FindProperty("groupA.foo"), nullptr); EXPECT_NE(material.FindProperty("groupA.bar"), nullptr); @@ -1670,10 +1670,10 @@ namespace UnitTest EXPECT_EQ(material.FindProperty("groupC.groupD.foo")->m_value, -1); EXPECT_EQ(material.FindProperty("groupC.groupE.bar")->m_value, 0u); - EXPECT_EQ(material.FindPropertySet("groupA")->GetFunctors().size(), 1); - EXPECT_EQ(material.FindPropertySet("groupB")->GetFunctors().size(), 1); - Ptr functorA = material.FindPropertySet("groupA")->GetFunctors()[0]->GetActualSourceData(); - Ptr functorB = material.FindPropertySet("groupB")->GetFunctors()[0]->GetActualSourceData(); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetFunctors().size(), 1); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetFunctors().size(), 1); + Ptr functorA = material.FindPropertyGroup("groupA")->GetFunctors()[0]->GetActualSourceData(); + Ptr functorB = material.FindPropertyGroup("groupB")->GetFunctors()[0]->GetActualSourceData(); EXPECT_TRUE(azrtti_cast(functorA.get())); EXPECT_EQ(azrtti_cast(functorA.get())->m_enablePassPropertyId, "foo"); EXPECT_EQ(azrtti_cast(functorA.get())->m_shaderIndex, 1); @@ -1708,7 +1708,7 @@ namespace UnitTest // (The "store" part of the test was not included because the saved data will be the new format). // Notable differences include: // 1) the key "id" is used instead of "name" - // 2) the group metadata, property definitions, and functors are all defined in different sections rather than in a property set + // 2) the group metadata, property definitions, and functors are all defined in different sections rather than in a unified property group definition const AZStd::string inputJson = R"( { @@ -1798,25 +1798,25 @@ namespace UnitTest // Before conversion to the new format, the data is in the old place EXPECT_EQ(material.GetPropertyLayout().m_groupsOld.size(), 2); EXPECT_EQ(material.GetPropertyLayout().m_propertiesOld.size(), 2); - EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 0); + EXPECT_EQ(material.GetPropertyLayout().m_propertyGroups.size(), 0); material.ConvertToNewDataFormat(); // After conversion to the new format, the data is in the new place EXPECT_EQ(material.GetPropertyLayout().m_groupsOld.size(), 0); EXPECT_EQ(material.GetPropertyLayout().m_propertiesOld.size(), 0); - EXPECT_EQ(material.GetPropertyLayout().m_propertySets.size(), 2); + EXPECT_EQ(material.GetPropertyLayout().m_propertyGroups.size(), 2); EXPECT_EQ(material.m_description, "This is a general description about the material"); - EXPECT_TRUE(material.FindPropertySet("groupA") != nullptr); - EXPECT_TRUE(material.FindPropertySet("groupB") != nullptr); - EXPECT_EQ(material.FindPropertySet("groupA")->GetDisplayName(), "Property Group A"); - EXPECT_EQ(material.FindPropertySet("groupB")->GetDisplayName(), "Property Group B"); - EXPECT_EQ(material.FindPropertySet("groupA")->GetDescription(), "Description of property group A"); - EXPECT_EQ(material.FindPropertySet("groupB")->GetDescription(), "Description of property group B"); - EXPECT_EQ(material.FindPropertySet("groupA")->GetProperties().size(), 2); - EXPECT_EQ(material.FindPropertySet("groupB")->GetProperties().size(), 2); + EXPECT_TRUE(material.FindPropertyGroup("groupA") != nullptr); + EXPECT_TRUE(material.FindPropertyGroup("groupB") != nullptr); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetDisplayName(), "Property Group A"); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetDisplayName(), "Property Group B"); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetDescription(), "Description of property group A"); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetDescription(), "Description of property group B"); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetProperties().size(), 2); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetProperties().size(), 2); EXPECT_TRUE(material.FindProperty("groupA.foo") != nullptr); EXPECT_TRUE(material.FindProperty("groupA.bar") != nullptr); @@ -1840,10 +1840,10 @@ namespace UnitTest EXPECT_EQ(material.FindProperty("groupB.foo")->m_value, 0.5f); EXPECT_EQ(material.FindProperty("groupB.bar")->m_value, AZ::Color(0.5f, 0.5f, 0.5f, 1.0f)); - // The functors can appear either at the top level or within each property set. The format conversion + // The functors can appear either at the top level or within each property group. The format conversion // function doesn't know how to move the functors, and they will be left at the top level. - EXPECT_EQ(material.FindPropertySet("groupA")->GetFunctors().size(), 0); - EXPECT_EQ(material.FindPropertySet("groupB")->GetFunctors().size(), 0); + EXPECT_EQ(material.FindPropertyGroup("groupA")->GetFunctors().size(), 0); + EXPECT_EQ(material.FindPropertyGroup("groupB")->GetFunctors().size(), 0); EXPECT_EQ(material.m_shaderCollection.size(), 2); EXPECT_EQ(material.m_shaderCollection[0].m_shaderFilePath, "ForwardPass.shader"); @@ -1873,7 +1873,7 @@ namespace UnitTest { "description": "", "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "general", "displayName": "General", @@ -1915,7 +1915,7 @@ namespace UnitTest { MaterialTypeSourceData sourceData; - MaterialTypeSourceData::PropertyDefinition* propertySource = sourceData.AddPropertySet("general")->AddProperty("a"); + MaterialTypeSourceData::PropertyDefinition* propertySource = sourceData.AddPropertyGroup("general")->AddProperty("a"); propertySource->m_dataType = MaterialPropertyDataType::Int; propertySource->m_value = 0; diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype index 5876a3a858..641b0089a5 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR.materialtype @@ -2,7 +2,7 @@ "description": "Base Material with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", "version": 3, "propertyLayout": { - "propertySets": [ + "propertyGroups": [ { "name": "settings", "displayName": "Settings", diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 96b98cef51..c441762710 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -602,7 +602,7 @@ namespace MaterialEditor return false; } - // TODO: Support populating the Material Editor with nested property sets, not just the top level. + // TODO: Support populating the Material Editor with nested property groups, not just the top level. const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->GetName().size() - 1); sourceData.m_properties[groupName][propertyDefinition->GetName()].m_value = propertyValue; } @@ -781,14 +781,14 @@ namespace MaterialEditor // Populate the property map from a combination of source data and assets // Assets must still be used for now because they contain the final accumulated value after all other materials // in the hierarchy are applied - m_materialTypeSourceData.EnumeratePropertySets([this, &parentPropertyValues](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertySet* propertySet) + m_materialTypeSourceData.EnumeratePropertyGroups([this, &parentPropertyValues](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertyGroup* propertyGroup) { AtomToolsFramework::DynamicPropertyConfig propertyConfig; - for (const auto& propertyDefinition : propertySet->GetProperties()) + for (const auto& propertyDefinition : propertyGroup->GetProperties()) { // Assign id before conversion so it can be used in dynamic description - propertyConfig.m_id = propertyIdContext + propertySet->GetName() + "." + propertyDefinition->GetName(); + propertyConfig.m_id = propertyIdContext + propertyGroup->GetName() + "." + propertyDefinition->GetName(); const auto& propertyIndex = m_materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(propertyConfig.m_id); const bool propertyIndexInBounds = propertyIndex.IsValid() && propertyIndex.GetIndex() < m_materialAsset->GetPropertyValues().size(); @@ -801,9 +801,9 @@ namespace MaterialEditor propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(parentPropertyValues[propertyIndex.GetIndex()]); - // TODO: Support populating the Material Editor with nested property sets, not just the top level. + // TODO: Support populating the Material Editor with nested property groups, not just the top level. // (Does DynamicPropertyConfig really even need m_groupName?) - propertyConfig.m_groupName = propertySet->GetDisplayName(); + propertyConfig.m_groupName = propertyGroup->GetDisplayName(); m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); } } @@ -812,10 +812,10 @@ namespace MaterialEditor }); // Populate the property group visibility map - // TODO: Support populating the Material Editor with nested property sets, not just the top level. - for (const AZStd::unique_ptr& propertySet : m_materialTypeSourceData.GetPropertyLayout().m_propertySets) + // TODO: Support populating the Material Editor with nested property groups, not just the top level. + for (const AZStd::unique_ptr& propertyGroup : m_materialTypeSourceData.GetPropertyLayout().m_propertyGroups) { - m_propertyGroupVisibility[AZ::Name{propertySet->GetName()}] = true; + m_propertyGroupVisibility[AZ::Name{propertyGroup->GetName()}] = true; } // Adding properties for material type and parent as part of making dynamic @@ -899,14 +899,14 @@ namespace MaterialEditor } } - // Add any material functors that are located inside each property set. - bool enumerateResult = m_materialTypeSourceData.EnumeratePropertySets( - [this](const AZStd::string&, const MaterialTypeSourceData::PropertySet* propertySet) + // Add any material functors that are located inside each property group. + bool enumerateResult = m_materialTypeSourceData.EnumeratePropertyGroups( + [this](const AZStd::string&, const MaterialTypeSourceData::PropertyGroup* propertyGroup) { const MaterialFunctorSourceData::EditorContext editorContext = MaterialFunctorSourceData::EditorContext( m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); - for (Ptr functorData : propertySet->GetFunctors()) + for (Ptr functorData : propertyGroup->GetFunctors()) { MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor(editorContext); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index 3208683bf0..1402ad9f24 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -171,16 +171,16 @@ namespace MaterialEditor MaterialDocumentRequestBus::EventResult( materialTypeSourceData, m_documentId, &MaterialDocumentRequestBus::Events::GetMaterialTypeSourceData); - // TODO: Support populating the Material Editor with nested property sets, not just the top level. - for (const AZStd::unique_ptr& propertySet : materialTypeSourceData->GetPropertyLayout().m_propertySets) + // TODO: Support populating the Material Editor with nested property groups, not just the top level. + for (const AZStd::unique_ptr& propertyGroup : materialTypeSourceData->GetPropertyLayout().m_propertyGroups) { - const AZStd::string& groupName = propertySet->GetName(); - const AZStd::string& groupDisplayName = !propertySet->GetDisplayName().empty() ? propertySet->GetDisplayName() : groupName; - const AZStd::string& groupDescription = !propertySet->GetDescription().empty() ? propertySet->GetDescription() : groupDisplayName; + const AZStd::string& groupName = propertyGroup->GetName(); + const AZStd::string& groupDisplayName = !propertyGroup->GetDisplayName().empty() ? propertyGroup->GetDisplayName() : groupName; + const AZStd::string& groupDescription = !propertyGroup->GetDescription().empty() ? propertyGroup->GetDescription() : groupDisplayName; auto& group = m_groups[groupName]; - group.m_properties.reserve(propertySet->GetProperties().size()); - for (const auto& propertyDefinition : propertySet->GetProperties()) + group.m_properties.reserve(propertyGroup->GetProperties().size()); + for (const auto& propertyDefinition : propertyGroup->GetProperties()) { AtomToolsFramework::DynamicProperty property; AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult( diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index 37fba346b8..dde81e77b5 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -293,16 +293,16 @@ namespace AZ void MaterialPropertyInspector::AddPropertiesGroup() { // Copy all of the properties from the material asset to the source data that will be exported - // TODO: Support populating the Material Editor with nested property sets, not just the top level. - for (const AZStd::unique_ptr& propertySet : m_editData.m_materialTypeSourceData.GetPropertyLayout().m_propertySets) + // TODO: Support populating the Material Editor with nested property groups, not just the top level. + for (const AZStd::unique_ptr& propertyGroup : m_editData.m_materialTypeSourceData.GetPropertyLayout().m_propertyGroups) { - const AZStd::string& groupName = propertySet->GetName(); - const AZStd::string& groupDisplayName = !propertySet->GetDisplayName().empty() ? propertySet->GetDisplayName() : groupName; - const AZStd::string& groupDescription = !propertySet->GetDescription().empty() ? propertySet->GetDescription() : groupDisplayName; + const AZStd::string& groupName = propertyGroup->GetName(); + const AZStd::string& groupDisplayName = !propertyGroup->GetDisplayName().empty() ? propertyGroup->GetDisplayName() : groupName; + const AZStd::string& groupDescription = !propertyGroup->GetDescription().empty() ? propertyGroup->GetDescription() : groupDisplayName; auto& group = m_groups[groupName]; - group.m_properties.reserve(propertySet->GetProperties().size()); - for (const auto& propertyDefinition : propertySet->GetProperties()) + group.m_properties.reserve(propertyGroup->GetProperties().size()); + for (const auto& propertyDefinition : propertyGroup->GetProperties()) { AtomToolsFramework::DynamicPropertyConfig propertyConfig; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp index 62982e4b4d..dde9644c50 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentUtil.cpp @@ -148,7 +148,7 @@ namespace AZ return true; } - // TODO: Support populating the Material Editor with nested property sets, not just the top level. + // TODO: Support populating the Material Editor with nested property groups, not just the top level. const AZStd::string groupName = propertyId.GetStringView().substr(0, propertyId.GetStringView().size() - propertyDefinition->GetName().size() - 1); exportData.m_properties[groupName][propertyDefinition->GetName()].m_value = propertyValue; return true; From 226fa6ab098cf91f63b4a3da5d4fbfb96b4e10b0 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Thu, 27 Jan 2022 18:33:49 -0600 Subject: [PATCH 324/394] {lyn5525} fixing the chunk mesh group logic for the Blast gem (#7202) fixing the chunk mesh group logic for the Blast gem so that the chunks are defined both as a selected mesh node and unselect all the rest of the mesh nodes Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- Gems/Blast/Editor/Scripts/blast_chunk_processor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/Blast/Editor/Scripts/blast_chunk_processor.py b/Gems/Blast/Editor/Scripts/blast_chunk_processor.py index 500577716b..91a86f9d22 100644 --- a/Gems/Blast/Editor/Scripts/blast_chunk_processor.py +++ b/Gems/Blast/Editor/Scripts/blast_chunk_processor.py @@ -123,6 +123,10 @@ def update_manifest(scene): meshGroup = sceneManifest.add_mesh_group(meshGroupName) meshGroup['id'] = '{' + str(uuid.uuid5(uuid.NAMESPACE_DNS, sourceFilenameOnly + chunkPath)) + '}' sceneManifest.mesh_group_select_node(meshGroup, chunkPath) + # un-select all other mesh nodes + for otherMeshIndex, otherMeshName in enumerate(meshNameList): + if otherMeshName is not chunkName: + sceneManifest.mesh_group_unselect_node(meshGroup, otherMeshName.get_path()) # combine both scene manifests so the OnPrepareForExport will be called originalManifest = json.loads(scene.manifest.ExportToJson()) From fa037d5d7dad0228377729ffc34bb77e767303cd Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:49:17 -0800 Subject: [PATCH 325/394] Updated MaterialSourceData::CreateMaterialAssetFromSourceData to use MaterialUtils::LoadMaterialTypeSourceData which calls ConvertToNewDataFormat(). This was needed by Material Editor to succesfully load old-format material types. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Source/RPI.Edit/Material/MaterialSourceData.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index 2fa4ff648e..ae7889aa93 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -217,14 +217,14 @@ namespace AZ return Failure(); } - MaterialTypeSourceData materialTypeSourceData; - if (!AZ::RPI::JsonUtils::LoadObjectFromFile(materialTypeSourcePath, materialTypeSourceData)) + auto materialTypeLoadOutcome = MaterialUtils::LoadMaterialTypeSourceData(materialTypeSourcePath); + if (!materialTypeLoadOutcome) { AZ_Error("MaterialSourceData", false, "Failed to load MaterialTypeSourceData: '%s'.", materialTypeSourcePath.c_str()); return Failure(); } - materialTypeSourceData.ResolveUvEnums(); + MaterialTypeSourceData materialTypeSourceData = materialTypeLoadOutcome.TakeValue(); const auto materialTypeAsset = materialTypeSourceData.CreateMaterialTypeAsset(materialTypeAssetId.GetValue(), materialTypeSourcePath, elevateWarnings); From e03d9eefd91e9222983b862b5c9cb31551ed244f Mon Sep 17 00:00:00 2001 From: Jackerty Date: Fri, 28 Jan 2022 18:13:24 +0200 Subject: [PATCH 326/394] Moves Culling.cpp::ProcessWorklist debug variables under preprocessing (#7043) Function Culling.cpp::ProcessWorklist has couple variable which are unsused when compiling profile causing a -Werror compile error. Fixes is to move variables and code increment them under debugging ifdef. Signed-off-by: Jackerty --- .../RPI/Code/Source/RPI.Public/Culling.cpp | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index 99b3518173..ad6d81d200 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -312,8 +312,11 @@ namespace AZ const View::UsageFlags viewFlags = worklistData->m_view->GetUsageFlags(); const RHI::DrawListMask drawListMask = worklistData->m_view->GetDrawListMask(); - [[maybe_unused]] uint32_t numDrawPackets = 0; - uint32_t numVisibleCullables = 0; + #ifdef AZ_CULL_DEBUG_ENABLED + // These variable are only used for the gathering of debug information. + uint32_t numDrawPackets = 0; + uint32_t numVisibleCullables = 0; + #endif AZ_Assert(worklist.size() > 0, "Received empty worklist in ProcessWorklist"); @@ -351,8 +354,15 @@ namespace AZ if (TestOcclusionCulling(worklistData, visibleEntry) == MaskedOcclusionCulling::CullingResult::VISIBLE) #endif { - numDrawPackets += AddLodDataToView(c->m_cullData.m_boundingSphere.GetCenter(), c->m_lodData, *worklistData->m_view); - ++numVisibleCullables; + // There are ways to write this without [[maybe_unused]], but they are brittle. + // For example, using #else could cause a bug where the function's parameter + // is changed in #ifdef but not in #else. + [[maybe_unused]] const uint32_t drawPacketCount=AddLodDataToView(c->m_cullData.m_boundingSphere.GetCenter(), c->m_lodData, *worklistData->m_view); + #ifdef AZ_CULL_DEBUG_ENABLED + ++numVisibleCullables; + numDrawPackets += drawPacketCount; + #endif + c->m_isVisible = true; } } @@ -387,8 +397,15 @@ namespace AZ if (TestOcclusionCulling(worklistData, visibleEntry) == MaskedOcclusionCulling::CullingResult::VISIBLE) #endif { - numDrawPackets += AddLodDataToView(c->m_cullData.m_boundingSphere.GetCenter(), c->m_lodData, *worklistData->m_view); - ++numVisibleCullables; + // There are ways to write this without [[maybe_unused]], but they are brittle. + // For example, using #else could cause a bug where the function's parameter + // is changed in #ifdef but not in #else. + [[maybe_unused]] const uint32_t drawPacketCount=AddLodDataToView(c->m_cullData.m_boundingSphere.GetCenter(), c->m_lodData, *worklistData->m_view); + #ifdef AZ_CULL_DEBUG_ENABLED + ++numVisibleCullables; + numDrawPackets += drawPacketCount; + #endif + c->m_isVisible = true; } } From 3a0edd2dd1ce0af71250a8078d441aaca6fcc351 Mon Sep 17 00:00:00 2001 From: Thomas Poulet <1039134+Bindless-Chicken@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:30:30 +0000 Subject: [PATCH 327/394] Move reflection probe fp file and fix missings in cmake file list (#7189) Signed-off-by: Bindless-Chicken <1039134+Bindless-Chicken@users.noreply.github.com> --- .../Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp | 2 +- .../Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp | 2 +- .../Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp | 2 +- .../ReflectionProbe/ReflectionProbeFeatureProcessor.cpp | 3 ++- .../ReflectionProbe/ReflectionProbeFeatureProcessor.h | 0 Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake | 4 +++- 6 files changed, 8 insertions(+), 5 deletions(-) rename Gems/Atom/Feature/Common/Code/{Include/Atom/Feature => Source}/ReflectionProbe/ReflectionProbeFeatureProcessor.h (100%) diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index a06defff08..fa473cb8c6 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 1aa79d1945..9462ff381f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -11,11 +11,11 @@ #include #include #include -#include #include #include #include #include +#include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp index 77031ca3af..f5aaec4faa 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp index 3ff574d977..155a159447 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp @@ -6,12 +6,13 @@ * */ +#include + #include #include #include #include #include -#include #include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.h similarity index 100% rename from Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessor.h rename to Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.h diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 375dbd9724..1ec6402b3e 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -31,7 +31,7 @@ set(FILES Include/Atom/Feature/PostProcessing/PostProcessingConstants.h Include/Atom/Feature/PostProcessing/SMAAFeatureProcessorInterface.h Include/Atom/Feature/PostProcess/PostFxLayerCategoriesConstants.h - Include/Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessor.h + Include/Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessorInterface.h Include/Atom/Feature/SkyBox/SkyBoxFogBus.h Include/Atom/Feature/SkyBox/SkyboxConstants.h Include/Atom/Feature/SkyBox/SkyBoxLUT.h @@ -272,7 +272,9 @@ set(FILES Source/RayTracing/RayTracingPass.cpp Source/RayTracing/RayTracingPass.h Source/RayTracing/RayTracingPassData.h + Source/ReflectionProbe/ReflectionProbeFeatureProcessor.h Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp + Source/ReflectionProbe/ReflectionProbe.h Source/ReflectionProbe/ReflectionProbe.cpp Source/ReflectionScreenSpace/ReflectionScreenSpaceTracePass.cpp Source/ReflectionScreenSpace/ReflectionScreenSpaceTracePass.h From b34a955c3d1464cf359d1c979e6c3948c5819217 Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Fri, 28 Jan 2022 16:38:33 +0000 Subject: [PATCH 328/394] Fixed platform settings not using unique values for Android and iOS (#7198) * Fixed platform settings not using unique values for Android and iOS Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Removed unnecessary comment Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Changes from PR Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../EditorScripts/Menus_FileMenuOptions.py | 2 +- .../PlatformSettings_Android.cpp | 2 -- .../PlatformSettings_Base.cpp | 4 ---- .../PlatformSettings_Ios.cpp | 9 ++------- .../PlatformSettings_common.h | 1 - .../ProjectSettingsTool/PropertyLinked.cpp | 19 ------------------- .../ProjectSettingsTool/Validators.cpp | 5 +++++ .../Plugins/ProjectSettingsTool/Validators.h | 2 ++ 8 files changed, 10 insertions(+), 34 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index 0060a3b29a..bedf474387 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -38,7 +38,7 @@ def Menus_FileMenuOptions_Work(): ("Save As",), ("Save Level Statistics",), ("Edit Project Settings",), - #("Edit Platform Settings",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6604 + ("Edit Platform Settings",), ("New Project",), ("Open Project",), ("Show Log File",), diff --git a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Android.cpp b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Android.cpp index ea65cf3e59..c51bfaf04e 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Android.cpp +++ b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Android.cpp @@ -209,12 +209,10 @@ namespace ProjectSettingsTool ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::PackageName)) ->Attribute(Attributes::LinkOptional, true) ->Attribute(Attributes::PropertyIdentfier, Identfiers::AndroidPackageName) - ->Attribute(Attributes::LinkedProperty, Identfiers::IosBundleIdentifer) ->DataElement(Handlers::LinkedLineEdit, &AndroidSettings::m_versionName, "Version Name", "Human readable version number. Used to set the \"android: versionName\" tag in the AndroidManifest.xml and ultimately what will be displayed in the App Store.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IOSVersionNumber)) ->Attribute(Attributes::LinkOptional, true) ->Attribute(Attributes::PropertyIdentfier, Identfiers::AndroidVersionName) - ->Attribute(Attributes::LinkedProperty, Identfiers::IosVersionName) ->DataElement(AZ::Edit::UIHandlers::Default, &AndroidSettings::m_versionNumber, "Version Number", "Internal application version number. Used to set the \"android:versionCode\" tag in the AndroidManifest.xml.") ->Attribute(AZ::Edit::Attributes::Min, 1) ->Attribute(AZ::Edit::Attributes::Max, Validators::maxAndroidVersion) diff --git a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Base.cpp b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Base.cpp index eff524b13e..d011289272 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Base.cpp +++ b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Base.cpp @@ -37,19 +37,15 @@ namespace ProjectSettingsTool ->DataElement(Handlers::LinkedLineEdit, &BaseSettings::m_projectName, "Project Name", "The name of the project.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::FileName)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::ProjectName) - ->Attribute(Attributes::LinkedProperty, Identfiers::IosBundleName) ->DataElement(Handlers::LinkedLineEdit, &BaseSettings::m_productName, "Product Name", "The project's user facing name.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IsNotEmpty)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::ProductName) - ->Attribute(Attributes::LinkedProperty, Identfiers::IosDisplayName) ->DataElement(Handlers::LinkedLineEdit, &BaseSettings::m_executableName, "Executable Name", "The project launcher's name.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::FileName)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::ExecutableName) - ->Attribute(Attributes::LinkedProperty, Identfiers::IosExecutableName) ->DataElement(Handlers::QValidatedLineEdit, &BaseSettings::m_projectPath, "Project Path", "The project root folder path .") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::FileNameOrEmpty)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::ProductName) - ->Attribute(Attributes::LinkedProperty, Identfiers::ExecutableName) ->DataElement(Handlers::QValidatedLineEdit, &BaseSettings::m_projectOutputFolder, "Output Folder", "The folder the packed project will be exported to.") ->DataElement(Handlers::QValidatedLineEdit, &BaseSettings::m_codeFolder, "Code Folder (legacy)", "A legacy setting specifing the folder for this project's code.") ; diff --git a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Ios.cpp b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Ios.cpp index fd6aef019e..739a5c94da 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Ios.cpp +++ b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_Ios.cpp @@ -262,27 +262,22 @@ namespace ProjectSettingsTool ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ->DataElement(Handlers::LinkedLineEdit, &IosSettings::m_bundleName, "Bundle Name", "The name of the bundle.") - ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::FileName)) + ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IOSFileName)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::IosBundleName) - ->Attribute(Attributes::LinkedProperty, Identfiers::ProjectName) ->DataElement(Handlers::LinkedLineEdit, &IosSettings::m_bundleDisplayName, "Display Name", "The user visible name of the bundle.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IsNotEmpty)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::IosDisplayName) - ->Attribute(Attributes::LinkedProperty, Identfiers::ProductName) ->DataElement(Handlers::LinkedLineEdit, &IosSettings::m_executableName, "Executable Name", "Name of the bundle's executable file.") - ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::FileName)) + ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IOSFileName)) ->Attribute(Attributes::PropertyIdentfier, Identfiers::IosExecutableName) - ->Attribute(Attributes::LinkedProperty, Identfiers::ExecutableName) ->DataElement(Handlers::LinkedLineEdit, &IosSettings::m_bundleIdentifier, "Bundle Identifier", "Uniquely identifies the bundle. Should be in reverse-DNS format.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::PackageName)) ->Attribute(Attributes::LinkOptional, true) ->Attribute(Attributes::PropertyIdentfier, Identfiers::IosBundleIdentifer) - ->Attribute(Attributes::LinkedProperty, Identfiers::AndroidPackageName) ->DataElement(Handlers::LinkedLineEdit, &IosSettings::m_versionName, "Version Name", "The release version number string for the app. Displayed in the app store.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IOSVersionNumber)) ->Attribute(Attributes::LinkOptional, true) ->Attribute(Attributes::PropertyIdentfier, Identfiers::IosVersionName) - ->Attribute(Attributes::LinkedProperty, Identfiers::AndroidVersionName) ->DataElement(Handlers::QValidatedLineEdit, &IosSettings::m_versionNumber, "Version Number", "The build version number string for the bundle.") ->Attribute(Attributes::FuncValidator, ConvertFunctorToVoid(&Validators::IOSVersionNumber)) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &IosSettings::m_developmentRegion, "Development Region", "The default language and region for the app.") diff --git a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_common.h b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_common.h index ab15b2d3cd..ffc9625b53 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_common.h +++ b/Code/Editor/Plugins/ProjectSettingsTool/PlatformSettings_common.h @@ -22,7 +22,6 @@ namespace ProjectSettingsTool static const AZ::Crc32 Obfuscated = AZ_CRC("ObfuscatedText"); // Used as a tooltip and for distinguising linked properties static const AZ::Crc32 PropertyIdentfier = AZ_CRC("PropertyIdentfier"); - static const AZ::Crc32 LinkedProperty = AZ_CRC("LinkedProperty"); static const AZ::Crc32 DefaultPath = AZ_CRC("DefaultPath"); static const AZ::Crc32 DefaultImagePreview = AZ_CRC("DefaultImagePreview"); static const AZ::Crc32 ObfuscatedText = AZ_CRC("ObfuscatedText"); diff --git a/Code/Editor/Plugins/ProjectSettingsTool/PropertyLinked.cpp b/Code/Editor/Plugins/ProjectSettingsTool/PropertyLinked.cpp index b48155f1f8..118c11b739 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/PropertyLinked.cpp +++ b/Code/Editor/Plugins/ProjectSettingsTool/PropertyLinked.cpp @@ -225,25 +225,6 @@ namespace ProjectSettingsTool } } } - else if (attrib == Attributes::LinkedProperty) - { - AZStd::string linked; - if (attrValue->Read(linked)) - { - auto result = m_ctrlToIdentAndLink.find(GUI); - if (result != m_ctrlToIdentAndLink.end()) - { - result->second.linkedIdentifier = linked; - } - else - { - m_ctrlToIdentAndLink.insert(AZStd::pair(GUI, IdentAndLink{ "", linked })); - m_ctrlInitOrder.push_back(GUI); - } - - GUI->SetLinkTooltip(linked.data()); - } - } else { GUI->ConsumeAttribute(attrib, attrValue, debugName); diff --git a/Code/Editor/Plugins/ProjectSettingsTool/Validators.cpp b/Code/Editor/Plugins/ProjectSettingsTool/Validators.cpp index 4dfc4ee25a..5bf3f5ce67 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/Validators.cpp +++ b/Code/Editor/Plugins/ProjectSettingsTool/Validators.cpp @@ -106,6 +106,11 @@ namespace ProjectSettingsTool return RegularExpressionValidator("[\\w,-]+", name); } + // Returns true if valid iOS file or directory name + RetType IOSFileName(const QString& name) + { + return RegularExpressionValidator("[\\w,-.]+", name); + } RetType FileNameOrEmpty(const QString& name) { if (IsNotEmpty(name).first == QValidator::Acceptable) diff --git a/Code/Editor/Plugins/ProjectSettingsTool/Validators.h b/Code/Editor/Plugins/ProjectSettingsTool/Validators.h index bd0abb19d6..7cf3498eef 100644 --- a/Code/Editor/Plugins/ProjectSettingsTool/Validators.h +++ b/Code/Editor/Plugins/ProjectSettingsTool/Validators.h @@ -24,6 +24,8 @@ namespace ProjectSettingsTool // Returns true if valid cross platform file or directory name FunctorValidator::ReturnType FileName(const QString& name); + // Returns true if valid iOS file or directory name + FunctorValidator::ReturnType IOSFileName(const QString& name); // Returns true if valid cross platform file or directory name or empty FunctorValidator::ReturnType FileNameOrEmpty(const QString& name); // Returns true if string isn't empty From fba7d73c57d79bbf6b6dd34715364b122542d1af Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 28 Jan 2022 11:10:33 -0600 Subject: [PATCH 329/394] Extended sub image pixel API to support component indexing. Signed-off-by: Chris Galvan --- .../RPI/Code/Source/RPI.Public/RPIUtils.cpp | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp index 2dd2885dff..e13db253f3 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp @@ -111,10 +111,14 @@ namespace AZ { case AZ::RHI::Format::R8_UNORM: case AZ::RHI::Format::A8_UNORM: + case AZ::RHI::Format::R8G8_UNORM: + case AZ::RHI::Format::R8G8B8A8_UNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } case AZ::RHI::Format::R8_SNORM: + case AZ::RHI::Format::R8G8_SNORM: + case AZ::RHI::Format::R8G8B8A8_SNORM: { // Scale the value from AZ::s8 min/max to -1 to 1 // We need to treat -128 and -127 the same, so that we get a symmetric @@ -126,10 +130,14 @@ namespace AZ } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: + case AZ::RHI::Format::R16G16_UNORM: + case AZ::RHI::Format::R16G16B16A16_UNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } case AZ::RHI::Format::R16_SNORM: + case AZ::RHI::Format::R16G16_SNORM: + case AZ::RHI::Format::R16G16B16A16_SNORM: { // Scale the value from AZ::s16 min/max to -1 to 1 // We need to treat -32768 and -32767 the same, so that we get a symmetric @@ -140,18 +148,23 @@ namespace AZ return ScaleValue(AZStd::max(actualMem[index], signedMin), signedMin, signedMax, -1.0f, 1.0f); } case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::R16G16_FLOAT: + case AZ::RHI::Format::R16G16B16A16_FLOAT: { auto actualMem = reinterpret_cast(mem); return SHalf(actualMem[index]); } case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: + case AZ::RHI::Format::R32G32_FLOAT: + case AZ::RHI::Format::R32G32B32_FLOAT: + case AZ::RHI::Format::R32G32B32A32_FLOAT: { auto actualMem = reinterpret_cast(mem); return actualMem[index]; } default: - AZ_Assert(false, "Unsupported pixel format"); + AZ_Assert(false, "Unsupported pixel format: %s", AZ::RHI::ToString(format)); return 0.0f; } } @@ -161,21 +174,28 @@ namespace AZ switch (format) { case AZ::RHI::Format::R8_UINT: + case AZ::RHI::Format::R8G8_UINT: + case AZ::RHI::Format::R8G8B8A8_UINT: { return mem[index] / static_cast(std::numeric_limits::max()); } case AZ::RHI::Format::R16_UINT: + case AZ::RHI::Format::R16G16_UINT: + case AZ::RHI::Format::R16G16B16A16_UINT: { auto actualMem = reinterpret_cast(mem); return actualMem[index] / static_cast(std::numeric_limits::max()); } case AZ::RHI::Format::R32_UINT: + case AZ::RHI::Format::R32G32_UINT: + case AZ::RHI::Format::R32G32B32_UINT: + case AZ::RHI::Format::R32G32B32A32_UINT: { auto actualMem = reinterpret_cast(mem); return actualMem[index]; } default: - AZ_Assert(false, "Unsupported pixel format"); + AZ_Assert(false, "Unsupported pixel format: %s", AZ::RHI::ToString(format)); return 0; } } @@ -185,21 +205,28 @@ namespace AZ switch (format) { case AZ::RHI::Format::R8_SINT: + case AZ::RHI::Format::R8G8_SINT: + case AZ::RHI::Format::R8G8B8A8_SINT: { return mem[index] / static_cast(std::numeric_limits::max()); } case AZ::RHI::Format::R16_SINT: + case AZ::RHI::Format::R16G16_SINT: + case AZ::RHI::Format::R16G16B16A16_SINT: { auto actualMem = reinterpret_cast(mem); return actualMem[index] / static_cast(std::numeric_limits::max()); } case AZ::RHI::Format::R32_SINT: + case AZ::RHI::Format::R32G32_SINT: + case AZ::RHI::Format::R32G32B32_SINT: + case AZ::RHI::Format::R32G32B32A32_SINT: { auto actualMem = reinterpret_cast(mem); return actualMem[index]; } default: - AZ_Assert(false, "Unsupported pixel format"); + AZ_Assert(false, "Unsupported pixel format: %s", AZ::RHI::ToString(format)); return 0; } } @@ -439,9 +466,6 @@ namespace AZ bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; - if (!imageAsset.IsReady()) { return false; @@ -455,14 +479,15 @@ namespace AZ const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + const uint32_t numComponents = AZ::RHI::GetFormatComponentCount(imageDescriptor.m_format); + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format) / numComponents; size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { - size_t imageDataIndex = (y * width + x) * pixelSize; + size_t imageDataIndex = (y * width + x) * pixelSize + componentIndex; auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -474,9 +499,6 @@ namespace AZ bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; - if (!imageAsset.IsReady()) { return false; @@ -490,14 +512,15 @@ namespace AZ const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + const uint32_t numComponents = AZ::RHI::GetFormatComponentCount(imageDescriptor.m_format); + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format) / numComponents; size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { - size_t imageDataIndex = (y * width + x) * pixelSize; + size_t imageDataIndex = (y * width + x) * pixelSize + componentIndex; auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); @@ -509,9 +532,6 @@ namespace AZ bool GetSubImagePixelValues(const AZ::Data::Asset& imageAsset, AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - // TODO: Use the component index - (void)componentIndex; - if (!imageAsset.IsReady()) { return false; @@ -525,14 +545,15 @@ namespace AZ const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; - const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format); + const uint32_t numComponents = AZ::RHI::GetFormatComponentCount(imageDescriptor.m_format); + const uint32_t pixelSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format) / numComponents; size_t outValuesIndex = 0; for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) { for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) { - size_t imageDataIndex = (y * width + x) * pixelSize; + size_t imageDataIndex = (y * width + x) * pixelSize + componentIndex; auto& outValue = outValues[outValuesIndex++]; outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); From 112e310419d781a8142c8af34a444c3fe83ade4d Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Fri, 28 Jan 2022 09:13:24 -0800 Subject: [PATCH 330/394] [Serialization] Add support for updating the values of existing keys in associative containers (#6832) * Add support for updating the values of existing keys in associative containers Signed-off-by: amzn-sj * Map/Unordered Map serialization updates values corresponding to existing keys by default. Multimaps always add a new entry for existing keys. Signed-off-by: amzn-sj * Fix unused parameter warning Signed-off-by: amzn-sj * Update comparison function for test case Signed-off-by: amzn-sj --- .../Serialization/Json/MapSerializer.cpp | 45 ++++++++++++++++--- .../AzCore/Serialization/Json/MapSerializer.h | 4 +- .../Serialization/Json/MapSerializerTests.cpp | 12 ++--- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp index 196ce28216..f7e41c0c00 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.cpp @@ -203,7 +203,7 @@ namespace AZ JsonSerializationResult::Result JsonMapSerializer::LoadElement(void* outputValue, SerializeContext::IDataContainer* container, const SerializeContext::ClassElement* pairElement, SerializeContext::IDataContainer* pairContainer, const SerializeContext::ClassElement* keyElement, const SerializeContext::ClassElement* valueElement, - const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context) + const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context, bool isMultiMap) { namespace JSR = JsonSerializationResult; @@ -231,8 +231,30 @@ namespace AZ return context.Report(keyResult, "Failed to read key for associative container."); } + void* valueAddress = nullptr; + bool keyExists = false; + + // For multimaps, we append values to keys instead updating them. + // This is to ensure legacy multimap serialization support. + if (!isMultiMap) + { + auto associativeContainer = container->GetAssociativeContainerInterface(); + void* existingKeyValuePair = associativeContainer->GetElementByKey(outputValue, keyElement, keyAddress); + if (existingKeyValuePair) + { + valueAddress = pairContainer->GetElementByIndex(existingKeyValuePair, pairElement, 1); + expectedSize--; + keyExists = true; + } + } + + // If the key doesn't exist or it's a multimap, we're adding the new element we reserved above. + if (!keyExists) + { + valueAddress = pairContainer->GetElementByIndex(address, pairElement, 1); + } + // Load value - void* valueAddress = pairContainer->GetElementByIndex(address, pairElement, 1); AZ_Assert(valueAddress, "Element reserved for associative container, but unable to retrieve address of the value."); ContinuationFlags valueLoadFlags = ContinuationFlags::LoadAsNewInstance; if (valueElement->m_flags & SerializeContext::ClassElement::Flags::FLG_POINTER) @@ -257,7 +279,18 @@ namespace AZ } else { - container->StoreElement(outputValue, address); + // Even if the key exists, calling StoreElement will not replace the existing key + // and will free the temporary address as expected. Checking if the key already + // exists and skipping the call to StoreElement if it does, makes the intent more + // clear. The end result is the same either way. + if (!keyExists) + { + container->StoreElement(outputValue, address); + } + else + { + container->FreeReservedElement(outputValue, address, context.GetSerializeContext()); + } if (container->Size(outputValue) != expectedSize) { return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unavailable, @@ -430,7 +463,7 @@ namespace AZ JsonSerializationResult::Result JsonUnorderedMultiMapSerializer::LoadElement(void* outputValue, SerializeContext::IDataContainer* container, const SerializeContext::ClassElement* pairElement, SerializeContext::IDataContainer* pairContainer, const SerializeContext::ClassElement* keyElement, const SerializeContext::ClassElement* valueElement, - const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context) + const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context, [[maybe_unused]] bool isMultiMap) { namespace JSR = JsonSerializationResult; @@ -440,7 +473,7 @@ namespace AZ for (auto& entry : value.GetArray()) { result.Combine(JsonMapSerializer::LoadElement(outputValue, container, pairElement, pairContainer, - keyElement, valueElement, key, entry, context)); + keyElement, valueElement, key, entry, context, true)); if (result.GetProcessing() == JSR::Processing::Halted) { return context.Report(result, "Unable to process the key or all values in multi-map."); @@ -451,7 +484,7 @@ namespace AZ else if (IsExplicitDefault(value)) { return JsonMapSerializer::LoadElement(outputValue, container, pairElement, pairContainer, - keyElement, valueElement, key, value, context); + keyElement, valueElement, key, value, context, true); } else { diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.h index 937c8389ff..74d7e81ac9 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/MapSerializer.h @@ -32,7 +32,7 @@ namespace AZ virtual JsonSerializationResult::Result LoadElement(void* outputValue, SerializeContext::IDataContainer* container, const SerializeContext::ClassElement* pairElement, SerializeContext::IDataContainer* pairContainer, const SerializeContext::ClassElement* keyElement, const SerializeContext::ClassElement* valueElement, - const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context); + const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context, bool isMultiMap = false); virtual JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context, bool sortResult); @@ -62,7 +62,7 @@ namespace AZ JsonSerializationResult::Result LoadElement(void* outputValue, SerializeContext::IDataContainer* container, const SerializeContext::ClassElement* pairElement, SerializeContext::IDataContainer* pairContainer, const SerializeContext::ClassElement* keyElement, const SerializeContext::ClassElement* valueElement, - const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context) override; + const rapidjson::Value& key, const rapidjson::Value& value, JsonDeserializerContext& context, bool isMultiMap = false) override; using JsonMapSerializer::Store; JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/MapSerializerTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/MapSerializerTests.cpp index 7ffe3ffee0..fe97d36f08 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/MapSerializerTests.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/MapSerializerTests.cpp @@ -475,7 +475,7 @@ namespace JsonSerializationTests EXPECT_STRCASEEQ("value_42", worldKey->second.m_value.c_str()); } - TEST_F(JsonMapSerializerTests, Load_DuplicateKey_EntryIgnored) + TEST_F(JsonMapSerializerTests, Load_DuplicateKey_EntryUpdated) { using namespace AZ::JsonSerializationResult; @@ -489,12 +489,12 @@ namespace JsonSerializationTests StringMap values; ResultCode result = m_unorderedMapSerializer.Load(&values, azrtti_typeid(&values), *m_jsonDocument, *m_jsonDeserializationContext); - EXPECT_EQ(Processing::PartialAlter, result.GetProcessing()); - EXPECT_EQ(Outcomes::Unavailable, result.GetOutcome()); + EXPECT_EQ(Processing::Completed, result.GetProcessing()); + EXPECT_EQ(Outcomes::Success, result.GetOutcome()); auto entry = values.find("Hello"); ASSERT_NE(values.end(), entry); - EXPECT_STRCASEEQ("World", entry->second.c_str()); + EXPECT_EQ("Other", entry->second); } TEST_F(JsonMapSerializerTests, Load_DuplicateMultiKey_LoadEverything) @@ -536,8 +536,8 @@ namespace JsonSerializationTests ResultCode result = m_unorderedMapSerializer.Load(&values, azrtti_typeid(&values), *m_jsonDocument, *m_jsonDeserializationContext); - EXPECT_EQ(Processing::Altered, result.GetProcessing()); - EXPECT_EQ(Outcomes::Unavailable, result.GetOutcome()); + EXPECT_EQ(Processing::Completed, result.GetProcessing()); + EXPECT_EQ(Outcomes::Success, result.GetOutcome()); auto entry = values.find("Hello"); ASSERT_NE(values.end(), entry); From fc027832003e4b1a8ea3eea800225b069819e490 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Fri, 28 Jan 2022 17:14:21 +0000 Subject: [PATCH 331/394] Fixed crash and asserts when heightfield is used without Terrain World Signed-off-by: Sergey Pereslavtsev --- Gems/PhysX/Code/Editor/DebugDraw.cpp | 7 ++++++- .../Code/Source/EditorHeightfieldColliderComponent.cpp | 7 ++++++- Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp | 8 +++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Gems/PhysX/Code/Editor/DebugDraw.cpp b/Gems/PhysX/Code/Editor/DebugDraw.cpp index 0af5822edf..78d216a21a 100644 --- a/Gems/PhysX/Code/Editor/DebugDraw.cpp +++ b/Gems/PhysX/Code/Editor/DebugDraw.cpp @@ -694,7 +694,12 @@ namespace PhysX const float minYBounds = -(numRows * heightfieldShapeConfig.GetGridResolution().GetY()) / 2.0f; auto heights = heightfieldShapeConfig.GetSamples(); - + + if (heights.empty()) + { + return; + } + for (int xIndex = 0; xIndex < numColumns - 1; xIndex++) { for (int yIndex = 0; yIndex < numRows - 1; yIndex++) diff --git a/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp index c6def5f0ab..292267cc5b 100644 --- a/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp @@ -211,7 +211,12 @@ namespace PhysX { ClearHeightfield(); InitHeightfieldShapeConfiguration(); - InitStaticRigidBody(); + + if (!m_shapeConfig->GetSamples().empty()) + { + InitStaticRigidBody(); + } + Physics::ColliderComponentEventBus::Event(GetEntityId(), &Physics::ColliderComponentEvents::OnColliderChanged); } diff --git a/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp b/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp index b219253b6f..9076afeab9 100644 --- a/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp @@ -150,7 +150,13 @@ namespace PhysX { ClearHeightfield(); InitHeightfieldShapeConfiguration(); - InitStaticRigidBody(); + + Physics::HeightfieldShapeConfiguration& configuration = static_cast(*m_shapeConfig.second); + if (!configuration.GetSamples().empty()) + { + InitStaticRigidBody(); + } + Physics::ColliderComponentEventBus::Event(GetEntityId(), &Physics::ColliderComponentEvents::OnColliderChanged); } From c3363fc22e867eb9fd46a24f9bc0e20a9eeb65e7 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:36:09 -0800 Subject: [PATCH 332/394] Updating StandardPbr.materialtype to follow the new file format. In this commit all I did was combine the "groups" metadata together with the property lists. The groups will now show up in the wrong order in the Material Editor, because that was based on the "groups" list that no longer exists. I wanted to keep the giant list of properties in the same order for an easier diff review. In the next commit, I'll move the property groups around to be in the same order as before. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Materials/Types/StandardPBR.materialtype | 1945 ++++++++--------- 1 file changed, 971 insertions(+), 974 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index f324394309..571b3301b7 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -10,1013 +10,1010 @@ } ], "propertyLayout": { - "groups": [ + "propertyGroups": [ + { + "name": "general", + "displayName": "General Settings", + "description": "General settings.", + "properties": [ + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ] + }, { "name": "baseColor", "displayName": "Base Color", - "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals." + "description": "Properties for configuring the surface reflected color for dielectrics or reflectance values for metals.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_baseColor" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_baseColorFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Base color texture map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Base color map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_baseColorMapUvIndex" + } + }, + { + "name": "textureBlendMode", + "displayName": "Texture Blend Mode", + "description": "Selects the equation to use when combining Color, Factor, and Texture.", + "type": "Enum", + "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], + "defaultValue": "Multiply", + "connection": { + "type": "ShaderOption", + "name": "o_baseColorTextureBlendMode" + } + } + ] }, { "name": "metallic", "displayName": "Metallic", - "description": "Properties for configuring whether the surface is metallic or not." + "description": "Properties for configuring whether the surface is metallic or not.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "This value is linear, black is non-metal and white means raw metal.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_metallicFactor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Metallic map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_metallicMapUvIndex" + } + } + ] }, { "name": "roughness", "displayName": "Roughness", - "description": "Properties for configuring how rough the surface appears." + "description": "Properties for configuring how rough the surface appears.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface roughness.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_roughnessMapUvIndex" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "lowerBound", + "displayName": "Lower Bound", + "description": "The roughness value that corresponds to black in the texture.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessLowerBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "upperBound", + "displayName": "Upper Bound", + "description": "The roughness value that corresponds to white in the texture.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessUpperBound" + } + }, + { + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "name": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_roughnessFactor" + } + } + ] }, { "name": "specularF0", "displayName": "Specular Reflectance f0", - "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces." - }, - { - "name": "normal", - "displayName": "Normal", - "description": "Properties related to configuring surface normal." - }, - { - "name": "occlusion", - "displayName": "Occlusion", - "description": "Properties for baked textures that represent geometric occlusion of light." - }, - { - "name": "emissive", - "displayName": "Emissive", - "description": "Properties to add light emission, independent of other lights in the scene." + "description": "The constant f0 represents the specular reflectance at normal incidence (Fresnel 0 Angle). Used to adjust reflectance of non-metal surfaces.", + "properties": [ + { + "name": "factor", + "displayName": "Factor", + "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", + "type": "Float", + "defaultValue": 0.5, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Factor" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface reflectance.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0Map" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Specular reflection map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularF0MapUvIndex" + } + }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR + { + "name": "enableMultiScatterCompensation", + "displayName": "Multiscattering Compensation", + "description": "Whether to enable multiple scattering compensation.", + "type": "Bool", + "connection": { + "type": "ShaderOption", + "name": "o_specularF0_enableMultiScatterCompensation" + } + } + ] }, { "name": "clearCoat", "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat" - }, + "description": "Properties for configuring gloss clear coat", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ] + }, { - "name": "parallax", - "displayName": "Displacement", - "description": "Properties for parallax effect produced by a height map." + "name": "normal", + "displayName": "Normal", + "description": "Properties related to configuring surface normal.", + "properties": [ + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface normal direction.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_normalMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_normalMapUvIndex" + } + }, + { + "name": "flipX", + "displayName": "Flip X Channel", + "description": "Flip tangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalX" + } + }, + { + "name": "flipY", + "displayName": "Flip Y Channel", + "description": "Flip bitangent direction for this normal map.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderInput", + "name": "m_flipNormalY" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_normalFactor" + } + } + ] }, { "name": "opacity", "displayName": "Opacity", - "description": "Properties for configuring the materials transparency." + "description": "Properties for configuring the materials transparency.", + "properties": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ] }, { "name": "uv", "displayName": "UVs", - "description": "Properties for configuring UV transforms." + "description": "Properties for configuring UV transforms.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] + }, + { + "name": "occlusion", + "displayName": "Occlusion", + "description": "Properties for baked textures that represent geometric occlusion of light.", + "properties": [ + { + "name": "diffuseTextureMap", + "displayName": "Diffuse AO", + "description": "Texture for defining occlusion area for diffuse ambient lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMap" + } + }, + { + "name": "diffuseUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Diffuse AO map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "diffuseTextureMapUv", + "displayName": " UV", + "description": "Diffuse AO map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionMapUvIndex" + } + }, + { + "name": "diffuseFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Diffuse AO", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_diffuseOcclusionFactor" + } + }, + { + "name": "specularTextureMap", + "displayName": "Specular Cavity", + "description": "Texture for defining occlusion area for specular lighting.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMap" + } + }, + { + "name": "specularUseTexture", + "displayName": " Use Texture", + "description": "Whether to use the Specular Cavity map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "specularTextureMapUv", + "displayName": " UV", + "description": "Specular Cavity map UV set.", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionMapUvIndex" + } + }, + { + "name": "specularFactor", + "displayName": " Factor", + "description": "Strength factor for scaling the values of Specular Cavity", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_specularOcclusionFactor" + } + } + ] + }, + { + "name": "emissive", + "displayName": "Emissive", + "description": "Properties to add light emission, independent of other lights in the scene.", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable the emissive group", + "type": "Bool", + "defaultValue": false + }, + { + "name": "unit", + "displayName": "Units", + "description": "The photometric units of the Intensity property.", + "type": "Enum", + "enumValues": ["Ev100"], + "defaultValue": "Ev100" + }, + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ], + "connection": { + "type": "ShaderInput", + "name": "m_emissiveColor" + } + }, + { + "name": "intensity", + "displayName": "Intensity", + "description": "The amount of energy emitted.", + "type": "Float", + "defaultValue": 4, + "min": -10, + "max": 20, + "softMin": -6, + "softMax": 16 + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining emissive area.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Emissive map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_emissiveMapUvIndex" + } + } + ] + }, + { + "name": "parallax", + "displayName": "Displacement", + "description": "Properties for parallax effect produced by a height map.", + "properties": [ + { + "name": "textureMap", + "displayName": "Height Map", + "description": "Displacement height map to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_heightmap" + } + }, + { + "name": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the height map.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Height map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_parallaxUvIndex" + } + }, + { + "name": "factor", + "displayName": "Height Map Scale", + "description": "The total height of the height map in local model units.", + "type": "Float", + "defaultValue": 0.05, + "min": 0.0, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapScale" + } + }, + { + "name": "offset", + "displayName": "Offset", + "description": "Adjusts the overall displacement amount in local model units.", + "type": "Float", + "defaultValue": 0.0, + "softMin": -0.1, + "softMax": 0.1, + "connection": { + "type": "ShaderInput", + "name": "m_heightmapOffset" + } + }, + { + "name": "algorithm", + "displayName": "Algorithm", + "description": "Select the algorithm to use for parallax mapping.", + "type": "Enum", + "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], + "defaultValue": "POM", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_algorithm" + } + }, + { + "name": "quality", + "displayName": "Quality", + "description": "Quality of parallax mapping.", + "type": "Enum", + "enumValues": [ "Low", "Medium", "High", "Ultra" ], + "defaultValue": "Low", + "connection": { + "type": "ShaderOption", + "name": "o_parallax_quality" + } + }, + { + "name": "pdo", + "displayName": "Pixel Depth Offset", + "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_enablePixelDepthOffset" + } + }, + { + "name": "showClipping", + "displayName": "Show Clipping", + "description": "Highlight areas where the height map is clipped by the mesh surface.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_parallax_highlightClipping" + } + } + ] }, { // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader "name": "irradiance", "displayName": "Irradiance", - "description": "Properties for configuring the irradiance used in global illumination." - }, - { - "name": "general", - "displayName": "General Settings", - "description": "General settings." + "description": "Properties for configuring the irradiance used in global illumination.", + "properties": [ + { + "name": "color", + "displayName": "Color", + "description": "Color is displayed as sRGB but the values are stored as linear color.", + "type": "Color", + "defaultValue": [ 1.0, 1.0, 1.0 ] + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0 + } + ] } - ], - "properties": { - "general": [ - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ], - "baseColor": [ - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_baseColor" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the base color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_baseColorFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Base color texture map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Base color map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_baseColorMapUvIndex" - } - }, - { - "name": "textureBlendMode", - "displayName": "Texture Blend Mode", - "description": "Selects the equation to use when combining Color, Factor, and Texture.", - "type": "Enum", - "enumValues": [ "Multiply", "LinearLight", "Lerp", "Overlay" ], - "defaultValue": "Multiply", - "connection": { - "type": "ShaderOption", - "name": "o_baseColorTextureBlendMode" - } - } - ], - "metallic": [ - { - "name": "factor", - "displayName": "Factor", - "description": "This value is linear, black is non-metal and white means raw metal.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_metallicFactor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Metallic map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_metallicMapUvIndex" - } - } - ], - "roughness": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface roughness.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_roughnessMapUvIndex" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "lowerBound", - "displayName": "Lower Bound", - "description": "The roughness value that corresponds to black in the texture.", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessLowerBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "upperBound", - "displayName": "Upper Bound", - "description": "The roughness value that corresponds to white in the texture.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessUpperBound" - } - }, - { - // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. - "name": "factor", - "displayName": "Factor", - "description": "Controls the roughness value", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_roughnessFactor" - } - } - ], - "specularF0": [ - { - "name": "factor", - "displayName": "Factor", - "description": "The default IOR is 1.5, which gives you 0.04 (4% of light reflected at 0 degree angle for dielectric materials). F0 values lie in the range 0-0.08, so that is why the default F0 slider is set on 0.5.", - "type": "Float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Factor" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface reflectance.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0Map" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Specular reflection map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularF0MapUvIndex" - } - }, - // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR - { - "name": "enableMultiScatterCompensation", - "displayName": "Multiscattering Compensation", - "description": "Whether to enable multiple scattering compensation.", - "type": "Bool", - "connection": { - "type": "ShaderOption", - "name": "o_specularF0_enableMultiScatterCompensation" - } - } - ], - "clearCoat": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ], - "normal": [ - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface normal direction.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_normalMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_normalMapUvIndex" - } - }, - { - "name": "flipX", - "displayName": "Flip X Channel", - "description": "Flip tangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalX" - } - }, - { - "name": "flipY", - "displayName": "Flip Y Channel", - "description": "Flip bitangent direction for this normal map.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderInput", - "name": "m_flipNormalY" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_normalFactor" - } - } - ], - "opacity": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ], - "uv": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ], - "occlusion": [ - { - "name": "diffuseTextureMap", - "displayName": "Diffuse AO", - "description": "Texture for defining occlusion area for diffuse ambient lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMap" - } - }, - { - "name": "diffuseUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Diffuse AO map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "diffuseTextureMapUv", - "displayName": " UV", - "description": "Diffuse AO map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionMapUvIndex" - } - }, - { - "name": "diffuseFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Diffuse AO", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_diffuseOcclusionFactor" - } - }, - { - "name": "specularTextureMap", - "displayName": "Specular Cavity", - "description": "Texture for defining occlusion area for specular lighting.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMap" - } - }, - { - "name": "specularUseTexture", - "displayName": " Use Texture", - "description": "Whether to use the Specular Cavity map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "specularTextureMapUv", - "displayName": " UV", - "description": "Specular Cavity map UV set.", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionMapUvIndex" - } - }, - { - "name": "specularFactor", - "displayName": " Factor", - "description": "Strength factor for scaling the values of Specular Cavity", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_specularOcclusionFactor" - } - } - ], - "emissive": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable the emissive group", - "type": "Bool", - "defaultValue": false - }, - { - "name": "unit", - "displayName": "Units", - "description": "The photometric units of the Intensity property.", - "type": "Enum", - "enumValues": ["Ev100"], - "defaultValue": "Ev100" - }, - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ], - "connection": { - "type": "ShaderInput", - "name": "m_emissiveColor" - } - }, - { - "name": "intensity", - "displayName": "Intensity", - "description": "The amount of energy emitted.", - "type": "Float", - "defaultValue": 4, - "min": -10, - "max": 20, - "softMin": -6, - "softMax": 16 - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining emissive area.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Emissive map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_emissiveMapUvIndex" - } - } - ], - "parallax": [ - { - "name": "textureMap", - "displayName": "Height Map", - "description": "Displacement height map to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_heightmap" - } - }, - { - "name": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the height map.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Height map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_parallaxUvIndex" - } - }, - { - "name": "factor", - "displayName": "Height Map Scale", - "description": "The total height of the height map in local model units.", - "type": "Float", - "defaultValue": 0.05, - "min": 0.0, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapScale" - } - }, - { - "name": "offset", - "displayName": "Offset", - "description": "Adjusts the overall displacement amount in local model units.", - "type": "Float", - "defaultValue": 0.0, - "softMin": -0.1, - "softMax": 0.1, - "connection": { - "type": "ShaderInput", - "name": "m_heightmapOffset" - } - }, - { - "name": "algorithm", - "displayName": "Algorithm", - "description": "Select the algorithm to use for parallax mapping.", - "type": "Enum", - "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "POM", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_algorithm" - } - }, - { - "name": "quality", - "displayName": "Quality", - "description": "Quality of parallax mapping.", - "type": "Enum", - "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Low", - "connection": { - "type": "ShaderOption", - "name": "o_parallax_quality" - } - }, - { - "name": "pdo", - "displayName": "Pixel Depth Offset", - "description": "Enable PDO to offset the original pixel depths. This will affect any shaders using depth, for example, when receiving shadows.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_enablePixelDepthOffset" - } - }, - { - "name": "showClipping", - "displayName": "Show Clipping", - "description": "Highlight areas where the height map is clipped by the mesh surface.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_parallax_highlightClipping" - } - } - ], - "irradiance": [ - // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader - { - "name": "color", - "displayName": "Color", - "description": "Color is displayed as sRGB but the values are stored as linear color.", - "type": "Color", - "defaultValue": [ 1.0, 1.0, 1.0 ] - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the irradiance color values. Zero (0.0) is black, white (1.0) is full color.", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0 - } - ] - } + ] }, "shaders": [ { @@ -1199,4 +1196,4 @@ "UV0": "Tiled", "UV1": "Unwrapped" } -} +} \ No newline at end of file From e173840bab5216460ee59d2be185b9f387632ef4 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:40:33 -0800 Subject: [PATCH 333/394] Moved the StandardPbr property groups around to be in their original order. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Materials/Types/StandardPBR.materialtype | 752 +++++++++--------- 1 file changed, 376 insertions(+), 376 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index 571b3301b7..a08fe60fd5 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -11,96 +11,6 @@ ], "propertyLayout": { "propertyGroups": [ - { - "name": "general", - "displayName": "General Settings", - "description": "General settings.", - "properties": [ - { - "name": "doubleSided", - "displayName": "Double-sided", - "description": "Whether to render back-faces or just front-faces.", - "type": "Bool" - }, - { - "name": "applySpecularAA", - "displayName": "Apply Specular AA", - "description": "Whether to apply specular anti-aliasing in the shader.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_applySpecularAA" - } - }, - { - "name": "enableShadows", - "displayName": "Enable Shadows", - "description": "Whether to use the shadow maps.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableShadows" - } - }, - { - "name": "enableDirectionalLights", - "displayName": "Enable Directional Lights", - "description": "Whether to use directional lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableDirectionalLights" - } - }, - { - "name": "enablePunctualLights", - "displayName": "Enable Punctual Lights", - "description": "Whether to use punctual lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enablePunctualLights" - } - }, - { - "name": "enableAreaLights", - "displayName": "Enable Area Lights", - "description": "Whether to use area lights.", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableAreaLights" - } - }, - { - "name": "enableIBL", - "displayName": "Enable IBL", - "description": "Whether to use Image Based Lighting (IBL).", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderOption", - "name": "o_enableIBL" - } - }, - { - "name": "forwardPassIBLSpecular", - "displayName": "Forward Pass IBL Specular", - "description": "Whether to apply IBL specular in the forward pass.", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "name": "o_materialUseForwardPassIBLSpecular" - } - } - ] - }, { "name": "baseColor", "displayName": "Base Color", @@ -360,146 +270,6 @@ } ] }, - { - "name": "clearCoat", - "displayName": "Clear Coat", - "description": "Properties for configuring gloss clear coat", - "properties": [ - { - "name": "enable", - "displayName": "Enable", - "description": "Enable clear coat", - "type": "Bool", - "defaultValue": false - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the percentage of effect applied", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatFactor" - } - }, - { - "name": "influenceMap", - "displayName": " Influence Map", - "description": "Strength factor texture", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMap" - } - }, - { - "name": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "influenceMapUv", - "displayName": " UV", - "description": "Strength factor map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatInfluenceMapUvIndex" - } - }, - { - "name": "roughness", - "displayName": "Roughness", - "description": "Clear coat layer roughness", - "type": "Float", - "defaultValue": 0.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughness" - } - }, - { - "name": "roughnessMap", - "displayName": " Roughness Map", - "description": "Texture for defining surface roughness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMap" - } - }, - { - "name": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, - { - "name": "roughnessMapUv", - "displayName": " UV", - "description": "Roughness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatRoughnessMapUvIndex" - } - }, - { - "name": "normalStrength", - "displayName": "Normal Strength", - "description": "Scales the impact of the clear coat normal map", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 2.0, - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalStrength" - } - }, - { - "name": "normalMap", - "displayName": "Normal Map", - "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMap" - } - }, - { - "name": "useNormalMap", - "displayName": " Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true - }, - { - "name": "normalMapUv", - "displayName": " UV", - "description": "Normal map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_clearCoatNormalMapUvIndex" - } - } - ] - }, { "name": "normal", "displayName": "Normal", @@ -571,152 +341,6 @@ } ] }, - { - "name": "opacity", - "displayName": "Opacity", - "description": "Properties for configuring the materials transparency.", - "properties": [ - { - "name": "mode", - "displayName": "Opacity Mode", - "description": "Indicates the general approach how transparency is to be applied.", - "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], - "defaultValue": "Opaque", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_mode" - } - }, - { - "name": "alphaSource", - "displayName": "Alpha Source", - "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", - "type": "Enum", - "enumValues": [ "Packed", "Split", "None" ], - "defaultValue": "Packed", - "connection": { - "type": "ShaderOption", - "name": "o_opacity_source" - } - }, - { - "name": "textureMap", - "displayName": "Texture", - "description": "Texture for defining surface opacity.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMap" - } - }, - { - "name": "textureMapUv", - "displayName": "UV", - "description": "Opacity map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "name": "m_opacityMapUvIndex" - } - }, - { - "name": "factor", - "displayName": "Factor", - "description": "Factor for cutout threshold and blending", - "type": "Float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.5, - "connection": { - "type": "ShaderInput", - "name": "m_opacityFactor" - } - }, - { - "name": "alphaAffectsSpecular", - "displayName": "Alpha affects specular", - "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", - "type": "float", - "min": 0.0, - "max": 1.0, - "defaultValue": 0.0, - "connection": { - "type": "ShaderInput", - "name": "m_opacityAffectsSpecularFactor" - } - } - ] - }, - { - "name": "uv", - "displayName": "UVs", - "description": "Properties for configuring UV transforms.", - "properties": [ - { - "name": "center", - "displayName": "Center", - "description": "Center point for scaling and rotation transformations.", - "type": "vector2", - "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.5, 0.5 ] - }, - { - "name": "tileU", - "displayName": "Tile U", - "description": "Scales texture coordinates in U.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "tileV", - "displayName": "Tile V", - "description": "Scales texture coordinates in V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - }, - { - "name": "offsetU", - "displayName": "Offset U", - "description": "Offsets texture coordinates in the U direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "offsetV", - "displayName": "Offset V", - "description": "Offsets texture coordinates in the V direction.", - "type": "float", - "defaultValue": 0.0, - "min": -1.0, - "max": 1.0 - }, - { - "name": "rotateDegrees", - "displayName": "Rotate", - "description": "Rotates the texture coordinates (degrees).", - "type": "float", - "defaultValue": 0.0, - "min": -180.0, - "max": 180.0, - "step": 1.0 - }, - { - "name": "scale", - "displayName": "Scale", - "description": "Scales texture coordinates in both U and V.", - "type": "float", - "defaultValue": 1.0, - "step": 0.1 - } - ] - }, { "name": "occlusion", "displayName": "Occlusion", @@ -881,6 +505,146 @@ } ] }, + { + "name": "clearCoat", + "displayName": "Clear Coat", + "description": "Properties for configuring gloss clear coat", + "properties": [ + { + "name": "enable", + "displayName": "Enable", + "description": "Enable clear coat", + "type": "Bool", + "defaultValue": false + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the percentage of effect applied", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatFactor" + } + }, + { + "name": "influenceMap", + "displayName": " Influence Map", + "description": "Strength factor texture", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMap" + } + }, + { + "name": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "influenceMapUv", + "displayName": " UV", + "description": "Strength factor map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatInfluenceMapUvIndex" + } + }, + { + "name": "roughness", + "displayName": "Roughness", + "description": "Clear coat layer roughness", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughness" + } + }, + { + "name": "roughnessMap", + "displayName": " Roughness Map", + "description": "Texture for defining surface roughness", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMap" + } + }, + { + "name": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, + { + "name": "roughnessMapUv", + "displayName": " UV", + "description": "Roughness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatRoughnessMapUvIndex" + } + }, + { + "name": "normalStrength", + "displayName": "Normal Strength", + "description": "Scales the impact of the clear coat normal map", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 2.0, + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalStrength" + } + }, + { + "name": "normalMap", + "displayName": "Normal Map", + "description": "Normal map for clear coat layer, as top layer material clear coat doesn't affect by base layer normal map", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMap" + } + }, + { + "name": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, + { + "name": "normalMapUv", + "displayName": " UV", + "description": "Normal map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_clearCoatNormalMapUvIndex" + } + } + ] + }, { "name": "parallax", "displayName": "Displacement", @@ -989,6 +753,152 @@ } ] }, + { + "name": "opacity", + "displayName": "Opacity", + "description": "Properties for configuring the materials transparency.", + "properties": [ + { + "name": "mode", + "displayName": "Opacity Mode", + "description": "Indicates the general approach how transparency is to be applied.", + "type": "Enum", + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], + "defaultValue": "Opaque", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_mode" + } + }, + { + "name": "alphaSource", + "displayName": "Alpha Source", + "description": "Indicates whether to get the opacity texture from the Base Color map (Packed) or from a separate greyscale texture (Split).", + "type": "Enum", + "enumValues": [ "Packed", "Split", "None" ], + "defaultValue": "Packed", + "connection": { + "type": "ShaderOption", + "name": "o_opacity_source" + } + }, + { + "name": "textureMap", + "displayName": "Texture", + "description": "Texture for defining surface opacity.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMap" + } + }, + { + "name": "textureMapUv", + "displayName": "UV", + "description": "Opacity map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "name": "m_opacityMapUvIndex" + } + }, + { + "name": "factor", + "displayName": "Factor", + "description": "Factor for cutout threshold and blending", + "type": "Float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.5, + "connection": { + "type": "ShaderInput", + "name": "m_opacityFactor" + } + }, + { + "name": "alphaAffectsSpecular", + "displayName": "Alpha affects specular", + "description": "How much the alpha value should also affect specular reflection. This should be 0.0 for materials where light can transmit through their physical surface (like glass), but 1.0 when alpha determines the very presence of a surface (like hair or grass)", + "type": "float", + "min": 0.0, + "max": 1.0, + "defaultValue": 0.0, + "connection": { + "type": "ShaderInput", + "name": "m_opacityAffectsSpecularFactor" + } + } + ] + }, + { + "name": "uv", + "displayName": "UVs", + "description": "Properties for configuring UV transforms.", + "properties": [ + { + "name": "center", + "displayName": "Center", + "description": "Center point for scaling and rotation transformations.", + "type": "vector2", + "vectorLabels": [ "U", "V" ], + "defaultValue": [ 0.5, 0.5 ] + }, + { + "name": "tileU", + "displayName": "Tile U", + "description": "Scales texture coordinates in U.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "tileV", + "displayName": "Tile V", + "description": "Scales texture coordinates in V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + }, + { + "name": "offsetU", + "displayName": "Offset U", + "description": "Offsets texture coordinates in the U direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "offsetV", + "displayName": "Offset V", + "description": "Offsets texture coordinates in the V direction.", + "type": "float", + "defaultValue": 0.0, + "min": -1.0, + "max": 1.0 + }, + { + "name": "rotateDegrees", + "displayName": "Rotate", + "description": "Rotates the texture coordinates (degrees).", + "type": "float", + "defaultValue": 0.0, + "min": -180.0, + "max": 180.0, + "step": 1.0 + }, + { + "name": "scale", + "displayName": "Scale", + "description": "Scales texture coordinates in both U and V.", + "type": "float", + "defaultValue": 1.0, + "step": 0.1 + } + ] + }, { // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader "name": "irradiance", @@ -1012,6 +922,96 @@ "max": 1.0 } ] + }, + { + "name": "general", + "displayName": "General Settings", + "description": "General settings.", + "properties": [ + { + "name": "doubleSided", + "displayName": "Double-sided", + "description": "Whether to render back-faces or just front-faces.", + "type": "Bool" + }, + { + "name": "applySpecularAA", + "displayName": "Apply Specular AA", + "description": "Whether to apply specular anti-aliasing in the shader.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_applySpecularAA" + } + }, + { + "name": "enableShadows", + "displayName": "Enable Shadows", + "description": "Whether to use the shadow maps.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableShadows" + } + }, + { + "name": "enableDirectionalLights", + "displayName": "Enable Directional Lights", + "description": "Whether to use directional lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableDirectionalLights" + } + }, + { + "name": "enablePunctualLights", + "displayName": "Enable Punctual Lights", + "description": "Whether to use punctual lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enablePunctualLights" + } + }, + { + "name": "enableAreaLights", + "displayName": "Enable Area Lights", + "description": "Whether to use area lights.", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableAreaLights" + } + }, + { + "name": "enableIBL", + "displayName": "Enable IBL", + "description": "Whether to use Image Based Lighting (IBL).", + "type": "Bool", + "defaultValue": true, + "connection": { + "type": "ShaderOption", + "name": "o_enableIBL" + } + }, + { + "name": "forwardPassIBLSpecular", + "displayName": "Forward Pass IBL Specular", + "description": "Whether to apply IBL specular in the forward pass.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "name": "o_materialUseForwardPassIBLSpecular" + } + } + ] } ] }, From 0ba1cff08ed1b91c62dcf091ad3a8a95d49d1d86 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:48:46 -0800 Subject: [PATCH 334/394] Remove legacy 'CrySetFileAttributes' (#7226) * Remove legacy function 'CrySetFileAttributes' and replace its only use with AZ::IO::SystemFile::* functions Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- Code/Legacy/CryCommon/WinBase.cpp | 14 -------------- Code/Legacy/CryCommon/platform.h | 1 - Code/Legacy/CryCommon/platform_impl.cpp | 17 ----------------- Code/Legacy/CrySystem/XML/xml.cpp | 5 ++++- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/Code/Legacy/CryCommon/WinBase.cpp b/Code/Legacy/CryCommon/WinBase.cpp index 771cde324e..6e6f5e210a 100644 --- a/Code/Legacy/CryCommon/WinBase.cpp +++ b/Code/Legacy/CryCommon/WinBase.cpp @@ -856,18 +856,4 @@ DLL_EXPORT void OutputDebugString(const char* outputString) #endif -// This code does not have a long life span and will be replaced soon -#if defined(APPLE) || defined(LINUX) || defined(DEFINE_LEGACY_CRY_FILE_OPERATIONS) - -bool CrySetFileAttributes(const char* lpFileName, uint32 dwFileAttributes) -{ - //TODO: implement - printf("CrySetFileAttributes not properly implemented yet\n"); - return false; -} - - - -#endif //defined(APPLE) || defined(LINUX) - #endif // AZ_TRAIT_LEGACY_CRYCOMMON_USE_WINDOWS_STUBS diff --git a/Code/Legacy/CryCommon/platform.h b/Code/Legacy/CryCommon/platform.h index d2251c7091..512f8b4892 100644 --- a/Code/Legacy/CryCommon/platform.h +++ b/Code/Legacy/CryCommon/platform.h @@ -336,7 +336,6 @@ void SetFlags(T& dest, U flags, bool b) #include AZ_RESTRICTED_FILE(platform_h) #endif -bool CrySetFileAttributes(const char* lpFileName, uint32 dwFileAttributes); threadID CryGetCurrentThreadId(); #ifdef __GNUC__ diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index 8cbc58ad95..3392c40771 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -24,7 +24,6 @@ #define PLATFORM_IMPL_H_SECTION_TRAITS 1 #define PLATFORM_IMPL_H_SECTION_CRYLOWLATENCYSLEEP 2 #define PLATFORM_IMPL_H_SECTION_CRYGETFILEATTRIBUTES 3 -#define PLATFORM_IMPL_H_SECTION_CRYSETFILEATTRIBUTES 4 #define PLATFORM_IMPL_H_SECTION_CRY_FILE_ATTRIBUTE_STUBS 5 #define PLATFORM_IMPL_H_SECTION_CRY_SYSTEM_FUNCTIONS 6 #define PLATFORM_IMPL_H_SECTION_VIRTUAL_ALLOCATORS 7 @@ -238,22 +237,6 @@ void InitRootDir(char szExeFileName[], uint nExeSize, char szExeRootName[], uint } } -////////////////////////////////////////////////////////////////////////// -bool CrySetFileAttributes(const char* lpFileName, uint32 dwFileAttributes) -{ -#if defined(AZ_RESTRICTED_PLATFORM) - #define AZ_RESTRICTED_SECTION PLATFORM_IMPL_H_SECTION_CRYSETFILEATTRIBUTES - #include AZ_RESTRICTED_FILE(platform_impl_h) -#endif -#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED) -#undef AZ_RESTRICTED_SECTION_IMPLEMENTED -#else - AZStd::wstring lpFileNameW; - AZStd::to_wstring(lpFileNameW, lpFileName); - return SetFileAttributes(lpFileNameW.c_str(), dwFileAttributes) != 0; -#endif -} - ////////////////////////////////////////////////////////////////////////// threadID CryGetCurrentThreadId() { diff --git a/Code/Legacy/CrySystem/XML/xml.cpp b/Code/Legacy/CrySystem/XML/xml.cpp index fb0714500c..2356e71518 100644 --- a/Code/Legacy/CrySystem/XML/xml.cpp +++ b/Code/Legacy/CrySystem/XML/xml.cpp @@ -1132,7 +1132,10 @@ bool CXmlNode::saveToFile(const char* fileName) bool CXmlNode::saveToFile([[maybe_unused]] const char* fileName, size_t chunkSize, AZ::IO::HandleType fileHandle) { - CrySetFileAttributes(fileName, FILE_ATTRIBUTE_NORMAL); + if (AZ::IO::SystemFile::Exists(fileName) && !AZ::IO::SystemFile::IsWritable(fileName)) + { + AZ::IO::SystemFile::SetWritable(fileName, true); + } if (chunkSize < 256 * 1024) // make at least 256k { From 24086ab3946d6d7257938f4643d81562349c8747 Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Fri, 28 Jan 2022 10:05:03 -0800 Subject: [PATCH 335/394] Resizable Headers for Gem Catalog and Gem Repo Screen (#6885) * Initial mostly working attempt at resizable headers Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Add const and constexpr to variables Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Add header tracking for buttons, display items based on header scrollbar position, fix some spacing issues Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Correct styling for adjustable header, and intending header section and alingned item content with header text Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Prevent header resizing larger than table width. Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> * Fix resize graphical glitching Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> * Remove unecessary qss Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Removed necessary headers Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Remove extra nl and old comment Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Address PR feedback Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Removed unused variables Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Change variable to constexpr Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Remove AUTOMOC from headers, set background color of Gem Catalog to 333333 and adjustable header to transparent Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Change to using update instead of repaint when sections are resized Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> * Change temp directory creation on for gradle Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Co-authored-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../Resources/ProjectManager.qss | 20 ++- .../Source/AdjustableHeaderWidget.cpp | 118 ++++++++++++++++++ .../Source/AdjustableHeaderWidget.h | 52 ++++++++ .../Source/ExternalLinkDialog.h | 2 +- .../GemCatalog/GemCatalogHeaderWidget.h | 2 +- .../Source/GemCatalog/GemCatalogScreen.cpp | 46 ++++++- .../Source/GemCatalog/GemDependenciesDialog.h | 2 +- .../Source/GemCatalog/GemFilterWidget.h | 2 +- .../Source/GemCatalog/GemInspector.h | 2 +- .../Source/GemCatalog/GemItemDelegate.cpp | 47 +++++-- .../Source/GemCatalog/GemItemDelegate.h | 29 ++++- .../Source/GemCatalog/GemListHeaderWidget.cpp | 30 +---- .../Source/GemCatalog/GemListHeaderWidget.h | 2 +- .../Source/GemCatalog/GemListView.cpp | 9 +- .../Source/GemCatalog/GemListView.h | 6 +- .../Source/GemCatalog/GemModel.h | 2 +- .../GemCatalog/GemRequirementDelegate.cpp | 8 +- .../GemCatalog/GemRequirementDelegate.h | 2 +- .../Source/GemCatalog/GemRequirementDialog.h | 2 +- .../GemRequirementFilterProxyModel.h | 2 +- .../GemCatalog/GemRequirementListView.h | 2 +- .../GemCatalog/GemSortFilterProxyModel.h | 2 +- .../Source/GemCatalog/GemUninstallDialog.h | 2 +- .../Source/GemCatalog/GemUpdateDialog.h | 2 +- .../Source/GemRepo/GemRepoInspector.h | 2 +- .../Source/GemRepo/GemRepoItemDelegate.cpp | 63 +++++++--- .../Source/GemRepo/GemRepoItemDelegate.h | 27 ++-- .../Source/GemRepo/GemRepoListView.cpp | 8 +- .../Source/GemRepo/GemRepoListView.h | 10 +- .../Source/GemRepo/GemRepoModel.h | 2 +- .../Source/GemRepo/GemRepoScreen.cpp | 54 ++++---- .../Source/GemRepo/GemRepoScreen.h | 3 +- .../ProjectManager/Source/GemsSubWidget.h | 2 +- Code/Tools/ProjectManager/Source/LinkWidget.h | 2 +- .../Source/ProjectButtonWidget.h | 2 +- .../Source/ProjectManagerDefs.h | 1 + .../Source/ScreenHeaderWidget.h | 2 +- Code/Tools/ProjectManager/Source/TagWidget.h | 2 +- .../Source/TemplateButtonWidget.h | 2 +- .../project_manager_files.cmake | 2 + .../build/Platform/Android/gradle_windows.cmd | 18 ++- 41 files changed, 437 insertions(+), 158 deletions(-) create mode 100644 Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.cpp create mode 100644 Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.h diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qss b/Code/Tools/ProjectManager/Resources/ProjectManager.qss index 3d100ec170..b2217435b2 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qss +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qss @@ -500,6 +500,10 @@ QProgressBar::chunk { /************** Gem Catalog **************/ +#GemCatalogScreen { + background-color: #333333; +} + #GemCatalogTitle { font-size: 18px; } @@ -546,9 +550,8 @@ QProgressBar::chunk { min-height:24px; } -#GemCatalogHeaderLabel { - font-size: 12px; - color: #FFFFFF; +#adjustableHeaderWidget QHeaderView::section { + background-color: transparent; } #GemCatalogHeaderShowCountLabel { @@ -732,15 +735,6 @@ QProgressBar::chunk { stop: 0 #555555, stop: 1.0 #777777); } -#gemRepoHeaderTable { - background-color: transparent; - max-height: 30px; -} - -#gemRepoListHeader { - background-color: transparent; -} - #gemRepoInspector { background: #444444; } @@ -774,4 +768,4 @@ QProgressBar::chunk { #gemRepoInspectorAddInfoTitleLabel { font-size: 16px; color: #FFFFFF; -} \ No newline at end of file +} diff --git a/Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.cpp new file mode 100644 index 0000000000..2b4732a168 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.cpp @@ -0,0 +1,118 @@ +/* + * 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 O3DE::ProjectManager +{ + AdjustableHeaderWidget::AdjustableHeaderWidget( const QStringList& headerLabels, + const QVector& defaultHeaderWidths, int minHeaderWidth, + const QVector& resizeModes, QWidget* parent) + : QTableWidget(parent) + { + setObjectName("adjustableHeaderWidget"); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + setFixedHeight(s_headerWidgetHeight); + + m_header = horizontalHeader(); + m_header->setDefaultAlignment(Qt::AlignLeft); + + setColumnCount(headerLabels.count()); + setHorizontalHeaderLabels(headerLabels); + + AZ_Assert(defaultHeaderWidths.count() == columnCount(), "Default header widths does not match number of columns"); + AZ_Assert(resizeModes.count() == columnCount(), "Resize modesdoes not match number of columns"); + + for (int column = 0; column < columnCount(); ++column) + { + m_header->resizeSection(column, defaultHeaderWidths[column]); + m_header->setSectionResizeMode(column, resizeModes[column]); + } + + m_header->setMinimumSectionSize(minHeaderWidth); + m_header->setCascadingSectionResizes(true); + + connect(m_header, &QHeaderView::sectionResized, this, &AdjustableHeaderWidget::OnSectionResized); + } + + void AdjustableHeaderWidget::OnSectionResized(int logicalIndex, int oldSize, int newSize) + { + const int headerCount = columnCount(); + const int headerWidth = m_header->width(); + const int totalSectionWidth = m_header->length(); + + if (totalSectionWidth > headerWidth && newSize > oldSize) + { + int xPos = 0; + int requiredWidth = 0; + + for (int i = 0; i < headerCount; i++) + { + if (i < logicalIndex) + { + xPos += m_header->sectionSize(i); + } + else if (i == logicalIndex) + { + xPos += newSize; + } + else if (i > logicalIndex) + { + if (m_header->sectionResizeMode(i) == QHeaderView::ResizeMode::Fixed) + { + requiredWidth += m_header->sectionSize(i); + } + else + { + requiredWidth += m_header->minimumSectionSize(); + } + } + } + + if (xPos + requiredWidth > headerWidth) + { + m_header->resizeSection(logicalIndex, oldSize); + } + } + + // wait till all columns resized + QTimer::singleShot(0, [&]() + { + // only re-paint when the header and section widths have settled + const int headerWidth = m_header->width(); + const int totalSectionWidth = m_header->length(); + if (totalSectionWidth == headerWidth) + { + emit sectionsResized(); + } + }); + } + + QPair AdjustableHeaderWidget::CalcColumnXBounds(int headerIndex) const + { + // Total the widths of all headers before this one in first and including it in second + QPair bounds(0, 0); + + for (int curIndex = 0; curIndex <= headerIndex; ++curIndex) + { + if (curIndex == headerIndex) + { + bounds.first = bounds.second; + } + bounds.second += m_header->sectionSize(curIndex); + } + + return bounds; + } + + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.h b/Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.h new file mode 100644 index 0000000000..26a5ce13c7 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/AdjustableHeaderWidget.h @@ -0,0 +1,52 @@ +/* + * 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 + +#if !defined(Q_MOC_RUN) +#include + +#include +#include +#include +#include +#endif + +namespace O3DE::ProjectManager +{ + // Using a QTableWidget for its header + // Using a seperate model allows the setup of a header exactly as needed + class AdjustableHeaderWidget + : public QTableWidget + { + Q_OBJECT + + public: + explicit AdjustableHeaderWidget(const QStringList& headerLabels, + const QVector& defaultHeaderWidths, int minHeaderWidth, + const QVector& resizeModes, + QWidget* parent = nullptr); + ~AdjustableHeaderWidget() = default; + + QPair CalcColumnXBounds(int headerIndex) const; + + inline constexpr static int s_headerTextIndent = 7; + inline constexpr static int s_headerWidgetHeight = 24; + + QHeaderView* m_header; + + signals: + void sectionsResized(); + + protected slots: + void OnSectionResized(int logicalIndex, int oldSize, int newSize); + + private: + inline constexpr static int s_headerIndentSection = 11; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ExternalLinkDialog.h b/Code/Tools/ProjectManager/Source/ExternalLinkDialog.h index 45d391e64e..f1b6574b67 100644 --- a/Code/Tools/ProjectManager/Source/ExternalLinkDialog.h +++ b/Code/Tools/ProjectManager/Source/ExternalLinkDialog.h @@ -17,7 +17,7 @@ namespace O3DE::ProjectManager class ExternalLinkDialog : public QDialog { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit ExternalLinkDialog(const QUrl& url, QWidget* parent = nullptr); ~ExternalLinkDialog() = default; diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h index b749e9831d..4e945f5c99 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h @@ -33,7 +33,7 @@ namespace O3DE::ProjectManager class GemCartWidget : public QScrollArea { - Q_OBJECT // AUTOMOC + Q_OBJECT public: GemCartWidget(GemModel* gemModel, DownloadController* downloadController, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp index 5bc0b26ca5..ebabff45cc 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp @@ -19,8 +19,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -40,6 +42,13 @@ namespace O3DE::ProjectManager GemCatalogScreen::GemCatalogScreen(QWidget* parent) : ScreenWidget(parent) { + // The width of either side panel (filters, inspector) in the catalog + constexpr int sidePanelWidth = 240; + // Querying qApp about styling reports the scroll bar being larger than it is so define it manually + constexpr int verticalScrollBarWidth = 8; + + setObjectName("GemCatalogScreen"); + m_gemModel = new GemModel(this); m_proxyModel = new GemSortFilterProxyModel(m_gemModel, this); @@ -69,10 +78,8 @@ namespace O3DE::ProjectManager hLayout->setMargin(0); vLayout->addLayout(hLayout); - m_gemListView = new GemListView(m_proxyModel, m_proxyModel->GetSelectionModel(), this); - m_rightPanelStack = new QStackedWidget(this); - m_rightPanelStack->setFixedWidth(240); + m_rightPanelStack->setFixedWidth(sidePanelWidth); m_gemInspector = new GemInspector(m_gemModel, this); @@ -81,18 +88,45 @@ namespace O3DE::ProjectManager connect(m_gemInspector, &GemInspector::UninstallGem, this, &GemCatalogScreen::UninstallGem); QWidget* filterWidget = new QWidget(this); - filterWidget->setFixedWidth(240); + filterWidget->setFixedWidth(sidePanelWidth); m_filterWidgetLayout = new QVBoxLayout(); m_filterWidgetLayout->setMargin(0); m_filterWidgetLayout->setSpacing(0); filterWidget->setLayout(m_filterWidgetLayout); - GemListHeaderWidget* listHeaderWidget = new GemListHeaderWidget(m_proxyModel); + GemListHeaderWidget* catalogHeaderWidget = new GemListHeaderWidget(m_proxyModel); + + constexpr int minHeaderSectionWidth = 100; + AdjustableHeaderWidget* listHeaderWidget = new AdjustableHeaderWidget( + QStringList{ tr("Gem Name"), tr("Gem Summary"), tr("Status") }, + QVector{ + GemItemDelegate::s_defaultSummaryStartX - 30, + 0, // Section is set to stretch to fit + GemItemDelegate::s_buttonWidth + GemItemDelegate::s_itemMargins.left() + GemItemDelegate::s_itemMargins.right() + GemItemDelegate::s_contentMargins.right() + }, + minHeaderSectionWidth, + QVector + { + QHeaderView::ResizeMode::Interactive, + QHeaderView::ResizeMode::Stretch, + QHeaderView::ResizeMode::Fixed + }, + this); + + m_gemListView = new GemListView(m_proxyModel, m_proxyModel->GetSelectionModel(), listHeaderWidget, this); + + QHBoxLayout* listHeaderLayout = new QHBoxLayout(); + listHeaderLayout->setMargin(0); + listHeaderLayout->setSpacing(0); + listHeaderLayout->addSpacing(GemItemDelegate::s_itemMargins.left()); + listHeaderLayout->addWidget(listHeaderWidget); + listHeaderLayout->addSpacing(GemItemDelegate::s_itemMargins.right() + verticalScrollBarWidth); QVBoxLayout* middleVLayout = new QVBoxLayout(); middleVLayout->setMargin(0); middleVLayout->setSpacing(0); - middleVLayout->addWidget(listHeaderWidget); + middleVLayout->addWidget(catalogHeaderWidget); + middleVLayout->addLayout(listHeaderLayout); middleVLayout->addWidget(m_gemListView); hLayout->addWidget(filterWidget); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemDependenciesDialog.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemDependenciesDialog.h index df8ca6f8a2..1858637aa5 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemDependenciesDialog.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemDependenciesDialog.h @@ -19,7 +19,7 @@ namespace O3DE::ProjectManager class GemDependenciesDialog : public QDialog { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemDependenciesDialog(GemModel* gemModel, QWidget *parent = nullptr); ~GemDependenciesDialog() = default; diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h index e422178d08..729a63af64 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h @@ -26,7 +26,7 @@ namespace O3DE::ProjectManager class FilterCategoryWidget : public QWidget { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit FilterCategoryWidget(const QString& header, diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h index 1713191623..c71d43eaac 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h @@ -28,7 +28,7 @@ namespace O3DE::ProjectManager class GemInspector : public QScrollArea { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemInspector(GemModel* model, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index dd94e42fc4..1733257e3b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -9,6 +9,8 @@ #include #include #include +#include + #include #include @@ -22,12 +24,14 @@ #include #include #include +#include namespace O3DE::ProjectManager { - GemItemDelegate::GemItemDelegate(QAbstractItemModel* model, QObject* parent) + GemItemDelegate::GemItemDelegate(QAbstractItemModel* model, AdjustableHeaderWidget* header, QObject* parent) : QStyledItemDelegate(parent) , m_model(model) + , m_headerWidget(header) { AddPlatformIcon(GemInfo::Android, ":/Android.svg"); AddPlatformIcon(GemInfo::iOS, ":/iOS.svg"); @@ -116,12 +120,15 @@ namespace O3DE::ProjectManager // Gem name QString gemName = GemModel::GetDisplayName(modelIndex); QFont gemNameFont(options.font); - const int firstColumnMaxTextWidth = s_summaryStartX - 30; + QPair nameXBounds = CalcColumnXBounds(HeaderOrder::Name); + const int nameStartX = nameXBounds.first; + const int firstColumnTextStartX = s_itemMargins.left() + nameStartX + AdjustableHeaderWidget::s_headerTextIndent; + const int firstColumnMaxTextWidth = nameXBounds.second - nameStartX - AdjustableHeaderWidget::s_headerTextIndent; gemNameFont.setPixelSize(static_cast(s_gemNameFontSize)); gemNameFont.setBold(true); gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth); QRect gemNameRect = GetTextRect(gemNameFont, gemName, s_gemNameFontSize); - gemNameRect.moveTo(contentRect.left(), contentRect.top()); + gemNameRect.moveTo(firstColumnTextStartX, contentRect.top()); painter->setFont(gemNameFont); painter->setPen(m_textColor); gemNameRect = painter->boundingRect(gemNameRect, Qt::TextSingleLine, gemName); @@ -131,7 +138,7 @@ namespace O3DE::ProjectManager QString gemCreator = GemModel::GetCreator(modelIndex); gemCreator = standardFontMetrics.elidedText(gemCreator, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth); QRect gemCreatorRect = GetTextRect(standardFont, gemCreator, s_fontSize); - gemCreatorRect.moveTo(contentRect.left(), contentRect.top() + gemNameRect.height()); + gemCreatorRect.moveTo(firstColumnTextStartX, contentRect.top() + gemNameRect.height()); painter->setFont(standardFont); gemCreatorRect = painter->boundingRect(gemCreatorRect, Qt::TextSingleLine, gemCreator); @@ -157,10 +164,13 @@ namespace O3DE::ProjectManager const int featureTagAreaHeight = 30; const int summaryHeight = contentRect.height() - (hasTags * featureTagAreaHeight); - const int additionalSummarySpacing = s_itemMargins.right() * 3; - const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - additionalSummarySpacing, + const auto [summaryStartX, summaryEndX] = CalcColumnXBounds(HeaderOrder::Summary); + + const QSize summarySize = + QSize(summaryEndX - summaryStartX - AdjustableHeaderWidget::s_headerTextIndent - s_extraSummarySpacing, summaryHeight); - return QRect(QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), summarySize); + return QRect( + QPoint(s_itemMargins.left() + summaryStartX + AdjustableHeaderWidget::s_headerTextIndent, contentRect.top()), summarySize); } QSize GemItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const @@ -169,7 +179,7 @@ namespace O3DE::ProjectManager initStyleOption(&options, modelIndex); int marginsHorizontal = s_itemMargins.left() + s_itemMargins.right() + s_contentMargins.left() + s_contentMargins.right(); - return QSize(marginsHorizontal + s_buttonWidth + s_summaryStartX, s_height); + return QSize(marginsHorizontal + s_buttonWidth + s_defaultSummaryStartX, s_height); } bool GemItemDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) @@ -299,9 +309,17 @@ namespace O3DE::ProjectManager return QFontMetrics(font).boundingRect(text); } + QPair GemItemDelegate::CalcColumnXBounds(HeaderOrder header) const + { + return m_headerWidget->CalcColumnXBounds(static_cast(header)); + } + QRect GemItemDelegate::CalcButtonRect(const QRect& contentRect) const { - const QPoint topLeft = QPoint(contentRect.right() - s_buttonWidth, contentRect.center().y() - s_buttonHeight / 2); + const QPoint topLeft = QPoint( + s_itemMargins.left() + CalcColumnXBounds(HeaderOrder::Status).first + AdjustableHeaderWidget::s_headerTextIndent + s_statusIconSize + + s_statusButtonSpacing, + contentRect.center().y() - s_buttonHeight / 2); const QSize size = QSize(s_buttonWidth, s_buttonHeight); return QRect(topLeft, size); } @@ -331,18 +349,23 @@ namespace O3DE::ProjectManager } } - void GemItemDelegate::DrawFeatureTags(QPainter* painter, const QRect& contentRect, const QStringList& featureTags, const QFont& standardFont, const QRect& summaryRect) const + void GemItemDelegate::DrawFeatureTags( + QPainter* painter, + const QRect& contentRect, + const QStringList& featureTags, + const QFont& standardFont, + const QRect& summaryRect) const { QFont gemFeatureTagFont(standardFont); gemFeatureTagFont.setPixelSize(s_featureTagFontSize); gemFeatureTagFont.setBold(false); painter->setFont(gemFeatureTagFont); - int x = s_summaryStartX; + int x = CalcColumnXBounds(HeaderOrder::Summary).first + AdjustableHeaderWidget::s_headerTextIndent; for (const QString& featureTag : featureTags) { QRect featureTagRect = GetTextRect(gemFeatureTagFont, featureTag, s_featureTagFontSize); - featureTagRect.moveTo(contentRect.left() + x + s_featureTagBorderMarginX, + featureTagRect.moveTo(s_itemMargins.left() + x + s_featureTagBorderMarginX, contentRect.top() + 47); featureTagRect = painter->boundingRect(featureTagRect, Qt::TextSingleLine, featureTag); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h index 107de6de15..a08fcb0a4b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h @@ -19,13 +19,15 @@ QT_FORWARD_DECLARE_CLASS(QEvent) namespace O3DE::ProjectManager { + QT_FORWARD_DECLARE_CLASS(AdjustableHeaderWidget) + class GemItemDelegate : public QStyledItemDelegate { - Q_OBJECT // AUTOMOC + Q_OBJECT public: - explicit GemItemDelegate(QAbstractItemModel* model, QObject* parent = nullptr); + explicit GemItemDelegate(QAbstractItemModel* model, AdjustableHeaderWidget* header, QObject* parent = nullptr); ~GemItemDelegate() = default; void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const override; @@ -45,12 +47,13 @@ namespace O3DE::ProjectManager inline constexpr static int s_height = 105; // Gem item total height inline constexpr static qreal s_gemNameFontSize = 13.0; inline constexpr static qreal s_fontSize = 12.0; - inline constexpr static int s_summaryStartX = 150; + inline constexpr static int s_defaultSummaryStartX = 190; // Margin and borders inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/16, /*top=*/8, /*right=*/16, /*bottom=*/8); // Item border distances inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/20, /*top=*/12, /*right=*/20, /*bottom=*/12); // Distances of the elements within an item to the item borders inline constexpr static int s_borderWidth = 4; + inline constexpr static int s_extraSummarySpacing = s_itemMargins.right(); // Button inline constexpr static int s_buttonWidth = 32; @@ -65,6 +68,13 @@ namespace O3DE::ProjectManager inline constexpr static int s_featureTagBorderMarginY = 3; inline constexpr static int s_featureTagSpacing = 7; + enum class HeaderOrder + { + Name, + Summary, + Status + }; + signals: void MovieStartedPlaying(const QMovie* playingMovie) const; @@ -74,13 +84,20 @@ namespace O3DE::ProjectManager void CalcRects(const QStyleOptionViewItem& option, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const; QRect GetTextRect(QFont& font, const QString& text, qreal fontSize) const; + QPair CalcColumnXBounds(HeaderOrder header) const; QRect CalcButtonRect(const QRect& contentRect) const; QRect CalcSummaryRect(const QRect& contentRect, bool hasTags) const; void DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; void DrawButton(QPainter* painter, const QRect& buttonRect, const QModelIndex& modelIndex) const; - void DrawFeatureTags(QPainter* painter, const QRect& contentRect, const QStringList& featureTags, const QFont& standardFont, const QRect& summaryRect) const; + void DrawFeatureTags( + QPainter* painter, + const QRect& contentRect, + const QStringList& featureTags, + const QFont& standardFont, + const QRect& summaryRect) const; void DrawText(const QString& text, QPainter* painter, const QRect& rect, const QFont& standardFont) const; - void DrawDownloadStatusIcon(QPainter* painter, const QRect& contentRect, const QRect& buttonRect, const QModelIndex& modelIndex) const; + void DrawDownloadStatusIcon( + QPainter* painter, const QRect& contentRect, const QRect& buttonRect, const QModelIndex& modelIndex) const; QAbstractItemModel* m_model = nullptr; @@ -100,5 +117,7 @@ namespace O3DE::ProjectManager QPixmap m_downloadSuccessfulPixmap; QPixmap m_downloadFailedPixmap; QMovie* m_downloadingMovie = nullptr; + + AdjustableHeaderWidget* m_headerWidget = nullptr; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp index 10ff31f33b..ec54b413b6 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp @@ -78,37 +78,9 @@ namespace O3DE::ProjectManager // Separating line QFrame* hLine = new QFrame(); hLine->setFrameShape(QFrame::HLine); - hLine->setStyleSheet("color: #666666;"); + hLine->setObjectName("horizontalSeparatingLine"); vLayout->addWidget(hLine); vLayout->addSpacing(GemItemDelegate::s_contentMargins.top()); - - // Bottom section - QHBoxLayout* columnHeaderLayout = new QHBoxLayout(); - columnHeaderLayout->setAlignment(Qt::AlignLeft); - - const int gemNameStartX = GemItemDelegate::s_itemMargins.left() + GemItemDelegate::s_contentMargins.left() - 1; - columnHeaderLayout->addSpacing(gemNameStartX); - - QLabel* gemNameLabel = new QLabel(tr("Gem Name")); - gemNameLabel->setObjectName("GemCatalogHeaderLabel"); - columnHeaderLayout->addWidget(gemNameLabel); - - columnHeaderLayout->addSpacing(89); - - QLabel* gemSummaryLabel = new QLabel(tr("Gem Summary")); - gemSummaryLabel->setObjectName("GemCatalogHeaderLabel"); - columnHeaderLayout->addWidget(gemSummaryLabel); - - QSpacerItem* horizontalSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - columnHeaderLayout->addSpacerItem(horizontalSpacer); - - QLabel* gemSelectedLabel = new QLabel(tr("Status")); - gemSelectedLabel->setObjectName("GemCatalogHeaderLabel"); - columnHeaderLayout->addWidget(gemSelectedLabel); - - columnHeaderLayout->addSpacing(72); - - vLayout->addLayout(columnHeaderLayout); } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h index 537748c849..350c17bbf9 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h @@ -19,7 +19,7 @@ namespace O3DE::ProjectManager class GemListHeaderWidget : public QFrame { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp index cfdf7fa5b3..d68cbf511b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp @@ -8,12 +8,15 @@ #include #include +#include #include +#include namespace O3DE::ProjectManager { - GemListView::GemListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent) + GemListView::GemListView( + QAbstractItemModel* model, QItemSelectionModel* selectionModel, AdjustableHeaderWidget* header, QWidget* parent) : QListView(parent) { setObjectName("GemCatalogListView"); @@ -21,7 +24,7 @@ namespace O3DE::ProjectManager setModel(model); setSelectionModel(selectionModel); - GemItemDelegate* itemDelegate = new GemItemDelegate(model, this); + GemItemDelegate* itemDelegate = new GemItemDelegate(model, header, this); connect(itemDelegate, &GemItemDelegate::MovieStartedPlaying, [=](const QMovie* playingMovie) { @@ -31,6 +34,8 @@ namespace O3DE::ProjectManager this->viewport()->repaint(); }); }); + + connect(header, &AdjustableHeaderWidget::sectionsResized, [=] { update(); }); setItemDelegate(itemDelegate); } diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h index b1b0e0c077..81f5255d9b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h @@ -16,13 +16,15 @@ namespace O3DE::ProjectManager { + QT_FORWARD_DECLARE_CLASS(AdjustableHeaderWidget) + class GemListView : public QListView { - Q_OBJECT // AUTOMOC + Q_OBJECT public: - explicit GemListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent = nullptr); + explicit GemListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, AdjustableHeaderWidget* header, QWidget* parent = nullptr); ~GemListView() = default; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h index cb99581468..50f406c97d 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h @@ -21,7 +21,7 @@ namespace O3DE::ProjectManager class GemModel : public QStandardItemModel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemModel(QObject* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp index f4a7148d46..ae4bad8901 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp @@ -16,7 +16,7 @@ namespace O3DE::ProjectManager { GemRequirementDelegate::GemRequirementDelegate(QAbstractItemModel* model, QObject* parent) - : GemItemDelegate(model, parent) + : GemItemDelegate(model, nullptr, parent) { } @@ -54,7 +54,7 @@ namespace O3DE::ProjectManager // Gem name QString gemName = GemModel::GetDisplayName(modelIndex); QFont gemNameFont(options.font); - const int firstColumnMaxTextWidth = s_summaryStartX - 30; + const int firstColumnMaxTextWidth = s_defaultSummaryStartX - 30; gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth); gemNameFont.setPixelSize(static_cast(s_gemNameFontSize)); gemNameFont.setBold(true); @@ -75,8 +75,8 @@ namespace O3DE::ProjectManager QRect GemRequirementDelegate::CalcRequirementRect(const QRect& contentRect) const { - const QSize requirementSize = QSize(contentRect.width() - s_summaryStartX - s_itemMargins.right(), contentRect.height()); - return QRect(QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), requirementSize); + const QSize requirementSize = QSize(contentRect.width() - s_defaultSummaryStartX - s_itemMargins.right(), contentRect.height()); + return QRect(QPoint(contentRect.left() + s_defaultSummaryStartX, contentRect.top()), requirementSize); } bool GemRequirementDelegate::editorEvent( diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.h index e9001df7fa..cbfb6b1838 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.h @@ -18,7 +18,7 @@ namespace O3DE::ProjectManager class GemRequirementDelegate : public GemItemDelegate { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemRequirementDelegate(QAbstractItemModel* model, QObject* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDialog.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDialog.h index af8b1e2cc9..c1dff70ca2 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDialog.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDialog.h @@ -19,7 +19,7 @@ namespace O3DE::ProjectManager class GemRequirementDialog : public QDialog { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemRequirementDialog(GemModel* model, QWidget *parent = nullptr); ~GemRequirementDialog() = default; diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementFilterProxyModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementFilterProxyModel.h index 7df75f7d94..c527df2ec1 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementFilterProxyModel.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementFilterProxyModel.h @@ -22,7 +22,7 @@ namespace O3DE::ProjectManager class GemRequirementFilterProxyModel : public QSortFilterProxyModel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: GemRequirementFilterProxyModel(GemModel* sourceModel, QObject* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementListView.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementListView.h index 1638fe3fc5..61b3356e06 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementListView.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementListView.h @@ -19,7 +19,7 @@ namespace O3DE::ProjectManager class GemRequirementListView : public QListView { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemRequirementListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h index 0c58d66ccf..6bdeaf828b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h @@ -22,7 +22,7 @@ namespace O3DE::ProjectManager class GemSortFilterProxyModel : public QSortFilterProxyModel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: enum class GemSelected diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemUninstallDialog.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemUninstallDialog.h index 9e3f4c3f3b..391d247f90 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemUninstallDialog.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemUninstallDialog.h @@ -17,7 +17,7 @@ namespace O3DE::ProjectManager class GemUninstallDialog : public QDialog { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemUninstallDialog(const QString& gemName, QWidget *parent = nullptr); ~GemUninstallDialog() = default; diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemUpdateDialog.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemUpdateDialog.h index cf34abfb3d..a0996216fd 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemUpdateDialog.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemUpdateDialog.h @@ -17,7 +17,7 @@ namespace O3DE::ProjectManager class GemUpdateDialog : public QDialog { - Q_OBJECT // AUTOMOC + Q_OBJECT public : explicit GemUpdateDialog(const QString& gemName, bool updateAvaliable = true, QWidget* parent = nullptr); ~GemUpdateDialog() = default; diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoInspector.h b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoInspector.h index a14472e6a6..f7051d1704 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoInspector.h +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoInspector.h @@ -26,7 +26,7 @@ namespace O3DE::ProjectManager { class GemRepoInspector : public QScrollArea { - Q_OBJECT // AUTOMOC + Q_OBJECT public : explicit GemRepoInspector(GemRepoModel* model, QWidget* parent = nullptr); ~GemRepoInspector() = default; diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.cpp index fdfcf02155..672cd509d3 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.cpp @@ -9,16 +9,19 @@ #include #include #include +#include #include #include #include +#include namespace O3DE::ProjectManager { - GemRepoItemDelegate::GemRepoItemDelegate(QAbstractItemModel* model, QObject* parent) + GemRepoItemDelegate::GemRepoItemDelegate(QAbstractItemModel* model, AdjustableHeaderWidget* header, QObject* parent) : QStyledItemDelegate(parent) , m_model(model) + , m_headerWidget(header) { m_refreshIcon = QIcon(":/Refresh.svg").pixmap(s_refreshIconSize, s_refreshIconSize); m_editIcon = QIcon(":/Edit.svg").pixmap(s_iconSize, s_iconSize); @@ -69,44 +72,55 @@ namespace O3DE::ProjectManager painter->restore(); } + int currentHorizontalOffset = CalcColumnXBounds(HeaderOrder::Name).first; + // Repo name QString repoName = GemRepoModel::GetName(modelIndex); - repoName = QFontMetrics(standardFont).elidedText(repoName, Qt::TextElideMode::ElideRight, s_nameMaxWidth); + int sectionSize = m_headerWidget->m_header->sectionSize(static_cast(HeaderOrder::Name)); + repoName = standardFontMetrics.elidedText(repoName, Qt::TextElideMode::ElideRight, + sectionSize - AdjustableHeaderWidget::s_headerTextIndent); QRect repoNameRect = GetTextRect(standardFont, repoName, s_fontSize); - int currentHorizontalOffset = contentRect.left(); - repoNameRect.moveTo(currentHorizontalOffset, contentRect.center().y() - repoNameRect.height() / 2); + repoNameRect.moveTo(currentHorizontalOffset + AdjustableHeaderWidget::s_headerTextIndent, + contentRect.center().y() - repoNameRect.height() / 2); repoNameRect = painter->boundingRect(repoNameRect, Qt::TextSingleLine, repoName); painter->drawText(repoNameRect, Qt::TextSingleLine, repoName); // Rem repo creator + currentHorizontalOffset += sectionSize; + sectionSize = m_headerWidget->m_header->sectionSize(static_cast(HeaderOrder::Creator)); + QString repoCreator = GemRepoModel::GetCreator(modelIndex); - repoCreator = standardFontMetrics.elidedText(repoCreator, Qt::TextElideMode::ElideRight, s_creatorMaxWidth); + repoCreator = standardFontMetrics.elidedText(repoCreator, Qt::TextElideMode::ElideRight, + sectionSize - AdjustableHeaderWidget::s_headerTextIndent); QRect repoCreatorRect = GetTextRect(standardFont, repoCreator, s_fontSize); - currentHorizontalOffset += s_nameMaxWidth + s_contentSpacing; - repoCreatorRect.moveTo(currentHorizontalOffset, contentRect.center().y() - repoCreatorRect.height() / 2); + repoCreatorRect.moveTo(currentHorizontalOffset + AdjustableHeaderWidget::s_headerTextIndent, + contentRect.center().y() - repoCreatorRect.height() / 2); repoCreatorRect = painter->boundingRect(repoCreatorRect, Qt::TextSingleLine, repoCreator); painter->drawText(repoCreatorRect, Qt::TextSingleLine, repoCreator); // Repo update + currentHorizontalOffset += sectionSize; + sectionSize = m_headerWidget->m_header->sectionSize(static_cast(HeaderOrder::Update)); + QString repoUpdatedDate = GemRepoModel::GetLastUpdated(modelIndex).toString(RepoTimeFormat); - repoUpdatedDate = standardFontMetrics.elidedText(repoUpdatedDate, Qt::TextElideMode::ElideRight, s_updatedMaxWidth); + repoUpdatedDate = standardFontMetrics.elidedText( + repoUpdatedDate, Qt::TextElideMode::ElideRight, + sectionSize - GemRepoItemDelegate::s_refreshIconSpacing - GemRepoItemDelegate::s_refreshIconSize - AdjustableHeaderWidget::s_headerTextIndent); QRect repoUpdatedDateRect = GetTextRect(standardFont, repoUpdatedDate, s_fontSize); - currentHorizontalOffset += s_creatorMaxWidth + s_contentSpacing; - repoUpdatedDateRect.moveTo(currentHorizontalOffset, contentRect.center().y() - repoUpdatedDateRect.height() / 2); + repoUpdatedDateRect.moveTo(currentHorizontalOffset + AdjustableHeaderWidget::s_headerTextIndent, + contentRect.center().y() - repoUpdatedDateRect.height() / 2); repoUpdatedDateRect = painter->boundingRect(repoUpdatedDateRect, Qt::TextSingleLine, repoUpdatedDate); painter->drawText(repoUpdatedDateRect, Qt::TextSingleLine, repoUpdatedDate); // Draw refresh button - painter->drawPixmap( - repoUpdatedDateRect.left() + s_updatedMaxWidth + s_refreshIconSpacing, - contentRect.center().y() - s_refreshIconSize / 3, // Dividing size by 3 centers much better - m_refreshIcon); + const QRect refreshButtonRect = CalcRefreshButtonRect(contentRect); + painter->drawPixmap(refreshButtonRect.topLeft(), m_refreshIcon); if (options.state & QStyle::State_MouseOver) { @@ -121,8 +135,8 @@ namespace O3DE::ProjectManager QStyleOptionViewItem options(option); initStyleOption(&options, modelIndex); - int marginsHorizontal = s_itemMargins.left() + s_itemMargins.right() + s_contentMargins.left() + s_contentMargins.right(); - return QSize(marginsHorizontal + s_nameMaxWidth + s_creatorMaxWidth + s_updatedMaxWidth + s_contentSpacing * 3, s_height); + const int marginsHorizontal = s_itemMargins.left() + s_itemMargins.right() + s_contentMargins.left() + s_contentMargins.right(); + return QSize(marginsHorizontal + s_nameDefaultWidth + s_creatorDefaultWidth + s_updatedDefaultWidth, s_height); } bool GemRepoItemDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) @@ -185,22 +199,31 @@ namespace O3DE::ProjectManager return QFontMetrics(font).boundingRect(text); } + QPair GemRepoItemDelegate::CalcColumnXBounds(HeaderOrder header) const + { + return m_headerWidget->CalcColumnXBounds(static_cast(header)); + } + QRect GemRepoItemDelegate::CalcDeleteButtonRect(const QRect& contentRect) const { - const QPoint topLeft = QPoint(contentRect.right() - s_iconSize, contentRect.center().y() - s_iconSize / 2); + const int deleteHeaderEndX = CalcColumnXBounds(HeaderOrder::Delete).second; + const QPoint topLeft = QPoint(deleteHeaderEndX - s_iconSize - s_contentMargins.right(), contentRect.center().y() - s_iconSize / 2); return QRect(topLeft, QSize(s_iconSize, s_iconSize)); } QRect GemRepoItemDelegate::CalcRefreshButtonRect(const QRect& contentRect) const { - const int topLeftX = contentRect.left() + s_nameMaxWidth + s_creatorMaxWidth + s_updatedMaxWidth + s_contentSpacing * 2 + s_refreshIconSpacing; - const QPoint topLeft = QPoint(topLeftX, contentRect.center().y() - s_refreshIconSize / 3); + const int headerEndX = CalcColumnXBounds(HeaderOrder::Update).second; + const int leftX = headerEndX - s_refreshIconSize - s_refreshIconSpacing; + // Dividing size by 3 centers much better + const QPoint topLeft = QPoint(leftX, contentRect.center().y() - s_refreshIconSize / 3); return QRect(topLeft, QSize(s_refreshIconSize, s_refreshIconSize)); } void GemRepoItemDelegate::DrawEditButtons(QPainter* painter, const QRect& contentRect) const { - painter->drawPixmap(contentRect.right() - s_iconSize, contentRect.center().y() - s_iconSize / 2, m_deleteIcon); + const QRect deleteButtonRect = CalcDeleteButtonRect(contentRect); + painter->drawPixmap(deleteButtonRect, m_deleteIcon); } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.h b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.h index 69d943001d..f8b53e47be 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoItemDelegate.h @@ -18,13 +18,15 @@ QT_FORWARD_DECLARE_CLASS(QEvent) namespace O3DE::ProjectManager { + QT_FORWARD_DECLARE_CLASS(AdjustableHeaderWidget) + class GemRepoItemDelegate : public QStyledItemDelegate { - Q_OBJECT // AUTOMOC + Q_OBJECT public: - explicit GemRepoItemDelegate(QAbstractItemModel* model, QObject* parent = nullptr); + explicit GemRepoItemDelegate(QAbstractItemModel* model, AdjustableHeaderWidget* header, QObject* parent = nullptr); ~GemRepoItemDelegate() = default; void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const override; @@ -42,15 +44,14 @@ namespace O3DE::ProjectManager inline constexpr static qreal s_fontSize = 12.0; // Margin and borders - inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/0, /*top=*/8, /*right=*/60, /*bottom=*/8); // Item border distances + inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/0, /*top=*/8, /*right=*/0, /*bottom=*/8); // Item border distances inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/20, /*top=*/20, /*right=*/20, /*bottom=*/20); // Distances of the elements within an item to the item borders inline constexpr static int s_borderWidth = 4; // Content - inline constexpr static int s_contentSpacing = 5; - inline constexpr static int s_nameMaxWidth = 145; - inline constexpr static int s_creatorMaxWidth = 115; - inline constexpr static int s_updatedMaxWidth = 125; + inline constexpr static int s_nameDefaultWidth = 150; + inline constexpr static int s_creatorDefaultWidth = 120; + inline constexpr static int s_updatedDefaultWidth = 130; // Icon inline constexpr static int s_iconSize = 24; @@ -58,6 +59,14 @@ namespace O3DE::ProjectManager inline constexpr static int s_refreshIconSize = 14; inline constexpr static int s_refreshIconSpacing = 10; + enum class HeaderOrder + { + Name, + Creator, + Update, + Delete + }; + signals: void RemoveRepo(const QModelIndex& modelIndex); void RefreshRepo(const QModelIndex& modelIndex); @@ -65,13 +74,15 @@ namespace O3DE::ProjectManager protected: void CalcRects(const QStyleOptionViewItem& option, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const; QRect GetTextRect(QFont& font, const QString& text, qreal fontSize) const; - QRect CalcButtonRect(const QRect& contentRect) const; + QPair CalcColumnXBounds(HeaderOrder header) const; QRect CalcDeleteButtonRect(const QRect& contentRect) const; QRect CalcRefreshButtonRect(const QRect& contentRect) const; void DrawEditButtons(QPainter* painter, const QRect& contentRect) const; QAbstractItemModel* m_model = nullptr; + AdjustableHeaderWidget* m_headerWidget = nullptr; + QPixmap m_refreshIcon; QPixmap m_editIcon; QPixmap m_deleteIcon; diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.cpp index 9adf3e6e3f..cf877fd73a 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.cpp @@ -8,12 +8,15 @@ #include #include +#include #include +#include namespace O3DE::ProjectManager { - GemRepoListView::GemRepoListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent) + GemRepoListView::GemRepoListView( + QAbstractItemModel* model, QItemSelectionModel* selectionModel, AdjustableHeaderWidget* header, QWidget* parent) : QListView(parent) { setObjectName("gemRepoListView"); @@ -22,9 +25,10 @@ namespace O3DE::ProjectManager setModel(model); setSelectionModel(selectionModel); - GemRepoItemDelegate* itemDelegate = new GemRepoItemDelegate(model, this); + GemRepoItemDelegate* itemDelegate = new GemRepoItemDelegate(model, header, this); connect(itemDelegate, &GemRepoItemDelegate::RemoveRepo, this, &GemRepoListView::RemoveRepo); connect(itemDelegate, &GemRepoItemDelegate::RefreshRepo, this, &GemRepoListView::RefreshRepo); + connect(header, &AdjustableHeaderWidget::sectionsResized, [=] { update(); }); setItemDelegate(itemDelegate); } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.h b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.h index 50bcf8daa6..7062997f09 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.h +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoListView.h @@ -17,13 +17,19 @@ QT_FORWARD_DECLARE_CLASS(QAbstractItemModel) namespace O3DE::ProjectManager { + QT_FORWARD_DECLARE_CLASS(AdjustableHeaderWidget) + class GemRepoListView : public QListView { - Q_OBJECT // AUTOMOC + Q_OBJECT public: - explicit GemRepoListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent = nullptr); + explicit GemRepoListView( + QAbstractItemModel* model, + QItemSelectionModel* selectionModel, + AdjustableHeaderWidget* header, + QWidget* parent = nullptr); ~GemRepoListView() = default; signals: diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoModel.h b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoModel.h index 68991a0509..d1e3975496 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoModel.h +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoModel.h @@ -21,7 +21,7 @@ namespace O3DE::ProjectManager class GemRepoModel : public QStandardItemModel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit GemRepoModel(QObject* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp index 843538d9da..996d8873c5 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include @@ -248,6 +250,9 @@ namespace O3DE::ProjectManager QFrame* GemRepoScreen::CreateReposContent() { + constexpr int inspectorWidth = 240; + constexpr int middleLayoutIndent = 60; + QFrame* contentFrame = new QFrame(this); QHBoxLayout* hLayout = new QHBoxLayout(); @@ -255,7 +260,7 @@ namespace O3DE::ProjectManager hLayout->setSpacing(0); contentFrame->setLayout(hLayout); - hLayout->addSpacing(60); + hLayout->addSpacing(middleLayoutIndent); QVBoxLayout* middleVLayout = new QVBoxLayout(); middleVLayout->setMargin(0); @@ -287,37 +292,34 @@ namespace O3DE::ProjectManager connect(addRepoButton, &QPushButton::clicked, this, &GemRepoScreen::HandleAddRepoButton); - topMiddleHLayout->addSpacing(30); - middleVLayout->addLayout(topMiddleHLayout); middleVLayout->addSpacing(30); - // Create a QTableWidget just for its header - // Using a seperate model allows the setup of a header exactly as needed - m_gemRepoHeaderTable = new QTableWidget(this); - m_gemRepoHeaderTable->setObjectName("gemRepoHeaderTable"); - m_gemRepoListHeader = m_gemRepoHeaderTable->horizontalHeader(); - m_gemRepoListHeader->setObjectName("gemRepoListHeader"); - m_gemRepoListHeader->setDefaultAlignment(Qt::AlignLeft); - m_gemRepoListHeader->setSectionResizeMode(QHeaderView::ResizeMode::Fixed); + constexpr int minHeaderSectionWidth = 120; - // Insert columns so the header labels will show up - m_gemRepoHeaderTable->insertColumn(0); - m_gemRepoHeaderTable->insertColumn(1); - m_gemRepoHeaderTable->insertColumn(2); - m_gemRepoHeaderTable->setHorizontalHeaderLabels({ tr("Repository Name"), tr("Creator"), tr("Updated") }); + m_gemRepoHeaderTable = new AdjustableHeaderWidget( + QStringList{ tr("Repository Name"), tr("Creator"), tr("Updated"), "" }, + QVector{ + GemRepoItemDelegate::s_nameDefaultWidth, + GemRepoItemDelegate::s_creatorDefaultWidth, + GemRepoItemDelegate::s_updatedDefaultWidth + GemRepoItemDelegate::s_refreshIconSpacing + GemRepoItemDelegate::s_refreshIconSize, + // Include invisible header for delete button + GemRepoItemDelegate::s_iconSize + GemRepoItemDelegate::s_contentMargins.right() + }, + minHeaderSectionWidth, + QVector + { + QHeaderView::ResizeMode::Interactive, + QHeaderView::ResizeMode::Stretch, + QHeaderView::ResizeMode::Fixed, + QHeaderView::ResizeMode::Fixed + }, + this); - const int headerExtraMargin = 18; - m_gemRepoListHeader->resizeSection(0, GemRepoItemDelegate::s_nameMaxWidth + GemRepoItemDelegate::s_contentSpacing + headerExtraMargin); - m_gemRepoListHeader->resizeSection(1, GemRepoItemDelegate::s_creatorMaxWidth + GemRepoItemDelegate::s_contentSpacing); - m_gemRepoListHeader->resizeSection(2, GemRepoItemDelegate::s_updatedMaxWidth + GemRepoItemDelegate::s_contentSpacing); - - // Required to set stylesheet in code as it will not be respected if set in qss - m_gemRepoHeaderTable->horizontalHeader()->setStyleSheet("QHeaderView::section { background-color:transparent; color:white; font-size:12px; border-style:none; }"); middleVLayout->addWidget(m_gemRepoHeaderTable); - m_gemRepoListView = new GemRepoListView(m_gemRepoModel, m_gemRepoModel->GetSelectionModel(), this); + m_gemRepoListView = new GemRepoListView(m_gemRepoModel, m_gemRepoModel->GetSelectionModel(), m_gemRepoHeaderTable, this); middleVLayout->addWidget(m_gemRepoListView); connect(m_gemRepoListView, &GemRepoListView::RemoveRepo, this, &GemRepoScreen::HandleRemoveRepoButton); @@ -325,8 +327,10 @@ namespace O3DE::ProjectManager hLayout->addLayout(middleVLayout); + hLayout->addSpacing(middleLayoutIndent); + m_gemRepoInspector = new GemRepoInspector(m_gemRepoModel, this); - m_gemRepoInspector->setFixedWidth(240); + m_gemRepoInspector->setFixedWidth(inspectorWidth); hLayout->addWidget(m_gemRepoInspector); return contentFrame; diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.h b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.h index eed9a5ec4a..643a9b91fc 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.h +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.h @@ -24,6 +24,7 @@ namespace O3DE::ProjectManager QT_FORWARD_DECLARE_CLASS(GemRepoInspector) QT_FORWARD_DECLARE_CLASS(GemRepoListView) QT_FORWARD_DECLARE_CLASS(GemRepoModel) + QT_FORWARD_DECLARE_CLASS(AdjustableHeaderWidget) class GemRepoScreen : public ScreenWidget @@ -59,7 +60,7 @@ namespace O3DE::ProjectManager QFrame* m_noRepoContent; QFrame* m_repoContent; - QTableWidget* m_gemRepoHeaderTable = nullptr; + AdjustableHeaderWidget* m_gemRepoHeaderTable = nullptr; QHeaderView* m_gemRepoListHeader = nullptr; GemRepoListView* m_gemRepoListView = nullptr; GemRepoInspector* m_gemRepoInspector = nullptr; diff --git a/Code/Tools/ProjectManager/Source/GemsSubWidget.h b/Code/Tools/ProjectManager/Source/GemsSubWidget.h index 5e670b930a..130e6c4282 100644 --- a/Code/Tools/ProjectManager/Source/GemsSubWidget.h +++ b/Code/Tools/ProjectManager/Source/GemsSubWidget.h @@ -22,7 +22,7 @@ namespace O3DE::ProjectManager class GemsSubWidget : public QWidget { - Q_OBJECT // AUTOMOC + Q_OBJECT public: GemsSubWidget(QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/LinkWidget.h b/Code/Tools/ProjectManager/Source/LinkWidget.h index eb0b9bb528..ab95c2ecdf 100644 --- a/Code/Tools/ProjectManager/Source/LinkWidget.h +++ b/Code/Tools/ProjectManager/Source/LinkWidget.h @@ -22,7 +22,7 @@ namespace O3DE::ProjectManager class LinkLabel : public QLabel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: LinkLabel(const QString& text = {}, const QUrl& url = {}, int fontSize = 10, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h index 358c1f249a..c526f7864d 100644 --- a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h @@ -31,7 +31,7 @@ namespace O3DE::ProjectManager class LabelButton : public QLabel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit LabelButton(QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h index d784fcf5fd..f184fd2e17 100644 --- a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h +++ b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h @@ -11,6 +11,7 @@ namespace O3DE::ProjectManager { + inline constexpr static int MinWindowWidth = 1200; inline constexpr static int ProjectPreviewImageWidth = 210; inline constexpr static int ProjectPreviewImageHeight = 280; inline constexpr static int ProjectTemplateImageWidth = 92; diff --git a/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h b/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h index aca0d21fd3..5c000bf61d 100644 --- a/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h +++ b/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h @@ -20,7 +20,7 @@ namespace O3DE::ProjectManager class ScreenHeader : public QFrame { - Q_OBJECT // AUTOMOC + Q_OBJECT public: ScreenHeader(QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/TagWidget.h b/Code/Tools/ProjectManager/Source/TagWidget.h index fce6eaf863..df817dc506 100644 --- a/Code/Tools/ProjectManager/Source/TagWidget.h +++ b/Code/Tools/ProjectManager/Source/TagWidget.h @@ -27,7 +27,7 @@ namespace O3DE::ProjectManager class TagWidget : public QLabel { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit TagWidget(const Tag& id, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h b/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h index 6216f0e3de..507219d2f2 100644 --- a/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h +++ b/Code/Tools/ProjectManager/Source/TemplateButtonWidget.h @@ -17,7 +17,7 @@ namespace O3DE::ProjectManager class TemplateButton : public QPushButton { - Q_OBJECT // AUTOMOC + Q_OBJECT public: explicit TemplateButton(const QString& imagePath, const QString& labelText, QWidget* parent = nullptr); diff --git a/Code/Tools/ProjectManager/project_manager_files.cmake b/Code/Tools/ProjectManager/project_manager_files.cmake index 915b1a072f..87dfae85e8 100644 --- a/Code/Tools/ProjectManager/project_manager_files.cmake +++ b/Code/Tools/ProjectManager/project_manager_files.cmake @@ -81,6 +81,8 @@ set(FILES Source/TemplateButtonWidget.cpp Source/ExternalLinkDialog.h Source/ExternalLinkDialog.cpp + Source/AdjustableHeaderWidget.h + Source/AdjustableHeaderWidget.cpp Source/GemCatalog/GemCatalogHeaderWidget.h Source/GemCatalog/GemCatalogHeaderWidget.cpp Source/GemCatalog/GemCatalogScreen.h diff --git a/scripts/build/Platform/Android/gradle_windows.cmd b/scripts/build/Platform/Android/gradle_windows.cmd index bb98799444..f2d423282f 100644 --- a/scripts/build/Platform/Android/gradle_windows.cmd +++ b/scripts/build/Platform/Android/gradle_windows.cmd @@ -31,11 +31,19 @@ IF NOT EXIST %OUTPUT_DIRECTORY% ( mkdir %OUTPUT_DIRECTORY% ) -REM Jenkins reports MSB8029 when TMP/TEMP is not defined, define a dummy folder -SET TMP=%cd%/temp -SET TEMP=%cd%/temp -IF NOT EXIST %TMP% ( - mkdir %TMP% +REM Jenkins does not defined TMP +IF "%TMP%"=="" ( + IF "%WORKSPACE%"=="" ( + SET TMP=%APPDATA%\Local\Temp + SET TEMP=%APPDATA%\Local\Temp + ) ELSE ( + SET TMP=%WORKSPACE%\Temp + SET TEMP=%WORKSPACE%\Temp + REM This folder may not be created in the workspace + IF NOT EXIST "!TMP!" ( + MKDIR "!TMP!" + ) + ) ) REM Optionally sign the APK if we are generating an APK From 117cb11505e008f841be1672c5dc72f7e8e31d23 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Fri, 28 Jan 2022 15:43:51 -0600 Subject: [PATCH 336/394] {ghi7197} ignore prefab groups with empty JSON DOMS (#7242) * {ghi7197} ignore prefab groups with empty JSON DOMS ignore prefab groups with empty JSON DOMS if the default procedural prefab is being skipped Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * a cleaner solution is to check if the Editor is attempting to construct, then ignore making a default procedural prefab group Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../PrefabGroup/PrefabGroupBehavior.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp index 6bd8f0d049..af21e7297c 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp @@ -166,7 +166,7 @@ namespace AZ::SceneAPI::Behaviors meshNodeFullName.append(meshNodeName.GetName()); auto meshGroup = AZStd::make_shared(); - meshGroup->SetName(meshNodeFullName.c_str()); + meshGroup->SetName(meshNodeFullName); meshGroup->GetSceneNodeSelectionList().AddSelectedNode(AZStd::move(meshNodePath)); for (const auto& meshGoupNamePair : meshTransformMap) { @@ -374,10 +374,18 @@ namespace AZ::SceneAPI::Behaviors Events::ProcessingResult PrefabGroupBehavior::ExportEventHandler::UpdateManifest( Containers::Scene& scene, ManifestAction action, - [[maybe_unused]] RequestingApplication requester) + RequestingApplication requester) { - if (action != Events::AssetImportRequest::ConstructDefault) + if (action == Events::AssetImportRequest::Update) { + // ignore constructing a default procedural prefab if some tool or script is attempting + // to update the scene manifest + return Events::ProcessingResult::Ignored; + } + else if (action == Events::AssetImportRequest::ConstructDefault && requester == RequestingApplication::Editor) + { + // ignore constructing a default procedurla prefab if the Editor's "Edit Settings..." is being used + // the user is trying to assign the source scene asset their own mesh groups return Events::ProcessingResult::Ignored; } From 1c6fbdab2ab1173dbc500b961471a070aa9a69d6 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 28 Jan 2022 15:44:25 -0600 Subject: [PATCH 337/394] Removed legacy/unused IEventLoopHook Signed-off-by: Chris Galvan --- Code/Editor/Core/QtEditorApplication.h | 1 - Code/Editor/CryEdit.cpp | 28 -------------------------- Code/Editor/CryEdit.h | 4 ---- Code/Editor/IEditor.h | 6 ------ Code/Editor/IEditorImpl.cpp | 10 --------- Code/Editor/IEditorImpl.h | 2 -- Code/Editor/Include/IEventLoopHook.h | 24 ---------------------- Code/Editor/Lib/Tests/IEditorMock.h | 2 -- Code/Editor/editor_lib_files.cmake | 1 - 9 files changed, 78 deletions(-) delete mode 100644 Code/Editor/Include/IEventLoopHook.h diff --git a/Code/Editor/Core/QtEditorApplication.h b/Code/Editor/Core/QtEditorApplication.h index 0d702bf647..28ee8ac14b 100644 --- a/Code/Editor/Core/QtEditorApplication.h +++ b/Code/Editor/Core/QtEditorApplication.h @@ -13,7 +13,6 @@ #include #include #include -#include "IEventLoopHook.h" #include #include diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 982f8ba411..480a973282 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -1828,34 +1828,6 @@ bool CCryEditApp::InitInstance() return true; } -void CCryEditApp::RegisterEventLoopHook(IEventLoopHook* pHook) -{ - pHook->pNextHook = m_pEventLoopHook; - m_pEventLoopHook = pHook; -} - -void CCryEditApp::UnregisterEventLoopHook(IEventLoopHook* pHookToRemove) -{ - IEventLoopHook* pPrevious = nullptr; - for (IEventLoopHook* pHook = m_pEventLoopHook; pHook != nullptr; pHook = pHook->pNextHook) - { - if (pHook == pHookToRemove) - { - if (pPrevious) - { - pPrevious->pNextHook = pHookToRemove->pNextHook; - } - else - { - m_pEventLoopHook = pHookToRemove->pNextHook; - } - - pHookToRemove->pNextHook = nullptr; - return; - } - } -} - ////////////////////////////////////////////////////////////////////////// void CCryEditApp::LoadFile(QString fileName) { diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h index 48f362003c..f472639dcd 100644 --- a/Code/Editor/CryEdit.h +++ b/Code/Editor/CryEdit.h @@ -30,7 +30,6 @@ class CConsoleDialog; struct mg_connection; struct mg_request_info; struct mg_context; -struct IEventLoopHook; class QAction; class MainWindow; class QSharedMemory; @@ -153,8 +152,6 @@ public: int IdleProcessing(bool bBackground); bool IsWindowInForeground(); void RunInitPythonScript(CEditCommandLineInfo& cmdInfo); - void RegisterEventLoopHook(IEventLoopHook* pHook); - void UnregisterEventLoopHook(IEventLoopHook* pHook); void DisableIdleProcessing() override; void EnableIdleProcessing() override; @@ -344,7 +341,6 @@ private: QString m_lastOpenLevelPath; CQuickAccessBar* m_pQuickAccessBar = nullptr; - IEventLoopHook* m_pEventLoopHook = nullptr; QString m_rootEnginePath; int m_disableIdleProcessingCounter = 0; //!< Counts requests to disable idle processing. When non-zero, idle processing will be disabled. diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index da29b00f2d..0de08445b4 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -66,7 +66,6 @@ class IAWSResourceManager; struct ISystem; struct IRenderer; struct AABB; -struct IEventLoopHook; struct IErrorReport; // Vladimir@conffx struct IFileUtil; // Vladimir@conffx struct IEditorLog; // Vladimir@conffx @@ -509,11 +508,6 @@ struct IEditor virtual void SetActiveView(CViewport* viewport) = 0; virtual struct IEditorFileMonitor* GetFileMonitor() = 0; - // These are needed for Qt integration: - virtual void RegisterEventLoopHook(IEventLoopHook* pHook) = 0; - virtual void UnregisterEventLoopHook(IEventLoopHook* pHook) = 0; - // ^^^ - //! QMimeData is used by the Qt clipboard. //! IMPORTANT: Any QMimeData allocated for the clipboard will be deleted //! when the editor exists. If a QMimeData is allocated by a different diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 05b74f3b05..b6a4209948 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -789,16 +789,6 @@ IEditorFileMonitor* CEditorImpl::GetFileMonitor() return m_pEditorFileMonitor.get(); } -void CEditorImpl::RegisterEventLoopHook(IEventLoopHook* pHook) -{ - CCryEditApp::instance()->RegisterEventLoopHook(pHook); -} - -void CEditorImpl::UnregisterEventLoopHook(IEventLoopHook* pHook) -{ - CCryEditApp::instance()->UnregisterEventLoopHook(pHook); -} - float CEditorImpl::GetTerrainElevation(float x, float y) { float terrainElevation = AzFramework::Terrain::TerrainDataRequests::GetDefaultTerrainHeight(); diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 5e47a76802..73fcec917d 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -155,8 +155,6 @@ public: CMusicManager* GetMusicManager() override { return m_pMusicManager; }; IEditorFileMonitor* GetFileMonitor() override; - void RegisterEventLoopHook(IEventLoopHook* pHook) override; - void UnregisterEventLoopHook(IEventLoopHook* pHook) override; IIconManager* GetIconManager() override; float GetTerrainElevation(float x, float y) override; Editor::EditorQtApplication* GetEditorQtApplication() override { return m_QtApplication; } diff --git a/Code/Editor/Include/IEventLoopHook.h b/Code/Editor/Include/IEventLoopHook.h deleted file mode 100644 index eaf7bf2d62..0000000000 --- a/Code/Editor/Include/IEventLoopHook.h +++ /dev/null @@ -1,24 +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 - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IEVENTLOOPHOOK_H -#define CRYINCLUDE_EDITOR_INCLUDE_IEVENTLOOPHOOK_H -#pragma once - -struct IEventLoopHook -{ - IEventLoopHook* pNextHook; - - IEventLoopHook() - : pNextHook(0) {} - - virtual bool PrePumpMessage() { return false; } -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IEVENTLOOPHOOK_H diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index 99c05c7f4d..780362cb30 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -97,8 +97,6 @@ public: MOCK_METHOD0(GetActiveView, class CViewport* ()); MOCK_METHOD1(SetActiveView, void(CViewport*)); MOCK_METHOD0(GetFileMonitor, struct IEditorFileMonitor* ()); - MOCK_METHOD1(RegisterEventLoopHook, void(IEventLoopHook* )); - MOCK_METHOD1(UnregisterEventLoopHook, void(IEventLoopHook* )); MOCK_CONST_METHOD0(CreateQMimeData, QMimeData* ()); MOCK_CONST_METHOD1(DestroyQMimeData, void(QMimeData*)); MOCK_METHOD0(GetLevelIndependentFileMan, class CLevelIndependentFileMan* ()); diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 75962fe3b3..7908d1e720 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -270,7 +270,6 @@ set(FILES Include/ICommandManager.h Include/IDisplayViewport.h Include/IEditorClassFactory.h - Include/IEventLoopHook.h Include/IExportManager.h Include/IGizmoManager.h Include/IIconManager.h From 991f97a6662ff5870f8342847654497f07144eff Mon Sep 17 00:00:00 2001 From: brianherrera Date: Fri, 28 Jan 2022 13:38:38 -0800 Subject: [PATCH 338/394] Add overall timeout for the AR pipeline Signed-off-by: brianherrera --- scripts/build/Jenkins/Jenkinsfile | 231 +++++++++++++++--------------- 1 file changed, 118 insertions(+), 113 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index b21d9d832d..3bef8601bc 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -12,6 +12,9 @@ INCREMENTAL_BUILD_SCRIPT_PATH = 'scripts/build/bootstrap/incremental_build_util. EBS_SNAPSHOT_SCRIPT_PATH = 'scripts/build/tools/ebs_snapshot.py' PIPELINE_RETRY_ATTEMPTS = 3 +// Number of minutes of inactivity in all stages of the pipeline to reach the timeout +PIPELINE_TIMEOUT = 60 + EMPTY_JSON = readJSON text: '{}' ENGINE_REPOSITORY_NAME = 'o3de' @@ -753,143 +756,145 @@ def pipelineConfig = {} // Start Pipeline try { - stage('Setup Pipeline') { - node('controller') { - def envVarList = [] - if(isUnix()) { - envVarList.add('IS_UNIX=1') - } - withEnv(envVarList) { - timestamps { - repositoryUrl = scm.getUserRemoteConfigs()[0].getUrl() - // repositoryName is the full repository name - repositoryName = (repositoryUrl =~ /https:\/\/github.com\/(.*)\.git/)[0][1] - env.REPOSITORY_NAME = repositoryName - (projectName, pipelineName) = GetRunningPipelineName(env.JOB_NAME) // env.JOB_NAME is the name of the job given by Jenkins - env.PIPELINE_NAME = pipelineName - if(env.BRANCH_NAME) { - branchName = env.BRANCH_NAME - } else { - branchName = scm.branches[0].name // for non-multibranch pipelines - env.BRANCH_NAME = branchName // so scripts that read this environment have it (e.g. incremental_build_util.py) - } - if(env.CHANGE_TARGET) { - // PR builds - if(BUILD_SNAPSHOTS.contains(env.CHANGE_TARGET)) { - snapshot = env.CHANGE_TARGET - echo "Snapshot for destination branch \"${env.CHANGE_TARGET}\" found." - } else { - snapshot = DEFAULT_BUILD_SNAPSHOT - echo "Snapshot for destination branch \"${env.CHANGE_TARGET}\" does not exist, defaulting to snapshot \"${snapshot}\"" + timeout(time: PIPELINE_TIMEOUT, unit: 'MINUTES', activity: true) { + stage('Setup Pipeline') { + node('controller') { + def envVarList = [] + if(isUnix()) { + envVarList.add('IS_UNIX=1') + } + withEnv(envVarList) { + timestamps { + repositoryUrl = scm.getUserRemoteConfigs()[0].getUrl() + // repositoryName is the full repository name + repositoryName = (repositoryUrl =~ /https:\/\/github.com\/(.*)\.git/)[0][1] + env.REPOSITORY_NAME = repositoryName + (projectName, pipelineName) = GetRunningPipelineName(env.JOB_NAME) // env.JOB_NAME is the name of the job given by Jenkins + env.PIPELINE_NAME = pipelineName + if(env.BRANCH_NAME) { + branchName = env.BRANCH_NAME + } else { + branchName = scm.branches[0].name // for non-multibranch pipelines + env.BRANCH_NAME = branchName // so scripts that read this environment have it (e.g. incremental_build_util.py) } - } else { - // Non-PR builds - pipelineParameters.add(choice(defaultValue: DEFAULT_BUILD_SNAPSHOT, name: 'SNAPSHOT', choices: BUILD_SNAPSHOTS_WITH_EMPTY, description: 'Selects the build snapshot to use. A more diverted snapshot will cause longer build times, but will not cause build failures.')) - snapshot = env.SNAPSHOT - echo "Snapshot \"${snapshot}\" selected." - } - pipelineProperties.add(disableConcurrentBuilds()) + if(env.CHANGE_TARGET) { + // PR builds + if(BUILD_SNAPSHOTS.contains(env.CHANGE_TARGET)) { + snapshot = env.CHANGE_TARGET + echo "Snapshot for destination branch \"${env.CHANGE_TARGET}\" found." + } else { + snapshot = DEFAULT_BUILD_SNAPSHOT + echo "Snapshot for destination branch \"${env.CHANGE_TARGET}\" does not exist, defaulting to snapshot \"${snapshot}\"" + } + } else { + // Non-PR builds + pipelineParameters.add(choice(defaultValue: DEFAULT_BUILD_SNAPSHOT, name: 'SNAPSHOT', choices: BUILD_SNAPSHOTS_WITH_EMPTY, description: 'Selects the build snapshot to use. A more diverted snapshot will cause longer build times, but will not cause build failures.')) + snapshot = env.SNAPSHOT + echo "Snapshot \"${snapshot}\" selected." + } + pipelineProperties.add(disableConcurrentBuilds()) - echo "Running repository: \"${repositoryName}\", pipeline: \"${pipelineName}\", branch: \"${branchName}\", CHANGE_ID: \"${env.CHANGE_ID}\", GIT_COMMMIT: \"${scm.GIT_COMMIT}\"..." + echo "Running repository: \"${repositoryName}\", pipeline: \"${pipelineName}\", branch: \"${branchName}\", CHANGE_ID: \"${env.CHANGE_ID}\", GIT_COMMMIT: \"${scm.GIT_COMMIT}\"..." - CheckoutBootstrapScripts(branchName) + CheckoutBootstrapScripts(branchName) - // Load configs - pipelineConfig = LoadPipelineConfig(pipelineName, branchName) + // Load configs + pipelineConfig = LoadPipelineConfig(pipelineName, branchName) - // Add each platform as a parameter that the user can disable if needed - if (!IsPullRequest(branchName)) { - pipelineParameters.add(stringParam(defaultValue: '', description: 'Filters and overrides the list of jobs to run for each of the below platforms (comma-separated). Can\'t be used during a pull request.', name: 'JOB_LIST_OVERRIDE')) + // Add each platform as a parameter that the user can disable if needed + if (!IsPullRequest(branchName)) { + pipelineParameters.add(stringParam(defaultValue: '', description: 'Filters and overrides the list of jobs to run for each of the below platforms (comma-separated). Can\'t be used during a pull request.', name: 'JOB_LIST_OVERRIDE')) + pipelineConfig.platforms.each { platform -> + pipelineParameters.add(booleanParam(defaultValue: true, description: '', name: platform.key)) + } + } + // Add additional Jenkins parameters pipelineConfig.platforms.each { platform -> - pipelineParameters.add(booleanParam(defaultValue: true, description: '', name: platform.key)) - } - } - // Add additional Jenkins parameters - pipelineConfig.platforms.each { platform -> - platformEnv = platform.value.PIPELINE_ENV - pipelineJenkinsParameters = platformEnv['PIPELINE_JENKINS_PARAMETERS'] ?: [:] - jenkinsParametersToAdd = pipelineJenkinsParameters[pipelineName] ?: [:] - jenkinsParametersToAdd.each{ jenkinsParameter -> - defaultValue = jenkinsParameter['default_value'] - // Use last run's value as default value so we can save values in different Jenkins environment - if (jenkinsParameter['use_last_run_value']?.toBoolean()) { - defaultValue = params."${jenkinsParameter['parameter_name']}" ?: jenkinsParameter['default_value'] - } - switch (jenkinsParameter['parameter_type']) { - case 'string': - pipelineParameters.add(stringParam(defaultValue: defaultValue, - description: jenkinsParameter['description'], - name: jenkinsParameter['parameter_name'] - )) - break - case 'boolean': - pipelineParameters.add(booleanParam(defaultValue: defaultValue, - description: jenkinsParameter['description'], - name: jenkinsParameter['parameter_name'] - )) - break - case 'password': - pipelineParameters.add(password(defaultValue: defaultValue, - description: jenkinsParameter['description'], - name: jenkinsParameter['parameter_name'] - )) - break + platformEnv = platform.value.PIPELINE_ENV + pipelineJenkinsParameters = platformEnv['PIPELINE_JENKINS_PARAMETERS'] ?: [:] + jenkinsParametersToAdd = pipelineJenkinsParameters[pipelineName] ?: [:] + jenkinsParametersToAdd.each{ jenkinsParameter -> + defaultValue = jenkinsParameter['default_value'] + // Use last run's value as default value so we can save values in different Jenkins environment + if (jenkinsParameter['use_last_run_value']?.toBoolean()) { + defaultValue = params."${jenkinsParameter['parameter_name']}" ?: jenkinsParameter['default_value'] + } + switch (jenkinsParameter['parameter_type']) { + case 'string': + pipelineParameters.add(stringParam(defaultValue: defaultValue, + description: jenkinsParameter['description'], + name: jenkinsParameter['parameter_name'] + )) + break + case 'boolean': + pipelineParameters.add(booleanParam(defaultValue: defaultValue, + description: jenkinsParameter['description'], + name: jenkinsParameter['parameter_name'] + )) + break + case 'password': + pipelineParameters.add(password(defaultValue: defaultValue, + description: jenkinsParameter['description'], + name: jenkinsParameter['parameter_name'] + )) + break + } } } - } - pipelineProperties.add(parameters(pipelineParameters.unique())) - properties(pipelineProperties) + pipelineProperties.add(parameters(pipelineParameters.unique())) + properties(pipelineProperties) - // Stash the INCREMENTAL_BUILD_SCRIPT_PATH and EBS_SNAPSHOT_SCRIPT_PATH since all nodes will use it - stash name: 'incremental_build_script', - includes: INCREMENTAL_BUILD_SCRIPT_PATH - if (fileExists(EBS_SNAPSHOT_SCRIPT_PATH)) { - stash name: 'ebs_snapshot_script', - includes: EBS_SNAPSHOT_SCRIPT_PATH + // Stash the INCREMENTAL_BUILD_SCRIPT_PATH and EBS_SNAPSHOT_SCRIPT_PATH since all nodes will use it + stash name: 'incremental_build_script', + includes: INCREMENTAL_BUILD_SCRIPT_PATH + if (fileExists(EBS_SNAPSHOT_SCRIPT_PATH)) { + stash name: 'ebs_snapshot_script', + includes: EBS_SNAPSHOT_SCRIPT_PATH + } } - } + } } } - } - if(env.BUILD_NUMBER == '1' && !IsPullRequest(branchName)) { - // Exit pipeline early on the intial build. This allows Jenkins to load the pipeline for the branch and enables users - // to select build parameters on their first actual build. See https://issues.jenkins.io/browse/JENKINS-41929 - currentBuild.result = 'SUCCESS' - return - } + if(env.BUILD_NUMBER == '1' && !IsPullRequest(branchName)) { + // Exit pipeline early on the intial build. This allows Jenkins to load the pipeline for the branch and enables users + // to select build parameters on their first actual build. See https://issues.jenkins.io/browse/JENKINS-41929 + currentBuild.result = 'SUCCESS' + return + } - def someBuildHappened = false + def someBuildHappened = false - // Build and Post-Build Testing Stage - def buildConfigs = [:] + // Build and Post-Build Testing Stage + def buildConfigs = [:] - // Platform Builds run on EC2 - pipelineConfig.platforms.each { platform -> - platform.value.build_types.each { build_job -> - if (IsJobEnabled(branchName, build_job, pipelineName, platform.key)) { // User can filter jobs, jobs are tagged by pipeline - def envVars = GetBuildEnvVars(platform.value.PIPELINE_ENV ?: EMPTY_JSON, build_job.value.PIPELINE_ENV ?: EMPTY_JSON, pipelineName) - envVars['JENKINS_JOB_NAME'] = env.JOB_NAME // Save original Jenkins job name to JENKINS_JOB_NAME - envVars['JOB_NAME'] = "${branchName}_${platform.key}_${build_job.key}" // backwards compatibility, some scripts rely on this - someBuildHappened = true + // Platform Builds run on EC2 + pipelineConfig.platforms.each { platform -> + platform.value.build_types.each { build_job -> + if (IsJobEnabled(branchName, build_job, pipelineName, platform.key)) { // User can filter jobs, jobs are tagged by pipeline + def envVars = GetBuildEnvVars(platform.value.PIPELINE_ENV ?: EMPTY_JSON, build_job.value.PIPELINE_ENV ?: EMPTY_JSON, pipelineName) + envVars['JENKINS_JOB_NAME'] = env.JOB_NAME // Save original Jenkins job name to JENKINS_JOB_NAME + envVars['JOB_NAME'] = "${branchName}_${platform.key}_${build_job.key}" // backwards compatibility, some scripts rely on this + someBuildHappened = true - buildConfigs["${platform.key} [${build_job.key}]"] = CreateBuildJobs(pipelineConfig, platform, build_job, envVars, branchName, pipelineName, repositoryName, projectName) + buildConfigs["${platform.key} [${build_job.key}]"] = CreateBuildJobs(pipelineConfig, platform, build_job, envVars, branchName, pipelineName, repositoryName, projectName) + } } } - } - timestamps { + timestamps { - stage('Build') { - parallel buildConfigs // Run parallel builds + stage('Build') { + parallel buildConfigs // Run parallel builds + } + + echo 'All builds successful' + } + if (!someBuildHappened) { + currentBuild.result = 'NOT_BUILT' } - - echo 'All builds successful' - } - if (!someBuildHappened) { - currentBuild.result = 'NOT_BUILT' } } catch(Exception e) { From 5f7a30f8dafac41bc02af4d315661be183e86132 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Sat, 29 Jan 2022 19:37:46 -0700 Subject: [PATCH 339/394] Added DiffuseProbeGrid Visualization passes, shaders, and editor controls. Changed the DiffuseGI passes to override IsEnabled() instead of exiting early from FrameBeginInternal. Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../Assets/Models/DiffuseProbeSphere.fbx | 3 + .../Passes/DiffuseGlobalIllumination.pass | 37 ++- ...ridVisualizationAccelerationStructure.pass | 13 + ...iffuseProbeGridVisualizationComposite.pass | 40 +++ .../DiffuseProbeGridVisualizationPrepare.pass | 13 + ...ffuseProbeGridVisualizationRayTracing.pass | 54 ++++ .../Common/Assets/Passes/MainPipeline.pass | 31 +- .../Common/Assets/Passes/OpaqueParent.pass | 11 + .../Assets/Passes/PassTemplates.azasset | 16 + ...iffuseProbeGridVisualizationComposite.azsl | 67 ++++ ...fuseProbeGridVisualizationComposite.shader | 42 +++ ...GridVisualizationPrepare.precompiledshader | 34 ++ ...dVisualizationRayTracing.precompiledshader | 34 ++ ...tionRayTracingClosestHit.precompiledshader | 35 ++ ...ualizationRayTracingMiss.precompiledshader | 35 ++ .../diffuseprobegridrelocation.azshader | Bin 79904 -> 79904 bytes ...probegridrelocation_dx12_0.azshadervariant | Bin 7994 -> 7974 bytes ...probegridrelocation_null_0.azshadervariant | Bin 486 -> 486 bytes ...obegridrelocation_vulkan_0.azshadervariant | Bin 11362 -> 11306 bytes ...fuseprobegridvisualizationprepare.azshader | Bin 0 -> 78689 bytes ...isualizationprepare_dx12_0.azshadervariant | Bin 0 -> 7346 bytes ...isualizationprepare_null_0.azshadervariant | Bin 0 -> 486 bytes ...ualizationprepare_vulkan_0.azshadervariant | Bin 0 -> 6554 bytes ...eprobegridvisualizationraytracing.azshader | Bin 0 -> 205596 bytes ...alizationraytracing_dx12_0.azshadervariant | Bin 0 -> 18458 bytes ...alizationraytracing_null_0.azshadervariant | Bin 0 -> 486 bytes ...izationraytracing_vulkan_0.azshadervariant | Bin 0 -> 12596 bytes ...visualizationraytracingclosesthit.azshader | Bin 0 -> 205606 bytes ...aytracingclosesthit_dx12_0.azshadervariant | Bin 0 -> 11774 bytes ...aytracingclosesthit_null_0.azshadervariant | Bin 0 -> 486 bytes ...tracingclosesthit_vulkan_0.azshadervariant | Bin 0 -> 1372 bytes ...begridvisualizationraytracingmiss.azshader | Bin 0 -> 205600 bytes ...ationraytracingmiss_dx12_0.azshadervariant | Bin 0 -> 10726 bytes ...ationraytracingmiss_null_0.azshadervariant | Bin 0 -> 486 bytes ...ionraytracingmiss_vulkan_0.azshadervariant | Bin 0 -> 1108 bytes ...iffuseProbeGridFeatureProcessorInterface.h | 3 + .../Code/Source/CommonSystemComponent.cpp | 8 + .../DiffuseProbeGrid.cpp | 97 +++++- .../DiffuseProbeGrid.h | 44 ++- .../DiffuseProbeGridBlendDistancePass.cpp | 31 +- .../DiffuseProbeGridBlendDistancePass.h | 3 +- .../DiffuseProbeGridBlendIrradiancePass.cpp | 31 +- .../DiffuseProbeGridBlendIrradiancePass.h | 3 +- .../DiffuseProbeGridBorderUpdatePass.cpp | 31 +- .../DiffuseProbeGridBorderUpdatePass.h | 3 +- .../DiffuseProbeGridClassificationPass.cpp | 39 +-- .../DiffuseProbeGridClassificationPass.h | 3 +- .../DiffuseProbeGridFeatureProcessor.cpp | 150 ++++++++- .../DiffuseProbeGridFeatureProcessor.h | 32 +- .../DiffuseProbeGridRayTracingPass.cpp | 77 ++++- .../DiffuseProbeGridRayTracingPass.h | 1 + .../DiffuseProbeGridRelocationPass.cpp | 105 +++--- .../DiffuseProbeGridRelocationPass.h | 3 +- .../DiffuseProbeGridRenderPass.cpp | 29 +- .../DiffuseProbeGridRenderPass.h | 3 +- ...VisualizationAccelerationStructurePass.cpp | 192 +++++++++++ ...idVisualizationAccelerationStructurePass.h | 53 ++++ ...useProbeGridVisualizationCompositePass.cpp | 62 ++++ ...ffuseProbeGridVisualizationCompositePass.h | 39 +++ ...ffuseProbeGridVisualizationPreparePass.cpp | 270 ++++++++++++++++ ...DiffuseProbeGridVisualizationPreparePass.h | 52 +++ ...seProbeGridVisualizationRayTracingPass.cpp | 300 ++++++++++++++++++ ...fuseProbeGridVisualizationRayTracingPass.h | 67 ++++ .../RayTracing/RayTracingFeatureProcessor.h | 2 + .../Code/atom_feature_common_files.cmake | 8 + .../RHI/RayTracingAccelerationStructure.h | 1 + .../Include/Atom/RHI/RayTracingBufferPools.h | 2 +- .../Code/Source/RHI/RayTracingBufferPools.cpp | 2 +- .../DX12/Code/Source/RHI/RayTracingTlas.cpp | 2 +- .../RHI/DX12/Code/Source/RHI/RayTracingTlas.h | 3 +- .../RHI/Null/Code/Source/RHI/RayTracingTlas.h | 3 +- .../Vulkan/Code/Source/RHI/CommandList.cpp | 20 ++ .../Code/Source/RHI/RayTracingBufferPools.h | 4 +- .../Vulkan/Code/Source/RHI/RayTracingTlas.cpp | 2 +- .../Vulkan/Code/Source/RHI/RayTracingTlas.h | 3 +- .../DiffuseProbeGridComponentConstants.h | 1 + .../DiffuseProbeGridComponentController.cpp | 41 ++- .../DiffuseProbeGridComponentController.h | 7 + .../EditorDiffuseProbeGridComponent.cpp | 37 ++- .../EditorDiffuseProbeGridComponent.h | 6 + 80 files changed, 2185 insertions(+), 155 deletions(-) create mode 100644 Gems/Atom/Feature/Common/Assets/Models/DiffuseProbeSphere.fbx create mode 100644 Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationAccelerationStructure.pass create mode 100644 Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationComposite.pass create mode 100644 Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationPrepare.pass create mode 100644 Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationRayTracing.pass create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.shader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPrepare.precompiledshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracing.precompiledshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingClosestHit.precompiledshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingMiss.precompiledshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare.azshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing.azshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit.azshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss.azshader create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.h create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.h create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.h create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.h diff --git a/Gems/Atom/Feature/Common/Assets/Models/DiffuseProbeSphere.fbx b/Gems/Atom/Feature/Common/Assets/Models/DiffuseProbeSphere.fbx new file mode 100644 index 0000000000..0fdf350c1f --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Models/DiffuseProbeSphere.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a2bfdeeabfbbf6397daab7c89f9f7321e4863b54a4669fa87e457cb113322c +size 78256 diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass index 45278cd511..a70f4446a4 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass @@ -42,6 +42,22 @@ }, "LoadAction": "Clear" } + }, + { + "Name": "VisualizationOutput", + "SlotType": "Output", + "ScopeAttachmentUsage": "RenderTarget", + "LoadStoreAction": { + "ClearValue": { + "Value": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "LoadAction": "Clear" + } } ], "ImageAttachments": [ @@ -73,7 +89,14 @@ "AttachmentRef": { "Pass": "This", "Attachment": "IrradianceImage" - } + } + }, + { + "LocalSlot": "VisualizationOutput", + "AttachmentRef": { + "Pass": "DiffuseProbeGridVisualizationRayTracingPass", + "Attachment": "Output" + } } ], "PassRequests": [ @@ -193,6 +216,18 @@ } } ] + }, + { + "Name": "DiffuseProbeGridVisualizationPreparePass", + "TemplateName": "DiffuseProbeGridVisualizationPreparePassTemplate" + }, + { + "Name": "DiffuseProbeGridVisualizationAccelerationStructurePass", + "TemplateName": "DiffuseProbeGridVisualizationAccelerationStructurePassTemplate" + }, + { + "Name": "DiffuseProbeGridVisualizationRayTracingPass", + "TemplateName": "DiffuseProbeGridVisualizationRayTracingPassTemplate" } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationAccelerationStructure.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationAccelerationStructure.pass new file mode 100644 index 0000000000..78d4c82dcf --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationAccelerationStructure.pass @@ -0,0 +1,13 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": + { + "PassTemplate": + { + "Name": "DiffuseProbeGridVisualizationAccelerationStructurePassTemplate", + "PassClass": "DiffuseProbeGridVisualizationAccelerationStructurePass" + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationComposite.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationComposite.pass new file mode 100644 index 0000000000..9f19fde4af --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationComposite.pass @@ -0,0 +1,40 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "DiffuseProbeGridVisualizationCompositePassTemplate", + "PassClass": "DiffuseProbeGridVisualizationCompositePass", + "Slots": [ + { + "Name": "VisualizationInput", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader" + }, + { + "Name": "Depth", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader", + "ImageViewDesc": { + "AspectFlags": [ + "Depth" + ] + } + }, + { + "Name": "ColorInputOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "RenderTarget" + } + ], + "PassData": { + "$type": "FullscreenTrianglePassData", + "ShaderAsset": { + "FilePath": "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.shader" + }, + "PipelineViewTag": "MainCamera" + } + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationPrepare.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationPrepare.pass new file mode 100644 index 0000000000..aa95128a2e --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationPrepare.pass @@ -0,0 +1,13 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": + { + "PassTemplate": + { + "Name": "DiffuseProbeGridVisualizationPreparePassTemplate", + "PassClass": "DiffuseProbeGridVisualizationPreparePass" + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationRayTracing.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationRayTracing.pass new file mode 100644 index 0000000000..bdfba0d478 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridVisualizationRayTracing.pass @@ -0,0 +1,54 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "DiffuseProbeGridVisualizationRayTracingPassTemplate", + "PassClass": "DiffuseProbeGridVisualizationRayTracingPass", + "Slots": [ + { + "Name": "Output", + "SlotType": "Output", + "ShaderInputName": "m_output", + "ScopeAttachmentUsage": "Shader", + "LoadStoreAction": { + "ClearValue": { + "Value": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "LoadAction": "Clear" + } + } + ], + "ImageAttachments": [ + { + "Name": "VisualizationImage", + "SizeSource": { + "Source": { + "Pass": "Parent", + "Attachment": "NormalInput" + } + }, + "ImageDescriptor": { + "Format": "R32G32B32A32_FLOAT", + "SharedQueueMask": "Graphics" + } + } + ], + "Connections": [ + { + "LocalSlot": "Output", + "AttachmentRef": { + "Pass": "This", + "Attachment": "VisualizationImage" + } + } + ] + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass b/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass index 314d999e4d..f0c1c212c0 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass @@ -357,6 +357,33 @@ } ] }, + { + "Name": "DiffuseProbeGridVisualizationCompositePass", + "TemplateName": "DiffuseProbeGridVisualizationCompositePassTemplate", + "Connections": [ + { + "LocalSlot": "VisualizationInput", + "AttachmentRef": { + "Pass": "OpaquePass", + "Attachment": "DiffuseProbeGridVisualization" + } + }, + { + "LocalSlot": "Depth", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "Depth" + } + }, + { + "LocalSlot": "ColorInputOutput", + "AttachmentRef": { + "Pass": "PostProcessPass", + "Attachment": "Output" + } + } + ] + }, { "Name": "AuxGeomPass", "TemplateName": "AuxGeomPassTemplate", @@ -365,8 +392,8 @@ { "LocalSlot": "ColorInputOutput", "AttachmentRef": { - "Pass": "PostProcessPass", - "Attachment": "Output" + "Pass": "DiffuseProbeGridVisualizationCompositePass", + "Attachment": "ColorInputOutput" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass index 752d565234..dcf5ef3550 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass @@ -46,6 +46,10 @@ "Name": "Output", "SlotType": "Output" }, + { + "Name": "DiffuseProbeGridVisualization", + "SlotType": "Output" + }, // SwapChain here is only used to reference the frame height and format { "Name": "SwapChainOutput", @@ -59,6 +63,13 @@ "Pass": "DiffuseSpecularMergePass", "Attachment": "Output" } + }, + { + "LocalSlot": "DiffuseProbeGridVisualization", + "AttachmentRef": { + "Pass": "DiffuseGlobalIlluminationPass", + "Attachment": "VisualizationOutput" + } } ], "PassRequests": [ diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index 96cf769690..16e6a7ee72 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -476,6 +476,22 @@ "Name": "DiffuseCompositePassTemplate", "Path": "Passes/DiffuseComposite.pass" }, + { + "Name": "DiffuseProbeGridVisualizationPreparePassTemplate", + "Path": "Passes/DiffuseProbeGridVisualizationPrepare.pass" + }, + { + "Name": "DiffuseProbeGridVisualizationAccelerationStructurePassTemplate", + "Path": "Passes/DiffuseProbeGridVisualizationAccelerationStructure.pass" + }, + { + "Name": "DiffuseProbeGridVisualizationRayTracingPassTemplate", + "Path": "Passes/DiffuseProbeGridVisualizationRayTracing.pass" + }, + { + "Name": "DiffuseProbeGridVisualizationCompositePassTemplate", + "Path": "Passes/DiffuseProbeGridVisualizationComposite.pass" + }, { "Name": "DiffuseGlobalFullscreenPassTemplate", "Path": "Passes/DiffuseGlobalFullscreen.pass" diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl new file mode 100644 index 0000000000..2151541c06 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl @@ -0,0 +1,67 @@ +/* + * 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 +#include +#include +#include + +ShaderResourceGroup PassSrg : SRG_PerPass +{ + Texture2D m_visualization; + Texture2D m_depth; + + Sampler LinearSampler + { + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Linear; + AddressU = Clamp; + AddressV = Clamp; + AddressW = Clamp; + }; +} + +#include + +// Vertex Shader +VSOutput MainVS(VSInput input) +{ + VSOutput OUT; + + float4 posTex = GetVertexPositionAndTexCoords(input.m_vertexID); + OUT.m_position = float4(posTex.x, posTex.y, 0.0, 1.0); + + return OUT; +} + +// Pixel Shader +PSOutput MainPS(VSOutput IN) +{ + uint2 screenCoords = IN.m_position.xy; + float depth = PassSrg::m_depth.Load(uint3(screenCoords, 0)).r; + float4 visualization = PassSrg::m_visualization.Load(uint3(screenCoords, 0)); + + if (!any(visualization)) + { + discard; + } + + if (depth > visualization.a) + { + discard; + } + + PSOutput OUT; + OUT.m_color = float4(visualization.rgb, 1.0f); + return OUT; +} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.shader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.shader new file mode 100644 index 0000000000..8d758b9b6d --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.shader @@ -0,0 +1,42 @@ +{ + "Source" : "DiffuseProbeGridVisualizationComposite.azsl", + + "RasterState" : + { + "CullMode" : "Back" + }, + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : false + } + }, + + "DrawList" : "forward", + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "MainVS", + "type": "Vertex" + }, + { + "name": "MainPS", + "type": "Fragment" + } + ] + }, + + "Supervariants": + [ + { + "Name": "NoMSAA", + "PlusArguments": "--no-ms", + "MinusArguments": "" + } + ] +} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPrepare.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPrepare.precompiledshader new file mode 100644 index 0000000000..d77b7fcb0e --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPrepare.precompiledshader @@ -0,0 +1,34 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PrecompiledShaderAssetSourceData", + "ClassData": + { + "ShaderAssetFileName": "diffuseprobegridvisualizationprepare.azshader", + "PlatformIdentifiers": [ + "pc", + "linux" + ], + "Supervariants": + [ + { + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationprepare_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationprepare_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationprepare_null_0.azshadervariant" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracing.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracing.precompiledshader new file mode 100644 index 0000000000..ff38bfd843 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracing.precompiledshader @@ -0,0 +1,34 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PrecompiledShaderAssetSourceData", + "ClassData": + { + "ShaderAssetFileName": "diffuseprobegridvisualizationraytracing.azshader", + "PlatformIdentifiers": [ + "pc", + "linux" + ], + "Supervariants": + [ + { + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracing_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracing_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracing_null_0.azshadervariant" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingClosestHit.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingClosestHit.precompiledshader new file mode 100644 index 0000000000..1f0d0f7e11 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingClosestHit.precompiledshader @@ -0,0 +1,35 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PrecompiledShaderAssetSourceData", + "ClassData": + { + "ShaderAssetFileName": "diffuseprobegridvisualizationraytracingclosesthit.azshader", + "PlatformIdentifiers": + [ + "pc", + "linux" + ], + "Supervariants": + [ + { + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracingclosesthit_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracingclosesthit_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracingclosesthit_null_0.azshadervariant" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingMiss.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingMiss.precompiledshader new file mode 100644 index 0000000000..905006d92a --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingMiss.precompiledshader @@ -0,0 +1,35 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PrecompiledShaderAssetSourceData", + "ClassData": + { + "ShaderAssetFileName": "diffuseprobegridvisualizationraytracingmiss.azshader", + "PlatformIdentifiers": + [ + "pc", + "linux" + ], + "Supervariants": + [ + { + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracingmiss_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracingmiss_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridvisualizationraytracingmiss_null_0.azshadervariant" + } + ] + } + ] + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation.azshader index 4186489303247e4a509e74262c354526a7d79b23..69507ebd96867eda93f0b06b368b928d6e0735e3 100644 GIT binary patch delta 170 zcmZ4Rfn~u5mJM<&Ec45!hHqA431Vb*E04%7-R!8hU465GE)RnLRf}Vdws!ZU=%3Fw z+eHQlLljPS)Kl7AJ9Vo1WCLC4$*EI5q6lBs;`lVLTrlgOz=h2(BW(mXPq~;0H4&`w n#_#FslXw66hNS7n@2grIEZcjhsUKLzzWG(8wczv*=8OgapVCJE delta 170 zcmZ4Rfn~u5mJM<&ELojz?rv6M31VaoFH4GY+3cvdU465GE)RnLRg2?5=!#>aZ986W zwu=l9hA5ousHe2KcIs61$p*U8lT)XBL=nEM#i2Uce8c5=#|k&UjI^oO$*a`G~yY0STNSJGrAPhfPDk@@2i;pBY#+2#)~W!YC3>-}doAfscainSG3CUZFns@du?3#Tf{YV0%g8+gb z9Bhgb5RGl|CsYj*5%k8Q1W5t)by6d=*C9gMNab4F0FQE z9bC0;JYozi2Neou)=0J_2sAzHSPEQnSsG2!qbNds7wH;@(57e$@#!NMIHu* zcbj$jm$NZCZ@wz}g1x@uAY+4qM9%9?+Lb|ii#Zt+8vPHXTO6`ydN@0kgV~Tn$M=$p z-88jKC3#_{A2VjH=&bSKcwn5Az@Wgv#=Eb@J3%!`?4zWi1%m)fb838+s(?=DBNe-4 zT7^RL(Nirt&vzVT0-CR)uvxEJfXB%IqVeqhIo=6wit^kn^*<$&P8?@)vRfweY2$$j z{h~EY^2$G0?94uJ)}(PBNm#%-QQV8)ZpWt{g9dE_i44alt(Thp*V!oZJmKPDixQ|@ z_~pT3?eiSWyO@}zy;|+erf}8fXo&vmk(P=V#JAma{!`z6dpS_eVI zArR5byVglwO*#swX$x1an{ZaDgkb^58>iBqw8j)X4fAP}Xik*KGxNZbupzFkM^kX5*%f-{Nu;1II7He6LDK9b?r|*(?=i(Oi*&d9)&7mBM zTg>N$fR6`r_*{Nr8wTvt{4+=Wx)_+}gI<*lB^D#`7AJkFnd0s}&l*tfWzy delta 660 zcmX|f6dIkBMw+Q&jS%{I^6+Z_3OwGv6+5 zU%at_FtDVJ0M?-m_-1UvYON8!0Ta(sqkNP2)A0vbA8`mQmaFEgZNF|lu} ziQ}A`wGE@sj|VndUHpMuv^>}z?jZ46Kc=!A7Ba4re3y6uuMXvVO2Kj370ooe2iqU9WQ83gI9umD% zb%&`!9Rcf(;*ZF6>j4;mx#rCh-dglpi7+s zBvkFv-RcY`O@nm@eLRVe$oX6Rf4oet+IiRly*~b&Ty=BAdZsNM^9oFwdTQZGi)M%Y RbhWe+Ef3$M77MRWXn!~TSd#z% diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare.azshader new file mode 100644 index 0000000000000000000000000000000000000000..3d9904c607985ec54782fd08e575f79ecb494b62 GIT binary patch literal 78689 zcmeHQdtA&}8~;ru+1ygJxkm0JU05NyH&MFkX4H^AH3< zXs%)`v)q(dEp~mLx}(PUe80yjF~KH_wQWWvb%Q+u>u+<}d?|-0 zyP|I}gK?_szj_oO4v;MEQl0$N3QLh|9P`Bl1e?= z0oKYK70CSiXO!(37kn&jnQf25U89yNu`KZR^gU(%Yhc}&>D&?E0|ApxZ7ykT$wbUJ z&C)TH4hDmE@#g5e#sqVg#hML4J@r;|a(s4gn!G=-A!Hmid8hhiS<%vU@ z0b^D&LML9&uWC>{dWFu=$NR%wypvvT54MY{I2u6LhXnKNcTX->R1aWy9SKT0tbOj6 zUWeY^X3D)vV~2`MCJDht3H3UbK1B~*$fxQINcz?*J%!Ww1wGvL|Z2H0mTf zX1?0xYfwMD;pYT``N|^jdaQk8|Mfk6UY)SCIe))o*Ajwh_oTm>Tm8y^dnX6<+i-ui z9{17iG=jP4Vdb*KgeQAqO?~uoZ*8sK^rkeHd~wFUf#vV|nz#(im=bwwJbRb}YwqRE zS84Uf^1GJ3j;2NK#hBw3b+K2gfHMJl3tI~SnvT|PpoPRLu}*tP-!em3UPIFYdZ*!Y zmu2)VnMb5YX%K*fshIAXS)cWUfY>yVfNQ*j%pHeb{zboOQh7W)M!uHHSl;F}*d6_BXT z3(PldUl81Rx4Vhczb37{2#o4h<<+5ilkM_%Wd~WMMXo+}{FK*K^0NkK8;JvA|B#iD z`_hwN36_D+`q&hW9LlM?dhuYusQsMoQs%y!`Q&GNI&JNF@~Rgr=l;A7V*L;u@Yzp@ zk-IM(&`R5C>{qt;*!Mf)v@C5Dqk;P<-y(XfM~A(c2hMeyop_7sT3=rfa+=^I1a2cx|*Qd>K z2}ECT1RSBvH%1KhBapru3&o_>PP%G=iPV*km>tR!hC?w~K{2(LJsCFF6N$+|6eW~_ z$sVF6Fg>f;#HnhU5hVat1;^wD#nfJ1H<+R(fXP)NVTbYLYa?IId=4Lu&r|LA2GQYj z`wvc6Dkq$`5s&@h?l_K zT`Uw?do7Nr$mFvFh#WY}oiW_4#6yv_m&s9m-iKk)2Dn7EgQJcIZw_A+N^Vu0gzPzd z4&38yR6Dw%6mxR`Q7$Qu%To)CC1gQLNNwFWMLt|Ix-{Ll@=JZ&StDX?jWso=rf(pl9~#4hX02WJ zX>j+Wd-UUEHC6hwu{0IuRz;L;>Pnpr1N{AZCRI#Gca2z(0gJNr0Kr%U3{-Cmwx&(f z`unXP8UPSqLjlmjiqItWMU$j-SA-^67fmueCV?ha8%?Z|{T7Gq*$5W1m3pn8{P zQ7SaaozNsxhg36rCL4Rxd|GCj%X05R^PNZ{$F?)O@0?N`Op(KG^riXq*6`2*_Lw_*bSpe z@7RDC%B!X@RNBDGnW8Y- z;gz~Cx?S(2Jy8B)%s$aP^T}zevwB(ijn8zo9x$12?V%tZO0jp0u792o{QbqYeKEiWjs^P^Ruof zPO|IcH!Zbd_=6VKal762I!_yraDF-c>{MRBGX)IJ%TJ5AO__7eze^yXT?PX8UtqBa0t=b_`)r84^ zZ84OoaTV$b5UfXip*`AOhOacN3WJ5ofA3Q&L5>gj4U_+1?0glXJ1`r={=E~ z{-fM;1CL3do#YA(NY7kA|nEa<2i^%Dr)W+9S%p7g{Tw?A{{qD}FAq~j`PdkMt zFy@B6D!loURpjNCMMFu{QFbcNw0rcmqh-c?!P(Nl#R)E_J0zQID{7 zhv}R7WYQnFR|_G{63}HJ+*TNUQ~^BDrk?Sr zdKv~a50QtI0N7Pko_81vSL$^gJk#m>xH)I~?iJOgGpokko1h~;(m!9Dbz!q^y!Z5Z z1mFiV9na1?2S40+D6e*Se)xY-|}1i{=%HF zL++o*JQl8grfC`(`Ba{r01U1>e_Hs?6Lr?>S4_)Dzd9&$=blxw!Qa7!m5njv{mV@0=N*H;T4}DBDq=Fo*Glw5I0FkIo}=W?uaF50?7LK}Jdb z(GRl^YL@;sedVUNOC#2532nh$%s~tH>vpI79dty$wJ!6`YW8;FNoTo#osxA@*jqfA zJRW7lpZjv;=rhceU0J7w80HT+8W?}0SDd8KHf>RFrg_G@w+9+(t%edr;F}+Z_N4w< zv3SN0X|5`)6Kp5{#IZxLSk{rlAa3m9Z<+OsH3z-AcO2$w5}Q((#5Y|1uB;)iFOLyo zVc^%n%3UylR&>@qU6apfz5}f8tKU~1p=kk6D_-2km;PyT8>V@6kminG zlSVHvG$XSK)o9A(}4qq-HAElY(xazy-?t+b9?K)kx$Ltczl2vX`v+W1xhU)&j zT$A$X6Gc75>+*=s12v*^GHt&!cb}YS*T+Fi%H3jJZ?Gk8Ye&x)vA;@Bj}rgtY%5=- zHv929QPXpLja}EoCj)jgei3r4SyR(O;Nxqs3_17K0|3S~Sd$% zU+s>AiVvq@lTnQ_dEi8~Dt%Pvi_@?X)JLT!w@kc&4USmo;J|6vN(#gzLe-|e#RxU0 z2iB=L4I8InH|<`5A4YH^)YV+8TW4V=SEBX-K~1x21`S&LBpZrrurdZRg36lM#yAZd zr(xqXY-PoEa2hsQ7LTj~hIoZFuE9bOxCTpG+4rjLL(wu7aSfKXtBBzmEFh940%d1; zLPWnNj}nk;E!DC?sRm9L2tqS(T!RIz52#y&Rsml$_2U{WZD#&ct)A}O1WoO@28#;S zA*rU`Y|Dvjut;$l_M*ovZXy5wsllSv+bOK4@o@Y9Y@5f33>^1_f@(!Q?+o{%aPs!sI{Wx>cC`hsl3U$0wNlhsl4+$tk!7i%Qq*tG0=S z9WP??U$Z+FNzPca($+Ag;TkNs28&8#Q-w?RU^a$puuvTvCjZI9`Y5y$O#W*XNJ3K| zCjZ5e7KdVTRG;_ZDCzxmx-g%I$$zaEBMyAFRLbM>LfJB&Na!SF&*5{zpq#7}C?~7E z$dk$g_qYZNuEB!Ie>4~FC>?$XH-jRa=noOJ_9gB-p|eCJlyTXioTj^;5m^O2nx;?H zSOwJ82Q}{t?Q|8_V8Jz5THAHAqhmyK#^gUt{%f0rrrJIf&5vR7U)y@ekJ&T!Te<6&PHD#ltWl z^-5rjrOSDbvO>MkXSWMdCn`#LD5B-ee{cY=R5m{L_m9;ld`kun8_~A}^orXD1;){|`Q=4_hGSbL1EQawKL^Qt*$RRLYTo4~BB2Qjx@$BM_TS6U~wTZyFloJtJCT=E&o6 z!AHSo=5XX$S$;fe6r0amK$0$7QW(N1s-z&RW11XcnpgEsb zB9f7F1C)vXG1<*%c&N9wdb4A^+rniG%@6>H2kmv7M?+pl!`0$0O0|_X`2(29Bu^hP zJCr93hxVTpR8R2RyU{Q~xfihH7+bYNYSDG1ngCrJSd|p2CO0T1IO82nO;qwF-4$Ih zoqbGpGa5csDDE(HzG~NApXN@B>`^skH=`+y$^dG0(;ZA>A5+={4H{KrGei;rn{Ur! z!-v7=YVSxRN=K@tv~1&R4yqP0%!`Vg?q>*DX}L z`u@!9W;E4Nk%481BU{F9BY`+x?K-3Sybr^o4R9Zm-HfI->UdCZX%jSbs^)XR2E@l? zH=`k>u1lKbmd$GC?B@1_W8=qAGFX+% zYdAFPBAnffvzu{tv!Zn8hhQxZjRl6HQ)zvT>2tzaw^oJT~BIT#72=|ioXdYL!@85+tCD7qRz}3o zrhhgJ{LRerO8ine=J1v8su-W@ISD%31eE39``zXFy{3t3ENZWKSLu|vfrlZ0TSgnAuIpQ48@ z4&RtVkE68Io%1{qwrCb*0VPb$MiKb4X|Fwu|bg0_}|p0J@!X1I(AxPw$R^1AX!04Dm;W_SI`L_c+w zF#*v^rro2j9W68F3(l4XE>3Vc-67dzTPah1?cv7xL3;wTW-2ct(i9kxCv_7f)KNnk zk_Vo43Qu6n4SQ91^Chdu%PotBPNW0nRgg3=l@U<*L+ykD_%6Vb8eKfbiUvH{$n?#8 zGU>trt+cJier0=)eZM14%hHD2Dyv4VK}e|tNFY2`0>Wb@5i0)qCzmm)@(UhyUl{T! z&;+hx0+fKOnBXcVLkS}A&5uKSN(yb$7WKweOmGzwT*ZWC9XX7Co-e!jTV_3D%|Wm3 z9f!G^#HJJ`@eNnMD{IK>%VUIC82EKCvwM1coT=5hp|zQ;XW3;IG>-uk?S7y%f?k2H zUjAZ_`2E*{Iu*Gm9RmIsv|OLN&i$NPd2mKDVe4CIqYz^6pJap%LGx5Kr4uX4|o1DkBnCF~L<#a1|3U?7%3J4^^76 z0)pg<#XTvu4e#nfdKN5Cky{w9F4jy<641!=GOIR^xj@l{?fhS|Gn{+VtW#=?7mnHA<0B z=5#}wEZONaRqY7Pra9tc#yUp~@TVaE(f(4Ts&UHlH99rM(-p9Ku z@IYSshs}24zh;ASp1HQ{hI!Dy`s1YhOlxt@p_EjW2k83C^YR6g%g*&jxUT#B*qQyW z{kVE%eTr1_%<{L-zxjFV&JD?3?^M0Bx+d&N=zm=6q}0;<4o}7G8C><(6P2HSw)EP% zm3N)^*(fx!$}4@vo0IS5XU6`}U%PricE`n>+GWXSS3CRodAC3B>39Tn3^tCIHo-Tc z+_2b7w|~c(3@{>JyOU%6Go~+{$&&2BYKg7YA0*dNUBCN}oK5A=KPhUIpRJ|y;uK=R;+o7C2S`7P_E<0C>Ba#8%Q}t?n`hFVZUx#nRj&)rJ(47cNgSybcK>Ws@l!6F=CYkY;L( z6S}Ewa6}T4i9rx$qn~k{8X{9dKge#Fp^6N=glM7)fspG#C>8KgWAoH1Wq3MDxgKi9 zA*cnsBZCaCczz@78GN7tWY-$HOE*J9z`k#H}I z{Kr)RTQvcMRSWq z?>Z)fKiJ`>#nF92|872x;?oH~$0+&Y3;VP;n1%n}o){C=Uv%&Zwk zzT`2h&CGHo)dUzQPEe_2R+*XA5@v~#1Dfgp&oFZRUrLl5&{PL_hLM}(eCxbUs>Xa< z;wFfEA`u=JK*XmIDPTgxWH(8fIG>cxJR0r(9&a%{%b-i{HbA6kClj{ZBOrMI0nsJ* zDA0sK4@kYqA|Vh@^GWH{Arc5g`FtWKa~Syi#zv9Yt>Zw73Og$0Ye2RTJdpwILIFSB zWONNp?uX^u+`V`_jln~#<&$c0vrTLvwL-B@Cf3szH_8?tmxY;RLb2J#5)YFyws@4Z zvBl%0j3b^VZ5;6oDdUP~NgG!z(b&Ai3XRNLoUNhzhzH1hKIUqed`SSw3L$X^4KF~* zJp!n%5JEd?<|2eVAb=u4OFK1zwO~9)LBW@iZc3tiCPrgke zq}}fET`#mOQZI7rT=YX{pQbh6tY;Hr6(F>FFyA_KtOB3o^0wqp-#lgC-pjMfmg+h^;IJJ_jO+@r*)MS-Ga- z*$pKds)|*Wsil=ws?xjypiSM0AJzD$^U&vXM3$dVa4RdXUA*nR82B?-`U9izzTBE8 zlI5G{rK)6G3JVJ=JmGzpNvxv~vm?dmaW>qr#R5+pXCOtu=*yB2B@gL`txzLd8-e)I zBS&$pphtDkVPPFV`r^nyW8c}1Qv>g3@C=*mJY*vQx-Vw5nrYpLN_j{sfBWmjXG>mM zI#hBfyg8-m`a5C8rR-<5l6+5Cc10Od!b3`Xkj;|VqQ9@I?Aq^M>9^Rgu5$mbG|zYT z1E=nN0@ZcHH?^&4Qk*BX?}i1K_zg5 z7AUUbAzOgrp6-LA5C?2oq3E`Nbe^G9*Fs7$Y}2r*C{5SZh4Zc=L6>yIxXx9^bMu4k z+!*)|JyJrVVze;phMC=jH02hFtZnxbthX3KW(>UY z;`=XJ2TnEb_8)k?r3ClLLK!;0Ury&GFX7sb+>R_PXYHTIV9jg{*1V{}y6BMfh-&l+ zjdv)@4IHl7l@^~?32gr(@V9SN;^ft7+w}RXV=-82cmpjE_!52mX2zlPMd7Qz+OgEQ z^y{-FS_x@If;$=sb7ORo^XREdyWij4HtV0>G*}7Pq@zD37PsO+_h}m>GURg}a;*p1Xkk(#VTEme>2Uht;-w{}T8Rk^Buq~b`skv# zc@@!(6RC|;_q71|NFYDWL%!@m*nxL#iS0W^#B?9+0Vb$`3Hkmu(*L4aH9z3O-A`3N z)aDZdM)5Hi#c?@y((W5|XngXjW6*H^`m}AVe{kE(_|>t&v1t&IzQsgq4a%s^)-_>N z{N=Rn%>|RyekEJr-I;qyc-hbI60Awlv6Ez6m4drzn5WzIg6Cq-*0gx}{>sH&UHfIb z7I(>C$O{IG>bV|k%1se#M#c86n0Iq(MTIJVBNe49OY=78Z!CQ_SyfV^0ujpwDgCiw_yyG7cAWzTUB;SS#rPuK7|=%mCN4-*wIFeS(2geIp%>J9a~@FgI6ho&yn&xV(TQw#T9=aO{eyGAfJC(u^g zOpwjd7&>oK#*Tqgy}j(--Hijlpyj}zNItTx7qKHH-b$&@a}z!lss;5Tp>slbp_{tC z+z?U}1`}&Tt+{;~8 z+Q=eV(--Om{e@45#x5kjGEMXibvL%`9*92Gvb#6KwKX!oW+~Y0HgBl_8~+;ZVGqHp z?&||`b4*=V{MKXZfr>FN+Cz2wID%KxI{aSA4Y;t5GNVlregfz+p8B+JWcR??4A)U` zW1-HqOmMy}LrI}yLRjcUd(0q@Yp@$-B(t`LS=nCBx(;!_26sM^vy3GRuvz^-?iLmj zF7s?UzahqBPWfX-#$!V@#;P*r3n;TTMPF9NtSe(w*XYY|y0o!!F8ZsE{;KBf{5ii8f0 z|DX!FXp%2?%9pp#=f~}FZSpt+Bfic4FzED0ZTtmBe2<;w5Hah^7Q5?V-l((o64UmPh=JH{_MrT=C%Ew{Pos*M)c@EQ@*>^{?9#(u8>g{3e$Biq}$IjY0v7v zNd10qK=sZum3Ud@bb#Mm zN%05LE+zpzy}La5Tg$IhlkAtjd2}nB?f0ZtqT}($6K9tyq?p5+-?iESKW_H>D# zCW_Mb37>DlIpA^)d`Be;Cl__dTFfjv z!HY;HP36A;HF1T|Af4qTLQ-2XM%XW43V=1+z$OJ&ImyyRDAxEWB~5^~V$)$Mk$^wM zb>%Pk0j${us=LLXkf1M?U2@?!um)^-;)ZCPvHmx(CMdP_0PhmXI&c=i8VQnz#eId) zoA`$OH)1emH3|Zd8EbB=urTWmGHb=m<+w{ikG=w9*3~d;#~GDM{qrcmA`HUJSOGCs z3^N`p(pQoC+F6%6C$mP(^kOY*w#N0y=OuVTK<`^Pi<*vosHj$svT!dH6_L>yh@L$y?h`(?WmxuH4IHM{Q*8d0-2p>Z;UIv^<6eUk{+GLj z)6#%jBJVL(z_dt6Z6#K&qRitFBN1Xp?Iwm@b>1t}Hu=22_`{E75sAqu^!5|tHPSN0 zXDY0fnuXNXeE%ku@?q9IEM84ZRR>>t_Gwe4??!rOs`^cXM`*~=fr8(LE8i`*?h90+ zqM+#i7Ticoy3WVue5Q2DAB20!G`i$oBPm+VfGzh3Nd77lg{Ym8N==XQdH*6&B9xRr?4x!i+Nwel+uO35~`V zze2-n5VBwJ^Evn5#BUAK4xDvn9=|b;NU?eR*3f-v9=~CGU2Rw{9E#eHNVE5{2W(Mi zB6(+yh{#X?6*728k=Byo*&w=%vp#JqXz45vgl^k+h;5CQl8jASBE`?NaMPZGVUle< zrZEtlb{qv?SL{9Ye`$hPF)ZBzB&ySPeyr(@P_$f90>X4u5}vPYvo_iM80KZVf7dO7 z{(HBGHk?J>KHB<52BxH^Uhf+LmxiIAefj@)hJVkUAsnn}V>~L zs9hd7sIORldr-Un&Ox2@I|p@_^w$UVI`Y>CwF-xzzX7{F;pA}Ya}ggrQA1GMdX-yS zF1tmr`yR9Hl8Ynlz=@G{`^+kj0L1NWx$2G=$&(Ix zM3X!bRg?xxV)+0m{0EmcIHJM82cx-c-0=}TIUzLeRN!tc2&~? zL9a;(p~S6TP0LOZqn;%g&vQb7+n3H|w+(#MfG5P1--_6@Yp1KUo^^XN55t^PWmB)V zp5;23*MtWKBXd}k1N@Ak zu%$@LGlsIX@7nReb$V&SF^;aj7-Gzh&R9P}xCuvKhh(Li^#;z$3h9@)*(hQke%C%t z=mM3-<2lN{V1xtKmwCD|yC-qg@s%?k4`({zTq70-hN0QFKyCF1(|A72KM9LG%Ocd{ zlqK7qF}S21aAcfxq`|s$%V~p^2Ien!ON7s&5ug388e)uRalwWnv6Y0nj1pMzO#8~T zq0?ab8beX7ixzbYrN7h8D{`1=V38jD6XD)@++9?({TTRxRn_E<_?DtS(phi#^#?7{ z=Fs!ZYM$F#Q4-4wtRu6O{obhSUWI$_>~=732hHI}>FQ*b5HyYF>^L#&`fAzs@ufFE qUpl0Yy7#d+`}h8z0s;A-{OJbOZjPQ4|K{&82%>F$?fEZoAom|Q5NKfl literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..84b6226022cf56a8f1fde48be591ed8d5a4fdb36 GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Jco%bzO%^#K4Nn#NfG literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationprepare_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..9ad3c0deb1fcfbb8e36eef4d5d19d6cf71f47757 GIT binary patch literal 6554 zcmbuEdu-L^8OIM)3JfeFmx5C$uuU#n5z0lJwxxyBD%jE%1VqY@_E$J^F6Eq4Xq^`j z7?+_SQ<3Qe<|a3t*STnn%cf&YUCi7?X0m@6$!4-S6Ji`>j(tDB-}{sw=&~jIB@gfO zexLjEKJR-7#A2~n!ImELUOzr$>ha2=oga@pbaqYitH*x3>((hfo-Mz7(vYb$$8SBg zf5gb!7C#<4_WJhK*Yx;cNlVk=_4PMz`N;#HtiSA4Z^=6wkNZ_0>|AyC-{&0My>nA# z;crfFkY9Z@bIU(neC6~1`q}nv@%Q(Ywe>yIcS2d$ww*@~jeBd?@Zyur@9ru4=$+fQ z_Iu@$&>-?>*S(oHCjNJ|*rKI>n*7&&Z*A%S?8&OPcO@4+T~q5_s?Z<4S5 z53JepQTBtQr^6<`e?0cKQ5W`QcY?2ThZKmFsd&FPPuDjpfuHSwM`KaSr?=x07# zv}*O*`NMZNyjHp6Owzg*dTu%F5u|AT=V)b4w*O*<=th^+*igJ=;?Rqe&wKS3P zR!}H)_Bqe4J)2qXS9^I+vLaRFY?LD1$-ACeoW_Q@NpfLh$+J&jC(}qif!}yG(JJ|u z0y%v$KdI(G-q^m<&-x8sYoddkdrLDGtFDgMF32Q1Qhv3cYl+v-7sfOo3mM{LL1H_z;EeDDI~`fWJoTYg~@8OSryFWHTj)>(&_aLa^`GIuR0OVr)gOn z&M45S>B{BRzFdMF!kUQ{$mV*T%E4T8=h)BWw`hXBM38yQ>Ei#=*fh(2X%1p9VqHetbrZ-auxiX*DL^qwU*DvtLlN{7?&flzb zOQu!F5%*FlFZ3Da$9oXy&h%PVwRvjoIggf~9%a{?M0$2sR}ej`M>6Z-Ak%AX$!3zt zy0*5QuVe0(4>mas*2S4kE7b_=)ew`P%iC1Cb%vTwgP+W_1fx4E?JZCG>XhYMY&uoC z+POqq;&Xc8nGZ9)FyE@A?_~w)#`KMG-gf6AcQ?G%fzCzey|HnRCP|lA9iWv9-Lh zB_5dN4MweC6(X}G53o5Aj6Q+YM=;I-tSN%=c7QF6V8j7i62Ukluw@a9o`GpZyK|v0 zU@IdS?*Ldbf^p};+9Mb}0@Ky$_QyR2>x^LBTd=z#7VS~3 zw;s_a2%rB8VQ2N)O3V?8&HNA#Kji)ut<(ih?qAi44Y?x!n${j7@IlhNQtK#5$7+Qi zENq-sbjNGOm-(LH_Vge5Rc?=eVqLA3y0E!k`x33ZKeitwo_B^1Il1z7n4H|mvxf-( zrA|iu*7s|~bI!;oI{9d~zt-*Px#>?5&)M64vUu)=?aRb7_qLxRKAii4;Jl`4KUERw z4SDj>tAA)WP3sNvPA{j6$bFu4>Bn^r)1tR1yuULXUa787+w~&q=N?lRzNq!Y5mzClxMAXJ-x--R_Pt&au296E!H#)!7 z;_*p*%W0N)?2(!MZ1Ldup??|GI9h95ge>i9u5lQ>;aqD))*H@?-e7l=lcC3X-z+jc z&J8`ze~y!($DGa;ncf)j=y6WBIGM$*i|8>s7PnqJGW0mRc_Q=2OrgiwH8`2YZH(wK zYZkXjJhCI|C--f>2+V5jEq;NB`(i!2RXly#BpZ6MPy|M9_X#8ZA`vsd+iP}<9d35F zX^#!~1J2hH@!*$>HaP5d@x(xOSQvRO711+#eNZ)nHH*MM)eTstmG6vX;GSrii2DLx zr;5mZxrj4@_?WGpqK6cxNNbA-9fN8t3>!j)?dFAU`Y{mF#qTi&-|vulVj9xT6=7encs|f zd?P!pjx5tk?^r)^aoWY>dzuJ+`f6vrT0ApoXPp%f#(7(eoOtdLGQ;xX@r#Ue?9j@` zIWn7TL}26szfOH%-qwnkNn#q->2T(dw*|c}5jdE=S9dzRX9W9(!|0>w-Q_SX-S5xc z;%^WkBkm$gO_8R$?)XcykM?b;)U_^?CA=H!0y=tSq_0qvO!WXz(SKda5+4yUtBEBeevrOso# z)}5k$qQN5Gy&|m-iooqo?-Gv>KEu8(9*i6fd&ptrT<_|ASUmoQIKr379&wn-@oBQ% zPKF(FeAD+4S|1hR7kl(76>EalJ)%O+YtCf%YhU^Iu821g{=5(+43+Hs7Fy<7Q&FOyeGerADHmBbc4{me%r1%SU zzAp^CUS~K`>kmZOf#Zi6d`bjvIUR7AmTv5z!#G2m=|ketMMi&YrVoop2JvBIGkrun zGmQ>skDblL)8dgAh?r077c2A0ygei0oI6D5(@Xx&!F%yT5pw%&d)8sh>mi*scl$XJ z_)t-?h+_=MJlKq5^MaHALOo>vqQi!1ebZqtiO2VF(a#U l(*5gr;O9b_0{w^oT!?jLrko!8x&H>xLEW==?Vn3z_itdKY@q-E literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing.azshader new file mode 100644 index 0000000000000000000000000000000000000000..0b8181e53f31fae3874a0a65b2c19f3dea59ce84 GIT binary patch literal 205596 zcmeHw2Ygh;_Wy3EN)enAufqavI#5O*iC>SV5Fmz0AlE& zNevR3bVLD7C?W!aJb3VYsECS)2vUUqnR~O|Wbe#oj@-NW`@4QV&!4|ca?f|p%$zxM zsz#&Hl$xv^8#HJ6DSMY2^VXcHf3)t;b2Abejwu`5Y*xj^e}tS`d+|cGI>B86pYLo+ zNlAAadpm4{j8P6#azB$Z-C#D2G^Ckq)@VaUtizCGvZiYEzs^3hC;V*IkkLPPU!9#b zA++p?+v9+cpGFs7u;uWGjVGVzuv|ZJ{QKv#Gw)@r%?}MpXy@1JYtw(8T-MFF<@cT6 z2cK9pCS&E~LtS4uG^=*4ONqzkwZ3{};FJnGs%YUe#s1N~HS&Ycs(l`MGyP8Q+3P2a z9ohU!%}C*krOWO3`c`cDF5hSMIP%oOpoWz*_D${ly!)gobvC9L(#>hT>|_!e{gXp2 zQI+guP!+#s}N5-EqQa%On z^8=i_HgNv|%vt|i+4etEzomci^Ow6&Mzk7E24<`p^HDV!pYJ~?{*NZ3SFN~tUk=C! ziaOdWe@E4%U%$?q*S>t2m%rO^rCVxqjqdHsJKqYsd^>Ud{J05w{9Xxpqq{CbcQE(n zk!Me(Pk8=J{0qCDSohkJlm+9()jrV15%YP+fkWp1nDABi?f35uq;0rD?q)huwcN}i zn}be5Pa~1$NQd=9QE+WR-8-3c{cb0Z4@ixQ|77#|6U!{ekGB%0{P-JFQ@1xwY_MQo zt(#?&CN~xF?1=rg{|iCAKik^>sQ-S)k*d@)=C&P0Wc{C6nE(EZ2|MSH4SDi|%IR-< z*jX@p`bq`H{-=p2U^P3TBFg9Suv}0zDD;-tG8yy z*Qh$hxHM+{oDQ3Y6ujK$j4(&-Cv6Q_CwF~z?+=r@KCc`5Qu*(4dX{Zjc1h&P z2^TJ&eK&G+dwt#Eajo6A>_>w?pQX|0(wD>soI4h@cWbG*mJ_u}?a$^OzaxHnLixr& zZ%U1do^^9|LTLJ-?Qyi_)aVX=dhOVuQ}wicw#Co-pzPsqYi_;wwT=jw2W1YOXgDLG z_KfT0gJO357$tnQe7#wp^jR=2JY$_cTKmhUk4GfZWJEucad?a)RgV@Eo{g=Lb@!W&CC%;P9=+4(lIJv@DI-vB9xcT$y zb?Y2_wEh(VZ0Xu3Uf6T*yYM5+hkd;#{7Rp6sz9r1Ni>eI+nnhRW4O(l=CGMP2sM58 zI~i-;mx3H2jlQ7e-LjMstw!&7>A`Q5k@_0_vl}`OrHsIdK}?{$B{A8U1cH@`+fT#7 z4d~FgLzuXM4G7%TEQwANS@qsFlQpfoDRpp~x2C{meFfAMo^(wi#%}ZO3<8*oP!TnQ zN|r>s*V)eoUkL>s*l!mli7}bT4BK#TZ6G_7{gqKOs8wVJktTDR(b3!BFj%}b4fZ*B z0yT}=Ac9N|km#Ti8qC5`_Ud~0v1L*f)I`W-;Iue9OOx@EP-U+~Rn!D3l9g}{@v1as zGyh2x_9rZfNd~(!-E8zKe6}>IhJp{QADV7R_9}KZ>#L)%1MBTJb4IGo>Q(scU0(wQ zzj|@_fP?Ac`4F0e~-+mF# z?PyY~YgivkAXPhkx=^``HI7IF4K>u^Fk}>(6=2^o9^a*z`kuyb+Og2H@Wk_85-TKRs+svhCO&@ zW{sFzdxL_He!p+s8ya2cwP*ahU!VBj=68(d;f4EC zU_W7e%5@2Ge+rB=j8D0)2kuXmVt&dcxVb+Csssa-OQdptstof}E=kAzsj|#ZxdagR zr^+!u<&q2BpDNG%l(}5(Urn{^1`D)^vR2M+`H}npuEuN_QzEn<$ea>jX1pQ9m*wGS)WU0VfkT4j&?jJinvP`0Q_+#+W8AeB+sWUuhOlJ%SW}j_4I!_08ZPL`VnbvU}RZuT5 zRB28f96?anFa%}BHyky%dok1`cOi}papNP71>GcvBMGVihGcQuH;xo&Xc$s5Q#Fnn zc?uzT>E@)v(E^npLyO`8!O;V?8AGqQ)f`6(6j=C2_qE>_FYK~BwRgUMVxQTEH*Qb) z`P3HS7TI;`%SQ8BM8CT-aKZSzieLXCvi#p|>R+848@+lMi2g1k|c9 z1V%r#+zSIkqvvJ*(k?M0uZ5j;rAU%i0pdYO;?jaBKs*3RT)Nv7ARdS$E(v}Gh_^-( zmm~@oagT<6@mTQgHgYHsTipX?EW@Qc;$i2EJzmxtY?47yP4Z&z$&ri!GU|!;#)aB`?xG)zQGCsW4RNPc$X42xOVsD^}Ni zFBd}cyp^=-Z>6W)f%SG6hn0Xz{T&5L_i&rToZQ>yG>O6I^fRwzZznK2GQ8ZlGvCyb zXf+xf@rfy}f5npz9>DDwRj%!RD;Ezyb0bwttnan~~Mt@Us+F&M>8>&NrRdSDm^~{~$ zRfhzZtO)7PxK_`I?x~Ilo~2Tpsz)%O39{t2Qkw^C8%`nI)MBuQrkM@S7}H4RRqF>- z88^RDcwh&ati!~JOD;&@sZt-3dqk+`RRhVaG9h)m6s=N@UR(OwVxsr8*p7&7U!qp0U(X9Sg9gXpE$1IQ3PB^Do#nwv?7+ zy(~tDL5LeSLI64QcJ~WlVp2*idd`K(ZnP$uNVF8hEhgD)j^tQdxGgE#kZek4oPHQRvi%v5+uyG?F73?mYE%QVoNb~J zuhYcxv+MQmS7X+pwhOup9=VWZGJe{n>ifBqqo#g}oWYT(!z4kS5mo--D3XY11P@EN zv2nB^7Xd??r2^xKN**ltRiv^Q6gj%qgrf>6Bbcdru#Mp8O0FiZ*~+D{O9mIcEpQP2 zg_}C_g^Z&r+4{LAPI=7W=#juC#5s~Hm^gBf2ZJFev(wUSrYwhZwaX_Tt2(D?fypK4dFnP@E>E=cpNyz8Mkc3@Kw@KrulF&3T z$6i`c^N8F5>(`r6dgVb}+Z~UM{VfyzG(UCX{o~qyRgJJz435jsz5GYijmwoAvEEE@ zyXenq@BAdEMLsp5;CM$Z*Yk^%@?q758NB{lHRt*MosCdc;%PQ&Au^{I%80L2bs(!;yM!x zzBn}b8}?hqmMV3uy>@D|uEt4knj0Ov7L}-Kd|2yCR~tG~$z3piP6-uSTCyg@CFf7a6; z2491bugV?C`LOB-jvWWOKN#EO%3}wXo7=$8Au>F5LW7*_H!8J^Y}hSlv%b~zD*-u9 z@o(-=wKt-VOnEzGGks+HlY!}1ns?0Fu($KcHI?pc$k=&1Sp3@fdX<~IkA&I@woA{( zR&gH@|7OmOQCr_iZFf0lTGYL)!4bRP+xE=?7$I(MPqq>M>N*K@iw*IQFta=%Cx}r| z=dVI1Fk;byGyRh)t!?TA3`y zQIl*#T%o0s%)*h8o_<_pipg#qC1Rd{rTu3`tP0OJ+wd+{1JuVFCRT%GIzfRwYKI$$ zwgOSNC0HQTG!sey;f9Iz{ma z$l#S0T@o&~>rp9OV3U;iWU&o1T8!4T*bF-}?no2DTVPkQG3l9@lv+CQnz*qEFi9^PaKsr&K~css zzN$LDXKDCcPnr_YC994OQfAz^r^|3c?2XZBVlxe5OjQmft0#li!!QCinu~AD^)#yv zP0lf~pi-ELSO*x}%&s~t(e+(;7Ya+-4^lZif`S*J%FEb5wv4U?jDSMLR*?HljzJ!b z%HZUJqlnZP3@2c)%?t;Sv7)0M0lqL$aR#SZjZSB5iTE;A$Ja!*xDx*&tVy!r+xLi}wPHj2Ty<#jM{b>O_63hOc+&|>^a~GhB{%woR^ts zX5(^Rg9Qm0uO}C8@D_C4qlIrR8~|iIWU*z#QK}2m6*h=0Oqv>C>+uEkDw7jRgk)8Otbt zCeof^I0(p?IQdyGVx+-QMur^9H-AwZGLE$5oZ%8PyviUB1Tw0g?(x8p1i6k8>~uE* zjwJC;A?^~I9|cEH^6zo2t^7<$ZzSnqj)Q=V3*>mF;pihXg5+{dZkfOVK&A!BpE7PH zRvdL?9IX6mEB=1R5l2Qg7t>&hd7yA)@mWG{))bnj0tW#Z^()`?F75bFgDj3dGJl8Z z)51|j#^}qpdXY!oEAalrQD-MKQZ;qY)WK$eqmInz@k|}e0yygU{1dk=@A9kS$dYUu z4J-UwbCMB$y)o$J+)oS*N#H6j{F=~GJN)|Rk8*AgdGkMHD{FL54>tvNm_KE4&DQ|*Jse)4MRyoL9GYDYL zz}1|9Zw79~cD=)XHh5P%1U~Rm9+PzK5SRl)?NY(wgCiSFg(h(gs&rJ)`ZZq zCvJ}eQv|4*jEw>QTE+P6ti|N?fnu1wbq0xB@$aAXDX^8hKN_3_M#D(g zCB*$HUq?*-wsgLZnEbr*b;R^_#4Mpju*V#3oInIUlOYgYDj2swglZX#Pk}!Khw7g# zFOXUIzK)oM+l#M3CCvyeIxbgnmH;4*OJP6r5riN|_p+&CF??+40V%kWtJNsgUxS;e z6m!HyQH%t5&6t#COpY{}A>~l0`;DEa6bZmZmFCpJO;d_u<044vCfLjwsWz)nn;$zp zDKwXh8q`e?9=BLBQur1Z84{vaWKu%WaV$wG3YUu{DYIyD4*5$=lw!EKNWqd7Z5)7| zm=s~jMa|7ghue%&01_81C>mmPTAW21Mj#8CNYO@I^om=}aZ~ek#N=tmDJ=+B!IP4V zU*Zz+mXML|HU)@d8#GFSUjgFSeua`m;UezAs*CMH3hG3mKJl=Wu?&~)h=--@>xfx$ zpIsu^|8ez&ST$)``Qs3!$EXp&_MN)UkFO(U_tn{w*&oLi>0R_^4@zc|;y%?E$wSu% z#?Ap*ruNP$q1ZeN7;IdXx3s59=`2*4s-ps>+t(4Z(C@=l-3#8&zK)pm#>%jld>t`8 zwVig0YxUUwO?!`d_Q4*^a24Zj6H?34X0oOUk9&_`z{bQ9k4k|NGX4z7w&7guCxI$M zTq}hK&bhB6W{JJjOX#n~xYv9gF`0#O{CpiTSsJZhebo;=Bq;hiV!|bYQHUU?SmfEC z9Xn~=vsjXVt#>OW$fY&)b;P9iSAgYXo;e8QW?Zyz8rfQiI;C!W9Wg0wOOW~RCEVDe zC7QQP5Hj`M*AdgiviM%M0NzL0TLC0jq_#%96e-4 zy{{uCaw8-2=fQ_5wK7DKl3XTSTgTTCQ|u6qJ1_W(1Ps+0M;2K{%GVK-t5>)bJi&Eh zd>t{lxGKdgadA~3iKlP+62SuX)pzDGYTC9dciFv5wt`rX3R`JZ70Hr{Y05N{%&;o-MS|uVV`GH6w zyb6&A>Im|(;8%rEkV4Mi z)k-N)B-)i96l~?9QR+^mP>^Di{3tx^AjKAo*yi{VQFA>MI$cEf=SSj!H;U~U^7i3J zNsv61K0{%FPu=OUIi_G@=l1@+#gpRnw*@5|{iBQ)r+;Xg z&Eg+vG>}p>{^2%@#b)&nb&^I({v^rI=y3XXHl?JbJB{M^yO_=C7L!$I&f^+^&x$?X z`k9>R2D53TFe)JvKikqU(rGqnbT{{WH~qx!s274S_Fww$#d8nlp8P63pU55UiW3KO zYd+U&#GLTTFP)oxV}I1wlfPlVWo)TZ$J%SBHtTAf^rpGd zv1?I@`nhM@#!=P+R;kL$u}$bBUB?uZJ@$Tsetxri44rgp@NWgTCy$49g|Z8GU%$JS zK9V=|hLJJ?be6CFCL=81WTkoI!(#IWwK)D+PkR{ICK~-$<&NZhSoH(Pjsx8vjBRq| zu>;G^ZQ$qSH2TyD4RW&IsMIpDVYi&k`c~7g1muufvG6zdr`j9QN2a_TvY9@z{mH=e zE6qD*ZP?rS~ z*5HWU?``|$0F1!y_Fz`f=+4(lIJv@DI-vB9xcT$yb?Y2_wEh)g#btHQ66j8Nq0Kd` zR3xNrGm51Cl?sLI>RN;ax&xIOF3VbQ=}i2y16C}3v8OYoWs7mbR7!DGCL)eFa#*Cw z^2~ZfkR#8S7I2$gc#&b=fh9t~Bw8wg>8iu+C6I8FAV9j>+K>ioUIGYu8v-D_nr-Q6 z_H>A6V-%TXud&Ci%UEM!gEl)6ra9lo@2X=>-&^Zqt6y(&=YKOax?8OVoXre-@XX8_ zF}L;x1t0x>-?}&8#=Q27fA{MX{~MhhS9kXJQ>v!?w0^!uH~PmTW3y&ldq1;9Ox0x< zSDu=4_dupFYwkh{ut6Dx6oh;5#nHY384pt+16f`Hw$i?K^M9n=cMwI^(^_zbG6E}j z=hdjO^pQo|oZG1*x>c`Kn6^6M`L5mT#@aScjcDFqv-6VfVD8N$H=-9-Shg>|)pFf{ zlZhLL4-xj0tolGgLc=j--Ob7nHxK>xkU7ERD1fy7+V6`Oc3GaX(Y{Szk+*|;G4mSrsbZcOm5 zrj3nPPaoS7*KCuqic`1oLay+;H6m8l`0#We{nGD;ma$h$1hbFsaZS_ppKUHZe`WoC z`5ShAzGhtMpkRU5+LWJiTMZBBRc6DY&4-^Dm~~Ot<@)u!#E;uTEc%7>7U1fHCT06^42_V9k^J~%&J3^b4;v}8)gFikOj-G zIxG)8Kv|&RMaZ}kl{%XoJ+)ZiMyL)>E;uB6h}3D1g>Td&z(?z@$-FKRMHm|5c-1k=g|EDoAPe1O)zNYGg=PVqsyaaM`MKQ=#k=gXkYzEE zDWx3Akri)}$U?S|iA+72CmoAOo5NyYCYEZJs18nk9^@^9S*%;3Iy&CIwk(9JRYxe- zONzEjgocGIXnBtq8gw&cLEHC;p+S>L7PQY*hbDg{7gCVLKef}u|4C+B4*n%Q`>7fEcKz%@Uv@O-&=lfSia0FWte#g+|6sV;7+9-kpN z%2Fj&E+(^$064Nz9bPW79v(P2x>9*nF1ns21dena+#1W3oZ{*ijyQ?aMw}&n^&SU< z1Xdwn$d9yKW5EGHrl-lDiL_@J4gv|ELhwL-){7WvaFmf*Wb(}qYId~Cwv8h#IcK=e z9j`Ko1A$DGrh7baBw?*Fi%oYU;7Ahh6k>nT{3tkrl7EkDZRKZ5dLv1u7aRm+s+Zg} zB|#{Brs3!#i#*8Xn%pvh1AwgbAb-lZnOJeuk*SUHtF8F^9Y>tRog?;pF%8CI8)mc^ zt!c3tcJ&KCxLH$Zo(kN|r7G842T#81UBOimkpE-_HX!r(ktG?JJ}um=r3%+vvzBl5 zB9FXR;QfiC{xoj4d8Q6F0~~c^kp|Dy!7PBIjxQP*P-1>g zYBGA&iktW4fQ+E1qrLKXR89Kz>%4jG%Wn*NIrkGoLlU@}pE~jWaqYjVMp!Ba$K~f< z{v+zf<;sopN5-EqQa(s%oz>p?i8_=&q2PE&E!PY70sNz3fcyEQoZCa*{Ev`}_qWcd zrGy$O6s#`9;c@4BNI^jgktbV9$4%b#v=;(B6+(c^z@fyPD};l|i3D1Tbzv-=+O({KuAN5|*E`IL%)B4rND-69O zNR+s|rQ^Tb88U6R`K`}ZADuo!A6?b2I^!dR&4}NJRnDJ$y!R#TsEJi8Ki4NZ_Ae7Mudy^XcebseY9o5C|ccxmDOGf|70eIic&q1*e}~ zwD$eU1L5b;ICNyj*cnu&>fbc&rUeJXc0X9o7D)e_{cV;vqmF3u*Ib`5NIT4V=FI+o zM>bvB_t<~G2&$GHUwc;n;Xf|fQtH6(-6qbt_vYYfrL7^5g%Uq%Q-vzBpTk1bofb91 z|ICI;Cg&?X-krPnL+exa4#KNNJN59Srp@>3=B``(QKMS9^|lX~damX;$BvNsqo2|R zF1&wl^PTgp8*4NJ?*6-R4f&77r;qO=MOo$JiEp3$6VHxDuWvWxd4?D}_WPpi+PAj! zsZ#FwE)6s1?wDn+HRXQ(o#k~*+Qe4X`<3wz{bkRKEm|LLe14Js*CqL_D4zidTKDYq z4OR0hRLvdJYwD)2;vd`9W7bxX$1rmCwdrA$bV5+`^Dq8q?M>}t)88Mr{MRu1w%pv~ z)lzotU=abKzx?vcb1CE>h~%jw`61;Fblg_N47L_uW0nu&fFbE9~t*^i#+;B*v)mDDN}^2Du3~VB`qEuc>vIE zUZ+UyPn&|;|6HZ(+@<|DmHz&Tr5XAk7S}GI@C)X@#$jtu9nozFf2P{>CDUfU^eu&^_p;lGi*>m|!Yi`b>&eC;LLCL+$`$_AXYZLBZO(*N&bn4_ z&4XcyJEal$FY&JYq>ZEbt2@H#< z{m}L}T57IFckt6|#}1vUr|q*Xe%1$N4}V*8>%Ff9_C6?c=tRRA3AJZjFCP@M>&GbJ ztL5v>`lQc-ap4*3^wHX1HhnxIkyh@ZpUF6!S;eHStcnRKU?LU*A%AFe6qYUNZW`oI zYGgYdsV(7ujJhM3+7zs6B<}SKS;_vOF#VN+4vv=|{6>NDdEiPBFjTe9LB)CquX zzpy(u3pbd17`S0Z>_QX_+#yWdu5HbSn_4i;J5yk@9$fJV*3-&6dS?a!%te5RM8pi- zDk(i`@DN{!08gvu=$#qZnd}FrK4J#U+GpOG2KyYiUUPg$*+bDZuS~>`Et4Qz5V0QM zCUkFQ@0AH?*ed}spNI(*FV5y2>}=*kSQP?0_$QMLc4xZTD70*Zj8I0=9cAw`wkU-N zdIbF91){x!oy~fPSVmwcu3?)wBh_a0D(l(19-`6^@JZZf5%|4H+fQ$8A4nu&RC6Lx zjSpLH48oTMJ5u$mw2TgLe)&D8fap7cG&G+f#!Uwt$WfCIe*7~&Cx zz4Oq3TX_jEt|*xY4hMM&FjNLshQqDB1Q=rA5P%`TR(9ybLIpkGe)872gXlKJFnjCh z5nm2@x$+%7&wTdQ>4Pv}#V~v8077b=Vwk;k28HU>fBWKw0$aK3B!c~fQ76%L32}c4 zlv>88T-O8lr=Tb$<5Mod&HX7*B^aM_iB#@SL6uj=r(BYb`%`6^pK=Kx?oUCzUIr?c zT;TpxdFH2F$Cdk2k1;<5rwF%2A7_5bW$WTbRe|{_m(hv)Q&7u-!FHDki2GBOn4c1w za`c!gK3KCFaYl`eyKt zaZdePD>|-v_H9G^1|AYvL=h{iZcC*{GeYACk^~*$l<^VtU~I+FB{9MXx>SD+j-r%X zd(;`9{cY12)8vJ3Jag|W%>pWGnbvU}Rgxxzm?zDtgCi(qYjaIgW_-g@lS)uV^1DhY5=b92(+Xo1R)SvQIY1V>NG zs^ywnajQ9w6v>+g6RR3E!b>tuh(LJ@hD(x`tG2dh;z5OJr@X|a1yO)_0Ft6W)f%SG6hn0Xz{T&5L_i&rToZQ>yG?8UwZEh`lJ1JE{x2YwOw6BX#OmY1y z)?_g{d;a;e9wuwL`2R9de$L!q?2rPSWPrhsD&?4>l5*+@!+_BSP`4Q4{Qp*j>;C8vqBK@`GPg!miJ z-1%K~NN~xDkYen%G!8`fR7V8QQag$2DH#lCf-JeM)aDT?+ZmE=!z~7TDCun#V;af4 zYW;vJyfYEy;RWj1EI@g9H9=8YunDogBc#q?B3&wJAkRcB3`PWQJ%dh+9mu*&NBS zws2cgv?1A)&c@e)iBBm(DaRLSOGA0mOtc%46AfvtAY6#9J^JaGSm3_FYHb5)iDd#5CVlq)hSSKVk0>rBTGhDf zCd%0+nvA(>-+?a6E|fTs=JgaggCl{gs7;lBIEu(RuO-~rINHb(uPhZ9M^y4)acvq< zG(`9j7~m2CZ76Q?|8aP*LsW914a zjvTU+gv?HZqb51axR@#5MYKB|2LV|pwzvftM@n*;aLtygpW`SZdl{5qq{Pvd+<{!P zW$QyYviQoo4AmM(7TGNU)>dx7$5E8rU|jt5Waq^ZmRzk|go~R2aipZ+2`*CdCnSy> zvOYS~7K5XT>~cYKw%`a#ZcHw&%Iv2&YRHQB7;`%gh!h;bHEovn5l0l%`$7jj7g4&o z5l0f);Q@9r-6oBrN%&qxcuMu;?E5CGZ_Klg;8H3_G$YeGV*O^%G#i7aHu-`JaRHFe@H@nBsNv8(?R&aar zcvvRL(YgEj-L>?QyrDOYlo6n_eDyaOVF4#A%^M#Un>VP%@y~kN!{BQ$@>RJbIn+9a z`qT*xa1|W z_H?GSY%xxl3SYJ&d9{(lBK5jqP74yS7}El7vkUGpz{3(DV8YETz;rby@e)YTJP{y^ zH3VR#u`A0(P;d|crG^Q3bRLT;G1i!zQQhA@IZ~tZWm7#|HWe}#2e#6_cJqIv+;`v- z`CH}UB+#wWg7g=a##M;?8KNt1 zSKeQl#lgv{qiZDNAS7EvI&9Xo6ho3xGJ7$E%2d?>Li(=T?I58&0-=` zN)wSI12u#+!AAsmqm| z;_4TUI5Jw2U%kh{K!$Y7kF;E4!2v+VGRmKcv}YI&0x~8}e%6Z^X>gR0A&2tK4{CO_ z%eIXpEjeen#0;-8hy#I)s;7HAa3qPN2qD<%ZUh`jWbiD_kAfp8`S-ZiR(__WH88D~>uc4px4(6@S0uh$ADLi)kQ}z&T~?+Ds5EK?HXvDm%->=9v~aUV#^}qp zdXY!oEAalrQD-MKQfq&DrVcg(9Cc(yk7w#&7Qj)*=byN3d6!=mN0wyUXjtLbnv;z1 z>y1G#=YC>nNCH=J;n#%LS?!&lDA7vrsR;$gJ8HRP!~^(8!vOd5M>)5Ly!jupl{LDj zhnoUB%%8HjX6t@!7IkS?uY!zlFDTEv_b?x^(K?faTY*v_pH#T`*odn zsL7SzM(K6BW$EU4zEE#pN6g#f$m)0sbY*mwtk1N+xI$oMLC4e>4hV$ub;K-7Iff8U zh-SU3O8_71K`C~t90dLjMw=>cwQ+MbC*YfbTe00o4c^rbfe*Zt2WCtb>j8O-{dVTr z^>xG)>mPY_J^VtL>*4E&Ns)}o$|5%NeH}5ghK&BX`|9kh387_A2%3VoSnunI>7|<( z9Bhm%7hgxr;w?PA)s_#JoCSt+S^LAnJW_A<o;5-1DUs&Cvs+mhkfAOC|IG z7|Lrg)MaG>gKYo-7z~fHE#d2kDcxc4uwsZj@YgEFXK$T8FpnyR*;@w?LJkze?5#6M z+=_qyq)&mZ+)d5kBrqELxh^5@Px(4x^7oSSb;RW7m9HaarLe3S*WS-;5mR;9#g(V# z+&z$qJLF*8WgK#sp_coQ`{V`x#`Sg3<>!^h4!X!Jd|yY*Lgk9DK_$%yEjlh&ah3p( z$^>%tkb@vc_p+%jV=IoX6kN$g7Yg>dSIKe~dWLytD#aXeQ4}KqNIwr_a-_)&<-Ucw z-&m?rBmfsxno|eISSgB)iy*0+U^8c=+N?t5ckJ|}&|EHRlDiN$DJgu5iwp@-D>5me z=s0#}QWP#1Nm6Ff)mZ>bN{Zp;A_YrUv~d8IniOHlMa|7ghg&x(0Evqh6b&&tEzTkh zBamlYiZnc|bo#OS-SvY{2$~dS6wOMd7Rfi+Ji~j6E$xKq*r#c!B zT^|@M0)1EQ6)U0GJPVlmTgg+UbQUW0cN8eyzK)m}$pr6bUq?)O;WOAvzK)p8vT&?+ zK&-QWk0~m_jn8lu<1SfJ%hJ~olTpPF&bhB6W{I^9OX#n~*xSC2m{0#* zF=yB7->=53Lv0sy89Z_!D@s6eV{&m-WJ05`$+vb~xT)XOr~6{cdr0HyU8)QH>D|sj3rAQE9vCoYM%2e;vKy{CpdtQpQC|2F(L(|i zf+8f_axD0#zU%4(Zhkx-HnU<1A29*(BO-zNFS-tOgZ|V;zPh($>ms8)PuYI8rqkTi$71zSP=vo%B)hDT{ZXy3=EG zOu@v??frX;C&lS+3raTnM;R?n|Ijp>#Xr($NCOSrKip=q*sT7cPSQxppCtJi9Zvtk z;xyv-yO_=C7L!$I&f^+^&x$?X`k9>R2D53TFe)JvKikqU(rGqnbT{{WH~qx!s274S z_Fww$#d8nlp8P63pU55UiW3KOYd+U&#GLTTFP)oxV}I1w zlfPlVWo)TZ$J%SBHtTAf^rpGdv1?I@`nhM@#!=P+R;kL$u}$bBUB?uZJ@$Tsetxri z44rgp@NWgTCy$49g*58BuisruAITef!$=tcI?GpolMxnhveLZqVX=9GS{(nZr#*~p z6OI0>az}DLtongt$ARt-#x}X~*n#EdHt_Ru8hz@7207VpRB9R7uv^Y%eXHqL0&+;L zSooX!Q|*oDBU9cE*-RhV{$ybKmF69@Htg+ua!sW>8!~p@4i>*QzFy_#?jxagLg&)6 zu~pnh#J`zyW7O8SQrlgQnHF^~YjDKw_qKg=07hVUdvtf7ua$6eg|T!%=^b(N=hf@h zIrwP(E5eG)sxBtbo$x}NYgXYNNZamyCu1#TJz>=fTHeJ~>SR~fA}r7ysMK&-)`ClC z;-4L`V(E)LohdC_j1#89SDA=7;>cl@{1e!a<^|IN_oZnYY4HZ$zOGc#+%+}axyeDwQ$>)wDH^V&21-LFslZ*+EC-Pzwy zshaZB`uQ5&=pT=aRk41BM)%@qUxAE{LoT*4JRh!q?PShrisXWg!KeTtJgfG{RUPHN zL?AAPm%T&z7Hp+`?dJbT8G%^op4Nghlo1dycV3MeOCMRZ&AFXAqFeP!g=wo3p6}Yd zZmezN)QIN&H9Ifq4(8rGawB?Sg=PEVTP@cOIGMO{_z>X~$;urhBs3gT*4?ZOar5AT zK;{IKqX5$SYrijE*kyTY?|lEnKC=&R+@A9DsVxGYU8lZmG_OVUyDI}1jL)n1^)DhG zu6#O*2p3&Zy!m?s8G@cn7UQT9%@aXQl36%1k~fcwiN$0$juLrpz|!U%^V<;_tsStt zUqaTD^&Rrw`(jR>u(U@lfpb=mOsKfNN5hEMU!Hahe)r;$(~XyR2+du$B);|hAyanl z`KZrn;diSae4yEE@1Hnv$i@ZPw=84fcVmKgHEnFXdivOwxMrJ-Rh+tw7jlK)tr4-Z z#)qf-=$C#!w2Zx4BA9)2k87H)|7>&V`77)9%ipl`^EKm22L%hf)~5WF+iG|~uQD4J zZ9e?Oz^se9F4wQ;C4Q`*aKS&i_ROh292h-1xsULxrMOc5=q-O3aks!8Rw9{F*%6{G zw6L+W&0$J4Sy@q%8qla1iHJ%?0n@t^vA9#8iN~YvhgdDo4XRkU*wLg);bOO#VPOhk z@=B?lR1A}#bh?^xurPIIVp3{9i8iI8ZOa8;G}L;h=Ot)*s}4!dCTP%hf= zW>y`VoMU2*+%Oa9hb&lj)nSRz%tfU|Ka+8|M^Nx0WL$|#olTCOS}cx@P#v6Ha7gwL zsnZ?{->64`kJeq2g)dWed`)DcL*ieAHOZDtticA01#ZnEm= zIQv4g08UjMAo%>;ZinJsc3H@>n8=h;j^xOSH%Vk6TgXJFp3IYuMWoGPF)*_yHA_?n zCqEDJmccC6txz2uZ(my$!quuHlhT$ZqbyZY*0Zeql-*V^(-N9r0d|; zSgzz0SHEz?Nt`y~Eb*)NI2gz*UHOrgYb-bb$n-S%Gm-WT!$Bb7Q;4OIpYLoW#Ne~L3X*l}GA`f!8CbvxB03a(p$e%K9CRQAEWNM@Q zYAgPJ#}OxS=ZO7YOoOr5h8ZnJYg%lE9h+T9q971t<-4Bdsld%#s&dVB@Z`JR6=4 z#L$oguI8ssynkH#uc{H2iotRDxtITlx^cO3BUV;8p>@38fjWY`>uE0pdMbnfmw`ix zIade=lM@NF6zjrRIJIe0)4OGHXbPba;<;FP6NEh)UF@Q3FF!<_6~gMqmUJv(A|Mq1 zrOVuZ?_j66LmfZul(=YZ;LcYYM5Oo7lT${KW)PLh7y%4_;}M2Top*Ta*aIUkk{7-v zfAaC(m$aiMR;~P8--yr04ccF4gYD`9-SHPMw=Hkq_DpVB{bxB9rbc%gs%Zd=+xcM6 zk3VZ#ZpFN+z2>fcCTQlF%ErbzXZ@|84qdY6yUV*`yYESQY+TiCx@`Dxr;&RbYoqHr zPMtS}XMXU~!u@BW7B$PiTzj5gP2Sq$@w8r}ru%s-6pIx-}{mBF2=g?hqWX9MTl$D3SdDFC;7C{Sp;$S&jApLLl zw^`ndI-<#6bA84j?J(z=GyDG?*>q{&WB>gks9JV>?OFYY|F~pJsRO@vn>gp*n}es7 zwuV5eM*OHv6{^U74hvCtTGR;tGaD+IoUinFckbd3txwrI2s*ZQ>fuREoA1}nUAOq7 zMzwP5Z67f8T+MNg9U=2aKcx#?c>mt!JLg+B)@TOY{deOU@*j(ey6+=JS>@x2Z=d`V z&yGf~Z#U$5h8R2c`=aaGx3=`DQttUK4KwHNm}Rat<$nI1<#kNj#8%b&mGKY#WzUN( zS|4tFev$syCHbu=p8*M4_w4iyRr4xT%^lNg>ZY&aAKTSq)>e?mFmm>_>0y+dJJ5ym zFaBrkP3>dT-ygU9*D(9G+}z{UQg-cN5di_d{PN3lDdZoB|Hr(he#A&e}J= z@0s`J&D#ovv*{B- zK1oZxp4b-(Twl6hU#R~C|Xo?u2Fb=e4=d z9TJUpD*RM)yI^p|27berE()0x*rP*M=+oh)ohd8Y**?BC>*At>3)!{mo^RIcNqA(E zVgu4YefFNI(dJBO<*aM<);t)NxKkQ|{}S)YPue(|zq%u=PVV~b-XA7)eO@>ArSjk9 z^eo%5?2^cn6E0jl`)=gu_WHWR<79O^_ST38GodbhNqoS$V?lejmWpdRQJd8MZ0_+p z;-@E+Z~XJ7)TroLH&-WwrXSiKN6TN;=nj5*?bxAH^|XDq#n1Yn?BQ=~ZoT)lz}^RC z4xMN?Bcb+;>*a%DcKsM7e6@VNS)cS-FfKe}ojzLo%chS%|RAZ!mY1GjQRj~YA#;UU1&iXM7r26iUu~-%<8ZSvwsc?Ub2`4D@Azz$Bl zB!k_VZZ>u|r4CN>)_uknr4VM0fM2|d@}p)wg!Lk@6aT5roRMm?dX@F;T@RsK2>2v8 zvIzX%q&KFwwhv@mFiIYg(7%VR$ptaKf^rvY96^fUg*qIDjKY$4ux}aqUTLPjr}3ok zF{VLG(8TAiYKjpDNA8vx6N-$8lL@GBbD22-S zluOcaf2u6=Q!W9-{V6DF%RuFl3*4V7&-|3@xN?8$G3KY>6ya9zaptF7wk~c|6_}rL z8J)O41qB}%Y0h#xwW6(k!5|mT4WwQ3dq^Gf$dR2SeGrr-dNp%{ym@2soab$>V8!;)mNe)L+D#^e#v*NaI94V=w2Nx-ssTxO3O1I~t z=H{fs(UP)JxoA;5AUJwb>M0k!;#PAUDUw_aCRQ~HX_sW05P|Ym)s`eJR{?6z#DfZx zBzcKT3!(t=03>ngZc~7GAd?Fpx5GHB1XSwpC{VhG+Z^WP-ZrO+EF)`k zYuVe0U1t_|=9^j)NsqVq#1z-RVoesKv*({b>tV8{i~lbZ<>$=(#SSUJp@jEyx)lm- z6mEOyVeL#a2$2zVVX3{SIwbN&GbS0#LeBywYpyYIfIor}rhsD&?4>l5*+}YW_BSP` zLFsx1OKzwR1y;#vBE15IuoWTx#xr+*R~-^uvLd7yyDg0a(LL1>!L!s(qIyaO1DYU9 zZY#BUgz|5OWZQ6y!5&H)K*g9wGOt=cpvt)UmBIr%$YdQxI%0A{0#B9tkdjRf@wzpb zIaUoMv&xX*wsi_D>S9ecj_B-$jwJy6Kp3kGtP03PSJzpOC*QBS>R3RDEE6lpHzQJm3 z18Iq60u&~F_Wp*`$fl2|z$9ALxJoL@*(REdxeCOAS%+Osa3Ia=DRKr!0$FyND*td4 zk;PC;xUq4xk#$g6Dlm?y5^51r7qT zkTdgzjH4>q`ne`fdCcJGAl^gJJ6eTwp z7e!BYUL0Y`)yhSaP3h%;?5II7525Hx2Cj-cemJ5Q`D1ug3T{sx56c8OI(J{cyOutZH}r;)G6Hm#ul^<@EZ}6N zdE>)k^9Hpz{#j3Z7<>&zzAASlhg!!_pE{vIPWBs>T1GbPma|#kYWkIc98zT-{^tHv zdn5YDl($1R(?_;H8JJEl_&dH{<>u}qp>{&&(zCHu+($$Nb8d{<`c`VY%Q4fU?qv;* z*!|wNZw|l+adR_lBScw4RM$zMTWpAbgqh_DIYA0mrU6quV=9CN51WcjUTx&CNDX0_ z(}IKw#FVI&C6J(bB0v_an$JpOSC)&Q;2;1>T?O#y zJQh`AtT8d2=>GP}ks6&Zo9f}RsgSuiu$A_;oBt!_z5|!Y-zpa;fo_!+q`#;%u0rJB zz+q4$s+%IhMQpsW)Z`u!q=+9^u%}EGai(N-WT z{Vi<{Q>uv>NvB~4Kd@cKI5Z?r$n^wi>2S4>WVjeL^_kpZ>wY*qo?Bb8aIsyFO5tKR zr(%|e%~Iy#S?cUiC?#uOb$hC7e)rhaa{ zJ6X`oszZ}=Of0ArW+K)BdO(TBt~xBy^<8)u3J0Peq;hx!m8Lo zoUA&!MludUvPGoBW=%^mBpD^M7elB_RUIIt@4DTsVqe)_DJjG@&s^9nCNiZo5jiqY zLrCY!!q(QTMP0~5rj$M+mwD2$C;{9O)xpWnL$uLsOAvk_Dd#&%nwI=aTP z?G_Fucc&@E#D{RT>Img}Nzq2j(CV1Qyu3#Y4f-InpzV9a(4ajv3)<(ZLz6#}i!3M; z7kf3IV>)hd3b4yGMbf&MFsd-wbHEb}b;5)>FEi21#v40~jMtNkH~Cu&2LKrlS!~&G zl=p0FC1}X zv?RZJkAr~>>6Ra9xyFJ6fQ)67KND%sFdPJAOq~3z>oS~>AZ2u#oQ2gzcm*mlHv*0%GI*BeN5K)4{Ciw$D?d}x z8%Z*~;28I6}XurqkiSP-eqNqfJ&oQU;~l`$ow6qPYX9|cuQeK zs(h;#dE~tU?@t_cc0wby_NQm+U^Bo`M`rYRrVeHS9CdvDiQATU`BiabNdTvY6@INb z$q2tr47gYAxAG@Clih*}zb3TKYVZ6+iB^J7O(;0tQOl)pJ%E2S3~-em>$WQ6xi8IR zV!Ee?n*uw`pR%}S>waw(b!k_xgSlNVL1!p^J?p6_vNc`4UzXDM+%NxIcw5)vYVxT| zr_K$iUc2w%%vCkpp0`G|(UJJ=c87M)3Vpg?*LjDUT={L3UZ-1@ZjR>*>h|@%ygiPr zgQt*IU++t53=X7vx#w4aUx3lhN!j+D^_fO4S3dy0o`0bJy448s)(ireGXR^6c>Zgj zcwx`I@4}BPANKX0@GE`Nsf*xNR@Xc1XM=Y&KHz3Q+!3U*moZta{NpY5+nMb5^}ZA< z9eH&<{6d)P;p=@#QAL!MrflZ>dS7M@8U1tj)!A7SLd%{IGzD+5-q-umOS%NO(ir(H zzTTI`n{|4t0Us_63rys)Mu&wNqu%PihfB-y062)b=SwS^jR)o{LC56F#`6Fe3TZJE zeq{lJ6#xMkOpLNE;p=@V-C>ZC#SnSmnN^I>-a36?2vrQTw+FGVOcY-y`R}4rs}ebD^Jb2dms~c z$icYFIOMLX1l)(*ColLnuCG@vKd(IY%0=ee`+8p%Dp!21D5bJvk`Y>TQLf@l_9re% zK_c-Hgm6ap0;w)zD~_%dM#LGw7B}HpF+9Ci;O^T)DqUPqL!)-<>)QF1~lm{_7EzTmXAqwL> zcu$)YSHwjR7VXdO23R)wdS4ChJOS{C3ycTv=FK1~%xJsLpWc(6$A8)Z3>26bi zIJOm|B={8|j_ph+Nfa*P9*m^E-j^kBa!IpzSZ)Uu$~)d2E?xEyOBuVvh-ClART5%V zpJgQi!sDG$4S?;o#;Jp;CWGfzs{keOc)D;i_^5?`L1{OL_q~*h{|Nm(22btj0gA zvwx2%D#4AMk`9j7~m2CZ76Q?|8aP*M5^S<7f$Xs<~rhIV=Fm5R&w>sC> z0V8iw$Mav24#;XwB^W7jvz6R|T(f2CLpZYd+5-&L8b=nCzrw&CuGvxz_&AD^8;pyh zCp#~Wu;gmxB1}Rxj7bLbU)jG>@B|krU+>G=_4@a#G3!v<1ziS@T*!(NkldJDT$R~R zaoYu1^T*fwaNcuasJNkDHe)@!N{k%^vHEVPyyTQj1sWY^%CEwa{;ii69pYDq(?;+p~ z`(3IF{psD#K?_G%4jvdVW=7PI8QQ^cYa0BhVinB~f1Z5z#{e6@nrp+j29fc+{Cf5Qt*M&kfIU zR)HFYK#?F{eo!R(56XEtp_ytp6q9$@%u3-P4>Nuoo|zM%6eyy#@PncS1}n5mL{Rbr zkwSPCA`jFNBU5Ztm`6v99}FB*OG-7Q;F-d%sbTOOkFCAFMhHK;`# z>o6pd23BUqYES-ktyogSNG3MO`L@84T2Ugz|;1tlB( zql^}(e`uP`;vZ==q=5$RA8xZ)Y*znJCuy1FPm=tM4yS)%aT@XaUCicmi^(dq;c<;<*QNPkxo2Pvnkv z#fgKtHJ|G>VorGFm(I<;F_SuD5IloSW|P%uaKsoacC*o;$=|TwGPYEyW9_w5n{_o# zdehwK*tMuc{oJ!{<0xwZt5jv>*e3Lmu44+y9(%t*Kfl>MhE6&)__u=FlgGolLK^km z*YB>SkK_%#VWf-zo#m^)$p{NLS!v$*u-LpoEslTI(;h~)iAMibxg$9rR{g-S<3RTZ zW1C!g?7(t!8~AxSjXrfkgPiO)Dz%Jk*ez$XzSZVBc{^k?ePsKS zf$3M8cg)(bxAVz0mF{fF*m*lx{Mz_>m7BYdgxU$VOV7quaUT)?X3mXKTi;4;cR6NS z)V-|15xd{p_RRqpA(6`rvx1;Up0AZ~a)q&UKPROCMnrNo7~pA}r7ysMK&-)`ClC;-4L`V(E)LohdC_ zj1#89SDA=7;>cl~ZTd)>zQEo1F;LobTgz)v>1Ut#z^0uQ$2#zZn|c ztyTlhW`;d@W@e3;TYH0okAA;z-5YRYUVFyB`}K+cjn0m%JNx@7Ra1UiKVPF8{o|3b zD%P*i=w2M{E0ED~$i+5>=fm}{oy<8+kx#HO7!^Q-McyA*b(H%Ofw&l6_73G+u$A_; zoBtza1Y)IoS_{rlMnJ^ec{OS*ePq!#=XUCdZq+LlrmaqRzH9fov9^s z%ktFT`TmK0W*^?TJ>}<9TLe72PJP*EUW@2=R|YN^pI7ngUqn1y`E(Q!F1n(4^Y;ig z1U;E7#!(}hCxV(Jvv6c2ZypyDi^*;rCGy;Wi#X?)-;T&=?SS3=60)YO?~wQ27jyE2 zr9Em1oU?jlLdEqx8b-YS^0Z^{yBCj~ZoIrhXzsct@vY|%nX+@wM}1BUzgzv_1I=c8 z|HO$yHZI7%Wf=><8xy>%X=CHn)5o^NHQQvY;?!-tkSqLdjfj;sK0Mt=zx4Z|W$e`w z!R(`ZT+?*@XPZmUUs=Cj{)U~OuNhZ5C|KaNHsz<>R>K2&mD#Xp^Wi53W?j^Exqdw_ z@nijj3;xlyXHNa$!06G*eS}{v#g$k?Z|=j0y9M^J;%?d55n!1{;1O-1g)N+I4pXYh z%8HWIfJTLm0>+`C_aS0&r#=%8Tld4^@!X1vg^L|csuV7EGZ_}95GJpb+DXMQ2}-A{ z?FI`|XC@|gR5@<_M4M942IYb;8fv}M^Aa?@Rfi;J6Ex(37d9J{o{34RrIWYDqBRL( z@$6OA@yYvE$y;o)&?T#m4oq{xb|-C9TMGYGq*ERX)?n3P$(!)F_1a=VGpi0w&M~n@ zZkP%5Ll!K%>afIU=AzP~pUF7fBPe(gGOk3W&L&6qEEdN`s18mpI3#!k4K!z9ur!A@MK5nq*5R)?kCh0%j4$g*9GvjB?>CZyLx#H(7OboE@N90H>-B z5PW`aw?pxMx-4W_Ok_$aM{;Dv+aa=$Eo357Pv%L-BGTrt7?_ErnkA}(lb;89b6^(h zR;Z4Sw}UMU;cC?p%Jq_>jS-Mj9MtWEPox^MjflZA%kE zYmnKcl5>XZyz?r9xcMU!rRg3I97$Mf%wp5s2so0&JB8R^G(QTCpyc1-P?nd&7sO-T?6pJ_Py$RZDNxhA(v-~b>iJ;$-NTMJRWaYb_=BdEVT&i--b@1f7-W6OG0r^i>U;|R9BTF(c zeOkC#!&?f&c==W@^2mDy-k&(?Pb*0sYz8>$$RZ7%=MH889Cdt20e1tUT?i9Kk|hD0 z8dgTF=AsWz`bg}l|Rv$tXJy9`^UBasv2Rb z7#x?Md-;#38<#6LVr7LBT4%L)exk+~a ztx`rU9F>R6sHKD&DHNe@P>uE0pdMbnfmw`ixIade=GtVx8 zmSSBP3#Slm*aL`7Ad5p&2!#;O#mbu?5H-5kMb}<_h&U^R)r~FbSi(d=DE>>Ax&Pk5 zPH~4ie%dK<(b~YBuQrHC@1ZB#oFdI2Dw8n+82-j144FE==D;d_S7deoPUKHM-usev z)WoWlpX(d(`M5#*>uj)HU7$Pu;^nsG?c1KoEvx@5r^3|eZbLNSOw^)g`IjqwI9}WTQ0Lq;eTdBC6n`&9`DXw{Gs(Jdj~&6<*fV=;0Ttoh2QC;+Xq$sO=Jn`+5f8yEE==JS} zJkJng$9`XQUHjISK2^#+-=$&Z+#R#bwWi$9zq7oKNt@WJdcQLMp}*{Tu|?~{jn6OA z|GFf<73DJ^LF=BKzM*Pfg{rw@dQIK*Rs3VSdd%7i@)$X% zyyNhKH}qrn=49SEdvEf@wxOk01s~Gi_{f$!u%yMKBM$)D&Fd7Y{b^HB`=6_Hox8OErqbU(u{1;f!{XWn6n??{*EnqLsUx}# z;m=f?zGT|Ww_Z$`liRINpDnL{`Kx$SHNT*_Z|Kqa-mIK&w^nRDVT6Yzys~fShCS6k zT^d{vX@9F){aV{U`|$&Dp9Hsk_DRYJK$`Mx?=}t3FBmr|G5q+(UH$rg@?Lg3aj`B} zX!sK4Z(!HG{l~;@lo9ya?lDit(!WObFlFjsXZ1~!!WZDBZ#8|J)^|32BFHCcsn-+x zLV@c`_v;JwKSKMK_qju&wMd1Z zYHk+{uGqkD_|ioolLC8m$O?TrytFfAMLXNaw`N^jlyD)tR^9W>dOg`VQ>Zl{T)D!( b`s_VZqs^Jn%30Uyt$8pkai=sQ{@4ElE~XAa literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..99c5a3791b8e291d4b3874e0e239db55cbd8eed6 GIT binary patch literal 18458 zcmeHvd0bQ1_V39+639T12!Q}5U=al|3^E8}5-_5If>K09Ntgr;7zR<0Y6c*vpkY!F zTfw<4T2QLu)FdDxqD7?^1uamd)Qc9;dYx|XTPJ|p`|Iz%d++D{{&?^8d^|bl?7h$0 zdky=$*4}3!f*=Sk9}{}1bD~ElpQaw3^!eX2qRzE+6fc{J`D)H5t`j{3)3!aUwwbhY z#Xh9vQbEcL%)Q8%urK5x3-iC(`K#RWoH(*Ar!&s~o_gIUzXToIqt4|MZog6jT{r@R z=lpfWl)B$^1>5I+U*#Te_}b9XJ#)MI%g?8_7F(G2M}1r2{-kZyHgW@f^o0+8Gq%WO+^CeDMV6`sZ8z=KXHpHoF+E>^pt!;QqIZ=Vk}; zd8@s@xOKFzcvsZC$}iKuT)b)O$H@OsX$#sJhIQhh$L`hze>s=--S^HvuADn6+V4A& zn+q60bB^|(j1BdC-JH4DJfh;x@=UjR*B7@mn8ZBmtF4$tdbVV6OP((96cRbr^X{`h z5HTM3v}|mlY40;t$-`m1-ONnxmW(s=ve2%N|84oYl#L%->{)VwzpH<0%-rFC2!X%P z(zo}$FLH!8t=bHc&wTD-<6cwE)NlcCtr!EyINhSXct)!@Qi8$>KyGe?Yrml~Uo1dC0j!hIN z$He`!RsrI4@qbglenYx+Lpp+)1H8QC{CT{dHFks2qm37SaOHn+|6eB$f~@(V9_?eCK6*t@#Xr=eZO{Yl4?T~e z4{)Gu$LsV3V?QlpSJV#N;Y8bk$siBm{1s00_&Xe^9Nrycb|iy>7?2Q3mksB5oAJKT z{!zLHa1!8L8paPBnu@+dKsFm8NI=B=ARIJC`R;&nfxqSfhk_ufP)Am<^>j_4jwrV) z;qq#h4t*M+PJd8~l!FnblmZpqMP^r@Jz|NX&&suBrKfY6jb1n12|ta250i z($qzEO(FbHc|ou8;dZ>YkPr&Sz8q+>GQWJ1lBvrad<-t@* zMZ}D9qQ*)mw;rgrLKN1mVw-_#Y7gJ0Rcv)jY|~mzZNu2y<5;y|xX@UY=|Gf8RT~p< zX=;@;0VTC*lPX&dm5{rYAVnf#8@L~BVZ-lFnD0+Fw^%-`T{D>Aw29*>R|&OrdV z5oA8d8nppag-E~-BIOxkFvvDGg7|>JxZ1WDvSV}cC3c5$;OEDjYBgg*(9QyKPJa-+ zw$Td1+-DKEG{CUr8*C>7gT2Mv%che}Fs6O(LyS;ez+Ai$!YIcuh3veFdm<2n)qvQh zTV~dZnKW2!(+`Zw7%w%bt_FLp`{l-C!NW)Ch+q}m8V7U8&6xH$-J4i6)z zd(KC>{1)4Gif-bAF_mMHsl_ts?pma{-%Z2d?1^%sabKO?bx`I~z@;>jbkhCqb4$6e zW(XoAv2U%P1`$_eljheKu;Bd$h0CZ6S~yO(D`4s4wtyyK|HbyS!c)NS>hu1ArT*tE$*CpAji-UxmKn% z5+&hDfibcjrU;p3G3UHu-|axt_8`{BjDQ>kSu8{rR8nVr+G;<-8Djf8UzF@Y#^fO}zPR2hH|yw3|b zs>?wp-$LI(WSGOP2$G-haVche_$#L9Rj?o1*@yTOgAhvs4Y|1B5JrvC8D&v~9PA8j ze7LyNKhWY=V^?nHPy@mc9Std z_Zf6XG_N>@$A-@2ICL~HqojNFN?t|W{?(}vO5KEF|G8KWM0SG)i07JqNG(xF4?UGDGQf}7MSm{r<1yG`M{ zuW^Q2;9cPFRjZs-CG#$^D!}>VH2StFS?vPv9^C8>rEjUyN-c0`QTpci`wh!ymjb;; zAD~f=^SR*f)sADyFxD?I%$IVTLB7u+oNrs>jCOxNjlXvl!o6+rpVPxkAl-O#2n_1# zRuf&c-H&Tb2A1b{@b`WmP!J=?iRods;fX(LXuVwHXFY^dJmZlN;~#m(zp{-V@@NM_ zj0Z%thiv0)5&7p3+F!Zk5h?8(F8Swn+OUT95F!7fraj>q*QjYf$!O1ehz_#PrUaXO z6!hB;x*1sO4(_*t+FfpC`6)pyQi>Jsis*>vySZO(kfl~-!DQFZ{Zx8x78lSJo%kyQ zRjFrH%hjs1m$}OWRT(m3hJ$LkOtrC!7#^rf;}Nrlag4wjB}ein*#CVlX-8qfoDJ&u zX(m6Gt9zMV1coMPEtfV#r#<5uCv(Zq*~Y(eY0pD|FrZn6%Y|J zI(I4_yaR5L*&yHM5rDNGyIc5-F>fU|mT;_Fdu`(RHaB|BgE-cma)4wT5yz^ZV|A|@ z+FSK&jYHJI3gHCG3CagH@ryd2Zr_wBI}A1vZ7h;Hbx6*1V_-T11ju9Tef~YA87v6| zI9H`qsnRzQ0m3sxx#?cS^eWYIo=VDAZ9Gey!{h&ztDnB3{Q3keSlrIIC7LYaeb_JIukJ&6OX_Y^&kG4ngUAGqm^k_c+Q8B@s83tFj>K8RG?I z;pK-cd~C!-S;#?Ii0MJvN(ukoq@t65rPKP~TcF};(uWp!Lt(LKsco|hM~9J8;-i%i zfJw_$nNsEQDq`j_RMs$?QrX1NW5hJBDpgJNtIbV!P;D+Z$n;W0$#OS}RM}ptjnWTh zQ0bZl{|cFZ=8${ad3u*;&T;Z^-SSJ8)wb=V8;M6+mM>vrnbEekhSuPaxQOW6B6O~9 zHK^UG#s`3ev~i;zxovUeF1t_@t@m|?H`%B?4POQE4{ zydxr_K~)yCX(v39>1*{g(UPiXJR=L&B>{L56X9M*WQhbM$Q==VfkBqi5ZNXK@&AlU zl7XwxA9=pk^mj`JN~RwhLA@G!Fh@!;bbVxpK2b7nAf$H<^L!H#yap{t5C6|*B3K^W zpofg}ttEnC!yS5P)JLf@edv!qiCRpFymwFB{%Raszhpq`m?Pc4>uvp2!=cQ0NqVt$n+~+v_RD2X2e5asi8l({ZkFzch{nik0PMP)uxo&66k{CsV$K0ZHPLS zAaim<(kn3RHVSev9?9q8cvmfuB{vXy8bP+#4e8&9srre6@Yf&?vv9my7RX+x+CY$f z;fBP1imCbw1&LdO1p453_brf-8%X;`f=uIvFh0YupHh&*HAucMj`z?4as3u)&m_p& z-H=kK`jvth#G``G1TfaZ;?NQoq!waL17(aAg`3lG6)6oEel^*ra&ytN z=xIiKr@h|WAkTDJm`09Sc$bbh#q%oJNEboOwkIKH_*@E2k{E4@uj=Bm4PE$jWbGgA zQH<^@nBq0?>JJ31)MIk9j@jJK{1)F!iXi;)8~?D~V2Vd5_9PxtLZ__tcMT|Zp_GIM z(`oYkVG%ZEk)08HyY8BFRYowoO1tka>oVWhT^V5!%3Rf%7kiGYWZECR$K{24@B;~{ zf85*XwuC7@EJ8)yQJ0eE613|3k6GCD3hu?;j`ZKSbmY*^ya(L_gSzg)oJVbK zt^M{S8B@Zea7junvk56@#}cmbraA3e;4E>v{&*<=aj;WC(t;;L>lQpp7`&de)48p1 z(XktCH9^S=q(DoEWh-5|1zL)Xs$=fc;>Dc*P7?pHbHk$BQ9CqT0#+s-RYjvo-GH8MkPzUffm|tj#Sv z-0*2IUFO~?nw-sh&bJDQ?CF2d)SCC;QTN~g$i-5^EuO=MnQG;#SLC7%Ng((%Q@n`k z!QAFRKS(FiT)Y}Q>s*hXJ3ZOEfqSx^d#29y3)c&-ryC5h8Um}}5QDTdAEz=yRavog z6)W_f)vEHY2#b#`R$Fv+<1qL|a}vn+ER1=%fns8x ztPelsulC`077PaFygR;)VQ>S^^#bS0}bThOg~R2GDhXVX{dK|pLOPBgZDJ|hLhg)o*pL+ zu{iuEg!Vy*R$@ls_=-F_Zd(IGB1$^~elQ!k!W>*=YL$Uw3`Gtp>aL zvZx#DG9iVR#GT-W+P#B~R2;J|E|$wGXqucK3XH-ydU)kvIIMyI^Zc-U+*)PPbF3CD zFo|27!d}gx9is}PX*o_!n9De4iR5^JQ@paM9v@1E_{6tI*Ln8-dJp>xj>6xs8oEiCBU_u3TEsI>mTvf4e<-N)-g56W{fo-_$3%bl#Fe~qd?OlDBV27ci zka(cu#l(S(=5VusdCLaE%~2Z#;}n9%^9e4NfFFr(_HHgYxN_Pxr4ehTqg|J1@?m~I zAFTiA=^5u-eb3EmILY>IsJ$@R^Q7wqsxZ|uU{aIZrake^0msIJUzRv7Oto`tgttED z=LEo8C8uYc<+`49KXVGq&l2wdZ6zTC(KBB6%@8QvgK#s$lr!x~U$q;X;+OS+tvbC0 zTQz$N>TGJx<9T?Hnk5qEkjyzjxvFc~-pW;U>s1vifzf-Fm0^G#_q)R)SCvOv0DpDV z1CxNi?_PYg(SCQoaM^&z9^oEO#(*%q+05gNHc+Ze=#%YbBZpvug)7?&!TuQ;wdQAv zSm#~%<+{M&6<_{P~DluVxaFZ?5q7uM_y4w_cr zbUZm3W(TpFHL4_kvfbwMAnb)K$4cn?8NU;hg!&08(B~O@SY_&Y8{tp-)rEgHx44|$ ziJcGZz3rs;UmbUu47s#>#sUs5zNn8PHGQ*PmRk&Mmrl-{NrH&9bXA%WhU*ECSdt z;SAW)p34?@?de?kDQkIo8xDg}~)Ll8X^wz@dAW9(99X>S%2q9FJ870JOH#kAR~oJUyeXzP16($` zT~AVl#dbL+u;*R#cpVMx_r!F{lljh%ovu&6nzVg-QjJ7eG(_qJs~?7mrPtXyva)i) zZPZ?73!bBH<#N^I9n&9E3U@l7QB_jS&{c^;&G8`TwrR(QZUml4-g)8#Al+LMggciH z0+ZKgmm;9U$8hmH8Ca*f+A$12YcJTpx^jy z^Q}U%?_C<`e9+UHb4xdnqZ??2sCODf6tg%(lWE7mbs7PJ1(1BV;npgU8XdvzXA{9< zFss4(PYQFd7v>g~Q7?Yi0Dc$=2jt8aJf9B&t2q6YcRlyy8J}vxR`gSihp%fnC;$F}WAd7IvSV7DL_hiHmyuFp3wi5Yb#*_zuK!aJ6=)IP41Wysj*QPZhbO_x6jK^UUq%E$bJ8 zBMHxgjzaPVRbK57B=yY*FeP@N-bUaFFdovWU45vawWbZs~haUHSEEj z-v%>B2I$oNNA<ZG~4A zlQ8}*UjO-fZCnf*Q|RaIruoSkaj9u>EH!?O{omOGlW7jS<$wbB_3O_)s{jv5yDL}R zMg8u|;!5ynk;_q3uzY~WROM0w54ZtOKBh#*WetE;9AZ5?He!jn7X~nYW=!&$2Zo2T8T9|KGkAO}9ckkK- zj^`_jecr5nlj=w=x&7L8{O7=eb&i#3)5agyE=c=w^buVB859)r*p*&YFVRI$@YPR0 z`TCRZ8X&IzysYr%;foE_iw)Or<~H1fwGa{s02A-OFZg$wX=!cNb?VoF09?)hT=kp| zd+=-T2W`H}a^>BkNXxq)TUuD(!(-ZE&^nKRE)?=ly&Lr2h3k|tj>@csX$NB#`1l`W zWqp};5McW}jPOC8tP;>C>%Df;649)NrPB53dU*9;zacr@6fZLeEb6AGnL@mb`i4<4 zlb=k#Ubu5A_>bf<@7X~WPXPewe{UG0$Z${BqZsVe4IH`k9EIT-z|DEiFigEI?|V*6 z&RCitj$OYoNi5}~=@Uy6v*KW@1MT_&eKTly&U^bl2}?V@X>&b}z;f?g^_f|oupAmD z19q(^eX|WWTVxUOPVS>&!bc57WxXbcua3$;x6bA8r`0IDOF{Zo{yB>P-d#TEp}t|} zhotE=RzYk!=@yXgi7yM!@cd}wi|<~{G$VK}yAs}93ZUTmJp3o2Cm(5oh_;-TG7ALJ z^j;8sk8~~Nw{EmUH~~w0m>*ssgbq&F6i{j9J3BP*X03d1x01CKeBu3e2w(2wF>Dp6 zbymP%K&`cP@6>9$*$tHVuvQ+pS|$6GTEWy5w6(Wg@27nGwxF|=datIitBHEQGx)*q z^&j#V{akh9(b+{qL3H+}sty?Sop5_|!bE%XJK@4*_MU(;2`Vl`u;0HhfZ%m^^Bo3Z z-p6^KFJ9Qs6aMP)+{1pNaCbP`OrioXsv7+I6Kz>T;o-WOxmt^hh2LH0Up(A!GqkL? z@Z!a*MIQqKc60XX!LjgSVdzCzN0yZ}%+Ce0hpPLWEL)nxw5TYlI5tY0?&=P1cq7Rb zT&Pk^{5s92;grusH$G2QA?kSXaUSun9?PaIyHh&Q{5-?{lr~UTj*l zbv}YUmwP>}-2=KoKrsmQUejSd)g3RX9zq|$ z=X~p&Z(o)hzdmOCrv6(zr*@m6Zmw|v?(zje5Tgr zocnoK!0Eb^5KK;(1K}KQ&L6%oL%;sFYj8hF4RDFsiau`CkK38phyGAig zc)>gPm^{63CoHFP=&-iEeDv{Oo&@hKq&!M;E*#zXDxml3%N_N*a7i^zR|{)UYNhm> zP4ZLnK|>Q;j_F=@;0TzdPR8{hMXLp-_zlMljavDOu^M>m{uGoLo|j zQbe5Y&euE=BtiE2>qdJ>mt<8&+NpIzoTwU$F1a=9<_UljDe}#4YdV*uGt@BT=&c9%1 z{5oL<$If+%o2%1pSD#+jlWsnjp7}g^=9hw*^J~nUzvBc`as<=r1>o49*p*Z=`vIx#2r@Yfu!2mK)c zWxGFXyG0)d8RpnVr$VAvLR^}ATjv8Ex~-@2t_@79)NcX}@@%gcCc{qKA)LuM*9$XF zpW(XNrpIlHN?xCu6g1d6d}(0tL4T`9m+sh|{l2J`9;JI@e)9T1Er(iRB0&_#la3l)Et^Io+w6t~}!OypF^)+ue z*>Gl71DM`a3@gmGF|GQV64sMxn-A)@g(@p;o7B|rfXvjigC*DW{sYPe)y5m3%wjV* z5ujZ;;gHGrUU(?nxWTSnQ?FG#12a3{-z%rFKp-P#ZX%|Yr%(nE9~V=NjmnDOqhe_>w=n05`jBQvswMZ6*;j10jKkm?gz!Y*N8DN{coV+K?LkD4xtU z{&AQ#971!WH=#*AkV6DnFY(-MJ{Oce?f%~NINuBKO&{meHq6Kn5jQ6gJ<)_FqNhwH zh2$m?e7h!Qyfgr^8)d2}k}8F%N`()1<#MMd!?Y(ov|lx}AucYu1hG10^C@kd0iC{8_;lcWY8xp{9AdToo@Pd$VebokOu>s1^75@P(EtCY83CUx`Bj&x#c^alMfl)^@k9=L88#&5YL z{VgH`C%?-!`*J#VHtFr5Uf+*xY>wXl$?nZ`+Nq->&(8d9;?cW_8@-+O=XFUlmecSz zzPK%A-Eh8k^f~t;1y5KfVqoVadMz$fT}k}wtClT08iziA`!;Fo4;yA(SVY9Gxie{g z*5TbxpP#$nWQRRIr}(1pk#8Pq>Q&cox`*piyr=F_UH!Rsb0h&B!?qR8xBoJ7vVc_oTi}b4^51sjDkpbR zNO-K$fNdn-@4oM7YvYggZ?a>*xh#GWw&l0e-=t@3LU{%1&M5UXsju^?Ya`s*f6G|> z^T_M+)qD2HHB}a+|14c6*5K}FR>X%nJh3KS(pNWrBx4|-Cv27`WCDRLf@~T4I_jQZ zd@s>M=JEp$<0v1A5$u57nWTwZxRIBhy%Yo>rY6|ywe(fnAs=1=JOAv-$$&b z-M-dRTiNE!`XM!b#gOHx#%B!+->Gb5=%LHsrvFrN_ZRM`1_xg8E}iSdxjy(c?|kz} zYWZqm-u>8&yDxXU-H!gg-1@U`S9Q3429k*j_)M>6U$-~bM^5qFC$+4x*!l;IEc_=4 zY&qgutzJ+jn4kcXd!rzGQJAfK2AXT)M}{nufFXQP&P-p$TYt!)TS?cY12$xw2@Er?16m&gWvn?{hvUL-}~lrx5D?Cv!em z03Q6A^Z7rT^LdMKKqhkoIiq=>Xs*EfyiXU713YhIBS;He|7q^$S>2zxpMU0l{(qPI zDcXrJ5_mLh5Cky)H{}Zt@`V@z7f2Zj9M2cxm-jgK-bRyoK^tp_{%E_g9Ff>+3 zQV1~{yXBB>WM^x)Omm#Ump zpm2~d1LceWaU<90Alu05R`;L>-*cXgj}7 z#B?X;@xP|SC7)j>vv4ODyO=&D$UKbf2n0kSY9}6UCp6~EF)}uDNIUhcmK!ZX*d)Tb z9-{C?3>DTfgF0g(pP4f zEj=O{0OxU&f7=p=!$HnZ9k0)aGNbAg+FX@N@q(gJ#Ky z#TcQp+qQ~Mj}tLW&vm-eb38OW=0)RH(y2-C)~+Nm#Pk zt8!V(l{|spo0$Vf!TWHA@e#uT&ON&6hZ+w| z9;VZBD9zGc9(N32I$FE2W# zT=Dz5h+8e=R)fsY*e1Rc!UfWfLxxU)RWX5+_m2q%cZp4&Y&5Qx*9V-`4z-AU=S0jW zLJ9>Hmho$y(`#{46>5a7yqQh5JaYC~Vm*&s&)ab`N5tGoBK20rCFIDO5w4IzLtmi< zHBNuacNUr|s`6w)Q$kgarj^~cosZAOr#ESKGCQfb^BA5dGDtuQ^%F&F-A;(A4M=>? zhJZ@!kn*f?1@>VA6H|tmZ-Rrcm0Izgs60tYa$@pA?z1OKqx})ZDMH2_%?-=W@hOzm zk{2Pnk|2P2MbahcxSdi^tG}Oz)yPzL8THuAe5yl`M^B#oKDU-dh%Z>(as?~!yEB}d z?c~rOvoi`F{rz4rp4O@Icg^+(dmZJ7ho3#H^Ann4MQ1tf#@zBacAluI2LYK3$^!1h z%y<;z&OwBxIU;v4U1*vwZW5vLy2K1Mj;81HxqS6513|Wvv_D2+H;H8hw(W!h(?+{t z6aKDZwpm+Vwv(to1`CzUS4>yU6*a~$k1||0SiEa)MRpLWFUEArq*ETR%IQs4xQqSr zrHX8)#GV)oX3|otmk}YFE4zt)X3Sv= z7cX?i`m~gAx9zgD2qr0d^Lm0cqTN~tELoLB=ie8Ia>>|H+~qqA8dki#lF!G%WG%&f zA)C*eq7>Q3N887{zJo;4Zn84l$(-;i!kIEsCsypDPRN$z_qZ(-QNk!fEuo2bSp}GmvUzn3apIe^P>|nIqWWR~h0H*TGO@|k4=Qx0BG^lE3MSWhP z*{PRLU9|e!1l<&vqsOs?Q!Yxd zK61~?3=jojKbzuP!J{=?0vdtrNt-@p;Z-IZHE&$1C6#3s zV*;*Z?H<29Sh?Fm!t9U1TxhvM68M?5?8vSGguq+`Y}H%Wxr%oEAZ$`G=hDx4+1foKuLE4PxYPU-Lnm*GR}l)=k-Euo{V_qUEmxRj zMY~)a?Z(707^afsjk%}rqwj7bu1E;1NTHv{g@SB}%mQEpjc@owpG3E@TXUba)3&|tZ;}o7sXoC3A0M3e literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..6c9bcb846b2a2ece4f1a74435d0a02edc8b7ae98 GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3^Wow0kVv7S8VC@od2$hTP*giP40{T0SVgcHyAE@iTKzr zf3hhh(EQi2N`LW)nb#sKjor`spV%pw{Q1#_nN}Ro&|qYU(KNsL8A}kefK^oHoBq_m OqM5O7$t0E&KqUZQHO4;x literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracing_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..8d0eb8a2a8c303f553819c108b2b9eed7e8a9033 GIT binary patch literal 12596 zcmcJVd7PEyb;s{8%&?6J3bKeWfE$7%vZ@Hounj0M!_2TF*Oz zDM(!?H7?DDHH`{MG)oh;Rx!4QsHusGkpR~oFIrNjgtEU$|G54k^Lubsp z=+5^Z9zACLy3fT9J$KjjmlPe@kZ9PyqxR}u&)@U@j*-uJ8(zKrus{FEo-H^1X6a)O z?75?=^v5S|)4Cdqm(BfP-34F&{de!$UH#_1X^s6(_M14ZefORNk571c?}%Z?;;%h4 z?cGSsP566CV)sUrgA3gSs<^RNgJTVt-t#5+AY^_T{+@`x@W8IJvJdxaj3Z0_&%|cA_aM1%wy6R9P1UkWpFIkKUNy6 zuU!?tdU0Jm=e5TRIWLjQY>o{Oj%oGM`lS{5Lb77o^vU=Qj1@Bly3=E)$6go`(@L>e zo!4INXH-?}tV;P?>vNmq^>x*z$=4Tht%(Br4G8??8Z*1*c$++GbJ^?s1RF2& z3c1uaZ2JYaoUN;^SzyyYu;Gk7*(}Ml`MJE`VMi=G?OJ-+vn*JTcz?Q`t;+tV1@^?f z)4r|CeIo0QLzgOB#Ex8knon)cZ!-sr19|VX@1Cnc!J5=Xr%lH9a_i!a_P>Tyv!7qy zfh|jAT0@bugn6N+I{jNSoe}CtrEJ5zPUPO(B)`t8=O3 z>Qu7O)UhYE+i8avCz;A`aTa#$)J~kW6JATcHSIg57O$aQ?5=P1l8%wH-dSDj zTC(Z(&Do4&N>3s7!@AfdvyGBVR2Oc%7x*oOrkch@DL)-HDcO{&yJ5pK+pvdq*e=Q@TJu4Tnb*qB zed!U}H=Ah4)+chlpQ-cIme7|5=b|^n<1Jn??iHp?3-9Fi6{qio9Z~irx)ZhIB@%vG z_o2^)J+U?CFJBeJg>}{Q8^X^;bvnDrOVdZ2<5VJRlgbM7O4fd-~S&w1yLZ=esj7ScCn0@@bCeo3dM%WITO=+I)SB zHu;KpSZnM}t@Z2|#FwU~d-aL&h88TSUa~5iZf*7#`1wS2tx8LgC<%08W7%A4b1D}LuM`VNP_p^jP#eCu1nA0LvbU)H5o z0$tEr^Fl)(Y9hdww>E3b=>Gi!AHF@N>ntWc9zPw~^$YCCtJy6`g})fg%J$(K6WA&0cz5N)N-<W(wHZeWbG(^5z0Nb+2qX zUDMc@_Y2CB>8a;HPk{Bqa1o(YAS_nIBG7ln!Av@A_y&Y)_~~pSDBXn_Z&TV=r0l%( z|G;Lx+E+f+m^#HS%=vJ$3(q@0t=BIo=o8e6j(JK?bl$krV|xd`gImJiyz=ke<##mi zlXE-$sH2Hi%hrBNe@_8Irq-ZCkxYG!7BSHC{>F)Tzb20r&%Kd(gXkG1qh}!V4qZJm zdRve8=<1QtvoHRt}Z+v37Q_?tWmdA3SlXbo{`&`+>QBlgfGhiP&7`++nBL|}{z<9tGGwKnnw}Vk1V0|5oUJ6#` zVDwI~K@LWr1RLUD)GF9;2csW?jdC#h2w1s;@$SJU3#-;Ed~xGF2ZJFB##i!FnOeSSAVu-{7pYf ze6i>({r?=z^H@<)By+ZLB5KFhv%8smu5|al zvOI0_d6G4P{mvJ|ew=lZVu5^t2phJIERT|^9x44)y)Y?*D3nc`>n-#ORh%OtN{`NkacyIeAuk=b1#>}%ED zY_pps8O+G+t`t`H)bc8mXG{`lduDDuH}q*kV1fmcU3GC3*NyjVnR zM@gm+m5abe$IcGEDcxg&Y`G(Ukj3SX&G?mfBlaAvz3E%%=$V{#iDvE;;=N;6i7ygW ziqK!J`G}Oft21S}RP$KfWSM68A;Okx#QYNl;X+OkDbjY<=Rw zH?&BEJu=@QtA4*=(A` zv(K)`CM6y_@H-;xI`QBaiEOPc;=w10I1}}m7ICJFMVzThbF&D1g>0z5j0j(bVOjBD z+^<$~B5y4sY|)JujTY_E8tASUp=a$f^G#S6>%o^I!*IUk!*3l zIl?prx!_*6L>TwQj{Ubs825iBI_D1Y__G&p;a1IzliCa2Z6Yw<1H9$qcJaj`i$Rt6 zJ4E1iu0IveIT(iR6c1+SqLy|=80WIOxl=s;*rRvrX18SY>}Tu#nRsy4Fzl`fskE%Ts%1I62HBg8N?6WUx>hnAN&c; z8zULKN_)~5?-Nl|)CE0}v(3@`84)_pKo0MZFygl}!X6O6U4+i;9u$u+V|Qftka%p- z)oEYW|4R`#eUf3epB2Ad#F}RNIq~55u>bARx}O)%n%LTzz94?P2%Y(VQ9L;7kf*Hf zNUiP@q030-Ob?6pi7YmMCEjAQTD-;P5%K7@>m2xfNrW%BVSgRr#DcqF_hk_{n8oYS z2)Ftn){jLPcQw1mBTQ4r{r8LK?&#PT-vc82(OI0nBA$JSiP?QsJUI5;w?^~VM0Q_# z0{10OPeeNG)`)*nWOif4V>d?g*CQQvE5v_8WOj?iV^^;En<8|!@3+L8-CFUs@85_= zXX}02v0E3}m23Wv2%Yu7ry|VmFj(@_qEeCN{u%M)jBgZo{96$id)^x5>sj&SYOcuq z{!To&`8_8dAMkskwVoFbexB&I2sm;1IY;wLB5WY)3G90!?2AR*1?-Rr9OB$y-xq!tWj6H067ae&#teHU`sm-5>z{n%Kz40UBKO-V{_ICeC{QV+y)+7H}Jnt9XjnSKWOFX#s z!JmuoZu2j~!0{Qb`E3z?CjYB=Y-;sV=4d`DdRqiOLd5UN2Fe?&Iq6?zyUqK;z-#rc=4t+45q{vTL+(Bhf!morj4(|d z*og=uMpg?a#bb*u%xPE)zmtp(Vz{;Nk>saE*jO!C|M^%L`eG4zwRka;S9;IyMdL-} z8hc{Nw|cndPekagm$ES!xg#e<97Kbhpz9?9BPa0Iw~EDYl^r!feXwtDY?(#qpHe)R zi|3!Op_?L}-`3ccN(LV-p0nET$Uef*fkAhRsHZbD_Z8kpb3*IFd*ZQYxWCgluf?mM zc+SYMbM_a88|OrCwgVztbY@#70U2BL^eWDOnt0YhZ~gx(PvDQ<{0E6= z4fOPf^JOzwJpOiGi5eVlYw|YcQUZ9r-_7GB{_l{Ew0h&YdQT%>Nu= zb_VkwEezcCAA>Ix`SW%;Q@JqKMo)hP8!Mi(qN7gi{>;1?Y{rQX_SK9%v7x`!NjF}+ z^|x`7sYl+@xx&#|Z#hpqz2);FzJ=7u`NFWXyk8(5jBl{@tqUdNM?bT*CODXV(=HOm z9@yFM(TS4rM`!Cz5|96bvLmjX^1+&86a5+ia#p zHsEG6RXk@in`z>~Sj%jti|4FnGebNWHkQws;_*dic9)6A<~*Ij>@JrK4iRf|dWCrW z(V6co@x&irdq-DFCjaQnceZ%^(b*nz#1jwhYkzMuS3I`psEff`w^DqGX5=$9S4r-x znSXtCmgaequ>oJB`s4dQUpzSL(Lbnl`<=Q#7{zEl*j3`uL-zahYVqLIby@UxIZGw$Pw>9c zPZvK!WIoG;VKX!E34gyXm#ja*zUVI(Z@)=uB%`0@tWhhOHLet9J!D0M3F_#Jb;7`B z3$q?nFB#mvLFV5e%+79ob)_(H*MF5{@b3Prh2c+*%zuq!aMypWWN`E6Hv{oqCycYP zJ~kH5_2Ts>upt)Q9a}s12JzT147(=6fDPLiVVuvtyK!OoV~^hb?p`a|zPs?A{IF-x zPjA)C_k`K~4sVqFu}*v$r(V<3zi(GveQV62owYmeez;;|?c^t~^Kba|(UMOB+v5EP t=5DB7*Z75J-#EGKoAuuhS2zXL9nAufqavI#5O*iC>SV5Fmz03w~x zqy`C1I--CkR1pwFc=CLxfQX2QQXc%z+?(|#duKLtK-}Uo({`_T zH5!ek#3b#QpxMh$+dJQyx8`i!qqTpYn~_j|bm`zGGs`djU&!gT7r&`eE4XuDU?)>b zO1jh7%V8U6jB=Qg`9fl;6H8tF9a~hp#I#ZfP|Ld%?d&19U z4IcG#x7Bm9#)pEwT z(@v(N(LX)JQkDW;s~NDf(#CD>f1P45JB^yWFRN7Tq5Zhx8&B{4FwXH-h0}9>ssFV> ze`MTQBjr;7KQF+!YXkQmz?}8Jm2USl^;`N@pTE+XGNRRRGB9J+=#Q(&`265u(SI}< zJ!{0x`?7yVP}I?$c{?g6{rYY0ymnZBBTEbV|wm-N(fVTAt zxSQ!r)p9e7Yz{gJJ&i<~BOTTcMZvWNb?;`*^}CZiE+923{?pADPA;>YIMG6w@{?~) zN!{K!vEG7xHEx$qn$%dtvm^HVelG>}I<~dnQUCppBbBMA&22l1$of6EFzX%is^58*jX@p`bq`<*#CO-t|>2(UwGx??0xP#`AO*{Ycg7uIM7_S)*6j=^okk3 zRnzERZSnT3_-d6W8<)ncpWS}b;QUv5pB3h){j{~C>1#W}YUQk-)9a(8E-&iFyj=E& z>>j0?mtGQiYWz1B&%GBps-3>}u(+1)TlV8YpU>22bm>dt1I`~0+Pk$xT=NOqq;}_W zPTUngJ-%$ipEspOMbEswIw3Uu(Dpdma%yx3Kf7`K(CIqb-rM45epveO_tm%F|5ir? z%)?TLPS&5EP;>gtvOzJsu0;u7En8>ir@a@94bNDokJkRO>677!G#Sy?WE>XbNY!L) zdADWR5^L9W)JMgqEZ%+kZuiYG`E5G2^9R}Zx-luu>2C{4Hu{IA*(@;zi`{G_e`s|0 z#|$zg8y($D1O11>51fwF=I}q0Mt6J957SQWj(REhV!x&DT|EDA?y0ZRHM$Em5>Bl! zmJBGlBX0h@I$b*jAFX>;09&%=$(Q!r{~`Ry@}b}E3BTGqohr~OTM~`K?KWq+!x(O} zra5e84?<1f?QX_e_oX05NTbhhey=oTM61y|UViu+Wu&e~|NMqdLntF~Vh|H3Ye`Ht zCV^mO;`Y<9a05Ct?hqz!U;_eo6-%PiL{`0*&16mMW=b8D=B+8PSzit{g{NIph_Tze zJA(k`B9uqXpn@gQ?sfLF!B;?m2lm@VNn%VUGQ&2^TN}vEWPe4}3~CgbL8Qr?W_0v2 zI1CnVO@n<7oxZNplD&$Z&HAb+?7(`v&76^H zvw9Uid)HS(!LM2rzMxQeONLfrUIo=bAJQGDP=8t0f=g%PpYOk7X{#R2l;+LG3QAIm z8Nna5@6$Kpg&mD*bP4Ni38ZSL&lV_mvBu$PprM939EOYn0|V?^#^bvrQ{U5g()Wtd zMjsh)pqBvq73`fy2He6+fJ-O^ILJ$YODYAprI!GgLIHk`a_D;492SGQJKRs+I(MZN z#O$r3S4Kh1-a36{6~yeV1Nel3n7wrdpCs2|lapbZ3%&iWJJ$61eO+wTn~m=Nce+OR zdyD?(GQ%D|H=|n2?|XxSk6zig?oEv@^u}}k-EL0!PxPF)+Ow`quAK7I`uQ5&sB1^Y zWKF;EL1wd<%F8aUJU#o~flT2-)o!ep|Daa=sCo-K48GXf@M5_B^;6krDCQNo1p9uq zWEy3}Wq9HK6xdG~pK@J7+@As?4dYX;>w)`IC77Rb32yFBfhxg3xZVCF^HVNc7dNVM%ul(DPTZd= z&-|3j1jPNR3d~P|Ek>hjHL60GPhNNwh(3AImV3ATACwmw-Tt`BBi+vcyb*_$zDv0T zD{A!n+Rnd5839q!!whY7OE0|0~S`sz;FG&k?aW331f>W= zk!c;rQ3dq^LzU*#!4U+74MR|7e8W+LyB9-Eau?#r5H~*JSkO&!IFg_WU`Q6Ved9=h zhK3;}GgafLk*5%Xmu^lv94%1!F|;Ti5F9;Fn=$l?TFr5!K!JsSbl>`Y@zO5KGkfRz zC-$Coc;ohzpHFWQZjoK5zicqCS@e4=0~d_TE&uH=BFn#SUHAH=*yz<;>V33y^y`C0 zQEw5?CZHAtAu#$WWnLN(8a*%bm$r!+xy|gXD@BsD3J?!M5| znTE^ThvuwX65n$E;K@7peBAqt@ViwHKGbZs_e-2Gc;kXOzgxz@@5Ti0YTVFx{mk(# zaZNTED>-!=zsV7Pw_3!?Y9F2HtzUX&NGW@jM367KCpC@NAKP4V{>r+2^ET}Ke9hRB zLBYZn)TaED(_&aa&r%x}Z9e?efUJwU&Npx7CVrwH|BZii%^6dEJTPiha&O^ROXQs& z)$GWUi1qIVMDH7HYN4k(#Hw2oNl;ip1R2B|bT_0qOv5#Lzn`?bsILtD?%gdeP)0(S zjyu=+;X?#B7(rAF4xpwo4$#jf9G$I0jSdL4Ww9kwbvV+ysQ5+Nr#c#VG!=vj{fVX+ z7J)2Nd&O$I@8tqWp0|=#{jKzjJFs336p~wQlUP?2Wh5U?ursT9iOenWh zhXSkQ9tZ20JAbGS2`*U?(w}jyo)O(w9T7ZBr8rfOU_cXO$!(=J57;)GLb$2LU=K|* z8=Ntw5zMRB52!M3ex>lh4l-GXiV>Gwkib)=J|y>uP|vFdl38U)aNCNj*4dhD99}5I zQwVuu2>?G3#wr7=R48WCGn1;Sjs=v+!ZDbh;rvT=IKY}eV=6sksiis=U`^o|NzZWV zst)I0uxo57&B=OMj1GekH*SOga^~&s7r?}%lv?zH3zOYwO)`;aDTrH4ve_KTv9@qq zQnVr2l+MQ2o{3K>K`F-geJL}fZix~d7t9i^YK`JwojT@U36-{gP-Se| z*%MW$24p$gL?d3u31w&1>DRZ~%tLJ!bRINfA<5hM^&=*b4{G`n8DE_flY{WBv&wTqsQWx_REs(y~62$?~c)hxzHiK8vK1G#3))`xIppTSL8BI~YN z7;aBL|sinB&5<#o(wy z+A4-B&Dnw@D7i7YxGJ-s;;50x4a5b8F}LG@NWl?Y(`I=eaYSMAnAy|KjX08!&y67o zyO?g1#!)4qX<&}Mw4nMCxdYa(7o+sb!?-p(o*466Cj4n$>VyX;wEwCcVJRORmzQ(- ze^IwCS8Tv~Gr{emKc~I>lbja$)cE`p9kg7}FH*{fRTpN^`Wsc87y6OcgpR*V3e}Ze zMJgc^Wws48n3*+GCdg{0L>Vnkp>T?Sq|rb!L;b^T7K_d5AL?`(p|A=u27@igzaUps z{C;P%Io)Ei3Wca#Bj8B)T&7C+Y;(g1rl$3Ljo*Kbz$Arnsz`Yr#?q;arJkfU?&jeBe9Be_Fv87U*Mk(RIiE+Z`9RE2rt z!eVm=Hal^whdm6w1|wgUIgm2k&^)q! z*X+&u7SpZ!Qke!!^`55kh^g4*)kY3WXUM@$HW{o*;PPQ4U_(L$V_Lv%cEKG6 zcvvFgjPd0&!_6$f>|`R&Uax@!%@YB#oC~BO&EO?2f`Wqp2vO3u^fY@q_^8oq>~ZTd z)|i~pzkhP1FPn-Zz0_ki6*3nGwh|*32V5e5t6ZD}T6sALvLMo5R2o+y@^9cUs1emo z5#b^>l|pM}vKU8AvJG*CmP#@UM@D-3agiw^yK$6=c>NZXntUM5VvE&0$J4K^a%NOHacNeo)F~O!9$( zPrUfK;)`n)#v>quS6Xy&xY({orEq~wQsR@vHq>Y_TGL`P?98|$O$d`$O1aaEU=q;9 z*oE50%=KfttCiYMV7ZX^B>a~UsKGvPy_jrL3X+^nJ<=_(tJs+IOiW5G9e7RL*aVoQ zmkl`LjHI9_LoB?eI=<&=_*_q#V$db4jt)|0+_Hs}4=hF|nXhn2A^i7~9OQIxNxkU2qo)OWGGwIXr@b7op0_SWmW$t_6&M zLd8~)`%I2O9*oN1#@rCE(mXKb z7R7*DqB=PFd5AWeZArpYCBkYLXg0DX-U`*xHI!|)a4@o?$o$$e1|!SubRy!BIwr9LhI;VH+}zwB(%O5;MHYAPxjFs-Eug zz>x&GjuGs1Hv*0%@lGM`5}F?cM^N(bajmWVOi6Df>0yq8fQ$>|c&6d#BQt{Ja!qcT zzyUy}1<9W>ZYEY7bz~f@{Aw%ue#a30U7lx-}Nr- z_)mi@jy^Jfhw0P8QANh+%eQ)=N8YRO{=`vdCp1zubiGN< zw=M7TtK!I#Y#R+L{91F05q`Zf=#`vL4fRRjDlYt*&{8}6`sa_c?+kwH-()Lmbk7bm z1-73*d2#iYeOoW;+_p}8bK9PxwP0zvr%K!k?lf>#>6DtU_P8IJcWP$8RwZv{J@eEY zP3J4iQu>_#<-ZH>=$c(mK7Hx*`TkXF_Bouns(PCX)~MDx64l-I(C(R`&-U#y?@*(w zzm3%Ebj#As@xG3jvJS-%pY~S*U40!fsp0XE0Op=`0p0>e{Hd}{J?k<}U#>0zeBD$* zDR!$I~AVLuzZs~rL#cqtFe*AbH>ez0Th(IUv#5woDZ=VO;h zzK)o(dsx}afGv%{vmhu~e9{QAeE+Q8%p+h*`9Sr?=Yj z;gYk!a4yv71lON?&rxsno;5-18;>+S7%xv%#n(zC0hbt7}Uy0S4Ou0x%dJ zWn0465i@IiXz7!8#)2sVR87Xl0DrAweD>Dq1M{e2n7wrXA>=?Y%-%YK#I5-EPx=(t z%H1CgP6DH0r0Wvm{*m&z2X+EPP)_%!2L3*PxPSgcco_t2j#l5XYskpZN$vkfVFqRIwO7w)B7$ zT*=jHlfoj+MX_-aBy|&P z=8ROERjAF6ot_k$%S8?9CJ2vPEEy?$i;D~iQ7belq3Af4q!fkAMUs?RG&u+VB_>KS z++3t!$qF|Pz)nnxu;ilV=A^@IMkxS^ixw0OF*+^ILJcF31x=)ABQAPHt>(C?`8s0q zwBwW(gsb35amFukiFixMNOzk8#IX$;CBd%%acsXrNuqEO_h8kQ@&MBtYJPR0XT$Q)9r%LH8RGF%y0;Sv65wpPW!&Ti2-p{^{ znDoZVu$O!tF+H`Nc8hEE*#Av?pLzDd9?WnR<8BjD%hG1DrU{RGk6^&Y#1fB6fe|wP z49T`(Tt{Fg>w9S9WhxNtzTW$4?QF(`Z{95 zC4y0iAg5U5*`FOdY2C9}l7OvuD<#OKHT8AGr1w{VX2;^p5v~U{PT8KKOZhRdv zDQ!!T`R~Qt*rFwxw@eT+_1)JI)8RBC6MrRF6K{nFH)#wp*s}h~xK&2h?qI%&d_G_~y2L zSMP3%DeoaLRkPovy3n8A>lCzbxaHu1{-dWyeNt*p{Z$8aq+ZLr!{a~bzqrrDocEvl z%w8%iIfK+|32rj8{Nn$GoL+nJn<}+}I|q6UDA5t$9_qL&g#))$JToUiDNrOpjGsBQ zz+i<|i3m!5AW{ggLgaxug1jvFRUs6lkTX9Mr1%o4_=`e7$n%;XhzCL2QmKtf!YKI> zc|JWsN`WF)52Zl0Pzn@@cI5{JTe)zQx>G3>q}U`s3J*I-vBe^`IetXcTn~j#7t#Is zk$B*ZVta++8N%Au~oc^6mDJkhrqxk*KW^=m5 zWEGn8xJKZ!Vvo1JCTF_AY#JeqO31{|HaCoLnoSzr?L9wCJGndRrQnPGmcDoK{KL7Y zzDmy{a!0%3+EWo~f%MpUAH?zuK`l(m3WsmLKCY~PjTmGF% z<6vE(?83b_?yaSdKQa<*UET2n#q>Vcxi~*xZ55P8{oD4G>@#`HG8wZ#k8vd*`!u1{LO za_ifvZ7;`6jk=#TC}Q{f+rB#hBe1(Ym=!d-3pEl>tuU4hD7hnU{=7O}I|U!DdsSF* zS)H>4x)WY#bImFh32EDmBB_6+LLs}l7GZ(zK!y6tvKCxA8~=R&6-!(7aHceGHddHQ z39iaS#1Tghi&R;jS&s;EN}b-29*5^fR%NLO1M(qPR? z06}j<0EAbwEj`Vi4)JV^BD3r@_PBK!YbL4%|7n8BQjdse|O)6tjX)!=f3~N>|9}Kk6Hp} zuO5+5etq})5pTRQ^*H?Q#Up1LE^i;2vu;Uz%lU&R@7(io?=!;hRz3Jov)SG+al+t@ z3+DW883Vr?6TGW&L*w-`$G5~a*<`Hb)NTAGNBG@p5i6^Gbf&j{>6Ia+>{SxM?4x^9 z(|G-{%_ZlrtlKwl!_Lpwj4c@yEbv;J@>5QWVF5i$ZCJGV@KXb_F6uhpyqTN$iGKVy z{?RpOO!@J^s8PwigSI*7H5uc?kt-pxwhc$0-LS#@+^nv;Z<@Lz@c=doZ7QXQ7OHIG{dE*3Pi>d@pI z6Kmv#nLs~e!Lq9k%R>)P7ASZTGOk3W&L&4sEf%=ps)LgY4#^%Ob=qU$8~GUU(YkB0 z@MWrwuaQi2Nc@YiCfSlr*3>A2#R6s#hK4v!b&PW1D{m#pLN`fubew&mSpcV~4iJ2P zZns0xF1svbSxjU~DMxZ-MVlnDkS$~)Q%~ke$0E|^uo#$$rJ5zGgOi^JdCOoH>sF|a zj<>HZ3*lsFV50d6|i3Hs0(-5*sIQ&5tWQUoPI{Z!H`EWQtpn zWy4Xbjhm{+X9$k6R7sVK$!sG4j;vINmy4{22M&&|R9=;fu4f5>BV7x(#&RX6sQQH? zPU5r?XNh0E$H5?hRR|dJBQ4ihZ~&0$Y4T?x?HPuHK*FaGJdmIDLPi=KWn>naeDi~v z9qqDh<48-+8Lo53s|?~mAQPqO9uFKzSZmB;)7=O-lEgcO*k3e13XY)U-{V?a`I(a5 zNRsIV2LYMtB{xk;5DK1YIQqyU4|2ICw@lywAS*q{pE7PHRvdL?YNPyWEBb!N5hroy zi2YtfgR$6#8ZAa^T5N`0{lX7!))bnj0ylH1$~D))lka+0a8(54KUskd$UJ^zNd~4* z3pZ=2!Zp{de)n4eRcjGi^(=6%^eBPi-<&%7O#lYad+cV4@)8-rfS`P5LK1g_?#PIz!a z`>)Comh!=Ic{!K=7j^4$#RmE#A0)KSY483-9m*S@f1-ny>jnD|{?RbN{rqwE zoxyMYTgb)xTW8c#LX8v(Ru|&%xN|+Epdf|FlP#s=ChvOM3xS>rA;4weP-4y%!olQ3 z0xiY5AQnz-+SK%JSsa=|D1>+}R^9|*k46`}=*BCL5NCz3y0Il4OPB}<#eeBC_uoI* zG44=@&pIY9S{u0YwR#ch-SuRfQ=}P0Wimzp!{2y>AyW^2*`q?UH~WIX&&zrF?lHf> z-(H#XU`tfhxf_R-ezy0TwY#zzR75x)_6rT7N9N+?439Lp1eZ-*!6K?lXId<%B~$OA|UjaUw&mSh5SR2Jar^5q|Bj?+QDVtUHj&h9=UG~d05tQ zc)^?c(R;Hq@1DCqX+oROlB2G~(OC$G+MqlOZy^-{hu|GGpx>XdW24ce+0_`}?isTaF*@VF|D9+qq#+)z6j& z=SSM#u2Q$g_G8yR6!%GRo9CaVi~yv`-}h==|H6W?6BENvY~0ni&!_LtX)7+)<#P33 zru+@;x_ACJVH;%xzP5Yxv$6EAkv&YAI@pkX)1>ePcJG#zRV8}MqSjnk~XR@bl`73>6)U;klG#|8s(#xJwKsLgrdkZ6xo;isBA z`Gd;W^BcBwQOLx=?(MTepA9eROj*(P>$;8moT;A>Jp1sq?fz?i3=a|NC<j7>;_g3~^nSh495)ku=m_X6uY~I1nWfA+UpgGRa_frkjmI%SOlu zWfa{}_C8~aQiz~Oz%N=L+B?|UtcQqY1a{&YwwW_hZC0U z^w#!)L=r|dClb~8sO82Wd|6QLpv@7f?-%ND7%~c~`N6(roR5-BeNW>_-(yU}rH%5{ zNAmzU&`W?J9zobUj|{klmjL66l6l~8ke2{MWng7E+|o;cAqEZs7y@i%hfXY1&>ik4 zZ=E}cZc_}iw~ik1<&c*v-_i5TXK$T82m@9Ov$qZ)q}C~h*;{8&s80R2FK#HXmAg(N z*iRUB5?z-N_oqOqWqitYJ#c>tic&H@*wJaEH zcbR~=KUIPGDWNHcuU2Wjg^yCJ6t~-a@}e#G#`TuGKvtWr$gDOCqU3K?Z8n4E(jq22 zw|-P&zRarc23?DD>fc_`Vb$~R7~0kIkia5}SXp&jDm|JJ8b^>M=m@8bkDv!*D~>LS z5k}CZ`fG3$rQF)1&iFasH;yq)TKML3_rKCCpt6=}9mi26X+ns3(wsUtf>O3N*ED6u zHykyo1O*p0$z6ye17;u$7wINB97(C#1lP=p+P-n5q*^6hq-3UQ95tzu02ehkCmoI! zsQj39qj*4Y^rWm>uDKPpn&U{3ylF78s!=1nIMaj(l(%5GBx$*7YkMXhRFHPcOI%tI z1&9YAiA#5z0>lH6#3jM60P&Vc;*vz+BJRPei{&{v6ykmNsFbk`m+pv1rQ8C^ZAr6u zRLa=nC0+K9N*TMuh-3%x_s^=MU)_>Og2H-Bgr81``L^7a3s+IM%>kN;8>_q(o>xQ*zoMCX`#MLxELt znn)W&A#6p6zwykSKU9YVm#hdW#%@dFKy+VqMDQ%Nlc=8J!GI>nlG{pc9-*?GA=x&} zVz7sj-c~WD5zMRB52!M3ex>lh4l-GXl4hTrkihb+KBQ!mL%ePcW{y<@$*eLYxNV&R zi#l7Ajl(;+p<@XEKM=+$1FHlw(c~P=!KA9HV*w?ya15qLLFD%@)!_hZhNK&kIapIm zbu7S|!a;_fSyNYaI8cZ$*_P6rte3^;F!VAw;Qyw9($Cz<0ZdFvsYOtmQp998T9Zs> zh?au5#Uz`}ksNCawOiZ0r$3&zP?6br~yCFHzkk$gih3ML&pN@$I?i;MuHh`8`CO~1*XYX$~ zjcode;!>hjjjL{=oNc1Xn5*_3=(6lWi34a}Pmwb?63B|$RQZRah^+Hk%#DqsjV$rX zQh{+qB@Y(YrU6Bct~KGPBFlt(u#Mp8O0FiZ*~+D{O9mIdEpQN!HL95}WE@q=*3UI@ z%3}sc4_P@@u3+NGAv;OP>@+xPlCzA9netskyVG$Hkac2aQEqcd$WII74l7c^%Jj-cemDPE(m1LlG!4wL^wQ&gy%?2fAI7!W@x++lGT~2grN`lR zQN8r|p!GMZI4|@guL&K=bmA+MLM_};1==>mIt)pq*QePw&|qfPOqn37nG$8RIQ>cC z6#q!0fnM!&hK0CbP%jaj^nn9g0D82(tW)pFpi3MLA zn!FABEn`ZQINnY>rAZg##J9{1j^Bt%)XzQFCXP}w1s1r{$}x@TBV9)4mp=YMy}o|4 zx(}IndeCqAcP5R4Wr7@?dvDxZOCQM{a?3~=0XoZ9f0q#!aH_(*abdB!1Dl;V*25kK zUxSga${fk2)-lwlj<1(J=gkVuBkOm~-mGsi?P@?aDWDI3^I(d-0exihJ0Y9tBio-2 zOs5z89apDfQ}>ZjJE3#w`PfSCBO-#?w?=M#JGJfQn5j|svj#=%et+9{2VjJ_xjorN zF4RakwZd33pyZCY`Sa>@?G${p?p0yMWtAZk=oTB|A7N&BLQar^m1)3K?`bLrD%4+= zwcyg(_~-ktSlX(GGo^X6vBFgNvK7gzjT{!K*9~)8kbuRQ7I2$gaEAdNmIwh8Ze{_d zt2v36K!WCp09m9V04t4MSuTQtg8(QsOu(b_SX7Cz#^j9Z{`Sd{8l5kj>d~^PkhwUp zmG-rre~ohAflK6Xm5Y-=w@M4rUsM`bA@Xljit46_a1k4CEHyc%f)w%N3ig!AVjMNe zHpE3ul36%1($kNNOcB|QqeRRT|G0=%;rV78*4b)+;KQLtLE&aPL4iGLhZ~5t0#WI2 zZgZGYP0UC-4LkTjDVH(H6LLL4nmb(GF&QpKO;u<}$tI;B$=L+G3*m*$#-wLrQfleIYvRTxT0ceBGQOrdK6#5zc{g$vx@6VSL9&h; z_X;%?X2F6OQERI1QjLLgVE;uB6h}3?Vg>U3zz(;F2&cc_eI=)6S(IN3K!kT1DCe~ns z#bRKdigBuAlnY;Ze`OX2C#jCEfsBKYY!T_OS<_MsNk+-+#Skh}R0jy@yKc9G*fO_g zN(!;fGZ!|CiA*U?M2-y95Ym*hpldg4Q5Q0iDW#9dWu9~_iUGGob#U_Y5N$Nuk_1ml zgw-(6Yy_2qvE5dvj;^6>yM=?v-DyfO@gZETIzqW#Qn-gSba7@eFZVG+gBH&$X!{;B zH0Zp|g7&%U(BzNgLJP{o#a_)9JUMOVye%US^`1jW>1} z8LuZ7Z}PVm4gfM9vdFUGDAfjonP`yZ3Z?M)48c*B%I_ zQAUOw$~Ql#+0icBHjcF9oZ%8PyviUB1Tw0g?(x8pB#t74V5hqga3qnzvot>nj-ce< z<62w!nUdZ}lIaBp0T~y_@l3c}`)`PEkR{f;A! zjBGBV!B}iVjTWOdEjGh$EGX5)tDWMrgxsttG*1O?=E$gD`L1_anIfRls1?|NWC1dN zhw0P8%^De_FW>5g9(k|A`x8fVYzsXkC=$;*B3T!`r^5W_(`?g-xxow^H=C(ZrouTA25y{o+HVXT0)eysyOSOJo zly_=ozg8u0WvYS~&GCGp-oB2QcgB*{@f7IF=qy>6X@7Brz{-M-sWBW7 z2<7XDS({dAl{2h!oRo-gj=4wvBHv_j~yN?^Zs~rL#cqtFe zm@L)<@)rB;%(Lt3h$+@T^6Gl{g)rB{*AbH<8I_eqZ07qqVrC5<^>eq?bF#*VmOd$H z3f^M9uOp_HZenn-F|u5I9Wjfx@bp$&K3sAZ7|vzw4-4{0z15Qsm#pOha1e9PmsB)I z4~$yE%abpa&;wv7uf&A@aaqs~DfXb^5?Osu*T( z9Y6>xjwUOU~C3lb=_Hzyr#-J}2{ zE?Q7D#OSm*3pI>Do^dJKh>IR9+MhiSux#{o#2gSBJumZ@wuu?J&FriW&(eZ$6+9`< z_$BT>-V!p>-KGF>Y=cHg@GC$Z+pkcPC|txn7)gB{F^k{il4kL!+zu*`cf31Xy6hj7 zGIoa%$^MV4FT|=z%SsP~$2+4&0NZU1TotXWTs3rx)Vqzo{yq|p?G3kZR zU@!SPVlvCZvDyK#&i;L-s024Y!&QvCWJxVcUq?(v6+bxVzK)p1);cVvzZPR}`#NGm z2{3xK7hgwAHf!ptE)gL?k*j`L= z#NOX<8rfQiI;C!W9Wg0+2gv;QVs32F63vxl3C9qb`p!~;aYQ8#7FW#!P~_ZQyJF*I z993lb6c4r$99_xP#5G&K+X4pxS-XSzLdH>*Z2eplr#xnG^pF|#zK)p440dGxd{GN9 zZYd?VI@i|mb;J}qgyWcuuSmd9t#M?LRivl}d>lo|4aT*bJlT11ge6xi7hw{rVN5cZ z|H|zq1y691@^!?VRi|IyYBLYDSUWbnlYsb8+?_d`hfyLUSHcM5*?q;CDZ z&n`7-aCc6aLd61{YOua`lQsH z`l}A;NWGSKhsS@=e{r9QIqyI9nY~n4at5i_65M2F`NjVWIlcDcH&to{cMkLzP@*Hy z9~~u8UicBwLjo0oA|%^#GpA_OnL-dq@l1Yhc#g9Q)F=ds1o`rVBGG?PPsh zyu)Tz3I}ehcxFz3QlN;|!p|I9V6Z}~LSL0%U8st^iN$eEuBQhbS2 z{6!%kpcck`B%ch{fF=p$6Vq}F1r0u_p59fl;**2-)fXfVe(QZ*S{-fda7#M*To z^-=LDi+7*C+kJCP{)A5L{CkNf#p!PgN;djO87)r#&@`LHKhkJO0}b3i+-9-Ztp1@+ z(n!glB>5Q~PXB`9G~)L=o6YGKlT~QW;~Ig_iap-?nw;qdvuT7dDj^d;+uSh1X*Owe zxA*)o?d0yLmx3?$Tl(I`^AG2q`YJt-$Q|v9lLvFEztD5|?C^>&pPzMW26e_Dcm|rx zCacllh%s2~W}`!sw_(3!Oo0+Gtmbt<48&Qe+x#!x%QPu)hsnW_Zjp!p? zM(3A4{z1LIezUp{nRt58Z~1p7je~WCH0pbA+*?Z@$sKabNErb-%U6Gw5f*T&!n|=| zvAF}AojBIR9!9o_M*mfrBiSES{?M`GK(~iu8eM(jz;bhI_<0$PK6QM(>^W~%XdYR= zYxZV+i)mK_vPrF2_?rh)><#E6livy1Odr|)bYS|`rX8|2?Co@FO@+G~GIrhx7QZ&G zPQ|9~BcXOe=hE}BmE1?fznOh&ky$eQ!|k(JTAby$LtwjpzKk z-JI~B=s9t2%6 zQ~(j4Rr}*Ak91!m5EsKr-=%yDw$i?~^RH1xAXd7EHUBJS1Vqf;*P_PIM;2{!Zl{ju zR=rwo>gt3SyL77^Yuh*_qG>H!DNjJa{0GIl<&8fVBSB?~9jqS)SQD-#@YUtiv0(r~G_+i-2d>=`S11YZm?9 z%D@HVa?5}Fi-?CSpN=BJMOPGW{vJVwpeK{XIBG=mL{O7t7LJVM&EsNX5!sESM4lV4 zwAsh~c0@*N`|s|XkTrRI``q`xn4K#u?NLkM?A0R@%CGNUKjMv7rXGjiy?EqI!{zNm zbJi`1Z#jSP6F)W~GsSS%ZAAV{;)TY4Khcl>#y`5|j43}J7&R)nxA3baxKjS;Eq@qs zx4<4&BAHUz5uz=$ps};fVM;YwSy7T2(5M)Rh)P8P)4LO~xKo#j$D{6tSS`;Ds#v(# z(WFY@Vz-!KVG3dLN~xVx1e2h2x|(sYFm+;LQffbmHl@OC%LQLF)Ox4qC1`r74oS`? zXww5PY&Ir66O&R)CvTWVYaPVm*=wrflXtU{H{N8SOI95nnC67-PMWDU7yheI|2!6~ zL8`-&x8`x{z{P@QRvnt0V`7cmFcav9ELe8cVTsYqg{4JblW~|wQ1BvTT!~7ZO^%*g zERGFV9h_WnNcIq^(;f@o$j5+>)?Jf@FH?1Vjbx%j;$MU{$(Bs4!3K*3%p!~nYnCZKM(Sj!7SFTP#qm_Ut1Q!)v6m`NTB|^hO7PQ>Q3=O&&vY_pI z%+R38Bn#T-szZ}Mk_#;;6Bm0mU-0CELOkAGrYWMAGhtL>vgd#&80utxa$aVlnT
iZDucNBBNL_R9uFKzSZmB;)7=O- zlEgcO*k3e13XY)U-{V?a`I(a5NRsIV2LYMtB{xk;5DK1YIQqyU4|2ICw@lywAS*q{ zpE7PHRvdL?YNPyWEBb!N5hroyi2YtfgR$6#8ZAa^T5N_Ln_WnvAP{8byPoE$z|CB$ za?N${S)ir9hH-Q z{Wf=AyRsXDUdj2?P@e>@=A}+}a6vF{gtgLWC>zwxPPZV14 zsqy(II%v6Gun*xM4FlZIA7|eg{MNsPT)e+^MlB`ONTFbLqBZEab3LS>Ace>Sbp(0W z(_RSlR0shs1BViGt`H6;ClY8W)&;R}YSX5scgy0?6ha}ybFuO!2zxZT*hM#9d4xDC zgw>5L=~%)cQf6I@sfrV~xwKm{+;y+_ldI%{W`p*ih%JyY;gnOZNP5c~@+=JxNcDt-MV) z2R__!#NLM5=-Q6c7fj)qAHKYB|JkTTP4X^R_-LHA->JR5e*Ct}-mDe*3vONwzo*YX zGxEBl#JgcXw&@|WNBKJv%SO*@t*Z|(kMTF;S_ ze=X5$@ZevF6%E#^lDSLj+P&A?&KTci;es>IFIxM-qyg}A=&m^;W6X5Q%ERBhW!g=P zpoKkgu#7E`{x|zuFK3?04*MjmHkf62CP1{g8w_N3%(LJYZ`YQg3UEODH1$hi3 z=U$%{M#;GYT{!RJzt`T@J~8csvCDrAvv14EIZ-8L*A5mD5a7!%zcQCX{-H>oI+7Ps z=1@oN;Ii+oee+6>+_#22EbBPD;7$GLz1f*}&)uIip-pJXRl$e!w?4L|k$Xj>uX6U@ zNczawpPS{UFI(Bx2fcnr2)0Rw~@ph|(**RT%_ulfxm%oZPRnu=Y4-DNq-JhBL z{nqj=#}D_ggje_N+_0zWXG??gBkgZjsas?Fv1=cS`y{x{^G{Po0Mg{|d$q2AVZqpm ziQy+U?&{m;)A#4J6&LGrx%w|t{swm4JO7)ojWPmX+dcZ(So+t<9;Qqk46VLtQuqSA z^sT0E)B4V)PXzfSE%kb0Unp>W>3)5w?uTib4mF1jc(u~TY1Uq=Ygmp7*1^fI|FEZH zg8@0?m)T#`=Dcu7G}@`~Q_Y?HLFMcD4O_Y>WMW|V_F19NhL?1vtZ4gn-Nt>+)K3VW zefZjT|202`3m3F-=Hbx9orQ*6cjc$89Zg@`5mqZ_{hVGO zC3SgGH|FKCKVUQj{77u1ZUHX#vfb++L_HHc^ z*L;FDsolAp6L-aHczoH0KW|Enik^9UbwX(Rq3v{fEL2oQ~Ay@IOXz4vmh#fCH;!hkKDfRz^H1 zOpIat@ zVS^)ZQ>$uuX9{fAgTERv1zHV6@5~^8xd;%phnRs|xuM4m9)j=?;Auqqt@ht7+*oTi!}}>Mesr$4nsyk$vfD$ z41KR8Q{U5g()SqCASP(y^W`fd<^gb^mjHv)UKzkGyaX5?a>@V>@)BT(a8w3xOD_S2 zKrsYhh(eVeIx(BSJKRs+I(HBPrWj^#9X;a9;g=Pj`RuLJ2eGn>VfNMmg#0tbFnj9^ z3MHKX_7wmHwrV%l%YRU-epJ1M#gxJW`w62Ip6e3g{uCH#7@u-o58R*fSfCF#K~N9{{tn)xZ00OI}>6t!iba>)hmPnBhU%5_}1KlKFjQ*erKEBGYy zQ!ZNz^XPq~av+@FGi4-B@uOhDY9s=)k|(7D1_(6d-6=93p~xp&+DL3yFkp-Qq= zWR_$FQS!Gc$(liPX%Q2iThk^nmu1y=gRaFn^>44}u?@6-SrE2qWlH{WUm>B%B^Wk!c;rQ6;%F2&y!v4vruwY#4$v;~S2e zRHxynGk(tZjbluc7QXr1{jW3&sQXoN7vji(83;2ex=9X4QYy*7HM63&ZyYJ9pa&Nz znW-8_O-i@tqUPqL!_ktmQMqVQJRmrFQtBxey`olg94V4q3?^1J3TYQ-nh=5VR@Igy zEmr|*&%}cYk|cSFOADd^@c<-o>26bicp#FvB={8|-V#Y%k|%48GF2>%l=U*V|N&l>>&RBS;gk7TM|i7STC_zl*wl8Zb);O zpe!t-m?(I>7}adqZfht7B%B|<^7n9q5k$q{0BS1Z0R3FT(b+l_x?>rcY{^s|j`S`n zev$U6jz%mKMmq8RiKZA9fh<#d#cI3n!LEV-@J<`K%j8Iot8o|73{eUXt=2r?2>>!hMDCvmF2?;z^ z>O)F4ImGMMVCGmgkjyGWg4@<9u&A>&**LtD8#>hGbJZ8((`SKBWYu9ABg@ zDcvbtye_1DnEVS-9iOzOwxn1aRHHK*tq5_j>RpTnDC}*2!GUh4}2WB01HNgQiucycv z90_FEX{!9gQA8F)E#}6?(MHxmWvRe8qLK%TYtw)tN7tHgRFSo`J=jKYbR}04*KFm| z*d>Dt-xfFs$U@G{7c!2jWb5aeIOQ>eqlYZ7DpxRZQMQj*JrYqnJV97hpZ@V^)%C62b_4&<6GTOY!a#h0gLsMa{LV3I0u#Bt3Q z)>dx7$5E8rU|bYE*?Dn=35g?zEF#Xd#o(wSTS3sAEjWUb z8Zf?YpM7BYIT}-!0vQ|{Vw7uLv)XBS{l|9#371gyx#4zEy*~FZ(RXIP9+}%7!0AY)6JMDWYT=G5(Ayx^ zA=EvOGTR0k%*>i86J#}0qKp=&KPjBzA89m@%uxSuo5fzL?hwW=}rW?$r5yGg1O#Ezf!w9FDQGrF+$=Ves59U;Vq37_~ z;T2y#KkL>E>Wo409cVI}i0e!&_~OvyZP;%aQ=-K2cG@XTx)>+EWo~f%MpUAH?zuK` zl$t59z?D{xX+$6CGCIHX@ek_t^_$gw$i&lwe#^fzX&fvQ1# zS-$$ajIe-H73Pf#i_IO_?8LDi_AvMwjC@t*NH(>Op+0qdz3e$}R%jksziakpeT!*V z1F}h#dH96w_6S~~EWxUq@Wbda@-uc?kt-Un0OvYUl2S#@+CJMXe!L5wLn zkPLSo+{Sgf+>QY_g_C87vk9^Hhve z9iv?M%9{|gI5S&O=miA*VdL@x8BV^IvaC8~pypND9p*_I@DN+PU=fo3D9 z9E|O@LUnWvW!o(rOzuuoiir>5YSj_S^^(GkmZ8-#i+Q<^85;CKWn z77hS19o?$o$$e1|!S=VJaAwkOMG&u{Z zi|`6mWXPd>^Mjfl?Xqp-CM`K23rZNo4RW&5wd3 zDEare)>eL|q&Jdedci?J#szXb({S{W89{QnCbvxB03g$Xg z7u4WXz0KWjEos+WdJL@uyT&{iqd_Dg_{dKDmge-r&AZft*owh*v|&F zFB{JTU?`-;Q23Pv3|0UHU@$StwuG}+#v_!F5{59suFM?a-Y25-?+YBx%|BH*ee&AZ}01US)g3;wW5^Dj!8yn z(M7q6GufZGCAgPdGGiRjQtU`@T3lpE zFj}EW3FXDHB&B#;E|R36qN|4hmXs8&%|!~9tZ<6}EHx>Xl8c&~lMc5TrBEX-T2LOu z=(IQswT38&^WZ&gQd|)iJy^6qyBlEH=<9tsAT)Yj<}Ym%Gjf~RS-qU41>q`fQk?Ni z+Z&dgAr+C)pog_w5O&Xag0O2V;iNQV=lXhI776#o@lRS)U++tLCk5DE z%rnQ{-*6h)T8KJDZG62iDR~FTO!s1LY|#?Ul}-tEGGvlFO9jRel{{En)eS(Ab9e2E zEtYXqk%dw`*hX-4C07&IZ24{r90X*Q4(1CPM^&=*b4{G`n8DFQ=Fa?l-%lETL+B1g&og-MLHm>ITd51#LZT62Xf7ptqiAbHUeLea29pBv6 z@9N!cG37l3ykWmfb)i4K*C}Y>aLd61{YOua`lQsH`l}A;NWGSKhsS@=e{r9QIqyI9 znY~n4at5i_65M2F`NjVWIlcDcH&to{cMkLzP@*Hy9~~u8UicBwLjo0oA|%^#GpA_O znL-eVV#Uu5&v90P8ihcSAYXn^B>E4^c{!n(YB&^=ci7BI;UEt)ejJ{e6QC3*qP6gY zq6G#kv`R!!@&l1VcoiZK)Dh%m!LJITASIjmnIOfNNOAWH0U^(8ejpwMZA+y#DtR~Y zBl3KDf|LS9tR6~%YM~S;679+l3bu0LD0Qb&C`egJeiR;dkYbBPY;*jGsJR{roi3vL z^CR)V8^!hvdHe7q@_f1!JMu!hG`B)S3ENj_xri~DpE>Yw__HKek(3>U(2#cwKN=6I zQVQWA^|<-*c-YK}DSX5P#E*y=Vx*iIg_uHIE&LGNvRf3wKs+xRebe2|TTt`n$6-LX*8sP2JRnjvsi3a|4=7sndDEB{EQB#e?f5?@%x?4 z=5&k6DzxEojlgHcZf<=|&UAy>G(s4akcppdZW!S-n>4!Hdw!U9a(C2A!58~2eedG= zhjUMTm7YiBj&{Y#gE`e-=sA3Lc*U2`&$=~(I%5z#15IX=)o5_U7%X1~X%M7!EphsS)k#K5-v1CBW9dYyL)#=(P_-Ng$ z!ivkPE+){O@IpgtR^c8<+wOKZV=ZMpVb$`R-z!ZYVH8PaSJxse&>g5ye_7UoOK0Ps z@4sScs~*mj=FP?mQ{k&jL>zJCut+uJne~WDFsB9FW>1T;4zNTBm_$n@FkKb5y#x|& z5(G$B0~^vx%}W45Z$kitSFb*y>^1hdbs1|cXxvRshG{PJ_Pg#_)93ef zu~lz2y8GYh8r|4GKPbW#76t;l{l2oPW2Q6aEuDC$9FaE0Zgy z{Iq_)MmOr(kufUPuh8gPjq(-9=rH(VYr~7-`qxiopP|Sn*cgloAi^T=kE=Y=eThI^ z3@d$?@-5g(``XUGMj3%v=^obnvy>4KF?U~!8bcphw9UDlI-*=HK5{F1VYy}d;#(}&^*@!kaoAwt6v?U&BqY=yUE1BO3~}?|fk5U2 z3)huK_pRR-FYU5Cvv@h~|l)Cdn)u8OfW+#l#}A8%K#eH{c@9KJK?8GFsbzci)7p z$?MzazW>GSTw!UCS^{UU9+6OfefRniZ@e<~IQ;I#BWD^eZy%boZb^L0`GY6#-1Bko zGs5pyJ@`S@>CFifK+c$5+&d=A3Eg2Ln@LHSlQ%;Lv0X<7?ShV@@ zQvN?-NnVa~De*8E7(KTmG`SHN0QOUi9UoF9vSVM2_!-%^D_ORk^+1U|bnMU9d zZJ`A%oNW$Ms>#ZVlGK1kg^mKop`rI7VsWP~6AxSW!{PDVii(Ac9ZjkfE_O2+7N!s; zuaw$JMKB3Ur>pG-3sWa1CU#UgZv8}?QsD;Wf-f3sz0>m&G`&=ZBxe&en77hS1#jVJ);V9L{P1WNw1V>q_q{_u)wh;hFR;t6xMb^Uu2S*o~oa$LZ;7HfP zt+8CmDXMiZDucNBBNL_R9uFKzSZmB;)7=O-lEgcO*k3e13XY)U z-{V?a`I(a5NRsIV2LYMtB{xk;5DK1YIQqyU4|2ICw@lywAS*q{pE7PHRvdL?YNPyW zEBb!N5hroyi2YtfgR$6#8ZAa^T5N_Ln_WnvAP{8byPoE$z|CB$a?N${^d`SU! z1EO6B6GoCH0h}6EMy=+QCZlJKxOrdp&j^Y-+B0uQ<)mM~&7Ie-Y+}IuD!-LI*@>)I z>VyX;wEwCcVJRORmzQ(-e^IwCS8Tw_3MaJAY483-jW5a@pMRo*mg@!k5dP6Hz*Tsn z>#B?wzBB_ZA@*CPj9NG>q|x*!%#A=?QujIF#)HwQl4am3z+ z+UVMj(-%zPnIFEqaR1q;MNRT9SNLe0w%@6}y?*?*%igRN`3r7d4Zo+)KQr>Wqr|&m zKep)}wsigBLBC(Tep^^3{kR(mU(nMVcI;l(lRomt%}qO&CU5QjWLnRWlYcGIZ1CV; zh!G8zs*<@&>e{{6+s+u@W#NJ|&o5g0!K4B3b7-zPB4f;S%EH6nyk*)=3!sH9aj=Xn zkp4IOTQ6@y9ns{ixjB8HcBu30+5KNfHeTB2_t}WS8;=mtWC(OS8 z)}W~+ts#)95kGQMxk|F1!$Q=a8a3Si?1l;^=d0b{o4fcU>ofNDf{Lx3a(H6nru%hs z*De0IL5-X`+xt&BUwy1&N67q9&*%adKDfX6?uC{OHJbkSzHV4e{$o*H^nIi-t9(51 z?UR4v+0p3rZ3n-|5M#&xSaehS_Lkn2%DmXQe&*aAGtD(7Kghegyp~Cu*rICRQvRX8 z>}l1k<>7`G7U_RolGlRr8IYj0&rRDj!=)KvQchB9QG@(ss$yLFJ^tV2?rIC9@qpx!I-bnh$*q@u_ z(nrE>uiH$SB3xB@iytm&_V~yHfVT5GMrwcB6x8nLN?qnI?YF7qm8X_w=zm;XGoQjQ znEx7wtsQklw;}wwD$|xso$+?7gxNV=d-vY*#+Sc}H&xSbG!G2jJKdj|{r%SREyoY{ zu!L9l?cA`Z>Ss%X^CRtVSE*ZL`>|^uiu)wE&GS!FMgY>}?|Zebe__GciHYGSHty=% z=hOG+v=tZYa=H31Q~m~a-8=uAu#GYTU)w$U*;xA5$R4Il9qg>WX;SzCy!5T6Z`1nD zrcVUK;ML?iH9l}rwiip+$hf=Gy{m&bmzW?64{_nf%ziZuf*UehVd){+S z_Bs2Uy`R0$*&Bi&2w8+!c2#f9(sS_2vB}5(&RKh@`R1O;nTYS^ZS}Hdai?y7sisbj zUR?z>UsYtxK=j7Mhkq*xTU2yy*KZR0OM;lTe0^eIuX6p?XQ9XTD+@U2pZ<^my5JMM zc;4@;r_}zXQ|wr9r`jjU(2Ch(eo#k_KqIv zT1X6?_swu!!ZP1CO}R^Lqsniu%Jp8*zO=dCGXCY=n(|p#iw$WhKiy=^fnwZzdtUxK zON;`1+BY=gwLg>OX=CB+eWYCGwwwzK^5CIQ{kdv=#>SO)`>hTDcfT1F#SPp+ zO?~@D_De-Et)O1MEqNFLmi(qW1OZYI6MWg=`wD#9oFHfgFNBE&5oU*^g=eM+ z($)zRL(;MnGqV!ovs2R3IN8~mDRCRJ6SLTC_G;)89Y7YIn-5GLd_CSj7lG&B??0xX zOa$N0=L-KR9x{bigmc0>9pN$>Itw}kMTLYS0U?-&i=dtxs2QN+Am{{WGn3K`d|81u zjKryg(~Js16TJNQAo6i8##lQlYG<67GT(^1$Ba8n@FMzQNsCOqGK+$hL|P!P=m=!z z#T^dDD@&Xj!#K+%iXqwk9VmYudKn3VRsou11r3_S@8M&OYM`6wG16aP{$E1QQcAag zs^d`fYD%w|s-rvT)#gofieBO{f?&!;e0i=bM$DIIs^q!J$W2OlCP|*Hl4m9(v&8Zo zEG83b1DyrbRs^ko$e~w58KzTu0V#+&KzHbuP+K|F-fD`T?$G;*nn=DeS(YurWU1sV zCT3Hz4A9AAV>A>U7*tJxbPfY*^L{#|UqA%}2i4}ibjm2g0m{N+a=_3KdgCTJ3(N$( z2FtTVa+V5{hm~hUVZ`qXa+VmAy9tx$D$l5vZ&b=z1bH44ljVxZO_t>bW45|tAUt%C z3h3*!lvcHQ8v;zyK_{VhewySlz&M~R-^j$|0cQE~jbM@=nbq?N@b=GxCWWOkcfiHT zkV!QZ0@fM{*4nC&O=6%L^Q%F5I}OwUf%S51HlZaHph}$%=YyYn`D!I`Qs^#)S^jV+ zL8-%Pa2lqL&}J#thIA8`>4v|7&iiRP5mw?tF`u0;K+*kJ%A-Y-7+)SzCQhnkam7th z*xK@E2qAR#AcjAPaaFb5{Pfp<{(pJZm?uj77}Me!+u{$% z;=Wj_4UJ>s9~1B|nHFhmv-@I;S78<}!tj}F(=B|9`%L_+G5iY+W<-O3M!>()p!saf zHVC~HYvUL9xSiF zb`iwJE>cYpfrLXJC~xHhL8puesQrAKQ4aNyfHJD44y!569O5G_rA$TnC_fi+EQ5jI#Jf^U*I=mgXet$DJVGA5xu;sD*j2h)ke9H5nxUu&qXfZmV; zpwT9A7yud}G1rLk?;zYew#BPzhi(LQWXN`uK6y}031g}r;{NmWAQP+3tp*vqh85J7 zJU@ed=@ImZ)*kNI0Z0(ZR#jtikHLDD2Q-p~S#}JQ#gu0%F>`AQ zvR&nyRmQn~^0lgh>}1R)fFk08jlr0W)tCsNxNJ<`7?N1jQ3^}--}A9MixpqbSFNM# zua_@u^kXDojih24^Cz+bIXk~0piM?@Gn&&JI7fk;b5j3+DuzZyB`HNrG_f5?g;lhVH(^MBwqeLXAK zyR0Z9w3&cHAzJy2nIudOR-UWE_^ONnCwU}H-Z2b-zDz>Fd*~QMMhD9?FUnUb%CiQ; z^s`yMT*l$^fx1b{2mVF5;d7`190yn&fNTkDI_Z?=A%~|xjH>NbBK#=ZVw+gnllqw^WNDn1nJt6W zAP}elN>Z->7dhh5DT4y)BZ))n2VMXR=RRj4(v9y5SRfc!5c8QU?Ef|S=X%@>^izH& z_GuSBm%v$ONq&pBldk7uwQPcFyZJ|yNRj}kqJp)Cfk#3KQd8T2ZRAj2YizpJl&1ol z;UUU4gw24&;l&VTKWMP%a4aoEt?d|0QL%4FEsoZbg&Qpr0UONcRMY! z)cUs*{TG=AL4lz`&T1#12}a1<n8P9BkB%$9`3!`hK@%U1@*9K^|NV=YZh=B+-oHSBR4i5u zoLIxBj=d5*y{IaRon@#}VZvC@gbK9Z%eGTM#6UWJZ(s;97-1ddMqG_R6S)F3F`2DK z6NT&{G*QH+V~E*o0fxAVt;P_yu!k_jYPP_Xc#N$!C7xs>%!oX#^%^xXjxDfWVo6M3 zYl%5r#3Uk(t9Bv=aEF|Td@h|qOyCL_#AL3TK@@Qjcp{&JuqO_3Bvj%UM>3iChNGQK z{EI_(Bsy~ijzm|k+L7qN9daZxxe_O0kQz@kHa8;>2ok(E$u75p zy4#@6B(&Ji8yYT0RR4&BBuS8~50ZV*4zh2D2q|dsLT@Oc0#W@F4mzF$CC@~%PuW44 z?NFEyElvOgD-pC_9CRxQYGxtX7wjM%Xi7tiv%R6SplJXH{RWzRk?d=BkWmK|CPItz zy`dl#yt=u-mz-e?LH5W{CC|tzXeKG%ENeEh*1fcH(dH~t0BYK!L6HiW!P#|SG`wR?s zcXanNureu|5hrj@pG+Z0nX*;$h7prZ#vb`*%;C{%Ju7a*3SLzoN z3X^0dVL|r;5_$(7xAwO7j~;t5*b3-)b4XvA^D-?}r6rQm%~tM}QZw?Rtl5B8C)%k8 z+mU-w1Jg3Ua;v_p9gsZfNS~xv5P0EZSD-z7HED?2yC^J1Saj{_2azSoTN>;WY zEk4mIf2f!5oW{N^c{yfaCM&OWy;;1~LNj<|Jy;tg7hfeeuj;RiDqp#}=RnwMeLqUj z%p#dM5H<`3oE#h;XlyO&9vRj3H?{5<8yx5d3k4SGyf*l$Sc7~(N5ga8=RC!hx6cNi zaseZfB_D6%u{fmj=DdTLMyj8Mr(eBqtrxxithdjs3w8DWQ+?{|{LlKb>P&Q+ROX(! zw0D}^X2S-#w6qkI94V+TF0-yLzEX0e{(wWlxpM_zDbr*nVk1k_jzBYb1wvhg!gdeg zNrma+(?a}{;$oqcxd|);5xZPOO`2GUlr&yudRlgpAU^T4<>=!(A7xibUxrByduw01 zIX-@~mv^Q6A$UdjHQM0ik}zWo&h>-9SQc~@*j;HkSI`A!!PN7ePqNQSOKS~(|FoOl z@VXuX6ygAdH4?G$ltYHyWUOo&XW8)fkB>wQ+c26U;B{%@%SxJ!Jk2`T<}fe9qG`gk z>Fpk=9*XHt+D|o43ssy_0DhEOw9|28olTX50B=vvO;tac+((FBr2;$TDgz>67BtdbjY zrulY$KcbzwkdEe6>trRb5Lz_cn_XRlS2=6tuiC77;L+uE4XFXNSo*@G%>~F<3?8U(`UUvXYxff!~iP z!M6qG(hLi-(H1?8^hb?A`Is}AfvuPxN+|T9b?rm@UXTR8lPFn)Klv7aS6f)+d)Ovd z7u1*3mZdT$mC$fg`en0#rM16E=9X{N7+YLz;T$n$mF1Hl{~aBGA5Q3TV562TiJ(pdTzqaq)ts;n=B9}tw_mBBr8xJMXkB6=e8Eq zAE+%e?&>P5zx4s}W�-<0uMVj-|Y<*j#!jdg=|CDZEQSD-t>UB~8bl>^zOzeR|1h zkKiTKJ!Z5NpTwohN~(;t{&ok>&$#3jaA{V3owIM9*JX3w9-AOPKfBWNGcGc{>U=Jo zG3V9UG(Jcm?=9DF|LXPj8k*S|w%IxUP7^Lk+<-#hwgI?C-(_+LG7(@sqn57RX)g7& zB^T~sj7nqsA}cCm2@bL4(SW($%F1xks?|UDhsVUKV(fa*PPJw*?-70b`^%&DkYmgH zV!)DwsmQDBqV@e~C#@Mb^DBTRXn+CJuvbK1na@9GwXwu@vnR(DnW>^FwSGbZ?wX$P z?gz9MDmF**tkl{gPj-3$_<*$zh?W9P_qX`w{CBk%>YaTrc-5d$!EL^t40{d<_Q{eP&TD7!`BgY9q(~Xomf9PmUilOGQ(0 z{K3Gt^@OucXsyUF@OPY}PZpirwK#OD!sApLz_muS+P0(Nn(-e=NOm8XnNIfY8 z^=;^7{($vWW^o=>!UoBc#@OKkVJ9y&lyDnzU|_!x;mIhZFAG%!HZ4tI|+uz_SDNdw^u&4atiSD%yfhXPLaULEPwH4i-P)eTCAhjlNG z>bsj-S)`Cngs)3WzIa;^Xy&x}d+&wuhulloPdya485WRxoVNVZ=P7R|Z9b9ZWLA2k z(%vlI9UxvBK)hBN)8c{p)_CH+CSD|C|40tY`ZoG{1nX7A1KtH~aHoufoZ@tAeB}dR zE{;a9c)qVjU=zpl1&udlOymP~*SO0*8y0xg%lP2+=J@?_#vPj`R)Gy~JZH*YLsP#D z;EUj=@s+GQ5&4+kM}MZc1JXquxOQjk16ar#ZI|%^7f-I~*?^L_cD3 zz-1kfy5E4p?FI@r8J4;+*`mJ4-k6eT6)75)u`Uap$SW>&ZC0`%A$?=2K(sV7WnD^I zNZJZvN<7%({CQZW$ZPIr9VQg6abD3Hk=G7RpKWxnoxQ`dUP`R0FRG`sCoC$uJVphZ z)smQ>DY3CYT@jW*U8$*S)7B=fO(QFUf{M0@s5XXoV5`l6-Q7-bxf?*~z1qeiwQMKk z4F!;uU(9=RZyq-xC=@lHfz8z5feVCZU^8mK{>$dGP}Ax-%$S6R8b_b!j<0&J>bpBS zM^ARQK0P*Y^us0_M4_p5ghdNcylzSdK2q5Fx0g1T#ycI#i(fc9@X(os?%%IBJyg1g z><-((j2c8pQlsxSS+(VZp`XTQULQwCGQcKGA+jQY1set?LXXXGg3ZMUDDTCT7|Nrd z{2Ej1w1fww*+ZD-p*SfVJ=IYR+?1QZnmx4CEvQn2_T8bZCiV2a_cdyOB{O0KsbE~c z2+DV(}L)O}~L_wxizQ6)3XC)!^Zh%$31e9A=6VmSnkgKdqO6;|k4nrlAEv>vf zOMO;Z`ASMnj2tdDpal3{fsEhQQYc=+!txFXNpmY|th`d!CZuGoUoJ>U*^mWPeW?Lp zcwY9vc?rPpEf0~dE*Znl~;R66&$RhVU&iPS;UfKuZJz|8ix z7HYy-*rww`60?GB4Q2-Xyv*#d^pv!0AWbW=4Y@^Ux57Tut#)ARBItQqxT3bK{y>)+ zR7BEW>A>W+$AY;AknzHms|$SA-1p%pO2wELOwL8wCZHr|>gd&F=F(;EvB7XWfd^aS_AQ&K4EPlQxdY1!Jv^~Ibf0AAPP#!1X>aa%un;#t?Gi>a(da31L`g? z?pk`24z@`x2e!M^1B=vtr0c%_kuG?SBD%p5*=%4w7-l}Er)8 z^s+n^?Ui;;CoJieduG4=;%(g`_wQwUHm`6e!<%D}{)RrW^YgppYrrE4Y@K@QaoWPC zk54?gG5yrz({73-)6LV7d)juUze7Lwx9~l2w(fhk`ZM31pYc5?9c9j{_qpus`@L6v zeVuvm@)LR^?C_3{+%pExxobv8pl8j0z`bmb`Nj6*Qb07>ypOx`UHw^>-+8ZN7kqqY9R&xJ zOX>@=d@q^k!c55u=Ok=-hF4xhO5(;9nd{a9kxNMx2@_X{(z8QT)+J{Lrf*2gw#wHM zfx5R7X5LF^gJJjRaL3i&tAhjG{i7-viVFuG^^XF4XeapIO&I>v7E3IS$r(TOmZA5^opvk#M_#s!M%I*^uRtma<~_ zTwGA=3F|B%zY=y90~N)kmYm-KNDXWF2BBd}v{WC9NE#b9&R4ez>(-jK0C%EFY_j`C2-b1o9wMtR>X%G9!(E~k|n$9-oPc zjNnBWgZ1Zw^;h9DW_2_i0e#Z>bu^rMasp@ZG!^*$ZBrGeP6L~5 ze!4An`g_m#Bp!Iir_O&@ce##M$Mn0zgdxoF0@L%n7r@)@SwZvs3~uVdpeiA9dGV5m z)w>?m?E3X`2WrUTg+L0Kz5xfHI7u?idfx&UTh_jjoSepS2Jr0+=rvP5p0j`0hQ-^T z6p3~LmkF>Fm@H>jNxlw`qLzWfPeoskWnX0!sqZ5;Mj5mk?O5x;?PaztdD7p3l8j>P zfn7?;4hPG<5!k`kXSe=*rKPrna|IY1AlP872k06NTz{l~;$&x#d{F-j-5G-er^TAt zS6kqL5iIWEl(jK9+xtN@| zDU1Zn#!So>oqS6xW^1>6D+6mYk#1Bc7Jr-ns9Qg} zr~lY+x30fK-@2!Nv~_r-wQ00_pkF!)&LoYGMq5Y3V)0pUk>nx7D$JW7jxO!C=y;g$ z_KaHe^*aRgms-#?Zo~7v?%1BXD=iH zpWYU-edrBYwPx{Wz{TPu(uU@-7#Lk!hbsn}TlGg#Aue74wwD4f*3o<~_)f@gy_?b7 zwxteU0sFmtXVnM5_}03mXBi`g%9*--bKPP;i&&jTKWGhbT!z#GIl) zzx)OT*ASr3Qf1&qAd4p;AS=duWm_iGQqw1J7wpi+f}Eu`s+hp%D&`f|LUgPEBHNpM6<2yED-LEHdD- zEFd2_yKRh^!^dn+#`uCz7Wfs*;jk7TljDlXd2I~HZWPPcf^-6sA?HCQ@pw9he>#Z& zO@n{TM8-9PD6ZNN%T!Y!M+rT0)LkZr2rve?5pErr{q9qQ?m!HjN)rT09H0fb(B6Xb|KAp2kX3 z$uG)3zuNyGJD~!PN|NcP`c$pE){qdVqN0sX=<+HSFTHg9MYeux(*Dx4yj62&?0)$0 z!tCI0Zv1q2)|CK^kz}>i#ljmKsgvQj1d1y}-+fWicV7I(#Vrq>J3;IHr|u|9da<+b zyd)K_nKos0p|xg~vmvG6+Qn2S4gB9Y}12&Mk076eO#38>n(%*#wF`^~V#GlSQZsv>?KPjd-F7lh&FGmXLs^Ow2a4>R?FLskMfHO+vr>%sH? zOPq-Gk8z?fvAL#Dz*m8r10ji0SWd&W79!$Q=7BGR$c2IuY$$<|EQ3~(O~ppg&f|nJ z@5XU($+1Abmxn>^wa#B@Y`yO~uthu~&lZgecM0F$#M?j2bJ=e*lG7BiZy4Nn`9=co zWqiaYXu*{IjEDu1EDQ>DcqRx(fg4G1C!Hi^`hm-x9s--J3|+*U{_AD)AEXG)b)DkL zG{vqTqbsBB`@xka*`b-VT17c@+;AXKs`snQtO--q)z#)&QYhhQasv&W5QZifGMO?j zJ+n${w-+G?M$0_VUd6E!l5VoiTlo!qbW#}b-1U!pW4fC`sOBh&V-0K{d@2P_n;W7l zA6U)ligsW)7xHfcqgf8FAiyPGo)ZX0O>!;+mU9$@!KD5D1EV_FV2>O{E&so*r1ZBB zvAzGbi~qCiqJRcLvw$92p*S9JekZVu(5oF{Ub!jpTXvTz@f+xhrFas}6V4BGLK{O; zevR-4MuXSl26PY&rzzqf#59smRc%XW`0W~mB^Jqy<3ltons9;Qghqqz(1te8i7MqC zzxP!V&LIVf1YxBJB6^qC`&LpwiJNST&~7-sjW(G)>9t;|xn78xn}zG5p|fyWG5iyT zuEfRK9n%^{5)ZK_@?2R0=qDmw5<;;MPs1}o&a3A{eKeZxCz}>%c}%-cYkC_n@Zl5n c@8$X$8gtWU{^9y>l8OPzZHG&Kvj$!M58G6w82|tP literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..4f3437ccda3c4a254763c049f669f8845c137d8a GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3^Wow0kVv7S8VC@od2$hTP*giP40{T0SVgcHyAE@iTKzr zf3hhh(EQi2N`LW)nb#sKjor`spV%pw{Q1#_nN}Ro&|qYU(KNsL8A}kefK^oHoBq_m OqM5O7$;7XsKqUZS7{+`6 literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingclosesthit_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..918e729d99fd2df91ef0140f5e25563e4d1b7f59 GIT binary patch literal 1372 zcmcIjYe|3E&ikC_ob6?dF_}ZM zxz(eH_oM_n`y(%p6m!k)7q0Dbl50r^mMP-bET|Z$n-!UpUBle1#|oE7dUAE?4R-AY z$GsC@?Gepmvsg&NB?)IgDIlZ?#&!78|wr;;BB{^?J!?XHc*GW!&rqSA%RvMMT{!`SA zX3~rP>dLCV(2|4MOy8uoQ1b>Rtv8) zns!m8OsK@EDJ+OR3}pOMr%6G1qgNEFW^edmVCX|Tx7Hw&8FWu^eW(trXnkE(iu`sdP6BO z$psDjM1G;)pBmLv1C2psPiO{U=mmyeU}y(^;P7~wO%%KkS z^9g<;aexy$0xvK)p#i+W;Kbac7@U}UEXLfx@svRi_;}FgJF(OCVylP+I;WF?9~e5R zt-!yZzA>l57egMpXON-aC{~h>ekUl3d>9#G;I;c=;pF2Sa$4b^z*q$Ns6h@rR+9?M zjrcGrUJlinK-}Uo({`_T zRVtOL#ANl@z&R__XO%(LZ-z zGdF8ONa@q}#sM)Ol_oxa+tCr5&pg**g?8fjjhE(TKFnB`7ZRM%)~CfchW|XjyqkX8 z@4J5pI=y&I#;VCjy1sg3R*mXc5>L)=dE?l?Ddl$gs^K$5{?WWM^1~CAKM%Q+e!ti3 z4HL$WYE-}_;l?d=L@=l)Xv-#YEF@#poF zPXYWqfBT+I+R>0#_BO2SC;Vk(c_~3s4{w1kDLEx z|BS%M<300sRZ9Bxo80;B%9d*X{ibW(Qk$wY?_S;gPUzKpi5nKgP1xr%Ao#8BnsCkG zoIA(rolT$c%K7+L_dK`$jio6I$2(U0P-|Pv=N$(QS#Uk!tL{4=Jse2ebOqeaw5O`M znMF1SorIP~BF&Z#>xZJ?+=80-GUxf+OCIl^8X5oT)=Q_Cn@*i-Ax!z%x2C4AGb<9{l+%l}eMoG~WN>$-w>FOT;yws7`8kA?MV6$EPQh zZTRz+)X3;rch)3?q#xNCM_W#n=J01XPaZj2Tits{{Hza4AN{V{_J`kSh=6%q>d5K( zGZJddxK%bVX3zCV;j3k9&-%3Y!f|04>$TD9U$%TQB9SH|`Wp1ZV{ECajBW3=EL&pT z`cB%&_>?7k&)$#P8k66qb2~qfif`zX((Hbgz+}B&NSehIqcd5Jdh&;Qn_tXeU9#TR z-7v^+82rF)OKlGSGpICo_I*G7^xnu&AzZ}z0;`zt&%BGKf-FUr`z;l7IT`-VssJqbskC?ffIw6Kv`2_vOWm}D-*Ym ziiI1{p>YQ@aRVC=xGS3y?FO>yy(|WET6aV0;51K7fzA4Is3|<}oI;G%;@KJaGZ&#e zY6cZdiB^xZpAEhO3Oumi>X0P*WFj*x!#%ZutW5S-M9rXjp&3LNjA?pXFP%+i^3*ig z=ioWiG-`kdGT1<(gG#6~3P;(a>*2$eNxrCwkjubsvUe6I;~}BSUWrPm36v)*VISgA zY075)^C;}knG%z9R(rZp?@{<{X;c{nA6P#$U6<@p>}=LoL172hTP??zHgjT4ll5;KE7>d>ce z_{+N*Rqq-~bN+ z_9@sqPYk$)hX9w53vi%^0GE^ta7zyXE`WyI{MqgO^o z%$_=ZWo5+dsRQ_ojF>%j2A?I@VUyFLs!P3nZrIlLxw}5L%B@EC|2IRWx!a=uh0M^$ zFU_nPb9aAW(D5G*tba?T3Ay=_U-w%R{~J9wuGZ`yrc_G#X~P1QX7u%AW3y)5+?d%c zrqc4utIp1Oa41u_P}Q63=0B=gKeFzkjzccD*1Zy@edA2_If{7&F2TNEEuBsoaT;E@ zKLz#^#;2T@5cj9RNW=J)^LpU^R0-y%oPwMCQ=m#PP&q{^_oqrRKjoBk+@C7V{FGAw zaet}|^HWZ_!2PMR%uhLwEBB|KVSWlu5pK6X%lwqn*2Rsg9P?97qZ9Y1$}>OZGy!pc zssi&{T8*v{>XjF61)^78wB_Dy{|DuTN^>x-(kRz60B^+MrSDTN!HO#Ffwl{- zQ$|3P^f2e2r;NardjIvvvGkF}JM25DBbwC%%1v97@JiS2wPG!sr-nD}r`ml*@Ce?H zUQ}-Rf%q0HH2u#cZXP~F5P3ew?eTNJYaC;kyy&f$9)6`-Nc9L({5cM<;OcJ&UyrkE z-&xslb-j0W?drPo3L@yyjLSpDNtbHAI&#DU%a}<^uqoHeu=$jAKkn& z<>#~8gj;0K*)JQ+Zx;Rjs(^*#bIX78i-YC=Ze8cbkg z1tBonsbyXr7!o}{^Ov@X8M)1@tSd#7v@#G6L=qPlL>&QK zPx|bNh*tOC+czO=%7zZPAAB(4O#yS(j7%uMA*z1(o9(Bagx|e<>|DbY9YS)} zFO6@xV91o+`#$b{PWas_haao9TKgqV9I|=g+`Fc+@VhZVdm1;?-#B-2TU?VZdSAO{ z^Vd1T?^X?8RrRBDy|v4J7+T6&IT7TG=2=za4JWpiT(GK6-@Hw`KVLhpWMGi61=T4( z<+K>?-?P-F#aoX)H!$n6rpv8cxrv`>Cw%P}U1R3d9}kTlo!nda)e?CZM>jjRG+_R(5A~Iy-MhENCCW%J({blKKYWPb z1|x`y!2#41#sT`dh@*>nnBE4Vwk)<}Dh@|{7Ztxq2NXvGkEVi9p+C_S!y=GnO0QTg z*S%Z-$^BMRE5DUqa0S-OrXN-eD&=<+DBZ&?He+%xi{0P|KBu2~HG4aO*^%Mp#+~`b zrbM$|XNylvasDgTVA9)r{Q0vegE`&t|FVvt`g7*~VuuvqP{R8;-7Ic<2yeBg>C7a` zlEJvkibEoAG!m>DW=S`vF>%~v;sAeyEDH#GDa~LMGBf%alG6q=q1;v+3apZA9ISip z{H{18xMUrW{)}sNkLaP|h~QZ&#;Ljm1DYU9Zp*cKz_wu*!c9#&Yeb-!vLnH7cvx2|{GpUN=SU`y^9E0f|&c76g1FZQorqVr@nu=oq))bDBbPuPF;&A>2yT+2z zoUE5gZ_^2J<9Y}nXWs5U{!C1AsYNe4F1=!* znE2!plu~>VmZWsM5HIRP+J`9#f)&RnuBjy{))JFs)9WEu6m(rCrp}6EBGL)=Sz@A9 zmz=0eYXRXxbnVec!^8sj4OVL#NJ}gepfKsP_cxqIHhq;Q^z5o?qrbnhQ#&tl6~rz%qo$WpdB zjCh?UmYrR@U*D>;jl^iwo)4>@WiJD9j)EQCbAC4l4h(_?R zm>U~M8*&jav{@=Jj;QFta$Q9#i$Rg2YfU(+kTQaqsvFw~j;`ox;+m~g8arih;oAZS z;a|9^GhfI!s-mr*YvPp042~WNY(ktPse*|k2YE0UauPcYj+*E!<6@?C7t!u?9E2LU z2^X~h<4B1v6Rz1(^>Z9W$PB`)W-&%e9Bt7Z$TeHGK7=Ft0&dD8Sy$B>N47eSEUc~6 zfRCdny1}^k>(0)LBP_aFxd<0E1L8=D!4q7hq)$j3ImkrA92cf721garRxwm*&K4X& z(T&N)Rf+u+M~y^oATBVBxg7^Y436NMHp}~nBMOtp%${y;#F2!2ZVXA-#dMoAjw%UF z19R+^h1HHp9k4#V7^PPp$FtGN z1hPKD^8vZgVR9ALov4l*d(K1M9 zWY$cXD5;qesW;h$!YO_cdL79O^$W9@Oct|Wh~2J-!YafV47MP@f?QF@_q!O4=_Z3& zC_&{M0Y|#q0#%OBHrI``8yOW?gmbK3dHQfpwU>L2m=jjR?PTq`6)XuxmCXTv{THjS;8_`F)j>#{5a%0`T zKC`2SPC7gIxBPpP$HOu~j?RNOAFQK~9r;NZxTCwKaj8OkG73Pl*jm;g@?9_=K z)=>BwjC@t*SoTMiKD6yR)cx_;M%SJ>w8GdLeh!i0sT1mE&wZ;x^N9N0vbSnmOuy!z zZFl_5qp8*g^pPp=25+U0?0h~T{aVwGS)2BEKC`yM{Y@FW?*%!&HokVnrmiC)R)XzH zy;xt@5y#)mxjkz8JE?82#!QQRm^CDmJ%F98J1(E&^rExVP{{{|&5>ee05$?dIP-v}0 z7UQUiwjr+2Qc-5%$cRrrE;2=AH;xi9Pr%atvm#c7=bL4C7qbrPV-0gugk?HGfjvrx z8#rtQ4yC`j#b!t~Kp9uMOHaiPevr#$O!9=BPmty|OPcUFVdAO7bsBSebE0s$eFsg=}AFR zhFExAaeVb?_?%CgV$dZkjt)|0T)3ynutV&P-fmzs4Ps0c4kW8Bffc120UOQ9H|Ba8 z6^AC}n4_RlsDW4q7~9OMI4p}XRA=x6r2DQ5hLg!IovTv&503mnS z<#vEbK8w-VGbM%C=9$Q{n8@VPM5M^b?Ep5o2vXgSEmjsWk;$cxNM)XQEQ$fQRB>?9 z^AN2!T9SmPO1N1!$f##ayp@WhYbe=nVPJHz8&V8>2-hf%P^y##LJRsAR`X?djvK_|-D#R44R@F@e3|SyS$au&i%Z8&=3#Kb<5J{LcHNe*GGXzIjEW5)M zIl?vq;K(AQBi%f3aCDK8%|1Rljh=kOBqyGNfC2q@@}Q4gfNi zQTj}zJ;QJikTG%6vtGzZgQJWLIh1bx!Zu_aY0){uC1!Y)K^zEVR6X6}fg=fW9V6K3 zZUh`j;+;a=B{V+@j-cq@<62wknG)Yf;=>#V0T~y_@l3`<(kwofdha{3z9x% zTuiJu>c}`)>D5;B{f;A!jBGBV!4&a8;mG2%gj}pCG*1N%0y64Xy6c_V@t+1+9DQW| z4%4TFql%2tmu~e!kGui!{=`vdCp1zub@$Z4W`LuP%;<4X9n1na>iGNwP0Df=StiT>O5$6>697+dOVECJ2R_atCF{}UU+V=_{Q~F%| z<$sIrX`0}n{=E&9>64l-I$lh5YFZS&^|45^2zm3vrG|SVC z@!pP@k`BcXpY~S*UA-MKsp0XE0Op!?0p0>e{HeT6J?k({U(PN8eBD$*DR!wG zGiTszPQW(%p;h*`9Sr>ENT;gYk!a4yv7 z1lONy&rwhH+S7%xv%#q4czHf)SJ##v0t~hR1Yj^cO16ZzBWBiw zkkY5`jRR8zsG5w80sdOq`0T0E2j)@PFnj6%Ldbz^m_2m{iCgjSpY$oPmAgM0oCHS0 zNarQQ{V8upO#ZfX-j103yz+L$^mfE7rbV#Z9B!OI1U-`>5S=O*w?Kqy8H`VXKLm&B zpDiztS@_oOuI4NOKpdCCe&!AB)}W`q%?hUguw_YheF+N>^#Lt04}ODrw(qKViX$}K~gutV$4Xjn1$N> z*y)L(xm?tsZi4W*#gY-jx46iV5Vb;+5{iyvNs3XpTqH@EMT33FUt*#d!_7qsmaK5& z0PMuX2um(%E>1e!W)uUExM)Gq5WU@GFVrvsS)B8S!qDfjG87qbT@gAdc-H5IfIUviF-Z{k-n`Z%ojjQmMc2_B#g(_2VRG@TwJ7O02eYmQ7!TZ_U5tH6n8TOL5 zBc{8y(=KtXZu`HfA2QEA*n=6aV%%*)YFSzg<}~4P?-mT$m{{UbE-*sIpDx)loU8pL zP-Tc~x$wX__jbfAwwHP_{k0hPnzth+vrvwYw<9J?qxGqy_@RdcMQ=w;xI{1t5#$s* zc=l(7-Es+XaZSA)G3oskVELG54g$Fu7cHDdwicpHsT*%cOiJ4lWd3_G zH@3qP&08i2nfmVSh-tIyk%_;etBJS5gNrnV7;H)ZWZWtvYj-eT$T+H^t)FY+l*bH? z9x|ie+YuAFk&*fH;KLMK86ruEE)%Y;@?$53JNqFiE^&81|cYS?FyQg>eC6xCN zn5xLC}X7IJ|i(XRZUU@I4nQn$;6f)tzNN8x4%$+lR;Hph>Mn(HCc=_0y6KN2^*k!{bA zw+}xe_oqv?BQK;&b1O8Iuzi`9i`3%gXAV3ZpqL{iWk)77D0#!ae}On69@Zhky& zHnVIBAIY)eM^rRtMkb~ZR|`J`m+TgqFp%6KmA2{L<}E4ju0NI0C#ZZ$uW1Msieqg; zSI9`CWsuGoV@p+KYOd7&7FPUPd~jk^3|Zr{g%Cd`QqbwXTD0$BXUQ* z^7P@HYA^R3F(<6zYZqtVo=KfC2%bR(qrnWlZDMpLt5I)L8e5{o$#&|gO}gqQ zy=`o8@@8bBcHV_Hag?=yRq|amwh?`#>zMq~CpXsZ>oYrQ=%llQf6Ko&c|5EulwEl6 z=7V+gk=&uT^^_5yvtrG+8KM4XD$E}r8k;+)*{Ksftf6F^sI*^|IhOrVr4Mbp4t0M# zw$Zg`4y`b@hM$*FX;UZE&7S*Kh2|0UyJc_HwwQj+KbzEwg}-?;)!KkQGUeUit@M$d z&j+MmYuYhu)Bet9)>gQ`DP#A&Ajj9n*RI&qbtJ?}=v=86>+3q=_?tPmM{R#6we8iI zX^{`J28ZwcV8^$IU<7uz8?%B+bE$g5nU(sI{v~(CEtp@sTj!wTb*>33E~#^tKzG6m zZLV3RA|Y*?Q6%-RR48Ou*CH&?9I8-%dDg-!=i}@3U%9MR4|_`UX5)mZl;EmNL>zJC zu!xoAne~VuN1ib);5NJPBE!4`ON4+)v{VAqS%=$0AmJuKfONLCAr00%1Q7H#1VDH- zThi04=@8GxC^E}lW4BwEvBts%ZE`wPb*Z<{4cpp2ch|>Oxz*_Y|7NH(cU$zokQw^; zrI}S@?(Po^I{w3f^>4wAdGjT|?zblXH+pVdt=T_Jsg&~5h6O6k=>_1ZT3l@T@lgh{(Ji-WKG%7A@_qX=Hv=Xd)yQ-XU)ij@*AS+ zhrii=+DZ7`%g4?&T+tyUXZ_OnmJ5bV*}d=M-sgnht#bIWYOA$h;>01F7tXzF8VkQ0 z6SSvsL;a0&C%45l*`oKgYc_wKBm8dF@KsemI@epf?1!PHtd$eN?4x;B)p)~+ttA(% zs?#@b)9%mLjw=}$B=B0D@>5QW;r=~KZCbqb=yLWBn3-rm zqhg?utM4lD^EjU%&25%6;rYSDQ-_Jit?q|dE%yzoSgXd4CY1{pyTuF(Q!tZPa_yud zn1oeyHsfGn>deF>*M4%?lnS>k7kts|1J_G&NK!UIn;v*!voUFznB-bIX~Qg9>mb%L zzOFbvX*Vlr<4qR2WW~{eX-*Vc!haR&pT~kVSaDd=);um9xLDAPibIof%uypZ)ByS+ z3zk)JSZ;cNvOvL$kZ~o-bv8MAYO%nLP#m08aESI0vC|$4->9d6kJeq2g)dWae2pZc zL*!q$Imwc2FsDZ9OeQdkFf_#Rier=tUui2r7P`rbqvPxg%>p=8ae(0SbGaRgcG+bi z%VHvvOF5DvE7~NHg=`TMnQ}5uJQfian@Pt^ELAO49Gvt#NLvQ8ShrGfbi93SSqRrC zj!>$X6mFLY4GUS&a-T9Z=w`@*cHk*PgC>(KXrC(%P5MYKw4h8}?A3hPoev7}cz2qn zB5j6bCJbLDdk(pSp-ko{=Vj(Fv+-sxlGr$bYd&1z`BL#FeQV(WAXD6mEE|qeE!}aQL8%J7n z&TySOUS$vm0+}dH_juq)!dhb%o9;%yktE(J#QviBQE&uB{~p)cO3#$|MiNagI0(p8 zFR5utgi!EI!_h|;d63FAsbvBO09oll`jl}ovEryBQyZmMThaGBjyQ=sN9^|^8jQ&@ zOmEVg(_%BM$`^icv8K>G6}Xv;Rj#=Xo^;ncgR8r30%!fo%raK`d^j8P342) z@^Y^J5qbM+#Rl4AjnE5{!uZ&{rqwEy&-S^N65wd zTW8c#LXBh!Ru|&%xN|+kpdgvZlP#s;ChvUO3xS?8A;4weP-4zy!olQ30xiY5AQnz( z+SK%JNgSF?D1>+}R^9|*k4h7}_-6Yjh_gai-Pn?jB}@c_j(=$~4?aBHDeg$e&pIV8 zUKgN?h);@!#(bp0?Nc&WSb0r_azvSMsUC_y}P$;`d>d^Cq9_bwxdDVx@{N_X+=e z+@OOsH(72h)SPN{wM|*;j+b&uYfogCn;PA1sH!gP+s=o3d~%|3nU(V^^_;ivrNEiz zE9x6+>~*$(HgxH}@2~EO?Y=MRnQ@hNXy(F)JB{4mP#s;%cJ`7XEc3(H79BhvxwuK* z)e0YtSNA)!zt@l7blsn|GJoN%Yhe$x`R7L6u$6c(^v5<)q02TL9enrljXS~?)Q-QI z@C7|}W7pp0J?SIA-`cWkS@QO%XVZF)n(}LjWj5VfX7 zj_^Cbse-{iAnN^jOFlBcVC^8hTGUgIPHNorpl06sB_B7ao>O~g|EU+NjkE0vUNHIv zO~9f@54YaG)Uu&U)&If28&;M6*zxr7exxv~ygc#llYipbQE9bphrGfNV<&%Kd`tb# zw%)#FUg=UlbKb65#_CfZ<=tOV)1XdlQKfGwzmQ+{wQAP#Xv0g3wZAUSYeD%8NYGjr zrf;g0Tdq>hn4VL&d=>x9o~T*dK_0`%g*T>$Qql=Q&Ck31pLKWC&rIJqZpE*m)*U%H zrz)rH*~KCPLVv~8_VXy@A3MlXNAiNp9OYug*w)@$)>%3+Cwv_zgxn&vJAD7g~r|=8rzt(1HM;*~@3VW&Y^rh2gzSAmU zPENPpy|=yj<*$yLs_ECNN4lua4`*e6x4nGJ2_xJr;k5(1H|?wP*|MPg2r~%) z;`)baN5e*?Sj-9IMo zpp3xR_KtZmmi{%ehbdDB8?twr6utm2y{qZnwBEDn6+vD}OTC`h7YbZonqOb7^I@8* zV~ybh2l#HDZtk_Fy6L!JCz$fa_xn0E7??9*x%Cxw&dWy}_DBVOs=AjyxO`oo;mZ~W zPYQ_YkQMS`SV?=z%C`L*J@{=%`~G*w)$%=9`8)HZV4;qJaODdB>b?Jb)z;@jDrViR zz4r02#NFZu{Fmdd{Is>L>Fc{fYvyd2+v}sGuCHjuzE<}8>>j0?mtGoiX2RE(FT5Wy zx}CPx@Hk0Hk_JZ~_5|*vFOB!VcrtMR_7ZW;C#sX$UC23g-|^`QWgGsyB{ed7)}1v8 zA?ZhU#?ex9Rhq+}-8^~ZY;AS#9r3e1EPeF5YTF-vBe3^zsUxTB&q$~-<5th&U&u=K2Ziac6m+n?_V_o7Vo-+}XGoNOV%d@u*Pu=S zZ2JY>xmmcu+{3^PGh!E_VBijB;&yIpKHSuTVV;=+oAuy|N3fn&-qABN@MkUpL?j|+ z;8IEHX@iIOLIikPJx9;Xz{+GlIQ0=TVAekK%rw~N!1x{K5Ur;;ev?u z05_p)D|?SjK*e4Oi1|cJplES6&tPXWAHu2-*ug)Uq_f)7je4PFBV>d!itfmJpRq+L zM9?GP7cCI&8SHGr*fz7F{a_vM)~Taxd9yDA;1ui zAnctd2He6!fN@31+;BM1Lx7<&usj@Y=^?-n1BU<%0k)Du=O|PV1^1Ju&K*Rz$%ffe zN00b&$jg=Q=(*>!r%oS)0n3KjQwI=I>tw_1sWT{4r~ca)Hx$^)T_+LjCyY9Y&P#~< zQ=rr`KIOa~xIYC&DH)$~3U2OCfhxiHlvAW~e+sI+GCt*$bljgR&HR*80C9f`>h&^E zIpqTPr^+%vz^XPdSZF+@FG477VsKO+ehAs=)k| z(3HbltF-Q-C#hA6+ihNX(UyDTdP-g(tIbwqR+|M;^0%rsn?ZAF5fh$EKPpGQ%<69k zUyrkE-&xslb-j0W?drNoU~!08Np)K)J(>|3N021w2&asXpc`W=jxLE2M$o1DYj70B z+}h*z__^OTjxkJL^wvuczfvuvvX*Hb$5AC|LWp_NoH{syVzxHdG$qD295t~71s65Z zU5FzCW*`g~=_WZGNwL}l*UXCAzHy|)S|wbhB&KQ{HL;Qa7d00r9gY^L{Frs4ctCLU z#H?DbxfQjV<4BRbX)v)WQ6s!K(}V*kZ^3X;(sI?-c27L8AnlZwxVRuP5cfwC7wi+>KQi%X4xl9QWOmQpPe|yd$2JatkE4Ma|+#DPxb9c-cQG zW$X?kk{!g~KdX*@HB%x93hU+QgJrOoqjYID15~_a)JX-87o$)w+jr_bKYW$_;RYj! ziopTY6vhGixrn2Sc^EYQ(lgnTsW=?*T~z!c9Z(#NqXHUfGWaK&Vps&SOz9P?<+_&( zAi3X4YUQ`m3$DO=+4RGTL8bhT0;PMn#b!+IWw9H`GO{+en!TOmDxurhlt|jw#V4jX z{}pR6>FquK{8^O2obLF4nJ7PJ?k{#o0ZuZ(`#IeVHAD)wJ+$Yxr|E>q2)eLTUsfCv zd86r*bVi{a1Cup3nK;0{$Ou!wu?F^1n!%_iB|`fdlG6q=q1;v+3apadK-wS*VJkxX zjeG9=t~eyPWF3%Vtd=wmL=P251kX|{iRvjH3}}KZxh>b`5h~m1k}bncI%^2&Z53k} z$-HWPfGXqWmkSTqD(po^c5M6up(J-;VeS_872GSDC1Sm}U?EMX=kxd^_T*_fp z@+xPqO**PnbKWEyVG$Hkac2aQEqcd$WII74l7c^%Jj-cqqDPE(m1LlG!4wL^wQ%#y%?2fAIG)X^~~7cGT~2grN`lRQM~l{;0-q` z+b{JauL%vwbmA+MLM_};8QM0)+H^^z*Qe1kNM~f$OqnRDnG&ft+5Jf26u$_)j%0@V zg;`7{i`g&4Zr7*T3reWi{R(nL9pCR_G^U#jW}&&da|9gejyBnS4fb@M(J)dN6_GhU z+gvx&Ze&zo5gx_rm8TEqRC~GSh&f>uU%NQ__Dt%GLGc}AFdB&K%u(>grpnuN&@{G0 ziIeTrQ=4?vPkP(f;N;E7MD4r_ZQ>|3Q(%F8SB-5%AL%+Kzx2tCb^H3vjv6}Y?BL(> z?@b;L%LF+(58iyRjy{q*^tPTd0(4fa`8Ffe|4fDX<3nR}2Q@o&qK7pUz6K*-l{uD8 ztz)Q7olrM>?pqa_N7V0@y;a*{`ZfP-Qa~U6=FwDZ1Nz96cZ0XmM|M6RkWMf7JHB?s zrmiC)Rzl}Wy;xt@5eI@fw?}P%C$;U>m}!v@vj&In{b0wphhT)bx!u`DE>%xBvr=Eu zzvQmC1@min>l}2v&NX4hC6yr(=oTB|A7N&BLQas3m1)3K?`|rGD%4+|weZUM_xMZkNWfxD3%JcLxWfPsON4+4H?siK*_^~fAVKp) zfGpAwfR)BBFBd_!pRCg9PzEvm#=V{%3{fBWP}mByP*^<>#p$Xp!QN(b65xK6q6 zz$Nmx%Ed{bTcri*?@$_7Bl2$)it46_a0fQtSZZ=i1u5dg73?XI#W-rBZHSASD6?>6 z#HSw@nIf_qM~Rpx{&5kj!t>2Cyo*@}!H2{2g2K&of&zP#4mWVv3LHv*bBoQ8YG6jv zso22}a=DC2o{;ki(%k0kj>&K_s_HPg<5u@`T>N<#M>jjRG8`mW3E;AolKGbM%C=9vqd z#Y85TCL%=!Y6xk{SB;2eUWYmMo z!Pssq6-U=lvfaYKOEFDcwZ8oD^Mn3wyMp+Sph7PJFT85(rnW^bBPhB9HooR^uy%*Go#jEvWliZ|(7 z3kLuh4_Rc{aFl9+!OUTh^TM;aNY zE>&`hs$V$b$Y@D^^&STU8PY91(o&5D2LKt%D19cC$ktB{HgkYz;5pX1t!Lu|!3XY)Y-{V?a>6sGW zNTTTl2LTxu$ni|W(MM(kN#&Zd1^9_te2GfTNDjKXKXePQNOSEXlS}vBIxa zXBgqvn*-bDe5$KY0#|Y2*M!yu_5GhH(Ms^C3Hhfws<~vuWB5nK0Qd99+4qLL{U5TG zRhk!v8v;5kn6ji=%f77_cWGO@gRyN-L1!rWLU?l3I*mfVT|HE{^h(WN7w4Us)vr~_ zTUjqWH&@l=hvg}KF8=brMfWt#ZX}<*a`s~XDmD5X&0Jlr%_VbWYYmC&ZhK_!tdJM` zcAbBu(Y4=3X*HVV>Be}zP;YNX%zNX=>bMJZWptLT!?eFRLtrIA$J7`O2!!%>#4JrY zh7eAOX1%jZ03Yi?DR!wG1pW?2n<`JWadS2&;G2Ozn7f1BPKtuyd5zsgl5gSxiPa@Or_=pwW5y&W+NlqygM&WXiBxM$zodvL@#29WaQm|x&8wX&ii4m4u)Lfi&xOEc)kho|;(Gb1e zWG~b(0(r*8Xd^CquxNkwJixNi+YxhMNc8;7U)m;S zTzw%{OtWqCb03GLsY! zD2~QW*9QiRK;Kn*#fm95&jP0WR&rMJ2dsxfm&%`8G#U;qu^>)N867Gw;<-|4hcEqIjSAgxs6i4j+4X2T< zg(y?%#@i8-l6Qd2e=p|7c37ghk}TmEB2(X4Dlm?y=)vNuc>s!>t83TMco|0(Sw6*$ zZ3IVGbTx6!mhZN}K|t2-V7`!XR7G1q*TgB085})iM!mNqCNhH^nLl6D0*qTq(XGz4 zb-W!h9Ua1POvYCvV5rtOvdAh@R0BSaqUZ+W+D-24yg0(5tCfo|3DwXi>5PBnb`ygq zxJY?BV$QDJuW!{^N7^jxGI-=7R+NC~#^mCv#D0p~F33ti-j0}qb;*|DCY?2ev>1vp zjKr29LRP*4y~s7z@2?!y|Ia&OwjULA`BCbZYx{j4oc`Xuj((kkUOcVYF#oeFO&Z*v zTlbUj)EVkGlJD;N`i^!_@9s+|?;(}Dcc~`ir}sMtE*fDve5n7J8Ihlqnp=PMAq}b5 z^4^H}js2JOnUwRvbDvpDg(hc^dM!asW|d#^NATHom%pxDGpI{|+kg@cf&SzuiSoja zh#nFs6BHrYmYX?6qt0Z4K#FJbbHja{Re(w+P$bBg9~6oHgCbvcXt5dwCFX4wqg*&} zTg5$d{N(~gv=)Bm&;o;HS|uVV`GJTbyfTpo>Im|Z;8&SYkV4M%B-)i96l~?fQR;TNP>^Di{3zV)AlVj+ z*yi{VQFA?HI$cEf=SSj(H?r*+^7i3JNsv61FeXauH)PKXc&W0L2_B zDLXQuA@3M|G;UI*WWqzLbo1kJvzcX6_=pLJ9}zLch&eMdF@?BV_#wDtx5$KncwSW6 zrhA*Wq`bTSR7Rhm@+GwvV`ZpN9Bb1hk+xPw%OIUG#+Ite*!Et_vL)87@1%{4Pg%0} z?ER>%G5HfaxAW`eI4O2NOJK6zFH&!^`-P-gOnwo1T^eZMeqk1q$zt{kv6Dthek93H zZ?pRq6sK`~zl+hBZZepK<~+_3_^hMHTVI1cU1v0m6h=j4j?XsNjkFsLD$SjJ-%mfi zH}ch>%l($UfBE9$d1t;#&m(e2z4G+ooN6!k95E-X;%gUY-=0aGF$kVP2BX2O*V$rp zCaY0zQ{`SoVN*l) zC3LRTi}iIKas17k+oQI>liK!b%(TddS%bs(ez4=)Lofon+pW9%QuTy0EA=J)OYVwW zFu!)U&OyiPToYDYQgtzb?t~ZGT(b)IK-zZq`x)yf>j|rt-~0itQYX8*7GZ(rP=)%- zvld=CA78Kk%4My3*i)J}8z)SKuQCyF#F4`yR+eYhBPzk17I2$AEk@V@ED-`G(NYOa zXB}=2frOg`0n*vlhBR375J1q|5CGxTY)MbErbEycqvjNQjooft#u^J7w8`mE)urA( zH*9PB++81AKm8R8bZ-I=CLoT=0y%MH<<4pEBisXWg!KeTtJgW}I zRT|~GL?AAPm%dN=7Hp*hZ5Ldpj6ke(4|D!`$_R*<`>#iirH?G$Vc$s|(X1X&ZrYlJ zSGsnu6>Hf%HN0s*)$S{r!#Q`3-Hu*VZux=u7ArLU&m?XhK14W0l5z(L3H8U6b~P(Q z+&p+7kU7ERD1fy7#^;My_n2PTzrZiC_w1vacc%P&cAJ1_&)F{<%x@O`{;Gh5<8#Y@ z^NRxyS3Vs@ggabOy!m?s8G@cf7UQT9%@aXQlvy}3qBoC=iA7{LjuLrpz|v-)^w|{= zt?s|KZ$j3T4IOen_+n13u(Zcb0dv-jOenu0s($#J?WdiD-@Sb7T*DO|LUPtGjc>VN z$dujtKJI-^_}wapAFH-n`z1~svU%a$yQZ=5yD>p~8aLG6ICpYeT$3$&U%O`W*Ez!P zRt;ZO^`mpWwab1OTFP2E5zIcCXH|_ioY-1&!Kyla^EU1NeC@cBfk6VV)hR#av>5K+ zv(%==TaP|BFzd3W%dK0viJxdEeC-!qW9HN!4~-t3+*|n75?m>N^p-!2xLaTkE0IjD z>&Gv>uhrL)M9aLgyP_& zfCJ25Ux=ip;Rv^+%6Fs7P6q_K4oao&5#A{z*B|>O(t2; zK35!?^pRX>L7BMNtNF4!9~9#8?lesiy_^Zdm&u+(?qDdB`N?^iIm~Rl*^4ALPT-mk zS9rcuyh-0$H~`2Lw<61iqf`qwRkzO&9A&YRDi@R4MgSaHu?{a6SvL#!@AxsQQH?PU5r?XNh0E$H72m=}M2ZRAa#bK&GcjpNX_*7!CpnpF%8!^sE;$ z(%>i~v&f{IAJpty^0Da8Jw z`B88LMgJbx+Dgxq_(l>A5(R-EE8X=pPX%t~VwG#IgD2hf z&fuzW$bT{e8<0XBS(1V2)56UfnRYGR>V+P81K|CMqy8dp+1*nIn*okGvPgq_>R=YY zQOB1Qa5W%Wg)m_xS&|5(f|$^S)s9hOe$J>edRC8{|7HJ-z{ul0^LABA`t_UK`R&SX z4s4(EsjfZ=T+K_J_~?}SUzNg5<%8n#a<2XndHZU`2CS@bLhFM1{!bKI@Tm#;r#h;+ zUa*hh9~A@K&mU*s8}jylgj~G8bw({E)JUdab)q$BxN|+kpdgvZ19b#>=hI#Y^ppt! zE(3=Wb1oAOCMObTDb@wCa7xprrgux?&}2d(#B;IoCJ1{}n%KoR+dn~^6~gMqmUJv( zA|Q19OOtu<;o(kkM>>AiDRJ?-fZeax4Ns5Kl2b;JW)PLh7y%4_;}M2Ty)*HdP4iao zOe37gn|!L*74@izl`6j6C;anqgAUf*WVx|WbE?(VHf60lUdk!0J&|2*YIL`us=Bba zoe%f;umpQ=+b@PU)>YieP7Zu<0|dY%!Lnk8o9rr zI=Yta>?K23=7+B>I(R;Eag)5O6+RlT?ssN?uOGkZx<6}W{=!?=!X9Yz&yBiaEAd|F zk8Pqtmu)yY`0nK!cZ7A)j=!1k1wFrE*WTql=_9}2+Olg|^7g1_(|V4Y@@t7^Lx%i9 ztZ1-SzQ(Sp>-OJhJ99$UMGMc>TfA=Lhgoz%GLLCw7N zOFnK;J*W20{!=ej8)w@UykPVTnt(-*9&WvVsbxczs{ez3H>@iCu|rY!exxv~ygc#l zlYipbQE9bphrGfNV<&%Kd`tb#w%)#FUg=UlbKb65#_CfZ<=tOV)1XdlQKfGwzmQ+{ zwQAP#Xv0g3wZAUSYeD%8NYGjrrf;g0Tdq>hn4VL&d=>x9o~T*dK_0`%g*T>$QgZG< z7tXu5%QCb-E~$}E;TQ0D zt0M3lruCjp zuL$x=TI%)0zEI%u(){{roe$Gg9cv69IKX%FbaSsY)lJ6*>)@0(zTelW!N8me%dM}d zb6!5;Fxn~bQ`Nov!R71v3}3c5cv3)Ahpdnn!%EsyR<`Zm=)rG8+V{UZu9ok?%HNqM z0a{|Z{PUmQ`_ETxeLkdO*3H^$9}i31{pSGr564~kX=_{4*LQ{1%-Jxv*GEZRU(t+x zt?c*NJxVt(y)@#?gs(4Oct2uvJ8iAuagw?n`>V!-nNX9yG~WN>$-w>FOT;yws7`8k zA?MV6$EPQhZTRz+)X3;rch)3?q#xNCN6TMTX%2sO^W>4Uwbi|M#LxP$^wICCZGZTU zz~0BDj-0MPBcaBOTV(@d_FRt?zFM~StWSF{92b_cUK_3cWy>cc5@|INNQwco)JGdh zsSi@+!%;1R{Gr}fP}`%sVUXW2_<`M)+8qAJD9)kM@E34kmF#dW^2f@E2Zf1I%mFTW zcGUyhYma}UC2v8vJm`Uq&KFgwhv@mFiIYg(7z|G$ptaKf^rwDA3=)Xh1hJmjDnJPux}aqUP-3D zr*fz7F{VLG(8TAPDNWo5(csRIc4XR=}T)EN{?IREV{ z019kXZ?2pFsAm1hx{Hb_g$MQ%Mkze!CB*$HFw!tS<-8uaKjpSSA8vx6N-$74MJhKc zD22-SlvC1if2uU|Q%(WI{V6DF%RuFn3*4V7%lwq{xN?8$8Rn~slwk~c| z<(Qvx8lAX51qB}%YO^#fa)!z=j9%t9Sv$EsrdhhDm)pe8Q;SjNs60lTyG$S;QAjx78 zWI7)~H^x>RUAQYTbgBLt97Qn!^|(EL?stu243ihV_0q$yR12xBWm?B^R7oxkg1=C{y=?kn#h_AtM}g8k++s5(_p;ax zWEokTTg~21>^if!GvC;hNP4`*C#E?66>Bi*?LGedS(L$??)ZP1C_iWJFLp=)4kf&w z)6Gz5qhQ-Z4{LjxPKb=43rqE7#UYV5nm$Qq6nYjgS#y(#1N;$;Fa;cIU@xT^jCxW> zv!5Y34NBKDSaMr&D6mR)1L+kggslkiH}1LfyW)`Gl663ev0BnN5Is~J5j;z+B&w%) zFrW#t8v570aT1(B=f5E0ji9fUoJebgAC?jq$4ILB=A%z4=LGT zb6mGNBgd+NWL6jw+_rXsMP1Cv`VpO7(6I!74+vw0f%$?=batI}d-8p%D2@e`$igw0 z?&17PaX7%5q3OD0j{Q?paV)@^!a;`aSyM-GI8d!F*^<(ntd~h|)AiEX;Qyw9($Cz< z{!C1AsYOuA&Vk9QHzyg45G@69i%AxXEjiW_W=V?HB^%P&_&PB0$t5VI_#!Mx>2~4b zbt3J<lCsM*>-P znkxTr6p_VHi@C9Jw2^gCSt>A&sOZ7s+BBfZ(X}QVRb(w~H?|QRUD4IVHCw4PcFN$w zw*?LYvXC?Lg^Z&r+WNUBPI=7W=poCiN)=2TIb^#9iJb;VO>~xVF;lvWXm>ge0yr|XP{k;15m%<5&l+o`8E>8hXfwz0vo{@J9; zJp9e0sn!Pckty#6Z>5jyd_EwZUhsE(?TSrZM?$QG&XszxzOEw<1aoeW+Wt;z+p96t zA|GZA4&VF1j&Bda2yt^WY$HTjLsZvEpj&K+e}tLk2{}PBR;B?{J!2|_1y7oaO7O$P|&?I7-Ak z0ZaSOidYq%ZBO>#k! zvI!de!3&#>Nz23}*V2L4#Dz_?rh}|yd|h#T(mt5dmfb9L$%>Pz zC~fNJ(z}xd&8RpuDaRZIl|l`~IzSI7QCSs-<#2r$+=aq{=nJVFZb79f4vM22CyQf{ z2cz&FlL`*e9wPSWW#Jq36!6jdabqh)Ay%wk^dQ-%h8kXg_UJY{Imo|*;ibH$-a zAIXIll!=SInlCdQH#h~@X__KwT}&9hO!gdd2Sb@KVb06UVP@lv9Y)6MNyVG=t%U=C zjE5|;Y&c4_z+mPu$a2MRxP6A;D2ruxxG1xY064P9=twsY92{L_B(r-7fg_EKQY0oem1Y}H{^sH+#?2sU(w;SvQ)kSy( zDl+6yy7@uPj&|C%ag!FEGhAYZR~f{CKt|QmJsvoc#8HG0>~uE*jwCX8mgYyn5fuG< zTx%;mQ{o#*G`-*;Amai#o@qGx$c!MVT$5TRZ~%~LLDHv;i-{FS9T^8Jz1oVt-*Lo| zke3eR*~ zo$>OQMlvzYi^B~89TrSkQmtj*){DEet=+-cwx^&ol)RPo!gF&~U4B@e(&yqY|66oV z)9gm_*(+x+_ODW-&(X}))!JM#N4D0G`0chw_Rb1bkXCQ+OKJ=bq8V%^l3p;@D%I4y)Qka zOMoklk7e5;nJ|cL@sG`SdcO5sqTBYv@AD(1DSiiq^#L^V7?M`OulS9 zH-Mp#7DM5e7cf`>5P-qNDA^L;-k0JX1{qllkq4ex+4$_K(+7r7*)V(R077tqY?wWD z28jdl@1Nc&u$8+L8k_`13qR*2#QiC6?@Rs$bl%>V{Jiq^zN`?MHRI;S%w{o_mS0|V zcFu!CnYcp^#$CoCcUC3fKIC3`!M}06y>j_^<+fKYGT+|Y`?5f};%h}ImK_s~&<+>n zYR+VT;-VBJ5+6YbXLK!)>NK|E=!#*KTwUs@{u&%bF}jG0qQmF!uLkSc*jmp48rB21{D&7$1RqO7^uZXh6JM( znv_sp97|G+x8)*93Mx8#2w+Kx(b`<3V95%%2*6SkV=1|)xj5-?n^6ok;-UrRLG*T$ zy-;h2f;bP}(p+lo;X{4x;7b|w@h3KwxVMpAF@%i=e=s98KIw*w309q$eoFZ(B@jNM^G zvj5{M39+irvJwH|@y@6Qz;;{X+Nc$+e9poF)D*@+EuGDRlc_iy@m=(1w@GF?;sM3c zxase}U=irMO0QTkW#w7Gl;2A3YNE4HDZisY>Gt-%Eb#kqRXKzAv$yvpy#O5SC2#Lb zW_dhT;~&=9f5;S-;KpaTigA}LsaomneaWb12_LzBvAgYwGQNN$;cp+lzVT z*!vq!BU=kmrl^g#_a!Co0Ga7t%#H1^M02H6f}ISR4A){!;~y9^$=h!rIu zx-q%9DzTs9whOZ6kGJ>bU|q6hxJhRXAfmT-A}?(XQmk9`YUh@NSBWPR7wNc5ti64>s z(-SBcC}Q=H3seiaK#^!yeo(NL3rDHj5MV9R8_{d_ga=Mv2J}QZDf4PlD%i|M{SMCpV+ybUoS`T zI=i1GFj?;xsW;jELeeZIzX-i94K#4SFpJ4#G5dwsNy{WZlH{ki+5HNN(>T80#b``7 z8O%Z(9_I*r*3r$aufd+KGa5z;qarfLXPfIr+KmR4=FYzFr=Q*%`D)PRe#_p!eDU$T zGhe0W5xJvYdHQfpwU>L2m=jjhVUmIV$VpG?V5G%oUrCzMB>xkoT=G-2& z{hiddS7W9{KFk^%zW0M2-yVVy61mJUD+qezrRoW1R_aUom)sS%V1Dgxor8|oxhAZ* zr0QY<-3c!=v}P6Vfwb-J_cPW}))Q7OzxjjG^btmpRCaYO!UD~q3iX#~Exd9*zFz;8 z%UboYr!;RiPM8W`Wg_B;BZoz-A1oz8T$C8nN?%%?hgz){=&M0_SieH0X*JqgAfw}u%dK^0v3+XE&t6g4m@1>bQBTp za7FRv?-6VWdJ01F7tXzF8VkQ06SSvsL;a0&C%45l*`oKgYc_wKBm8dF@KsemI@epf z?1!PHtd$eN?4x;B)p)~+ttA(%s?#@b)9%mLjw=}$B=B0D@>5QW;r=~KZCbqb=yL?!$c4Hl-(Oib*ka@_hkY)XY2lncISsP#_IOHlPv9Fmkx(2xgS*lbK%CMLO- zPTCra)+C6lYa|gJBLBk8NtR?{4c3`VU>0FqSmPDPC>6farhzPUlNCqD z*#VjbaH`?}!RP04I~47w%R-jLL?)MVBt=%V9U=?aA|^8BWS)2|A}ltOj+t1hTB3NVg2WGKurQ+y#JJ_-iu2CGJR4*yq7!g_%vY_QYWoXd1kOl3)Q-%iZBw5ftR~(x3 zkz8m&nYh@i`7+Z7g?s!tO;bcKXTtDhvgeRH7|LXRa$aT*GaGOAB8iQ2*bTYD^QGcV z`qsh$K&H4ASvDM{TDYmYeTLvDifJ{%5J`-urFdPIDK7|l#(z9O3NQ0w{%p#L+ zeo(WcEonk%4Klk_bk1;{cV1->H-BWJG~MHYBMEDbS!}u+0Y{Q}rx5##=10L16#aW# zYb!ld;u}dcz2G1qQ@y07DG@@!GYv-{S>!<~*QAyS8~|jc2kBGB#l(uEj!bQoUTsC+ z?>OQl?i{h-i)b(=%P_r3Z%&KNuwt_dNfZQvtaR7YJQcW^i&d_<4xV(^JA|Gu>8a zy!@pRXbG|33T4#7QF+3QT1u#qOu_0zYtV4#dWbl*zWt1o*7qZhh{E(xYNk}4b{=L zY-cYS!ZJU6ZPCH=k&Bz;U9IrZcy+%s`+NQPP1pTdEAtoLx)%08n}2T94O@x#LVs)% z6}oK0(ZP2w-?$?zlXm>ggfHmn4ZHR(?@1r|{nnOU%aXT8J)72Z)RbRKG#fJH7h*(% zrSdg)OWC_D?X4Mu)WhuO&ma7EMB`uHXfuU(f_Bdh~GX{Yxzys#N_S{JUXQ>5m=iqW2?(S>@%4cc1(d z&yGr~Z9C)@h8R2f`{G;bceeHRE%Qp3`kC`~%`#S>@+j~Aikb#>Vv8z$OZkQTvaeOM zmPZ?2TCDwbXn$Wy5+0*XZA$R+79v$j!k56>;j(EhljMm~jKF#okS zOFQa_W>eTpm8UPAHuIfU33GC~_3pjx%`bm-+*D1!Rz1>1b$&Q2`@8MsTTU3^W(lty z*u80AmCu$1E zZR=R9tL5syM)@1qb?^Q$aR+4tzP5MFi?Q^tkv&YAI@npg)1>ePc@k9H@@H3slmXU3CpdosB>OE z;;j{K4hx`V3#TICxS(REMmP7sE>0Q&zU^-{`?_L)!PhJFb@R!OGv6CuIt? h281hD_*d`!=c~3pA5t;vX6?0)hb8V7M;!n4{{RBT6jT5J literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..db77503c25021445dbb32d008d162bb3cc9e9230 GIT binary patch literal 10726 zcmeHtYgAL$*60oiNk||G4Wbe9yJ#L=XhQ7GhRj?U}~u;Zf9M)4%*ZbJL~PTcwfnF<&j-?K6!NJiF*cjq~*A z4b@2NRaNR-%$=CnHGh=}!wbLprLj(Yp9KkDY&4b8jR;%ydv@BH;6pTGWa$*xcy z_oINnc7JiN^wUjCt4?N|{4i_QTI4_UwiR6r!#Mqbv%hWG&zI6~|1jr%^pYvk{?LPT zEwhPO{KZg1+)BTfE!iL1MOA*kK6~EM8y~jnEMs5XtE*f<3_fa`X8Q9#Pa!e0{CZ#f zHzdXZo(@f|l*S+F%H**%-2L=y_MXfOOLNerPyJ*4_SBtg?GLQF%=>g`R_x5nAyL8n zy84M0Ma`0DedABoZ2iFS1qMidc_xAYD1;3+7j8Y=L>B~EEeK;1q5bAs6~bGS1s#-G zCV%_}!7mEK4Q>RpczHs4I+wei7qwO>&Q44b$AyS9#9S_S1A>mg6m%V5bSm6lfBZVZ z@9%$HWN6#K{ih2yAwtN=>NUJITo!`FB6vgy??R%&BCr4m-H!*n59aIdvdj@=DU6Zx zn8rO?!x%y4TEc6^h2d#F0i_s)`3zH{y)$m#W+{D%NpLASxS8f-<4>fAlYBN8hN^9t zd_mzc#NH=(D3qeMbZr*$R?1X^@&|iy-U9qeI)bbMm<$yYu@dzn&IWYjRB4Eszo4D( zUx*DX=QBF_{ztKaXB+($*uc7`AY_ny9+d}n@&j7=jB;$?QGVb%Xivr{NovXy5#>cE zei)%9p>U`ph=%VEi!h815|; zzQ2Yaa8?$e=QGao{X4M>-fi+1KpY^CQHHrxKz4Kt-Q-(jkuabqDht*ME>grqkf+e` zaVa!o#^vLzU5_f@abHoRwy}y(smO}v2-;{PQE#qi8))s8(#EiEo0W#4FOc*8`c90s zw17)5^e_>sy=iO}7uQ5=Qe&IM#wk0UJg#;GdxtCyHPKx1ur7_Gm5b?lOd|TnwJ#7y zb(9@1v~vIEXYR8dwtHC%g01womScDmC z_8O&8TE)98epEJF4GHeICLNhIWmuxu@MF@jy(iCwr&nITnXPnzbm60$r9HsWyBV@}OI=qHzOixyLPe0Ehvs-V?l_ylG*3UQl(@Ty=1O z3ItLS3MrFZ>Mu;{ z118}pjr5#J9aK~QB}Wv^mp(k`vP|>Zj^)Mi*<&mIEI-ugXyvkIfAv^=wQ9;kDP??s;Gv(A zuHTms_Z6!?U!vK{>iO2VP#i2oY>Y^GD^zUqIFtGdsGCu!hM1&ZM3iA6<++}4UQKx* zp`Kwv^;(K#N^Ci6LEd3+=G7<(BTkYg~q&@B16ZefqDdHd#%?V995`OUl{5%?*x9jC-9h z9$SKRIdXIIEW1+W#%L`K@T4^RM zT3%(3$gzjzI4pMV7uk;RoPPr4tO0sDw(@L#YIJM|ipi*nET^_X=XjoT$Do~nXB0jP`vB z_!k{{_A6GS^a-XbMDFhluErE(EeGgqw7F@t{2VqR-2*ka(V@z;i^}zCW%{IPR2Ct# zRhgbe*!hk=n4r}TDr}&lDX3k}Xg2{gcS) zifezdG;DUg|Fm%Hg3f#V!Yw0GGj2W&hshE%Q7inNqt-=$!FH_CzDFY4UAbHbY)my01%|$N+EBINpftX;2R3YG zhE4DN^R5_cZ9)_#FB_&T=J3qZ-WNr1Q|^-Uv7OUUZPKcW#bwS-g=Is_BYnebACN@*sS0FeU> z<-i;Wb>0FIQD7(s=5*qpNR6XLnCKh!khc_pIM8@8$+*?f@Nw2S+FM4bRc7u>TX1}b zWmw^aYXRqZN??YY;OMt)|nGnpnZ5&>zu}40RM_MZ}+O2r0)*jg#kAxn?Fh9mi|7wpk#3LinNyJMV z?2+zxWLp)6nT(fSvPVc;k`GUD*RdFR>&0q8^21apktI>jr>{&tv;DRL!o72t@&`d_z)mzI%T!^!Ck&m*&&JY%Z>YA4=x7S>?y$kv+9{MCKk z@R}b4<(#ECE9H~Z5vLR9BqisuLm8?# z3nEA2yh4(evU$sLan>qvc1S{chB!HPi?u?0N92~wy)1h%W<(}Er))bp)_NHkUHKN! z1{+MNR$5f|S4CB>-OzhTxS^*XCqBWUn>o>T3 zyWm2DE?~B=t|8#8AE&|0AWdSIE@HmcXSW&|G~?Q}{E}n&y5fpyy5cJ($8?9B^3R>i z2T~@=OQa^2qz*nAr9gy7V&V<2#99?;`RPQ;w~G2J z#YSomeEk&^xo3+GZ=le==B<44^a;CKn|JX--IugxrhI3keUOyI|v2N6VIj8e{yY> zVWzEXoVHnJo6NIwCl-4}(D2?pBDd|_@w^v_Y%4z|`(dxhEtMh}`F-&4wl{06%8zl<;NWmx!nNj%Zr%?{k2T@+EiDEcLSN7vw z#Ad-1j?E5<)vS7}54?GWiQ=jKit2a>R-<9A(Xn~-b`cguB7)`-1ACue&#Ef|RIC{V zm0GiEZTE!fubcyd0~5pN8$&bl*wxCgz8@GdJy8xD@8Vqt%?{gDDZ$^R#r#f zsp`YKJ~InWbDo{FX`47Pesx057KRGvRoIs8ac+0M?ofS&X;)W;?)DpVHxC40Gf$QO zVl3g+!Q8SV(X+41Nhp^9q(_6l7w$7}Aj;#zYM)@swn0Q*Dd z=U(y&y0k#o;O5uhbJ;>rY8&G3Z(nwP?nSmwgYShi7J>%b=7({N^2(l~&nAoNnB+5D z@;T8yGs8KuH7*>4aQ)l}8v7%_JGGvr-e-~LZO16s>pqgVu`lvq)kd1r#>!~G>`qnH z8v6PTKlZPQ*{F%J@5Q^;lTpOi^&RN1j4EYptn7;cdI&X)_4d&{pstPN;Iz-cj^IK2 zKOkO_d}guaob}EUyIgNx&mM7}_BR8*acrMO7L}Yz*tWp%Q4fKfs@o&2y@A_`2kJ1TbgqQt>kF~`xJ=;#mYecwYn+k$VD6kA{g)?e|C zKMt?`WO>AFmDj1{WO+$5zQ(Sj>5IqPDIcgtAJ4f~?3GlT2=CkRD+2)U_2kW7)rn2A z$ITmu@)J7+NfESW5kM9*DGVIekAu_I^Vk`&O#=kqdWH&6Y8x2oRCF7L4;n^>y2sp! ze1}B39x*Sl2<>KEea27>2G!oVI^1b!z5C>jVIXg4$ngAlPj^cjhaQ$i`@F2=<5vgy zWY^rU=Pipp;#szR_7Q$ADjN5B?TWHz39qbjPo}$)%dS^BkYhc;RDN977}_RhQyp0`<9ttirhIY#7*qN@kC)Pd$FL8VwM*xIFJ)6J}25-sP z*oQS;6EpVPa-iEI7eV*d#DfX2wJn@{Tfs!;%yQ#UzZ@)!_`8XQK_98LrH4@Y;59)AT`2CTEcU>0^#pVg|57;~=HVs7X7f`iNLDiQxdJAN23DPMKwr#HYaUL-zJVr*_kAke3+K7H6b}Hd39n!EU1)XF_A6tS@hn7 zDOGD;T=xV7!B%8OJaU>+_(`G6=MmC>YTJG zc~ktRWQHmvq;QYK+1A(x7i|IVwum<4UXbIRtL-3>MYNp3Acp$m#V_wK4vq_nz%6kn zCP*j{`B=CUw~2uN@+BPH2Ms)SOk7i)i|;d+@jF+0x;r{YYP;K>oVa`Z4U>(c(9$-{ zVTP$DTT&o25^jHWDYq=v^+-?$Z;xDS`Ec;N ziTU47;3M6E2{Uatk>Jq#!8!C0Q(aLKkY=yMWG_{1;>f9v zVu((f!H+$%G%T%FMfCmPxPji=_eY4K1|MeP9-;w@F4jQ%o^!LYtwnvCb4aDXedYPN z4L5g~B=1Pyl)OcpW~~^c z06D8@N%w-R6&Naza|12qUJ#>tT1kmRqovbe$#hF=AMY~X_11o}GBbn2(Iyo9W3jIM(ZN*ae$aH2pH94=okj*pV49m z;~1)=zQp!ySomXF^$YdKudGhSTFY~)!qF&nD!c$y`b)4v{-O@7uTjs!(_B59;B8H? zN?w)}b@kB2eV1FU7Y>#!dS)%OtS}2^)HdN{7Pnw$4(CPLK@N(-|IgRLx`U>5lt{Qj|$r?An=887LUV|8v#I+mp zeLs5OE83DbhJVcFNwArqBxf2}+6s%jm7a`(Pu&yq!$7Vp?VVO0M2+k;5Z^gdekL*@ zE(1cXkVqg0D$+Y7Aqi=qC6VBGTF>sT$*-?uRUA81(*^5pVzn4hZ*=WY(F`5ZF?0C5ehoSVNm|ri@#{lNKMEdN5Tsu?? zQOuVl$Au-wZOMXtYy>St!;(3Qp&*D-=DhI%KO5#e_Tj0qSsG@iET|Ke^s3UpS0BG> z2>1M2UYfhwlYuhFDE&=+QnzRK7~k;d9sIW0r$&>PJsCau`1+hvqo-%7R?M+T!Irk~ zOL>id7C`kodA8x}S-LY{ouB(Pw2reE=zK4``F-u9(=}Lxu9}Nl+S&fp`R}GdsCcfy z`_fsz3saNL3~B;HJ@nD8`+me-sm=v5uoOR*_xDEj*+Hncp%-<6(W~i)VjMmyt=d@G zAJdC>>$3a%q(z>fTDe73u`bhZ#?A>ax(C)}5@s0fD#Q%?hvLC8MSgE1n0cT8Le+5* zwsZ{LbJyGszIWaK277s_=b0%AfcEEt_W$#5p#6yb!@(_Y*V*x_`?mu8FH@ljSb<5< z_Cj-SpALS&JFsb<VbH)wwM;)dSMc;|sfdJMzIyT{?o+2oPPF0E!|v}8}NKUVSM@@t27 zpWA&**SowXzvRk~=kgm(yXy0AEI;9L}%zMs*gzuSUZ}zN)y)@_q1C z(SL&b1?v0@*o>L?@QsRtVbPs+H&IIV#nx z$L7V!fAH|A0eHyBOR82?z2jj&Bl>P{6=OBH)*m~g4>5kkiG?U1In90k_KdfDoZH}c z#>`MhVidY16Lr1nFN-dB?z=K{{pw_RtGfN#iHPg^_Vyn0j#1T3g+*_5@tw04{p~k! zV#+<)s=gnhP)|)?qlt-%wg*iEOIOb@NSt$$Hc7T5$0j5$7faS`$%;)$NsC*P!cU2P z>kCrA==^D#ASHH3y3roL`G>V&n^NG*1DLJ4U-0dCraK(LLX`*vO5GFl36bjr>r8?EQ9yqUC3QhZ(=muM zPuHqcBab`aD0P(5Meb-i_4uSY^+^&${Oz+#i1*w<^>R~1F?dutn`j9QI%sdoy#!){;kxW5A@(-R!PFC}EG0dnsIKR9`I_m5Yu z)tB(DfU^O?23p@`>GkOQW4fs`ol)}P{oh$`1amki)&*X95onDIsw2d|(fQS@mhw}Q z(Qhaj!8_vPx1_C6}=PtH*5g2C7AhZ3mhWbm23|2_HT)Wrm?-I zA880VJ&@chQZtK6B}E4c%_>`q4sIh~K#DFf%`TqUcX43fRhq>&!s6Rfi|^}-`vxrf zHPn}_pS}#WoF=ohEwT>Kl?B*OTNPHZs%YAJUB!BPyR@(aX{iTx_7bvcsxDy;b;=I) z6q)rl9_q(@KF0d|Iq!2b111sSm^Zzwy;;!c_x;x09OCGAix>sG-Tg{Ejz|3nJZtmK z0u$+UL_IzEU*zMh6^+w4xEB2VjGtycQnv5m*!;v_j7S!Hb@vaC40DLT@z;oB&umW* zbM*v!V})DWIu6%n?NOwPm{Hl~P&pg=K(CE}r;~392HBN)i z^w>W>)3;}-G9-jtA|X3eDUlFzARNk4LL$k&-I6k@Ml*-WZ0h|n%9xNckJgOl8+%x2 zelnh26nNQ~bw7&@x(um!$jpz~WQqv6+X#N!lxgskDkW+(VUy`W$ec6>|O><$<*Li`ruuwi=-pnHGl3;T@l$lbceHWiHIe;HxQXUTACuoouq(GkYsgODj z^h#wytpog;)|u|PF}{m}iku3Vl#~WU)532rs^mZZ|f+6|7#tE%X@VctpBN__)phSKnWDoQ4puvDLJ>jpaz*ALO+-F>DT1GA%rJg#(sK{t6Cx0Y;DQrGVH_5dj?;2M2L3=d literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridvisualizationraytracingmiss_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..b44637279f342f92e439868f6067153d7c81f3b4 GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3^Wow0kVv7S8VC@od2$hTP*giP40{T0SVgcHyAE@iTKzr zf3hhh(EQi2N`LW)nb#sKjor`spV%pw{Q1#_nN}Ro&|qYU(KNsL8A}kefK^oHoBq_m OqM5O7$;5MKfJy*kF~aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3^Wow0kVu~8Jm08^p_60%gZ|672P`a6B4x7Z!lc+67jKL z{$x{1p!u(3mHy%pGp|Kf8oQtMKe1CV`SYU=Y0rqm?lwaP*=9yy$WRY+P{(6h2^1=(}VUn_CL`~W_-cSq|DC1$_NZ( zJ_cBT3oDceJntiF)-W%`V*u^7-$;@kX8ipIDs^X zZ4FcjQUh`yNS!v24>E%bh#43f_L~8DAax-7K>(!h2T(OPkhTS?1)0kO#322FK(!#d zd7)w;Js>fVTlk=2AawyiRUm!*Kn$`6q#h)12NVU#gT(&=ZL|Q{8i6hTfoWxn{E7B} z#@>Z`aRCM!vQn$wK4Se3R?EC #include #include +#include +#include +#include +#include #include #include #include @@ -278,6 +282,10 @@ namespace AZ passSystem->AddPassCreator(Name("DiffuseProbeGridClassificationPass"), &Render::DiffuseProbeGridClassificationPass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridDownsamplePass"), &Render::DiffuseProbeGridDownsamplePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRenderPass"), &Render::DiffuseProbeGridRenderPass::Create); + passSystem->AddPassCreator(Name("DiffuseProbeGridVisualizationPreparePass"), &Render::DiffuseProbeGridVisualizationPreparePass::Create); + passSystem->AddPassCreator(Name("DiffuseProbeGridVisualizationAccelerationStructurePass"), &Render::DiffuseProbeGridVisualizationAccelerationStructurePass::Create); + passSystem->AddPassCreator(Name("DiffuseProbeGridVisualizationRayTracingPass"), &Render::DiffuseProbeGridVisualizationRayTracingPass::Create); + passSystem->AddPassCreator(Name("DiffuseProbeGridVisualizationCompositePass"), &Render::DiffuseProbeGridVisualizationCompositePass::Create); passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp index 798ebc502b..b04078c893 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp @@ -43,10 +43,15 @@ namespace AZ m_irradianceImageAttachmentId = AZStd::string::format("ProbeIrradianceImageAttachmentId_%s", uuidString.c_str()); m_distanceImageAttachmentId = AZStd::string::format("ProbeDistanceImageAttachmentId_%s", uuidString.c_str()); m_probeDataImageAttachmentId = AZStd::string::format("ProbeDataImageAttachmentId_%s", uuidString.c_str()); + m_visualizationTlasAttachmentId = AZStd::string::format("ProbeVisualizationTlasAttachmentId_%s", uuidString.c_str()); + m_visualizationTlasInstancesAttachmentId = AZStd::string::format("ProbeVisualizationTlasInstancesAttachmentId_%s", uuidString.c_str()); // setup culling m_cullable.m_cullData.m_scene = m_scene; m_cullable.SetDebugName(AZ::Name("DiffuseProbeGrid Volume")); + + // create the visualization TLAS + m_visualizationTlas = AZ::RHI::RayTracingTlas::CreateRHIRayTracingTlas(); } void DiffuseProbeGrid::Simulate(uint32_t probeIndex) @@ -253,6 +258,23 @@ namespace AZ return m_cullable.m_isVisible; } + void DiffuseProbeGrid::SetVisualizationEnabled(bool visualizationEnabled) + { + m_visualizationEnabled = visualizationEnabled; + m_visualizationTlasUpdateRequired = true; + } + + void DiffuseProbeGrid::SetVisualizationSphereRadius(float visualizationSphereRadius) + { + m_visualizationSphereRadius = visualizationSphereRadius; + m_visualizationTlasUpdateRequired = true; + } + + bool DiffuseProbeGrid::GetVisualizationTlasUpdateRequired() const + { + return m_visualizationTlasUpdateRequired || m_remainingRelocationIterations > 0; + } + uint32_t DiffuseProbeGrid::GetTotalProbeCount() const { return m_probeCountX * m_probeCountY * m_probeCountZ; @@ -348,8 +370,8 @@ namespace AZ // textures have changed so we need to update the render Srg to bind the new ones m_updateRenderObjectSrg = true; - // we need to clear the irradiance texture - m_irradianceClearRequired = true; + // we need to clear the Irradiance, Distance, and ProbeData textures + m_textureClearRequired = true; } void DiffuseProbeGrid::ComputeProbeCount(const AZ::Vector3& extents, const AZ::Vector3& probeSpacing, uint32_t& probeCountX, uint32_t& probeCountY, uint32_t& probeCountZ) @@ -753,6 +775,77 @@ namespace AZ UpdateCulling(); } + void DiffuseProbeGrid::UpdateVisualizationPrepareSrg(const Data::Instance& shader, const RHI::Ptr& layout) + { + if (!m_visualizationPrepareSrg) + { + m_visualizationPrepareSrg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), shader->GetSupervariantIndex(), layout->GetName()); + AZ_Error("DiffuseProbeGrid", m_visualizationPrepareSrg.get(), "Failed to create VisualizationPrepare shader resource group"); + } + + RHI::ShaderInputConstantIndex constantIndex; + RHI::ShaderInputImageIndex imageIndex; + RHI::ShaderInputBufferIndex bufferIndex; + + // TLAS instances + bufferIndex = layout->FindShaderInputBufferIndex(AZ::Name("m_tlasInstances")); + uint32_t tlasInstancesBufferByteCount = aznumeric_cast(m_visualizationTlas->GetTlasInstancesBuffer()->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor bufferViewDescriptor = RHI::BufferViewDescriptor::CreateStructured(0, tlasInstancesBufferByteCount / RayTracingTlasInstanceElementSize, RayTracingTlasInstanceElementSize); + m_visualizationPrepareSrg->SetBufferView(bufferIndex, m_visualizationTlas->GetTlasInstancesBuffer()->GetBufferView(bufferViewDescriptor).get()); + + // probe data + imageIndex = layout->FindShaderInputImageIndex(AZ::Name("m_probeData")); + m_visualizationPrepareSrg->SetImageView(imageIndex, GetProbeDataImage()->GetImageView(m_renderData->m_probeDataImageViewDescriptor).get()); + + // probe sphere radius + constantIndex = layout->FindShaderInputConstantIndex(Name("m_probeSphereRadius")); + m_visualizationPrepareSrg->SetConstant(constantIndex, m_visualizationSphereRadius); + + SetGridConstants(m_visualizationPrepareSrg); + } + + void DiffuseProbeGrid::UpdateVisualizationRayTraceSrg(const Data::Instance& shader, const RHI::Ptr& layout, const RHI::ImageView* outputImageView) + { + if (!m_visualizationRayTraceSrg) + { + m_visualizationRayTraceSrg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), shader->GetSupervariantIndex(), layout->GetName()); + AZ_Error("DiffuseProbeGrid", m_visualizationRayTraceSrg.get(), "Failed to create VisualizationRayTrace shader resource group"); + } + + RHI::ShaderInputConstantIndex constantIndex; + RHI::ShaderInputImageIndex imageIndex; + RHI::ShaderInputBufferIndex bufferIndex; + + // TLAS + uint32_t tlasBufferByteCount = aznumeric_cast(m_visualizationTlas->GetTlasBuffer()->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor bufferViewDescriptor = RHI::BufferViewDescriptor::CreateRayTracingTLAS(tlasBufferByteCount); + + bufferIndex = layout->FindShaderInputBufferIndex(AZ::Name("m_tlas")); + m_visualizationRayTraceSrg->SetBufferView(bufferIndex, m_visualizationTlas->GetTlasBuffer()->GetBufferView(bufferViewDescriptor).get()); + + // probe irradiance + imageIndex = layout->FindShaderInputImageIndex(AZ::Name("m_probeIrradiance")); + m_visualizationRayTraceSrg->SetImageView(imageIndex, GetIrradianceImage()->GetImageView(m_renderData->m_probeIrradianceImageViewDescriptor).get()); + + // probe distance + imageIndex = layout->FindShaderInputImageIndex(AZ::Name("m_probeDistance")); + m_visualizationRayTraceSrg->SetImageView(imageIndex, GetDistanceImage()->GetImageView(m_renderData->m_probeDistanceImageViewDescriptor).get()); + + // probe data + imageIndex = layout->FindShaderInputImageIndex(AZ::Name("m_probeData")); + m_visualizationRayTraceSrg->SetImageView(imageIndex, GetProbeDataImage()->GetImageView(m_renderData->m_probeDataImageViewDescriptor).get()); + + // show inactive probes + constantIndex = layout->FindShaderInputConstantIndex(Name("m_showInactiveProbes")); + m_visualizationRayTraceSrg->SetConstant(constantIndex, m_visualizationShowInactiveProbes); + + // output + imageIndex = layout->FindShaderInputImageIndex(AZ::Name("m_output")); + m_visualizationRayTraceSrg->SetImageView(imageIndex, outputImageView); + + SetGridConstants(m_visualizationRayTraceSrg); + } + void DiffuseProbeGrid::UpdateCulling() { if (!m_drawPacket) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h index 8c8470cdad..3f65d6083a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include #include @@ -98,6 +99,15 @@ namespace AZ DiffuseProbeGridMode GetMode() const { return m_mode; } void SetMode(DiffuseProbeGridMode mode); + bool GetVisualizationEnabled() const { return m_visualizationEnabled; } + void SetVisualizationEnabled(bool visualizationEnabled); + + bool GetVisualizationShowInactiveProbes() const { return m_visualizationShowInactiveProbes; } + void SetVisualizationShowInactiveProbes(bool visualizationShowInactiveProbes) { m_visualizationShowInactiveProbes = visualizationShowInactiveProbes; } + + float GetVisualizationSphereRadius() const { return m_visualizationSphereRadius; } + void SetVisualizationSphereRadius(float visualizationSphereRadius); + uint32_t GetRemainingRelocationIterations() const { return aznumeric_cast(m_remainingRelocationIterations); } void DecrementRemainingRelocationIterations() { m_remainingRelocationIterations = AZStd::max(0, m_remainingRelocationIterations - 1); } void ResetRemainingRelocationIterations() { m_remainingRelocationIterations = DefaultNumRelocationIterations; } @@ -125,6 +135,8 @@ namespace AZ const Data::Instance& GetRelocationSrg() const { return m_relocationSrg; } const Data::Instance& GetClassificationSrg() const { return m_classificationSrg; } const Data::Instance& GetRenderObjectSrg() const { return m_renderObjectSrg; } + const Data::Instance& GetVisualizationPrepareSrg() const { return m_visualizationPrepareSrg; } + const Data::Instance& GetVisualizationRayTraceSrg() const { return m_visualizationRayTraceSrg; } // Srg updates void UpdateRayTraceSrg(const Data::Instance& shader, const RHI::Ptr& srgLayout); @@ -135,6 +147,8 @@ namespace AZ void UpdateRelocationSrg(const Data::Instance& shader, const RHI::Ptr& srgLayout); void UpdateClassificationSrg(const Data::Instance& shader, const RHI::Ptr& srgLayout); void UpdateRenderObjectSrg(); + void UpdateVisualizationPrepareSrg(const Data::Instance& shader, const RHI::Ptr& srgLayout); + void UpdateVisualizationRayTraceSrg(const Data::Instance& shader, const RHI::Ptr& srgLayout, const RHI::ImageView* outputImageView); // textures const RHI::Ptr GetRayTraceImage() { return m_rayTraceImage[m_currentImageIndex]; } @@ -151,12 +165,14 @@ namespace AZ const RHI::AttachmentId GetIrradianceImageAttachmentId() const { return m_irradianceImageAttachmentId; } const RHI::AttachmentId GetDistanceImageAttachmentId() const { return m_distanceImageAttachmentId; } const RHI::AttachmentId GetProbeDataImageAttachmentId() const { return m_probeDataImageAttachmentId; } + const RHI::AttachmentId GetProbeVisualizationTlasAttachmentId() const { return m_visualizationTlasAttachmentId; } + const RHI::AttachmentId GetProbeVisualizationTlasInstancesAttachmentId() const { return m_visualizationTlasInstancesAttachmentId; } const DiffuseProbeGridRenderData* GetRenderData() const { return m_renderData; } - // the irradiance image needs to be manually cleared after it is resized in the editor - bool GetIrradianceClearRequired() const { return m_irradianceClearRequired; } - void ResetIrradianceClearRequired() { m_irradianceClearRequired = false; } + // the Irradiance, Distance, and ProbeData images need to be manually cleared after certain operations, e.g., changing the grid size + bool GetTextureClearRequired() const { return m_textureClearRequired; } + void ResetTextureClearRequired() { m_textureClearRequired = false; } // texture readback DiffuseProbeGridTextureReadback& GetTextureReadback() { return m_textureReadback; } @@ -168,7 +184,16 @@ namespace AZ static constexpr uint32_t DefaultNumDistanceTexels = 14; static constexpr int32_t DefaultNumRelocationIterations = 100; + // visualization TLAS + const RHI::Ptr& GetVisualizationTlas() const { return m_visualizationTlas; } + RHI::Ptr& GetVisualizationTlas() { return m_visualizationTlas; } + + bool GetVisualizationTlasUpdateRequired() const; + void ResetVisualizationTlasUpdateRequired() { m_visualizationTlasUpdateRequired = false; } + private: + + // helper functions void UpdateTextures(); void ComputeProbeCount(const AZ::Vector3& extents, const AZ::Vector3& probeSpacing, uint32_t& probeCountX, uint32_t& probeCountY, uint32_t& probeCountZ); bool ValidateProbeCount(const AZ::Vector3& extents, const AZ::Vector3& probeSpacing); @@ -248,7 +273,7 @@ namespace AZ RHI::Ptr m_probeDataImage[ImageFrameCount]; uint32_t m_currentImageIndex = 0; bool m_updateTextures = false; - bool m_irradianceClearRequired = true; + bool m_textureClearRequired = true; // baked textures Data::Instance m_bakedIrradianceImage; @@ -281,6 +306,17 @@ namespace AZ RHI::AttachmentId m_irradianceImageAttachmentId; RHI::AttachmentId m_distanceImageAttachmentId; RHI::AttachmentId m_probeDataImageAttachmentId; + + // probe visualization + bool m_visualizationEnabled = false; + bool m_visualizationShowInactiveProbes = false; + float m_visualizationSphereRadius = 0.5f; + RHI::Ptr m_visualizationTlas; + bool m_visualizationTlasUpdateRequired = false; + RHI::AttachmentId m_visualizationTlasAttachmentId; + RHI::AttachmentId m_visualizationTlasInstancesAttachmentId; + Data::Instance m_visualizationPrepareSrg; + Data::Instance m_visualizationRayTraceSrg; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp index a5da79a482..0b2f74191f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp @@ -75,27 +75,34 @@ namespace AZ } } - void DiffuseProbeGridBlendDistancePass::FrameBeginInternal(FramePrepareParams params) + bool DiffuseProbeGridBlendDistancePass::IsEnabled() const { - RPI::Scene* scene = m_pipeline->GetScene(); - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + if (!RenderPass::IsEnabled()) { - // no diffuse probe grids - return; + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; } RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - AZ_Assert(rayTracingFeatureProcessor, "DiffuseProbeGridBlendDistancePass requires the RayTracingFeatureProcessor"); - - if (!rayTracingFeatureProcessor->GetSubMeshCount()) + if (!rayTracingFeatureProcessor || !rayTracingFeatureProcessor->GetSubMeshCount()) { // empty scene - return; + return false; } - RenderPass::FrameBeginInternal(params); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + return true; } void DiffuseProbeGridBlendDistancePass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h index 942f90eb10..6d9d26f9b3 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h @@ -42,8 +42,7 @@ namespace AZ void LoadShader(); // Pass overrides - void FrameBeginInternal(FramePrepareParams params) override; - + bool IsEnabled() const override; void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp index 7a12fc5415..4e29339a38 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp @@ -75,27 +75,34 @@ namespace AZ } } - void DiffuseProbeGridBlendIrradiancePass::FrameBeginInternal(FramePrepareParams params) + bool DiffuseProbeGridBlendIrradiancePass::IsEnabled() const { - RPI::Scene* scene = m_pipeline->GetScene(); - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + if (!RenderPass::IsEnabled()) { - // no diffuse probe grids - return; + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; } RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - AZ_Assert(rayTracingFeatureProcessor, "DiffuseProbeGridBlendIrradiancePass requires the RayTracingFeatureProcessor"); - - if (!rayTracingFeatureProcessor->GetSubMeshCount()) + if (!rayTracingFeatureProcessor || !rayTracingFeatureProcessor->GetSubMeshCount()) { // empty scene - return; + return false; } - RenderPass::FrameBeginInternal(params); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + return true; } void DiffuseProbeGridBlendIrradiancePass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h index 77dba9745c..a9bf9bfc31 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h @@ -42,8 +42,7 @@ namespace AZ void LoadShader(); // Pass overrides - void FrameBeginInternal(FramePrepareParams params) override; - + bool IsEnabled() const override; void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp index c4fcb49c17..ee2b638cb7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp @@ -83,27 +83,34 @@ namespace AZ } } - void DiffuseProbeGridBorderUpdatePass::FrameBeginInternal(FramePrepareParams params) + bool DiffuseProbeGridBorderUpdatePass::IsEnabled() const { - RPI::Scene* scene = m_pipeline->GetScene(); - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + if (!RenderPass::IsEnabled()) { - // no diffuse probe grids - return; + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; } RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - AZ_Assert(rayTracingFeatureProcessor, "DiffuseProbeGridBorderUpdatePass requires the RayTracingFeatureProcessor"); - - if (!rayTracingFeatureProcessor->GetSubMeshCount()) + if (!rayTracingFeatureProcessor || !rayTracingFeatureProcessor->GetSubMeshCount()) { // empty scene - return; + return false; } - RenderPass::FrameBeginInternal(params); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + return true; } void DiffuseProbeGridBorderUpdatePass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h index ee49c66f78..415231c281 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h @@ -40,8 +40,7 @@ namespace AZ RHI::DispatchDirect& dispatchArgs); // Pass overrides - void FrameBeginInternal(FramePrepareParams params) override; - + bool IsEnabled() const override; void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp index 1d1e6f745f..acb5b73c1a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp @@ -79,27 +79,34 @@ namespace AZ } } - void DiffuseProbeGridClassificationPass::FrameBeginInternal(FramePrepareParams params) + bool DiffuseProbeGridClassificationPass::IsEnabled() const { - RPI::Scene* scene = m_pipeline->GetScene(); - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + if (!RenderPass::IsEnabled()) { - // no diffuse probe grids - return; + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; } RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - AZ_Assert(rayTracingFeatureProcessor, "DiffuseProbeGridClassificationPass requires the RayTracingFeatureProcessor"); - - if (!rayTracingFeatureProcessor->GetSubMeshCount()) + if (!rayTracingFeatureProcessor || !rayTracingFeatureProcessor->GetSubMeshCount()) { // empty scene - return; + return false; } - RenderPass::FrameBeginInternal(params); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + return true; } void DiffuseProbeGridClassificationPass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) @@ -160,15 +167,11 @@ namespace AZ const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetClassificationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); - uint32_t probeCountX; - uint32_t probeCountY; - diffuseProbeGrid->GetTexture2DProbeCount(probeCountX, probeCountY); - RHI::DispatchItem dispatchItem; dispatchItem.m_arguments = shader.m_dispatchArgs; dispatchItem.m_pipelineState = shader.m_pipelineState; - dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = probeCountX; - dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = probeCountY; + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = diffuseProbeGrid->GetTotalProbeCount(); + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = 1; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsZ = 1; commandList->Submit(dispatchItem); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h index 3ec76fd0f0..894e9df098 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h @@ -43,8 +43,7 @@ namespace AZ void LoadShader(); // Pass overrides - void FrameBeginInternal(FramePrepareParams params) override; - + bool IsEnabled() const override; void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp index d690c57dea..84c066604a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -39,6 +40,7 @@ namespace AZ void DiffuseProbeGridFeatureProcessor::Activate() { RHI::RHISystemInterface* rhiSystem = RHI::RHISystemInterface::Get(); + RHI::Ptr device = rhiSystem->GetDevice(); m_diffuseProbeGrids.reserve(InitialProbeGridAllocationSize); m_realTimeDiffuseProbeGrids.reserve(InitialProbeGridAllocationSize); @@ -49,7 +51,7 @@ namespace AZ m_bufferPool = RHI::Factory::Get().CreateBufferPool(); m_bufferPool->SetName(Name("DiffuseProbeGridBoxBufferPool")); - [[maybe_unused]] RHI::ResultCode resultCode = m_bufferPool->Init(*rhiSystem->GetDevice(), desc); + [[maybe_unused]] RHI::ResultCode resultCode = m_bufferPool->Init(*device, desc); AZ_Error("DiffuseProbeGridFeatureProcessor", resultCode == RHI::ResultCode::Success, "Failed to initialize buffer pool"); // create box mesh vertices and indices @@ -61,7 +63,7 @@ namespace AZ imagePoolDesc.m_bindFlags = RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead; m_probeGridRenderData.m_imagePool = RHI::Factory::Get().CreateImagePool(); - [[maybe_unused]] RHI::ResultCode result = m_probeGridRenderData.m_imagePool->Init(*rhiSystem->GetDevice(), imagePoolDesc); + [[maybe_unused]] RHI::ResultCode result = m_probeGridRenderData.m_imagePool->Init(*device, imagePoolDesc); AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize output image pool"); } @@ -90,6 +92,22 @@ namespace AZ AZ_Error("DiffuseProbeGridFeatureProcessor", m_probeGridRenderData.m_srgLayout != nullptr, "Failed to find ObjectSrg layout"); } + // initialize the buffer pools for the DiffuseProbeGrid visualization + m_visualizationBufferPools = RHI::RayTracingBufferPools::CreateRHIRayTracingBufferPools(); + m_visualizationBufferPools->Init(device); + + // load probe visualization model, the BLAS will be created in OnAssetReady() + m_visualizationModelAsset = AZ::RPI::AssetUtils::GetAssetByProductPath( + "Models/DiffuseProbeSphere.azmodel", + AZ::RPI::AssetUtils::TraceLevel::Assert); + + if (!m_visualizationModelAsset.IsReady()) + { + m_visualizationModelAsset.QueueLoad(); + } + + Data::AssetBus::MultiHandler::BusConnect(m_visualizationModelAsset.GetId()); + EnableSceneNotification(); } @@ -106,6 +124,8 @@ namespace AZ { m_bufferPool.reset(); } + + Data::AssetBus::MultiHandler::BusDisconnect(); } void DiffuseProbeGridFeatureProcessor::Simulate([[maybe_unused]] const FeatureProcessor::SimulatePacket& packet) @@ -186,13 +206,19 @@ namespace AZ void DiffuseProbeGridFeatureProcessor::OnEndPrepareRender() { - // re-build the list of visible real-time diffuse probe grids + // re-build the list of visible diffuse probe grids + m_visibleDiffuseProbeGrids.clear(); m_visibleRealTimeDiffuseProbeGrids.clear(); - for (auto& diffuseProbeGrid : m_realTimeDiffuseProbeGrids) + for (auto& diffuseProbeGrid : m_diffuseProbeGrids) { if (diffuseProbeGrid->GetIsVisible()) { - m_visibleRealTimeDiffuseProbeGrids.push_back(diffuseProbeGrid); + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::RealTime) + { + m_visibleRealTimeDiffuseProbeGrids.push_back(diffuseProbeGrid); + } + + m_visibleDiffuseProbeGrids.push_back(diffuseProbeGrid); } } } @@ -237,6 +263,17 @@ namespace AZ m_realTimeDiffuseProbeGrids.erase(itEntry); } + // remove from side list of visible grids + itEntry = AZStd::find_if(m_visibleDiffuseProbeGrids.begin(), m_visibleDiffuseProbeGrids.end(), [&](AZStd::shared_ptr const& entry) + { + return (entry == probeGrid); + }); + + if (itEntry != m_visibleDiffuseProbeGrids.end()) + { + m_visibleDiffuseProbeGrids.erase(itEntry); + } + // remove from side list of visible real-time grids itEntry = AZStd::find_if(m_visibleRealTimeDiffuseProbeGrids.begin(), m_visibleRealTimeDiffuseProbeGrids.end(), [&](AZStd::shared_ptr const& entry) { @@ -449,6 +486,24 @@ namespace AZ probeGrid->SetBakedTextures(bakedTextures); } + void DiffuseProbeGridFeatureProcessor::SetVisualizationEnabled(const DiffuseProbeGridHandle& probeGrid, bool visualizationEnabled) + { + AZ_Assert(probeGrid.get(), "SetVisualizationEnabled called with an invalid handle"); + probeGrid->SetVisualizationEnabled(visualizationEnabled); + } + + void DiffuseProbeGridFeatureProcessor::SetVisualizationShowInactiveProbes(const DiffuseProbeGridHandle& probeGrid, bool visualizationShowInactiveProbes) + { + AZ_Assert(probeGrid.get(), "SetVisualizationShowInactiveProbes called with an invalid handle"); + probeGrid->SetVisualizationShowInactiveProbes(visualizationShowInactiveProbes); + } + + void DiffuseProbeGridFeatureProcessor::SetVisualizationSphereRadius(const DiffuseProbeGridHandle& probeGrid, float visualizationSphereRadius) + { + AZ_Assert(probeGrid.get(), "SetVisualizationSphereRadius called with an invalid handle"); + probeGrid->SetVisualizationSphereRadius(visualizationSphereRadius); + } + void DiffuseProbeGridFeatureProcessor::CreateBoxMesh() { // vertex positions @@ -613,6 +668,71 @@ namespace AZ } } + void DiffuseProbeGridFeatureProcessor::OnVisualizationModelAssetReady(Data::Asset asset) + { + Data::Asset modelAsset = asset; + + m_visualizationModel = RPI::Model::FindOrCreate(modelAsset); + AZ_Assert(m_visualizationModel.get(), "Failed to load DiffuseProbeGrid visualization model"); + + const AZStd::span>& modelLods = m_visualizationModel->GetLods(); + AZ_Assert(!modelLods.empty(), "Invalid DiffuseProbeGrid visualization model"); + if (modelLods.empty()) + { + return; + } + + const Data::Instance& modelLod = modelLods[0]; + AZ_Assert(!modelLod->GetMeshes().empty(), "Invalid DiffuseProbeGrid visualization model asset"); + if (modelLod->GetMeshes().empty()) + { + return; + } + + const RPI::ModelLod::Mesh& mesh = modelLod->GetMeshes()[0]; + + // setup a stream layout and shader input contract for the position vertex stream + static const char* PositionSemantic = "POSITION"; + static const RHI::Format PositionStreamFormat = RHI::Format::R32G32B32_FLOAT; + + RHI::InputStreamLayoutBuilder layoutBuilder; + layoutBuilder.AddBuffer()->Channel(PositionSemantic, PositionStreamFormat); + RHI::InputStreamLayout inputStreamLayout = layoutBuilder.End(); + + RPI::ShaderInputContract::StreamChannelInfo positionStreamChannelInfo; + positionStreamChannelInfo.m_semantic = RHI::ShaderSemantic(AZ::Name(PositionSemantic)); + positionStreamChannelInfo.m_componentCount = RHI::GetFormatComponentCount(PositionStreamFormat); + + RPI::ShaderInputContract shaderInputContract; + shaderInputContract.m_streamChannels.emplace_back(positionStreamChannelInfo); + + // retrieve vertex/index buffers + RPI::ModelLod::StreamBufferViewList streamBufferViews; + [[maybe_unused]] bool result = modelLod->GetStreamsForMesh( + inputStreamLayout, + streamBufferViews, + nullptr, + shaderInputContract, + 0); + AZ_Assert(result, "Failed to retrieve DiffuseProbeGrid visualization mesh stream buffer views"); + + m_visualizationVB = streamBufferViews[0]; + m_visualizationIB = mesh.m_indexBufferView; + + // create the BLAS object + RHI::RayTracingBlasDescriptor blasDescriptor; + blasDescriptor.Build() + ->Geometry() + ->VertexFormat(PositionStreamFormat) + ->VertexBuffer(m_visualizationVB) + ->IndexBuffer(m_visualizationIB) + ; + + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + m_visualizationBlas = AZ::RHI::RayTracingBlas::CreateRHIRayTracingBlas(); + m_visualizationBlas->CreateBuffers(*device, &blasDescriptor, *m_visualizationBufferPools); + } + void DiffuseProbeGridFeatureProcessor::HandleAssetNotification(Data::Asset asset, DiffuseProbeGridTextureNotificationType notificationType) { for (NotifyTextureAssetVector::iterator itNotification = m_notifyTextureAssets.begin(); itNotification != m_notifyTextureAssets.end(); ++itNotification) @@ -633,14 +753,28 @@ namespace AZ void DiffuseProbeGridFeatureProcessor::OnAssetReady(Data::Asset asset) { - HandleAssetNotification(asset, DiffuseProbeGridTextureNotificationType::Ready); + if (asset.GetId() == m_visualizationModelAsset.GetId()) + { + OnVisualizationModelAssetReady(asset); + } + else + { + HandleAssetNotification(asset, DiffuseProbeGridTextureNotificationType::Ready); + } } void DiffuseProbeGridFeatureProcessor::OnAssetError(Data::Asset asset) { - AZ_Error("ReflectionProbeFeatureProcessor", false, "Failed to load cubemap [%s]", asset.GetHint().c_str()); + if (asset.GetId() == m_visualizationModelAsset.GetId()) + { + AZ_Error("DiffuseProbeGridFeatureProcessor", false, "Failed to load probe visualization model asset [%s]", asset.GetHint().c_str()); + } + else + { + AZ_Error("DiffuseProbeGridFeatureProcessor", false, "Failed to load cubemap [%s]", asset.GetHint().c_str()); - HandleAssetNotification(asset, DiffuseProbeGridTextureNotificationType::Error); + HandleAssetNotification(asset, DiffuseProbeGridTextureNotificationType::Error); + } } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h index d0df7dfbfe..239de5ea27 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h @@ -9,6 +9,9 @@ #pragma once #include +#include +#include +#include #include namespace AZ @@ -46,6 +49,9 @@ namespace AZ void SetUseDiffuseIbl(const DiffuseProbeGridHandle& probeGrid, bool useDiffuseIbl) override; void SetMode(const DiffuseProbeGridHandle& probeGrid, DiffuseProbeGridMode mode) override; void SetBakedTextures(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridBakedTextures& bakedTextures) override; + void SetVisualizationEnabled(const DiffuseProbeGridHandle& probeGrid, bool visualizationEnabled) override; + void SetVisualizationShowInactiveProbes(const DiffuseProbeGridHandle& probeGrid, bool visualizationShowInactiveProbes) override; + void SetVisualizationSphereRadius(const DiffuseProbeGridHandle& probeGrid, float visualizationSphereRadius) override; void BakeTextures( const DiffuseProbeGridHandle& probeGrid, @@ -76,9 +82,19 @@ namespace AZ // retrieve the side list of probe grids that are using real-time (raytraced) mode DiffuseProbeGridVector& GetRealTimeProbeGrids() { return m_realTimeDiffuseProbeGrids; } - // retrieve the side list of probe grids that are using real-time (raytraced) mode and visible (on screen) + // retrieve the side list of probe grids that are visible (on screen), both real-time (raytraced) and baked + DiffuseProbeGridVector& GetVisibleProbeGrids() { return m_visibleDiffuseProbeGrids; } + + // retrieve the side list of probe grids that are real-time (raytraced) and visible (on screen) DiffuseProbeGridVector& GetVisibleRealTimeProbeGrids() { return m_visibleRealTimeDiffuseProbeGrids; } + // returns the RayTracingBufferPool used for the DiffuseProbeGrid visualization + RHI::RayTracingBufferPools& GetVisualizationBufferPools() { return *m_visualizationBufferPools; } + + // returns the RayTracingBlas for the visualization model + const RHI::Ptr& GetVisualizationBlas() const { return m_visualizationBlas; } + RHI::Ptr& GetVisualizationBlas() { return m_visualizationBlas; } + private: AZ_DISABLE_COPY_MOVE(DiffuseProbeGridFeatureProcessor); @@ -108,6 +124,9 @@ namespace AZ void UpdatePipelineStates(); void UpdatePasses(); + // loads the probe visualization model and creates the BLAS + void OnVisualizationModelAssetReady(Data::Asset asset); + // list of all diffuse probe grids const size_t InitialProbeGridAllocationSize = 64; DiffuseProbeGridVector m_diffuseProbeGrids; @@ -115,6 +134,9 @@ namespace AZ // side list of diffuse probe grids that are in real-time mode (subset of m_diffuseProbeGrids) DiffuseProbeGridVector m_realTimeDiffuseProbeGrids; + // side list of diffuse probe grids that are visible, both real-time and baked modes (subset of m_diffuseProbeGrids) + DiffuseProbeGridVector m_visibleDiffuseProbeGrids; + // side list of diffuse probe grids that are in real-time mode and visible (subset of m_realTimeDiffuseProbeGrids) DiffuseProbeGridVector m_visibleRealTimeDiffuseProbeGrids; @@ -157,6 +179,14 @@ namespace AZ }; typedef AZStd::vector NotifyTextureAssetVector; NotifyTextureAssetVector m_notifyTextureAssets; + + // visualization + RHI::Ptr m_visualizationBufferPools; + Data::Asset m_visualizationModelAsset; + RHI::Ptr m_visualizationBlas; + Data::Instance m_visualizationModel; + RHI::StreamBufferView m_visualizationVB; + RHI::IndexBufferView m_visualizationIB; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp index 7af6f4c8ec..3fa4837a23 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp @@ -107,14 +107,39 @@ namespace AZ m_rayTracingPipelineState->Init(*device.get(), &descriptor); } + bool DiffuseProbeGridRayTracingPass::IsEnabled() const + { + if (!RenderPass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); + if (!rayTracingFeatureProcessor) + { + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + return true; + } + void DiffuseProbeGridRayTracingPass::FrameBeginInternal(FramePrepareParams params) { RPI::Scene* scene = m_pipeline->GetScene(); RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - if (!rayTracingFeatureProcessor) - { - return; - } if (!m_initialized) { @@ -131,13 +156,6 @@ namespace AZ m_rayTracingShaderTable->Init(*device.get(), rayTracingBufferPools); } - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) - { - // no diffuse probe grids - return; - } - RenderPass::FrameBeginInternal(params); } @@ -156,9 +174,16 @@ namespace AZ // TLAS { AZ::RHI::AttachmentId tlasAttachmentId = rayTracingFeatureProcessor->GetTlasAttachmentId(); - if (frameGraph.GetAttachmentDatabase().IsAttachmentValid(tlasAttachmentId)) + const RHI::Ptr& rayTracingTlasBuffer = rayTracingFeatureProcessor->GetTlas()->GetTlasBuffer(); + if (rayTracingTlasBuffer) { - uint32_t tlasBufferByteCount = aznumeric_cast(rayTracingFeatureProcessor->GetTlas()->GetTlasBuffer()->GetDescriptor().m_byteCount); + if (!frameGraph.GetAttachmentDatabase().IsAttachmentValid(tlasAttachmentId)) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportBuffer(tlasAttachmentId, rayTracingTlasBuffer); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import ray tracing TLAS buffer with error %d", result); + } + + uint32_t tlasBufferByteCount = aznumeric_cast(rayTracingTlasBuffer->GetDescriptor().m_byteCount); RHI::BufferViewDescriptor tlasBufferViewDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, tlasBufferByteCount); RHI::BufferScopeAttachmentDescriptor desc; @@ -191,10 +216,10 @@ namespace AZ RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetIrradianceImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeIrradianceImageViewDescriptor; - if (diffuseProbeGrid->GetIrradianceClearRequired()) + + if (diffuseProbeGrid->GetTextureClearRequired()) { desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Clear; - diffuseProbeGrid->ResetIrradianceClearRequired(); } else { @@ -212,7 +237,15 @@ namespace AZ RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetDistanceImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeDistanceImageViewDescriptor; - desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::DontCare; + + if (diffuseProbeGrid->GetTextureClearRequired()) + { + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Clear; + } + else + { + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + } frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::ReadWrite); } @@ -225,10 +258,20 @@ namespace AZ RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetProbeDataImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeDataImageViewDescriptor; - desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + + if (diffuseProbeGrid->GetTextureClearRequired()) + { + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Clear; + } + else + { + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + } frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::ReadWrite); } + + diffuseProbeGrid->ResetTextureClearRequired(); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h index f5775f7624..13063b57a7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h @@ -45,6 +45,7 @@ namespace AZ void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; // Pass overrides + bool IsEnabled() const override; void FrameBeginInternal(FramePrepareParams params) override; // revision number of the ray tracing TLAS when the shader table was built diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp index fd23dadf6f..70b54d70cc 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp @@ -74,49 +74,71 @@ namespace AZ } } + bool DiffuseProbeGridRelocationPass::IsEnabled() const + { + if (!RenderPass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); + if (!rayTracingFeatureProcessor || !rayTracingFeatureProcessor->GetSubMeshCount()) + { + // empty scene + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + // check TLAS version + uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); + if (rayTracingDataRevision != m_rayTracingDataRevision) + { + return true; + } + + // check to see if any grids need relocation + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) + { + if (diffuseProbeGrid->GetRemainingRelocationIterations() > 0) + { + return true; + } + } + + return false; + } + void DiffuseProbeGridRelocationPass::FrameBeginInternal(FramePrepareParams params) { RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) - { - // no diffuse probe grids - return; - } - RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); AZ_Assert(rayTracingFeatureProcessor, "DiffuseProbeGridRelocationPass requires the RayTracingFeatureProcessor"); - if (!rayTracingFeatureProcessor->GetSubMeshCount()) - { - // empty scene - return; - } - - // create the Relocation Srgs for each DiffuseProbeGrid, and check to see if any grids need relocation - bool needRelocation = false; + // reset the relocation iterations on the grids if the TLAS was updated + uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) - { - uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); + { if (rayTracingDataRevision != m_rayTracingDataRevision) { // the TLAS changed, relocate probes - m_rayTracingDataRevision = rayTracingDataRevision; diffuseProbeGrid->ResetRemainingRelocationIterations(); } - - if (diffuseProbeGrid->GetRemainingRelocationIterations() > 0) - { - needRelocation = true; - } } - if (!needRelocation) - { - // no diffuseProbeGrids require relocation, this pass can be skipped entirely - return; - } + m_rayTracingDataRevision = rayTracingDataRevision; RenderPass::FrameBeginInternal(params); } @@ -160,11 +182,7 @@ namespace AZ // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) diffuseProbeGrid->UpdateRelocationSrg(m_shader, m_srgLayout); - diffuseProbeGrid->GetRelocationSrg()->Compile(); - - // relocation stops after a limited number of iterations - diffuseProbeGrid->DecrementRemainingRelocationIterations(); } } @@ -180,19 +198,30 @@ namespace AZ const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetRelocationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); - uint32_t probeCountX; - uint32_t probeCountY; - diffuseProbeGrid->GetTexture2DProbeCount(probeCountX, probeCountY); - RHI::DispatchItem dispatchItem; dispatchItem.m_arguments = m_dispatchArgs; dispatchItem.m_pipelineState = m_pipelineState; - dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = probeCountX; - dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = probeCountY; + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = diffuseProbeGrid->GetTotalProbeCount(); + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = 1; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsZ = 1; commandList->Submit(dispatchItem); } } + + void DiffuseProbeGridRelocationPass::FrameEndInternal() + { + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + // submit the DispatchItems for each DiffuseProbeGrid + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) + { + // relocation stops after a limited number of iterations + diffuseProbeGrid->DecrementRemainingRelocationIterations(); + } + + RenderPass::FrameEndInternal(); + } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h index a6ede22ee6..121c51050d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h @@ -42,11 +42,12 @@ namespace AZ void LoadShader(); // Pass overrides + bool IsEnabled() const override; void FrameBeginInternal(FramePrepareParams params) override; - void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; + void FrameEndInternal() override; // shader Data::Instance m_shader; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp index f444c0c6ba..db95e17a9e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp @@ -51,18 +51,35 @@ namespace AZ AZ_Assert(m_shaderResourceGroup, "[DiffuseProbeGridRenderPass '%s']: Failed to create SRG", GetPathName().GetCStr()); } + bool DiffuseProbeGridRenderPass::IsEnabled() const + { + if (!RenderPass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + + return true; + } + void DiffuseProbeGridRenderPass::FrameBeginInternal(FramePrepareParams params) { RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) - { - // no diffuse probe grids - return; - } - // get output attachment size AZ_Assert(GetInputOutputCount() > 0, "DiffuseProbeGridRenderPass: Could not find output bindings"); RPI::PassAttachment* m_outputAttachment = GetInputOutputBinding(0).m_attachment.get(); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h index 6f4a91d9c6..c3612649fa 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h @@ -36,7 +36,8 @@ namespace AZ explicit DiffuseProbeGridRenderPass(const RPI::PassDescriptor& descriptor); // Pass behavior overrides... - virtual void FrameBeginInternal(FramePrepareParams params) override; + bool IsEnabled() const override; + void FrameBeginInternal(FramePrepareParams params) override; // Scope producer functions... void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.cpp new file mode 100644 index 0000000000..29e50fb158 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.cpp @@ -0,0 +1,192 @@ +/* + * 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 +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + RPI::Ptr DiffuseProbeGridVisualizationAccelerationStructurePass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr diffuseProbeGridVisualizationAccelerationStructurePass = aznew DiffuseProbeGridVisualizationAccelerationStructurePass(descriptor); + return AZStd::move(diffuseProbeGridVisualizationAccelerationStructurePass); + } + + DiffuseProbeGridVisualizationAccelerationStructurePass::DiffuseProbeGridVisualizationAccelerationStructurePass(const RPI::PassDescriptor& descriptor) + : Pass(descriptor) + { + // disable this pass if we're on a platform that doesn't support raytracing + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + if (device->GetFeatures().m_rayTracing == false || !AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + SetEnabled(false); + } + } + + bool DiffuseProbeGridVisualizationAccelerationStructurePass::ShouldUpdate(const AZStd::shared_ptr& diffuseProbeGrid) const + { + return (diffuseProbeGrid->GetVisualizationEnabled() && diffuseProbeGrid->GetVisualizationTlasUpdateRequired()); + } + + bool DiffuseProbeGridVisualizationAccelerationStructurePass::IsEnabled() const + { + if (!Pass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (diffuseProbeGridFeatureProcessor) + { + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (ShouldUpdate(diffuseProbeGrid)) + { + return true; + } + } + } + + return false; + } + + void DiffuseProbeGridVisualizationAccelerationStructurePass::BuildInternal() + { + SetScopeId(RHI::ScopeId(GetPathName())); + } + + void DiffuseProbeGridVisualizationAccelerationStructurePass::FrameBeginInternal(FramePrepareParams params) + { + params.m_frameGraphBuilder->ImportScopeProducer(*this); + } + + void DiffuseProbeGridVisualizationAccelerationStructurePass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) + { + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + // import and attach the visualization TLAS buffers + RHI::Ptr& visualizationTlas = diffuseProbeGrid->GetVisualizationTlas(); + const RHI::Ptr& tlasBuffer = visualizationTlas->GetTlasBuffer(); + const RHI::Ptr& tlasInstancesBuffer = visualizationTlas->GetTlasInstancesBuffer(); + if (tlasBuffer && tlasInstancesBuffer) + { + // TLAS buffer + { + AZ::RHI::AttachmentId attachmentId = diffuseProbeGrid->GetProbeVisualizationTlasAttachmentId(); + if (frameGraph.GetAttachmentDatabase().IsAttachmentValid(attachmentId) == false) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportBuffer(attachmentId, tlasBuffer); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import DiffuseProbeGrid visualization TLAS buffer with error %d", result); + } + + uint32_t byteCount = aznumeric_cast(tlasBuffer->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor bufferViewDescriptor = RHI::BufferViewDescriptor::CreateRayTracingTLAS(byteCount); + + RHI::BufferScopeAttachmentDescriptor desc; + desc.m_attachmentId = attachmentId; + desc.m_bufferViewDescriptor = bufferViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::DontCare; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Write); + } + + // TLAS Instances buffer + { + AZ::RHI::AttachmentId attachmentId = diffuseProbeGrid->GetProbeVisualizationTlasInstancesAttachmentId(); + if (frameGraph.GetAttachmentDatabase().IsAttachmentValid(attachmentId) == false) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportBuffer(attachmentId, tlasInstancesBuffer); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import DiffuseProbeGrid visualization TLAS Instances buffer with error %d", result); + } + + uint32_t byteCount = aznumeric_cast(tlasInstancesBuffer->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor bufferViewDescriptor = RHI::BufferViewDescriptor::CreateStructured(0, byteCount / RayTracingTlasInstanceElementSize, RayTracingTlasInstanceElementSize); + + RHI::BufferScopeAttachmentDescriptor desc; + desc.m_attachmentId = attachmentId; + desc.m_bufferViewDescriptor = bufferViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Read); + } + } + } + } + + void DiffuseProbeGridVisualizationAccelerationStructurePass::BuildCommandList(const RHI::FrameGraphExecuteContext& context) + { + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + // build the visualization BLAS from the DiffuseProbeGridFeatureProcessor + // Note: the BLAS is used by all DiffuseProbeGrid visualization TLAS objects + if (m_visualizationBlasBuilt == false) + { + context.GetCommandList()->BuildBottomLevelAccelerationStructure(*diffuseProbeGridFeatureProcessor->GetVisualizationBlas()); + m_visualizationBlasBuilt = true; + } + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + if (!diffuseProbeGrid->GetVisualizationTlas()->GetTlasBuffer()) + { + continue; + } + + // build the TLAS object + context.GetCommandList()->BuildTopLevelAccelerationStructure(*diffuseProbeGrid->GetVisualizationTlas()); + } + } + + void DiffuseProbeGridVisualizationAccelerationStructurePass::FrameEndInternal() + { + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + // TLAS is now updated + diffuseProbeGrid->ResetVisualizationTlasUpdateRequired(); + } + } + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.h new file mode 100644 index 0000000000..b353b9a41a --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.h @@ -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 + * + */ +#pragma once + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + //! This pass builds the DiffuseProbeGrid visualization acceleration structure + class DiffuseProbeGridVisualizationAccelerationStructurePass final + : public RPI::Pass + , public RHI::ScopeProducer + { + public: + AZ_RPI_PASS(DiffuseProbeGridVisualizationAccelerationStructurePass); + + AZ_RTTI(DiffuseProbeGridVisualizationAccelerationStructurePass, "{103D8917-D4DC-4CA3-BFB4-CD62846D282A}", Pass); + AZ_CLASS_ALLOCATOR(DiffuseProbeGridVisualizationAccelerationStructurePass, SystemAllocator, 0); + + //! Creates a DiffuseProbeGridVisualizationAccelerationStructurePass + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + ~DiffuseProbeGridVisualizationAccelerationStructurePass() = default; + + private: + explicit DiffuseProbeGridVisualizationAccelerationStructurePass(const RPI::PassDescriptor& descriptor); + + bool ShouldUpdate(const AZStd::shared_ptr& diffuseProbeGrid) const; + + // Scope producer functions + void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; + void BuildCommandList(const RHI::FrameGraphExecuteContext& context) override; + + // Pass overrides + bool IsEnabled() const override; + void BuildInternal() override; + void FrameBeginInternal(FramePrepareParams params) override; + void FrameEndInternal() override; + + bool m_visualizationBlasBuilt = false; + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.cpp new file mode 100644 index 0000000000..722b42daf7 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.cpp @@ -0,0 +1,62 @@ +/* + * 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 Render + { + RPI::Ptr DiffuseProbeGridVisualizationCompositePass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr pass = aznew DiffuseProbeGridVisualizationCompositePass(descriptor); + return AZStd::move(pass); + } + + DiffuseProbeGridVisualizationCompositePass::DiffuseProbeGridVisualizationCompositePass(const RPI::PassDescriptor& descriptor) + : RPI::FullscreenTrianglePass(descriptor) + { + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + SetEnabled(false); + } + } + + bool DiffuseProbeGridVisualizationCompositePass::IsEnabled() const + { + if (!FullscreenTrianglePass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (diffuseProbeGridFeatureProcessor) + { + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (diffuseProbeGrid->GetVisualizationEnabled()) + { + return true; + } + } + } + + return false; + } + + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.h new file mode 100644 index 0000000000..af0109039b --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.h @@ -0,0 +1,39 @@ +/* + * 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 +{ + namespace Render + { + //! This pass composites the DiffuseProbeGrid visualization image onto the main scene + class DiffuseProbeGridVisualizationCompositePass + : public RPI::FullscreenTrianglePass + { + public: + AZ_RPI_PASS(DiffuseProbeGridVisualizationCompositePass); + + AZ_RTTI(Render::DiffuseProbeGridVisualizationCompositePass, "{64BD5779-AB30-41C1-81B7-B93D864355E5}", RPI::FullscreenTrianglePass); + AZ_CLASS_ALLOCATOR(Render::DiffuseProbeGridVisualizationCompositePass, SystemAllocator, 0); + + //! Creates a new pass without a PassTemplate + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + ~DiffuseProbeGridVisualizationCompositePass() = default; + + private: + explicit DiffuseProbeGridVisualizationCompositePass(const RPI::PassDescriptor& descriptor); + + // Pass behavior overrides... + bool IsEnabled() const override; + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.cpp new file mode 100644 index 0000000000..29d7ff4aaa --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.cpp @@ -0,0 +1,270 @@ +/* + * 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 +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + RPI::Ptr DiffuseProbeGridVisualizationPreparePass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr diffuseProbeGridVisualizationPreparePass = aznew DiffuseProbeGridVisualizationPreparePass(descriptor); + return AZStd::move(diffuseProbeGridVisualizationPreparePass); + } + + DiffuseProbeGridVisualizationPreparePass::DiffuseProbeGridVisualizationPreparePass(const RPI::PassDescriptor& descriptor) + : RenderPass(descriptor) + { + // disable this pass if we're on a platform that doesn't support raytracing + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + if (device->GetFeatures().m_rayTracing == false || !AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + SetEnabled(false); + } + else + { + LoadShader(); + } + } + + void DiffuseProbeGridVisualizationPreparePass::LoadShader() + { + // load shaders + // Note: the shader may not be available on all platforms + AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPrepare.azshader"; + m_shader = RPI::LoadCriticalShader(shaderFilePath); + if (m_shader == nullptr) + { + return; + } + + RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; + const auto& shaderVariant = m_shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); + m_pipelineState = m_shader->AcquirePipelineState(pipelineStateDescriptor); + AZ_Assert(m_pipelineState, "Failed to acquire pipeline state"); + + m_srgLayout = m_shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + AZ_Assert(m_srgLayout.get(), "Failed to find Srg layout"); + + const auto outcome = RPI::GetComputeShaderNumThreads(m_shader->GetAsset(), m_dispatchArgs); + if (!outcome.IsSuccess()) + { + AZ_Error("PassSystem", false, "[DiffuseProbeGridVisualizationPreparePass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + } + } + + bool DiffuseProbeGridVisualizationPreparePass::ShouldUpdate(const AZStd::shared_ptr& diffuseProbeGrid) const + { + return (diffuseProbeGrid->GetVisualizationEnabled() && diffuseProbeGrid->GetVisualizationTlasUpdateRequired()); + } + + bool DiffuseProbeGridVisualizationPreparePass::IsEnabled() const + { + if (!RenderPass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (diffuseProbeGridFeatureProcessor) + { + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (ShouldUpdate(diffuseProbeGrid)) + { + return true; + } + } + } + + return false; + } + + void DiffuseProbeGridVisualizationPreparePass::FrameBeginInternal(FramePrepareParams params) + { + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + // create the TLAS descriptor by adding an instance entry for each probe in the grid + RHI::RayTracingTlasDescriptor tlasDescriptor; + RHI::RayTracingTlasDescriptor* tlasDescriptorBuild = tlasDescriptor.Build(); + + // initialize the transform for each probe to Identity(), they will be updated by the compute shader + AZ::Transform transform = AZ::Transform::Identity(); + + uint32_t probeCount = diffuseProbeGrid->GetTotalProbeCount(); + for (uint32_t index = 0; index < probeCount; ++index) + { + tlasDescriptorBuild->Instance() + ->InstanceID(index) + ->HitGroupIndex(0) + ->Blas(diffuseProbeGridFeatureProcessor->GetVisualizationBlas()) + ->Transform(transform) + ; + } + + // create the TLAS buffers from on the descriptor + RHI::Ptr& visualizationTlas = diffuseProbeGrid->GetVisualizationTlas(); + visualizationTlas->CreateBuffers(*device, &tlasDescriptor, diffuseProbeGridFeatureProcessor->GetVisualizationBufferPools()); + } + + RenderPass::FrameBeginInternal(params); + } + + void DiffuseProbeGridVisualizationPreparePass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) + { + RenderPass::SetupFrameGraphDependencies(frameGraph); + + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + // import and attach the visualization TLAS and probe data + RHI::Ptr& visualizationTlas = diffuseProbeGrid->GetVisualizationTlas(); + const RHI::Ptr& tlasBuffer = visualizationTlas->GetTlasBuffer(); + const RHI::Ptr& tlasInstancesBuffer = visualizationTlas->GetTlasInstancesBuffer(); + if (tlasBuffer && tlasInstancesBuffer) + { + // TLAS buffer + { + AZ::RHI::AttachmentId attachmentId = diffuseProbeGrid->GetProbeVisualizationTlasAttachmentId(); + if (frameGraph.GetAttachmentDatabase().IsAttachmentValid(attachmentId) == false) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportBuffer(attachmentId, tlasBuffer); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import DiffuseProbeGrid visualization TLAS buffer with error %d", result); + } + + uint32_t byteCount = aznumeric_cast(tlasBuffer->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor bufferViewDescriptor = RHI::BufferViewDescriptor::CreateRayTracingTLAS(byteCount); + + RHI::BufferScopeAttachmentDescriptor desc; + desc.m_attachmentId = attachmentId; + desc.m_bufferViewDescriptor = bufferViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::DontCare; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Write); + } + + // TLAS Instances buffer + { + AZ::RHI::AttachmentId attachmentId = diffuseProbeGrid->GetProbeVisualizationTlasInstancesAttachmentId(); + if (frameGraph.GetAttachmentDatabase().IsAttachmentValid(attachmentId) == false) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportBuffer(attachmentId, tlasInstancesBuffer); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import DiffuseProbeGrid visualization TLAS Instances buffer with error %d", result); + } + + uint32_t byteCount = aznumeric_cast(tlasInstancesBuffer->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor bufferViewDescriptor = RHI::BufferViewDescriptor::CreateStructured(0, byteCount / RayTracingTlasInstanceElementSize, RayTracingTlasInstanceElementSize); + + RHI::BufferScopeAttachmentDescriptor desc; + desc.m_attachmentId = attachmentId; + desc.m_bufferViewDescriptor = bufferViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::DontCare; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Write); + } + + // probe data + { + AZ::RHI::AttachmentId attachmentId = diffuseProbeGrid->GetProbeDataImageAttachmentId(); + if (frameGraph.GetAttachmentDatabase().IsAttachmentValid(attachmentId) == false) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(attachmentId, diffuseProbeGrid->GetProbeDataImage()); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import DiffuseProbeGrid probe data buffer with error %d", result); + } + + RHI::ImageScopeAttachmentDescriptor desc; + desc.m_attachmentId = attachmentId; + desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeDataImageViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Read); + } + } + } + } + + void DiffuseProbeGridVisualizationPreparePass::CompileResources([[maybe_unused]] const RHI::FrameGraphCompileContext& context) + { + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + // the DiffuseProbeGrid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs + // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) + diffuseProbeGrid->UpdateVisualizationPrepareSrg(m_shader, m_srgLayout); + diffuseProbeGrid->GetVisualizationPrepareSrg()->Compile(); + } + } + + void DiffuseProbeGridVisualizationPreparePass::BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) + { + RHI::CommandList* commandList = context.GetCommandList(); + + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!ShouldUpdate(diffuseProbeGrid)) + { + continue; + } + + const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetVisualizationPrepareSrg()->GetRHIShaderResourceGroup(); + commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); + + RHI::DispatchItem dispatchItem; + dispatchItem.m_arguments = m_dispatchArgs; + dispatchItem.m_pipelineState = m_pipelineState; + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = diffuseProbeGrid->GetTotalProbeCount(); + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = 1; + dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsZ = 1; + + commandList->Submit(dispatchItem); + } + } + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.h new file mode 100644 index 0000000000..5e86a606aa --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.h @@ -0,0 +1,52 @@ +/* + * 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 +{ + namespace Render + { + //! This pass updates the DiffuseProbeGrid visualization TLAS instances buffer + class DiffuseProbeGridVisualizationPreparePass final + : public RPI::RenderPass + { + public: + AZ_RPI_PASS(DiffuseProbeGridVisualizationPreparePass); + + AZ_RTTI(DiffuseProbeGridVisualizationPreparePass, "{33BD769D-378B-4142-8C11-6A2ADA2BB095}", Pass); + AZ_CLASS_ALLOCATOR(DiffuseProbeGridVisualizationPreparePass, SystemAllocator, 0); + + //! Creates a DiffuseProbeGridVisualizationPreparePass + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + ~DiffuseProbeGridVisualizationPreparePass() = default; + + private: + explicit DiffuseProbeGridVisualizationPreparePass(const RPI::PassDescriptor& descriptor); + + void LoadShader(); + bool ShouldUpdate(const AZStd::shared_ptr& diffuseProbeGrid) const; + + // Pass overrides + bool IsEnabled() const override; + void FrameBeginInternal(FramePrepareParams params) override; + void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; + void CompileResources(const RHI::FrameGraphCompileContext& context) override; + void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; + + // shader + Data::Instance m_shader; + const RHI::PipelineState* m_pipelineState = nullptr; + RHI::Ptr m_srgLayout; + RHI::DispatchDirect m_dispatchArgs; + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.cpp new file mode 100644 index 0000000000..69c033f76c --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.cpp @@ -0,0 +1,300 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + RPI::Ptr DiffuseProbeGridVisualizationRayTracingPass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr pass = aznew DiffuseProbeGridVisualizationRayTracingPass(descriptor); + return AZStd::move(pass); + } + + DiffuseProbeGridVisualizationRayTracingPass::DiffuseProbeGridVisualizationRayTracingPass(const RPI::PassDescriptor& descriptor) + : RPI::RenderPass(descriptor) + { + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + if (device->GetFeatures().m_rayTracing == false || !AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // raytracing or GI is not supported on this platform + SetEnabled(false); + } + } + + void DiffuseProbeGridVisualizationRayTracingPass::CreateRayTracingPipelineState() + { + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + + // load the ray tracing shader + // Note: the shader may not be available on all platforms + AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracing.azshader"; + m_rayTracingShader = RPI::LoadCriticalShader(shaderFilePath); + if (m_rayTracingShader == nullptr) + { + return; + } + + auto shaderVariant = m_rayTracingShader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + RHI::PipelineStateDescriptorForRayTracing rayGenerationShaderDescriptor; + shaderVariant.ConfigurePipelineState(rayGenerationShaderDescriptor); + + // closest hit shader + AZStd::string closestHitShaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingClosestHit.azshader"; + m_closestHitShader = RPI::LoadCriticalShader(closestHitShaderFilePath); + + auto closestHitShaderVariant = m_closestHitShader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + RHI::PipelineStateDescriptorForRayTracing closestHitShaderDescriptor; + closestHitShaderVariant.ConfigurePipelineState(closestHitShaderDescriptor); + + // miss shader + AZStd::string missShaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingMiss.azshader"; + m_missShader = RPI::LoadCriticalShader(missShaderFilePath); + + auto missShaderVariant = m_missShader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + RHI::PipelineStateDescriptorForRayTracing missShaderDescriptor; + missShaderVariant.ConfigurePipelineState(missShaderDescriptor); + + // global pipeline state and Srg + m_globalPipelineState = m_rayTracingShader->AcquirePipelineState(rayGenerationShaderDescriptor); + AZ_Assert(m_globalPipelineState, "Failed to acquire ray tracing global pipeline state"); + + m_globalSrgLayout = m_rayTracingShader->FindShaderResourceGroupLayout(Name{ "RayTracingGlobalSrg" }); + AZ_Assert(m_globalSrgLayout != nullptr, "Failed to find RayTracingGlobalSrg layout for shader [%s]", shaderFilePath.c_str()); + + // build the ray tracing pipeline state descriptor + RHI::RayTracingPipelineStateDescriptor descriptor; + descriptor.Build() + ->PipelineState(m_globalPipelineState.get()) + ->MaxPayloadSize(64) + ->MaxAttributeSize(32) + ->MaxRecursionDepth(2) + ->ShaderLibrary(rayGenerationShaderDescriptor) + ->RayGenerationShaderName(AZ::Name("RayGen")) + ->ShaderLibrary(missShaderDescriptor) + ->MissShaderName(AZ::Name("Miss")) + ->ShaderLibrary(closestHitShaderDescriptor) + ->ClosestHitShaderName(AZ::Name("ClosestHit")) + ->HitGroup(AZ::Name("HitGroup")) + ->ClosestHitShaderName(AZ::Name("ClosestHit")); + + // create the ray tracing pipeline state object + m_rayTracingPipelineState = RHI::Factory::Get().CreateRayTracingPipelineState(); + m_rayTracingPipelineState->Init(*device.get(), &descriptor); + } + + bool DiffuseProbeGridVisualizationRayTracingPass::IsEnabled() const + { + if (!RenderPass::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + if (diffuseProbeGridFeatureProcessor) + { + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (diffuseProbeGrid->GetVisualizationEnabled()) + { + return true; + } + } + } + + return false; + } + + void DiffuseProbeGridVisualizationRayTracingPass::FrameBeginInternal(FramePrepareParams params) + { + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + if (!m_initialized) + { + CreateRayTracingPipelineState(); + m_initialized = true; + } + + if (!m_rayTracingShaderTable) + { + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + RHI::RayTracingBufferPools& rayTracingBufferPools = diffuseProbeGridFeatureProcessor->GetVisualizationBufferPools(); + + m_rayTracingShaderTable = RHI::Factory::Get().CreateRayTracingShaderTable(); + m_rayTracingShaderTable->Init(*device.get(), rayTracingBufferPools); + + AZStd::shared_ptr descriptor = AZStd::make_shared(); + + // build the ray tracing shader table descriptor + descriptor->Build(AZ::Name("RayTracingShaderTable"), m_rayTracingPipelineState) + ->RayGenerationRecord(AZ::Name("RayGen")) + ->MissRecord(AZ::Name("Miss")) + ->HitGroupRecord(AZ::Name("HitGroup")) + ; + + m_rayTracingShaderTable->Build(descriptor); + } + + RenderPass::FrameBeginInternal(params); + } + + void DiffuseProbeGridVisualizationRayTracingPass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) + { + RenderPass::SetupFrameGraphDependencies(frameGraph); + + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!diffuseProbeGrid->GetVisualizationEnabled()) + { + continue; + } + + // TLAS + { + AZ::RHI::AttachmentId tlasAttachmentId = diffuseProbeGrid->GetProbeVisualizationTlasAttachmentId(); + const RHI::Ptr& visualizationTlasBuffer = diffuseProbeGrid->GetVisualizationTlas()->GetTlasBuffer(); + if (visualizationTlasBuffer) + { + if (!frameGraph.GetAttachmentDatabase().IsAttachmentValid(tlasAttachmentId)) + { + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportBuffer(tlasAttachmentId, visualizationTlasBuffer); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import ray tracing TLAS buffer with error %d", result); + } + + uint32_t tlasBufferByteCount = aznumeric_cast(visualizationTlasBuffer->GetDescriptor().m_byteCount); + RHI::BufferViewDescriptor tlasBufferViewDescriptor = RHI::BufferViewDescriptor::CreateRaw(0, tlasBufferByteCount); + + RHI::BufferScopeAttachmentDescriptor desc; + desc.m_attachmentId = tlasAttachmentId; + desc.m_bufferViewDescriptor = tlasBufferViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::ReadWrite); + } + } + + // probe irradiance + { + RHI::ImageScopeAttachmentDescriptor desc; + desc.m_attachmentId = diffuseProbeGrid->GetIrradianceImageAttachmentId(); + desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeIrradianceImageViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Read); + } + + // probe distance + { + RHI::ImageScopeAttachmentDescriptor desc; + desc.m_attachmentId = diffuseProbeGrid->GetDistanceImageAttachmentId(); + desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeDistanceImageViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Read); + } + + // probe data + { + RHI::ImageScopeAttachmentDescriptor desc; + desc.m_attachmentId = diffuseProbeGrid->GetProbeDataImageAttachmentId(); + desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeDataImageViewDescriptor; + desc.m_loadStoreAction.m_loadAction = AZ::RHI::AttachmentLoadAction::Load; + + frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::Read); + } + } + + // retrieve the visualization image size, this will determine the number of rays to cast + RPI::Ptr visualizationImageAttachment = m_ownedAttachments[0]; + AZ_Assert(visualizationImageAttachment.get(), "Invalid DiffuseProbeGrid Visualization image"); + + m_outputAttachmentSize = visualizationImageAttachment->GetTransientImageDescriptor().m_imageDescriptor.m_size; + } + + void DiffuseProbeGridVisualizationRayTracingPass::CompileResources([[maybe_unused]] const RHI::FrameGraphCompileContext& context) + { + const RHI::ImageView* outputImageView = context.GetImageView(GetOutputBinding(0).m_attachment->GetAttachmentId()); + AZ_Assert(outputImageView, "Failed to retrieve output ImageView"); + + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!diffuseProbeGrid->GetVisualizationEnabled()) + { + continue; + } + + // the DiffuseProbeGridVisualization Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader + // inputs (see line ValidateSetImageView() in ShaderResourceGroupData.cpp) + diffuseProbeGrid->UpdateVisualizationRayTraceSrg(m_rayTracingShader, m_globalSrgLayout, outputImageView); + diffuseProbeGrid->GetVisualizationRayTraceSrg()->Compile(); + } + } + + void DiffuseProbeGridVisualizationRayTracingPass::BuildCommandListInternal([[maybe_unused]] const RHI::FrameGraphExecuteContext& context) + { + RPI::Scene* scene = m_pipeline->GetScene(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); + + const AZStd::vector& views = m_pipeline->GetViews(RPI::PipelineViewTag{ "MainCamera" }); + if (views.empty()) + { + return; + } + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleProbeGrids()) + { + if (!diffuseProbeGrid->GetVisualizationEnabled()) + { + continue; + } + + const RHI::ShaderResourceGroup* shaderResourceGroups[] = { + diffuseProbeGrid->GetVisualizationRayTraceSrg()->GetRHIShaderResourceGroup(), + views[0]->GetRHIShaderResourceGroup() + }; + + RHI::DispatchRaysItem dispatchRaysItem; + dispatchRaysItem.m_width = m_outputAttachmentSize.m_width; + dispatchRaysItem.m_height = m_outputAttachmentSize.m_height; + dispatchRaysItem.m_depth = 1; + dispatchRaysItem.m_rayTracingPipelineState = m_rayTracingPipelineState.get(); + dispatchRaysItem.m_rayTracingShaderTable = m_rayTracingShaderTable.get(); + dispatchRaysItem.m_shaderResourceGroupCount = RHI::ArraySize(shaderResourceGroups); + dispatchRaysItem.m_shaderResourceGroups = shaderResourceGroups; + dispatchRaysItem.m_globalPipelineState = m_globalPipelineState.get(); + + // submit the DispatchRays item + context.GetCommandList()->Submit(dispatchRaysItem); + } + } + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.h new file mode 100644 index 0000000000..c2e5ecf3de --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.h @@ -0,0 +1,67 @@ +/* + * 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 +#include +#include + +namespace AZ +{ + namespace Render + { + //! Ray tracing shader that generates the probe visualization image for a DiffuseProbeGrid + class DiffuseProbeGridVisualizationRayTracingPass final + : public RPI::RenderPass + { + public: + AZ_RPI_PASS(DiffuseProbeGridVisualizationRayTracingPass); + + AZ_RTTI(DiffuseProbeGridVisualizationRayTracingPass, "{CDFB5C03-08D1-4FCA-8B63-2F8326E0DF1D}", RPI::RenderPass); + AZ_CLASS_ALLOCATOR(DiffuseProbeGridVisualizationRayTracingPass, SystemAllocator, 0); + + //! Creates a DiffuseProbeGridVisualizationRayTracingPass + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + ~DiffuseProbeGridVisualizationRayTracingPass() = default; + + private: + explicit DiffuseProbeGridVisualizationRayTracingPass(const RPI::PassDescriptor& descriptor); + + void CreateRayTracingPipelineState(); + + // Scope producer functions + void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override; + void CompileResources(const RHI::FrameGraphCompileContext& context) override; + void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; + + // Pass overrides + bool IsEnabled() const override; + void FrameBeginInternal(FramePrepareParams params) override; + + // ray tracing shader and pipeline state + Data::Instance m_rayTracingShader; + Data::Instance m_missShader; + Data::Instance m_closestHitShader; + RHI::Ptr m_rayTracingPipelineState; + + // ray tracing shader table + RHI::Ptr m_rayTracingShaderTable; + + // current size of output attachment, updated every frame + RHI::Size m_outputAttachmentSize; + + // ray tracing global shader resource group layout and pipeline state + RHI::Ptr m_globalSrgLayout; + RHI::ConstPtr m_globalPipelineState; + + bool m_initialized = false; + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.h index d098fca35a..dce340807d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.h @@ -24,6 +24,8 @@ namespace AZ static const uint32_t RayTracingSceneSrgBindingSlot = 1; static const uint32_t RayTracingMaterialSrgBindingSlot = 2; + static const uint32_t RayTracingTlasInstanceElementSize = 64; + enum class RayTracingSubMeshBufferFlags : uint32_t { None = 0, diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 1ec6402b3e..6ba0ed1165 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -140,6 +140,14 @@ set(FILES Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.h + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationPreparePass.cpp + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.h + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationAccelerationStructurePass.cpp + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.h + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationRayTracingPass.cpp + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.h + Source/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationCompositePass.cpp Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.h Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.cpp Source/DisplayMapper/AcesOutputTransformPass.cpp diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingAccelerationStructure.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingAccelerationStructure.h index cd58ee359f..ce12d12162 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingAccelerationStructure.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingAccelerationStructure.h @@ -182,6 +182,7 @@ namespace AZ //! Returns the TLAS RHI buffer virtual const RHI::Ptr GetTlasBuffer() const = 0; + virtual const RHI::Ptr GetTlasInstancesBuffer() const = 0; private: // Platform API diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingBufferPools.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingBufferPools.h index 288a83b4da..6b3e2a4abd 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingBufferPools.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RayTracingBufferPools.h @@ -46,7 +46,7 @@ namespace AZ virtual RHI::BufferBindFlags GetShaderTableBufferBindFlags() const { return RHI::BufferBindFlags::ShaderRead | RHI::BufferBindFlags::CopyRead | RHI::BufferBindFlags::RayTracingShaderTable; } virtual RHI::BufferBindFlags GetScratchBufferBindFlags() const { return RHI::BufferBindFlags::ShaderReadWrite | RHI::BufferBindFlags::RayTracingScratchBuffer; } virtual RHI::BufferBindFlags GetBlasBufferBindFlags() const { return RHI::BufferBindFlags::ShaderReadWrite | RHI::BufferBindFlags::RayTracingAccelerationStructure; } - virtual RHI::BufferBindFlags GetTlasInstancesBufferBindFlags() const { return RHI::BufferBindFlags::ShaderRead; } + virtual RHI::BufferBindFlags GetTlasInstancesBufferBindFlags() const { return RHI::BufferBindFlags::ShaderReadWrite; } virtual RHI::BufferBindFlags GetTlasBufferBindFlags() const { return RHI::BufferBindFlags::RayTracingAccelerationStructure; } private: diff --git a/Gems/Atom/RHI/Code/Source/RHI/RayTracingBufferPools.cpp b/Gems/Atom/RHI/Code/Source/RHI/RayTracingBufferPools.cpp index 3ef2ba05ac..7899d9b5d0 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RayTracingBufferPools.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RayTracingBufferPools.cpp @@ -97,7 +97,7 @@ namespace AZ // create TLAS Instances buffer pool { RHI::BufferPoolDescriptor bufferPoolDesc; - bufferPoolDesc.m_heapMemoryLevel = RHI::HeapMemoryLevel::Host; + bufferPoolDesc.m_heapMemoryLevel = RHI::HeapMemoryLevel::Device; bufferPoolDesc.m_bindFlags = GetTlasInstancesBufferBindFlags(); m_tlasInstancesBufferPool = RHI::Factory::Get().CreateBufferPool(); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.cpp index c28c5e4db5..a91f995671 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.cpp @@ -54,7 +54,7 @@ namespace AZ // create instances buffer buffers.m_tlasInstancesBuffer = RHI::Factory::Get().CreateBuffer(); AZ::RHI::BufferDescriptor tlasInstancesBufferDescriptor; - tlasInstancesBufferDescriptor.m_bindFlags = RHI::BufferBindFlags::ShaderRead; + tlasInstancesBufferDescriptor.m_bindFlags = RHI::BufferBindFlags::ShaderReadWrite; tlasInstancesBufferDescriptor.m_byteCount = instanceDescsSizeInBytes; tlasInstancesBufferDescriptor.m_alignment = D3D12_RAYTRACING_INSTANCE_DESCS_BYTE_ALIGNMENT; diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.h index accc43ec92..41aad8cf87 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/RayTracingTlas.h @@ -40,7 +40,8 @@ namespace AZ const TlasBuffers& GetBuffers() const { return m_buffers[m_currentBufferIndex]; } // RHI::RayTracingTlas overrides... - virtual const RHI::Ptr GetTlasBuffer() const override { return m_buffers[m_currentBufferIndex].m_tlasBuffer; } + const RHI::Ptr GetTlasBuffer() const override { return m_buffers[m_currentBufferIndex].m_tlasBuffer; } + const RHI::Ptr GetTlasInstancesBuffer() const override { return m_buffers[m_currentBufferIndex].m_tlasInstancesBuffer; } private: RayTracingTlas() = default; diff --git a/Gems/Atom/RHI/Null/Code/Source/RHI/RayTracingTlas.h b/Gems/Atom/RHI/Null/Code/Source/RHI/RayTracingTlas.h index 7bb0316230..a3e5d8c558 100644 --- a/Gems/Atom/RHI/Null/Code/Source/RHI/RayTracingTlas.h +++ b/Gems/Atom/RHI/Null/Code/Source/RHI/RayTracingTlas.h @@ -26,7 +26,8 @@ namespace AZ static RHI::Ptr Create(); // RHI::RayTracingTlas overrides... - virtual const RHI::Ptr GetTlasBuffer() const override { return nullptr; } + const RHI::Ptr GetTlasBuffer() const override { return nullptr; } + const RHI::Ptr GetTlasInstancesBuffer() const override { return nullptr; } private: RayTracingTlas() = default; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp index c1d87b0211..6211adf35c 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp @@ -970,6 +970,26 @@ namespace AZ const VkAccelerationStructureBuildRangeInfoKHR& offsetInfo = tlasBuffers.m_offsetInfo; const VkAccelerationStructureBuildRangeInfoKHR* pOffsetInfo = &offsetInfo; vkCmdBuildAccelerationStructuresKHR(GetNativeCommandBuffer(), 1, &tlasBuffers.m_buildInfo, &pOffsetInfo); + + // we need a pipeline barrier on VK_ACCESS_ACCELERATION_STRUCTURE (both read and write) in case we are building + // multiple TLAS objects in a command list + VkMemoryBarrier memoryBarrier = {}; + memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER; + memoryBarrier.pNext = nullptr; + memoryBarrier.srcAccessMask = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR | VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR; + memoryBarrier.dstAccessMask = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR | VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR; + + vkCmdPipelineBarrier( + GetNativeCommandBuffer(), + VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, + VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, + 0, + 1, + &memoryBarrier, + 0, + nullptr, + 0, + nullptr); } void CommandList::ClearImage(const ResourceClearRequest& request) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBufferPools.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBufferPools.h index a7547c7106..0ae3b37c50 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBufferPools.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingBufferPools.h @@ -24,8 +24,8 @@ namespace AZ static RHI::Ptr Create() { return aznew RayTracingBufferPools; } protected: - virtual RHI::BufferBindFlags GetShaderTableBufferBindFlags() const override { return RHI::BufferBindFlags::CopyRead | RHI::BufferBindFlags::RayTracingShaderTable; } - virtual RHI::BufferBindFlags GetTlasInstancesBufferBindFlags() const override { return RHI::BufferBindFlags::ShaderRead | RHI::BufferBindFlags::RayTracingAccelerationStructure; } + RHI::BufferBindFlags GetShaderTableBufferBindFlags() const override { return RHI::BufferBindFlags::CopyRead | RHI::BufferBindFlags::RayTracingShaderTable; } + RHI::BufferBindFlags GetTlasInstancesBufferBindFlags() const override { return RHI::BufferBindFlags::ShaderReadWrite | RHI::BufferBindFlags::RayTracingAccelerationStructure; } private: RayTracingBufferPools() = default; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp index 08b933c96b..b081e3f82d 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.cpp @@ -60,7 +60,7 @@ namespace AZ // create instances buffer buffers.m_tlasInstancesBuffer = RHI::Factory::Get().CreateBuffer(); AZ::RHI::BufferDescriptor tlasInstancesBufferDescriptor; - tlasInstancesBufferDescriptor.m_bindFlags = RHI::BufferBindFlags::ShaderRead | RHI::BufferBindFlags::RayTracingAccelerationStructure; + tlasInstancesBufferDescriptor.m_bindFlags = RHI::BufferBindFlags::ShaderReadWrite | RHI::BufferBindFlags::RayTracingAccelerationStructure; tlasInstancesBufferDescriptor.m_byteCount = instanceDescsSizeInBytes; AZ::RHI::BufferInitRequest tlasInstancesBufferRequest; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.h index 96d5f8f5f6..55fcf481af 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/RayTracingTlas.h @@ -43,7 +43,8 @@ namespace AZ const TlasBuffers& GetBuffers() const { return m_buffers[m_currentBufferIndex]; } // RHI::RayTracingTlas overrides... - virtual const RHI::Ptr GetTlasBuffer() const override { return m_buffers[m_currentBufferIndex].m_tlasBuffer; } + const RHI::Ptr GetTlasBuffer() const override { return m_buffers[m_currentBufferIndex].m_tlasBuffer; } + const RHI::Ptr GetTlasInstancesBuffer() const override { return m_buffers[m_currentBufferIndex].m_tlasInstancesBuffer; } private: RayTracingTlas() = default; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h index 91c4e2bcf4..32d77c1c3a 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h @@ -20,5 +20,6 @@ namespace AZ static constexpr float DefaultDiffuseProbeGridViewBias = 0.2f; static constexpr float DefaultDiffuseProbeGridNormalBias = 0.1f; static constexpr DiffuseProbeGridNumRaysPerProbe DefaultDiffuseProbeGridNumRaysPerProbe = DiffuseProbeGridNumRaysPerProbe::NumRaysPerProbe_288; + static constexpr float DefaultVisualizationSphereRadius = 0.5f; } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp index 8c8b29a053..9aa58c1082 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp @@ -34,7 +34,7 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(2) // Added NumRaysPerProbe setting + ->Version(3) // Added probe visualization ->Field("ProbeSpacing", &DiffuseProbeGridComponentConfig::m_probeSpacing) ->Field("Extents", &DiffuseProbeGridComponentConfig::m_extents) ->Field("AmbientMultiplier", &DiffuseProbeGridComponentConfig::m_ambientMultiplier) @@ -49,6 +49,9 @@ namespace AZ ->Field("BakedIrradianceTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedIrradianceTextureAsset) ->Field("BakedDistanceTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedDistanceTextureAsset) ->Field("BakedProbeDataTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedProbeDataTextureAsset) + ->Field("VisualizationEnabled", &DiffuseProbeGridComponentConfig::m_visualizationEnabled) + ->Field("VisualizationShowInactiveProbes", &DiffuseProbeGridComponentConfig::m_visualizationShowInactiveProbes) + ->Field("VisualizationSphereRadius", &DiffuseProbeGridComponentConfig::m_visualizationSphereRadius) ; } } @@ -140,6 +143,9 @@ namespace AZ m_featureProcessor->SetViewBias(m_handle, m_configuration.m_viewBias); m_featureProcessor->SetNormalBias(m_handle, m_configuration.m_normalBias); m_featureProcessor->SetNumRaysPerProbe(m_handle, m_configuration.m_numRaysPerProbe); + m_featureProcessor->SetVisualizationEnabled(m_handle, m_configuration.m_visualizationEnabled); + m_featureProcessor->SetVisualizationShowInactiveProbes(m_handle, m_configuration.m_visualizationShowInactiveProbes); + m_featureProcessor->SetVisualizationSphereRadius(m_handle, m_configuration.m_visualizationSphereRadius); // load the baked texture assets, but only if they are all valid if (m_configuration.m_bakedIrradianceTextureAsset.GetId().IsValid() && @@ -356,6 +362,39 @@ namespace AZ m_configuration.m_runtimeMode = runtimeMode; } + void DiffuseProbeGridComponentController::SetVisualizationEnabled(bool visualizationEnabled) + { + if (!m_featureProcessor) + { + return; + } + + m_configuration.m_visualizationEnabled = visualizationEnabled; + m_featureProcessor->SetVisualizationEnabled(m_handle, m_configuration.m_visualizationEnabled); + } + + void DiffuseProbeGridComponentController::SetVisualizationShowInactiveProbes(bool visualizationShowInactiveProbes) + { + if (!m_featureProcessor) + { + return; + } + + m_configuration.m_visualizationShowInactiveProbes = visualizationShowInactiveProbes; + m_featureProcessor->SetVisualizationShowInactiveProbes(m_handle, m_configuration.m_visualizationShowInactiveProbes); + } + + void DiffuseProbeGridComponentController::SetVisualizationSphereRadius(float visualizationSphereRadius) + { + if (!m_featureProcessor) + { + return; + } + + m_configuration.m_visualizationSphereRadius = visualizationSphereRadius; + m_featureProcessor->SetVisualizationSphereRadius(m_handle, m_configuration.m_visualizationSphereRadius); + } + void DiffuseProbeGridComponentController::BakeTextures(DiffuseProbeGridBakeTexturesCallback callback) { if (!m_featureProcessor) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h index 8f84954b2c..44cab5fc32 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h @@ -48,6 +48,10 @@ namespace AZ Data::Asset m_bakedDistanceTextureAsset; Data::Asset m_bakedProbeDataTextureAsset; + bool m_visualizationEnabled = false; + bool m_visualizationShowInactiveProbes = false; + float m_visualizationSphereRadius = DefaultVisualizationSphereRadius; + AZ::u64 m_entityId{ EntityId::InvalidEntityId }; }; @@ -102,6 +106,9 @@ namespace AZ void SetNumRaysPerProbe(const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe); void SetEditorMode(DiffuseProbeGridMode editorMode); void SetRuntimeMode(DiffuseProbeGridMode runtimeMode); + void SetVisualizationEnabled(bool visualizationEnabled); + void SetVisualizationShowInactiveProbes(bool visualizationShowInactiveProbes); + void SetVisualizationSphereRadius(float visualizationSphereRadius); // Bake the diffuse probe grid textures to assets void BakeTextures(DiffuseProbeGridBakeTexturesCallback callback); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp index 6588b18636..dd4ffd25e6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp @@ -43,6 +43,9 @@ namespace AZ ->Field("numRaysPerProbe", &EditorDiffuseProbeGridComponent::m_numRaysPerProbe) ->Field("editorMode", &EditorDiffuseProbeGridComponent::m_editorMode) ->Field("runtimeMode", &EditorDiffuseProbeGridComponent::m_runtimeMode) + ->Field("showVisualization", &EditorDiffuseProbeGridComponent::m_showVisualization) + ->Field("showInactiveProbes", &EditorDiffuseProbeGridComponent::m_showInactiveProbes) + ->Field("visualizationSphereRadius", &EditorDiffuseProbeGridComponent::m_visualizationSphereRadius) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -94,10 +97,22 @@ namespace AZ ->Attribute(Edit::Attributes::Step, 0.1f) ->Attribute(Edit::Attributes::Min, 0.0f) ->Attribute(Edit::Attributes::Max, 1.0f) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_numRaysPerProbe, "Number of Rays Per Probe", "Number of rays cast by each probe to detect lighting in its surroundings") + ->DataElement(AZ::Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_numRaysPerProbe, "Number of Rays Per Probe", "Number of rays cast by each probe to detect lighting in its surroundings") ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnNumRaysPerProbeChanged) ->Attribute(AZ::Edit::Attributes::EnumValues, &EditorDiffuseProbeGridComponent::GetNumRaysPerProbeEnumList) - ->ClassElement(AZ::Edit::ClassElements::EditorData, "Grid mode") + ->ClassElement(AZ::Edit::ClassElements::Group, "Visualization") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &EditorDiffuseProbeGridComponent::m_showVisualization, "Show Visualization", "Show the probe grid visualization") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnShowVisualizationChanged) + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &EditorDiffuseProbeGridComponent::m_showInactiveProbes, "Show Inactive Probes", "Show inactive probes in the probe grid visualization") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnShowInactiveProbesChanged) + ->DataElement(AZ::Edit::UIHandlers::Slider, &EditorDiffuseProbeGridComponent::m_visualizationSphereRadius, "Visualization Sphere Radius", "Radius of the spheres in the probe grid visualization") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnVisualizationSphereRadiusChanged) + ->Attribute(Edit::Attributes::Decimals, 2) + ->Attribute(Edit::Attributes::Step, 0.25f) + ->Attribute(Edit::Attributes::Min, 0.25f) + ->Attribute(Edit::Attributes::Max, 2.0f) + ->ClassElement(AZ::Edit::ClassElements::Group, "Grid mode") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_editorMode, "Editor Mode", "Controls whether the editor uses RealTime or Baked diffuse GI. RealTime requires a ray-tracing capable GPU. Auto-Select will fallback to Baked if ray-tracing is not available") ->Attribute(AZ::Edit::Attributes::ChangeValidate, &EditorDiffuseProbeGridComponent::OnModeChangeValidate) @@ -350,6 +365,24 @@ namespace AZ return AZ::Edit::PropertyRefreshLevels::None; } + AZ::u32 EditorDiffuseProbeGridComponent::OnShowVisualizationChanged() + { + m_controller.SetVisualizationEnabled(m_showVisualization); + return AZ::Edit::PropertyRefreshLevels::None; + } + + AZ::u32 EditorDiffuseProbeGridComponent::OnShowInactiveProbesChanged() + { + m_controller.SetVisualizationShowInactiveProbes(m_showInactiveProbes); + return AZ::Edit::PropertyRefreshLevels::None; + } + + AZ::u32 EditorDiffuseProbeGridComponent::OnVisualizationSphereRadiusChanged() + { + m_controller.SetVisualizationSphereRadius(m_visualizationSphereRadius); + return AZ::Edit::PropertyRefreshLevels::None; + } + AZ::Outcome EditorDiffuseProbeGridComponent::OnModeChangeValidate([[maybe_unused]] void* newValue, [[maybe_unused]] const AZ::Uuid& valueType) { DiffuseProbeGridMode newMode = (*(reinterpret_cast(newValue))); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h index c7832902a8..2b3d4dfe0e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h @@ -69,6 +69,9 @@ namespace AZ AZ::u32 OnNumRaysPerProbeChanged(); AZ::u32 OnEditorModeChanged(); AZ::u32 OnRuntimeModeChanged(); + AZ::u32 OnShowVisualizationChanged(); + AZ::u32 OnShowInactiveProbesChanged(); + AZ::u32 OnVisualizationSphereRadiusChanged(); AZ::Outcome OnModeChangeValidate(void* newValue, const AZ::Uuid& valueType); // Button handler @@ -85,6 +88,9 @@ namespace AZ DiffuseProbeGridNumRaysPerProbe m_numRaysPerProbe = DefaultDiffuseProbeGridNumRaysPerProbe; DiffuseProbeGridMode m_editorMode = DiffuseProbeGridMode::RealTime; DiffuseProbeGridMode m_runtimeMode = DiffuseProbeGridMode::RealTime; + bool m_showVisualization = false; + bool m_showInactiveProbes = false; + float m_visualizationSphereRadius = DefaultVisualizationSphereRadius; // flags bool m_editorModeSet = false; From ec76a4d64740f945335eb07a8bab8f8c46b297f4 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Sat, 29 Jan 2022 20:59:22 -0700 Subject: [PATCH 340/394] Always relocate probes after the texture is cleared Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseGlobalIllumination/DiffuseProbeGrid.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp index b04078c893..ac7d4bbb4d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp @@ -121,9 +121,6 @@ namespace AZ // recompute the number of probes since the spacing changed UpdateProbeCount(); - // probes need to be relocated since the grid density changed - m_remainingRelocationIterations = DefaultNumRelocationIterations; - m_updateTextures = true; } @@ -174,9 +171,6 @@ namespace AZ m_obbWs = Obb::CreateFromPositionRotationAndHalfLengths(m_transform.GetTranslation(), m_transform.GetRotation(), m_renderExtents / 2.0f); - // probes need to be relocated since the grid extents changed - m_remainingRelocationIterations = DefaultNumRelocationIterations; - m_updateTextures = true; } @@ -206,9 +200,6 @@ namespace AZ } m_updateTextures = true; - - // probes need to be relocated since the mode has changed - m_remainingRelocationIterations = DefaultNumRelocationIterations; } void DiffuseProbeGrid::SetBakedTextures(const DiffuseProbeGridBakedTextures& bakedTextures) @@ -363,6 +354,9 @@ namespace AZ [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeDataImage image"); } + + // probes need to be relocated since the textures changed + m_remainingRelocationIterations = DefaultNumRelocationIterations; } m_updateTextures = false; From aa093945a6f7c3d43f7f0422000f736edf4a641f Mon Sep 17 00:00:00 2001 From: Daniel Edwards Date: Thu, 27 Jan 2022 23:04:15 +0100 Subject: [PATCH 341/394] Remove an unused variable and explicitly initialize some bools to false Signed-off-by: Daniel Edwards --- Code/Editor/EditorPreferencesPageAWS.cpp | 2 +- Code/Editor/Objects/EntityObject.cpp | 2 -- Code/Editor/Settings.cpp | 2 +- .../Source/Editor/Attribution/AWSCoreAttributionManager.cpp | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Code/Editor/EditorPreferencesPageAWS.cpp b/Code/Editor/EditorPreferencesPageAWS.cpp index 968969245d..bb57802e47 100644 --- a/Code/Editor/EditorPreferencesPageAWS.cpp +++ b/Code/Editor/EditorPreferencesPageAWS.cpp @@ -101,7 +101,7 @@ void CEditorPreferencesPage_AWS::SaveSettingsRegistryFile() return; } - [[maybe_unused]] bool saved{}; + [[maybe_unused]] bool saved = false; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; if (AZ::IO::SystemFile outputFile; outputFile.Open(resolvedPath.data(), configurationMode)) diff --git a/Code/Editor/Objects/EntityObject.cpp b/Code/Editor/Objects/EntityObject.cpp index 450a15766c..0d70d47d7d 100644 --- a/Code/Editor/Objects/EntityObject.cpp +++ b/Code/Editor/Objects/EntityObject.cpp @@ -499,14 +499,12 @@ void CEntityObject::AdjustLightProperties(CVarBlockPtr& properties, const char* pAreaLight->SetHumanName("PlanarLight"); } - bool bCastShadowLegacy = false; // Backward compatibility for existing shadow casting lights if (IVariable* pCastShadowVarLegacy = FindVariableInSubBlock(properties, pSubBlockVar, "bCastShadow")) { pCastShadowVarLegacy->SetFlags(pCastShadowVarLegacy->GetFlags() | IVariable::UI_INVISIBLE); const QString zeroPrefix("0"); if (!pCastShadowVarLegacy->GetDisplayValue().startsWith(zeroPrefix)) { - bCastShadowLegacy = true; pCastShadowVarLegacy->SetDisplayValue(zeroPrefix); } } diff --git a/Code/Editor/Settings.cpp b/Code/Editor/Settings.cpp index 9efe846b9e..a3f08a24b2 100644 --- a/Code/Editor/Settings.cpp +++ b/Code/Editor/Settings.cpp @@ -1084,7 +1084,7 @@ void SEditorSettings::SaveSettingsRegistryFile() return; } - [[maybe_unused]] bool saved{}; + [[maybe_unused]] bool saved = false; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; diff --git a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp index c52d3be088..8b75a26a43 100644 --- a/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp +++ b/Gems/AWSCore/Code/Source/Editor/Attribution/AWSCoreAttributionManager.cpp @@ -223,7 +223,7 @@ namespace AWSCore return; } - [[maybe_unused]] bool saved {}; + [[maybe_unused]] bool saved = false; constexpr auto configurationMode = AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY; if (AZ::IO::SystemFile outputFile; outputFile.Open(resolvedPathAWSPreference.c_str(), configurationMode)) From 42a812bb04ca0de1fde664b1a052ed64da5007cd Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Sun, 30 Jan 2022 02:13:38 -0800 Subject: [PATCH 342/394] Removing transmission from terrain PBR shader Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl index c9c3e0ab00..119a81e49c 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl @@ -177,9 +177,8 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) surface.CalculateRoughnessA(); } - // Clear Coat, Transmission (Not used for terrain) + // Clear Coat surface.clearCoat.InitializeToZero(); - surface.transmission.InitializeToZero(); // ------- LightingData ------- @@ -211,7 +210,7 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(surface.transmission.tint); + lightingData.FinalizeLighting(); PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); From 79f4fee96014d7b4c7508fd00ef6ca059f7f8034 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Sun, 30 Jan 2022 09:55:40 -0800 Subject: [PATCH 343/394] Manipulator for params (#7231) Signed-off-by: rhhong --- .../Code/Tools/EMStudio/AtomRenderPlugin.cpp | 2 - .../EMStudioSDK/Source/EMStudioManager.cpp | 3 ++ .../EMStudioSDK/Source/EMStudioManager.h | 5 +++ .../Vector3GizmoParameterEditor.cpp | 44 +++++++++++++++++++ .../Vector3GizmoParameterEditor.h | 9 +++- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp index 660f8e52d7..c39012d303 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp @@ -28,8 +28,6 @@ namespace EMStudio { AZ_CLASS_ALLOCATOR_IMPL(AtomRenderPlugin, EMotionFX::EditorAllocator, 0); - const AzToolsFramework::ManipulatorManagerId g_animManipulatorManagerId = - AzToolsFramework::ManipulatorManagerId(AZ::Crc32("AnimManipulatorManagerId")); AtomRenderPlugin::AtomRenderPlugin() : DockWidgetPlugin() diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp index 6881e49429..efc895c0b5 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp @@ -500,6 +500,9 @@ namespace EMStudio painter.drawPath(path); } + const AzToolsFramework::ManipulatorManagerId g_animManipulatorManagerId = + AzToolsFramework::ManipulatorManagerId(AZ::Crc32("AnimManipulatorManagerId")); + // shortcuts QApplication* GetApp() { diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h index 1d60773e1f..753086ca01 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h @@ -31,6 +31,8 @@ #include "MainWindow.h" #include +#include + // include Qt #include #include @@ -169,6 +171,9 @@ namespace EMStudio EventProcessingCallback* m_eventProcessingCallback = nullptr; }; + // Define the manipulator id for atom viewport in animation editor. + extern const AzToolsFramework::ManipulatorManagerId g_animManipulatorManagerId; + // Shortcuts QApplication* GetApp(); EMStudioManager* GetManager(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.cpp index 7a24ece95a..9993161b70 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.cpp @@ -25,6 +25,8 @@ namespace EMStudio , m_currentValue(0.0f, 0.0f, 0.0f) , m_gizmoButton(nullptr) , m_transformationGizmo(nullptr) + , m_translationManipulators( + AzToolsFramework::TranslationManipulators::Dimensions::Three, AZ::Transform::Identity(), AZ::Vector3::CreateOne()) { UpdateValue(); } @@ -102,6 +104,27 @@ namespace EMStudio m_gizmoButton->setCheckable(true); m_gizmoButton->setEnabled(!IsReadOnly()); m_manipulatorCallback = manipulatorCallback; + + // Setup the translation manipulator + AzToolsFramework::ConfigureTranslationManipulatorAppearance3d(&m_translationManipulators); + m_translationManipulators.InstallLinearManipulatorMouseMoveCallback( + [this](const AzToolsFramework::LinearManipulator::Action& action) + { + OnManipulatorMoved(action.LocalPosition()); + }); + + m_translationManipulators.InstallPlanarManipulatorMouseMoveCallback( + [this](const AzToolsFramework::PlanarManipulator::Action& action) + { + OnManipulatorMoved(action.LocalPosition()); + }); + + m_translationManipulators.InstallSurfaceManipulatorMouseMoveCallback( + [this](const AzToolsFramework::SurfaceManipulator::Action& action) + { + OnManipulatorMoved(action.LocalPosition()); + }); + return m_gizmoButton; } @@ -183,6 +206,17 @@ namespace EMStudio EMStudioManager::MakeTransparentButton(m_gizmoButton, "Images/Icons/Vector3GizmoDisabled.png", "Show/Hide translation gizmo for visual manipulation"); } + // These will enable/disable the translation manipulator for atom render viewport. + if (m_translationManipulators.Registered()) + { + m_translationManipulators.Unregister(); + } + else + { + m_translationManipulators.Register(g_animManipulatorManagerId); + } + + // These will enable/disable the translation manipulator for opengl render viewport. if (!m_transformationGizmo) { m_transformationGizmo = static_cast(GetManager()->AddTransformationManipulator(new MCommon::TranslateManipulator(70.0f, true))); @@ -197,4 +231,14 @@ namespace EMStudio m_transformationGizmo = nullptr; } } + + void Vector3GizmoParameterEditor::OnManipulatorMoved(const AZ::Vector3& position) + { + m_translationManipulators.SetLocalPosition(position); + SetValue(position); + if (m_manipulatorCallback) + { + m_manipulatorCallback(); + } + } } diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.h index 92dd40923d..71d6d63cda 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/ParameterEditor/Vector3GizmoParameterEditor.h @@ -8,7 +8,8 @@ #pragma once -#include "ValueParameterEditor.h" +#include +#include #include @@ -50,10 +51,16 @@ namespace EMStudio AZ::Vector3 GetMinValue() const; AZ::Vector3 GetMaxValue() const; + void OnManipulatorMoved(const AZ::Vector3& position); + private: AZ::Vector3 m_currentValue = AZ::Vector3::CreateZero(); QPushButton* m_gizmoButton = nullptr; + + // TODO: Remove this when we remove the opengl widget MCommon::TranslateManipulator* m_transformationGizmo = nullptr; + + AzToolsFramework::TranslationManipulators m_translationManipulators; AZStd::function m_manipulatorCallback; }; } // namespace EMStudio From d7b3d33711e179d835008215b1526b080ca4f08c Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Mon, 31 Jan 2022 01:57:34 -0800 Subject: [PATCH 344/394] chore: simplify logic for handling expanding entries in Outliner (#5219) (#5394) * chore: simplify logic for handling expanding entries in Outliner Signed-off-by: Michael Pollind * bugfix: fix bottom border for collapsed prefabs. issue: https://github.com/o3de/o3de/issues/5219 Signed-off-by: Michael Pollind * chore: revert changes for expanding entities Signed-off-by: Michael Pollind --- .../UI/Outliner/EntityOutlinerListModel.cpp | 13 +---- .../UI/Outliner/EntityOutlinerListModel.hxx | 2 - .../UI/Outliner/EntityOutlinerTreeView.cpp | 55 +++++++++++++++++++ .../UI/Outliner/EntityOutlinerTreeView.hxx | 6 ++ .../UI/Outliner/EntityOutlinerWidget.cpp | 5 -- .../UI/Outliner/EntityOutlinerWidget.hxx | 1 - 6 files changed, 62 insertions(+), 20 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp index 93e4ffd3da..45363f4bb5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp @@ -80,7 +80,6 @@ namespace AzToolsFramework EntityOutlinerListModel::EntityOutlinerListModel(QObject* parent) : QAbstractItemModel(parent) , m_entitySelectQueue() - , m_entityExpandQueue() , m_entityChangeQueue() , m_entityChangeQueued(false) , m_entityLayoutQueued(false) @@ -1275,7 +1274,6 @@ namespace AzToolsFramework void EntityOutlinerListModel::QueueEntityToExpand(AZ::EntityId entityId, bool expand) { m_entityExpansionState[entityId] = expand; - m_entityExpandQueue.insert(entityId); QueueEntityUpdate(entityId); } @@ -1300,16 +1298,7 @@ namespace AzToolsFramework { return; } - - { - AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ExpandQueue"); - for (auto entityId : m_entityExpandQueue) - { - emit ExpandEntity(entityId, IsExpanded(entityId)); - }; - m_entityExpandQueue.clear(); - } - + { AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:SelectQueue"); for (auto entityId : m_entitySelectQueue) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.hxx index f099ed504a..51d047e81a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.hxx @@ -156,7 +156,6 @@ namespace AzToolsFramework void ProcessEntityUpdates(); Q_SIGNALS: - void ExpandEntity(const AZ::EntityId& entityId, bool expand); void SelectEntity(const AZ::EntityId& entityId, bool select); void EnableSelectionUpdates(bool enable); void ResetFilter(); @@ -190,7 +189,6 @@ namespace AzToolsFramework void QueueEntityToExpand(AZ::EntityId entityId, bool expand); void ProcessEntityInfoResetEnd(); AZStd::unordered_set m_entitySelectQueue; - AZStd::unordered_set m_entityExpandQueue; AZStd::unordered_set m_entityChangeQueue; bool m_entityChangeQueued; bool m_entityLayoutQueued; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp index 857fdb5f80..c2bbebb72e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.cpp @@ -81,6 +81,61 @@ namespace AzToolsFramework update(); } + void EntityOutlinerTreeView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector& roles) + { + AzQtComponents::StyledTreeView::dataChanged(topLeft, bottomRight, roles); + + if (topLeft.isValid() && topLeft.parent() == bottomRight.parent() && topLeft.row() <= bottomRight.row() && + topLeft.column() <= bottomRight.column()) + { + for (int i = topLeft.row(); i <= bottomRight.row(); i++) + { + auto modelRow = topLeft.sibling(i, EntityOutlinerListModel::ColumnName); + if (modelRow.isValid()) + { + checkExpandedState(modelRow); + } + } + } + } + + void EntityOutlinerTreeView::rowsInserted(const QModelIndex& parent, int start, int end) + { + if (parent.isValid()) + { + for (int i = start; i <= end; i++) + { + auto modelRow = model()->index(i, EntityOutlinerListModel::ColumnName, parent); + if (modelRow.isValid()) + { + checkExpandedState(modelRow); + recursiveCheckExpandedStates(modelRow); + } + } + } + AzQtComponents::StyledTreeView::rowsInserted(parent, start, end); + } + + void EntityOutlinerTreeView::recursiveCheckExpandedStates(const QModelIndex& current) + { + const int rowCount = model()->rowCount(current); + for (int i = 0; i < rowCount; i++) + { + auto modelRow = model()->index(i, EntityOutlinerListModel::ColumnName, current); + if (modelRow.isValid()) + { + checkExpandedState(modelRow); + recursiveCheckExpandedStates(modelRow); + } + } + } + + void EntityOutlinerTreeView::checkExpandedState(const QModelIndex& current) + { + const bool expandState = current.data(EntityOutlinerListModel::ExpandedRole).template value(); + setExpanded(current, expandState); + } + void EntityOutlinerTreeView::mousePressEvent(QMouseEvent* event) { //postponing normal mouse pressed logic until mouse is released or dragged diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx index 9262da9a73..014bb7bd48 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerTreeView.hxx @@ -51,6 +51,10 @@ namespace AzToolsFramework Q_SIGNALS: void ItemDropped(); + protected Q_SLOTS: + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) override; + void rowsInserted(const QModelIndex &parent, int start, int end) override; + protected: // Qt overrides void mousePressEvent(QMouseEvent* event) override; @@ -75,6 +79,8 @@ namespace AzToolsFramework void ClearQueuedMouseEvent(); void processQueuedMousePressedEvent(QMouseEvent* event); + void recursiveCheckExpandedStates(const QModelIndex& parent); + void checkExpandedState(const QModelIndex& current); void StartCustomDrag(const QModelIndexList& indexList, Qt::DropActions supportedActions) override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index 31bb067603..52b688543a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -224,7 +224,6 @@ namespace AzToolsFramework connect(m_gui->m_objectTree, &QTreeView::expanded, this, &EntityOutlinerWidget::OnTreeItemExpanded); connect(m_gui->m_objectTree, &QTreeView::collapsed, this, &EntityOutlinerWidget::OnTreeItemCollapsed); connect(m_gui->m_objectTree, &EntityOutlinerTreeView::ItemDropped, this, &EntityOutlinerWidget::OnDropEvent); - connect(m_listModel, &EntityOutlinerListModel::ExpandEntity, this, &EntityOutlinerWidget::OnExpandEntity); connect(m_listModel, &EntityOutlinerListModel::SelectEntity, this, &EntityOutlinerWidget::OnSelectEntity); connect(m_listModel, &EntityOutlinerListModel::EnableSelectionUpdates, this, &EntityOutlinerWidget::OnEnableSelectionUpdates); connect(m_listModel, &EntityOutlinerListModel::ResetFilter, this, &EntityOutlinerWidget::ClearFilter); @@ -972,10 +971,6 @@ namespace AzToolsFramework m_listModel->OnEntityCollapsed(entityId); } - void EntityOutlinerWidget::OnExpandEntity(const AZ::EntityId& entityId, bool expand) - { - m_gui->m_objectTree->setExpanded(GetIndexFromEntityId(entityId), expand); - } void EntityOutlinerWidget::OnSelectEntity(const AZ::EntityId& entityId, bool selected) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx index e6c42fa64e..38d2e16199 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx @@ -155,7 +155,6 @@ namespace AzToolsFramework void OnTreeItemDoubleClicked(const QModelIndex& index); void OnTreeItemExpanded(const QModelIndex& index); void OnTreeItemCollapsed(const QModelIndex& index); - void OnExpandEntity(const AZ::EntityId& entityId, bool expand); void OnSelectEntity(const AZ::EntityId& entityId, bool selected); void OnEnableSelectionUpdates(bool enable); void OnDropEvent(); From 2068c225d1410aa02e3c228acc9e0cecddb4169d Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:25:58 +0100 Subject: [PATCH 345/394] Motion Matching (#7232) commit 0c873fc67f0250ec7155e1999c34930b23c7647f Author: Benjamin Jillich Date: Wed Jan 26 10:05:07 2022 +0100 Motion Matching: Automated tests for the feature matrix and feature schema (#38) * Set up base motion matching test fixture * Automated tests for feature matrix * Automated tests for feature schema Signed-off-by: Benjamin Jillich commit cbd4f124481faf4c8bf0b98ae4602140f231e2fb Author: Benjamin Jillich Date: Tue Jan 25 09:59:32 2022 +0100 Motion Matching: User adjustable algorithm via UI and new residual calculation option (#37) * Added the feature properties to the edit context. As all the preparation work has been done, this finalizes the adjustable algorithm UI work. * Added a new residual calculation type for calculating the differences between the input query calues and the features extracted from the motion database. Either the differences are just used as an absolute value or they are squared. "Use 'Squared' in case minimal differences should be ignored and larger differences should overweight others. Use 'Absolute' for linear differences and don't want the mentioned effect." * Added comments and edit context data element descriptions about the feature properties. Signed-off-by: Benjamin Jillich commit ddad62b994be1e89cc394b28863faa44650c8ed1 Author: Benjamin Jillich Date: Fri Jan 21 09:37:55 2022 +0100 Motion Matching: Replaced the MotionMatchEventData with a DiscardFrameEventData and a TagEventData (#36) * Replaced the MotionMatchEventData with a DiscardFrameEventData and a TagEventData * Moved the system components and modules into the EMFX::MotionMatching namespace * Converted all the animation assetinfos to use the new discard frame motion event. * A few other fixes and code cleaning. Signed-off-by: Benjamin Jillich commit f022ab4f3adbe5dc141998bc368a8ca9290698be Author: Benjamin Jillich Date: Thu Jan 20 07:29:01 2022 +0100 Motion Matching: Refactoring [Part 4] Introduced MotionMatchingData (#35) * Renamed MotionMatchingConfig into MotionMatchingData while removing the feature schema from it as that needs to be part of the anim graph node in order to be reflected by the edit context so that users can change the features used in the algorithm. * Default feature schema is applied in the anim graph node in case none got de-serialized along with the node (e.g. when creating a new motion matching node). * Added a few class descriptions. * Fixed the lowest cost search frequency, which was used as the inverse (the time interval) while the UI and variable was named frequency. * Removed the hard-coded weighting for the past and future trajectory and created new members for the cost factors in the trajectory feature. Signed-off-by: Benjamin Jillich commit e05b96b0eb734cd4818e343d5b46dbb54712faf0 Author: Benjamin Jillich Date: Wed Jan 19 10:36:20 2022 +0100 Motion Matching: Architecture and Feature Schema Diagrams and README pass (#34) * Added architecture diagram * Added feature schema diagram * First pass on ReadMe.md Signed-off-by: Benjamin Jillich commit d50deb1f9eea79e9c56b3ded1bda62f755e3e97f Author: Benjamin Jillich Date: Wed Jan 19 10:35:44 2022 +0100 Motion Matching: Refactoring [Part 3] Moved feature schema, matix and the kd-tree to the config and removed the feature database (#33) * Removed feature database which contained the feature schema, feature matrix and the kd-tree. * Feature schema, feature matrix and the kd-tree are now part of the motion matching config. * DebugDraw moved from the config to the instance. * FindLowestCostFrameIndex moved from the config to the instance. * Kd-tree now has a helper to calculate the number of dimensions based on a feature set. * SaveToCsv moved from the feature database to the feature matrix directly. Signed-off-by: Benjamin Jillich commit 09aff543822a2a3e092edc65cfca315a83e25730 Author: Benjamin Jillich Date: Fri Jan 14 17:08:18 2022 +0100 Motion Matching: Refactoring [Part 2] - Added new default feature schema and removed hard-coded locomotion config (#32) * Added a new FeatureSchemaDefault class that creates the default feature schema (left/right foot position and velocity, pelvis velocity and root trajectory). * Removed the LocomotionConfig and moved the functionality like the FindLowestCostFrameIndex() to the motion matching config. * Moved more per-instance data to the motion matching instance where they actually belong like the temporary cost vectors or the cached trajectory feature pointer. * Added cost factor to the feature base class so that users can weight the costs of the features and adjust them in the UI later on. * Removed the hard-coded cost factors from the motion matching node. * Using the new, customizable config rather than the hard-coded locomotion config in the motion matching node. Signed-off-by: Benjamin Jillich commit 8eba891a7b599d81a1ad7cbed841e342034fee9f Author: Benjamin Jillich Date: Thu Jan 13 08:56:26 2022 +0100 Motion Matching: Refactoring [Part 1] (#31) * Storing the joint and relative to joint as strings in the feature so that we can later expose it to the UI. * Joint indices will be cached with initializing the features. * Some more code cleaning here and there. Signed-off-by: Benjamin Jillich commit 31e689015afaf61ededb50d4d3c5dddb61561603 Author: Benjamin Jillich Date: Tue Jan 11 18:34:56 2022 +0100 Motion Matching: Created feature schema class and separated funtionality out from the feature database (#30) * Created new feature schema class which holds the set of features involved in the motion matching search. The schema represents the order of the features as well as their settings while the feature matrix stores the actual feature data. * Untangled feature database with the feature schema functionality and it now just holds a feature schema. * Code cleaning (removed Allocators.cpp, fixed alignment, renamed some variables. Signed-off-by: Benjamin Jillich commit c407959bd5dd1c38a283900815624a8103173d37 Author: Benjamin Jillich Date: Tue Jan 11 13:11:51 2022 +0100 Motion Matching: Eigen SDK is now optional and a simple NxN matrix equivalent is provided (#29) * Eigen SDK is now optional and users can opt-in manually. * Simple NxN matrix class provided for convenience that currently wraps all features needed to run motion matching (default). Signed-off-by: Benjamin Jillich commit dbd27a6ce68674e6fd3fcc9ca59c4d57884a133c Author: Benjamin Jillich Date: Mon Jan 10 08:54:01 2022 +0100 Motion Matching: Added pose data for joint velocities and unified the broad-phase query filling (#28) * Added PoseDataJointVelocities class that extends the pose with relative to a given joint based velocities. * Unified the broad-phase search using the KD-tree by getting rid of the hard-coded fill query feature value calls. We're now just iterating over the features. * Adding the new pose data to the factory from within the MM gem. * Joint velocities are calculated before each motion matching search for the query pose. * Moved the debug draw helper from the locomotion config to the base class. * Some code cleaning. Signed-off-by: Benjamin Jillich commit 7ec4151fede3046379bdbdab86459cc3684c730c Author: Benjamin Jillich Date: Tue Jan 4 09:20:38 2022 +0100 Motion Matching: Yet another round of timing improvements (#26) Motion Matching: Yet another timing improvement * Sampling the input query pose for the motion matching search algorithm for the new motion time as the motion instance has not been updated with the time delta when we do the search. So we pre-sample the future pose to not get little lags as the search was done on the last current pose, which is a time delta old already. * Fixed a bug: We never updated the previous motion instance while we were still blending between the poses. Basically we were blending with a static pose after switching to a new best matching frame. This increased smoothness obviously. * Re-enabled motion extraction delta blending now that we fixed the above bug which gave another smoothness increase. * Renaming MM behavior into config (#27) * Behavior -> MotionMatchingConfig * LocomotionBehavior -> LocomotionConfig * BehaviorInstance -> MotionMatchingInstance * Removed the MotionMatchSystem and cleaned up reflection * Moved to namespace EMotionFX::MotionMatching Signed-off-by: Benjamin Jillich commit e9c6d6fd74641bed90e57efeb5b65ad00ad44562 Author: Benjamin Jillich Date: Fri Dec 10 10:52:06 2021 +0100 Improved smoothness and increased trajectory facing direction influence (#25) * When switching to a new best matching frame we were lagging a frame behind when updating the motion instance time. * Increased the influence of the facing direction as we have two different position difference costs while only one facing direction cost. Signed-off-by: Benjamin Jillich commit f4a5d041a0d3c0bb747dd155a30a1ac993511db7 Author: Benjamin Jillich Date: Wed Dec 8 08:54:16 2021 +0100 Sampling poses for velocity feature directly from the motion data + some refactoring (#24) * New helper to calculate the velocity without a motion instance and sample the poses directly from the motion. * New helper to draw velocities other than the actual feature for a frame. * Now sharing the frame cost context between the position and the trajectory feature. The velocity feature can't use that yet as it needs custom velocity information. Will address that later. * After the changes, we were able to greatly simplify the extract features routine in the feature database as no motion instances are required anymore to extract the features from the source motions! * Some refactoring: Renamed some variables and classes for more sense. Signed-off-by: Benjamin Jillich commit 94e0ce6e6995cd4893eb5dada1119467dc26e360 Author: Benjamin Jillich Date: Fri Dec 3 09:02:09 2021 +0100 Sampling poses for trajectory feature directly from the motion data (#23) * Introduced a new SamplePose() helper to the Frame class which allows sampling a pose of the given frame without a motion instance. We can also apply a time offset to sample a pose before/after the frame which will be needed to sample trajectories or velocities as the Frame objects are sampled at 30 Hz currently. In case the offset reached the animation boundaries, the sample time will be clamped to the animation range. * The trajectory feature now samples the poses using the new helper directly from the motion data and does not need a motion instance object anymore which helps on the path towards multi-threading and also makes the code more readable and less error-prone. Signed-off-by: Benjamin Jillich commit 590ea3ddef575003f29e6d03b6db498a37da23a6 Author: Benjamin Jillich Date: Thu Dec 2 09:20:48 2021 +0100 Motion Matching: Motion extraction sometimes outputs zero movement and results in stuttering (#22) The problem was that after the motion matching algorithm determined a better matching frame and we started a cross-fade, at that given frame the motion extraction delta was outputting a zero vector, resulting in a little stutters at the mm update frequency. This happened because the exrtaction calculation was done before the motion instance time values were updated and also the previous time values weren't set correctly when switching the frame/animation. Signed-off-by: Benjamin Jillich commit 6d0b64fd4ce2e4b3ad696c6cc5f3935447a7782e Author: Benjamin Jillich Date: Wed Dec 1 17:05:49 2021 +0100 Motion Matching: Facing direction support (#21) * Added facing direction to the trajectory feature based on a forward facing axis of the character asset. * The facing direction is calculated in model/animation space relative to the root joint of the character of the current frame. * As the trajectory is looking into the past/future of the current frame the facing direction is relative to the root joint of another frame, either in the future or the past. * The facing direction cost is the normalized difference (normalized dot product) between the current character facing direction and the expected one from the used frame in the database. * The trajectory history as well as the trajectory query got extended by a facing direction. * Added visualization for facing direction. Signed-off-by: Benjamin Jillich commit a552881139debfba2b489b8e23d57cb2556635c1 Author: Benjamin Jillich Date: Wed Nov 24 11:02:03 2021 +0100 Motion Matching: Moved velocity feature from normalized direction and speed to a scaled vector (#20) * More stable representation for joints that remain motionless. * Skipping velocity debug visualizations for zero velocities. Signed-off-by: Benjamin Jillich commit 5a27e1db3de3d4ac753208a3c4af9bc2115f5b40 Author: Benjamin Jillich Date: Thu Nov 18 13:11:15 2021 +0100 Motion Matching: Final tweaks for Phase 1 milestone (#19) * Added pelvis velocity feature to smooth out sudden direction changes of it. * Blending motion extraction delta as it results in smoother motion extraction after all of the fixes from the last weeks Signed-off-by: Benjamin Jillich commit c928dc5502cc9cbb4df3fccdae60039e68571c77 Author: Benjamin Jillich Date: Tue Nov 16 12:45:13 2021 +0100 Motion Matching: Move debug rendering to use DebugDisplayBus & some code cleaning (#18) * Debug drawing for LY Editor as well as Animation Editor in the new Atom viewport. * Ported from Atom aux geom to render backend independent debug display. * Renamed last occurances of frame data to feature. Signed-off-by: Benjamin Jillich commit 57904c55d15694e60713f90f42715c18756f52c4 Author: Benjamin Jillich Date: Thu Nov 11 16:38:22 2021 +0100 Motion Matching: Move control spline into separate trajectory query class (#17) * Introducing new TrajectoryQuery class which represents the trajectory history and desired future trajectory control points input for the motion matching search. * The trajectory history will be used to sample the number of expected control points for the past trajectory based on the trajectory feature. * For the future trajectory, I just ported over the different functions that we had previously. Will revisit that with a later change. * Moved DebugDrawControlSpline() from locomotion behavior to the TrajectoryQuery. * Trajectory query is owned by the behavior instance, same as the trajectory history. Signed-off-by: Benjamin Jillich commit fbed5b1803f820a86ffa562a2be9bbae00c64109 Author: Benjamin Jillich Date: Tue Nov 9 10:36:03 2021 +0100 Motion Matching: Trajectory feature improvements (#16) * Reduced dimensionality of the trajectory feature. Removed the velocity from the sample as the velocity is embedded in the distances between the control points already. * Reduced the position and facing direction features from 3D to 2D as motion extraction is projected to the ground plane anyway and the last component was always zeroed out. * Improved the cost function by removing the angle difference from it. After the latest changes in the trajectory history and the bug fixes in the trajectory feature and history, results are better without it. * Adjusted some target path generation parameters to get more variation in the locomotion results. * Some minor code cleanup. Signed-off-by: Benjamin Jillich commit 796b763d676380e0b9fbe0ae72824a7f29e59eab Author: Benjamin Jillich Date: Thu Nov 4 11:58:39 2021 +0100 Major rewrite of the trajectory history (#15) * Fixed several sampling issues related to indexing issues by elevating the keytrack class that has been proven to work rather than reinventing the wheel here. * Offers two ways to sample the trajectory history, either based on time in seconds or using a normalized value. * Automatically takes care that the trajectory feature is not needing a longer history than the history itself records. * History older than the trajectory feature requres is rendered as semi-transparent spheres that fade out over time. * Trajectory history is now owned by the behavior instance rather than the anim graph node to have everything at a central place. * Trajectory history is pre-filled with the character location at init time so that we simulate a standing still character without confusing the motion matching algorithm or special case handling. Signed-off-by: Benjamin Jillich commit 80c6572380e1b879014aae5aecdaaea1aa3160c1 Author: Benjamin Jillich Date: Wed Nov 3 09:34:16 2021 +0100 Motion Matching: Improve trajectory feature extraction and cost calculation (#14) * Fixed bug in calculating the past frame index which led to retrieving wrong data and skewed costs. * Fixed an off-by-one indexing issue. We were only seeing 5 viual control points in our debug viz while there should have been 6. That is now fixed + the cost is more accurate as we're actually comparing the right control points now. * Changed the cost function from just calculating the spatial differences between the desired and actual trajectory positions to a combination of relative spatial differences and their angles. This reduced the average costs and resulted in better matching frames and smoother synthesized animations. Signed-off-by: Benjamin Jillich commit 7cc180054ede4fab8ba592c45c2feaf746beeb28 Author: Benjamin Jillich Date: Fri Oct 29 08:54:41 2021 +0200 Remove bad animation ranges with discard range events (#12) We got a mechanism in place to discard specific frames/ranges of an animation and exclude it from the motion matching database. We have several sections in our animations where the arms are over the head, where the person suddenly crouches for a bit or other poses that do not match the other locomotion data. I went through the animation database and discarded all of these sections in order to improve the results of the synthesized animations. Signed-off-by: Benjamin Jillich commit 14f36cdc1813aaa9a5ce514272cef01bad3f38b6 Author: Benjamin Jillich Date: Fri Oct 29 08:54:13 2021 +0200 Remove direction feature (facing direction will be part of the trajectory) (#13) Removed the currently unused and half implemented direction feature. The facing direction will be part of the trajectory in the future. Signed-off-by: Benjamin Jillich commit a8e6f1c42f92cb3a207bf04371e884d8f5d0fbb4 Author: Benjamin Jillich Date: Tue Oct 26 13:30:07 2021 +0200 Motion Matching: Improved spatial velocity feature calculation (#11) * Added Motion Matching ImGuiMonitor and Bus Added bus for pushing values to the histogram and a monitor owning and rendering the histograms. * Implemented performance and feature cost histograms * Improved spatial velocity feature calculation Signed-off-by: Benjamin Jillich commit 925e05bdd3c433af767118eff7b3c93bb6e2a94a Author: Benjamin Jillich Date: Mon Oct 25 10:26:37 2021 +0200 Add position feature visualization and other debug viz improvements (#10) * Rendering a sphere for the position feature in order to see the offset between the actual foot position and the best matching frame's extracted position feature. * Improved velocity feature visualization by making rendering an arrow head and a thicker direction. * Added the ability to have different bar colors for different histograms. * Matched histogram bar with feature visualization colors to easily understand which 3D viz belongs to which histogram. * Using better matching color palette. Signed-off-by: Benjamin Jillich commit 6600abcff16df4e49a744bbeb68d00d9fe03f31d Author: Benjamin Jillich Date: Wed Oct 20 17:18:05 2021 +0200 Use feature matrix to generalize FillFrameFloats() and improve feature visualizations (#9) * Generalized the FillFrameFloats() in the KD-tree by utilizing the feature matrix and dimensionality information from the features to replace the custom per-feature functions with a shared version. * Improved the trajectory visualization by consolidating the past and future trajectory rendering into a single function and nicer visuals by replacing the line based markers with spheres and cylinders to fake thicker line until the aux geom is able to render them. * Now using Atom's aux geom for improved rendering of the features. * Included some more feedback from the last PR. Signed-off-by: Benjamin Jillich commit 96a90bc62cf4220d1afd207fce9c6cab9e453c3b Author: Benjamin Jillich Date: Wed Oct 20 09:04:07 2021 +0200 Motion Matching: Store features used for kd-tree in feature database and get rid of the local flags inside the feature class (#8) * The list of features used in the KD-tree is now separated and not part of the actual feature descriptor anymore * Renamed frame floats to query features / feature vales to make it align better with the rewrite from some weeks ago. * Some more code cleanup Signed-off-by: Benjamin Jillich commit e430637f734b20e6813a5c44572645390fe77c92 Author: Benjamin Jillich Date: Fri Oct 15 09:25:49 2021 +0200 Feature cost and performance metrics visualization (#7) * Added Motion Matching ImGuiMonitor and Bus Added bus for pushing values to the histogram and a monitor owning and rendering the histograms. Signed-off-by: Benjamin Jillich * Implemented performance and feature cost histograms Signed-off-by: Benjamin Jillich commit f8ca765fcc168942c361dfea249b08915dac5f77 Author: Benjamin Jillich Date: Mon Oct 11 09:21:17 2021 +0200 Motion matching: Data analysis and Visualization (Part 2) (#6) Added scatterplot using PCA Added feature correlation heatmap Data normalization ground truth using sklearn's scaler (Min-max scaling) Histogram for verifying that the value distributions stayed the same after normalizing PCA scatterplot for the normalized data Signed-off-by: Benjamin Jillich commit 21d3f8b9e4b2545bfe07bf2a08ed1e39337dfc58 Merge: 58abd6c a6587bb Author: Benjamin Jillich Date: Thu Oct 7 09:16:39 2021 +0200 Motion Matching: Feature matrix CSV export Signed-off-by: Benjamin Jillich commit a6587bb9218e2c618ac3a836b6374ab16fcc9bbc Merge: 3f5ac80 aee9039 Author: Benjamin Jillich Date: Thu Oct 7 09:13:32 2021 +0200 Motion Matching: Start of a Jupyter notebook for feature data analysis and visualizations Signed-off-by: Benjamin Jillich commit aee903942ed0b05d9397778d606775482dc1cfc7 Author: Benjamin Jillich Date: Wed Oct 6 15:35:14 2021 +0200 Motion Matching: Feature matrix CSV export Signed-off-by: Benjamin Jillich commit 3f5ac808323a7b6a78cdf5c1f8ceaf8d175e9857 Author: Benjamin Jillich Date: Tue Oct 5 10:04:44 2021 +0200 Motion Matching: Feature matrix CSV export * Added GetDimensionName() function for the feature to output a component's name, which corresponds to a column in the feature matrix. * Added SaveAsCsv() function to feature matrix which exports a Eigen matrix to a .csv file plus column names based on the feature component names. Signed-off-by: Benjamin Jillich commit 58abd6c9600f67121eaec9b80c2264bba73ff198 Merge: 1fb12e4 fd12fda Author: Benjamin Jillich Date: Mon Oct 4 08:44:25 2021 +0200 Motion Matching: Created feature matrix and moved all feature data to it Signed-off-by: Benjamin Jillich commit fd12fda7843ec6d361caa3a26892fcdb0dfc9f7c Author: Benjamin Jillich Date: Fri Oct 1 09:01:24 2021 +0200 Created feature matrix and moved all feature data into it We now have a new FeatureMatrix which is responsible for storing the feature data that we need for the motion matching algorithm in a cache-efficient way. The great thing is that this is also the enabler for any feature analysis and later on machine learning as we're in the right data format already. The FeatureMatrix internally stores the data in a 2D dense matrix from the Eigen library. This can easily be replaced with another linear algebra/vector/matrix library though and the FeatureMatrix acts as a wrapper. We're currently extracting the following motion features from our motion database: Left foot position/velocity, right foot position/velocity and the root joint trajectory with 6 past and 6 future sample positions and directions. Having 41203 keyframes/poses in our motion database, this results in a feature matrix holding 22.63 MB of data. This is only the data size for the extracted features. Signed-off-by: Benjamin Jillich commit 7cdd4d9b0b525b3a7c218ce4a16dfa9d2a90132c Author: Benjamin Jillich Date: Wed Sep 22 14:21:14 2021 +0200 Adding profile instrumentations Signed-off-by: Benjamin Jillich commit 1fb12e4af1fd1d70c8f39842a0207de96bd1550c Author: Benjamin Jillich Date: Fri Sep 17 13:10:55 2021 +0200 Fixing compile issues due to new warning mode Signed-off-by: Benjamin Jillich commit 9ea3a67aa985d872498fcc19bb973311089f9679 Merge: 5e5d69c 99cfb29 Author: Benjamin Jillich Date: Wed Sep 15 17:49:09 2021 +0200 Added velocity feature visualization improved velocity calculation Signed-off-by: Benjamin Jillich commit 99cfb2914cdadcf5616570c30a15b246abb20f97 Author: Benjamin Jillich Date: Wed Sep 8 16:35:12 2021 +0200 Addressed PR feedback Signed-off-by: Benjamin Jillich commit af291c0ca97e17d1bb07075a5546747591812e9e Author: Benjamin Jillich Date: Tue Sep 7 10:36:18 2021 +0200 Added velocity feature visualization improved velocity calculation Signed-off-by: Benjamin Jillich commit 5e5d69c9293c3609950e55d19ea6145a21027187 Merge: f2c1577 902179c Author: Benjamin Jillich Date: Mon Sep 6 18:58:59 2021 +0200 MotionMatching: Separated features from source data and renamed FrameData to Feature #1 Signed-off-by: Benjamin Jillich commit 902179c6a19f91bca64c37a383adc776da15f8e8 Author: Benjamin Jillich Date: Fri Sep 3 15:25:27 2021 +0200 Separated features from source data and renamed FrameData to Feature Signed-off-by: Benjamin Jillich commit f2c1577febb46d8957693826d404f8cc6ad5e240 Author: Benjamin Jillich Date: Mon Aug 30 12:10:30 2021 +0200 Fixed some compile errors for the latest version Signed-off-by: Benjamin Jillich commit 498018553ccf75b0e3983895984401680ffa25b9 Author: Benjamin Jillich Date: Mon Aug 30 11:51:21 2021 +0200 Initial motion matching prototype code Signed-off-by: Benjamin Jillich Signed-off-by: Benjamin Jillich --- .../Assets/Animations/Acceleration1.fbx | 3 + .../Assets/Animations/Circles1.fbx | 3 + .../Assets/Animations/Crouching1.fbx | 3 + .../Assets/Animations/FreeRoaming1.fbx | 3 + .../Assets/Animations/FreeRoaming2.fbx | 3 + .../MotionMatching/Assets/Animations/Jog1.fbx | 3 + .../Assets/Animations/JogPivotTurn1.fbx | 3 + .../Assets/Animations/Jumps1.fbx | 3 + .../Assets/Animations/JumpsFreeRoam1.fbx | 3 + .../Assets/Animations/MixedLocomotion1.fbx | 3 + .../Assets/Animations/OutofRange1.fbx | 3 + .../Assets/Animations/Pushes1.fbx | 3 + .../MotionMatching/Assets/Animations/Run1.fbx | 3 + .../Assets/Animations/RunPivotTurn1.fbx | 3 + .../Assets/Animations/Snake1.fbx | 3 + .../Assets/Animations/TurnOnSpot1.fbx | 3 + .../Assets/Animations/Walk1.fbx | 3 + .../Assets/Animations/Walk2.fbx | 3 + .../Assets/Animations/WalkPivotTurn1.fbx | 3 + .../Assets/Animations/WalkStopTurn1.fbx | 3 + .../Assets/Animations/WalkStopTurnPivot1.fbx | 3 + .../Assets/Animations/WalkTurns1.fbx | 3 + .../Animations/acceleration1.fbx.assetinfo | 50 + .../Assets/Animations/circles1.fbx.assetinfo | 41 + .../Animations/crouching1.fbx.assetinfo | 125 ++ .../Animations/freeroaming1.fbx.assetinfo | 59 + .../Animations/freeroaming2.fbx.assetinfo | 41 + .../Assets/Animations/jog1.fbx.assetinfo | 41 + .../Animations/jogpivotturn1.fbx.assetinfo | 53 + .../Animations/mixedlocomotion1.fbx.assetinfo | 53 + .../Animations/outofrange1.fbx.assetinfo | 41 + .../Assets/Animations/run1.fbx.assetinfo | 41 + .../Animations/runpivotturn1.fbx.assetinfo | 50 + .../Assets/Animations/snake1.fbx.assetinfo | 50 + .../Animations/turnonspot1.fbx.assetinfo | 106 ++ .../Assets/Animations/walk1.fbx.assetinfo | 59 + .../Assets/Animations/walk2.fbx.assetinfo | 50 + .../Animations/walkpivotturn1.fbx.assetinfo | 106 ++ .../Animations/walkstopturn1.fbx.assetinfo | 41 + .../walkstopturnpivot1.fbx.assetinfo | 41 + .../Animations/walkturns1.fbx.assetinfo | 50 + Gems/MotionMatching/Assets/Character/Rin.fbx | 3 + .../Assets/Character/Rin.fbx.assetinfo | 1543 +++++++++++++++++ .../Assets/MotionMatching.animgraph | 3 + .../Assets/MotionMatching.emfxworkspace | 3 + .../Assets/MotionMatching.motionset | 3 + Gems/MotionMatching/CMakeLists.txt | 16 + Gems/MotionMatching/Code/CMakeLists.txt | 155 ++ .../MotionMatching/MotionMatchingBus.h | 38 + Gems/MotionMatching/Code/Source/Allocators.h | 16 + .../Code/Source/BlendTreeMotionMatchNode.cpp | 373 ++++ .../Code/Source/BlendTreeMotionMatchNode.h | 111 ++ Gems/MotionMatching/Code/Source/EventData.cpp | 92 + Gems/MotionMatching/Code/Source/EventData.h | 55 + Gems/MotionMatching/Code/Source/Feature.cpp | 275 +++ Gems/MotionMatching/Code/Source/Feature.h | 174 ++ .../Code/Source/FeatureMatrix.cpp | 102 ++ .../Code/Source/FeatureMatrix.h | 118 ++ .../Code/Source/FeaturePosition.cpp | 127 ++ .../Code/Source/FeaturePosition.h | 55 + .../Code/Source/FeatureSchema.cpp | 123 ++ .../Code/Source/FeatureSchema.h | 47 + .../Code/Source/FeatureSchemaDefault.cpp | 82 + .../Code/Source/FeatureSchemaDefault.h | 23 + .../Code/Source/FeatureTrajectory.cpp | 450 +++++ .../Code/Source/FeatureTrajectory.h | 148 ++ .../Code/Source/FeatureVelocity.cpp | 152 ++ .../Code/Source/FeatureVelocity.h | 64 + Gems/MotionMatching/Code/Source/Frame.cpp | 78 + Gems/MotionMatching/Code/Source/Frame.h | 62 + .../Code/Source/FrameDatabase.cpp | 250 +++ .../Code/Source/FrameDatabase.h | 86 + .../Code/Source/ImGuiMonitor.cpp | 144 ++ .../MotionMatching/Code/Source/ImGuiMonitor.h | 84 + .../Code/Source/ImGuiMonitorBus.h | 37 + Gems/MotionMatching/Code/Source/KdTree.cpp | 454 +++++ Gems/MotionMatching/Code/Source/KdTree.h | 95 + .../Code/Source/MotionMatchingData.cpp | 181 ++ .../Code/Source/MotionMatchingData.h | 74 + .../Source/MotionMatchingEditorModule.cpp | 40 + .../MotionMatchingEditorSystemComponent.cpp | 60 + .../MotionMatchingEditorSystemComponent.h | 40 + .../Code/Source/MotionMatchingInstance.cpp | 571 ++++++ .../Code/Source/MotionMatchingInstance.h | 116 ++ .../Code/Source/MotionMatchingModule.cpp | 23 + .../Source/MotionMatchingModuleInterface.h | 39 + .../Source/MotionMatchingSystemComponent.cpp | 128 ++ .../Source/MotionMatchingSystemComponent.h | 51 + .../Code/Source/PoseDataJointVelocities.cpp | 160 ++ .../Code/Source/PoseDataJointVelocities.h | 60 + .../Code/Source/TrajectoryHistory.cpp | 167 ++ .../Code/Source/TrajectoryHistory.h | 63 + .../Code/Source/TrajectoryQuery.cpp | 163 ++ .../Code/Source/TrajectoryQuery.h | 68 + .../Code/Tests/FeatureMatrixTests.cpp | 62 + .../Code/Tests/FeatureSchemaTests.cpp | 81 + Gems/MotionMatching/Code/Tests/Fixture.h | 23 + .../Code/Tests/MotionMatchingEditorTest.cpp | 11 + .../Code/Tests/MotionMatchingTest.cpp | 11 + .../Code/motionmatching_editor_files.cmake | 12 + .../motionmatching_editor_shared_files.cmake | 11 + .../motionmatching_editor_tests_files.cmake | 11 + .../Code/motionmatching_files.cmake | 52 + .../Code/motionmatching_shared_files.cmake | 11 + .../Code/motionmatching_tests_files.cmake | 14 + .../Docs/Diagrams/ArchitectureDiagram.drawio | 1 + .../Docs/Diagrams/FeatureSchema.drawio | 1 + .../Docs/Images/ArchitectureDiagram.png | 3 + .../Docs/Images/FeatureSchema.png | 3 + .../JupyterNotebooks/FeatureAnalysis.ipynb | 352 ++++ Gems/MotionMatching/README.md | 48 + Gems/MotionMatching/gem.json | 21 + Gems/MotionMatching/preview.png | 3 + engine.json | 1 + 114 files changed, 9541 insertions(+) create mode 100644 Gems/MotionMatching/Assets/Animations/Acceleration1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Circles1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Crouching1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/FreeRoaming1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/FreeRoaming2.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Jog1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/JogPivotTurn1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Jumps1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/JumpsFreeRoam1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/MixedLocomotion1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/OutofRange1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Pushes1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Run1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/RunPivotTurn1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Snake1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/TurnOnSpot1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Walk1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/Walk2.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/WalkPivotTurn1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/WalkStopTurn1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/WalkStopTurnPivot1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/WalkTurns1.fbx create mode 100644 Gems/MotionMatching/Assets/Animations/acceleration1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/circles1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/crouching1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/freeroaming1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/freeroaming2.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/jog1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/jogpivotturn1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/mixedlocomotion1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/outofrange1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/run1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/runpivotturn1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/snake1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/turnonspot1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/walk1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/walk2.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/walkpivotturn1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/walkstopturn1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/walkstopturnpivot1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Animations/walkturns1.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/Character/Rin.fbx create mode 100644 Gems/MotionMatching/Assets/Character/Rin.fbx.assetinfo create mode 100644 Gems/MotionMatching/Assets/MotionMatching.animgraph create mode 100644 Gems/MotionMatching/Assets/MotionMatching.emfxworkspace create mode 100644 Gems/MotionMatching/Assets/MotionMatching.motionset create mode 100644 Gems/MotionMatching/CMakeLists.txt create mode 100644 Gems/MotionMatching/Code/CMakeLists.txt create mode 100644 Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h create mode 100644 Gems/MotionMatching/Code/Source/Allocators.h create mode 100644 Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp create mode 100644 Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.h create mode 100644 Gems/MotionMatching/Code/Source/EventData.cpp create mode 100644 Gems/MotionMatching/Code/Source/EventData.h create mode 100644 Gems/MotionMatching/Code/Source/Feature.cpp create mode 100644 Gems/MotionMatching/Code/Source/Feature.h create mode 100644 Gems/MotionMatching/Code/Source/FeatureMatrix.cpp create mode 100644 Gems/MotionMatching/Code/Source/FeatureMatrix.h create mode 100644 Gems/MotionMatching/Code/Source/FeaturePosition.cpp create mode 100644 Gems/MotionMatching/Code/Source/FeaturePosition.h create mode 100644 Gems/MotionMatching/Code/Source/FeatureSchema.cpp create mode 100644 Gems/MotionMatching/Code/Source/FeatureSchema.h create mode 100644 Gems/MotionMatching/Code/Source/FeatureSchemaDefault.cpp create mode 100644 Gems/MotionMatching/Code/Source/FeatureSchemaDefault.h create mode 100644 Gems/MotionMatching/Code/Source/FeatureTrajectory.cpp create mode 100644 Gems/MotionMatching/Code/Source/FeatureTrajectory.h create mode 100644 Gems/MotionMatching/Code/Source/FeatureVelocity.cpp create mode 100644 Gems/MotionMatching/Code/Source/FeatureVelocity.h create mode 100644 Gems/MotionMatching/Code/Source/Frame.cpp create mode 100644 Gems/MotionMatching/Code/Source/Frame.h create mode 100644 Gems/MotionMatching/Code/Source/FrameDatabase.cpp create mode 100644 Gems/MotionMatching/Code/Source/FrameDatabase.h create mode 100644 Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp create mode 100644 Gems/MotionMatching/Code/Source/ImGuiMonitor.h create mode 100644 Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h create mode 100644 Gems/MotionMatching/Code/Source/KdTree.cpp create mode 100644 Gems/MotionMatching/Code/Source/KdTree.h create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingData.cpp create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingData.h create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingEditorModule.cpp create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.cpp create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.h create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingInstance.h create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingModule.cpp create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingModuleInterface.h create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp create mode 100644 Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h create mode 100644 Gems/MotionMatching/Code/Source/PoseDataJointVelocities.cpp create mode 100644 Gems/MotionMatching/Code/Source/PoseDataJointVelocities.h create mode 100644 Gems/MotionMatching/Code/Source/TrajectoryHistory.cpp create mode 100644 Gems/MotionMatching/Code/Source/TrajectoryHistory.h create mode 100644 Gems/MotionMatching/Code/Source/TrajectoryQuery.cpp create mode 100644 Gems/MotionMatching/Code/Source/TrajectoryQuery.h create mode 100644 Gems/MotionMatching/Code/Tests/FeatureMatrixTests.cpp create mode 100644 Gems/MotionMatching/Code/Tests/FeatureSchemaTests.cpp create mode 100644 Gems/MotionMatching/Code/Tests/Fixture.h create mode 100644 Gems/MotionMatching/Code/Tests/MotionMatchingEditorTest.cpp create mode 100644 Gems/MotionMatching/Code/Tests/MotionMatchingTest.cpp create mode 100644 Gems/MotionMatching/Code/motionmatching_editor_files.cmake create mode 100644 Gems/MotionMatching/Code/motionmatching_editor_shared_files.cmake create mode 100644 Gems/MotionMatching/Code/motionmatching_editor_tests_files.cmake create mode 100644 Gems/MotionMatching/Code/motionmatching_files.cmake create mode 100644 Gems/MotionMatching/Code/motionmatching_shared_files.cmake create mode 100644 Gems/MotionMatching/Code/motionmatching_tests_files.cmake create mode 100644 Gems/MotionMatching/Docs/Diagrams/ArchitectureDiagram.drawio create mode 100644 Gems/MotionMatching/Docs/Diagrams/FeatureSchema.drawio create mode 100644 Gems/MotionMatching/Docs/Images/ArchitectureDiagram.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureSchema.png create mode 100644 Gems/MotionMatching/JupyterNotebooks/FeatureAnalysis.ipynb create mode 100644 Gems/MotionMatching/README.md create mode 100644 Gems/MotionMatching/gem.json create mode 100644 Gems/MotionMatching/preview.png diff --git a/Gems/MotionMatching/Assets/Animations/Acceleration1.fbx b/Gems/MotionMatching/Assets/Animations/Acceleration1.fbx new file mode 100644 index 0000000000..c2c167cdd1 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Acceleration1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33d5b3035966ac54bbb97a207ca14868a6daef9ad9e596281f7930764b54c819 +size 2527664 diff --git a/Gems/MotionMatching/Assets/Animations/Circles1.fbx b/Gems/MotionMatching/Assets/Animations/Circles1.fbx new file mode 100644 index 0000000000..fcdecc0ab5 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Circles1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91d6a8c16bae554339d1849285804b798e136113c6aecc3dfed1be635c484600 +size 4750720 diff --git a/Gems/MotionMatching/Assets/Animations/Crouching1.fbx b/Gems/MotionMatching/Assets/Animations/Crouching1.fbx new file mode 100644 index 0000000000..bf5c171f8b --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Crouching1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e18101baa7b33af4ac26181b7c3c20d5c12e9d9d2f57bd24271c6e4665e1a65a +size 3001296 diff --git a/Gems/MotionMatching/Assets/Animations/FreeRoaming1.fbx b/Gems/MotionMatching/Assets/Animations/FreeRoaming1.fbx new file mode 100644 index 0000000000..f44eba537a --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/FreeRoaming1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8eda027438797e48e6b00745e17e3ec4da6d507735c754056a8fea19c465a528 +size 5926096 diff --git a/Gems/MotionMatching/Assets/Animations/FreeRoaming2.fbx b/Gems/MotionMatching/Assets/Animations/FreeRoaming2.fbx new file mode 100644 index 0000000000..837f8df648 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/FreeRoaming2.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c2af3ea28464b4d7269f54c1ff1ded691b19b826d5de85139d20ae825aae992 +size 5085168 diff --git a/Gems/MotionMatching/Assets/Animations/Jog1.fbx b/Gems/MotionMatching/Assets/Animations/Jog1.fbx new file mode 100644 index 0000000000..02e6c73ac5 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Jog1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25593a1e4670dbb9cb1c5a0fc375ba2bf7862784c45847d76eefd44d39df86f9 +size 2974896 diff --git a/Gems/MotionMatching/Assets/Animations/JogPivotTurn1.fbx b/Gems/MotionMatching/Assets/Animations/JogPivotTurn1.fbx new file mode 100644 index 0000000000..51fac75ca6 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/JogPivotTurn1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e21e3f9b7db6572f740a99159bba72eca3697d3d3e1c07562579be9599bcebb7 +size 2511488 diff --git a/Gems/MotionMatching/Assets/Animations/Jumps1.fbx b/Gems/MotionMatching/Assets/Animations/Jumps1.fbx new file mode 100644 index 0000000000..d075da8991 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Jumps1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3802b0e44b3e0aa6610a4157510c3038bfe4038211202cebd6eb116ffd53cee9 +size 2587408 diff --git a/Gems/MotionMatching/Assets/Animations/JumpsFreeRoam1.fbx b/Gems/MotionMatching/Assets/Animations/JumpsFreeRoam1.fbx new file mode 100644 index 0000000000..d384c9f156 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/JumpsFreeRoam1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f07e278fcee81d719ec2e7c02417e2ee710b9d224a29798cfb97b55a9ffe351 +size 3515488 diff --git a/Gems/MotionMatching/Assets/Animations/MixedLocomotion1.fbx b/Gems/MotionMatching/Assets/Animations/MixedLocomotion1.fbx new file mode 100644 index 0000000000..317fa22e76 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/MixedLocomotion1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc4d0b653f910cea3c7c3b8d08963af0cc331ad91e467c7becb2c7f9b9c5b402 +size 4068144 diff --git a/Gems/MotionMatching/Assets/Animations/OutofRange1.fbx b/Gems/MotionMatching/Assets/Animations/OutofRange1.fbx new file mode 100644 index 0000000000..ecde12dee1 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/OutofRange1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58cd43568cdd3f9b9585b65208cfff6d6c5f5bea9ad67878a1efbeebb8ef8a6d +size 1812176 diff --git a/Gems/MotionMatching/Assets/Animations/Pushes1.fbx b/Gems/MotionMatching/Assets/Animations/Pushes1.fbx new file mode 100644 index 0000000000..d89c45a611 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Pushes1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a831cfe702120d163e44a27d5cd33faf64f5f892da3789aea1bbfecd528e72 +size 3288400 diff --git a/Gems/MotionMatching/Assets/Animations/Run1.fbx b/Gems/MotionMatching/Assets/Animations/Run1.fbx new file mode 100644 index 0000000000..150ae00f4f --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Run1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3649e2d0b239f9da45af2b04e937ce6113e8dee74a70a3cef748995ea15f6120 +size 2354544 diff --git a/Gems/MotionMatching/Assets/Animations/RunPivotTurn1.fbx b/Gems/MotionMatching/Assets/Animations/RunPivotTurn1.fbx new file mode 100644 index 0000000000..8e67a72016 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/RunPivotTurn1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:207378e42ebdad1c3dfe8cefc84ed50e1d322895f018e2efca14fdcbf2e6600f +size 1890352 diff --git a/Gems/MotionMatching/Assets/Animations/Snake1.fbx b/Gems/MotionMatching/Assets/Animations/Snake1.fbx new file mode 100644 index 0000000000..ff597b968d --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Snake1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78c68566aba845544ec96a92f2cf4e36350c74c16e931c3aa9e14151bcaed8e8 +size 3881680 diff --git a/Gems/MotionMatching/Assets/Animations/TurnOnSpot1.fbx b/Gems/MotionMatching/Assets/Animations/TurnOnSpot1.fbx new file mode 100644 index 0000000000..ac71a0f42b --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/TurnOnSpot1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73560b662d3819647985c3f7b0544ba3ad71365e8393a3915630b254f86c6286 +size 3669552 diff --git a/Gems/MotionMatching/Assets/Animations/Walk1.fbx b/Gems/MotionMatching/Assets/Animations/Walk1.fbx new file mode 100644 index 0000000000..423a59b31f --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Walk1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2fad264af33252d49c6e3a0b6c6ef83697b951a54c7ab0cd4259f145024d915 +size 3962336 diff --git a/Gems/MotionMatching/Assets/Animations/Walk2.fbx b/Gems/MotionMatching/Assets/Animations/Walk2.fbx new file mode 100644 index 0000000000..0aaf74b496 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/Walk2.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:149ae8bfc0dc4ad8471e79f5cd8ce5420c02bc5c8a5cf1971ebbf997cae21096 +size 3834704 diff --git a/Gems/MotionMatching/Assets/Animations/WalkPivotTurn1.fbx b/Gems/MotionMatching/Assets/Animations/WalkPivotTurn1.fbx new file mode 100644 index 0000000000..1dac028839 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/WalkPivotTurn1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6468a660cfd88c350443e92b31e41362909d705c344cda6640c65a5e1fd2a29 +size 2288048 diff --git a/Gems/MotionMatching/Assets/Animations/WalkStopTurn1.fbx b/Gems/MotionMatching/Assets/Animations/WalkStopTurn1.fbx new file mode 100644 index 0000000000..20f967fece --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/WalkStopTurn1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b824d6fd5bb3e7f6b4f29ff90b406179539e1c155ba9f8870ef54f1d1d0e22e7 +size 3128032 diff --git a/Gems/MotionMatching/Assets/Animations/WalkStopTurnPivot1.fbx b/Gems/MotionMatching/Assets/Animations/WalkStopTurnPivot1.fbx new file mode 100644 index 0000000000..50f69af25c --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/WalkStopTurnPivot1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38f0f9e280ff686032aa223cc8ce754442edc616d28a16d39a87c90bd221c91a +size 2807280 diff --git a/Gems/MotionMatching/Assets/Animations/WalkTurns1.fbx b/Gems/MotionMatching/Assets/Animations/WalkTurns1.fbx new file mode 100644 index 0000000000..acdb27e1d9 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/WalkTurns1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:862ddf8893923169938db017f573f63228bb5aec3d4892d21a525200dd6c4680 +size 4063280 diff --git a/Gems/MotionMatching/Assets/Animations/acceleration1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/acceleration1.fbx.assetinfo new file mode 100644 index 0000000000..c9749b8bf3 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/acceleration1.fbx.assetinfo @@ -0,0 +1,50 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "acceleration1", + "selectedRootBone": "RootNode.root", + "id": "{ADB2CDC1-8EA3-5B21-90D6-43EBE9991709}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 19.600000381469727, + "endTime": 20.666667938232422 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 50.599998474121094, + "endTime": 53.19999694824219 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/circles1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/circles1.fbx.assetinfo new file mode 100644 index 0000000000..4276767f05 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/circles1.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "circles1", + "selectedRootBone": "RootNode.root", + "id": "{BF21E0D5-87F6-5A3F-B100-507F217D4C7E}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 112.73334503173828, + "endTime": 114.00001525878906 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/crouching1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/crouching1.fbx.assetinfo new file mode 100644 index 0000000000..2f2f8c52e5 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/crouching1.fbx.assetinfo @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/MotionMatching/Assets/Animations/freeroaming1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/freeroaming1.fbx.assetinfo new file mode 100644 index 0000000000..0a6534208d --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/freeroaming1.fbx.assetinfo @@ -0,0 +1,59 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "freeroaming1", + "selectedRootBone": "RootNode.root", + "id": "{A07E54E7-BB49-5DB3-BCA1-5EC8B4FA74A3}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 73.33333587646484, + "endTime": 111.13333129882813 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 134.3333282470703, + "endTime": 136.13333129882813 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 145.1999969482422, + "endTime": 146.13333129882813 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/freeroaming2.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/freeroaming2.fbx.assetinfo new file mode 100644 index 0000000000..bdb6c10668 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/freeroaming2.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "freeroaming2", + "selectedRootBone": "RootNode.root", + "id": "{96DC1ABD-1F72-5546-8B7F-7092C3AC0E5D}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 119.26667022705078, + "endTime": 123.4000015258789 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/jog1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/jog1.fbx.assetinfo new file mode 100644 index 0000000000..dbb83cb4d3 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/jog1.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "jog1", + "selectedRootBone": "RootNode.root", + "id": "{9200D325-808C-5B2D-B323-1FF9790C07B7}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 64.0, + "endTime": 65.53333282470703 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/jogpivotturn1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/jogpivotturn1.fbx.assetinfo new file mode 100644 index 0000000000..10b3e2e59a --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/jogpivotturn1.fbx.assetinfo @@ -0,0 +1,53 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "jogpivotturn1", + "selectedRootBone": "RootNode.root", + "id": "{596210E7-A7F4-511D-886B-AA4FED4AC92B}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false + }, + { + "name": "Event Track 2", + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 36.66666793823242, + "endTime": 40.733333587646484 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 41.733333587646484, + "endTime": 53.06666564941406 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/mixedlocomotion1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/mixedlocomotion1.fbx.assetinfo new file mode 100644 index 0000000000..d8d1a4d4e6 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/mixedlocomotion1.fbx.assetinfo @@ -0,0 +1,53 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "mixedlocomotion1", + "selectedRootBone": "RootNode.root", + "id": "{2F7682E4-235E-5A31-B450-266D7DC00E39}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false + }, + { + "name": "Event Track 2", + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 27.53333282470703, + "endTime": 29.999998092651367 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 56.53333282470703, + "endTime": 60.666664123535156 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/outofrange1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/outofrange1.fbx.assetinfo new file mode 100644 index 0000000000..9e206c09ae --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/outofrange1.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "outofrange1", + "selectedRootBone": "RootNode.root", + "id": "{6B28C886-471C-5506-AD03-DF19025F6DA1}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 29.299814224243164, + "endTime": 33.83555221557617 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/run1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/run1.fbx.assetinfo new file mode 100644 index 0000000000..fe0bd2f197 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/run1.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "run1", + "selectedRootBone": "RootNode.root", + "id": "{12953346-AF3A-5481-A54F-9119523C4538}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 23.600000381469727, + "endTime": 27.933334350585938 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/runpivotturn1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/runpivotturn1.fbx.assetinfo new file mode 100644 index 0000000000..353f4bd81c --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/runpivotturn1.fbx.assetinfo @@ -0,0 +1,50 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "runpivotturn1", + "selectedRootBone": "RootNode.root", + "id": "{DEF0D469-00AB-57D0-AF05-6AF1D6563D4A}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 25.080034255981445, + "endTime": 28.964109420776367 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 29.574464797973633, + "endTime": 36.288368225097656 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/snake1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/snake1.fbx.assetinfo new file mode 100644 index 0000000000..5c8961c700 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/snake1.fbx.assetinfo @@ -0,0 +1,50 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "snake1", + "selectedRootBone": "RootNode.root", + "id": "{4A29F10E-0083-559F-A78B-282A9EF87E00}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 34.46666717529297, + "endTime": 38.733333587646484 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 89.4000015258789, + "endTime": 90.86666870117188 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/turnonspot1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/turnonspot1.fbx.assetinfo new file mode 100644 index 0000000000..76c0729bb2 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/turnonspot1.fbx.assetinfo @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/MotionMatching/Assets/Animations/walk1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/walk1.fbx.assetinfo new file mode 100644 index 0000000000..f21f187899 --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/walk1.fbx.assetinfo @@ -0,0 +1,59 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "walk1", + "selectedRootBone": "RootNode.root", + "id": "{B161FB42-0EC0-51DA-BB0E-F04B73C0DE0C}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 11.533333778381348, + "endTime": 12.533333778381348 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 35.20000076293945, + "endTime": 37.53333282470703 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 76.33333587646484, + "endTime": 93.66667175292969 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/walk2.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/walk2.fbx.assetinfo new file mode 100644 index 0000000000..c945ba6a6d --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/walk2.fbx.assetinfo @@ -0,0 +1,50 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "walk2", + "selectedRootBone": "RootNode.root", + "id": "{D4D1809B-5085-59E4-B98C-D29AE1A90277}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 37.599998474121094, + "endTime": 40.266666412353516 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 81.26667022705078, + "endTime": 84.0666732788086 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/walkpivotturn1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/walkpivotturn1.fbx.assetinfo new file mode 100644 index 0000000000..f603a5858e --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/walkpivotturn1.fbx.assetinfo @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/MotionMatching/Assets/Animations/walkstopturn1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/walkstopturn1.fbx.assetinfo new file mode 100644 index 0000000000..ffd5dbbd0e --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/walkstopturn1.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "walkstopturn1", + "selectedRootBone": "RootNode.root", + "id": "{D38F0C22-1841-5EBB-A198-9D9441CD7C80}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 63.53333282470703, + "endTime": 70.53333282470703 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/walkstopturnpivot1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/walkstopturnpivot1.fbx.assetinfo new file mode 100644 index 0000000000..121124029b --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/walkstopturnpivot1.fbx.assetinfo @@ -0,0 +1,41 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "walkstopturnpivot1", + "selectedRootBone": "RootNode.root", + "id": "{FCD5DF16-A875-552E-9333-3C7BF8554CBB}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 53.06666564941406, + "endTime": 55.86666488647461 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Animations/walkturns1.fbx.assetinfo b/Gems/MotionMatching/Assets/Animations/walkturns1.fbx.assetinfo new file mode 100644 index 0000000000..5f200f546e --- /dev/null +++ b/Gems/MotionMatching/Assets/Animations/walkturns1.fbx.assetinfo @@ -0,0 +1,50 @@ +{ + "values": [ + { + "$type": "MotionGroup", + "name": "walkturns1", + "selectedRootBone": "RootNode.root", + "id": "{FD1981AB-0270-56F7-9062-ABA4D73686F9}", + "rules": { + "rules": [ + { + "$type": "EMotionFX::Pipeline::Rule::MotionMetaDataRule", + "data": { + "motionEventTable": { + "tracks": [ + { + "name": "Sync", + "deletable": false, + "events": [ + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 32.266666412353516, + "endTime": 51.33333206176758 + }, + { + "eventDatas": [ + { + "$type": "DiscardFrameEventData" + } + ], + "startTime": 86.86666870117188, + "endTime": 89.46666717529297 + } + ] + } + ] + } + } + }, + { + "$type": "MotionSamplingRule" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Character/Rin.fbx b/Gems/MotionMatching/Assets/Character/Rin.fbx new file mode 100644 index 0000000000..3041a9efe1 --- /dev/null +++ b/Gems/MotionMatching/Assets/Character/Rin.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d38ee57dcf86d1209982ffa29cf5a2b42f5e0e0b86f5045a8485e3e431d74b03 +size 12267120 diff --git a/Gems/MotionMatching/Assets/Character/Rin.fbx.assetinfo b/Gems/MotionMatching/Assets/Character/Rin.fbx.assetinfo new file mode 100644 index 0000000000..1a3d8be596 --- /dev/null +++ b/Gems/MotionMatching/Assets/Character/Rin.fbx.assetinfo @@ -0,0 +1,1543 @@ +{ + "values": [ + { + "$type": "ActorGroup", + "name": "RinMM", + "id": "{3B0C7D44-39A9-5B89-B361-4789175AE832}", + "rules": { + "rules": [ + { + "$type": "MetaDataRule", + "metaData": "AdjustActor -actorID $(ACTORID) -name \"RinMM\"\nActorSetCollisionMeshes -actorID $(ACTORID) -lod 0 -nodeList \"\"\nAdjustActor -actorID $(ACTORID) -nodesExcludedFromBounds \"\" -nodeAction \"select\"\nAdjustActor -actorID $(ACTORID) -nodeAction \"replace\" -attachmentNodes \"\"\nAdjustActor -actorID $(ACTORID) -motionExtractionNodeName \"root\"\nAdjustActor -actorID $(ACTORID) -mirrorSetup \"L_leg_JNT,R_leg_JNT;R_leg_JNT,L_leg_JNT;L_ribbon_01_JNT,R_ribbon_01_JNT;R_ribbon_01_JNT,L_ribbon_01_JNT;L_knee_JNT,R_knee_JNT;L_leg_twist_JNT,R_leg_twist_JNT;R_knee_JNT,L_knee_JNT;R_leg_twist_JNT,L_leg_twist_JNT;L_ribbon_02_JNT,R_ribbon_02_JNT;R_ribbon_02_JNT,L_ribbon_02_JNT;L_foot_JNT,R_foot_JNT;L_knee_twist_JNT,R_knee_twist_JNT;R_foot_JNT,L_foot_JNT;R_knee_twist_JNT,L_knee_twist_JNT;L_toe_JNT,R_toe_JNT;R_toe_JNT,L_toe_JNT;L_clavicle_JNT,R_clavicle_JNT;R_clavicle_JNT,L_clavicle_JNT;L_neckCollar_01_JNT,R_neckCollar_01_JNT;L_neckCollar_02_JNT,R_neckCollar_02_JNT;R_neckCollar_01_JNT,L_neckCollar_01_JNT;R_neckCollar_02_JNT,L_neckCollar_02_JNT;L_arm_JNT,R_arm_JNT;L_tassle_01_JNT,R_tassle_01_JNT;L_tassleLoop_01_JNT,R_tassleLoop_01_JNT;L_armPit_corr_JNT,R_armPit_corr_JNT;R_arm_JNT,L_arm_JNT;R_tassle_01_JNT,L_tassle_01_JNT;R_tassleLoop_01_JNT,L_tassleLoop_01_JNT;R_armPit_corr_JNT,L_armPit_corr_JNT;L_elbow_JNT,R_elbow_JNT;L_arm_twist_JNT,R_arm_twist_JNT;L_armBulge_corr_JNT,R_armBulge_corr_JNT;L_tassle_02_JNT,R_tassle_02_JNT;L_tassleLoop_02_JNT,R_tassleLoop_02_JNT;R_elbow_JNT,L_elbow_JNT;R_arm_twist_JNT,L_arm_twist_JNT;R_armBulge_corr_JNT,L_armBulge_corr_JNT;R_tassle_02_JNT,L_tassle_02_JNT;R_tassleLoop_02_JNT,L_tassleLoop_02_JNT;L_wrist_JNT,R_wrist_JNT;L_elbow_twist_JNT,R_elbow_twist_JNT;L_tassle_03_JNT,R_tassle_03_JNT;L_brow_inner_JNT,R_brow_inner_JNT;L_brow_mid_JNT,R_brow_mid_JNT;L_brow_outer_JNT,R_brow_outer_JNT;L_nostril_inner_JNT,R_nostril_inner_JNT;L_nostril_outer_JNT,R_nostril_outer_JNT;L_cheekUpper_inner_JNT,R_cheekUpper_inner_JNT;L_squint_mid_JNT,R_squint_mid_JNT;L_squint_outer_JNT,R_squint_outer_JNT;L_squint_inner_JNT,R_squint_inner_JNT;L_zygomatic_outer_JNT,R_zygomatic_outer_JNT;L_cheekBone_JNT,R_cheekBone_JNT;L_ear_JNT,R_ear_JNT;L_chin_below_JNT,R_chin_below_JNT;L_eyelid_lower_JNT,R_eyelid_lower_JNT;L_eyelid_upper_JNT,R_eyelid_upper_JNT;L_eye_JNT,R_eye_JNT;L_lipUpper_JNT,R_lipUpper_JNT;L_lipLevator_inner_JNT,R_lipLevator_inner_JNT;L_lipLevator_corner_JNT,R_lipLevator_corner_JNT;L_cheekUpper_outer_JNT,R_cheekUpper_outer_JNT;L_cheekUpper_mid_JNT,R_cheekUpper_mid_JNT;R_eyelid_upper_JNT,L_eyelid_upper_JNT;R_eyelid_lower_JNT,L_eyelid_lower_JNT;R_nostril_inner_JNT,L_nostril_inner_JNT;R_lipLevator_inner_JNT,L_lipLevator_inner_JNT;R_cheekBone_JNT,L_cheekBone_JNT;R_zygomatic_outer_JNT,L_zygomatic_outer_JNT;R_lipUpper_JNT,L_lipUpper_JNT;R_chin_below_JNT,L_chin_below_JNT;R_ear_JNT,L_ear_JNT;R_eye_JNT,L_eye_JNT;R_brow_inner_JNT,L_brow_inner_JNT;R_brow_mid_JNT,L_brow_mid_JNT;R_brow_outer_JNT,L_brow_outer_JNT;R_lipLevator_corner_JNT,L_lipLevator_corner_JNT;R_cheekUpper_outer_JNT,L_cheekUpper_outer_JNT;R_cheekUpper_mid_JNT,L_cheekUpper_mid_JNT;R_nostril_outer_JNT,L_nostril_outer_JNT;R_cheekUpper_inner_JNT,L_cheekUpper_inner_JNT;R_squint_inner_JNT,L_squint_inner_JNT;R_squint_mid_JNT,L_squint_mid_JNT;R_squint_outer_JNT,L_squint_outer_JNT;L_lipUpper_corner_JNT,R_lipUpper_corner_JNT;R_lipUpper_corner_JNT,L_lipUpper_corner_JNT;R_frontalis_inner_JNT,L_frontalis_inner_JNT;R_frontalis_outer_JNT,L_frontalis_outer_JNT;L_frontalis_outer_JNT,R_frontalis_outer_JNT;L_frontalis_inner_JNT,R_frontalis_inner_JNT;R_eyelid_fold_JNT,L_eyelid_fold_JNT;L_eyelid_fold_JNT,R_eyelid_fold_JNT;L_eye_bulge_JNT,R_eye_bulge_JNT;R_eye_bulge_JNT,L_eye_bulge_JNT;R_wrist_JNT,L_wrist_JNT;R_elbow_twist_JNT,L_elbow_twist_JNT;R_tassle_03_JNT,L_tassle_03_JNT;L_thumb_01_JNT,R_thumb_01_JNT;L_index_root_JNT,R_index_root_JNT;L_middle_root_JNT,R_middle_root_JNT;L_ring_root_JNT,R_ring_root_JNT;L_pinky_root_JNT,R_pinky_root_JNT;L_depressor_JNT,R_depressor_JNT;R_depressor_JNT,L_depressor_JNT;L_lip_nasolabial_JNT,R_lip_nasolabial_JNT;R_mouth_corner_JNT,L_mouth_corner_JNT;R_lip_nasolabial_JNT,L_lip_nasolabial_JNT;R_lipLower_corner_JNT,L_lipLower_corner_JNT;R_lipLower_JNT,L_lipLower_JNT;L_lipLower_JNT,R_lipLower_JNT;L_mouth_corner_JNT,R_mouth_corner_JNT;L_lipLower_corner_JNT,R_lipLower_corner_JNT;R_jaw_clench_JNT,L_jaw_clench_JNT;L_jaw_clench_JNT,R_jaw_clench_JNT;L_zygomatic_inner_JNT,R_zygomatic_inner_JNT;R_zygomatic_inner_JNT,L_zygomatic_inner_JNT;R_thumb_01_JNT,L_thumb_01_JNT;R_index_root_JNT,L_index_root_JNT;R_middle_root_JNT,L_middle_root_JNT;R_ring_root_JNT,L_ring_root_JNT;R_pinky_root_JNT,L_pinky_root_JNT;L_thumb_02_JNT,R_thumb_02_JNT;L_index_01_JNT,R_index_01_JNT;L_middle_01_JNT,R_middle_01_JNT;L_ring_01_JNT,R_ring_01_JNT;L_pinky_01_JNT,R_pinky_01_JNT;R_thumb_02_JNT,L_thumb_02_JNT;R_index_01_JNT,L_index_01_JNT;R_middle_01_JNT,L_middle_01_JNT;R_ring_01_JNT,L_ring_01_JNT;R_pinky_01_JNT,L_pinky_01_JNT;L_thumb_03_JNT,R_thumb_03_JNT;L_index_02_JNT,R_index_02_JNT;L_middle_02_JNT,R_middle_02_JNT;L_ring_02_JNT,R_ring_02_JNT;L_pinky_02_JNT,R_pinky_02_JNT;R_thumb_03_JNT,L_thumb_03_JNT;R_index_02_JNT,L_index_02_JNT;R_middle_02_JNT,L_middle_02_JNT;R_ring_02_JNT,L_ring_02_JNT;R_pinky_02_JNT,L_pinky_02_JNT;L_index_03_JNT,R_index_03_JNT;L_middle_03_JNT,R_middle_03_JNT;L_ring_03_JNT,R_ring_03_JNT;L_pinky_03_JNT,R_pinky_03_JNT;R_index_03_JNT,L_index_03_JNT;R_middle_03_JNT,L_middle_03_JNT;R_ring_03_JNT,L_ring_03_JNT;R_pinky_03_JNT,L_pinky_03_JNT;\"\n" + } + ] + } + }, + { + "$type": "{5B03C8E6-8CEE-4DA0-A7FA-CD88689DD45B} MeshGroup", + "id": "{3C9D4C02-8F36-5F94-8B47-CEC412E736F3}", + "name": "anigmarinactor", + "NodeSelectionList": { + "unselectedNodes": [ + "RootNode", + "RootNode.rin_eyeballs", + "RootNode.rin_haircap", + "RootNode.rin_cloth", + "RootNode.rin_leather", + "RootNode.rin_armor", + "RootNode.rin_hands", + "RootNode.rin_props", + "RootNode.rin_teeth_low", + "RootNode.rin_teeth_up", + "RootNode.rin_tongue", + "RootNode.rin_face", + "RootNode.rin_armorstraps", + "RootNode.rin_hairplanes", + "RootNode.rin_eyebrows_top", + "RootNode.rin_eyelashes_top", + "RootNode.rin_eyelashes_lower", + "RootNode.rin_eyecover", + "RootNode.rin_facefuzz", + "RootNode.rin_haircards", + "RootNode.rin_lash_01", + "RootNode.rin_lash_02", + "RootNode.rin_lash_03", + "RootNode.rin_eyewetness", + "RootNode.rin_eyebrows_lower", + "RootNode.rin_tearduct", + "RootNode.root", + "RootNode.rin_eyeballs.rin_eyeballs_1", + "RootNode.rin_eyeballs.rin_eyeballs_2", + "RootNode.rin_haircap.rin_haircap_1", + "RootNode.rin_haircap.rin_haircap_2", + "RootNode.rin_cloth.rin_cloth_1", + "RootNode.rin_cloth.rin_cloth_2", + "RootNode.rin_leather.rin_leather_1", + "RootNode.rin_leather.rin_leather_2", + "RootNode.rin_armor.rin_armor_1", + "RootNode.rin_armor.rin_armor_2", + "RootNode.rin_hands.rin_hands_1", + "RootNode.rin_hands.rin_hands_2", + "RootNode.rin_props.rin_props_1", + "RootNode.rin_props.rin_props_2", + "RootNode.rin_teeth_low.rin_teeth_low_1", + "RootNode.rin_teeth_low.rin_teeth_low_2", + "RootNode.rin_teeth_up.rin_teeth_up_1", + "RootNode.rin_teeth_up.rin_teeth_up_2", + "RootNode.rin_tongue.rin_tongue_1", + "RootNode.rin_tongue.rin_tongue_2", + "RootNode.rin_face.rin_face_1", + "RootNode.rin_face.rin_face_2", + "RootNode.rin_armorstraps.rin_armorstraps_1", + "RootNode.rin_armorstraps.rin_armorstraps_2", + "RootNode.rin_hairplanes.rin_hairplanes_1", + "RootNode.rin_hairplanes.rin_hairplanes_2", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2", + "RootNode.rin_eyecover.rin_eyecover_1", + "RootNode.rin_eyecover.rin_eyecover_2", + "RootNode.rin_facefuzz.rin_facefuzz_1", + "RootNode.rin_facefuzz.rin_facefuzz_2", + "RootNode.rin_haircards.rin_haircards_1", + "RootNode.rin_haircards.rin_haircards_2", + "RootNode.rin_lash_01.rin_lash_01_1", + "RootNode.rin_lash_01.rin_lash_01_2", + "RootNode.rin_lash_02.rin_lash_02_1", + "RootNode.rin_lash_02.rin_lash_02_2", + "RootNode.rin_lash_03.rin_lash_03_1", + "RootNode.rin_lash_03.rin_lash_03_2", + "RootNode.rin_eyewetness.rin_eyewetness_1", + "RootNode.rin_eyewetness.rin_eyewetness_2", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2", + "RootNode.rin_tearduct.rin_tearduct_1", + "RootNode.rin_tearduct.rin_tearduct_2", + "RootNode.root.C_pelvis_JNT", + "RootNode.rin_eyeballs.rin_eyeballs_1.Bitangent", + "RootNode.rin_eyeballs.rin_eyeballs_1.SkinWeight_", + "RootNode.rin_eyeballs.rin_eyeballs_1.transform", + "RootNode.rin_eyeballs.rin_eyeballs_1.Tangent", + "RootNode.rin_eyeballs.rin_eyeballs_1.map1", + "RootNode.rin_eyeballs.rin_eyeballs_1.rin_m_eyeballs", + "RootNode.rin_eyeballs.rin_eyeballs_2.Bitangent", + "RootNode.rin_eyeballs.rin_eyeballs_2.SkinWeight_", + "RootNode.rin_eyeballs.rin_eyeballs_2.transform", + "RootNode.rin_eyeballs.rin_eyeballs_2.Tangent", + "RootNode.rin_eyeballs.rin_eyeballs_2.map1", + "RootNode.rin_eyeballs.rin_eyeballs_2.rin_m_eyeballs", + "RootNode.rin_haircap.rin_haircap_1.Bitangent", + "RootNode.rin_haircap.rin_haircap_1.SkinWeight_", + "RootNode.rin_haircap.rin_haircap_1.transform", + "RootNode.rin_haircap.rin_haircap_1.Tangent", + "RootNode.rin_haircap.rin_haircap_1.map1", + "RootNode.rin_haircap.rin_haircap_1.rin_m_haircap", + "RootNode.rin_haircap.rin_haircap_2.Bitangent", + "RootNode.rin_haircap.rin_haircap_2.SkinWeight_", + "RootNode.rin_haircap.rin_haircap_2.transform", + "RootNode.rin_haircap.rin_haircap_2.Tangent", + "RootNode.rin_haircap.rin_haircap_2.map1", + "RootNode.rin_haircap.rin_haircap_2.rin_m_haircap", + "RootNode.rin_cloth.rin_cloth_1.Col0", + "RootNode.rin_cloth.rin_cloth_1.Bitangent", + "RootNode.rin_cloth.rin_cloth_1.SkinWeight_", + "RootNode.rin_cloth.rin_cloth_1.transform", + "RootNode.rin_cloth.rin_cloth_1.Tangent", + "RootNode.rin_cloth.rin_cloth_1.UVMap", + "RootNode.rin_cloth.rin_cloth_1.rin_m_cloth", + "RootNode.rin_cloth.rin_cloth_2.Col0", + "RootNode.rin_cloth.rin_cloth_2.Bitangent", + "RootNode.rin_cloth.rin_cloth_2.SkinWeight_", + "RootNode.rin_cloth.rin_cloth_2.transform", + "RootNode.rin_cloth.rin_cloth_2.Tangent", + "RootNode.rin_cloth.rin_cloth_2.UVMap", + "RootNode.rin_cloth.rin_cloth_2.rin_m_cloth", + "RootNode.rin_leather.rin_leather_1.Col0", + "RootNode.rin_leather.rin_leather_1.Bitangent", + "RootNode.rin_leather.rin_leather_1.SkinWeight_", + "RootNode.rin_leather.rin_leather_1.transform", + "RootNode.rin_leather.rin_leather_1.Tangent", + "RootNode.rin_leather.rin_leather_1.UVMap", + "RootNode.rin_leather.rin_leather_1.rin_m_leather", + "RootNode.rin_leather.rin_leather_2.Col0", + "RootNode.rin_leather.rin_leather_2.Bitangent", + "RootNode.rin_leather.rin_leather_2.SkinWeight_", + "RootNode.rin_leather.rin_leather_2.transform", + "RootNode.rin_leather.rin_leather_2.Tangent", + "RootNode.rin_leather.rin_leather_2.UVMap", + "RootNode.rin_leather.rin_leather_2.rin_m_leather", + "RootNode.rin_armor.rin_armor_1.Col0", + "RootNode.rin_armor.rin_armor_1.Bitangent", + "RootNode.rin_armor.rin_armor_1.SkinWeight_", + "RootNode.rin_armor.rin_armor_1.transform", + "RootNode.rin_armor.rin_armor_1.Tangent", + "RootNode.rin_armor.rin_armor_1.UVMap", + "RootNode.rin_armor.rin_armor_1.rin_m_armor", + "RootNode.rin_armor.rin_armor_2.Col0", + "RootNode.rin_armor.rin_armor_2.Bitangent", + "RootNode.rin_armor.rin_armor_2.SkinWeight_", + "RootNode.rin_armor.rin_armor_2.transform", + "RootNode.rin_armor.rin_armor_2.Tangent", + "RootNode.rin_armor.rin_armor_2.UVMap", + "RootNode.rin_armor.rin_armor_2.rin_m_armor", + "RootNode.rin_hands.rin_hands_1.Col0", + "RootNode.rin_hands.rin_hands_1.Bitangent", + "RootNode.rin_hands.rin_hands_1.SkinWeight_", + "RootNode.rin_hands.rin_hands_1.transform", + "RootNode.rin_hands.rin_hands_1.Tangent", + "RootNode.rin_hands.rin_hands_1.UVMap", + "RootNode.rin_hands.rin_hands_1.rin_m_hands", + "RootNode.rin_hands.rin_hands_2.Col0", + "RootNode.rin_hands.rin_hands_2.Bitangent", + "RootNode.rin_hands.rin_hands_2.SkinWeight_", + "RootNode.rin_hands.rin_hands_2.transform", + "RootNode.rin_hands.rin_hands_2.Tangent", + "RootNode.rin_hands.rin_hands_2.UVMap", + "RootNode.rin_hands.rin_hands_2.rin_m_hands", + "RootNode.rin_props.rin_props_1.Bitangent", + "RootNode.rin_props.rin_props_1.SkinWeight_", + "RootNode.rin_props.rin_props_1.transform", + "RootNode.rin_props.rin_props_1.Tangent", + "RootNode.rin_props.rin_props_1.UVMap", + "RootNode.rin_props.rin_props_1.map1", + "RootNode.rin_props.rin_props_1.rin_m_props", + "RootNode.rin_props.rin_props_2.Bitangent", + "RootNode.rin_props.rin_props_2.SkinWeight_", + "RootNode.rin_props.rin_props_2.transform", + "RootNode.rin_props.rin_props_2.Tangent", + "RootNode.rin_props.rin_props_2.UVMap", + "RootNode.rin_props.rin_props_2.map1", + "RootNode.rin_props.rin_props_2.rin_m_props", + "RootNode.rin_teeth_low.rin_teeth_low_1.Bitangent", + "RootNode.rin_teeth_low.rin_teeth_low_1.SkinWeight_", + "RootNode.rin_teeth_low.rin_teeth_low_1.transform", + "RootNode.rin_teeth_low.rin_teeth_low_1.Tangent", + "RootNode.rin_teeth_low.rin_teeth_low_1.map1", + "RootNode.rin_teeth_low.rin_teeth_low_1.rin_m_mouth", + "RootNode.rin_teeth_low.rin_teeth_low_2.Bitangent", + "RootNode.rin_teeth_low.rin_teeth_low_2.SkinWeight_", + "RootNode.rin_teeth_low.rin_teeth_low_2.transform", + "RootNode.rin_teeth_low.rin_teeth_low_2.Tangent", + "RootNode.rin_teeth_low.rin_teeth_low_2.map1", + "RootNode.rin_teeth_low.rin_teeth_low_2.rin_m_mouth", + "RootNode.rin_teeth_up.rin_teeth_up_1.Bitangent", + "RootNode.rin_teeth_up.rin_teeth_up_1.SkinWeight_", + "RootNode.rin_teeth_up.rin_teeth_up_1.transform", + "RootNode.rin_teeth_up.rin_teeth_up_1.Tangent", + "RootNode.rin_teeth_up.rin_teeth_up_1.map1", + "RootNode.rin_teeth_up.rin_teeth_up_1.rin_m_mouth", + "RootNode.rin_teeth_up.rin_teeth_up_2.Bitangent", + "RootNode.rin_teeth_up.rin_teeth_up_2.SkinWeight_", + "RootNode.rin_teeth_up.rin_teeth_up_2.transform", + "RootNode.rin_teeth_up.rin_teeth_up_2.Tangent", + "RootNode.rin_teeth_up.rin_teeth_up_2.map1", + "RootNode.rin_teeth_up.rin_teeth_up_2.rin_m_mouth", + "RootNode.rin_tongue.rin_tongue_1.Bitangent", + "RootNode.rin_tongue.rin_tongue_1.SkinWeight_", + "RootNode.rin_tongue.rin_tongue_1.transform", + "RootNode.rin_tongue.rin_tongue_1.Tangent", + "RootNode.rin_tongue.rin_tongue_1.map1", + "RootNode.rin_tongue.rin_tongue_1.rin_m_mouth", + "RootNode.rin_tongue.rin_tongue_2.Bitangent", + "RootNode.rin_tongue.rin_tongue_2.SkinWeight_", + "RootNode.rin_tongue.rin_tongue_2.transform", + "RootNode.rin_tongue.rin_tongue_2.Tangent", + "RootNode.rin_tongue.rin_tongue_2.map1", + "RootNode.rin_tongue.rin_tongue_2.rin_m_mouth", + "RootNode.rin_face.rin_face_1.Bitangent", + "RootNode.rin_face.rin_face_1.SkinWeight_", + "RootNode.rin_face.rin_face_1.transform", + "RootNode.rin_face.rin_face_1.Tangent", + "RootNode.rin_face.rin_face_1.map1", + "RootNode.rin_face.rin_face_1.rin_m_face", + "RootNode.rin_face.rin_face_2.Bitangent", + "RootNode.rin_face.rin_face_2.SkinWeight_", + "RootNode.rin_face.rin_face_2.transform", + "RootNode.rin_face.rin_face_2.Tangent", + "RootNode.rin_face.rin_face_2.map1", + "RootNode.rin_face.rin_face_2.rin_m_face", + "RootNode.rin_armorstraps.rin_armorstraps_1.Bitangent", + "RootNode.rin_armorstraps.rin_armorstraps_1.SkinWeight_", + "RootNode.rin_armorstraps.rin_armorstraps_1.transform", + "RootNode.rin_armorstraps.rin_armorstraps_1.Tangent", + "RootNode.rin_armorstraps.rin_armorstraps_1.map1", + "RootNode.rin_armorstraps.rin_armorstraps_1.rin_m_armor", + "RootNode.rin_armorstraps.rin_armorstraps_2.Bitangent", + "RootNode.rin_armorstraps.rin_armorstraps_2.SkinWeight_", + "RootNode.rin_armorstraps.rin_armorstraps_2.transform", + "RootNode.rin_armorstraps.rin_armorstraps_2.Tangent", + "RootNode.rin_armorstraps.rin_armorstraps_2.map1", + "RootNode.rin_armorstraps.rin_armorstraps_2.rin_m_armor", + "RootNode.rin_hairplanes.rin_hairplanes_1.Bitangent", + "RootNode.rin_hairplanes.rin_hairplanes_1.SkinWeight_", + "RootNode.rin_hairplanes.rin_hairplanes_1.transform", + "RootNode.rin_hairplanes.rin_hairplanes_1.Tangent", + "RootNode.rin_hairplanes.rin_hairplanes_1.map1", + "RootNode.rin_hairplanes.rin_hairplanes_1.rin_m_hairplanes", + "RootNode.rin_hairplanes.rin_hairplanes_2.Bitangent", + "RootNode.rin_hairplanes.rin_hairplanes_2.SkinWeight_", + "RootNode.rin_hairplanes.rin_hairplanes_2.transform", + "RootNode.rin_hairplanes.rin_hairplanes_2.Tangent", + "RootNode.rin_hairplanes.rin_hairplanes_2.map1", + "RootNode.rin_hairplanes.rin_hairplanes_2.rin_m_hairplanes", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.Bitangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.SkinWeight_", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.transform", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.Tangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.map1", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.rin_m_eyebrow", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.Bitangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.SkinWeight_", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.transform", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.Tangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.map1", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.rin_m_eyebrow", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.Bitangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.SkinWeight_", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.transform", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.Tangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.map1", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.rin_m_lashes", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.Bitangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.SkinWeight_", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.transform", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.Tangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.map1", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.rin_m_lashes", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.Bitangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.SkinWeight_", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.transform", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.Tangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.map1", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.rin_m_eyebrow", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.Bitangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.SkinWeight_", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.transform", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.Tangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.map1", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.rin_m_eyebrow", + "RootNode.rin_eyecover.rin_eyecover_1.Bitangent", + "RootNode.rin_eyecover.rin_eyecover_1.SkinWeight_", + "RootNode.rin_eyecover.rin_eyecover_1.transform", + "RootNode.rin_eyecover.rin_eyecover_1.Tangent", + "RootNode.rin_eyecover.rin_eyecover_1.map1", + "RootNode.rin_eyecover.rin_eyecover_1.rin_m_eyecover", + "RootNode.rin_eyecover.rin_eyecover_2.Bitangent", + "RootNode.rin_eyecover.rin_eyecover_2.SkinWeight_", + "RootNode.rin_eyecover.rin_eyecover_2.transform", + "RootNode.rin_eyecover.rin_eyecover_2.Tangent", + "RootNode.rin_eyecover.rin_eyecover_2.map1", + "RootNode.rin_eyecover.rin_eyecover_2.rin_m_eyecover", + "RootNode.rin_facefuzz.rin_facefuzz_1.Bitangent", + "RootNode.rin_facefuzz.rin_facefuzz_1.SkinWeight_", + "RootNode.rin_facefuzz.rin_facefuzz_1.transform", + "RootNode.rin_facefuzz.rin_facefuzz_1.Tangent", + "RootNode.rin_facefuzz.rin_facefuzz_1.map1", + "RootNode.rin_facefuzz.rin_facefuzz_1.rin_m_fuzz", + "RootNode.rin_facefuzz.rin_facefuzz_2.Bitangent", + "RootNode.rin_facefuzz.rin_facefuzz_2.SkinWeight_", + "RootNode.rin_facefuzz.rin_facefuzz_2.transform", + "RootNode.rin_facefuzz.rin_facefuzz_2.Tangent", + "RootNode.rin_facefuzz.rin_facefuzz_2.map1", + "RootNode.rin_facefuzz.rin_facefuzz_2.rin_m_fuzz", + "RootNode.rin_haircards.rin_haircards_1.Bitangent", + "RootNode.rin_haircards.rin_haircards_1.SkinWeight_", + "RootNode.rin_haircards.rin_haircards_1.transform", + "RootNode.rin_haircards.rin_haircards_1.Tangent", + "RootNode.rin_haircards.rin_haircards_1.map1", + "RootNode.rin_haircards.rin_haircards_1.rin_m_haircards", + "RootNode.rin_haircards.rin_haircards_2.Bitangent", + "RootNode.rin_haircards.rin_haircards_2.SkinWeight_", + "RootNode.rin_haircards.rin_haircards_2.transform", + "RootNode.rin_haircards.rin_haircards_2.Tangent", + "RootNode.rin_haircards.rin_haircards_2.map1", + "RootNode.rin_haircards.rin_haircards_2.rin_m_haircards", + "RootNode.rin_lash_01.rin_lash_01_1.Bitangent", + "RootNode.rin_lash_01.rin_lash_01_1.SkinWeight_", + "RootNode.rin_lash_01.rin_lash_01_1.transform", + "RootNode.rin_lash_01.rin_lash_01_1.Tangent", + "RootNode.rin_lash_01.rin_lash_01_1.map1", + "RootNode.rin_lash_01.rin_lash_01_1.rin_m_lashes", + "RootNode.rin_lash_01.rin_lash_01_2.Bitangent", + "RootNode.rin_lash_01.rin_lash_01_2.SkinWeight_", + "RootNode.rin_lash_01.rin_lash_01_2.transform", + "RootNode.rin_lash_01.rin_lash_01_2.Tangent", + "RootNode.rin_lash_01.rin_lash_01_2.map1", + "RootNode.rin_lash_01.rin_lash_01_2.rin_m_lashes", + "RootNode.rin_lash_02.rin_lash_02_1.Bitangent", + "RootNode.rin_lash_02.rin_lash_02_1.SkinWeight_", + "RootNode.rin_lash_02.rin_lash_02_1.transform", + "RootNode.rin_lash_02.rin_lash_02_1.Tangent", + "RootNode.rin_lash_02.rin_lash_02_1.map1", + "RootNode.rin_lash_02.rin_lash_02_1.rin_m_lashes", + "RootNode.rin_lash_02.rin_lash_02_2.Bitangent", + "RootNode.rin_lash_02.rin_lash_02_2.SkinWeight_", + "RootNode.rin_lash_02.rin_lash_02_2.transform", + "RootNode.rin_lash_02.rin_lash_02_2.Tangent", + "RootNode.rin_lash_02.rin_lash_02_2.map1", + "RootNode.rin_lash_02.rin_lash_02_2.rin_m_lashes", + "RootNode.rin_lash_03.rin_lash_03_1.Bitangent", + "RootNode.rin_lash_03.rin_lash_03_1.SkinWeight_", + "RootNode.rin_lash_03.rin_lash_03_1.transform", + "RootNode.rin_lash_03.rin_lash_03_1.Tangent", + "RootNode.rin_lash_03.rin_lash_03_1.map1", + "RootNode.rin_lash_03.rin_lash_03_1.rin_m_lashes", + "RootNode.rin_lash_03.rin_lash_03_2.Bitangent", + "RootNode.rin_lash_03.rin_lash_03_2.SkinWeight_", + "RootNode.rin_lash_03.rin_lash_03_2.transform", + "RootNode.rin_lash_03.rin_lash_03_2.Tangent", + "RootNode.rin_lash_03.rin_lash_03_2.map1", + "RootNode.rin_lash_03.rin_lash_03_2.rin_m_lashes", + "RootNode.rin_eyewetness.rin_eyewetness_1.Bitangent", + "RootNode.rin_eyewetness.rin_eyewetness_1.SkinWeight_", + "RootNode.rin_eyewetness.rin_eyewetness_1.transform", + "RootNode.rin_eyewetness.rin_eyewetness_1.Tangent", + "RootNode.rin_eyewetness.rin_eyewetness_1.map1", + "RootNode.rin_eyewetness.rin_eyewetness_1.rin_m_eyewetness", + "RootNode.rin_eyewetness.rin_eyewetness_2.Bitangent", + "RootNode.rin_eyewetness.rin_eyewetness_2.SkinWeight_", + "RootNode.rin_eyewetness.rin_eyewetness_2.transform", + "RootNode.rin_eyewetness.rin_eyewetness_2.Tangent", + "RootNode.rin_eyewetness.rin_eyewetness_2.map1", + "RootNode.rin_eyewetness.rin_eyewetness_2.rin_m_eyewetness", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.Bitangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.SkinWeight_", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.transform", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.Tangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.map1", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.rin_m_eyebrow", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.Bitangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.SkinWeight_", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.transform", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.Tangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.map1", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.rin_m_eyebrow", + "RootNode.rin_tearduct.rin_tearduct_1.Bitangent", + "RootNode.rin_tearduct.rin_tearduct_1.SkinWeight_", + "RootNode.rin_tearduct.rin_tearduct_1.transform", + "RootNode.rin_tearduct.rin_tearduct_1.Tangent", + "RootNode.rin_tearduct.rin_tearduct_1.map1", + "RootNode.rin_tearduct.rin_tearduct_1.rin_m_tearduct", + "RootNode.rin_tearduct.rin_tearduct_2.Bitangent", + "RootNode.rin_tearduct.rin_tearduct_2.SkinWeight_", + "RootNode.rin_tearduct.rin_tearduct_2.transform", + "RootNode.rin_tearduct.rin_tearduct_2.Tangent", + "RootNode.rin_tearduct.rin_tearduct_2.map1", + "RootNode.rin_tearduct.rin_tearduct_2.rin_m_tearduct", + "RootNode.root.C_pelvis_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT", + "RootNode.root.C_pelvis_JNT.C_legArmor_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_sword_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_leg_twist_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_leg_twist_JNT", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT.L_ribbon_02_JNT", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT.R_ribbon_02_JNT", + "RootNode.root.C_pelvis_JNT.C_legArmor_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_sword_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_knee_twist_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_leg_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_knee_twist_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_leg_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT.L_ribbon_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT.R_ribbon_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT.L_toe_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_knee_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT.R_toe_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_knee_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neckCollar_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_02_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT.L_toe_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT.R_toe_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_armPit_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_armPit_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neckCollar_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_arm_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_armBulge_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT.L_tassleLoop_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_armPit_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_throat_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_arm_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_armBulge_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT.R_tassleLoop_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_armPit_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT.C_hood_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_elbow_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_arm_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_armBulge_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT.L_tassle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT.L_tassleLoop_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_corrugator_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_noseBridge_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_zygomatic_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekBone_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_ear_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_chin_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_chin_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_lower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_upper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_levator_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipLevator_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipUpper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_upper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_lower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekBone_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_zygomatic_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_chin_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_ear_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_slide_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_fold_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_fold_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_bulge_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_bulge_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_throat_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_elbow_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_arm_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_armBulge_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT.R_tassle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT.R_tassleLoop_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT.C_hood_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_elbow_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT.L_tassle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_corrugator_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_noseBridge_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_zygomatic_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekBone_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_ear_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_chin_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_chin_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_lower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_upper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_levator_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipLevator_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipUpper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_mentalis_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_depressor_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_depressor_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lip_nasolabial_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_mouth_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lip_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lip_nasolabial_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lipLower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_mouth_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_jaw_clench_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_jaw_clench_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_zygomatic_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_zygomatic_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_upper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_lower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekBone_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_zygomatic_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_chin_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_ear_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_slide_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_fold_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_fold_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_bulge_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_bulge_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_elbow_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT.R_tassle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_mentalis_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_depressor_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_depressor_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lip_nasolabial_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_mouth_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lip_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lip_nasolabial_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lipLower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_mouth_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_jaw_clench_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_jaw_clench_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_zygomatic_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_zygomatic_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT.L_thumb_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT.C_tongue_tip_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT.R_thumb_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT.L_thumb_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT.L_index_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT.L_middle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT.L_ring_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT.L_pinky_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT.C_tongue_tip_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT.R_thumb_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT.R_index_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT.R_middle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT.R_ring_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT.R_pinky_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT.L_index_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT.L_middle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT.L_ring_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT.L_pinky_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT.R_index_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT.R_middle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT.R_ring_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT.R_pinky_03_JNT.transform" + ] + } + }, + { + "$type": "{07B356B7-3635-40B5-878A-FAC4EFD5AD86} MeshGroup", + "name": "RinMM", + "nodeSelectionList": { + "selectedNodes": [ + "RootNode", + "RootNode.rin_eyeballs", + "RootNode.rin_haircap", + "RootNode.rin_cloth", + "RootNode.rin_leather", + "RootNode.rin_armor", + "RootNode.rin_hands", + "RootNode.rin_props", + "RootNode.rin_teeth_low", + "RootNode.rin_teeth_up", + "RootNode.rin_tongue", + "RootNode.rin_face", + "RootNode.rin_armorstraps", + "RootNode.rin_hairplanes", + "RootNode.rin_eyebrows_top", + "RootNode.rin_eyelashes_top", + "RootNode.rin_eyelashes_lower", + "RootNode.rin_eyecover", + "RootNode.rin_facefuzz", + "RootNode.rin_haircards", + "RootNode.rin_lash_01", + "RootNode.rin_lash_02", + "RootNode.rin_lash_03", + "RootNode.rin_eyewetness", + "RootNode.rin_eyebrows_lower", + "RootNode.rin_tearduct", + "RootNode.root", + "RootNode.rin_eyeballs.rin_eyeballs_1", + "RootNode.rin_eyeballs.rin_eyeballs_2", + "RootNode.rin_haircap.rin_haircap_1", + "RootNode.rin_haircap.rin_haircap_2", + "RootNode.rin_cloth.rin_cloth_1", + "RootNode.rin_cloth.rin_cloth_2", + "RootNode.rin_leather.rin_leather_1", + "RootNode.rin_leather.rin_leather_2", + "RootNode.rin_armor.rin_armor_1", + "RootNode.rin_armor.rin_armor_2", + "RootNode.rin_hands.rin_hands_1", + "RootNode.rin_hands.rin_hands_2", + "RootNode.rin_props.rin_props_1", + "RootNode.rin_props.rin_props_2", + "RootNode.rin_teeth_low.rin_teeth_low_1", + "RootNode.rin_teeth_low.rin_teeth_low_2", + "RootNode.rin_teeth_up.rin_teeth_up_1", + "RootNode.rin_teeth_up.rin_teeth_up_2", + "RootNode.rin_tongue.rin_tongue_1", + "RootNode.rin_tongue.rin_tongue_2", + "RootNode.rin_face.rin_face_1", + "RootNode.rin_face.rin_face_2", + "RootNode.rin_armorstraps.rin_armorstraps_1", + "RootNode.rin_armorstraps.rin_armorstraps_2", + "RootNode.rin_hairplanes.rin_hairplanes_1", + "RootNode.rin_hairplanes.rin_hairplanes_2", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2", + "RootNode.rin_eyecover.rin_eyecover_1", + "RootNode.rin_eyecover.rin_eyecover_2", + "RootNode.rin_facefuzz.rin_facefuzz_1", + "RootNode.rin_facefuzz.rin_facefuzz_2", + "RootNode.rin_haircards.rin_haircards_1", + "RootNode.rin_haircards.rin_haircards_2", + "RootNode.rin_lash_01.rin_lash_01_1", + "RootNode.rin_lash_01.rin_lash_01_2", + "RootNode.rin_lash_02.rin_lash_02_1", + "RootNode.rin_lash_02.rin_lash_02_2", + "RootNode.rin_lash_03.rin_lash_03_1", + "RootNode.rin_lash_03.rin_lash_03_2", + "RootNode.rin_eyewetness.rin_eyewetness_1", + "RootNode.rin_eyewetness.rin_eyewetness_2", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2", + "RootNode.rin_tearduct.rin_tearduct_1", + "RootNode.rin_tearduct.rin_tearduct_2", + "RootNode.root.C_pelvis_JNT", + "RootNode.rin_eyeballs.rin_eyeballs_1.Bitangent", + "RootNode.rin_eyeballs.rin_eyeballs_1.SkinWeight_", + "RootNode.rin_eyeballs.rin_eyeballs_1.transform", + "RootNode.rin_eyeballs.rin_eyeballs_1.Tangent", + "RootNode.rin_eyeballs.rin_eyeballs_1.map1", + "RootNode.rin_eyeballs.rin_eyeballs_1.rin_m_eyeballs", + "RootNode.rin_eyeballs.rin_eyeballs_2.Bitangent", + "RootNode.rin_eyeballs.rin_eyeballs_2.SkinWeight_", + "RootNode.rin_eyeballs.rin_eyeballs_2.transform", + "RootNode.rin_eyeballs.rin_eyeballs_2.Tangent", + "RootNode.rin_eyeballs.rin_eyeballs_2.map1", + "RootNode.rin_eyeballs.rin_eyeballs_2.rin_m_eyeballs", + "RootNode.rin_haircap.rin_haircap_1.Bitangent", + "RootNode.rin_haircap.rin_haircap_1.SkinWeight_", + "RootNode.rin_haircap.rin_haircap_1.transform", + "RootNode.rin_haircap.rin_haircap_1.Tangent", + "RootNode.rin_haircap.rin_haircap_1.map1", + "RootNode.rin_haircap.rin_haircap_1.rin_m_haircap", + "RootNode.rin_haircap.rin_haircap_2.Bitangent", + "RootNode.rin_haircap.rin_haircap_2.SkinWeight_", + "RootNode.rin_haircap.rin_haircap_2.transform", + "RootNode.rin_haircap.rin_haircap_2.Tangent", + "RootNode.rin_haircap.rin_haircap_2.map1", + "RootNode.rin_haircap.rin_haircap_2.rin_m_haircap", + "RootNode.rin_cloth.rin_cloth_1.Col0", + "RootNode.rin_cloth.rin_cloth_1.Bitangent", + "RootNode.rin_cloth.rin_cloth_1.SkinWeight_", + "RootNode.rin_cloth.rin_cloth_1.transform", + "RootNode.rin_cloth.rin_cloth_1.Tangent", + "RootNode.rin_cloth.rin_cloth_1.UVMap", + "RootNode.rin_cloth.rin_cloth_1.rin_m_cloth", + "RootNode.rin_cloth.rin_cloth_2.Col0", + "RootNode.rin_cloth.rin_cloth_2.Bitangent", + "RootNode.rin_cloth.rin_cloth_2.SkinWeight_", + "RootNode.rin_cloth.rin_cloth_2.transform", + "RootNode.rin_cloth.rin_cloth_2.Tangent", + "RootNode.rin_cloth.rin_cloth_2.UVMap", + "RootNode.rin_cloth.rin_cloth_2.rin_m_cloth", + "RootNode.rin_leather.rin_leather_1.Col0", + "RootNode.rin_leather.rin_leather_1.Bitangent", + "RootNode.rin_leather.rin_leather_1.SkinWeight_", + "RootNode.rin_leather.rin_leather_1.transform", + "RootNode.rin_leather.rin_leather_1.Tangent", + "RootNode.rin_leather.rin_leather_1.UVMap", + "RootNode.rin_leather.rin_leather_1.rin_m_leather", + "RootNode.rin_leather.rin_leather_2.Col0", + "RootNode.rin_leather.rin_leather_2.Bitangent", + "RootNode.rin_leather.rin_leather_2.SkinWeight_", + "RootNode.rin_leather.rin_leather_2.transform", + "RootNode.rin_leather.rin_leather_2.Tangent", + "RootNode.rin_leather.rin_leather_2.UVMap", + "RootNode.rin_leather.rin_leather_2.rin_m_leather", + "RootNode.rin_armor.rin_armor_1.Col0", + "RootNode.rin_armor.rin_armor_1.Bitangent", + "RootNode.rin_armor.rin_armor_1.SkinWeight_", + "RootNode.rin_armor.rin_armor_1.transform", + "RootNode.rin_armor.rin_armor_1.Tangent", + "RootNode.rin_armor.rin_armor_1.UVMap", + "RootNode.rin_armor.rin_armor_1.rin_m_armor", + "RootNode.rin_armor.rin_armor_2.Col0", + "RootNode.rin_armor.rin_armor_2.Bitangent", + "RootNode.rin_armor.rin_armor_2.SkinWeight_", + "RootNode.rin_armor.rin_armor_2.transform", + "RootNode.rin_armor.rin_armor_2.Tangent", + "RootNode.rin_armor.rin_armor_2.UVMap", + "RootNode.rin_armor.rin_armor_2.rin_m_armor", + "RootNode.rin_hands.rin_hands_1.Col0", + "RootNode.rin_hands.rin_hands_1.Bitangent", + "RootNode.rin_hands.rin_hands_1.SkinWeight_", + "RootNode.rin_hands.rin_hands_1.transform", + "RootNode.rin_hands.rin_hands_1.Tangent", + "RootNode.rin_hands.rin_hands_1.UVMap", + "RootNode.rin_hands.rin_hands_1.rin_m_hands", + "RootNode.rin_hands.rin_hands_2.Col0", + "RootNode.rin_hands.rin_hands_2.Bitangent", + "RootNode.rin_hands.rin_hands_2.SkinWeight_", + "RootNode.rin_hands.rin_hands_2.transform", + "RootNode.rin_hands.rin_hands_2.Tangent", + "RootNode.rin_hands.rin_hands_2.UVMap", + "RootNode.rin_hands.rin_hands_2.rin_m_hands", + "RootNode.rin_props.rin_props_1.Bitangent", + "RootNode.rin_props.rin_props_1.SkinWeight_", + "RootNode.rin_props.rin_props_1.transform", + "RootNode.rin_props.rin_props_1.Tangent", + "RootNode.rin_props.rin_props_1.UVMap", + "RootNode.rin_props.rin_props_1.map1", + "RootNode.rin_props.rin_props_1.rin_m_props", + "RootNode.rin_props.rin_props_2.Bitangent", + "RootNode.rin_props.rin_props_2.SkinWeight_", + "RootNode.rin_props.rin_props_2.transform", + "RootNode.rin_props.rin_props_2.Tangent", + "RootNode.rin_props.rin_props_2.UVMap", + "RootNode.rin_props.rin_props_2.map1", + "RootNode.rin_props.rin_props_2.rin_m_props", + "RootNode.rin_teeth_low.rin_teeth_low_1.Bitangent", + "RootNode.rin_teeth_low.rin_teeth_low_1.SkinWeight_", + "RootNode.rin_teeth_low.rin_teeth_low_1.transform", + "RootNode.rin_teeth_low.rin_teeth_low_1.Tangent", + "RootNode.rin_teeth_low.rin_teeth_low_1.map1", + "RootNode.rin_teeth_low.rin_teeth_low_1.rin_m_mouth", + "RootNode.rin_teeth_low.rin_teeth_low_2.Bitangent", + "RootNode.rin_teeth_low.rin_teeth_low_2.SkinWeight_", + "RootNode.rin_teeth_low.rin_teeth_low_2.transform", + "RootNode.rin_teeth_low.rin_teeth_low_2.Tangent", + "RootNode.rin_teeth_low.rin_teeth_low_2.map1", + "RootNode.rin_teeth_low.rin_teeth_low_2.rin_m_mouth", + "RootNode.rin_teeth_up.rin_teeth_up_1.Bitangent", + "RootNode.rin_teeth_up.rin_teeth_up_1.SkinWeight_", + "RootNode.rin_teeth_up.rin_teeth_up_1.transform", + "RootNode.rin_teeth_up.rin_teeth_up_1.Tangent", + "RootNode.rin_teeth_up.rin_teeth_up_1.map1", + "RootNode.rin_teeth_up.rin_teeth_up_1.rin_m_mouth", + "RootNode.rin_teeth_up.rin_teeth_up_2.Bitangent", + "RootNode.rin_teeth_up.rin_teeth_up_2.SkinWeight_", + "RootNode.rin_teeth_up.rin_teeth_up_2.transform", + "RootNode.rin_teeth_up.rin_teeth_up_2.Tangent", + "RootNode.rin_teeth_up.rin_teeth_up_2.map1", + "RootNode.rin_teeth_up.rin_teeth_up_2.rin_m_mouth", + "RootNode.rin_tongue.rin_tongue_1.Bitangent", + "RootNode.rin_tongue.rin_tongue_1.SkinWeight_", + "RootNode.rin_tongue.rin_tongue_1.transform", + "RootNode.rin_tongue.rin_tongue_1.Tangent", + "RootNode.rin_tongue.rin_tongue_1.map1", + "RootNode.rin_tongue.rin_tongue_1.rin_m_mouth", + "RootNode.rin_tongue.rin_tongue_2.Bitangent", + "RootNode.rin_tongue.rin_tongue_2.SkinWeight_", + "RootNode.rin_tongue.rin_tongue_2.transform", + "RootNode.rin_tongue.rin_tongue_2.Tangent", + "RootNode.rin_tongue.rin_tongue_2.map1", + "RootNode.rin_tongue.rin_tongue_2.rin_m_mouth", + "RootNode.rin_face.rin_face_1.Bitangent", + "RootNode.rin_face.rin_face_1.SkinWeight_", + "RootNode.rin_face.rin_face_1.transform", + "RootNode.rin_face.rin_face_1.Tangent", + "RootNode.rin_face.rin_face_1.map1", + "RootNode.rin_face.rin_face_1.rin_m_face", + "RootNode.rin_face.rin_face_2.Bitangent", + "RootNode.rin_face.rin_face_2.SkinWeight_", + "RootNode.rin_face.rin_face_2.transform", + "RootNode.rin_face.rin_face_2.Tangent", + "RootNode.rin_face.rin_face_2.map1", + "RootNode.rin_face.rin_face_2.rin_m_face", + "RootNode.rin_armorstraps.rin_armorstraps_1.Bitangent", + "RootNode.rin_armorstraps.rin_armorstraps_1.SkinWeight_", + "RootNode.rin_armorstraps.rin_armorstraps_1.transform", + "RootNode.rin_armorstraps.rin_armorstraps_1.Tangent", + "RootNode.rin_armorstraps.rin_armorstraps_1.map1", + "RootNode.rin_armorstraps.rin_armorstraps_1.rin_m_armor", + "RootNode.rin_armorstraps.rin_armorstraps_2.Bitangent", + "RootNode.rin_armorstraps.rin_armorstraps_2.SkinWeight_", + "RootNode.rin_armorstraps.rin_armorstraps_2.transform", + "RootNode.rin_armorstraps.rin_armorstraps_2.Tangent", + "RootNode.rin_armorstraps.rin_armorstraps_2.map1", + "RootNode.rin_armorstraps.rin_armorstraps_2.rin_m_armor", + "RootNode.rin_hairplanes.rin_hairplanes_1.Bitangent", + "RootNode.rin_hairplanes.rin_hairplanes_1.SkinWeight_", + "RootNode.rin_hairplanes.rin_hairplanes_1.transform", + "RootNode.rin_hairplanes.rin_hairplanes_1.Tangent", + "RootNode.rin_hairplanes.rin_hairplanes_1.map1", + "RootNode.rin_hairplanes.rin_hairplanes_1.rin_m_hairplanes", + "RootNode.rin_hairplanes.rin_hairplanes_2.Bitangent", + "RootNode.rin_hairplanes.rin_hairplanes_2.SkinWeight_", + "RootNode.rin_hairplanes.rin_hairplanes_2.transform", + "RootNode.rin_hairplanes.rin_hairplanes_2.Tangent", + "RootNode.rin_hairplanes.rin_hairplanes_2.map1", + "RootNode.rin_hairplanes.rin_hairplanes_2.rin_m_hairplanes", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.Bitangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.SkinWeight_", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.transform", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.Tangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.map1", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_1.rin_m_eyebrow", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.Bitangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.SkinWeight_", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.transform", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.Tangent", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.map1", + "RootNode.rin_eyebrows_top.rin_eyebrows_top_2.rin_m_eyebrow", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.Bitangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.SkinWeight_", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.transform", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.Tangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.map1", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_1.rin_m_lashes", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.Bitangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.SkinWeight_", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.transform", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.Tangent", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.map1", + "RootNode.rin_eyelashes_top.rin_eyelashes_top_2.rin_m_lashes", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.Bitangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.SkinWeight_", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.transform", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.Tangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.map1", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_1.rin_m_eyebrow", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.Bitangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.SkinWeight_", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.transform", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.Tangent", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.map1", + "RootNode.rin_eyelashes_lower.rin_eyelashes_lower_2.rin_m_eyebrow", + "RootNode.rin_eyecover.rin_eyecover_1.Bitangent", + "RootNode.rin_eyecover.rin_eyecover_1.SkinWeight_", + "RootNode.rin_eyecover.rin_eyecover_1.transform", + "RootNode.rin_eyecover.rin_eyecover_1.Tangent", + "RootNode.rin_eyecover.rin_eyecover_1.map1", + "RootNode.rin_eyecover.rin_eyecover_1.rin_m_eyecover", + "RootNode.rin_eyecover.rin_eyecover_2.Bitangent", + "RootNode.rin_eyecover.rin_eyecover_2.SkinWeight_", + "RootNode.rin_eyecover.rin_eyecover_2.transform", + "RootNode.rin_eyecover.rin_eyecover_2.Tangent", + "RootNode.rin_eyecover.rin_eyecover_2.map1", + "RootNode.rin_eyecover.rin_eyecover_2.rin_m_eyecover", + "RootNode.rin_facefuzz.rin_facefuzz_1.Bitangent", + "RootNode.rin_facefuzz.rin_facefuzz_1.SkinWeight_", + "RootNode.rin_facefuzz.rin_facefuzz_1.transform", + "RootNode.rin_facefuzz.rin_facefuzz_1.Tangent", + "RootNode.rin_facefuzz.rin_facefuzz_1.map1", + "RootNode.rin_facefuzz.rin_facefuzz_1.rin_m_fuzz", + "RootNode.rin_facefuzz.rin_facefuzz_2.Bitangent", + "RootNode.rin_facefuzz.rin_facefuzz_2.SkinWeight_", + "RootNode.rin_facefuzz.rin_facefuzz_2.transform", + "RootNode.rin_facefuzz.rin_facefuzz_2.Tangent", + "RootNode.rin_facefuzz.rin_facefuzz_2.map1", + "RootNode.rin_facefuzz.rin_facefuzz_2.rin_m_fuzz", + "RootNode.rin_haircards.rin_haircards_1.Bitangent", + "RootNode.rin_haircards.rin_haircards_1.SkinWeight_", + "RootNode.rin_haircards.rin_haircards_1.transform", + "RootNode.rin_haircards.rin_haircards_1.Tangent", + "RootNode.rin_haircards.rin_haircards_1.map1", + "RootNode.rin_haircards.rin_haircards_1.rin_m_haircards", + "RootNode.rin_haircards.rin_haircards_2.Bitangent", + "RootNode.rin_haircards.rin_haircards_2.SkinWeight_", + "RootNode.rin_haircards.rin_haircards_2.transform", + "RootNode.rin_haircards.rin_haircards_2.Tangent", + "RootNode.rin_haircards.rin_haircards_2.map1", + "RootNode.rin_haircards.rin_haircards_2.rin_m_haircards", + "RootNode.rin_lash_01.rin_lash_01_1.Bitangent", + "RootNode.rin_lash_01.rin_lash_01_1.SkinWeight_", + "RootNode.rin_lash_01.rin_lash_01_1.transform", + "RootNode.rin_lash_01.rin_lash_01_1.Tangent", + "RootNode.rin_lash_01.rin_lash_01_1.map1", + "RootNode.rin_lash_01.rin_lash_01_1.rin_m_lashes", + "RootNode.rin_lash_01.rin_lash_01_2.Bitangent", + "RootNode.rin_lash_01.rin_lash_01_2.SkinWeight_", + "RootNode.rin_lash_01.rin_lash_01_2.transform", + "RootNode.rin_lash_01.rin_lash_01_2.Tangent", + "RootNode.rin_lash_01.rin_lash_01_2.map1", + "RootNode.rin_lash_01.rin_lash_01_2.rin_m_lashes", + "RootNode.rin_lash_02.rin_lash_02_1.Bitangent", + "RootNode.rin_lash_02.rin_lash_02_1.SkinWeight_", + "RootNode.rin_lash_02.rin_lash_02_1.transform", + "RootNode.rin_lash_02.rin_lash_02_1.Tangent", + "RootNode.rin_lash_02.rin_lash_02_1.map1", + "RootNode.rin_lash_02.rin_lash_02_1.rin_m_lashes", + "RootNode.rin_lash_02.rin_lash_02_2.Bitangent", + "RootNode.rin_lash_02.rin_lash_02_2.SkinWeight_", + "RootNode.rin_lash_02.rin_lash_02_2.transform", + "RootNode.rin_lash_02.rin_lash_02_2.Tangent", + "RootNode.rin_lash_02.rin_lash_02_2.map1", + "RootNode.rin_lash_02.rin_lash_02_2.rin_m_lashes", + "RootNode.rin_lash_03.rin_lash_03_1.Bitangent", + "RootNode.rin_lash_03.rin_lash_03_1.SkinWeight_", + "RootNode.rin_lash_03.rin_lash_03_1.transform", + "RootNode.rin_lash_03.rin_lash_03_1.Tangent", + "RootNode.rin_lash_03.rin_lash_03_1.map1", + "RootNode.rin_lash_03.rin_lash_03_1.rin_m_lashes", + "RootNode.rin_lash_03.rin_lash_03_2.Bitangent", + "RootNode.rin_lash_03.rin_lash_03_2.SkinWeight_", + "RootNode.rin_lash_03.rin_lash_03_2.transform", + "RootNode.rin_lash_03.rin_lash_03_2.Tangent", + "RootNode.rin_lash_03.rin_lash_03_2.map1", + "RootNode.rin_lash_03.rin_lash_03_2.rin_m_lashes", + "RootNode.rin_eyewetness.rin_eyewetness_1.Bitangent", + "RootNode.rin_eyewetness.rin_eyewetness_1.SkinWeight_", + "RootNode.rin_eyewetness.rin_eyewetness_1.transform", + "RootNode.rin_eyewetness.rin_eyewetness_1.Tangent", + "RootNode.rin_eyewetness.rin_eyewetness_1.map1", + "RootNode.rin_eyewetness.rin_eyewetness_1.rin_m_eyewetness", + "RootNode.rin_eyewetness.rin_eyewetness_2.Bitangent", + "RootNode.rin_eyewetness.rin_eyewetness_2.SkinWeight_", + "RootNode.rin_eyewetness.rin_eyewetness_2.transform", + "RootNode.rin_eyewetness.rin_eyewetness_2.Tangent", + "RootNode.rin_eyewetness.rin_eyewetness_2.map1", + "RootNode.rin_eyewetness.rin_eyewetness_2.rin_m_eyewetness", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.Bitangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.SkinWeight_", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.transform", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.Tangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.map1", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_1.rin_m_eyebrow", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.Bitangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.SkinWeight_", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.transform", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.Tangent", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.map1", + "RootNode.rin_eyebrows_lower.rin_eyebrows_lower_2.rin_m_eyebrow", + "RootNode.rin_tearduct.rin_tearduct_1.Bitangent", + "RootNode.rin_tearduct.rin_tearduct_1.SkinWeight_", + "RootNode.rin_tearduct.rin_tearduct_1.transform", + "RootNode.rin_tearduct.rin_tearduct_1.Tangent", + "RootNode.rin_tearduct.rin_tearduct_1.map1", + "RootNode.rin_tearduct.rin_tearduct_1.rin_m_tearduct", + "RootNode.rin_tearduct.rin_tearduct_2.Bitangent", + "RootNode.rin_tearduct.rin_tearduct_2.SkinWeight_", + "RootNode.rin_tearduct.rin_tearduct_2.transform", + "RootNode.rin_tearduct.rin_tearduct_2.Tangent", + "RootNode.rin_tearduct.rin_tearduct_2.map1", + "RootNode.rin_tearduct.rin_tearduct_2.rin_m_tearduct", + "RootNode.root.C_pelvis_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT", + "RootNode.root.C_pelvis_JNT.C_legArmor_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_sword_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_leg_twist_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_leg_twist_JNT", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT.L_ribbon_02_JNT", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT.R_ribbon_02_JNT", + "RootNode.root.C_pelvis_JNT.C_legArmor_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_sword_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_knee_twist_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_leg_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_knee_twist_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_leg_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_ribbon_01_JNT.L_ribbon_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_ribbon_01_JNT.R_ribbon_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT.transform", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT.L_toe_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_knee_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT.R_toe_JNT", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_knee_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neckCollar_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_02_JNT", + "RootNode.root.C_pelvis_JNT.L_leg_JNT.L_knee_JNT.L_foot_JNT.L_toe_JNT.transform", + "RootNode.root.C_pelvis_JNT.R_leg_JNT.R_knee_JNT.R_foot_JNT.R_toe_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_armPit_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_armPit_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neckCollar_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_neckCollar_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_neckCollar_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_arm_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_armBulge_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT.L_tassleLoop_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_armPit_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_throat_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_arm_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_armBulge_corr_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT.R_tassleLoop_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_armPit_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT.C_hood_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_elbow_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_arm_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_armBulge_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT.L_tassle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassleLoop_01_JNT.L_tassleLoop_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_corrugator_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_noseBridge_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_zygomatic_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekBone_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_ear_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_chin_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_chin_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_lower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_upper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_levator_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipLevator_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipUpper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_upper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_lower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekBone_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_zygomatic_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_chin_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_ear_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_slide_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_outer_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_fold_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_fold_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_bulge_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_bulge_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_throat_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_elbow_twist_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_arm_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_armBulge_corr_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT.R_tassle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassleLoop_01_JNT.R_tassleLoop_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_hood_01_JNT.C_hood_02_JNT.C_hood_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_elbow_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_tassle_01_JNT.L_tassle_02_JNT.L_tassle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_brow_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_corrugator_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_noseBridge_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_nostril_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_squint_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_zygomatic_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekBone_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_ear_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_chin_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_chin_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_lower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_upper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_levator_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipLevator_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_lipUpper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipLevator_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_mentalis_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_depressor_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_depressor_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lip_nasolabial_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_mouth_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lip_below_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lip_nasolabial_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lipLower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_mouth_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_corner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_jaw_clench_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_jaw_clench_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_zygomatic_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_zygomatic_inner_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_cheekUpper_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_upper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_lower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekBone_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_zygomatic_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_chin_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_ear_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_nose_slide_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_brow_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipLevator_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_nostril_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_cheekUpper_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_squint_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_lipUpper_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_lipUpper_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_frontalis_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_outer_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_frontalis_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eyelid_fold_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eyelid_fold_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.L_eye_bulge_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.R_eye_bulge_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_elbow_twist_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_tassle_01_JNT.R_tassle_02_JNT.R_tassle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_mentalis_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_depressor_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_depressor_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lip_nasolabial_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_mouth_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lip_below_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lip_nasolabial_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_lipLower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_lipLower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_mouth_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_lipLower_corner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_jaw_clench_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_jaw_clench_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.L_zygomatic_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.R_zygomatic_inner_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT.L_thumb_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT.C_tongue_tip_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT.R_thumb_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_thumb_01_JNT.L_thumb_02_JNT.L_thumb_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT.L_index_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT.L_middle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT.L_ring_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT.L_pinky_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.C_neck_01_JNT.C_neck_02_JNT.C_head_JNT.C_jaw_JNT.C_tongue_root_JNT.C_tongue_mid_JNT.C_tongue_tip_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_thumb_01_JNT.R_thumb_02_JNT.R_thumb_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT.R_index_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT.R_middle_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT.R_ring_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT.R_pinky_03_JNT", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_index_root_JNT.L_index_01_JNT.L_index_02_JNT.L_index_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_middle_root_JNT.L_middle_01_JNT.L_middle_02_JNT.L_middle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_ring_root_JNT.L_ring_01_JNT.L_ring_02_JNT.L_ring_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.L_clavicle_JNT.L_arm_JNT.L_elbow_JNT.L_wrist_JNT.L_pinky_root_JNT.L_pinky_01_JNT.L_pinky_02_JNT.L_pinky_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_index_root_JNT.R_index_01_JNT.R_index_02_JNT.R_index_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_middle_root_JNT.R_middle_01_JNT.R_middle_02_JNT.R_middle_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_ring_root_JNT.R_ring_01_JNT.R_ring_02_JNT.R_ring_03_JNT.transform", + "RootNode.root.C_pelvis_JNT.C_spine_01_JNT.C_spine_02_JNT.C_spine_03_JNT.C_spine_04_JNT.R_clavicle_JNT.R_arm_JNT.R_elbow_JNT.R_wrist_JNT.R_pinky_root_JNT.R_pinky_01_JNT.R_pinky_02_JNT.R_pinky_03_JNT.transform" + ] + }, + "rules": { + "rules": [ + { + "$type": "SkinRule" + }, + { + "$type": "StaticMeshAdvancedRule", + "vertexColorStreamName": "Col0" + }, + { + "$type": "MaterialRule" + } + ] + }, + "id": "{CA754822-3673-46C8-9EE7-3453CF782C5A}" + } + ] +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/MotionMatching.animgraph b/Gems/MotionMatching/Assets/MotionMatching.animgraph new file mode 100644 index 0000000000..10707eb6c4 --- /dev/null +++ b/Gems/MotionMatching/Assets/MotionMatching.animgraph @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09cc2374b99c219421812ec39b68a350912d44777a50e3078c8cd67e91cc74cf +size 30927 diff --git a/Gems/MotionMatching/Assets/MotionMatching.emfxworkspace b/Gems/MotionMatching/Assets/MotionMatching.emfxworkspace new file mode 100644 index 0000000000..6d59fa310d --- /dev/null +++ b/Gems/MotionMatching/Assets/MotionMatching.emfxworkspace @@ -0,0 +1,3 @@ +[General] +version=1 +startScript="ImportActor -filename \"Character/RinMM.actor\"\nCreateActorInstance -actorID %LASTRESULT% -xPos 4.585605 -yPos -7.166286 -zPos 0.000000 -xScale 1.000000 -yScale 1.000000 -zScale 1.000000 -rot 0.00000000,0.00000000,0.98711985,-0.15998250\nLoadMotionSet -filename \"@products@/MotionMatching.motionset\"\nLoadAnimGraph -filename \"@products@/MotionMatching.animgraph\"\nActivateAnimGraph -actorInstanceID %LASTRESULT3% -animGraphID %LASTRESULT1% -motionSetID %LASTRESULT2% -visualizeScale 1.000000\n" diff --git a/Gems/MotionMatching/Assets/MotionMatching.motionset b/Gems/MotionMatching/Assets/MotionMatching.motionset new file mode 100644 index 0000000000..276895e3a0 --- /dev/null +++ b/Gems/MotionMatching/Assets/MotionMatching.motionset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c895a1696f5f37492089ceaef11210d704c1fb7e3dd31305cf4732d63489507 +size 13645 diff --git a/Gems/MotionMatching/CMakeLists.txt b/Gems/MotionMatching/CMakeLists.txt new file mode 100644 index 0000000000..341df6e33d --- /dev/null +++ b/Gems/MotionMatching/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# 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 +# +# + +set(o3de_gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(o3de_gem_json ${o3de_gem_path}/gem.json) +o3de_read_json_key(o3de_gem_name ${o3de_gem_json} "gem_name") +o3de_restricted_path(${o3de_gem_json} o3de_gem_restricted_path) + +ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) + +add_subdirectory(Code) diff --git a/Gems/MotionMatching/Code/CMakeLists.txt b/Gems/MotionMatching/Code/CMakeLists.txt new file mode 100644 index 0000000000..275f8f2530 --- /dev/null +++ b/Gems/MotionMatching/Code/CMakeLists.txt @@ -0,0 +1,155 @@ +# +# 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 +# +# + +# Add the MotionMatching.Static target +ly_add_target( + NAME MotionMatching.Static STATIC + NAMESPACE Gem + FILES_CMAKE + motionmatching_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + Include + PRIVATE + Source + BUILD_DEPENDENCIES + PUBLIC + AZ::AzCore + AZ::AzFramework + Gem::EMotionFXStaticLib + Gem::ImguiAtom.Static +) + +# Here add MotionMatching target, it depends on the MotionMatching.Static +ly_add_target( + NAME MotionMatching ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} + NAMESPACE Gem + FILES_CMAKE + motionmatching_shared_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + Include + PRIVATE + Source + BUILD_DEPENDENCIES + PRIVATE + Gem::MotionMatching.Static + Gem::ImGui.Static + Gem::ImGui.ImGuiLYUtils +) + +# By default, we will specify that the above target MotionMatching would be used by +# Client and Server type targets when this gem is enabled. If you don't want it +# active in Clients or Servers by default, delete one of both of the following lines: +ly_create_alias(NAME MotionMatching.Clients NAMESPACE Gem TARGETS Gem::MotionMatching) +ly_create_alias(NAME MotionMatching.Servers NAMESPACE Gem TARGETS Gem::MotionMatching) + +# If we are on a host platform, we want to add the host tools targets like the MotionMatching.Editor target which +# will also depend on MotionMatching.Static +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME MotionMatching.Editor.Static STATIC + NAMESPACE Gem + FILES_CMAKE + motionmatching_editor_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + PUBLIC + Include + BUILD_DEPENDENCIES + PUBLIC + AZ::AzToolsFramework + Gem::MotionMatching.Static + ) + + ly_add_target( + NAME MotionMatching.Editor GEM_MODULE + NAMESPACE Gem + AUTOMOC + OUTPUT_NAME Gem.MotionMatching.Editor + FILES_CMAKE + motionmatching_editor_shared_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + PUBLIC + Include + BUILD_DEPENDENCIES + PUBLIC + Gem::MotionMatching.Editor.Static + ) + + # By default, we will specify that the above target MotionMatching would be used by + # Tool and Builder type targets when this gem is enabled. If you don't want it + # active in Tools or Builders by default, delete one of both of the following lines: + ly_create_alias(NAME MotionMatching.Tools NAMESPACE Gem TARGETS Gem::MotionMatching.Editor) + ly_create_alias(NAME MotionMatching.Builders NAMESPACE Gem TARGETS Gem::MotionMatching.Editor) + + +endif() + +################################################################################ +# Tests +################################################################################ +# See if globally, tests are supported +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + # We globally support tests, see if we support tests on this platform for MotionMatching.Static + if(PAL_TRAIT_MOTIONMATCHING_TEST_SUPPORTED) + # We support MotionMatching.Tests on this platform, add MotionMatching.Tests target which depends on MotionMatching.Static + ly_add_target( + NAME MotionMatching.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + motionmatching_files.cmake + motionmatching_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzFramework + Gem::EMotionFX.Tests.Static + Gem::MotionMatching.Static + ) + + # Add MotionMatching.Tests to googletest + ly_add_googletest( + NAME Gem::MotionMatching.Tests + ) + endif() + + # If we are a host platform we want to add tools test like editor tests here + if(PAL_TRAIT_BUILD_HOST_TOOLS) + # We are a host platform, see if Editor tests are supported on this platform + if(PAL_TRAIT_MOTIONMATCHING_EDITOR_TEST_SUPPORTED) + # We support MotionMatching.Editor.Tests on this platform, add MotionMatching.Editor.Tests target which depends on MotionMatching.Editor + ly_add_target( + NAME MotionMatching.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + motionmatching_editor_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + Gem::MotionMatching.Editor + ) + + # Add MotionMatching.Editor.Tests to googletest + ly_add_googletest( + NAME Gem::MotionMatching.Editor.Tests + ) + endif() + endif() +endif() diff --git a/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h b/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h new file mode 100644 index 0000000000..5b2bc1847a --- /dev/null +++ b/Gems/MotionMatching/Code/Include/MotionMatching/MotionMatchingBus.h @@ -0,0 +1,38 @@ +/* + * 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 EMotionFX::MotionMatching +{ + class MotionMatchingRequests + { + public: + AZ_RTTI(MotionMatchingRequests, "{b08f73cc-a922-49ef-8c0e-07166b43ea65}"); + virtual ~MotionMatchingRequests() = default; + // Put your public methods here + }; + + class MotionMatchingBusTraits + : public AZ::EBusTraits + { + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; + static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + ////////////////////////////////////////////////////////////////////////// + }; + + using MotionMatchingRequestBus = AZ::EBus; + using MotionMatchingInterface = AZ::Interface; + +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/Allocators.h b/Gems/MotionMatching/Code/Source/Allocators.h new file mode 100644 index 0000000000..af6fa27cc8 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/Allocators.h @@ -0,0 +1,16 @@ +/* + * 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 + +namespace EMotionFX::MotionMatching +{ + using MotionMatchAllocator = AZ::SystemAllocator; +} // namespace MotionMatching diff --git a/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp b/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp new file mode 100644 index 0000000000..58cd3903e1 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.cpp @@ -0,0 +1,373 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(BlendTreeMotionMatchNode, AnimGraphAllocator, 0) + AZ_CLASS_ALLOCATOR_IMPL(BlendTreeMotionMatchNode::UniqueData, AnimGraphObjectUniqueDataAllocator, 0) + + BlendTreeMotionMatchNode::BlendTreeMotionMatchNode() + : AnimGraphNode() + { + // Setup the input ports. + InitInputPorts(2); + SetupInputPort("Goal Pos", INPUTPORT_TARGETPOS, MCore::AttributeVector3::TYPE_ID, PORTID_INPUT_TARGETPOS); + SetupInputPort("Goal Facing Dir", INPUTPORT_TARGETFACINGDIR, MCore::AttributeVector3::TYPE_ID, PORTID_INPUT_TARGETFACINGDIR); + + // Setup the output ports. + InitOutputPorts(1); + SetupOutputPortAsPose("Output Pose", OUTPUTPORT_POSE, PORTID_OUTPUT_POSE); + } + + BlendTreeMotionMatchNode::~BlendTreeMotionMatchNode() + { + } + + bool BlendTreeMotionMatchNode::InitAfterLoading(AnimGraph* animGraph) + { + if (!AnimGraphNode::InitAfterLoading(animGraph)) + { + return false; + } + + // Automatically register the default feature schema in case the schema is empty after loading the node. + if (m_featureSchema.GetNumFeatures() == 0) + { + AZStd::string rootJointName; + if (m_animGraph->GetNumAnimGraphInstances() > 0) + { + const Actor* actor = m_animGraph->GetAnimGraphInstance(0)->GetActorInstance()->GetActor(); + const Node* rootJoint = actor->GetMotionExtractionNode(); + if (rootJoint) + { + rootJointName = rootJoint->GetNameString(); + } + } + + DefaultFeatureSchemaInitSettings defaultSettings; + defaultSettings.m_rootJointName = rootJointName.c_str(); + defaultSettings.m_leftFootJointName = "L_foot_JNT"; + defaultSettings.m_rightFootJointName = "R_foot_JNT"; + defaultSettings.m_pelvisJointName = "C_pelvis_JNT"; + DefaultFeatureSchema(m_featureSchema, defaultSettings); + } + + InitInternalAttributesForAllInstances(); + + Reinit(); + return true; + } + + const char* BlendTreeMotionMatchNode::GetPaletteName() const + { + return "Motion Matching"; + } + + AnimGraphObject::ECategory BlendTreeMotionMatchNode::GetPaletteCategory() const + { + return AnimGraphObject::CATEGORY_SOURCES; + } + + void BlendTreeMotionMatchNode::UniqueData::Update() + { + AZ_PROFILE_SCOPE(Animation, "BlendTreeMotionMatchNode::UniqueData::Update"); + + auto animGraphNode = azdynamic_cast(m_object); + AZ_Assert(animGraphNode, "Unique data linked to incorrect node type."); + + ActorInstance* actorInstance = m_animGraphInstance->GetActorInstance(); + + // Clear existing data. + delete m_instance; + delete m_data; + + m_data = aznew MotionMatching::MotionMatchingData(animGraphNode->m_featureSchema); + m_instance = aznew MotionMatching::MotionMatchingInstance(); + + MotionSet* motionSet = m_animGraphInstance->GetMotionSet(); + if (!motionSet) + { + SetHasError(true); + return; + } + + //--------------------------------- + AZ::Debug::Timer timer; + timer.Stamp(); + + // Build a list of motions we want to import the frames from. + AZ_Printf("Motion Matching", "Importing motion database..."); + MotionMatching::MotionMatchingData::InitSettings settings; + settings.m_actorInstance = actorInstance; + settings.m_frameImportSettings.m_sampleRate = animGraphNode->m_sampleRate; + settings.m_importMirrored = animGraphNode->m_mirror; + settings.m_maxKdTreeDepth = animGraphNode->m_maxKdTreeDepth; + settings.m_minFramesPerKdTreeNode = animGraphNode->m_minFramesPerKdTreeNode; + settings.m_motionList.reserve(animGraphNode->m_motionIds.size()); + for (const AZStd::string& id : animGraphNode->m_motionIds) + { + Motion* motion = motionSet->RecursiveFindMotionById(id); + if (motion) + { + settings.m_motionList.emplace_back(motion); + } + else + { + AZ_Warning("Motion Matching", false, "Failed to get motion for motionset entry id '%s'", id.c_str()); + } + } + + // Initialize the motion matching data (slow). + AZ_Printf("Motion Matching", "Initializing motion matching..."); + if (!m_data->Init(settings)) + { + AZ_Warning("Motion Matching", false, "Failed to initialize motion matching for anim graph node '%s'!", animGraphNode->GetName()); + SetHasError(true); + return; + } + + // Initialize the instance. + AZ_Printf("Motion Matching", "Initializing instance..."); + MotionMatching::MotionMatchingInstance::InitSettings initSettings; + initSettings.m_actorInstance = actorInstance; + initSettings.m_data = m_data; + m_instance->Init(initSettings); + + const float initTime = timer.GetDeltaTimeInSeconds(); + const size_t memUsage = m_data->GetFrameDatabase().CalcMemoryUsageInBytes(); + AZ_Printf("Motion Matching", "Finished in %.2f seconds (mem usage=%d bytes or %.2f mb)", initTime, memUsage, memUsage / (float)(1024 * 1024)); + //--------------------------------- + + SetHasError(false); + } + + void BlendTreeMotionMatchNode::Update(AnimGraphInstance* animGraphInstance, float timePassedInSeconds) + { + AZ_PROFILE_SCOPE(Animation, "BlendTreeMotionMatchNode::Update"); + + m_timer.Stamp(); + + UniqueData* uniqueData = static_cast(FindOrCreateUniqueNodeData(animGraphInstance)); + UpdateAllIncomingNodes(animGraphInstance, timePassedInSeconds); + uniqueData->Clear(); + if (uniqueData->GetHasError()) + { + m_updateTimeInMs = 0.0f; + m_postUpdateTimeInMs = 0.0f; + m_outputTimeInMs = 0.0f; + return; + } + + AZ::Vector3 targetPos = AZ::Vector3::CreateZero(); + TryGetInputVector3(animGraphInstance, INPUTPORT_TARGETPOS, targetPos); + + AZ::Vector3 targetFacingDir = AZ::Vector3::CreateAxisY(); + TryGetInputVector3(animGraphInstance, INPUTPORT_TARGETFACINGDIR, targetFacingDir); + + MotionMatching::MotionMatchingInstance* instance = uniqueData->m_instance; + instance->Update(timePassedInSeconds, targetPos, targetFacingDir, m_trajectoryQueryMode, m_pathRadius, m_pathSpeed); + + // set the current time to the new calculated time + uniqueData->ClearInheritFlags(); + uniqueData->SetPreSyncTime(instance->GetMotionInstance()->GetCurrentTime()); + uniqueData->SetCurrentPlayTime(instance->GetNewMotionTime()); + + if (uniqueData->GetPreSyncTime() > uniqueData->GetCurrentPlayTime()) + { + uniqueData->SetPreSyncTime(uniqueData->GetCurrentPlayTime()); + } + + m_updateTimeInMs = m_timer.GetDeltaTimeInSeconds() * 1000.0f; + } + + void BlendTreeMotionMatchNode::PostUpdate(AnimGraphInstance* animGraphInstance, float timePassedInSeconds) + { + AZ_PROFILE_SCOPE(Animation, "BlendTreeMotionMatchNode::PostUpdate"); + + AZ_UNUSED(animGraphInstance); + AZ_UNUSED(timePassedInSeconds); + m_timer.Stamp(); + + for (AZ::u32 i = 0; i < GetNumConnections(); ++i) + { + AnimGraphNode* node = GetConnection(i)->GetSourceNode(); + node->PerformPostUpdate(animGraphInstance, timePassedInSeconds); + } + + UniqueData* uniqueData = static_cast(FindOrCreateUniqueNodeData(animGraphInstance)); + MotionMatching::MotionMatchingInstance* instance = uniqueData->m_instance; + + RequestRefDatas(animGraphInstance); + AnimGraphRefCountedData* data = uniqueData->GetRefCountedData(); + data->ClearEventBuffer(); + data->ZeroTrajectoryDelta(); + + if (uniqueData->GetHasError()) + { + return; + } + + MotionInstance* motionInstance = instance->GetMotionInstance(); + motionInstance->UpdateByTimeValues(uniqueData->GetPreSyncTime(), uniqueData->GetCurrentPlayTime(), &data->GetEventBuffer()); + + uniqueData->SetCurrentPlayTime(motionInstance->GetCurrentTime()); + data->GetEventBuffer().UpdateEmitters(this); + + instance->PostUpdate(timePassedInSeconds); + + const Transform& trajectoryDelta = instance->GetMotionExtractionDelta(); + data->SetTrajectoryDelta(trajectoryDelta); + data->SetTrajectoryDeltaMirrored(trajectoryDelta); // TODO: use a real mirrored version here. + + m_postUpdateTimeInMs = m_timer.GetDeltaTimeInSeconds() * 1000.0f; + } + + void BlendTreeMotionMatchNode::Output(AnimGraphInstance* animGraphInstance) + { + AZ_PROFILE_SCOPE(Animation, "BlendTreeMotionMatchNode::Output"); + + AZ_UNUSED(animGraphInstance); + m_timer.Stamp(); + + AnimGraphPose* outputPose; + + // Initialize to bind pose. + ActorInstance* actorInstance = animGraphInstance->GetActorInstance(); + RequestPoses(animGraphInstance); + outputPose = GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue(); + outputPose->InitFromBindPose(actorInstance); + + if (m_disabled) + { + return; + } + + UniqueData* uniqueData = static_cast(FindOrCreateUniqueNodeData(animGraphInstance)); + if (GetEMotionFX().GetIsInEditorMode()) + { + SetHasError(uniqueData, uniqueData->GetHasError()); + } + + if (uniqueData->GetHasError()) + { + return; + } + + OutputIncomingNode(animGraphInstance, GetInputNode(INPUTPORT_TARGETPOS)); + OutputIncomingNode(animGraphInstance, GetInputNode(INPUTPORT_TARGETFACINGDIR)); + + MotionMatching::MotionMatchingInstance* instance = uniqueData->m_instance; + instance->SetLowestCostSearchFrequency(m_lowestCostSearchFrequency); + + Pose& outTransformPose = outputPose->GetPose(); + instance->Output(outTransformPose); + + // Performance metrics + m_outputTimeInMs = m_timer.GetDeltaTimeInSeconds() * 1000.0f; + { + //AZ_Printf("MotionMatch", "Update = %.2f, PostUpdate = %.2f, Output = %.2f", m_updateTime, m_postUpdateTime, m_outputTime); +#ifdef IMGUI_ENABLED + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushPerformanceHistogramValue, "Update", m_updateTimeInMs); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushPerformanceHistogramValue, "Post Update", m_postUpdateTimeInMs); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushPerformanceHistogramValue, "Output", m_outputTimeInMs); +#endif + } + + instance->DebugDraw(); + } + + void BlendTreeMotionMatchNode::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(9) + ->Field("sampleRate", &BlendTreeMotionMatchNode::m_sampleRate) + ->Field("lowestCostSearchFrequency", &BlendTreeMotionMatchNode::m_lowestCostSearchFrequency) + ->Field("maxKdTreeDepth", &BlendTreeMotionMatchNode::m_maxKdTreeDepth) + ->Field("minFramesPerKdTreeNode", &BlendTreeMotionMatchNode::m_minFramesPerKdTreeNode) + ->Field("mirror", &BlendTreeMotionMatchNode::m_mirror) + ->Field("controlSplineMode", &BlendTreeMotionMatchNode::m_trajectoryQueryMode) + ->Field("pathRadius", &BlendTreeMotionMatchNode::m_pathRadius) + ->Field("pathSpeed", &BlendTreeMotionMatchNode::m_pathSpeed) + ->Field("featureSchema", &BlendTreeMotionMatchNode::m_featureSchema) + ->Field("motionIds", &BlendTreeMotionMatchNode::m_motionIds) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("Motion Matching Node", "Motion Matching Attributes") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_sampleRate, "Feature sample rate", "The sample rate (in Hz) used for extracting the features from the animations. The higher the sample rate, the more data will be used and the more options the motion matching search has available for the best matching frame.") + ->Attribute(AZ::Edit::Attributes::Min, 1) + ->Attribute(AZ::Edit::Attributes::Max, 240) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeMotionMatchNode::Reinit) + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_lowestCostSearchFrequency, "Search frequency", "How often per second we apply the motion matching search and find the lowest cost / best matching frame, and start to blend towards it.") + ->Attribute(AZ::Edit::Attributes::Min, 0.001f) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Step, 0.05f) + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_maxKdTreeDepth, "Max kdTree depth", "The maximum number of hierarchy levels in the kdTree.") + ->Attribute(AZ::Edit::Attributes::Min, 1) + ->Attribute(AZ::Edit::Attributes::Max, 20) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeMotionMatchNode::Reinit) + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_minFramesPerKdTreeNode, "Min kdTree node size", "The minimum number of frames to store per kdTree node.") + ->Attribute(AZ::Edit::Attributes::Min, 1) + ->Attribute(AZ::Edit::Attributes::Max, 100000) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeMotionMatchNode::Reinit) + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_pathRadius, "Path radius", "") + ->Attribute(AZ::Edit::Attributes::Min, 0.0001f) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Step, 0.01f) + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_pathSpeed, "Path speed", "") + ->Attribute(AZ::Edit::Attributes::Min, 0.0001f) + ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits::max()) + ->Attribute(AZ::Edit::Attributes::Step, 0.01f) + ->DataElement(AZ::Edit::UIHandlers::ComboBox, &BlendTreeMotionMatchNode::m_trajectoryQueryMode, "Trajectory mode", "Desired future trajectory generation mode.") + ->EnumAttribute(TrajectoryQuery::MODE_TARGETDRIVEN, "Target driven") + ->EnumAttribute(TrajectoryQuery::MODE_ONE, "Mode one") + ->EnumAttribute(TrajectoryQuery::MODE_TWO, "Mode two") + ->EnumAttribute(TrajectoryQuery::MODE_THREE, "Mode three") + ->EnumAttribute(TrajectoryQuery::MODE_FOUR, "Mode four") + ->DataElement(AZ::Edit::UIHandlers::Default, &BlendTreeMotionMatchNode::m_featureSchema, "FeatureSchema", "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeMotionMatchNode::Reinit) + ->DataElement(AZ_CRC("MotionSetMotionIds", 0x8695c0fa), &BlendTreeMotionMatchNode::m_motionIds, "Motions", "") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &BlendTreeMotionMatchNode::Reinit) + ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::HideChildren) + ; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.h b/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.h new file mode 100644 index 0000000000..3acae96d2c --- /dev/null +++ b/Gems/MotionMatching/Code/Source/BlendTreeMotionMatchNode.h @@ -0,0 +1,111 @@ +/* + * 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 +#include +#include +#include +#include +#include + +namespace EMotionFX::MotionMatching +{ + class EMFX_API BlendTreeMotionMatchNode + : public AnimGraphNode + { + public: + AZ_RTTI(BlendTreeMotionMatchNode, "{1DC80DCD-6536-4950-9260-A4615C03E3C5}", AnimGraphNode) + AZ_CLASS_ALLOCATOR_DECL + + enum + { + INPUTPORT_TARGETPOS = 0, + INPUTPORT_TARGETFACINGDIR = 1, + OUTPUTPORT_POSE = 0 + }; + + enum + { + PORTID_INPUT_TARGETPOS = 0, + PORTID_INPUT_TARGETFACINGDIR = 1, + PORTID_OUTPUT_POSE = 0 + }; + + class EMFX_API UniqueData + : public AnimGraphNodeData + { + EMFX_ANIMGRAPHOBJECTDATA_IMPLEMENT_LOADSAVE + public: + AZ_CLASS_ALLOCATOR_DECL + + UniqueData(AnimGraphNode* node, AnimGraphInstance* animGraphInstance) + : AnimGraphNodeData(node, animGraphInstance) + { + } + + ~UniqueData() + { + delete m_data; + delete m_instance; + } + + void Update() override; + + public: + MotionMatching::MotionMatchingInstance* m_instance = nullptr; + MotionMatching::MotionMatchingData* m_data = nullptr; + }; + + BlendTreeMotionMatchNode(); + ~BlendTreeMotionMatchNode(); + + bool InitAfterLoading(AnimGraph* animGraph) override; + + bool GetSupportsVisualization() const override { return true; } + bool GetHasOutputPose() const override { return true; } + bool GetSupportsDisable() const override { return true; } + AZ::Color GetVisualColor() const override { return AZ::Colors::Green; } + AnimGraphPose* GetMainOutputPose(AnimGraphInstance* animGraphInstance) const override { return GetOutputPose(animGraphInstance, OUTPUTPORT_POSE)->GetValue(); } + + const char* GetPaletteName() const override; + AnimGraphObject::ECategory GetPaletteCategory() const override; + + AnimGraphObjectData* CreateUniqueData(AnimGraphInstance* animGraphInstance) override { return aznew UniqueData(this, animGraphInstance); } + + static void Reflect(AZ::ReflectContext* context); + + private: + void Output(AnimGraphInstance* animGraphInstance) override; + void Update(AnimGraphInstance* animGraphInstance, float timePassedInSeconds) override; + void PostUpdate(AnimGraphInstance* animGraphInstance, float timePassedInSeconds) override; + + FeatureSchema m_featureSchema; + AZStd::vector m_motionIds; + + float m_pathRadius = 1.0f; + float m_pathSpeed = 1.0f; + float m_lowestCostSearchFrequency = 5.0f; + AZ::u32 m_sampleRate = 30; + AZ::u32 m_maxKdTreeDepth = 15; + AZ::u32 m_minFramesPerKdTreeNode = 1000; + TrajectoryQuery::EMode m_trajectoryQueryMode = TrajectoryQuery::MODE_TARGETDRIVEN; + bool m_mirror = false; + + AZ::Debug::Timer m_timer; + float m_updateTimeInMs = 0.0f; + float m_postUpdateTimeInMs = 0.0f; + float m_outputTimeInMs = 0.0f; + +#ifdef IMGUI_ENABLED + ImGuiMonitor m_imguiMonitor; +#endif + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/EventData.cpp b/Gems/MotionMatching/Code/Source/EventData.cpp new file mode 100644 index 0000000000..32c05ee58b --- /dev/null +++ b/Gems/MotionMatching/Code/Source/EventData.cpp @@ -0,0 +1,92 @@ +/* + * 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 +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(DiscardFrameEventData, MotionEventAllocator, 0) + + bool DiscardFrameEventData::Equal([[maybe_unused]]const EventData& rhs, [[maybe_unused]] bool ignoreEmptyFields) const + { + return true; + } + + void DiscardFrameEventData::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(1) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("[Motion Matching] Discard Frame", "Event used for discarding ranges of the animation..") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ_CRC_CE("Creatable"), true) + ; + } + + /////////////////////////////////////////////////////////////////////////// + + AZ_CLASS_ALLOCATOR_IMPL(TagEventData, MotionEventAllocator, 0) + + bool TagEventData::Equal(const EventData& rhs, [[maybe_unused]] bool ignoreEmptyFields) const + { + const TagEventData* other = azdynamic_cast(&rhs); + if (other) + { + return AZ::StringFunc::Equal(m_tag.c_str(), other->m_tag.c_str(), /*caseSensitive=*/false); + } + return false; + } + + void TagEventData::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(1) + ->Field("tag", &TagEventData::m_tag) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("[Motion Matching] Tag", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ_CRC_CE("Creatable"), true) + ->DataElement(AZ::Edit::UIHandlers::Default, &TagEventData::m_tag, "Tag", "The tag that should be active.") + ; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/EventData.h b/Gems/MotionMatching/Code/Source/EventData.h new file mode 100644 index 0000000000..8b80499b78 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/EventData.h @@ -0,0 +1,55 @@ +/* + * 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 + +namespace AZ +{ + class ReflectContext; +} + +namespace EMotionFX::MotionMatching +{ + class EMFX_API DiscardFrameEventData + : public EventData + { + public: + AZ_RTTI(DiscardFrameEventData, "{25499823-E611-4958-85B7-476BC1918744}", EventData); + AZ_CLASS_ALLOCATOR_DECL + + DiscardFrameEventData() = default; + ~DiscardFrameEventData() override = default; + + static void Reflect(AZ::ReflectContext* context); + + bool Equal(const EventData& rhs, bool ignoreEmptyFields = false) const override; + + private: + AZStd::string m_tag; + }; + + class EMFX_API TagEventData + : public EventData + { + public: + AZ_RTTI(TagEventData, "{FEFEA2C7-CD68-43B2-94D6-85559E29EABF}", EventData); + AZ_CLASS_ALLOCATOR_DECL + + TagEventData() = default; + ~TagEventData() override = default; + + static void Reflect(AZ::ReflectContext* context); + + bool Equal(const EventData& rhs, bool ignoreEmptyFields = false) const override; + + private: + AZStd::string m_tag; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/Feature.cpp b/Gems/MotionMatching/Code/Source/Feature.cpp new file mode 100644 index 0000000000..0d135d6ed8 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/Feature.cpp @@ -0,0 +1,275 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(Feature, MotionMatchAllocator, 0) + + bool Feature::Init(const InitSettings& settings) + { + const Actor* actor = settings.m_actorInstance->GetActor(); + const Skeleton* skeleton = actor->GetSkeleton(); + + const Node* joint = skeleton->FindNodeByNameNoCase(m_jointName.c_str()); + m_jointIndex = joint ? joint->GetNodeIndex() : InvalidIndex; + if (m_jointIndex == InvalidIndex) + { + AZ_Error("MotionMatching", false, "Feature::Init(): Cannot find index for joint named '%s'.", m_jointName.c_str()); + return false; + } + + const Node* relativeToJoint = skeleton->FindNodeByNameNoCase(m_relativeToJointName.c_str()); + m_relativeToNodeIndex = relativeToJoint ? relativeToJoint->GetNodeIndex() : InvalidIndex; + if (m_relativeToNodeIndex == InvalidIndex) + { + AZ_Error("MotionMatching", false, "Feature::Init(): Cannot find index for joint named '%s'.", m_relativeToJointName.c_str()); + return false; + } + + // Set a default feature name in case it did not get set manually. + if (m_name.empty()) + { + AZStd::string featureTypeName = this->RTTI_GetTypeName(); + AzFramework::StringFunc::Replace(featureTypeName, "Feature", ""); + m_name = AZStd::string::format("%s (%s)", featureTypeName.c_str(), m_jointName.c_str()); + } + return true; + } + + void Feature::SetDebugDrawColor(const AZ::Color& color) + { + m_debugColor = color; + } + + const AZ::Color& Feature::GetDebugDrawColor() const + { + return m_debugColor; + } + + void Feature::SetDebugDrawEnabled(bool enabled) + { + m_debugDrawEnabled = enabled; + } + + bool Feature::GetDebugDrawEnabled() const + { + return m_debugDrawEnabled; + } + + float Feature::CalculateFrameCost([[maybe_unused]] size_t frameIndex, [[maybe_unused]] const FrameCostContext& context) const + { + AZ_Assert(false, "Feature::CalculateFrameCost(): Not implemented for the given feature."); + return 0.0f; + } + + void Feature::SetRelativeToNodeIndex(size_t nodeIndex) + { + m_relativeToNodeIndex = nodeIndex; + } + + void Feature::CalculateVelocity(size_t jointIndex, size_t relativeToJointIndex, MotionInstance* motionInstance, AZ::Vector3& outVelocity) + { + const float originalTime = motionInstance->GetCurrentTime(); + + // Prepare for sampling. + ActorInstance* actorInstance = motionInstance->GetActorInstance(); + AnimGraphPosePool& posePool = GetEMotionFX().GetThreadData(actorInstance->GetThreadIndex())->GetPosePool(); + AnimGraphPose* prevPose = posePool.RequestPose(actorInstance); + AnimGraphPose* currentPose = posePool.RequestPose(actorInstance); + Pose* bindPose = actorInstance->GetTransformData()->GetBindPose(); + + const size_t numSamples = 3; + const float timeRange = 0.05f; // secs + const float halfTimeRange = timeRange * 0.5f; + const float startTime = originalTime - halfTimeRange; + const float frameDelta = timeRange / numSamples; + + AZ::Vector3 accumulatedVelocity = AZ::Vector3::CreateZero(); + + for (size_t sampleIndex = 0; sampleIndex < numSamples + 1; ++sampleIndex) + { + float sampleTime = startTime + sampleIndex * frameDelta; + if (sampleTime < 0.0f) + { + sampleTime = 0.0f; + } + if (sampleTime >= motionInstance->GetMotion()->GetDuration()) + { + sampleTime = motionInstance->GetMotion()->GetDuration(); + } + + if (sampleIndex == 0) + { + motionInstance->SetCurrentTime(sampleTime); + motionInstance->GetMotion()->Update(bindPose, &prevPose->GetPose(), motionInstance); + continue; + } + + motionInstance->SetCurrentTime(sampleTime); + motionInstance->GetMotion()->Update(bindPose, ¤tPose->GetPose(), motionInstance); + + const Transform inverseJointWorldTransform = currentPose->GetPose().GetWorldSpaceTransform(relativeToJointIndex).Inversed(); + + // Calculate the velocity. + const AZ::Vector3 prevPosition = prevPose->GetPose().GetWorldSpaceTransform(jointIndex).m_position; + const AZ::Vector3 currentPosition = currentPose->GetPose().GetWorldSpaceTransform(jointIndex).m_position; + const AZ::Vector3 velocity = CalculateLinearVelocity(prevPosition, currentPosition, frameDelta); + + accumulatedVelocity += inverseJointWorldTransform.TransformVector(velocity); + + *prevPose = *currentPose; + } + + outVelocity = accumulatedVelocity / aznumeric_cast(numSamples); + + motionInstance->SetCurrentTime(originalTime); // set back to what it was + + posePool.FreePose(prevPose); + posePool.FreePose(currentPose); + } + + void Feature::CalculateVelocity(const ActorInstance* actorInstance, size_t jointIndex, size_t relativeToJointIndex, const Frame& frame, AZ::Vector3& outVelocity) + { + AnimGraphPosePool& posePool = GetEMotionFX().GetThreadData(actorInstance->GetThreadIndex())->GetPosePool(); + AnimGraphPose* prevPose = posePool.RequestPose(actorInstance); + AnimGraphPose* currentPose = posePool.RequestPose(actorInstance); + + const size_t numSamples = 3; + const float timeRange = 0.05f; // secs + const float halfTimeRange = timeRange * 0.5f; + const float frameDelta = timeRange / numSamples; + + AZ::Vector3 accumulatedVelocity = AZ::Vector3::CreateZero(); + + for (size_t sampleIndex = 0; sampleIndex < numSamples + 1; ++sampleIndex) + { + const float sampleTimeOffset = (-halfTimeRange) + sampleIndex * frameDelta; + + if (sampleIndex == 0) + { + frame.SamplePose(&prevPose->GetPose(), sampleTimeOffset); + continue; + } + + frame.SamplePose(¤tPose->GetPose(), sampleTimeOffset); + const Transform inverseJointWorldTransform = currentPose->GetPose().GetWorldSpaceTransform(relativeToJointIndex).Inversed(); + + // Calculate the velocity. + const AZ::Vector3 prevPosition = prevPose->GetPose().GetWorldSpaceTransform(jointIndex).m_position; + const AZ::Vector3 currentPosition = currentPose->GetPose().GetWorldSpaceTransform(jointIndex).m_position; + const AZ::Vector3 velocity = CalculateLinearVelocity(prevPosition, currentPosition, frameDelta); + + accumulatedVelocity += inverseJointWorldTransform.TransformVector(velocity); + + *prevPose = *currentPose; + } + + outVelocity = accumulatedVelocity / aznumeric_cast(numSamples); + + posePool.FreePose(prevPose); + posePool.FreePose(currentPose); + } + + float Feature::GetNormalizedDirectionDifference(const AZ::Vector2& directionA, const AZ::Vector2& directionB) const + { + const float dotProduct = directionA.GetNormalized().Dot(directionB.GetNormalized()); + const float normalizedDirectionDifference = (2.0f - (1.0f + dotProduct)) * 0.5f; + return AZ::GetAbs(normalizedDirectionDifference); + } + + float Feature::GetNormalizedDirectionDifference(const AZ::Vector3& directionA, const AZ::Vector3& directionB) const + { + const float dotProduct = directionA.GetNormalized().Dot(directionB.GetNormalized()); + const float normalizedDirectionDifference = (2.0f - (1.0f + dotProduct)) * 0.5f; + return AZ::GetAbs(normalizedDirectionDifference); + } + + float Feature::CalcResidual(float value) const + { + if (m_residualType == ResidualType::Squared) + { + return value * value; + } + + return AZ::Abs(value); + } + + float Feature::CalcResidual(const AZ::Vector3& a, const AZ::Vector3& b) const + { + const float euclideanDistance = (b - a).GetLength(); + return CalcResidual(euclideanDistance); + } + + AZ::Crc32 Feature::GetCostFactorVisibility() const + { + return AZ::Edit::PropertyVisibility::Show; + } + + void Feature::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(2) + ->Field("id", &Feature::m_id) + ->Field("name", &Feature::m_name) + ->Field("jointName", &Feature::m_jointName) + ->Field("relativeToJointName", &Feature::m_relativeToJointName) + ->Field("debugDraw", &Feature::m_debugDrawEnabled) + ->Field("debugColor", &Feature::m_debugColor) + ->Field("costFactor", &Feature::m_costFactor) + ->Field("residualType", &Feature::m_residualType) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("Feature", "Base class for a feature") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ->DataElement(AZ::Edit::UIHandlers::Default, &Feature::m_name, "Name", "Custom name of the feature used for identification and debug visualizations.") + ->DataElement(AZ_CRC_CE("ActorNode"), &Feature::m_jointName, "Joint", "The joint to extract the data from.") + ->DataElement(AZ_CRC_CE("ActorNode"), &Feature::m_relativeToJointName, "Relative To Joint", "When extracting feature data, convert it to relative-space to the given joint.") + ->DataElement(AZ::Edit::UIHandlers::Default, &Feature::m_debugDrawEnabled, "Debug Draw", "Are debug visualizations enabled for this feature?") + ->DataElement(AZ::Edit::UIHandlers::Default, &Feature::m_debugColor, "Debug Draw Color", "Color used for debug visualizations to identify the feature.") + ->DataElement(AZ::Edit::UIHandlers::SpinBox, &Feature::m_costFactor, "Cost Factor", "The cost factor for the feature is multiplied with the actual and can be used to change a feature's influence in the motion matching search.") + ->Attribute(AZ::Edit::Attributes::Min, 0.0f) + ->Attribute(AZ::Edit::Attributes::Max, 100.0f) + ->Attribute(AZ::Edit::Attributes::Step, 0.1f) + ->Attribute(AZ::Edit::Attributes::Visibility, &Feature::GetCostFactorVisibility) + ->DataElement(AZ::Edit::UIHandlers::ComboBox, &Feature::m_residualType, "Residual", "Use 'Squared' in case minimal differences should be ignored and larger differences should overweight others. Use 'Absolute' for linear differences and don't want the mentioned effect.") + ->EnumAttribute(ResidualType::Absolute, "Absolute") + ->EnumAttribute(ResidualType::Squared, "Squared") + ; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/Feature.h b/Gems/MotionMatching/Code/Source/Feature.h new file mode 100644 index 0000000000..9a0fe9fa8c --- /dev/null +++ b/Gems/MotionMatching/Code/Source/Feature.h @@ -0,0 +1,174 @@ +/* + * 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 +#include + +#include +#include +#include + +#include + +#include + +namespace EMotionFX +{ + class ActorInstance; + class MotionInstance; + class Pose; + class Motion; +}; + +namespace EMotionFX::MotionMatching +{ + class Frame; + class FrameDatabase; + class MotionMatchingInstance; + class TrajectoryQuery; + + class EMFX_API Feature + { + public: + AZ_RTTI(Feature, "{DE9CBC48-9176-4DF1-8306-4B1E621F0E76}") + AZ_CLASS_ALLOCATOR_DECL + + Feature() = default; + virtual ~Feature() = default; + + //////////////////////////////////////////////////////////////////////// + // Initialization + struct EMFX_API InitSettings + { + ActorInstance* m_actorInstance = nullptr; + FeatureMatrix::Index m_featureColumnStartOffset = 0; + }; + virtual bool Init(const InitSettings& settings); + + //////////////////////////////////////////////////////////////////////// + // Feature extraction + struct EMFX_API ExtractFeatureContext + { + ExtractFeatureContext(FeatureMatrix& featureMatrix) + : m_featureMatrix(featureMatrix) + { + } + + FrameDatabase* m_frameDatabase = nullptr; + FeatureMatrix& m_featureMatrix; + + size_t m_frameIndex = InvalidIndex; + const Pose* m_framePose = nullptr; //! Pre-sampled pose for the given frame. + + ActorInstance* m_actorInstance = nullptr; + }; + virtual void ExtractFeatureValues(const ExtractFeatureContext& context) = 0; + + //////////////////////////////////////////////////////////////////////// + // Feature cost + struct EMFX_API FrameCostContext + { + FrameCostContext(const FeatureMatrix& featureMatrix, const Pose& currentPose) + : m_featureMatrix(featureMatrix) + , m_currentPose(currentPose) + { + } + + const FeatureMatrix& m_featureMatrix; + const ActorInstance* m_actorInstance = nullptr; + const Pose& m_currentPose; //! Current actor instance pose. + const TrajectoryQuery* m_trajectoryQuery; + }; + virtual float CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const; + + //! Specifies how the feature value differences (residuals), between the input query values + //! and the frames in the motion database that sum up the feature cost, are calculated. + enum ResidualType + { + Absolute, + Squared + }; + + void SetCostFactor(float costFactor) { m_costFactor = costFactor; } + float GetCostFactor() const { return m_costFactor; } + + virtual void FillQueryFeatureValues([[maybe_unused]] size_t startIndex, + [[maybe_unused]] AZStd::vector& queryFeatureValues, + [[maybe_unused]] const FrameCostContext& context) {} + + virtual void DebugDraw([[maybe_unused]] AzFramework::DebugDisplayRequests& debugDisplay, + [[maybe_unused]] MotionMatchingInstance* instance, + [[maybe_unused]] size_t frameIndex) {} + + void SetDebugDrawColor(const AZ::Color& color); + const AZ::Color& GetDebugDrawColor() const; + + void SetDebugDrawEnabled(bool enabled); + bool GetDebugDrawEnabled() const; + + void SetJointName(const AZStd::string& jointName) { m_jointName = jointName; } + const AZStd::string& GetJointName() const { return m_jointName; } + + void SetRelativeToJointName(const AZStd::string& jointName) { m_relativeToJointName = jointName; } + const AZStd::string& GetRelativeToJointName() const { return m_relativeToJointName; } + + void SetName(const AZStd::string& name) { m_name = name; } + const AZStd::string& GetName() const { return m_name; } + + // Column offset for the first value for the given feature inside the feature matrix. + virtual size_t GetNumDimensions() const = 0; + virtual AZStd::string GetDimensionName([[maybe_unused]] size_t index) const { return "Unknown"; } + FeatureMatrix::Index GetColumnOffset() const { return m_featureColumnOffset; } + void SetColumnOffset(FeatureMatrix::Index offset) { m_featureColumnOffset = offset; } + + const AZ::TypeId& GetId() const { return m_id; } + size_t GetRelativeToNodeIndex() const { return m_relativeToNodeIndex; } + void SetRelativeToNodeIndex(size_t nodeIndex); + + static void Reflect(AZ::ReflectContext* context); + static void CalculateVelocity(size_t jointIndex, size_t relativeToJointIndex, MotionInstance* motionInstance, AZ::Vector3& outVelocity); + static void CalculateVelocity(const ActorInstance* actorInstance, size_t jointIndex, size_t relativeToJointIndex, const Frame& frame, AZ::Vector3& outVelocity); + + protected: + /** + * Calculate a normalized direction vector difference between the two given vectors. + * A dot product of the two vectors is taken and the result in range [-1, 1] is scaled to [0, 1]. + * @result Normalized, absolute difference between the vectors. + * Angle difference dot result cost + * 0.0 degrees 1.0 0.0 + * 90.0 degrees 0.0 0.5 + * 180.0 degrees -1.0 1.0 + * 270.0 degrees 0.0 0.5 + **/ + float GetNormalizedDirectionDifference(const AZ::Vector2& directionA, const AZ::Vector2& directionB) const; + float GetNormalizedDirectionDifference(const AZ::Vector3& directionA, const AZ::Vector3& directionB) const; + + float CalcResidual(float value) const; + float CalcResidual(const AZ::Vector3& a, const AZ::Vector3& b) const; + + virtual AZ::Crc32 GetCostFactorVisibility() const; + + // Shared and reflected data. + AZ::TypeId m_id = AZ::TypeId::CreateRandom(); //< The feature identification number. Use this instead of the RTTI class ID so that we can have multiple of the same type. + AZStd::string m_name; //< Display name used for feature identification and debug visualizations. + AZStd::string m_jointName; //< Joint name to extract the data from. + AZStd::string m_relativeToJointName; //< When extracting feature data, convert it to relative-space to the given joint. + AZ::Color m_debugColor = AZ::Colors::Green; //< Color used for debug visualizations to identify the feature. + bool m_debugDrawEnabled = false; //< Are debug visualizations enabled for this feature? + float m_costFactor = 1.0f; //< The cost factor for the feature is multiplied with the actual and can be used to change a feature's influence in the motion matching search. + ResidualType m_residualType = ResidualType::Squared; //< How do we calculate the differences (residuals) between the input query values and the frames in the motion database that sum up the feature cost. + + // Instance data (depends on the feature schema or actor instance). + FeatureMatrix::Index m_featureColumnOffset; //< Float/Value offset, starting column for where the feature should be places at. + size_t m_relativeToNodeIndex = InvalidIndex; + size_t m_jointIndex = InvalidIndex; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureMatrix.cpp b/Gems/MotionMatching/Code/Source/FeatureMatrix.cpp new file mode 100644 index 0000000000..7da9e146d9 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureMatrix.cpp @@ -0,0 +1,102 @@ +/* + * 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 +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(FeatureMatrix, MotionMatchAllocator, 0) + + void FeatureMatrix::Clear() + { + resize(0, 0); + } + + void FeatureMatrix::SaveAsCsv(const AZStd::string& filename, const AZStd::vector& columnNames) + { + std::ofstream file(filename.c_str()); + + // Save column names in the first row + if (!columnNames.empty()) + { + for (size_t i = 0; i < columnNames.size(); ++i) + { + if (i != 0) + { + file << ","; + } + + file << columnNames[i].c_str(); + } + file << "\n"; + } + + // Save coefficients +#ifdef O3DE_USE_EIGEN + // Force specify precision, else wise values close to 0.0 get rounded to 0.0. + const static Eigen::IOFormat csvFormat(/*Eigen::StreamPrecision|FullPrecision*/8, Eigen::DontAlignCols, ", ", "\n"); + file << format(csvFormat); +#endif + } + + void FeatureMatrix::SaveAsCsv(const AZStd::string& filename, const FeatureSchema* featureSchema) + { + AZStd::vector columnNames; + + for (Feature* feature: featureSchema->GetFeatures()) + { + const size_t numDimensions = feature->GetNumDimensions(); + for (size_t dimension = 0; dimension < numDimensions; ++dimension) + { + columnNames.push_back(feature->GetDimensionName(dimension)); + } + } + + SaveAsCsv(filename, columnNames); + } + + AZ::Vector2 FeatureMatrix::GetVector2(Index row, Index startColumn) const + { + return AZ::Vector2( + coeff(row, startColumn + 0), + coeff(row, startColumn + 1)); + } + + void FeatureMatrix::SetVector2(Index row, Index startColumn, const AZ::Vector2& value) + { + operator()(row, startColumn + 0) = value.GetX(); + operator()(row, startColumn + 1) = value.GetY(); + } + + AZ::Vector3 FeatureMatrix::GetVector3(Index row, Index startColumn) const + { + return AZ::Vector3( + coeff(row, startColumn + 0), + coeff(row, startColumn + 1), + coeff(row, startColumn + 2)); + } + + void FeatureMatrix::SetVector3(Index row, Index startColumn, const AZ::Vector3& value) + { + operator()(row, startColumn + 0) = value.GetX(); + operator()(row, startColumn + 1) = value.GetY(); + operator()(row, startColumn + 2) = value.GetZ(); + } + + size_t FeatureMatrix::CalcMemoryUsageInBytes() const + { + const size_t bytesPerValue = sizeof(O3DE_MM_FLOATTYPE); + const size_t numValues = size(); + return numValues * bytesPerValue; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureMatrix.h b/Gems/MotionMatching/Code/Source/FeatureMatrix.h new file mode 100644 index 0000000000..1cf42933ce --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureMatrix.h @@ -0,0 +1,118 @@ +/* + * 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 +#include +#include +#include +#include + +//#define O3DE_USE_EIGEN +#define O3DE_MM_FLOATTYPE float + +#ifdef O3DE_USE_EIGEN +#pragma warning (push, 1) +#pragma warning (disable:4834) // C4834: discarding return value of function with 'nodiscard' attribute +#pragma warning (disable:5031) // #pragma warning(pop): likely mismatch, popping warning state pushed in different file +#pragma warning (disable:4702) // warning C4702: unreachable code +#pragma warning (disable:4723) // warning C4723: potential divide by 0 +#include "../../3rdParty/eigen-3.3.9/Eigen/Dense" +#pragma warning (pop) +#endif + +namespace EMotionFX::MotionMatching +{ + class FeatureSchema; + +#ifdef O3DE_USE_EIGEN + // Features are stored in columns, each row represents a frame + // RowMajor: Store row components next to each other in memory for cache-optimized feature access for a given frame. + using FeatureMatrixType = Eigen::Matrix; +#else + /** + * Small wrapper for a 2D matrix similar to the Eigen::Matrix. + */ + class FeatureMatrixType + { + public: + size_t size() const + { + return m_data.size(); + } + + size_t rows() const + { + return m_rowCount; + } + + size_t cols() const + { + return m_columnCount; + } + + void resize(size_t rowCount, size_t columnCount) + { + m_rowCount = rowCount; + m_columnCount = columnCount; + m_data.resize(m_rowCount * m_columnCount); + } + + float& operator()(size_t row, size_t column) + { + return m_data[row * m_columnCount + column]; + } + + const float& operator()(size_t row, size_t column) const + { + return m_data[row * m_columnCount + column]; + } + + float coeff(size_t row, size_t column) const + { + return m_data[row * m_columnCount + column]; + } + + private: + AZStd::vector m_data; + size_t m_rowCount = 0; + size_t m_columnCount = 0; + }; +#endif + + class FeatureMatrix + : public FeatureMatrixType + { + public: + AZ_RTTI(FeatureMatrix, "{E063C9CB-7147-4776-A6E0-98584DD93FEF}"); + AZ_CLASS_ALLOCATOR_DECL + +#ifdef O3DE_USE_EIGEN + using Index = Eigen::Index; +#else + using Index = size_t; +#endif + + virtual ~FeatureMatrix() = default; + + void Clear(); + + void SaveAsCsv(const AZStd::string& filename, const AZStd::vector& columnNames = {}); + void SaveAsCsv(const AZStd::string& filename, const FeatureSchema* featureSchema); + + size_t CalcMemoryUsageInBytes() const; + + AZ::Vector2 GetVector2(Index row, Index startColumn) const; + void SetVector2(Index row, Index startColumn, const AZ::Vector2& value); + + AZ::Vector3 GetVector3(Index row, Index startColumn) const; + void SetVector3(Index row, Index startColumn, const AZ::Vector3& value); + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeaturePosition.cpp b/Gems/MotionMatching/Code/Source/FeaturePosition.cpp new file mode 100644 index 0000000000..b81ec081f7 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeaturePosition.cpp @@ -0,0 +1,127 @@ +/* + * 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 +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(FeaturePosition, MotionMatchAllocator, 0) + + void FeaturePosition::FillQueryFeatureValues(size_t startIndex, AZStd::vector& queryFeatureValues, const FrameCostContext& context) + { + const Transform invRootTransform = context.m_currentPose.GetWorldSpaceTransform(m_relativeToNodeIndex).Inversed(); + const AZ::Vector3 worldInputPosition = context.m_currentPose.GetWorldSpaceTransform(m_jointIndex).m_position; + const AZ::Vector3 relativeInputPosition = invRootTransform.TransformPoint(worldInputPosition); + queryFeatureValues[startIndex + 0] = relativeInputPosition.GetX(); + queryFeatureValues[startIndex + 1] = relativeInputPosition.GetY(); + queryFeatureValues[startIndex + 2] = relativeInputPosition.GetZ(); + } + + void FeaturePosition::ExtractFeatureValues(const ExtractFeatureContext& context) + { + const Transform invRootTransform = context.m_framePose->GetWorldSpaceTransform(m_relativeToNodeIndex).Inversed(); + const AZ::Vector3 nodeWorldPosition = context.m_framePose->GetWorldSpaceTransform(m_jointIndex).m_position; + const AZ::Vector3 position = invRootTransform.TransformPoint(nodeWorldPosition); + SetFeatureData(context.m_featureMatrix, context.m_frameIndex, position); + } + + void FeaturePosition::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex) + { + const MotionMatchingData* data = instance->GetData(); + const ActorInstance* actorInstance = instance->GetActorInstance(); + const Pose* pose = actorInstance->GetTransformData()->GetCurrentPose(); + const Transform jointModelTM = pose->GetModelSpaceTransform(m_jointIndex); + const Transform relativeToWorldTM = pose->GetWorldSpaceTransform(m_relativeToNodeIndex); + + const AZ::Vector3 position = GetFeatureData(data->GetFeatureMatrix(), frameIndex); + const AZ::Vector3 transformedPos = relativeToWorldTM.TransformPoint(position); + + constexpr float markerSize = 0.03f; + debugDisplay.DepthTestOff(); + debugDisplay.SetColor(m_debugColor); + debugDisplay.DrawBall(transformedPos, markerSize, /*drawShaded=*/false); + } + + float FeaturePosition::CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const + { + const Transform invRootTransform = context.m_currentPose.GetWorldSpaceTransform(m_relativeToNodeIndex).Inversed(); + const AZ::Vector3 worldInputPosition = context.m_currentPose.GetWorldSpaceTransform(m_jointIndex).m_position; + const AZ::Vector3 relativeInputPosition = invRootTransform.TransformPoint(worldInputPosition); + const AZ::Vector3 framePosition = GetFeatureData(context.m_featureMatrix, frameIndex); // This is already relative to the root node + return CalcResidual(relativeInputPosition, framePosition); + } + + void FeaturePosition::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(1); + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("FeaturePosition", "Matches joint positions.") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ; + } + + size_t FeaturePosition::GetNumDimensions() const + { + return 3; + } + + AZStd::string FeaturePosition::GetDimensionName(size_t index) const + { + AZStd::string result = m_jointName; + result += '.'; + + switch (index) + { + case 0: { result += "PosX"; break; } + case 1: { result += "PosY"; break; } + case 2: { result += "PosZ"; break; } + default: { result += Feature::GetDimensionName(index); } + } + + return result; + } + + AZ::Vector3 FeaturePosition::GetFeatureData(const FeatureMatrix& featureMatrix, size_t frameIndex) const + { + return featureMatrix.GetVector3(frameIndex, m_featureColumnOffset); + } + + void FeaturePosition::SetFeatureData(FeatureMatrix& featureMatrix, size_t frameIndex, const AZ::Vector3& position) + { + featureMatrix.SetVector3(frameIndex, m_featureColumnOffset, position); + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeaturePosition.h b/Gems/MotionMatching/Code/Source/FeaturePosition.h new file mode 100644 index 0000000000..d62dce9a18 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeaturePosition.h @@ -0,0 +1,55 @@ +/* + * 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 +#include +#include +#include + +#include +#include + +namespace AZ +{ + class ReflectContext; +} + +namespace EMotionFX::MotionMatching +{ + class FrameDatabase; + + class EMFX_API FeaturePosition + : public Feature + { + public: + AZ_RTTI(FeaturePosition, "{3EAA6459-DB59-4EA1-B8B3-C933A83AA77D}", Feature) + AZ_CLASS_ALLOCATOR_DECL + + FeaturePosition() = default; + ~FeaturePosition() override = default; + + void ExtractFeatureValues(const ExtractFeatureContext& context) override; + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex) override; + + float CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const override; + + void FillQueryFeatureValues(size_t startIndex, AZStd::vector& queryFeatureValues, const FrameCostContext& context) override; + + static void Reflect(AZ::ReflectContext* context); + + size_t GetNumDimensions() const override; + AZStd::string GetDimensionName(size_t index) const override; + AZ::Vector3 GetFeatureData(const FeatureMatrix& featureMatrix, size_t frameIndex) const; + void SetFeatureData(FeatureMatrix& featureMatrix, size_t frameIndex, const AZ::Vector3& position); + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureSchema.cpp b/Gems/MotionMatching/Code/Source/FeatureSchema.cpp new file mode 100644 index 0000000000..1e36a755ee --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureSchema.cpp @@ -0,0 +1,123 @@ +/* + * 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 +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(FeatureSchema, MotionMatchAllocator, 0) + + FeatureSchema::~FeatureSchema() + { + Clear(); + } + + Feature* FeatureSchema::GetFeature(size_t index) const + { + return m_features[index]; + } + + const AZStd::vector& FeatureSchema::GetFeatures() const + { + return m_features; + } + + void FeatureSchema::AddFeature(Feature* feature) + { + // Try to see if there is a feature with the same id already. + auto iterator = AZStd::find_if(m_featuresById.begin(), m_featuresById.end(), [&feature](const auto& curEntry) -> bool { + return (feature->GetId() == curEntry.second->GetId()); + }); + + if (iterator != m_featuresById.end()) + { + AZ_Assert(false, "Cannot add feature. Feature with id '%s' has already been registered.", feature->GetId().data); + return; + } + + m_featuresById.emplace(feature->GetId(), feature); + m_features.emplace_back(feature); + } + + void FeatureSchema::Clear() + { + for (Feature* feature : m_features) + { + delete feature; + } + m_featuresById.clear(); + m_features.clear(); + } + + size_t FeatureSchema::GetNumFeatures() const + { + return m_features.size(); + } + + Feature* FeatureSchema::FindFeatureById(const AZ::TypeId& featureId) const + { + const auto result = m_featuresById.find(featureId); + if (result == m_featuresById.end()) + { + return nullptr; + } + + return result->second; + } + + Feature* FeatureSchema::CreateFeatureByType(const AZ::TypeId& typeId) + { + AZ::SerializeContext* context = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(context, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + if (!context) + { + AZ_Error("Motion Matching", false, "Can't get serialize context from component application."); + return nullptr; + } + + const AZ::SerializeContext::ClassData* classData = context->FindClassData(typeId); + if (!classData) + { + AZ_Warning("Motion Matching", false, "Can't find class data for this type."); + return nullptr; + } + + Feature* featureObject = reinterpret_cast(classData->m_factory->Create(classData->m_name)); + return featureObject; + } + + void FeatureSchema::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(1) + ->Field("features", &FeatureSchema::m_features); + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("FeatureSchema", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureSchema::m_features, "Features", "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureSchema.h b/Gems/MotionMatching/Code/Source/FeatureSchema.h new file mode 100644 index 0000000000..d1005ef6dc --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureSchema.h @@ -0,0 +1,47 @@ +/* + * 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 +#include +#include + +#include + +namespace EMotionFX::MotionMatching +{ + //! The set of features involved in the motion matching search. + //! The schema represents the order of the features as well as their settings while the feature matrix stores the actual feature data. + class EMFX_API FeatureSchema + { + public: + AZ_RTTI(FrameDatabase, "{E34F6BFE-73DB-4DED-AAB9-09FBC5113236}") + AZ_CLASS_ALLOCATOR_DECL + + virtual ~FeatureSchema(); + + void AddFeature(Feature* feature); + void Clear(); + + size_t GetNumFeatures() const; + Feature* GetFeature(size_t index) const; + const AZStd::vector& GetFeatures() const; + + Feature* FindFeatureById(const AZ::TypeId& featureId) const; + + static void Reflect(AZ::ReflectContext* context); + + protected: + static Feature* CreateFeatureByType(const AZ::TypeId& typeId); + + AZStd::vector m_features; //< Ordered set of features (Owns the feature objects). + AZStd::unordered_map m_featuresById; //< Hash-map for fast access to the features by ID. (Weak ownership) + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureSchemaDefault.cpp b/Gems/MotionMatching/Code/Source/FeatureSchemaDefault.cpp new file mode 100644 index 0000000000..9201c525b6 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureSchemaDefault.cpp @@ -0,0 +1,82 @@ +/* + * 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 EMotionFX::MotionMatching +{ + void DefaultFeatureSchema(FeatureSchema& featureSchema, DefaultFeatureSchemaInitSettings settings) + { + featureSchema.Clear(); + const AZStd::string rootJointName = settings.m_rootJointName; + + //---------------------------------------------------------------------------------------------------------- + // Past and future root trajectory + FeatureTrajectory* rootTrajectory = aznew FeatureTrajectory(); + rootTrajectory->SetJointName(rootJointName); + rootTrajectory->SetRelativeToJointName(rootJointName); + rootTrajectory->SetDebugDrawColor(AZ::Color::CreateFromRgba(157,78,221,255)); + rootTrajectory->SetDebugDrawEnabled(true); + featureSchema.AddFeature(rootTrajectory); + + //---------------------------------------------------------------------------------------------------------- + // Left foot position + FeaturePosition* leftFootPosition = aznew FeaturePosition(); + leftFootPosition->SetName("Left Foot Position"); + leftFootPosition->SetJointName(settings.m_leftFootJointName); + leftFootPosition->SetRelativeToJointName(rootJointName); + leftFootPosition->SetDebugDrawColor(AZ::Color::CreateFromRgba(255,173,173,255)); + leftFootPosition->SetDebugDrawEnabled(true); + featureSchema.AddFeature(leftFootPosition); + + //---------------------------------------------------------------------------------------------------------- + // Right foot position + FeaturePosition* rightFootPosition = aznew FeaturePosition(); + rightFootPosition->SetName("Right Foot Position"); + rightFootPosition->SetJointName(settings.m_rightFootJointName); + rightFootPosition->SetRelativeToJointName(rootJointName); + rightFootPosition->SetDebugDrawColor(AZ::Color::CreateFromRgba(253,255,182,255)); + rightFootPosition->SetDebugDrawEnabled(true); + featureSchema.AddFeature(rightFootPosition); + + //---------------------------------------------------------------------------------------------------------- + // Left foot velocity + FeatureVelocity* leftFootVelocity = aznew FeatureVelocity(); + leftFootVelocity->SetName("Left Foot Velocity"); + leftFootVelocity->SetJointName(settings.m_leftFootJointName); + leftFootVelocity->SetRelativeToJointName(rootJointName); + leftFootVelocity->SetDebugDrawColor(AZ::Color::CreateFromRgba(155,246,255,255)); + leftFootVelocity->SetDebugDrawEnabled(true); + leftFootVelocity->SetCostFactor(0.75f); + featureSchema.AddFeature(leftFootVelocity); + + //---------------------------------------------------------------------------------------------------------- + // Right foot velocity + FeatureVelocity* rightFootVelocity = aznew FeatureVelocity(); + rightFootVelocity->SetName("Right Foot Velocity"); + rightFootVelocity->SetJointName(settings.m_rightFootJointName); + rightFootVelocity->SetRelativeToJointName(rootJointName); + rightFootVelocity->SetDebugDrawColor(AZ::Color::CreateFromRgba(189,178,255,255)); + rightFootVelocity->SetDebugDrawEnabled(true); + rightFootVelocity->SetCostFactor(0.75f); + featureSchema.AddFeature(rightFootVelocity); + + //---------------------------------------------------------------------------------------------------------- + // Pelvis velocity + FeatureVelocity* pelvisVelocity = aznew FeatureVelocity(); + pelvisVelocity->SetName("Pelvis Velocity"); + pelvisVelocity->SetJointName(settings.m_pelvisJointName); + pelvisVelocity->SetRelativeToJointName(rootJointName); + pelvisVelocity->SetDebugDrawColor(AZ::Color::CreateFromRgba(185,255,175,255)); + pelvisVelocity->SetDebugDrawEnabled(true); + featureSchema.AddFeature(pelvisVelocity); + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureSchemaDefault.h b/Gems/MotionMatching/Code/Source/FeatureSchemaDefault.h new file mode 100644 index 0000000000..0c9cda228f --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureSchemaDefault.h @@ -0,0 +1,23 @@ +/* + * 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 + +namespace EMotionFX::MotionMatching +{ + struct DefaultFeatureSchemaInitSettings + { + AZStd::string m_rootJointName; + AZStd::string m_leftFootJointName; + AZStd::string m_rightFootJointName; + AZStd::string m_pelvisJointName; + }; + void DefaultFeatureSchema(FeatureSchema& featureSchema, DefaultFeatureSchemaInitSettings settings); +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureTrajectory.cpp b/Gems/MotionMatching/Code/Source/FeatureTrajectory.cpp new file mode 100644 index 0000000000..3de6053b06 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureTrajectory.cpp @@ -0,0 +1,450 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(FeatureTrajectory, MotionMatchAllocator, 0) + + bool FeatureTrajectory::Init(const InitSettings& settings) + { + const bool result = Feature::Init(settings); + UpdateFacingAxis(); + return result; + } + + size_t FeatureTrajectory::CalcNumSamplesPerFrame() const + { + return m_numPastSamples + 1 + m_numFutureSamples; + } + + void FeatureTrajectory::SetFacingAxis(const Axis axis) + { + m_facingAxis = axis; + UpdateFacingAxis(); + } + + void FeatureTrajectory::UpdateFacingAxis() + { + switch (m_facingAxis) + { + case Axis::X: + { + m_facingAxisDir = AZ::Vector3::CreateAxisX(); + break; + } + case Axis::Y: + { + m_facingAxisDir = AZ::Vector3::CreateAxisY(); + break; + } + case Axis::X_NEGATIVE: + { + m_facingAxisDir = -AZ::Vector3::CreateAxisX(); + break; + } + case Axis::Y_NEGATIVE: + { + m_facingAxisDir = -AZ::Vector3::CreateAxisY(); + break; + } + default: + { + AZ_Assert(false, "Facing direction axis unknown."); + } + } + } + + AZ::Vector2 FeatureTrajectory::CalculateFacingDirection(const Pose& pose, const Transform& invRootTransform) const + { + // Get the facing direction of the given joint for the given pose in animation world space. + // The given pose is either sampled into the relative past or future based on the frame we want to extract the feature for. + const AZ::Vector3 facingDirAnimationWorldSpace = pose.GetWorldSpaceTransform(m_jointIndex).TransformVector(m_facingAxisDir); + + // The invRootTransform is the inverse of the world space transform for the given joint at the frame we want to extract the feature for. + // The result after this will be the facing direction relative to the frame we want to extract the feature for. + const AZ::Vector3 facingDirection = invRootTransform.TransformVector(facingDirAnimationWorldSpace); + + // Project to the ground plane and make sure the direction is normalized. + return AZ::Vector2(facingDirection).GetNormalizedSafe(); + } + + FeatureTrajectory::Sample FeatureTrajectory::GetSampleFromPose(const Pose& pose, const Transform& invRootTransform) const + { + // Position of the root joint in the model space relative to frame to extract. + const AZ::Vector2 position = AZ::Vector2(invRootTransform.TransformPoint(pose.GetWorldSpaceTransform(m_jointIndex).m_position)); + + // Calculate the facing direction. + const AZ::Vector2 facingDirection = CalculateFacingDirection(pose, invRootTransform); + + return { position, facingDirection }; + } + + void FeatureTrajectory::ExtractFeatureValues(const ExtractFeatureContext& context) + { + const ActorInstance* actorInstance = context.m_actorInstance; + AnimGraphPosePool& posePool = GetEMotionFX().GetThreadData(actorInstance->GetThreadIndex())->GetPosePool(); + AnimGraphPose* samplePose = posePool.RequestPose(actorInstance); + AnimGraphPose* nextSamplePose = posePool.RequestPose(actorInstance); + + const size_t frameIndex = context.m_frameIndex; + const Frame& currentFrame = context.m_frameDatabase->GetFrame(context.m_frameIndex); + + // Inverse of the root transform for the frame that we want to extract data from. + const Transform invRootTransform = context.m_framePose->GetWorldSpaceTransform(m_relativeToNodeIndex).Inversed(); + + const size_t midSampleIndex = CalcMidFrameIndex(); + const Sample midSample = GetSampleFromPose(*context.m_framePose, invRootTransform); + SetFeatureData(context.m_featureMatrix, frameIndex, midSampleIndex, midSample); + + // Sample the past. + const float pastFrameTimeDelta = m_pastTimeRange / static_cast(m_numPastSamples - 1); + currentFrame.SamplePose(&samplePose->GetPose()); + for (size_t i = 0; i < m_numPastSamples; ++i) + { + // Increase the sample index by one as the zeroth past/future sample actually needs one time delta time difference to the current frame. + const float sampleTimeOffset = (i+1) * pastFrameTimeDelta * (-1.0f); + currentFrame.SamplePose(&nextSamplePose->GetPose(), sampleTimeOffset); + + const Sample sample = GetSampleFromPose(samplePose->GetPose(), invRootTransform); + const size_t sampleIndex = CalcPastFrameIndex(i); + SetFeatureData(context.m_featureMatrix, frameIndex, sampleIndex, sample); + + *samplePose = *nextSamplePose; + } + + // Sample into the future. + const float futureFrameTimeDelta = m_futureTimeRange / (float)(m_numFutureSamples - 1); + currentFrame.SamplePose(&samplePose->GetPose()); + for (size_t i = 0; i < m_numFutureSamples; ++i) + { + // Sample the value at the future sample point. + const float sampleTimeOffset = (i+1) * futureFrameTimeDelta; + currentFrame.SamplePose(&nextSamplePose->GetPose(), sampleTimeOffset); + + const Sample sample = GetSampleFromPose(samplePose->GetPose(), invRootTransform); + const size_t sampleIndex = CalcFutureFrameIndex(i); + SetFeatureData(context.m_featureMatrix, frameIndex, sampleIndex, sample); + + *samplePose = *nextSamplePose; + } + + posePool.FreePose(samplePose); + posePool.FreePose(nextSamplePose); + } + + void FeatureTrajectory::SetPastTimeRange(float timeInSeconds) + { + m_pastTimeRange = timeInSeconds; + } + + void FeatureTrajectory::SetFutureTimeRange(float timeInSeconds) + { + m_futureTimeRange = timeInSeconds; + } + + void FeatureTrajectory::SetNumPastSamplesPerFrame(size_t numHistorySamples) + { + m_numPastSamples = numHistorySamples; + } + + void FeatureTrajectory::SetNumFutureSamplesPerFrame(size_t numFutureSamples) + { + m_numFutureSamples = numFutureSamples; + } + + void FeatureTrajectory::DebugDrawFacingDirection(AzFramework::DebugDisplayRequests& debugDisplay, + const AZ::Vector3& positionWorldSpace, + const AZ::Vector3& facingDirectionWorldSpace) + { + const float length = 0.2f; + const float radius = 0.01f; + + const AZ::Vector3 facingDirectionTarget = positionWorldSpace + facingDirectionWorldSpace * length; + debugDisplay.DrawSolidCylinder(/*center=*/(facingDirectionTarget + positionWorldSpace) * 0.5f, + /*direction=*/facingDirectionWorldSpace, + radius, + /*height=*/length, + /*drawShaded=*/false); + } + + void FeatureTrajectory::DebugDrawFacingDirection(AzFramework::DebugDisplayRequests& debugDisplay, + const Transform& worldSpaceTransform, + const Sample& sample, + const AZ::Vector3& samplePosWorldSpace) const + { + const AZ::Vector3 facingDirectionWorldSpace = worldSpaceTransform.TransformVector(AZ::Vector3(sample.m_facingDirection)).GetNormalizedSafe(); + DebugDrawFacingDirection(debugDisplay, samplePosWorldSpace, facingDirectionWorldSpace); + } + + void FeatureTrajectory::DebugDrawTrajectory(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex, + const Transform& worldSpaceTransform, + const AZ::Color& color, + size_t numSamples, + const SplineToFeatureMatrixIndex& splineToFeatureMatrixIndex) const + { + if (frameIndex == InvalidIndex) + { + return; + } + + constexpr float markerSize = 0.02f; + const FeatureMatrix& featureMatrix = instance->GetData()->GetFeatureMatrix(); + + debugDisplay.DepthTestOff(); + debugDisplay.SetColor(color); + + Sample nextSample; + AZ::Vector3 nextSamplePos; + for (size_t i = 0; i < numSamples - 1; ++i) + { + const Sample currentSample = GetFeatureData(featureMatrix, frameIndex, splineToFeatureMatrixIndex(i)); + nextSample = GetFeatureData(featureMatrix, frameIndex, splineToFeatureMatrixIndex(i + 1)); + + const AZ::Vector3 currentSamplePos = worldSpaceTransform.TransformPoint(AZ::Vector3(currentSample.m_position)); + nextSamplePos = worldSpaceTransform.TransformPoint(AZ::Vector3(nextSample.m_position)); + + // Line between current and next sample. + debugDisplay.DrawSolidCylinder(/*center=*/(nextSamplePos + currentSamplePos) * 0.5f, + /*direction=*/(nextSamplePos - currentSamplePos).GetNormalizedSafe(), + /*radius=*/0.0025f, + /*height=*/(nextSamplePos - currentSamplePos).GetLength(), + /*drawShaded=*/false); + + // Sphere at the sample position and a cylinder to indicate the facing direction. + debugDisplay.DrawBall(currentSamplePos, markerSize, /*drawShaded=*/false); + DebugDrawFacingDirection(debugDisplay, worldSpaceTransform, currentSample, currentSamplePos); + } + + debugDisplay.DrawBall(nextSamplePos, markerSize, /*drawShaded=*/false); + DebugDrawFacingDirection(debugDisplay, worldSpaceTransform, nextSample, nextSamplePos); + } + + void FeatureTrajectory::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex) + { + const ActorInstance* actorInstance = instance->GetActorInstance(); + const Transform transform = actorInstance->GetTransformData()->GetCurrentPose()->GetWorldSpaceTransform(m_jointIndex); + + DebugDrawTrajectory(debugDisplay, instance, frameIndex, transform, + m_debugColor, m_numPastSamples, AZStd::bind(&FeatureTrajectory::CalcPastFrameIndex, this, AZStd::placeholders::_1)); + + DebugDrawTrajectory(debugDisplay, instance, frameIndex, transform, + m_debugColor, m_numFutureSamples, AZStd::bind(&FeatureTrajectory::CalcFutureFrameIndex, this, AZStd::placeholders::_1)); + } + + size_t FeatureTrajectory::CalcMidFrameIndex() const + { + return m_numPastSamples; + } + + size_t FeatureTrajectory::CalcPastFrameIndex(size_t historyFrameIndex) const + { + AZ_Assert(historyFrameIndex < m_numPastSamples, "The history frame index is out of range"); + return m_numPastSamples - historyFrameIndex - 1; + } + + size_t FeatureTrajectory::CalcFutureFrameIndex(size_t futureFrameIndex) const + { + AZ_Assert(futureFrameIndex < m_numFutureSamples, "The future frame index is out of range"); + return CalcMidFrameIndex() + 1 + futureFrameIndex; + } + + float FeatureTrajectory::CalculateCost(const FeatureMatrix& featureMatrix, + size_t frameIndex, + const Transform& invRootTransform, + const AZStd::vector& controlPoints, + const SplineToFeatureMatrixIndex& splineToFeatureMatrixIndex) const + { + float cost = 0.0f; + AZ::Vector2 lastControlPoint, lastSamplePos; + + for (size_t i = 0; i < controlPoints.size(); ++i) + { + const TrajectoryQuery::ControlPoint& controlPoint = controlPoints[i]; + const Sample sample = GetFeatureData(featureMatrix, frameIndex, splineToFeatureMatrixIndex(i)); + const AZ::Vector2& samplePos = sample.m_position; + const AZ::Vector2 controlPointPos = AZ::Vector2(invRootTransform.TransformPoint(controlPoint.m_position)); // Convert so it is relative to where we are and pointing to. + + if (i != 0) + { + const AZ::Vector2 controlPointDelta = controlPointPos - lastControlPoint; + const AZ::Vector2 sampleDelta = samplePos - lastSamplePos; + + const float posDistance = (samplePos - controlPointPos).GetLength(); + const float posDeltaDistance = (controlPointDelta - sampleDelta).GetLength(); + + // The facing direction from the control point (trajectory query) is in world space while the facing direction from the + // sample of this trajectory feature is in relative-to-frame-root-joint space. + const AZ::Vector2 controlPointFacingDirRelativeSpace = AZ::Vector2(invRootTransform.TransformVector(controlPoint.m_facingDirection)); + const float facingDirectionCost = GetNormalizedDirectionDifference(sample.m_facingDirection, + controlPointFacingDirRelativeSpace); + + // As we got two different costs for the position, double the cost of the facing direction to equal out the influence. + cost += CalcResidual(posDistance) + CalcResidual(posDeltaDistance) + CalcResidual(facingDirectionCost) * 2.0f; + } + + lastControlPoint = controlPointPos; + lastSamplePos = samplePos; + } + + return cost; + } + + float FeatureTrajectory::CalculateFutureFrameCost(size_t frameIndex, const FrameCostContext& context) const + { + AZ_Assert(context.m_trajectoryQuery->GetFutureControlPoints().size() == m_numFutureSamples, "Number of future control points from the trajectory query does not match the one from the trajectory feature."); + const Transform invRootTransform = context.m_currentPose.GetWorldSpaceTransform(m_relativeToNodeIndex).Inversed(); + return CalculateCost(context.m_featureMatrix, frameIndex, invRootTransform, context.m_trajectoryQuery->GetFutureControlPoints(), AZStd::bind(&FeatureTrajectory::CalcFutureFrameIndex, this, AZStd::placeholders::_1)); + } + + float FeatureTrajectory::CalculatePastFrameCost(size_t frameIndex, const FrameCostContext& context) const + { + AZ_Assert(context.m_trajectoryQuery->GetPastControlPoints().size() == m_numPastSamples, "Number of past control points from the trajectory query does not match the one from the trajectory feature"); + const Transform invRootTransform = context.m_currentPose.GetWorldSpaceTransform(m_relativeToNodeIndex).Inversed(); + return CalculateCost(context.m_featureMatrix, frameIndex, invRootTransform, context.m_trajectoryQuery->GetPastControlPoints(), AZStd::bind(&FeatureTrajectory::CalcPastFrameIndex, this, AZStd::placeholders::_1)); + } + + AZ::Crc32 FeatureTrajectory::GetCostFactorVisibility() const + { + return AZ::Edit::PropertyVisibility::Hide; + } + + void FeatureTrajectory::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(2) + ->Field("pastTimeRange", &FeatureTrajectory::m_pastTimeRange) + ->Field("numPastSamples", &FeatureTrajectory::m_numPastSamples) + ->Field("pastCostFactor", &FeatureTrajectory::m_pastCostFactor) + ->Field("futureTimeRange", &FeatureTrajectory::m_futureTimeRange) + ->Field("numFutureSamples", &FeatureTrajectory::m_numFutureSamples) + ->Field("futureCostFactor", &FeatureTrajectory::m_futureCostFactor) + ->Field("facingAxis", &FeatureTrajectory::m_facingAxis) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("FeatureTrajectory", "Matches the joint past and future trajectory.") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureTrajectory::m_numPastSamples, "Past Samples", "The number of samples stored per frame for the past trajectory. [Default = 4 samples to represent the trajectory history]") + ->Attribute(AZ::Edit::Attributes::Min, 1) + ->Attribute(AZ::Edit::Attributes::Max, 100) + ->Attribute(AZ::Edit::Attributes::Step, 1) + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureTrajectory::m_pastTimeRange, "Past Time Range", "The time window the samples are distributed along for the trajectory history. [Default = 0.7 seconds]") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->Attribute(AZ::Edit::Attributes::Max, 10.0f) + ->Attribute(AZ::Edit::Attributes::Step, 0.1f) + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureTrajectory::m_pastCostFactor, "Past Cost Factor", "The cost factor is multiplied with the cost from the trajectory history and can be used to change the influence of the trajectory history match in the motion matching search.") + ->Attribute(AZ::Edit::Attributes::Min, 0.0f) + ->Attribute(AZ::Edit::Attributes::Max, 100.0f) + ->Attribute(AZ::Edit::Attributes::Step, 0.1f) + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureTrajectory::m_numFutureSamples, "Future Samples", "The number of samples stored per frame for the future trajectory. [Default = 6 samples to represent the future trajectory]") + ->Attribute(AZ::Edit::Attributes::Min, 1) + ->Attribute(AZ::Edit::Attributes::Max, 100) + ->Attribute(AZ::Edit::Attributes::Step, 1) + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureTrajectory::m_futureTimeRange, "Future Time Range", "The time window the samples are distributed along for the future trajectory. [Default = 1.2 seconds]") + ->Attribute(AZ::Edit::Attributes::Min, 0.01f) + ->Attribute(AZ::Edit::Attributes::Max, 10.0f) + ->Attribute(AZ::Edit::Attributes::Step, 0.1f) + ->DataElement(AZ::Edit::UIHandlers::Default, &FeatureTrajectory::m_futureCostFactor, "Future Cost Factor", "The cost factor is multiplied with the cost from the future trajectory and can be used to change the influence of the future trajectory match in the motion matching search.") + ->Attribute(AZ::Edit::Attributes::Min, 0.0f) + ->Attribute(AZ::Edit::Attributes::Max, 100.0f) + ->Attribute(AZ::Edit::Attributes::Step, 0.1f) + ->DataElement(AZ::Edit::UIHandlers::ComboBox, &FeatureTrajectory::m_facingAxis, "Facing Axis", "The facing direction of the character. Which axis of the joint transform is facing forward? [Default = Looking into Y-axis direction]") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &FeatureTrajectory::UpdateFacingAxis) + ->EnumAttribute(Axis::X, "X") + ->EnumAttribute(Axis::X_NEGATIVE, "-X") + ->EnumAttribute(Axis::Y, "Y") + ->EnumAttribute(Axis::Y_NEGATIVE, "-Y") + ; + } + + size_t FeatureTrajectory::GetNumDimensions() const + { + return CalcNumSamplesPerFrame() * Sample::s_componentsPerSample; + } + + AZStd::string FeatureTrajectory::GetDimensionName(size_t index) const + { + AZStd::string result = "Trajectory"; + + const int sampleIndex = aznumeric_cast(index) / aznumeric_cast(Sample::s_componentsPerSample); + const int componentIndex = index % Sample::s_componentsPerSample; + const int midSampleIndex = aznumeric_cast(CalcMidFrameIndex()); + + if (sampleIndex == midSampleIndex) + { + result += ".Current."; + } + else if (sampleIndex < midSampleIndex) + { + result += AZStd::string::format(".Past%i.", sampleIndex - static_cast(m_numPastSamples)); + } + else + { + result += AZStd::string::format(".Future%i.", sampleIndex - static_cast(m_numPastSamples)); + } + + switch (componentIndex) + { + case 0: { result += "PosX"; break; } + case 1: { result += "PosY"; break; } + case 2: { result += "FacingDirX"; break; } + case 3: { result += "FacingDirY"; break; } + default: { result += Feature::GetDimensionName(index); } + } + + return result; + } + + FeatureTrajectory::Sample FeatureTrajectory::GetFeatureData(const FeatureMatrix& featureMatrix, size_t frameIndex, size_t sampleIndex) const + { + const size_t columnOffset = m_featureColumnOffset + sampleIndex * Sample::s_componentsPerSample; + return { + /*.m_position =*/ featureMatrix.GetVector2(frameIndex, columnOffset + 0), + /*.m_facingDirection =*/ featureMatrix.GetVector2(frameIndex, columnOffset + 2), + }; + } + + void FeatureTrajectory::SetFeatureData(FeatureMatrix& featureMatrix, size_t frameIndex, size_t sampleIndex, const Sample& sample) + { + const size_t columnOffset = m_featureColumnOffset + sampleIndex * Sample::s_componentsPerSample; + featureMatrix.SetVector2(frameIndex, columnOffset + 0, sample.m_position); + featureMatrix.SetVector2(frameIndex, columnOffset + 2, sample.m_facingDirection); + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureTrajectory.h b/Gems/MotionMatching/Code/Source/FeatureTrajectory.h new file mode 100644 index 0000000000..7eacbf684c --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureTrajectory.h @@ -0,0 +1,148 @@ +/* + * 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 +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace AZ +{ + class ReflectContext; +} + +namespace EMotionFX::MotionMatching +{ + class FrameDatabase; + + /** + * Matches the root joint past and future trajectory. + * For each frame in the motion database, the position and facing direction relative to the current frame of the joint will be evaluated for a past and future time window. + * The past and future samples together form the trajectory of the current frame within the time window. This basically describes where the character came from to reach the + * current frame and where it will go when continuing to play the animation. + **/ + class EMFX_API FeatureTrajectory + : public Feature + { + public: + AZ_RTTI(FeatureTrajectory, "{0451E95B-A452-439A-81ED-3962A06A3992}", Feature) + AZ_CLASS_ALLOCATOR_DECL + + enum class Axis + { + X = 0, + Y = 1, + X_NEGATIVE = 2, + Y_NEGATIVE = 3, + }; + + struct EMFX_API Sample + { + AZ::Vector2 m_position; //! Position in the space relative to the extracted frame. + AZ::Vector2 m_facingDirection; //! Facing direction in the space relative to the extracted frame. + + static constexpr size_t s_componentsPerSample = 4; + }; + + FeatureTrajectory() = default; + ~FeatureTrajectory() override = default; + + bool Init(const InitSettings& settings) override; + void ExtractFeatureValues(const ExtractFeatureContext& context) override; + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex) override; + + float CalculateFutureFrameCost(size_t frameIndex, const FrameCostContext& context) const; + float CalculatePastFrameCost(size_t frameIndex, const FrameCostContext& context) const; + + void SetNumPastSamplesPerFrame(size_t numHistorySamples); + void SetNumFutureSamplesPerFrame(size_t numFutureSamples); + void SetPastTimeRange(float timeInSeconds); + void SetFutureTimeRange(float timeInSeconds); + void SetFacingAxis(const Axis axis); + void UpdateFacingAxis(); + + float GetPastTimeRange() const { return m_pastTimeRange; } + size_t GetNumPastSamples() const { return m_numPastSamples; } + float GetPastCostFactor() const { return m_pastCostFactor; } + + float GetFutureTimeRange() const { return m_futureTimeRange; } + size_t GetNumFutureSamples() const { return m_numFutureSamples; } + float GetFutureCostFactor() const { return m_futureCostFactor; } + + AZ::Vector2 CalculateFacingDirection(const Pose& pose, const Transform& invRootTransform) const; + AZ::Vector3 GetFacingAxisDir() const { return m_facingAxisDir; } + + static void Reflect(AZ::ReflectContext* context); + + size_t GetNumDimensions() const override; + AZStd::string GetDimensionName(size_t index) const override; + + // Shared helper function to draw a facing direction. + static void DebugDrawFacingDirection(AzFramework::DebugDisplayRequests& debugDisplay, + const AZ::Vector3& positionWorldSpace, + const AZ::Vector3& facingDirectionWorldSpace); + + private: + size_t CalcMidFrameIndex() const; + size_t CalcPastFrameIndex(size_t historyFrameIndex) const; + size_t CalcFutureFrameIndex(size_t futureFrameIndex) const; + size_t CalcNumSamplesPerFrame() const; + + using SplineToFeatureMatrixIndex = AZStd::function; + float CalculateCost(const FeatureMatrix& featureMatrix, + size_t frameIndex, + const Transform& invRootTransform, + const AZStd::vector& controlPoints, + const SplineToFeatureMatrixIndex& splineToFeatureMatrixIndex) const; + + //! Called for every sample in the past or future range to extract its information. + //! @param[in] pose The sampled pose within the trajectory range [m_pastTimeRange, m_futureTimeRange]. + //! @param[in] invRootTransform The inverse of the world space transform of the joint at frame time that the feature is extracted for. + Sample GetSampleFromPose(const Pose& pose, const Transform& invRootTransform) const; + + Sample GetFeatureData(const FeatureMatrix& featureMatrix, size_t frameIndex, size_t sampleIndex) const; + void SetFeatureData(FeatureMatrix& featureMatrix, size_t frameIndex, size_t sampleIndex, const Sample& sample); + + void DebugDrawTrajectory(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex, + const Transform& transform, + const AZ::Color& color, + size_t numSamples, + const SplineToFeatureMatrixIndex& splineToFeatureMatrixIndex) const; + + void DebugDrawFacingDirection(AzFramework::DebugDisplayRequests& debugDisplay, + const Transform& worldSpaceTransform, + const Sample& sample, + const AZ::Vector3& samplePosWorldSpace) const; + + AZ::Crc32 GetCostFactorVisibility() const override; + + float m_pastTimeRange = 0.7f; //< The time window the samples are distributed along for the past trajectory. + size_t m_numPastSamples = 4; //< The number of samples stored per frame for the past (history) trajectory. + float m_pastCostFactor = 0.5f; //< Normalized value to weight or scale the future trajectory cost. + + float m_futureTimeRange = 1.2f; //< The time window the samples are distributed along for the future trajectory. + size_t m_numFutureSamples = 6; //< The number of samples stored per frame for the future trajectory. + float m_futureCostFactor = 0.75f; //< Normalized value to weight or scale the future trajectory cost. + + Axis m_facingAxis = Axis::Y; //< Which axis of the joint transform is facing forward? + AZ::Vector3 m_facingAxisDir = AZ::Vector3::CreateAxisY(); + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureVelocity.cpp b/Gems/MotionMatching/Code/Source/FeatureVelocity.cpp new file mode 100644 index 0000000000..e210ca1a61 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureVelocity.cpp @@ -0,0 +1,152 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(FeatureVelocity, MotionMatchAllocator, 0) + + void FeatureVelocity::FillQueryFeatureValues(size_t startIndex, AZStd::vector& queryFeatureValues, const FrameCostContext& context) + { + PoseDataJointVelocities* velocityPoseData = static_cast(context.m_currentPose.GetPoseDataByType(azrtti_typeid())); + AZ_Assert(velocityPoseData, "Cannot calculate velocity feature cost without joint velocity pose data."); + const AZ::Vector3 currentVelocity = velocityPoseData->GetVelocity(m_jointIndex); + + queryFeatureValues[startIndex + 0] = currentVelocity.GetX(); + queryFeatureValues[startIndex + 1] = currentVelocity.GetY(); + queryFeatureValues[startIndex + 2] = currentVelocity.GetZ(); + } + + void FeatureVelocity::ExtractFeatureValues(const ExtractFeatureContext& context) + { + AZ::Vector3 velocity; + CalculateVelocity(context.m_actorInstance, m_jointIndex, m_relativeToNodeIndex, context.m_frameDatabase->GetFrame(context.m_frameIndex), velocity); + + SetFeatureData(context.m_featureMatrix, context.m_frameIndex, velocity); + } + + void FeatureVelocity::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + const AZ::Vector3& velocity, + size_t jointIndex, + size_t relativeToJointIndex, + const AZ::Color& color) + { + const ActorInstance* actorInstance = instance->GetActorInstance(); + const Pose* pose = actorInstance->GetTransformData()->GetCurrentPose(); + const Transform jointModelTM = pose->GetModelSpaceTransform(jointIndex); + const Transform relativeToWorldTM = pose->GetWorldSpaceTransform(relativeToJointIndex); + + const AZ::Vector3 jointPosition = relativeToWorldTM.TransformPoint(jointModelTM.m_position); + const float scale = 0.15f; + const AZ::Vector3 velocityWorldSpace = relativeToWorldTM.TransformVector(velocity * scale); + + DebugDrawVelocity(debugDisplay, jointPosition, velocityWorldSpace, color); + } + + void FeatureVelocity::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex) + { + if (m_jointIndex == InvalidIndex) + { + return; + } + + const MotionMatchingData* data = instance->GetData(); + const AZ::Vector3 velocity = GetFeatureData(data->GetFeatureMatrix(), frameIndex); + DebugDraw(debugDisplay, instance, velocity, m_jointIndex, m_relativeToNodeIndex, m_debugColor); + } + + float FeatureVelocity::CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const + { + PoseDataJointVelocities* velocityPoseData = static_cast(context.m_currentPose.GetPoseDataByType(azrtti_typeid())); + AZ_Assert(velocityPoseData, "Cannot calculate velocity feature cost without joint velocity pose data."); + const AZ::Vector3 currentVelocity = velocityPoseData->GetVelocity(m_jointIndex); + + const AZ::Vector3 frameVelocity = GetFeatureData(context.m_featureMatrix, frameIndex); + + // Direction difference + const float directionDifferenceCost = GetNormalizedDirectionDifference(frameVelocity.GetNormalized(), currentVelocity.GetNormalized()); + + // Speed difference + // TODO: This needs to be normalized later on, else wise it could be that the direction difference is weights + // too heavily or too less compared to what the speed values are + const float speedDifferenceCost = frameVelocity.GetLength() - currentVelocity.GetLength(); + + return CalcResidual(directionDifferenceCost) + CalcResidual(speedDifferenceCost); + } + + void FeatureVelocity::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (!serializeContext) + { + return; + } + + serializeContext->Class() + ->Version(1) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (!editContext) + { + return; + } + + editContext->Class("FeatureVelocity", "Matches joint velocities.") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, "") + ; + } + + size_t FeatureVelocity::GetNumDimensions() const + { + return 3; + } + + AZStd::string FeatureVelocity::GetDimensionName(size_t index) const + { + AZStd::string result = m_jointName; + result += '.'; + + switch (index) + { + case 0: { result += "VelocityX"; break; } + case 1: { result += "VelocityY"; break; } + case 2: { result += "VelocityZ"; break; } + default: { result += Feature::GetDimensionName(index); } + } + + return result; + } + + AZ::Vector3 FeatureVelocity::GetFeatureData(const FeatureMatrix& featureMatrix, size_t frameIndex) const + { + return featureMatrix.GetVector3(frameIndex, m_featureColumnOffset); + } + + void FeatureVelocity::SetFeatureData(FeatureMatrix& featureMatrix, size_t frameIndex, const AZ::Vector3& velocity) + { + featureMatrix.SetVector3(frameIndex, m_featureColumnOffset, velocity); + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FeatureVelocity.h b/Gems/MotionMatching/Code/Source/FeatureVelocity.h new file mode 100644 index 0000000000..37cd8f3d7e --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FeatureVelocity.h @@ -0,0 +1,64 @@ +/* + * 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 +#include +#include +#include + +#include +#include +#include + +namespace AZ +{ + class ReflectContext; +} + +namespace EMotionFX::MotionMatching +{ + class FrameDatabase; + + class EMFX_API FeatureVelocity + : public Feature + { + public: + AZ_RTTI(FeatureVelocity, "{DEEA4F0F-CE70-4F16-9136-C2BFDDA29336}", Feature) + AZ_CLASS_ALLOCATOR_DECL + + FeatureVelocity() = default; + ~FeatureVelocity() override = default; + + void ExtractFeatureValues(const ExtractFeatureContext& context) override; + + static void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + const AZ::Vector3& velocity, // in world space + size_t jointIndex, + size_t relativeToJointIndex, + const AZ::Color& color); + + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, + MotionMatchingInstance* instance, + size_t frameIndex) override; + + float CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const override; + + void FillQueryFeatureValues(size_t startIndex, AZStd::vector& queryFeatureValues, const FrameCostContext& context) override; + + static void Reflect(AZ::ReflectContext* context); + + size_t GetNumDimensions() const override; + AZStd::string GetDimensionName(size_t index) const override; + AZ::Vector3 GetFeatureData(const FeatureMatrix& featureMatrix, size_t frameIndex) const; + void SetFeatureData(FeatureMatrix& featureMatrix, size_t frameIndex, const AZ::Vector3& velocity); + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/Frame.cpp b/Gems/MotionMatching/Code/Source/Frame.cpp new file mode 100644 index 0000000000..170d3050f7 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/Frame.cpp @@ -0,0 +1,78 @@ +/* + * 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 EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(Frame, MotionMatchAllocator, 0) + + Frame::Frame() + : m_frameIndex(InvalidIndex) + , m_sampleTime(0.0f) + , m_sourceMotion(nullptr) + , m_mirrored(false) + { + } + + Frame::Frame(size_t frameIndex, Motion* sourceMotion, float sampleTime, bool mirrored) + : m_frameIndex(frameIndex) + , m_sourceMotion(sourceMotion) + , m_sampleTime(sampleTime) + , m_mirrored(mirrored) + { + } + + void Frame::SamplePose(Pose* outputPose, float timeOffset) const + { + MotionDataSampleSettings sampleSettings; + sampleSettings.m_actorInstance = outputPose->GetActorInstance(); + sampleSettings.m_inPlace = false; + sampleSettings.m_mirror = m_mirrored; + sampleSettings.m_retarget = false; + sampleSettings.m_inputPose = sampleSettings.m_actorInstance->GetTransformData()->GetBindPose(); + + sampleSettings.m_sampleTime = m_sampleTime + timeOffset; + sampleSettings.m_sampleTime = AZ::GetClamp(m_sampleTime + timeOffset, 0.0f, m_sourceMotion->GetDuration()); + + m_sourceMotion->SamplePose(outputPose, sampleSettings); + } + + void Frame::SetFrameIndex(size_t frameIndex) + { + m_frameIndex = frameIndex; + } + + Motion* Frame::GetSourceMotion() const + { + return m_sourceMotion; + } + + float Frame::GetSampleTime() const + { + return m_sampleTime; + } + + void Frame::SetSourceMotion(Motion* sourceMotion) + { + m_sourceMotion = sourceMotion; + } + + void Frame::SetMirrored(bool enabled) + { + m_mirrored = enabled; + } + + void Frame::SetSampleTime(float sampleTime) + { + m_sampleTime = sampleTime; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/Frame.h b/Gems/MotionMatching/Code/Source/Frame.h new file mode 100644 index 0000000000..02150cfa5a --- /dev/null +++ b/Gems/MotionMatching/Code/Source/Frame.h @@ -0,0 +1,62 @@ +/* + * 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 + +#include +#include + +namespace EMotionFX +{ + class Motion; + + namespace MotionMatching + { + /** + * A motion matching frame. + * This holds information required in order to extract a given pose in a given motion. + */ + class EMFX_API Frame + { + public: + AZ_RTTI(Frame, "{985BD732-D80E-4898-AB6C-CAB22D88AACD}") + AZ_CLASS_ALLOCATOR_DECL + + Frame(); + Frame(size_t frameIndex, Motion* sourceMotion, float sampleTime, bool mirrored); + ~Frame() = default; + + //! Sample the pose for the given frame. + //! @param[in] outputPose The pose used to store the sampled result. + //! @param[in] timeOffset Frames in the frame database are samples with a given sample rate (default = 30 fps). + //! For calculating velocities for example, it is needed to sample a pose close to a frame but not exactly at the frame position. + //! The timeOffset parameter can be used for that and represents the offset in time from the frame sample time in seconds. + //! In case the time offset is 0.0, the pose exactly at the frame position will be sampled. + void SamplePose(Pose* outputPose, float timeOffset = 0.0f) const; + + Motion* GetSourceMotion() const; + float GetSampleTime() const; + size_t GetFrameIndex() const { return m_frameIndex; } + bool GetMirrored() const { return m_mirrored; } + + void SetSourceMotion(Motion* sourceMotion); + void SetSampleTime(float sampleTime); + void SetFrameIndex(size_t frameIndex); + void SetMirrored(bool enabled); + + private: + size_t m_frameIndex = 0; /**< The motion frame index inside the data object. */ + float m_sampleTime = 0.0f; /**< The time offset in the original motion. */ + Motion* m_sourceMotion = nullptr; /**< The original motion that we sample from to restore the pose. */ + bool m_mirrored = false; /**< Is this frame mirrored? */ + }; + } // namespace MotionMatching +} // namespace EMotionFX diff --git a/Gems/MotionMatching/Code/Source/FrameDatabase.cpp b/Gems/MotionMatching/Code/Source/FrameDatabase.cpp new file mode 100644 index 0000000000..7d38060dcc --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FrameDatabase.cpp @@ -0,0 +1,250 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(FrameDatabase, MotionMatchAllocator, 0) + + FrameDatabase::FrameDatabase() + { + } + + FrameDatabase::~FrameDatabase() + { + Clear(); + } + + void FrameDatabase::Clear() + { + // Clear the frames. + m_frames.clear(); + m_frames.shrink_to_fit(); + + m_frameIndexByMotion.clear(); + + // Clear other things. + m_usedMotions.clear(); + m_usedMotions.shrink_to_fit(); + } + + void FrameDatabase::ExtractActiveMotionEventDatas(const Motion* motion, float time, AZStd::vector& activeEventDatas) + { + activeEventDatas.clear(); + + // Iterate over all motion event tracks and all events inside them. + const MotionEventTable* eventTable = motion->GetEventTable(); + const size_t numTracks = eventTable->GetNumTracks(); + for (size_t t = 0; t < numTracks; ++t) + { + const MotionEventTrack* track = eventTable->GetTrack(t); + const size_t numEvents = track->GetNumEvents(); + for (size_t e = 0; e < numEvents; ++e) + { + const MotionEvent& motionEvent = track->GetEvent(e); + + // Only handle range based events and events that include our time value. + if (motionEvent.GetIsTickEvent() || + motionEvent.GetStartTime() > time || + motionEvent.GetEndTime() < time) + { + continue; + } + + for (auto eventData : motionEvent.GetEventDatas()) + { + activeEventDatas.emplace_back(const_cast(eventData.get())); + } + } + } + } + + bool FrameDatabase::IsFrameDiscarded(const AZStd::vector& activeEventDatas) const + { + for (const EventData* eventData : activeEventDatas) + { + if (eventData->RTTI_GetType() == azrtti_typeid()) + { + return true; + } + } + + return false; + } + + AZStd::tuple FrameDatabase::ImportFrames(Motion* motion, const FrameImportSettings& settings, bool mirrored) + { + AZ_PROFILE_SCOPE(Animation, "FrameDatabase::ImportFrames"); + + AZ_Assert(motion, "The motion cannot be a nullptr"); + AZ_Assert(settings.m_sampleRate > 0, "The sample rate must be bigger than zero frames per second"); + AZ_Assert(settings.m_sampleRate <= 120, "The sample rate must be smaller than 120 frames per second"); + + size_t numFramesImported = 0; + size_t numFramesDiscarded = 0; + + // Calculate the number of frames we might need to import, in worst case. + m_sampleRate = settings.m_sampleRate; + const double timeStep = 1.0 / aznumeric_cast(settings.m_sampleRate); + const size_t worstCaseNumFrames = aznumeric_cast(ceil(motion->GetDuration() / timeStep)) + 1; + + // Try to pre-allocate memory for the worst case scenario. + if (m_frames.capacity() < m_frames.size() + worstCaseNumFrames) + { + m_frames.reserve(m_frames.size() + worstCaseNumFrames); + } + + AZStd::vector activeEvents; + + // Iterate over all sample positions in the motion. + const double totalTime = aznumeric_cast(motion->GetDuration()); + double curTime = 0.0; + while (curTime <= totalTime) + { + const float floatTime = aznumeric_cast(curTime); + ExtractActiveMotionEventDatas(motion, floatTime, activeEvents); + if (!IsFrameDiscarded(activeEvents)) + { + ImportFrame(motion, floatTime, mirrored); + numFramesImported++; + } + else + { + numFramesDiscarded++; + } + curTime += timeStep; + } + + // Make sure we include the last frame, if we stepped over it. + if (curTime - timeStep < totalTime - 0.000001) + { + const float floatTime = aznumeric_cast(totalTime); + ExtractActiveMotionEventDatas(motion, floatTime, activeEvents); + if (!IsFrameDiscarded(activeEvents)) + { + ImportFrame(motion, floatTime, mirrored); + numFramesImported++; + } + else + { + numFramesDiscarded++; + } + } + + // Automatically shrink the frame storage to their minimum size. + if (settings.m_autoShrink) + { + m_frames.shrink_to_fit(); + } + + // Register the motion. + if (AZStd::find(m_usedMotions.begin(), m_usedMotions.end(), motion) == m_usedMotions.end()) + { + m_usedMotions.emplace_back(motion); + } + + return { numFramesImported, numFramesDiscarded }; + } + + void FrameDatabase::ImportFrame(Motion* motion, float timeValue, bool mirrored) + { + m_frames.emplace_back(Frame(m_frames.size(), motion, timeValue, mirrored)); + m_frameIndexByMotion[motion].emplace_back(m_frames.back().GetFrameIndex()); + } + + size_t FrameDatabase::CalcMemoryUsageInBytes() const + { + size_t total = 0; + + total += m_frames.capacity() * sizeof(Frame); + total += sizeof(m_frames); + total += m_usedMotions.capacity() * sizeof(const Motion*); + total += sizeof(m_usedMotions); + + return total; + } + + size_t FrameDatabase::GetNumFrames() const + { + return m_frames.size(); + } + + size_t FrameDatabase::GetNumUsedMotions() const + { + return m_usedMotions.size(); + } + + const Motion* FrameDatabase::GetUsedMotion(size_t index) const + { + return m_usedMotions[index]; + } + + const Frame& FrameDatabase::GetFrame(size_t index) const + { + AZ_Assert(index < m_frames.size(), "Frame index is out of range!"); + return m_frames[index]; + } + + AZStd::vector& FrameDatabase::GetFrames() + { + return m_frames; + } + + const AZStd::vector& FrameDatabase::GetFrames() const + { + return m_frames; + } + + const AZStd::vector& FrameDatabase::GetUsedMotions() const + { + return m_usedMotions; + } + + size_t FrameDatabase::FindFrameIndex(Motion* motion, float playtime) const + { + auto iterator = m_frameIndexByMotion.find(motion); + if (iterator == m_frameIndexByMotion.end()) + { + return InvalidIndex; + } + + const AZStd::vector& frameIndices = iterator->second; + for (const size_t frameIndex : frameIndices) + { + const Frame& frame = m_frames[frameIndex]; + if (playtime >= frame.GetSampleTime() && + frameIndex + 1 < m_frames.size() && + playtime <= m_frames[frameIndex + 1].GetSampleTime()) + { + return frameIndex; + } + } + + return InvalidIndex; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/FrameDatabase.h b/Gems/MotionMatching/Code/Source/FrameDatabase.h new file mode 100644 index 0000000000..c5258e1b39 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/FrameDatabase.h @@ -0,0 +1,86 @@ +/* + * 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 +#include +#include +#include + +#include +#include +#include + +namespace EMotionFX +{ + class Motion; + class ActorInstance; +} + +namespace EMotionFX::MotionMatching +{ + class MotionMatchingInstance; + class MotionMatchEventData; + + // The motion matching data. + // This is basically a database of frames (which point to motion objects), together with meta data per frame. + // No actual pose data is stored directly inside this class, just references to the right sample times inside specific motions. + class EMFX_API FrameDatabase + { + public: + AZ_RTTI(FrameDatabase, "{3E5ED4F9-8975-41F2-B665-0086368F0DDA}") + AZ_CLASS_ALLOCATOR_DECL + + // The settings used when importing motions into the frame database. + // Used in combination with ImportFrames(). + struct EMFX_API FrameImportSettings + { + size_t m_sampleRate = 30; /**< Sample at 30 frames per second on default. */ + bool m_autoShrink = true; /**< Automatically shrink the internal frame arrays to their minimum size afterwards. */ + }; + + FrameDatabase(); + virtual ~FrameDatabase(); + + // Main functions. + AZStd::tuple ImportFrames(Motion* motion, const FrameImportSettings& settings, bool mirrored); // Returns the number of imported frames and the number of discarded frames as second element. + void Clear(); // Clear the data, so you can re-initialize it with new data. + + // Statistics. + size_t GetNumFrames() const; + size_t GetNumUsedMotions() const; + size_t CalcMemoryUsageInBytes() const; + + // Misc. + const Motion* GetUsedMotion(size_t index) const; + const Frame& GetFrame(size_t index) const; + const AZStd::vector& GetFrames() const; + AZStd::vector& GetFrames(); + const AZStd::vector& GetUsedMotions() const; + size_t GetSampleRate() const { return m_sampleRate; } + + /** + * Find the frame index for the given playtime and motion. + * NOTE: This is a slow operation and should not be used by the runtime without visual debugging. + */ + size_t FindFrameIndex(Motion* motion, float playtime) const; + + private: + void ImportFrame(Motion* motion, float timeValue, bool mirrored); + bool IsFrameDiscarded(const AZStd::vector& activeEventDatas) const; + void ExtractActiveMotionEventDatas(const Motion* motion, float time, AZStd::vector& activeEventDatas); // Vector will be cleared internally. + + private: + AZStd::vector m_frames; /**< The collection of frames. Keep in mind these don't hold a pose, but reference to a given frame/time value inside a given motion. */ + AZStd::unordered_map> m_frameIndexByMotion; + AZStd::vector m_usedMotions; /**< The list of used motions. */ + size_t m_sampleRate = 0; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp b/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp new file mode 100644 index 0000000000..97b666c693 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/ImGuiMonitor.cpp @@ -0,0 +1,144 @@ +/* + * 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 + * + */ + +#ifdef IMGUI_ENABLED +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(ImGuiMonitor, MotionMatchAllocator, 0) + + ImGuiMonitor::ImGuiMonitor() + { + m_performanceStats.m_name = "Performance Statistics"; + + m_featureCosts.m_name = "Feature Costs"; + m_featureCosts.m_histogramContainerCount = 100; + + ImGui::ImGuiUpdateListenerBus::Handler::BusConnect(); + ImGuiMonitorRequestBus::Handler::BusConnect(); + } + + ImGuiMonitor::~ImGuiMonitor() + { + ImGui::ImGuiUpdateListenerBus::Handler::BusDisconnect(); + ImGuiMonitorRequestBus::Handler::BusDisconnect(); + } + + void ImGuiMonitor::OnImGuiUpdate() + { + if (!m_performanceStats.m_show && !m_featureCosts.m_show) + { + return; + } + + if (ImGui::Begin("Motion Matching")) + { + if (ImGui::CollapsingHeader("Feature Matrix", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Text("Memory Usage: %.2f MB", m_featureMatrixMemoryUsageInBytes / 1024.0f / 1024.0f); + ImGui::Text("Num Frames: %zu", m_featureMatrixNumFrames); + ImGui::Text("Num Feature Components: %zu", m_featureMatrixNumComponents); + } + + if (ImGui::CollapsingHeader("Kd-Tree", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + ImGui::Text("Memory Usage: %.2f MB", m_kdTreeMemoryUsageInBytes / 1024.0f / 1024.0f); + ImGui::Text("Num Nodes: %zu", m_kdTreeNumNodes); + ImGui::Text("Num Dimensions: %zu", m_kdTreeNumDimensions); + } + + m_performanceStats.OnImGuiUpdate(); + m_featureCosts.OnImGuiUpdate(); + } + } + + void ImGuiMonitor::OnImGuiMainMenuUpdate() + { + if (ImGui::BeginMenu("Motion Matching")) + { + ImGui::MenuItem(m_performanceStats.m_name.c_str(), "", &m_performanceStats.m_show); + ImGui::MenuItem(m_featureCosts.m_name.c_str(), "", &m_featureCosts.m_show); + ImGui::EndMenu(); + } + } + + void ImGuiMonitor::PushPerformanceHistogramValue(const char* performanceMetricName, float value) + { + m_performanceStats.PushHistogramValue(performanceMetricName, value, AZ::Color::CreateFromRgba(229,56,59,255)); + } + + void ImGuiMonitor::PushCostHistogramValue(const char* costName, float value, const AZ::Color& color) + { + m_featureCosts.PushHistogramValue(costName, value, color); + } + + void ImGuiMonitor::HistogramGroup::PushHistogramValue(const char* valueName, float value, const AZ::Color& color) + { + auto iterator = m_histogramIndexByName.find(valueName); + if (iterator != m_histogramIndexByName.end()) + { + ImGui::LYImGuiUtils::HistogramContainer& histogramContiner = m_histograms[iterator->second]; + histogramContiner.PushValue(value); + histogramContiner.SetBarLineColor(ImColor(color.GetR(), color.GetG(), color.GetB(), color.GetA())); + } + else + { + ImGui::LYImGuiUtils::HistogramContainer newHistogram; + newHistogram.Init(/*histogramName=*/valueName, + /*containerCount=*/m_histogramContainerCount, + /*viewType=*/ImGui::LYImGuiUtils::HistogramContainer::ViewType::Histogram, + /*displayOverlays=*/true, + /*min=*/0.0f, + /*max=*/0.0f); + + newHistogram.SetMoveDirection(ImGui::LYImGuiUtils::HistogramContainer::PushRightMoveLeft); + newHistogram.PushValue(value); + + m_histogramIndexByName[valueName] = m_histograms.size(); + m_histograms.push_back(newHistogram); + } + } + + void ImGuiMonitor::HistogramGroup::OnImGuiUpdate() + { + if (!m_show) + { + return; + } + + if (ImGui::CollapsingHeader(m_name.c_str(), ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + for (auto& histogram : m_histograms) + { + ImGui::BeginGroup(); + { + histogram.Draw(ImGui::GetColumnWidth() - 70, s_histogramHeight); + + ImGui::SameLine(); + + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0,0,0,255)); + { + const ImColor color = histogram.GetBarLineColor(); + ImGui::PushStyleColor(ImGuiCol_Button, color.Value); + { + const AZStd::string valueString = AZStd::string::format("%.2f", histogram.GetLastValue()); + ImGui::Button(valueString.c_str()); + } + ImGui::PopStyleColor(); + } + ImGui::PopStyleColor(); + } + ImGui::EndGroup(); + } + } + } +} // namespace EMotionFX::MotionMatching + +#endif // IMGUI_ENABLED diff --git a/Gems/MotionMatching/Code/Source/ImGuiMonitor.h b/Gems/MotionMatching/Code/Source/ImGuiMonitor.h new file mode 100644 index 0000000000..0583d0ba41 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/ImGuiMonitor.h @@ -0,0 +1,84 @@ +/* + * 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 +#ifdef IMGUI_ENABLED + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +namespace EMotionFX::MotionMatching +{ + class EMFX_API ImGuiMonitor + : public ImGui::ImGuiUpdateListenerBus::Handler + , public ImGuiMonitorRequestBus::Handler + { + public: + AZ_RTTI(ImGuiMonitor, "{BF1B85A4-215C-4E3A-8FD8-CE3233E5C779}") + AZ_CLASS_ALLOCATOR_DECL + + ImGuiMonitor(); + ~ImGuiMonitor(); + + // ImGui::ImGuiUpdateListenerBus::Handler + void OnImGuiUpdate() override; + void OnImGuiMainMenuUpdate() override; + + // ImGuiMonitorRequestBus::Handler + void PushPerformanceHistogramValue(const char* performanceMetricName, float value) override; + void PushCostHistogramValue(const char* costName, float value, const AZ::Color& color) override; + + void SetFeatureMatrixMemoryUsage(size_t sizeInBytes) override { m_featureMatrixMemoryUsageInBytes = sizeInBytes; } + void SetFeatureMatrixNumFrames(size_t numFrames) override { m_featureMatrixNumFrames = numFrames; } + void SetFeatureMatrixNumComponents(size_t numFeatureComponents) override { m_featureMatrixNumComponents = numFeatureComponents; } + + void SetKdTreeMemoryUsage(size_t sizeInBytes) override { m_kdTreeMemoryUsageInBytes = sizeInBytes; } + void SetKdTreeNumNodes(size_t numNodes) override { m_kdTreeNumNodes = numNodes; } + void SetKdTreeNumDimensions(size_t numDimensions) override { m_kdTreeNumDimensions = numDimensions; } + + private: + //! Named and sub-divided group containing several histograms. + struct HistogramGroup + { + void OnImGuiUpdate(); + void PushHistogramValue(const char* valueName, float value, const AZ::Color& color); + + bool m_show = true; + AZStd::string m_name; + using HistogramIndexByNames = AZStd::unordered_map; + HistogramIndexByNames m_histogramIndexByName; + AZStd::vector m_histograms; + int m_histogramContainerCount = 500; + + static constexpr float s_histogramHeight = 95.0f; + }; + + HistogramGroup m_performanceStats; + HistogramGroup m_featureCosts; + + size_t m_featureMatrixMemoryUsageInBytes = 0; + size_t m_featureMatrixNumFrames = 0; + size_t m_featureMatrixNumComponents = 0; + + size_t m_kdTreeMemoryUsageInBytes = 0; + size_t m_kdTreeNumNodes = 0; + size_t m_kdTreeNumDimensions = 0; + }; +} // namespace EMotionFX::MotionMatching + +#endif // IMGUI_ENABLED diff --git a/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h b/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h new file mode 100644 index 0000000000..7c50b317c5 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/ImGuiMonitorBus.h @@ -0,0 +1,37 @@ +/* + * 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 +#include +#include + +namespace EMotionFX::MotionMatching +{ + class ImGuiMonitorRequests + : public AZ::EBusTraits + { + public: + // Enable multi-threaded access by locking primitive using a mutex when connecting handlers to the EBus or executing events. + using MutexType = AZStd::recursive_mutex; + + virtual void PushPerformanceHistogramValue(const char* performanceMetricName, float value) = 0; + virtual void PushCostHistogramValue(const char* costName, float value, const AZ::Color& color) = 0; + + virtual void SetFeatureMatrixMemoryUsage(size_t sizeInBytes) = 0; + virtual void SetFeatureMatrixNumFrames(size_t numFrames) = 0; + virtual void SetFeatureMatrixNumComponents(size_t numFeatureComponents) = 0; + + virtual void SetKdTreeMemoryUsage(size_t sizeInBytes) = 0; + virtual void SetKdTreeNumNodes(size_t numNodes) = 0; + virtual void SetKdTreeNumDimensions(size_t numDimensions) = 0; + }; + using ImGuiMonitorRequestBus = AZ::EBus; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/KdTree.cpp b/Gems/MotionMatching/Code/Source/KdTree.cpp new file mode 100644 index 0000000000..e496f0b63e --- /dev/null +++ b/Gems/MotionMatching/Code/Source/KdTree.cpp @@ -0,0 +1,454 @@ +/* + * 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 EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(KdTree, MotionMatchAllocator, 0) + + KdTree::~KdTree() + { + Clear(); + } + + size_t KdTree::CalcNumDimensions(const AZStd::vector& features) + { + size_t result = 0; + for (Feature* feature : features) + { + if (feature->GetId().IsNull()) + { + continue; + } + + result += feature->GetNumDimensions(); + } + return result; + } + + bool KdTree::Init(const FrameDatabase& frameDatabase, + const FeatureMatrix& featureMatrix, + const AZStd::vector& features, + size_t maxDepth, + size_t minFramesPerLeaf) + { + AZ::Debug::Timer timer; + timer.Stamp(); + + Clear(); + + // Verify the dimensions. + // Going above a 20 dimensional tree would start eating up too much memory. + m_numDimensions = CalcNumDimensions(features); + if (m_numDimensions == 0 || m_numDimensions > 20) + { + AZ_Error("Motion Matching", false, "Cannot initialize KD-tree. KD-tree dimension (%d) has to be between 1 and 20. Please use Feature::SetIncludeInKdTree(false) on some features.", m_numDimensions); + return false; + } + + if (minFramesPerLeaf > 100000) + { + AZ_Error("Motion Matching", false, "KdTree minFramesPerLeaf (%d) cannot be smaller than 100000.", minFramesPerLeaf); + return false; + } + + if (maxDepth == 0) + { + AZ_Error("Motion Matching", false, "KdTree max depth (%d) cannot be zero", maxDepth); + return false; + } + + m_maxDepth = maxDepth; + m_minFramesPerLeaf = minFramesPerLeaf; + + // Build the tree. + m_featureValues.resize(m_numDimensions); + BuildTreeNodes(frameDatabase, featureMatrix, features, new Node(), nullptr, 0); + MergeSmallLeafNodesToParents(); + ClearFramesForNonEssentialNodes(); + RemoveZeroFrameLeafNodes(); + + const float initTime = timer.GetDeltaTimeInSeconds(); + AZ_TracePrintf("EMotionFX", "KdTree initialized in %f seconds (numNodes = %d numDims = %d Memory used = %.2f MB).", + initTime, m_nodes.size(), + m_numDimensions, + static_cast(CalcMemoryUsageInBytes()) / 1024.0f / 1024.0f); + + PrintStats(); + return true; + } + + void KdTree::Clear() + { + // delete all nodes + for (Node* node : m_nodes) + { + delete node; + } + + m_nodes.clear(); + m_featureValues.clear(); + m_numDimensions = 0; + } + + size_t KdTree::CalcMemoryUsageInBytes() const + { + size_t totalBytes = 0; + + for (const Node* node : m_nodes) + { + totalBytes += sizeof(Node); + totalBytes += node->m_frames.capacity() * sizeof(size_t); + } + + totalBytes += m_featureValues.capacity() * sizeof(float); + totalBytes += sizeof(KdTree); + return totalBytes; + } + + bool KdTree::IsInitialized() const + { + return (m_numDimensions != 0); + } + + size_t KdTree::GetNumNodes() const + { + return m_nodes.size(); + } + + size_t KdTree::GetNumDimensions() const + { + return m_numDimensions; + } + + void KdTree::BuildTreeNodes(const FrameDatabase& frameDatabase, + const FeatureMatrix& featureMatrix, + const AZStd::vector& features, + Node* node, + Node* parent, + size_t dimension, + bool leftSide) + { + node->m_parent = parent; + node->m_dimension = dimension; + m_nodes.emplace_back(node); + + // Fill the frames array and calculate the median. + FillFramesForNode(node, frameDatabase, featureMatrix, features, parent, leftSide); + + // Prevent splitting further when we don't want to. + const size_t maxDimensions = AZ::GetMin(m_numDimensions, m_maxDepth); + if (node->m_frames.size() < m_minFramesPerLeaf * 2 || + dimension >= maxDimensions) + { + return; + } + + // Create the left node. + Node* leftNode = new Node(); + AZ_Assert(!node->m_leftNode, "Expected the parent left node to be a nullptr"); + node->m_leftNode = leftNode; + BuildTreeNodes(frameDatabase, featureMatrix, features, leftNode, node, dimension + 1, true); + + // Create the right node. + Node* rightNode = new Node(); + AZ_Assert(!node->m_rightNode, "Expected the parent right node to be a nullptr"); + node->m_rightNode = rightNode; + BuildTreeNodes(frameDatabase, featureMatrix, features, rightNode, node, dimension + 1, false); + } + + void KdTree::ClearFramesForNonEssentialNodes() + { + for (Node* node : m_nodes) + { + if (node->m_leftNode && node->m_rightNode) + { + node->m_frames.clear(); + node->m_frames.shrink_to_fit(); + } + } + } + + void KdTree::RemoveLeafNode(Node* node) + { + Node* parent = node->m_parent; + + if (parent->m_leftNode == node) + { + parent->m_leftNode = nullptr; + } + + if (parent->m_rightNode == node) + { + parent->m_rightNode = nullptr; + } + + // Remove it from the node vector. + const auto location = AZStd::find(m_nodes.begin(), m_nodes.end(), node); + AZ_Assert(location != m_nodes.end(), "Expected to find the item to remove."); + m_nodes.erase(location); + + delete node; + } + + void KdTree::MergeSmallLeafNodesToParents() + { + AZStd::vector nodesToRemove; + for (Node* node : m_nodes) + { + // If we are a leaf node and we don't have enough frames. + if ((!node->m_leftNode && !node->m_rightNode) && + node->m_frames.size() < m_minFramesPerLeaf) + { + nodesToRemove.emplace_back(node); + } + } + + // Remove the actual nodes. + for (Node* node : nodesToRemove) + { + RemoveLeafNode(node); + } + } + + void KdTree::RemoveZeroFrameLeafNodes() + { + AZStd::vector nodesToRemove; + + // Build a list of leaf nodes to remove. + // These are ones that have no feature inside them. + for (Node* node : m_nodes) + { + if ((!node->m_leftNode && !node->m_rightNode) && + node->m_frames.empty()) + { + nodesToRemove.emplace_back(node); + } + } + + // Remove the actual nodes. + for (Node* node : nodesToRemove) + { + RemoveLeafNode(node); + } + } + + void KdTree::FillFramesForNode(Node* node, + const FrameDatabase& frameDatabase, + const FeatureMatrix& featureMatrix, + const AZStd::vector& features, + Node* parent, + bool leftSide) + { + float median = 0.0f; + if (parent) + { + // Assume half of the parent frames are in this node. + node->m_frames.reserve((parent->m_frames.size() / 2) + 1); + + // Add parent frames to this node, but only ones that should be on this side. + for (const size_t frameIndex : parent->m_frames) + { + FillFeatureValues(featureMatrix, features, frameIndex); + + const float value = m_featureValues[parent->m_dimension]; + if (leftSide) + { + if (value <= parent->m_median) + { + node->m_frames.emplace_back(frameIndex); + } + } + else + { + if (value > parent->m_median) + { + node->m_frames.emplace_back(frameIndex); + } + } + + median += value; + } + } + else // We're the root node. + { + node->m_frames.reserve(frameDatabase.GetNumFrames()); + for (const Frame& frame : frameDatabase.GetFrames()) + { + const size_t frameIndex = frame.GetFrameIndex(); + node->m_frames.emplace_back(frameIndex); + FillFeatureValues(featureMatrix, features, frameIndex); + median += m_featureValues[node->m_dimension]; + } + } + + if (!node->m_frames.empty()) + { + median /= static_cast(node->m_frames.size()); + } + node->m_median = median; + } + + void KdTree::FillFeatureValues(const FeatureMatrix& featureMatrix, const Feature* feature, size_t frameIndex, size_t startIndex) + { + const size_t numDimensions = feature->GetNumDimensions(); + const size_t featureColumnOffset = feature->GetColumnOffset(); + for (size_t i = 0; i < numDimensions; ++i) + { + m_featureValues[startIndex + i] = featureMatrix(frameIndex, featureColumnOffset + i); + } + } + + void KdTree::FillFeatureValues(const FeatureMatrix& featureMatrix, const AZStd::vector& features, size_t frameIndex) + { + size_t startDimension = 0; + for (const Feature* feature : features) + { + FillFeatureValues(featureMatrix, feature, frameIndex, startDimension); + startDimension += feature->GetNumDimensions(); + } + } + + void KdTree::RecursiveCalcNumFrames(Node* node, size_t& outNumFrames) const + { + if (node->m_leftNode && node->m_rightNode) + { + RecursiveCalcNumFrames(node->m_leftNode, outNumFrames); + RecursiveCalcNumFrames(node->m_rightNode, outNumFrames); + } + else + { + outNumFrames += node->m_frames.size(); + } + } + + void KdTree::PrintStats() + { + size_t leftNumFrames = 0; + size_t rightNumFrames = 0; + if (m_nodes[0]->m_leftNode) + { + RecursiveCalcNumFrames(m_nodes[0]->m_leftNode, leftNumFrames); + } + + if (m_nodes[0]->m_rightNode) + { + RecursiveCalcNumFrames(m_nodes[0]->m_rightNode, rightNumFrames); + } + + const float numFrames = static_cast(leftNumFrames + rightNumFrames); + const float halfFrames = numFrames / 2.0f; + const float balanceScore = 100.0f - (AZ::GetAbs(halfFrames - static_cast(leftNumFrames)) / numFrames) * 100.0f; + + // Get the maximum depth. + size_t maxDepth = 0; + for (const Node* node : m_nodes) + { + maxDepth = AZ::GetMax(maxDepth, node->m_dimension); + } + + AZ_TracePrintf("EMotionFX", "KdTree Balance Info: leftSide=%d rightSide=%d score=%.2f totalFrames=%d maxDepth=%d", leftNumFrames, rightNumFrames, balanceScore, leftNumFrames + rightNumFrames, maxDepth); + + size_t numLeafNodes = 0; + size_t numZeroNodes = 0; + size_t minFrames = 1000000000; + size_t maxFrames = 0; + for (const Node* node : m_nodes) + { + if (node->m_leftNode || node->m_rightNode) + { + continue; + } + + numLeafNodes++; + + if (node->m_frames.empty()) + { + numZeroNodes++; + } + + AZ_TracePrintf("EMotionFX", "Frames = %d", node->m_frames.size()); + + minFrames = AZ::GetMin(minFrames, node->m_frames.size()); + maxFrames = AZ::GetMax(maxFrames, node->m_frames.size()); + } + + const size_t avgFrames = (leftNumFrames + rightNumFrames) / numLeafNodes; + AZ_TracePrintf("EMotionFX", "KdTree Node Info: leafs=%d avgFrames=%d zeroFrames=%d minFrames=%d maxFrames=%d", numLeafNodes, avgFrames, numZeroNodes, minFrames, maxFrames); + } + + void KdTree::FindNearestNeighbors(const AZStd::vector& frameFloats, AZStd::vector& resultFrameIndices) const + { + AZ_Assert(IsInitialized() && !m_nodes.empty(), "Expecting a valid and initialized kdTree. Did you forget to call KdTree::Init()?"); + Node* curNode = m_nodes[0]; + + // Step as far as we need to through the kdTree. + Node* nodeToSearch = nullptr; + const size_t numDimensions = frameFloats.size(); + for (size_t d = 0; d < numDimensions; ++d) + { + AZ_Assert(curNode->m_dimension == d, "Dimension mismatch"); + + // We have children in both directions. + if (curNode->m_leftNode && curNode->m_rightNode) + { + curNode = (frameFloats[d] <= curNode->m_median) ? curNode->m_leftNode : curNode->m_rightNode; + } + else if (!curNode->m_leftNode && !curNode->m_rightNode) // we have a leaf node + { + nodeToSearch = curNode; + } + else + { + // We have both a left and right node, so we're not at a leaf yet. + if (curNode->m_leftNode) + { + if (frameFloats[d] <= curNode->m_median) + { + curNode = curNode->m_leftNode; + } + else + { + nodeToSearch = curNode; + } + } + else // We have a right node. + { + if (frameFloats[d] > curNode->m_median) + { + curNode = curNode->m_rightNode; + } + else + { + nodeToSearch = curNode; + } + } + } + + // If we found our search node, perform a linear search through the frames inside this node. + if (nodeToSearch) + { + //AZ_Assert(d == nodeToSearch->m_dimension, "Dimension mismatch inside kdTree nearest neighbor search."); + FindNearestNeighbors(nodeToSearch, frameFloats, resultFrameIndices); + return; + } + } + + FindNearestNeighbors(curNode, frameFloats, resultFrameIndices); + } + + void KdTree::FindNearestNeighbors([[maybe_unused]] Node* node, [[maybe_unused]] const AZStd::vector& frameFloats, AZStd::vector& resultFrameIndices) const + { + resultFrameIndices = node->m_frames; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/KdTree.h b/Gems/MotionMatching/Code/Source/KdTree.h new file mode 100644 index 0000000000..8b62788c32 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/KdTree.h @@ -0,0 +1,95 @@ +/* + * 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 + +#include + +#include +#include +#include + +namespace EMotionFX::MotionMatching +{ + class KdTree + { + public: + AZ_RTTI(KdTree, "{CDA707EC-4150-463B-8157-90D98351ACED}") + AZ_CLASS_ALLOCATOR_DECL + + KdTree() = default; + virtual ~KdTree(); + + bool Init(const FrameDatabase& frameDatabase, + const FeatureMatrix& featureMatrix, + const AZStd::vector& features, + size_t maxDepth=10, + size_t minFramesPerLeaf=1000); + + /** + * Calculate the number of dimensions or values for the given feature set. + * Each feature might store one or multiple values inside the feature matrix and the number of + * values each feature holds varies with the feature type. This calculates the sum of the number of + * values of the given feature set. + */ + static size_t CalcNumDimensions(const AZStd::vector& features); + + void Clear(); + void PrintStats(); + + size_t GetNumNodes() const; + size_t GetNumDimensions() const; + size_t CalcMemoryUsageInBytes() const; + bool IsInitialized() const; + + void FindNearestNeighbors(const AZStd::vector& frameFloats, AZStd::vector& resultFrameIndices) const; + + private: + struct Node + { + Node* m_leftNode = nullptr; + Node* m_rightNode = nullptr; + Node* m_parent = nullptr; + float m_median = 0.0f; + size_t m_dimension = 0; + AZStd::vector m_frames; + }; + + void BuildTreeNodes(const FrameDatabase& frameDatabase, + const FeatureMatrix& featureMatrix, + const AZStd::vector& features, + Node* node, + Node* parent, + size_t dimension = 0, + bool leftSide = true); + void FillFeatureValues(const FeatureMatrix& featureMatrix, const Feature* feature, size_t frameIndex, size_t startIndex); + void FillFeatureValues(const FeatureMatrix& featureMatrix, const AZStd::vector& features, size_t frameIndex); + void FillFramesForNode(Node* node, + const FrameDatabase& frameDatabase, + const FeatureMatrix& featureMatrix, + const AZStd::vector& features, + Node* parent, + bool leftSide); + void RecursiveCalcNumFrames(Node* node, size_t& outNumFrames) const; + void ClearFramesForNonEssentialNodes(); + void MergeSmallLeafNodesToParents(); + void RemoveZeroFrameLeafNodes(); + void RemoveLeafNode(Node* node); + void FindNearestNeighbors(Node* node, const AZStd::vector& frameFloats, AZStd::vector& resultFrameIndices) const; + + private: + AZStd::vector m_nodes; + AZStd::vector m_featureValues; + size_t m_numDimensions = 0; + size_t m_maxDepth = 20; + size_t m_minFramesPerLeaf = 1000; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingData.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingData.cpp new file mode 100644 index 0000000000..1ce891c98b --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingData.cpp @@ -0,0 +1,181 @@ +/* + * 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 + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(MotionMatchingData, MotionMatchAllocator, 0) + + MotionMatchingData::MotionMatchingData(const FeatureSchema& featureSchema) + : m_featureSchema(featureSchema) + { + m_kdTree = AZStd::make_unique(); + } + + MotionMatchingData::~MotionMatchingData() + { + Clear(); + } + + bool MotionMatchingData::ExtractFeatures(ActorInstance* actorInstance, FrameDatabase* frameDatabase, size_t maxKdTreeDepth, size_t minFramesPerKdTreeNode) + { + AZ_PROFILE_SCOPE(Animation, "MotionMatchingData::ExtractFeatures"); + AZ::Debug::Timer timer; + timer.Stamp(); + + const size_t numFrames = frameDatabase->GetNumFrames(); + if (numFrames == 0) + { + return true; + } + + // Initialize all features before we process each frame. + FeatureMatrix::Index featureComponentCount = 0; + for (Feature* feature : m_featureSchema.GetFeatures()) + { + Feature::InitSettings frameSettings; + frameSettings.m_actorInstance = actorInstance; + if (!feature->Init(frameSettings)) + { + return false; + } + + feature->SetColumnOffset(featureComponentCount); + featureComponentCount += feature->GetNumDimensions(); + } + + const auto& frames = frameDatabase->GetFrames(); + + // Allocate memory for the feature matrix + m_featureMatrix.resize(/*rows=*/numFrames, /*columns=*/featureComponentCount); + + // Iterate over all frames and extract the data for this frame. + AnimGraphPosePool& posePool = GetEMotionFX().GetThreadData(actorInstance->GetThreadIndex())->GetPosePool(); + AnimGraphPose* pose = posePool.RequestPose(actorInstance); + + Feature::ExtractFeatureContext context(m_featureMatrix); + context.m_frameDatabase = frameDatabase; + context.m_framePose = &pose->GetPose(); + context.m_actorInstance = actorInstance; + + for (const Frame& frame : frames) + { + context.m_frameIndex = frame.GetFrameIndex(); + + // Pre-sample the frame pose as that will be needed by many of the feature extraction calculations. + frame.SamplePose(const_cast(context.m_framePose)); + + // Extract all features for the given frame. + { + for (Feature* feature : m_featureSchema.GetFeatures()) + { + feature->ExtractFeatureValues(context); + } + } + } + + posePool.FreePose(pose); + + const float extractFeaturesTime = timer.GetDeltaTimeInSeconds(); + timer.Stamp(); + + // Initialize the kd-tree used to accelerate the searches. + if (!m_kdTree->Init(*frameDatabase, m_featureMatrix, m_featuresInKdTree, maxKdTreeDepth, minFramesPerKdTreeNode)) // Internally automatically clears any existing contents. + { + AZ_Error("EMotionFX", false, "Failed to initialize KdTree acceleration structure."); + return false; + } + + const float initKdTreeTimer = timer.GetDeltaTimeInSeconds(); + + AZ_Printf("MotionMatching", "Feature matrix (%zu, %zu) uses %.2f MB and took %.2f ms to initialize (KD-Tree %.2f ms).", + m_featureMatrix.rows(), + m_featureMatrix.cols(), + static_cast(m_featureMatrix.CalcMemoryUsageInBytes()) / 1024.0f / 1024.0f, + extractFeaturesTime * 1000.0f, + initKdTreeTimer * 1000.0f); + + return true; + } + + bool MotionMatchingData::Init(const InitSettings& settings) + { + AZ_PROFILE_SCOPE(Animation, "MotionMatchingData::Init"); + + // Import all motion frames. + size_t totalNumFramesImported = 0; + size_t totalNumFramesDiscarded = 0; + for (Motion* motion : settings.m_motionList) + { + size_t numFrames = 0; + size_t numDiscarded = 0; + std::tie(numFrames, numDiscarded) = m_frameDatabase.ImportFrames(motion, settings.m_frameImportSettings, false); + totalNumFramesImported += numFrames; + totalNumFramesDiscarded += numDiscarded; + + if (settings.m_importMirrored) + { + std::tie(numFrames, numDiscarded) = m_frameDatabase.ImportFrames(motion, settings.m_frameImportSettings, true); + totalNumFramesImported += numFrames; + totalNumFramesDiscarded += numDiscarded; + } + } + + if (totalNumFramesImported > 0 || totalNumFramesDiscarded > 0) + { + AZ_TracePrintf("Motion Matching", "Imported a total of %d frames (%d frames discarded) across %d motions. This is %.2f seconds (%.2f minutes) of motion data.", + totalNumFramesImported, + totalNumFramesDiscarded, + settings.m_motionList.size(), + totalNumFramesImported / (float)settings.m_frameImportSettings.m_sampleRate, + (totalNumFramesImported / (float)settings.m_frameImportSettings.m_sampleRate) / 60.0f); + } + + // Use all features other than the trajectory for the broad-phase search using the KD-Tree. + for (Feature* feature : m_featureSchema.GetFeatures()) + { + if (feature->RTTI_GetType() != azrtti_typeid()) + { + m_featuresInKdTree.push_back(feature); + } + } + + // Extract feature data and place the values into the feature matrix. + if (!ExtractFeatures(settings.m_actorInstance, &m_frameDatabase, settings.m_maxKdTreeDepth, settings.m_minFramesPerKdTreeNode)) + { + AZ_Error("Motion Matching", false, "Failed to extract features from motion database."); + return false; + } + + return true; + } + + void MotionMatchingData::Clear() + { + m_frameDatabase.Clear(); + m_featureMatrix.Clear(); + m_kdTree->Clear(); + m_featuresInKdTree.clear(); + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingData.h b/Gems/MotionMatching/Code/Source/MotionMatchingData.h new file mode 100644 index 0000000000..15748bb849 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingData.h @@ -0,0 +1,74 @@ +/* + * 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 +#include + +#include + +#include +#include +#include +#include + +namespace AZ +{ + class ReflectContext; +} + +namespace EMotionFX +{ + class ActorInstance; +} + +namespace EMotionFX::MotionMatching +{ + class EMFX_API MotionMatchingData + { + public: + AZ_RTTI(MotionMatchingData, "{7BC3DFF5-8864-4518-B6F0-0553ADFAB5C1}") + AZ_CLASS_ALLOCATOR_DECL + + MotionMatchingData(const FeatureSchema& featureSchema); + virtual ~MotionMatchingData(); + + struct EMFX_API InitSettings + { + ActorInstance* m_actorInstance = nullptr; + AZStd::vector m_motionList; + FrameDatabase::FrameImportSettings m_frameImportSettings; + size_t m_maxKdTreeDepth = 20; + size_t m_minFramesPerKdTreeNode = 1000; + bool m_importMirrored = false; + }; + bool Init(const InitSettings& settings); + + void Clear(); + + const FrameDatabase& GetFrameDatabase() const { return m_frameDatabase; } + FrameDatabase& GetFrameDatabase() { return m_frameDatabase; } + const FeatureSchema& GetFeatureSchema() const { return m_featureSchema; } + const FeatureMatrix& GetFeatureMatrix() const { return m_featureMatrix; } + const KdTree& GetKdTree() const { return *m_kdTree.get(); } + const AZStd::vector& GetFeaturesInKdTree() const { return m_featuresInKdTree; } + + protected: + bool ExtractFeatures(ActorInstance* actorInstance, FrameDatabase* frameDatabase, size_t maxKdTreeDepth=20, size_t minFramesPerKdTreeNode=2000); + + FrameDatabase m_frameDatabase; /**< The animation database with all the keyframes and joint transform data. */ + + const FeatureSchema& m_featureSchema; + FeatureMatrix m_featureMatrix; + + AZStd::unique_ptr m_kdTree; /**< The acceleration structure to speed up the search for lowest cost frames. */ + AZStd::vector m_featuresInKdTree; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingEditorModule.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingEditorModule.cpp new file mode 100644 index 0000000000..fce6957901 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingEditorModule.cpp @@ -0,0 +1,40 @@ +/* + * 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 + +namespace EMotionFX::MotionMatching +{ + class MotionMatchingEditorModule + : public MotionMatchingModuleInterface + { + public: + AZ_RTTI(MotionMatchingEditorModule, "{cf4381d1-0207-4ef8-85f0-6c88ec28a7b6}", MotionMatchingModuleInterface); + AZ_CLASS_ALLOCATOR(MotionMatchingEditorModule, AZ::SystemAllocator, 0); + + MotionMatchingEditorModule() + { + m_descriptors.insert(m_descriptors.end(), + { + MotionMatchingEditorSystemComponent::CreateDescriptor(), + }); + } + + /// Add required SystemComponents to the SystemEntity. Non-SystemComponents should not be added here. + AZ::ComponentTypeList GetRequiredSystemComponents() const override + { + return AZ::ComponentTypeList + { + azrtti_typeid(), + }; + } + }; +}// namespace EMotionFX::MotionMatching + +AZ_DECLARE_MODULE_CLASS(Gem_MotionMatching, EMotionFX::MotionMatching::MotionMatchingEditorModule) diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.cpp new file mode 100644 index 0000000000..d8f0079a59 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.cpp @@ -0,0 +1,60 @@ +/* + * 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 + +namespace EMotionFX::MotionMatching +{ + void MotionMatchingEditorSystemComponent::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0); + } + } + + MotionMatchingEditorSystemComponent::MotionMatchingEditorSystemComponent() = default; + + MotionMatchingEditorSystemComponent::~MotionMatchingEditorSystemComponent() = default; + + void MotionMatchingEditorSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + BaseSystemComponent::GetProvidedServices(provided); + provided.push_back(AZ_CRC_CE("MotionMatchingEditorService")); + } + + void MotionMatchingEditorSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + { + BaseSystemComponent::GetIncompatibleServices(incompatible); + incompatible.push_back(AZ_CRC_CE("MotionMatchingEditorService")); + } + + void MotionMatchingEditorSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required) + { + BaseSystemComponent::GetRequiredServices(required); + } + + void MotionMatchingEditorSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent) + { + BaseSystemComponent::GetDependentServices(dependent); + } + + void MotionMatchingEditorSystemComponent::Activate() + { + MotionMatchingSystemComponent::Activate(); + AzToolsFramework::EditorEvents::Bus::Handler::BusConnect(); + } + + void MotionMatchingEditorSystemComponent::Deactivate() + { + AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect(); + MotionMatchingSystemComponent::Deactivate(); + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.h b/Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.h new file mode 100644 index 0000000000..a9d3bb528f --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingEditorSystemComponent.h @@ -0,0 +1,40 @@ +/* + * 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 EMotionFX::MotionMatching +{ + /// System component for MotionMatching editor + class MotionMatchingEditorSystemComponent + : public MotionMatchingSystemComponent + , private AzToolsFramework::EditorEvents::Bus::Handler + { + using BaseSystemComponent = MotionMatchingSystemComponent; + public: + AZ_COMPONENT(MotionMatchingEditorSystemComponent, "{a43957d3-5a2d-4c29-873d-7daacc357722}", BaseSystemComponent); + static void Reflect(AZ::ReflectContext* context); + + MotionMatchingEditorSystemComponent(); + ~MotionMatchingEditorSystemComponent(); + + private: + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); + + // AZ::Component + void Activate() override; + void Deactivate() override; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp new file mode 100644 index 0000000000..54fc2918e6 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.cpp @@ -0,0 +1,571 @@ +/* + * 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 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(MotionMatchingInstance, MotionMatchAllocator, 0) + + MotionMatchingInstance::~MotionMatchingInstance() + { + if (m_motionInstance) + { + GetMotionInstancePool().Free(m_motionInstance); + } + + if (m_prevMotionInstance) + { + GetMotionInstancePool().Free(m_prevMotionInstance); + } + } + + MotionInstance* MotionMatchingInstance::CreateMotionInstance() const + { + MotionInstance* result = GetMotionInstancePool().RequestNew(m_data->GetFrameDatabase().GetFrame(0).GetSourceMotion(), m_actorInstance); + return result; + } + + void MotionMatchingInstance::Init(const InitSettings& settings) + { + AZ_Assert(settings.m_actorInstance, "The actor instance cannot be a nullptr."); + AZ_Assert(settings.m_data, "The motion match data cannot be nullptr."); + + // Update the cached pointer to the trajectory feature. + const FeatureSchema& featureSchema = settings.m_data->GetFeatureSchema(); + for (Feature* feature : featureSchema.GetFeatures()) + { + if (feature->RTTI_GetType() == azrtti_typeid()) + { + m_cachedTrajectoryFeature = static_cast(feature); + break; + } + } + + // Debug display initialization. + const auto AddDebugDisplay = [=](AZ::s32 debugDisplayId) + { + if (debugDisplayId == -1) + { + return; + } + + AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus; + AzFramework::DebugDisplayRequestBus::Bind(debugDisplayBus, debugDisplayId); + + AzFramework::DebugDisplayRequests* debugDisplay = AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); + if (debugDisplay) + { + m_debugDisplays.emplace_back(debugDisplay); + } + }; + // Draw the debug visualizations to the Animation Editor as well as the LY Editor viewport. + AZ::s32 animationEditorViewportId = -1; + EMStudio::ViewportPluginRequestBus::BroadcastResult(animationEditorViewportId, &EMStudio::ViewportPluginRequestBus::Events::GetViewportId); + AddDebugDisplay(animationEditorViewportId); + AddDebugDisplay(AzFramework::g_defaultSceneEntityDebugDisplayId); + + m_actorInstance = settings.m_actorInstance; + m_data = settings.m_data; + if (settings.m_data->GetFrameDatabase().GetNumFrames() == 0) + { + return; + } + + if (!m_motionInstance) + { + m_motionInstance = CreateMotionInstance(); + } + + if (!m_prevMotionInstance) + { + m_prevMotionInstance = CreateMotionInstance(); + } + + m_blendSourcePose.LinkToActorInstance(m_actorInstance); + m_blendSourcePose.InitFromBindPose(m_actorInstance); + + m_blendTargetPose.LinkToActorInstance(m_actorInstance); + m_blendTargetPose.InitFromBindPose(m_actorInstance); + + m_queryPose.LinkToActorInstance(m_actorInstance); + m_queryPose.InitFromBindPose(m_actorInstance); + + // Make sure we have enough space inside the frame floats array, which is used to search the kdTree. + const size_t numValuesInKdTree = m_data->GetKdTree().GetNumDimensions(); + m_queryFeatureValues.resize(numValuesInKdTree); + + // Initialize the trajectory history. + size_t rootJointIndex = m_actorInstance->GetActor()->GetMotionExtractionNodeIndex(); + if (rootJointIndex == InvalidIndex32) + { + rootJointIndex = 0; + } + m_trajectoryHistory.Init(*m_actorInstance->GetTransformData()->GetCurrentPose(), + rootJointIndex, + m_cachedTrajectoryFeature->GetFacingAxisDir(), + m_trajectorySecsToTrack); + } + + void MotionMatchingInstance::DebugDraw() + { + if (m_data && !m_debugDisplays.empty()) + { + for (AzFramework::DebugDisplayRequests* debugDisplay : m_debugDisplays) + { + if (debugDisplay) + { + const AZ::u32 prevState = debugDisplay->GetState(); + DebugDraw(*debugDisplay); + debugDisplay->SetState(prevState); + } + } + } + } + + void MotionMatchingInstance::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay) + { + AZ_PROFILE_SCOPE(Animation, "MotionMatchingInstance::DebugDraw"); + + // Get the lowest cost frame index from the last search. As we're searching the feature database with a much lower + // frequency and sample the animation onwards from this, the resulting frame index does not represent the current + // feature values from the shown pose. + const size_t curFrameIndex = GetLowestCostFrameIndex(); + if (curFrameIndex == InvalidIndex) + { + return; + } + + const FrameDatabase& frameDatabase = m_data->GetFrameDatabase(); + const FeatureSchema& featureSchema = m_data->GetFeatureSchema(); + + // Find the frame index in the frame database that belongs to the currently used pose. + const size_t currentFrame = frameDatabase.FindFrameIndex(m_motionInstance->GetMotion(), m_motionInstance->GetCurrentTime()); + + // Render the feature debug visualizations for the current frame. + if (currentFrame != InvalidIndex) + { + for (Feature* feature: featureSchema.GetFeatures()) + { + if (feature->GetDebugDrawEnabled()) + { + feature->DebugDraw(debugDisplay, this, currentFrame); + } + } + } + + // Draw the desired future trajectory and the sampled version of the past trajectory. + const AZ::Color trajectoryQueryColor = AZ::Color::CreateFromRgba(90,219,64,255); + m_trajectoryQuery.DebugDraw(debugDisplay, trajectoryQueryColor); + + // Draw the trajectory history starting after the sampled version of the past trajectory. + m_trajectoryHistory.DebugDraw(debugDisplay, trajectoryQueryColor, m_cachedTrajectoryFeature->GetPastTimeRange()); + } + + void MotionMatchingInstance::SamplePose(MotionInstance* motionInstance, Pose& outputPose) + { + const Pose* bindPose = m_actorInstance->GetTransformData()->GetBindPose(); + motionInstance->GetMotion()->Update(bindPose, &outputPose, motionInstance); + if (m_actorInstance->GetActor()->GetMotionExtractionNode() && m_actorInstance->GetMotionExtractionEnabled()) + { + outputPose.CompensateForMotionExtraction(); + } + } + + void MotionMatchingInstance::SamplePose(Motion* motion, Pose& outputPose, float sampleTime) const + { + MotionDataSampleSettings sampleSettings; + sampleSettings.m_actorInstance = outputPose.GetActorInstance(); + sampleSettings.m_inPlace = false; + sampleSettings.m_mirror = false; + sampleSettings.m_retarget = false; + sampleSettings.m_inputPose = sampleSettings.m_actorInstance->GetTransformData()->GetBindPose(); + + sampleSettings.m_sampleTime = sampleTime; + sampleSettings.m_sampleTime = AZ::GetClamp(sampleTime, 0.0f, motion->GetDuration()); + + motion->SamplePose(&outputPose, sampleSettings); + } + + void MotionMatchingInstance::PostUpdate([[maybe_unused]] float timeDelta) + { + if (!m_data) + { + m_motionExtractionDelta.Identity(); + return; + } + + const size_t lowestCostFrame = GetLowestCostFrameIndex(); + if (m_data->GetFrameDatabase().GetNumFrames() == 0 || lowestCostFrame == InvalidIndex) + { + m_motionExtractionDelta.Identity(); + return; + } + + // Blend the motion extraction deltas. + // Note: Make sure to update the previous as well as the current/target motion instances. + if (m_blendWeight >= 1.0f - AZ::Constants::FloatEpsilon) + { + m_motionInstance->ExtractMotion(m_motionExtractionDelta); + } + else if (m_blendWeight > AZ::Constants::FloatEpsilon && m_blendWeight < 1.0f - AZ::Constants::FloatEpsilon) + { + Transform targetMotionExtractionDelta; + m_motionInstance->ExtractMotion(m_motionExtractionDelta); + m_prevMotionInstance->ExtractMotion(targetMotionExtractionDelta); + m_motionExtractionDelta.Blend(targetMotionExtractionDelta, m_blendWeight); + } + else + { + m_prevMotionInstance->ExtractMotion(m_motionExtractionDelta); + } + } + + void MotionMatchingInstance::Output(Pose& outputPose) + { + AZ_PROFILE_SCOPE(Animation, "MotionMatchingInstance::Output"); + + if (!m_data) + { + outputPose.InitFromBindPose(m_actorInstance); + return; + } + + const size_t lowestCostFrame = GetLowestCostFrameIndex(); + if (m_data->GetFrameDatabase().GetNumFrames() == 0 || lowestCostFrame == InvalidIndex) + { + outputPose.InitFromBindPose(m_actorInstance); + return; + } + + // Sample the motions and blend the results when needed. + if (m_blendWeight >= 1.0f - AZ::Constants::FloatEpsilon) + { + m_blendTargetPose.InitFromBindPose(m_actorInstance); + if (m_motionInstance) + { + SamplePose(m_motionInstance, m_blendTargetPose); + } + outputPose = m_blendTargetPose; + } + else if (m_blendWeight > AZ::Constants::FloatEpsilon && m_blendWeight < 1.0f - AZ::Constants::FloatEpsilon) + { + m_blendSourcePose.InitFromBindPose(m_actorInstance); + m_blendTargetPose.InitFromBindPose(m_actorInstance); + if (m_motionInstance) + { + SamplePose(m_motionInstance, m_blendTargetPose); + } + if (m_prevMotionInstance) + { + SamplePose(m_prevMotionInstance, m_blendSourcePose); + } + + outputPose = m_blendSourcePose; + outputPose.Blend(&m_blendTargetPose, m_blendWeight); + } + else + { + m_blendSourcePose.InitFromBindPose(m_actorInstance); + if (m_prevMotionInstance) + { + SamplePose(m_prevMotionInstance, m_blendSourcePose); + } + outputPose = m_blendSourcePose; + } + } + + void MotionMatchingInstance::Update(float timePassedInSeconds, const AZ::Vector3& targetPos, const AZ::Vector3& targetFacingDir, TrajectoryQuery::EMode mode, float pathRadius, float pathSpeed) + { + AZ_PROFILE_SCOPE(Animation, "MotionMatchingInstance::Update"); + + if (!m_data) + { + return; + } + + size_t currentFrameIndex = GetLowestCostFrameIndex(); + if (currentFrameIndex == InvalidIndex) + { + currentFrameIndex = 0; + } + + // Add the sample from the last frame (post-motion extraction) + m_trajectoryHistory.AddSample(*m_actorInstance->GetTransformData()->GetCurrentPose()); + // Update the time. After this there is no sample for the updated time in the history as we're about to prepare this with the current update. + m_trajectoryHistory.Update(timePassedInSeconds); + + // Register the current actor instance position to the history data of the spline. + m_trajectoryQuery.Update(m_actorInstance, + m_cachedTrajectoryFeature, + m_trajectoryHistory, + mode, + targetPos, + targetFacingDir, + timePassedInSeconds, + pathRadius, + pathSpeed); + + // Calculate the new time value of the motion, but don't set it yet (the syncing might adjust this again) + m_motionInstance->SetFreezeAtLastFrame(true); + m_motionInstance->SetMaxLoops(1); + const float newMotionTime = m_motionInstance->CalcPlayStateAfterUpdate(timePassedInSeconds).m_currentTime; + m_newMotionTime = newMotionTime; + + // Keep on playing the previous instance as we're blending the poses and motion extraction deltas. + m_prevMotionInstance->Update(timePassedInSeconds); + + m_timeSinceLastFrameSwitch += timePassedInSeconds; + + const float lowestCostSearchTimeInterval = 1.0f / m_lowestCostSearchFrequency; + + if (m_blending) + { + const float maxBlendTime = lowestCostSearchTimeInterval; + m_blendProgressTime += timePassedInSeconds; + if (m_blendProgressTime > maxBlendTime) + { + m_blendWeight = 1.0f; + m_blendProgressTime = maxBlendTime; + m_blending = false; + } + else + { + m_blendWeight = AZ::GetClamp(m_blendProgressTime / maxBlendTime, 0.0f, 1.0f); + } + } + + const bool searchLowestCostFrame = m_timeSinceLastFrameSwitch >= lowestCostSearchTimeInterval; + if (searchLowestCostFrame) + { + // Calculate the input query pose for the motion matching search algorithm. + { + // Sample the pose for the new motion time as the motion instance has not been updated with the timeDelta from this frame yet. + SamplePose(m_motionInstance->GetMotion(), m_queryPose, newMotionTime); + + // Copy over the motion extraction joint transform from the current pose to the newly sampled pose. + // When sampling a motion, the motion extraction joint is in animation space, while we need the query pose to be in + // world space. + // Note: This does not yet take the extraction delta from the current tick into account. + if (m_actorInstance->GetActor()->GetMotionExtractionNode()) + { + const Pose* currentPose = m_actorInstance->GetTransformData()->GetCurrentPose(); + const size_t motionExtractionJointIndex = m_actorInstance->GetActor()->GetMotionExtractionNodeIndex(); + m_queryPose.SetWorldSpaceTransform(motionExtractionJointIndex, + currentPose->GetWorldSpaceTransform(motionExtractionJointIndex)); + } + + // Calculate the joint velocities for the sampled pose using the same method as we do for the frame database. + PoseDataJointVelocities* velocityPoseData = m_queryPose.GetAndPreparePoseData(m_actorInstance); + velocityPoseData->CalculateVelocity(m_motionInstance, m_cachedTrajectoryFeature->GetRelativeToNodeIndex()); + } + + const FeatureMatrix& featureMatrix = m_data->GetFeatureMatrix(); + const FrameDatabase& frameDatabase = m_data->GetFrameDatabase(); + + Feature::FrameCostContext frameCostContext(featureMatrix, m_queryPose); + frameCostContext.m_trajectoryQuery = &m_trajectoryQuery; + frameCostContext.m_actorInstance = m_actorInstance; + const size_t lowestCostFrameIndex = FindLowestCostFrameIndex(frameCostContext); + + const Frame& currentFrame = frameDatabase.GetFrame(currentFrameIndex); + const Frame& lowestCostFrame = frameDatabase.GetFrame(lowestCostFrameIndex); + const bool sameMotion = (currentFrame.GetSourceMotion() == lowestCostFrame.GetSourceMotion()); + const float timeBetweenFrames = newMotionTime - lowestCostFrame.GetSampleTime(); + const bool sameLocation = sameMotion && (AZ::GetAbs(timeBetweenFrames) < 0.1f); + + if (lowestCostFrameIndex != currentFrameIndex && !sameLocation) + { + // Start a blend. + m_blending = true; + m_blendWeight = 0.0f; + m_blendProgressTime = 0.0f; + + // Store the current motion instance state, so we can sample this as source pose. + m_prevMotionInstance->SetMotion(m_motionInstance->GetMotion()); + m_prevMotionInstance->SetMirrorMotion(m_motionInstance->GetMirrorMotion()); + m_prevMotionInstance->SetCurrentTime(newMotionTime, true); + m_prevMotionInstance->SetLastCurrentTime(m_prevMotionInstance->GetCurrentTime() - timePassedInSeconds); + + m_lowestCostFrameIndex = lowestCostFrameIndex; + + m_motionInstance->SetMotion(lowestCostFrame.GetSourceMotion()); + m_motionInstance->SetMirrorMotion(lowestCostFrame.GetMirrored()); + + // The new motion time will become the current time after this frame while the current time + // becomes the last current time. As we just start playing at the search frame, calculate + // the last time based on the time delta. + m_motionInstance->SetCurrentTime(lowestCostFrame.GetSampleTime() - timePassedInSeconds, true); + m_newMotionTime = lowestCostFrame.GetSampleTime(); + } + + // Do this always, else wise we search for the lowest cost frame index too many times. + m_timeSinceLastFrameSwitch = 0.0f; + } + + // ImGui monitor + { +#ifdef IMGUI_ENABLED + const KdTree& kdTree = m_data->GetKdTree(); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeMemoryUsage, kdTree.CalcMemoryUsageInBytes()); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeNumNodes, kdTree.GetNumNodes()); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetKdTreeNumDimensions, kdTree.GetNumDimensions()); + // TODO: add memory usage for frame database + + const FeatureMatrix& featureMatrix = m_data->GetFeatureMatrix(); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixMemoryUsage, featureMatrix.CalcMemoryUsageInBytes()); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixNumFrames, featureMatrix.rows()); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::SetFeatureMatrixNumComponents, featureMatrix.cols()); +#endif + } + } + + size_t MotionMatchingInstance::FindLowestCostFrameIndex(const Feature::FrameCostContext& context) + { + AZ::Debug::Timer timer; + timer.Stamp(); + + AZ_PROFILE_SCOPE(Animation, "MotionMatchingInstance::FindLowestCostFrameIndex"); + + const FrameDatabase& frameDatabase = m_data->GetFrameDatabase(); + const FeatureSchema& featureSchema = m_data->GetFeatureSchema(); + const FeatureTrajectory* trajectoryFeature = m_cachedTrajectoryFeature; + + // 1. Broad-phase search using KD-tree + { + // Build the input query features that will be compared to every entry in the feature database in the motion matching search. + size_t startOffset = 0; + for (Feature* feature : m_data->GetFeaturesInKdTree()) + { + feature->FillQueryFeatureValues(startOffset, m_queryFeatureValues, context); + startOffset += feature->GetNumDimensions(); + } + AZ_Assert(startOffset == m_queryFeatureValues.size(), "Frame float vector is not the expected size."); + + // Find our nearest frames. + m_data->GetKdTree().FindNearestNeighbors(m_queryFeatureValues, m_nearestFrames); + } + + // 2. Narrow-phase, brute force find the actual best matching frame (frame with the minimal cost). + float minCost = FLT_MAX; + size_t minCostFrameIndex = 0; + m_tempCosts.resize(featureSchema.GetNumFeatures()); + m_minCosts.resize(featureSchema.GetNumFeatures()); + float minTrajectoryPastCost = 0.0f; + float minTrajectoryFutureCost = 0.0f; + + // Iterate through the frames filtered by the broad-phase search. + for (const size_t frameIndex : m_nearestFrames) + { + const Frame& frame = frameDatabase.GetFrame(frameIndex); + + // TODO: This shouldn't be there, we should be discarding the frames when extracting the features and not at runtime when checking the cost. + if (frame.GetSampleTime() >= frame.GetSourceMotion()->GetDuration() - 1.0f) + { + continue; + } + + float frameCost = 0.0f; + + // Calculate the frame cost by accumulating the weighted feature costs. + for (size_t featureIndex = 0; featureIndex < featureSchema.GetNumFeatures(); ++featureIndex) + { + Feature* feature = featureSchema.GetFeature(featureIndex); + if (feature->RTTI_GetType() != azrtti_typeid()) + { + const float featureCost = feature->CalculateFrameCost(frameIndex, context); + const float featureCostFactor = feature->GetCostFactor(); + const float featureFinalCost = featureCost * featureCostFactor; + + frameCost += featureFinalCost; + m_tempCosts[featureIndex] = featureFinalCost; + } + } + + // Manually add the trajectory cost. + float trajectoryPastCost = 0.0f; + float trajectoryFutureCost = 0.0f; + if (trajectoryFeature) + { + trajectoryPastCost = trajectoryFeature->CalculatePastFrameCost(frameIndex, context) * trajectoryFeature->GetPastCostFactor(); + trajectoryFutureCost = trajectoryFeature->CalculateFutureFrameCost(frameIndex, context) * trajectoryFeature->GetFutureCostFactor(); + frameCost += trajectoryPastCost; + frameCost += trajectoryFutureCost; + } + + // Track the minimum feature and frame costs. + if (frameCost < minCost) + { + minCost = frameCost; + minCostFrameIndex = frameIndex; + + for (size_t featureIndex = 0; featureIndex < featureSchema.GetNumFeatures(); ++featureIndex) + { + Feature* feature = featureSchema.GetFeature(featureIndex); + if (feature->RTTI_GetType() != azrtti_typeid()) + { + m_minCosts[featureIndex] = m_tempCosts[featureIndex]; + } + } + + minTrajectoryPastCost = trajectoryPastCost; + minTrajectoryFutureCost = trajectoryFutureCost; + } + } + + // 3. ImGui debug visualization + { + const float time = timer.GetDeltaTimeInSeconds(); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushPerformanceHistogramValue, "FindLowestCostFrameIndex", time * 1000.0f); + + for (size_t featureIndex = 0; featureIndex < featureSchema.GetNumFeatures(); ++featureIndex) + { + Feature* feature = featureSchema.GetFeature(featureIndex); + if (feature->RTTI_GetType() != azrtti_typeid()) + { + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushCostHistogramValue, + feature->GetName().c_str(), + m_minCosts[featureIndex], + feature->GetDebugDrawColor()); + } + } + + if (trajectoryFeature) + { + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushCostHistogramValue, "Future Trajectory", minTrajectoryFutureCost, trajectoryFeature->GetDebugDrawColor()); + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushCostHistogramValue, "Past Trajectory", minTrajectoryPastCost, trajectoryFeature->GetDebugDrawColor()); + } + + ImGuiMonitorRequestBus::Broadcast(&ImGuiMonitorRequests::PushCostHistogramValue, "Total Cost", minCost, AZ::Color::CreateFromRgba(202,255,191,255)); + } + + return minCostFrameIndex; + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h new file mode 100644 index 0000000000..49c781162d --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingInstance.h @@ -0,0 +1,116 @@ +/* + * 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 +#include + +#include + +#include +#include +#include +#include + +namespace AZ +{ + class ReflectContext; +} + +namespace EMotionFX +{ + class ActorInstance; + class Motion; +} + +namespace EMotionFX::MotionMatching +{ + class MotionMatchingData; + + class EMFX_API MotionMatchingInstance + { + public: + AZ_RTTI(MotionMatchingInstance, "{1ED03AD8-0FB2-431B-AF01-02F7E930EB73}") + AZ_CLASS_ALLOCATOR_DECL + + virtual ~MotionMatchingInstance(); + + struct EMFX_API InitSettings + { + ActorInstance* m_actorInstance = nullptr; + MotionMatchingData* m_data = nullptr; + }; + void Init(const InitSettings& settings); + + void DebugDraw(); + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay); + + void Update(float timePassedInSeconds, const AZ::Vector3& targetPos, const AZ::Vector3& targetFacingDir, TrajectoryQuery::EMode mode, float pathRadius, float pathSpeed); + void PostUpdate(float timeDelta); + void Output(Pose& outputPose); + + MotionInstance* GetMotionInstance() const { return m_motionInstance; } + ActorInstance* GetActorInstance() const { return m_actorInstance; } + MotionMatchingData* GetData() const { return m_data; } + + size_t GetLowestCostFrameIndex() const { return m_lowestCostFrameIndex; } + void SetLowestCostSearchFrequency(float frequency) { m_lowestCostSearchFrequency = frequency; } + float GetNewMotionTime() const { return m_newMotionTime; } + + /** + * Get the cached trajectory feature. + * The trajectory feature is searched in the feature schema used in the current instance at init time. + */ + FeatureTrajectory* GetTrajectoryFeature() const { return m_cachedTrajectoryFeature; } + const TrajectoryQuery& GetTrajectoryQuery() const { return m_trajectoryQuery; } + const TrajectoryHistory& GetTrajectoryHistory() const { return m_trajectoryHistory; } + const Transform& GetMotionExtractionDelta() const { return m_motionExtractionDelta; } + + private: + MotionInstance* CreateMotionInstance() const; + void SamplePose(MotionInstance* motionInstance, Pose& outputPose); + void SamplePose(Motion* motion, Pose& outputPose, float sampleTime) const; + + size_t FindLowestCostFrameIndex(const Feature::FrameCostContext& context); + + MotionMatchingData* m_data = nullptr; + ActorInstance* m_actorInstance = nullptr; + Pose m_blendSourcePose; + Pose m_blendTargetPose; + Pose m_queryPose; //! Input query pose for the motion matching search. + MotionInstance* m_motionInstance = nullptr; + MotionInstance* m_prevMotionInstance = nullptr; + Transform m_motionExtractionDelta = Transform::CreateIdentity(); + + /// Buffers used for the broad-phase KD-tree search. + AZStd::vector m_queryFeatureValues; /** The input query features to be compared to every entry/row in the feature matrix with the motion matching search. */ + AZStd::vector m_nearestFrames; /** Stores the nearest matching frames / search result from the KD-tree. */ + + FeatureTrajectory* m_cachedTrajectoryFeature = nullptr; /** Cached pointer to the trajectory feature in the feature schema. */ + TrajectoryQuery m_trajectoryQuery; + TrajectoryHistory m_trajectoryHistory; + static constexpr float m_trajectorySecsToTrack = 5.0f; + + float m_timeSinceLastFrameSwitch = 0.0f; + float m_newMotionTime = 0.0f; + size_t m_lowestCostFrameIndex = InvalidIndex; + float m_lowestCostSearchFrequency = 5.0f; //< How often the lowest cost frame shall be searched per second. + + bool m_blending = false; + float m_blendWeight = 1.0f; + float m_blendProgressTime = 0.0f; // How long are we already blending? In seconds. + + /// Buffers used for FindLowestCostFrameIndex(). + AZStd::vector m_tempCosts; + AZStd::vector m_minCosts; + + AZStd::vector m_debugDisplays; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingModule.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingModule.cpp new file mode 100644 index 0000000000..bc29172bb5 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingModule.cpp @@ -0,0 +1,23 @@ +/* + * 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 + +namespace EMotionFX::MotionMatching +{ + class MotionMatchingModule + : public MotionMatchingModuleInterface + { + public: + AZ_RTTI(MotionMatchingModule, "{cf4381d1-0207-4ef8-85f0-6c88ec28a7b6}", MotionMatchingModuleInterface); + AZ_CLASS_ALLOCATOR(MotionMatchingModule, AZ::SystemAllocator, 0); + }; +}// namespace EMotionFX::MotionMatching + +AZ_DECLARE_MODULE_CLASS(Gem_MotionMatching, EMotionFX::MotionMatching::MotionMatchingModule) diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingModuleInterface.h b/Gems/MotionMatching/Code/Source/MotionMatchingModuleInterface.h new file mode 100644 index 0000000000..e2110263f5 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingModuleInterface.h @@ -0,0 +1,39 @@ +/* + * 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 EMotionFX::MotionMatching +{ + class MotionMatchingModuleInterface + : public AZ::Module + { + public: + AZ_RTTI(MotionMatchingModuleInterface, "{33e8e826-b143-4008-89f3-9a46ad3de4fe}", AZ::Module); + AZ_CLASS_ALLOCATOR(MotionMatchingModuleInterface, AZ::SystemAllocator, 0); + + MotionMatchingModuleInterface() + { + m_descriptors.insert(m_descriptors.end(), + { + MotionMatchingSystemComponent::CreateDescriptor(), + }); + } + + /// Add required SystemComponents to the SystemEntity. + AZ::ComponentTypeList GetRequiredSystemComponents() const override + { + return AZ::ComponentTypeList + { + azrtti_typeid(), + }; + } + }; +}// namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp new file mode 100644 index 0000000000..073362d741 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.cpp @@ -0,0 +1,128 @@ +/* + * 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 +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace EMotionFX::MotionMatching +{ + void MotionMatchingSystemComponent::Reflect(AZ::ReflectContext* context) + { + if (AZ::SerializeContext* serialize = azrtti_cast(context)) + { + serialize->Class() + ->Version(0) + ; + + if (AZ::EditContext* ec = serialize->GetEditContext()) + { + ec->Class("MotionMatching", "[Description of functionality provided by this System Component]") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System")) + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ; + } + } + + EMotionFX::MotionMatching::DiscardFrameEventData::Reflect(context); + EMotionFX::MotionMatching::TagEventData::Reflect(context); + + EMotionFX::MotionMatching::FeatureSchema::Reflect(context); + EMotionFX::MotionMatching::Feature::Reflect(context); + EMotionFX::MotionMatching::FeaturePosition::Reflect(context); + EMotionFX::MotionMatching::FeatureTrajectory::Reflect(context); + EMotionFX::MotionMatching::FeatureVelocity::Reflect(context); + + EMotionFX::MotionMatching::PoseDataJointVelocities::Reflect(context); + + EMotionFX::MotionMatching::BlendTreeMotionMatchNode::Reflect(context); + } + + void MotionMatchingSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC_CE("MotionMatchingService")); + } + + void MotionMatchingSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC_CE("MotionMatchingService")); + } + + void MotionMatchingSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required) + { + required.push_back(AZ_CRC("EMotionFXAnimationService", 0x3f8a6369)); + } + + void MotionMatchingSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent) + { + } + + MotionMatchingSystemComponent::MotionMatchingSystemComponent() + { + if (MotionMatchingInterface::Get() == nullptr) + { + MotionMatchingInterface::Register(this); + } + } + + MotionMatchingSystemComponent::~MotionMatchingSystemComponent() + { + if (MotionMatchingInterface::Get() == this) + { + MotionMatchingInterface::Unregister(this); + } + } + + void MotionMatchingSystemComponent::Init() + { + } + + void MotionMatchingSystemComponent::Activate() + { + MotionMatchingRequestBus::Handler::BusConnect(); + AZ::TickBus::Handler::BusConnect(); + + // Register the motion matching anim graph node + EMotionFX::AnimGraphObject* motionMatchNodeObject = EMotionFX::AnimGraphObjectFactory::Create(azrtti_typeid()); + auto motionMatchNode = azdynamic_cast(motionMatchNodeObject); + if (motionMatchNode) + { + EMotionFX::Integration::EMotionFXRequestBus::Broadcast(&EMotionFX::Integration::EMotionFXRequests::RegisterAnimGraphObjectType, motionMatchNode); + delete motionMatchNode; + } + + // Register the joint velocities pose data. + EMotionFX::GetPoseDataFactory().AddPoseDataType(azrtti_typeid()); + } + + void MotionMatchingSystemComponent::Deactivate() + { + AZ::TickBus::Handler::BusDisconnect(); + MotionMatchingRequestBus::Handler::BusDisconnect(); + } + + void MotionMatchingSystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + { + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h new file mode 100644 index 0000000000..6a5b5a7b73 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/MotionMatchingSystemComponent.h @@ -0,0 +1,51 @@ +/* + * 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 +#include + +namespace EMotionFX::MotionMatching +{ + class MotionMatchingSystemComponent + : public AZ::Component + , protected MotionMatchingRequestBus::Handler + , public AZ::TickBus::Handler + { + public: + AZ_COMPONENT(MotionMatchingSystemComponent, "{158cd35c-b548-4d7b-9493-9a3c5c359e49}"); + + static void Reflect(AZ::ReflectContext* context); + + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); + + MotionMatchingSystemComponent(); + ~MotionMatchingSystemComponent(); + + protected: + //////////////////////////////////////////////////////////////////////// + // MotionMatchingRequestBus interface implementation + + //////////////////////////////////////////////////////////////////////// + // AZ::Component interface implementation + void Init() override; + void Activate() override; + void Deactivate() override; + //////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////// + // AZTickBus interface implementation + void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + //////////////////////////////////////////////////////////////////////// + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/PoseDataJointVelocities.cpp b/Gems/MotionMatching/Code/Source/PoseDataJointVelocities.cpp new file mode 100644 index 0000000000..b74e8d9df7 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/PoseDataJointVelocities.cpp @@ -0,0 +1,160 @@ +/* + * 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 +#include +#include + +namespace EMotionFX::MotionMatching +{ + AZ_CLASS_ALLOCATOR_IMPL(PoseDataJointVelocities, MotionMatchAllocator, 0) + + PoseDataJointVelocities::PoseDataJointVelocities() + : PoseData() + { + } + + PoseDataJointVelocities::~PoseDataJointVelocities() + { + Clear(); + } + + void PoseDataJointVelocities::Clear() + { + m_velocities.clear(); + m_angularVelocities.clear(); + } + + void PoseDataJointVelocities::LinkToActorInstance(const ActorInstance* actorInstance) + { + m_velocities.resize(actorInstance->GetNumNodes()); + m_angularVelocities.resize(actorInstance->GetNumNodes()); + + SetRelativeToJointIndex(actorInstance->GetActor()->GetMotionExtractionNodeIndex()); + } + + void PoseDataJointVelocities::SetRelativeToJointIndex(size_t relativeToJointIndex) + { + if (relativeToJointIndex == InvalidIndex) + { + m_relativeToJointIndex = 0; + } + else + { + m_relativeToJointIndex = relativeToJointIndex; + } + } + + void PoseDataJointVelocities::LinkToActor(const Actor* actor) + { + AZ_UNUSED(actor); + Clear(); + } + + void PoseDataJointVelocities::Reset() + { + const size_t numJoints = m_velocities.size(); + for (size_t i = 0; i < numJoints; ++i) + { + m_velocities[i] = AZ::Vector3::CreateZero(); + m_angularVelocities[i] = AZ::Vector3::CreateZero(); + } + } + + void PoseDataJointVelocities::CopyFrom(const PoseData* from) + { + AZ_Assert(from->RTTI_GetType() == azrtti_typeid(), "Cannot copy from pose data other than joint velocity pose data."); + const PoseDataJointVelocities* fromVelocityPoseData = static_cast(from); + + m_isUsed = fromVelocityPoseData->m_isUsed; + m_velocities = fromVelocityPoseData->m_velocities; + m_angularVelocities = fromVelocityPoseData->m_angularVelocities; + m_relativeToJointIndex = fromVelocityPoseData->m_relativeToJointIndex; + } + + void PoseDataJointVelocities::Blend(const Pose* destPose, float weight) + { + PoseDataJointVelocities* destPoseData = destPose->GetPoseData(); + + if (destPoseData && destPoseData->IsUsed()) + { + AZ_Assert(m_velocities.size() == destPoseData->m_velocities.size(), "Expected the same number of joints and velocities in the destination pose data."); + + if (m_isUsed) + { + // Blend while both, the destination pose as well as the current pose hold joint velocities. + for (size_t i = 0; i < m_velocities.size(); ++i) + { + m_velocities[i] = m_velocities[i].Lerp(destPoseData->m_velocities[i], weight); + m_angularVelocities[i] = m_angularVelocities[i].Lerp(destPoseData->m_angularVelocities[i], weight); + } + } + else + { + // The destination pose data is used while the current one is not. Just copy over the velocities from the destination. + m_velocities = destPoseData->m_velocities; + m_angularVelocities = destPoseData->m_angularVelocities; + } + } + else + { + // Destination pose either doesn't contain velocity pose data or it is unused. + // Don't do anything and keep the current velocities. + } + } + + void PoseDataJointVelocities::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color) const + { + AZ_Assert(m_pose->GetNumTransforms() == m_velocities.size(), "Expected a joint velocity for each joint in the pose."); + + const Pose* pose = m_pose; + for (size_t i = 0; i < m_velocities.size(); ++i) + { + const size_t jointIndex = i; + + // draw linear velocity + { + const Transform jointModelTM = pose->GetModelSpaceTransform(jointIndex); + const Transform relativeToWorldTM = pose->GetWorldSpaceTransform(m_relativeToJointIndex); + const AZ::Vector3 jointPosition = relativeToWorldTM.TransformPoint(jointModelTM.m_position); + + const AZ::Vector3& velocity = m_velocities[i]; + + const float scale = 0.15f; + const AZ::Vector3 velocityWorldSpace = relativeToWorldTM.TransformVector(velocity * scale); + + DebugDrawVelocity(debugDisplay, jointPosition, velocityWorldSpace, color); + } + } + } + + void PoseDataJointVelocities::CalculateVelocity(MotionInstance* motionInstance, size_t relativeToJointIndex) + { + SetRelativeToJointIndex(relativeToJointIndex); + ActorInstance* actorInstance = motionInstance->GetActorInstance(); + m_velocities.resize(actorInstance->GetNumNodes()); + m_angularVelocities.resize(actorInstance->GetNumNodes()); + for (size_t i = 0; i < m_velocities.size(); ++i) + { + Feature::CalculateVelocity(i, m_relativeToJointIndex, motionInstance, m_velocities[i]); + // TODO: Angular velocity not used yet. + } + } + + void PoseDataJointVelocities::Reflect(AZ::ReflectContext* context) + { + AZ::SerializeContext* serializeContext = azrtti_cast(context); + if (serializeContext) + { + serializeContext->Class()->Version(1); + } + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/PoseDataJointVelocities.h b/Gems/MotionMatching/Code/Source/PoseDataJointVelocities.h new file mode 100644 index 0000000000..68404b41ec --- /dev/null +++ b/Gems/MotionMatching/Code/Source/PoseDataJointVelocities.h @@ -0,0 +1,60 @@ +/* + * 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 +#include +#include + +namespace EMotionFX::MotionMatching +{ + /** + * Extends a given pose with joint-relative linear and angular velocities. + **/ + class EMFX_API PoseDataJointVelocities + : public PoseData + { + public: + AZ_RTTI(PoseDataJointVelocities, "{9C082B82-7225-4550-A52C-C920CCC2482C}", PoseData) + AZ_CLASS_ALLOCATOR_DECL + + PoseDataJointVelocities(); + ~PoseDataJointVelocities(); + + void Clear(); + + void LinkToActorInstance(const ActorInstance* actorInstance) override; + void LinkToActor(const Actor* actor) override; + void Reset() override; + + void CopyFrom(const PoseData* from) override; + void Blend(const Pose* destPose, float weight) override; + + void CalculateVelocity(MotionInstance* motionInstance, size_t relativeToJointIndex); + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color) const override; + + AZStd::vector& GetVelocities() { return m_velocities; } + const AZStd::vector& GetVelocities() const { return m_velocities; } + const AZ::Vector3& GetVelocity(size_t jointIndex) { return m_velocities[jointIndex]; } + + AZStd::vector& GetAngularVelocities() { return m_angularVelocities; } + const AZStd::vector& GetAngularVelocities() const { return m_angularVelocities; } + const AZ::Vector3& GetAngularVelocity(size_t jointIndex) { return m_angularVelocities[jointIndex]; } + + static void Reflect(AZ::ReflectContext* context); + + void SetRelativeToJointIndex(size_t relativeToJointIndex); + + private: + AZStd::vector m_velocities; + AZStd::vector m_angularVelocities; + size_t m_relativeToJointIndex = InvalidIndex; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/TrajectoryHistory.cpp b/Gems/MotionMatching/Code/Source/TrajectoryHistory.cpp new file mode 100644 index 0000000000..3a5adedf48 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/TrajectoryHistory.cpp @@ -0,0 +1,167 @@ +/* + * 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 EMotionFX::MotionMatching +{ + TrajectoryHistory::Sample operator*(TrajectoryHistory::Sample sample, float weight) + { + return {sample.m_position * weight, sample.m_facingDirection * weight}; + } + + TrajectoryHistory::Sample operator*(float weight, TrajectoryHistory::Sample sample) + { + return {weight * sample.m_position, weight * sample.m_facingDirection}; + } + + TrajectoryHistory::Sample operator+(TrajectoryHistory::Sample lhs, const TrajectoryHistory::Sample& rhs) + { + return {lhs.m_position + rhs.m_position, lhs.m_facingDirection + rhs.m_facingDirection}; + } + + void TrajectoryHistory::Init(const Pose& pose, size_t jointIndex, const AZ::Vector3& facingAxisDir, float numSecondsToTrack) + { + AZ_Assert(numSecondsToTrack > 0.0f, "Number of seconds to track has to be greater than zero."); + Clear(); + m_jointIndex = jointIndex; + m_facingAxisDir = facingAxisDir; + m_numSecondsToTrack = numSecondsToTrack; + + // Pre-fill the history with samples from the current joint position. + PrefillSamples(pose, /*timeDelta=*/1.0f / 60.0f); + } + + void TrajectoryHistory::AddSample(const Pose& pose) + { + Sample sample; + const Transform worldSpaceTransform = pose.GetWorldSpaceTransform(m_jointIndex); + sample.m_position = worldSpaceTransform.m_position; + sample.m_facingDirection = worldSpaceTransform.TransformVector(m_facingAxisDir).GetNormalizedSafe(); + + // The new key will be added at the end of the keytrack. + m_keytrack.AddKey(m_currentTime, sample); + + while (m_keytrack.GetNumKeys() > 2 && + ((m_keytrack.GetKey(m_keytrack.GetNumKeys() - 2)->GetTime() - m_keytrack.GetFirstTime()) > m_numSecondsToTrack)) + { + m_keytrack.RemoveKey(0); // Remove first (oldest) key + } + } + + void TrajectoryHistory::PrefillSamples(const Pose& pose, float timeDelta) + { + const size_t numKeyframes = aznumeric_caster<>(m_numSecondsToTrack / timeDelta); + for (size_t i = 0; i < numKeyframes; ++i) + { + AddSample(pose); + Update(timeDelta); + } + } + + void TrajectoryHistory::Clear() + { + m_jointIndex = 0; + m_currentTime = 0.0f; + m_keytrack.ClearKeys(); + } + + void TrajectoryHistory::Update(float timeDelta) + { + m_currentTime += timeDelta; + } + + TrajectoryHistory::Sample TrajectoryHistory::Evaluate(float time) const + { + if (m_keytrack.GetNumKeys() == 0) + { + return {}; + } + + return m_keytrack.GetValueAtTime(m_keytrack.GetLastTime() - time); + } + + TrajectoryHistory::Sample TrajectoryHistory::EvaluateNormalized(float normalizedTime) const + { + const float firstTime = m_keytrack.GetFirstTime(); + const float lastTime = m_keytrack.GetLastTime(); + const float range = lastTime - firstTime; + + const float time = (1.0f - normalizedTime) * range + firstTime; + return m_keytrack.GetValueAtTime(time); + } + + void TrajectoryHistory::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, float timeStart) const + { + const size_t numKeyframes = m_keytrack.GetNumKeys(); + if (numKeyframes == 0) + { + return; + } + + // Clip some of the newest samples. + const float adjustedLastTime = m_keytrack.GetLastTime() - timeStart; + size_t adjustedLastKey = m_keytrack.FindKeyNumber(adjustedLastTime); + if (adjustedLastKey == InvalidIndex) + { + adjustedLastKey = m_keytrack.GetNumKeys() - 1; + } + const float firstTime = m_keytrack.GetFirstTime(); + const float range = adjustedLastTime - firstTime; + + debugDisplay.DepthTestOff(); + + for (size_t i = 0; i < adjustedLastKey; ++i) + { + const float time = m_keytrack.GetKey(i)->GetTime(); + const float normalized = (time - firstTime) / range; + if (normalized < 0.3f) + { + continue; + } + + // Decrease size and fade out alpha the older the sample is. + AZ::Color finalColor = color; + finalColor.SetA(finalColor.GetA() * 0.6f * normalized); + const float markerSize = m_debugMarkerSize * 0.7f * normalized; + + const Sample currentSample = m_keytrack.GetKey(i)->GetValue(); + debugDisplay.SetColor(finalColor); + debugDisplay.DrawBall(currentSample.m_position, markerSize, /*drawShaded=*/false); + + const float facingDirectionLength = m_debugMarkerSize * 10.0f * normalized; + debugDisplay.DrawLine(currentSample.m_position, currentSample.m_position + currentSample.m_facingDirection * facingDirectionLength); + } + } + + void TrajectoryHistory::DebugDrawSampled(AzFramework::DebugDisplayRequests& debugDisplay, + size_t numSamples, + const AZ::Color& color) const + { + debugDisplay.DepthTestOff(); + debugDisplay.SetColor(color); + + Sample lastSample = EvaluateNormalized(0.0f); + for (size_t i = 0; i < numSamples; ++i) + { + const float sampleTime = i / static_cast(numSamples - 1); + const Sample currentSample = EvaluateNormalized(sampleTime); + if (i > 0) + { + debugDisplay.DrawLine(lastSample.m_position, currentSample.m_position); + } + + debugDisplay.DrawBall(currentSample.m_position, m_debugMarkerSize, /*drawShaded=*/false); + + lastSample = currentSample; + } + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/TrajectoryHistory.h b/Gems/MotionMatching/Code/Source/TrajectoryHistory.h new file mode 100644 index 0000000000..833125d27f --- /dev/null +++ b/Gems/MotionMatching/Code/Source/TrajectoryHistory.h @@ -0,0 +1,63 @@ +/* + * 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 + +#include + +#include +#include + +namespace EMotionFX::MotionMatching +{ + //! Used to store the trajectory history for the root motion (motion extraction node). + //! The trajectory history is independent of the trajectory feature and captures a sample with every engine tick. + //! The recorded history needs to record and track at least the time the trajectory feature/query requires. + class EMFX_API TrajectoryHistory + { + public: + void Init(const Pose& pose, size_t jointIndex, const AZ::Vector3& facingAxisDir, float numSecondsToTrack); + void Clear(); + + void Update(float timeDelta); + void AddSample(const Pose& pose); + + struct EMFX_API Sample + { + AZ::Vector3 m_position = AZ::Vector3::CreateZero(); + AZ::Vector3 m_facingDirection = AZ::Vector3::CreateZero(); + }; + + //! time in range [0, m_numSecondsToTrack] + Sample Evaluate(float time) const; + + //! time in range [0, 1] where 0 is the current character position and 1 the oldest keyframe in the trajectory history + Sample EvaluateNormalized(float normalizedTime) const; + + float GetNumSecondsToTrack() const { return m_numSecondsToTrack; } + float GetCurrentTime() const { return m_currentTime; } + size_t GetJointIndex() const { return m_jointIndex; } + + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, float timeStart = 0.0f) const; + void DebugDrawSampled(AzFramework::DebugDisplayRequests& debugDisplay, size_t numSamples, const AZ::Color& color) const; + + private: + void PrefillSamples(const Pose& pose, float timeDelta); + + KeyTrackLinearDynamic m_keytrack; + float m_numSecondsToTrack = 0.0f; + size_t m_jointIndex = 0; + float m_currentTime = 0.0f; + AZ::Vector3 m_facingAxisDir; //! Facing direction of the character asset. (e.g. 0,1,0 when it is looking towards Y-axis) + + static constexpr float m_debugMarkerSize = 0.02f; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/TrajectoryQuery.cpp b/Gems/MotionMatching/Code/Source/TrajectoryQuery.cpp new file mode 100644 index 0000000000..803623a1af --- /dev/null +++ b/Gems/MotionMatching/Code/Source/TrajectoryQuery.cpp @@ -0,0 +1,163 @@ +/* + * 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 EMotionFX::MotionMatching +{ + AZ::Vector3 SampleFunction(TrajectoryQuery::EMode mode, float offset, float radius, float phase) + { + switch (mode) + { + case TrajectoryQuery::MODE_TWO: + { + AZ::Vector3 displacement = AZ::Vector3::CreateZero(); + displacement.SetX(radius * sinf(phase + offset) ); + displacement.SetY(cosf(phase + offset)); + return displacement; + } + + case TrajectoryQuery::MODE_THREE: + { + AZ::Vector3 displacement = AZ::Vector3::CreateZero(); + const float rad = radius * cosf(radius + phase*0.2f); + displacement.SetX(rad * sinf(phase + offset)); + displacement.SetY(rad * cosf(phase + offset)); + return displacement; + } + + case TrajectoryQuery::MODE_FOUR: + { + AZ::Vector3 displacement = AZ::Vector3::CreateZero(); + displacement.SetX(radius * sinf(phase + offset)); + displacement.SetY(radius*2.0f * cosf(phase + offset)); + return displacement; + } + + // MODE_ONE and default + default: + { + AZ::Vector3 displacement = AZ::Vector3::CreateZero(); + displacement.SetX(radius * sinf(phase * 0.7f + offset) + radius * 0.75f * cosf(phase * 2.0f + offset * 2.0f)); + displacement.SetY(radius * cosf(phase * 0.4f + offset)); + return displacement; + } + } + } + + void TrajectoryQuery::Update(const ActorInstance* actorInstance, + const FeatureTrajectory* trajectoryFeature, + const TrajectoryHistory& trajectoryHistory, + EMode mode, + [[maybe_unused]] AZ::Vector3 targetPos, + [[maybe_unused]] AZ::Vector3 targetFacingDir, + float timeDelta, + float pathRadius, + float pathSpeed) + { + // Build the future trajectory control points. + const size_t numFutureSamples = trajectoryFeature->GetNumFutureSamples(); + m_futureControlPoints.resize(numFutureSamples); + + if (mode == MODE_TARGETDRIVEN) + { + const AZ::Vector3 curPos = actorInstance->GetWorldSpaceTransform().m_position; + if (curPos.IsClose(targetPos, 0.1f)) + { + for (size_t i = 0; i < numFutureSamples; ++i) + { + m_futureControlPoints[i].m_position = curPos; + } + } + else + { + // NOTE: Improve it by using a curve to the target. + for (size_t i = 0; i < numFutureSamples; ++i) + { + const float sampleTime = static_cast(i) / (numFutureSamples - 1); + m_futureControlPoints[i].m_position = curPos.Lerp(targetPos, sampleTime); + } + } + } + else + { + static float phase = 0.0f; + phase += timeDelta * pathSpeed; + AZ::Vector3 base = SampleFunction(mode, 0.0f, pathRadius, phase); + for (size_t i = 0; i < numFutureSamples; ++i) + { + const float offset = i * 0.1f; + const AZ::Vector3 curSample = SampleFunction(mode, offset, pathRadius, phase); + AZ::Vector3 displacement = curSample - base; + m_futureControlPoints[i].m_position = actorInstance->GetWorldSpaceTransform().m_position + displacement; + + // Evaluate a control point slightly further into the future than the actual + // one and use the position difference as the facing direction. + const AZ::Vector3 deltaSample = SampleFunction(mode, offset + 0.01f, pathRadius, phase); + const AZ::Vector3 dir = deltaSample - curSample; + m_futureControlPoints[i].m_facingDirection = dir.GetNormalizedSafe(); + } + } + + // Build the past trajectory control points. + const size_t numPastSamples = trajectoryFeature->GetNumPastSamples(); + m_pastControlPoints.resize(numPastSamples); + const float pastTimeRange = trajectoryFeature->GetPastTimeRange(); + + for (size_t i = 0; i < numPastSamples; ++i) + { + const float sampleTimeNormalized = i / static_cast(numPastSamples - 1); + const TrajectoryHistory::Sample sample = trajectoryHistory.Evaluate(sampleTimeNormalized * pastTimeRange); + m_pastControlPoints[i] = { sample.m_position, sample.m_facingDirection }; + } + } + + void TrajectoryQuery::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color) const + { + DebugDrawControlPoints(debugDisplay, m_pastControlPoints, color); + DebugDrawControlPoints(debugDisplay, m_futureControlPoints, color); + } + + void TrajectoryQuery::DebugDrawControlPoints(AzFramework::DebugDisplayRequests& debugDisplay, + const AZStd::vector& controlPoints, + const AZ::Color& color) + { + const float markerSize = 0.02f; + + const size_t numControlPoints = controlPoints.size(); + if (numControlPoints > 1) + { + debugDisplay.DepthTestOff(); + debugDisplay.SetColor(color); + + for (size_t i = 0; i < numControlPoints - 1; ++i) + { + const ControlPoint& current = controlPoints[i]; + const AZ::Vector3& posA = current.m_position; + const AZ::Vector3& posB = controlPoints[i + 1].m_position; + const AZ::Vector3 diff = posB - posA; + + debugDisplay.DrawSolidCylinder(/*center=*/(posB + posA) * 0.5f, + /*direction=*/diff.GetNormalizedSafe(), + /*radius=*/0.0025f, + /*height=*/diff.GetLength(), + /*drawShaded=*/false); + + FeatureTrajectory::DebugDrawFacingDirection(debugDisplay, current.m_position, current.m_facingDirection); + } + + for (const ControlPoint& controlPoint : controlPoints) + { + debugDisplay.DrawBall(controlPoint.m_position, markerSize, /*drawShaded=*/false); + FeatureTrajectory::DebugDrawFacingDirection(debugDisplay, controlPoint.m_position, controlPoint.m_facingDirection); + } + } + } +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Source/TrajectoryQuery.h b/Gems/MotionMatching/Code/Source/TrajectoryQuery.h new file mode 100644 index 0000000000..55d9ecf797 --- /dev/null +++ b/Gems/MotionMatching/Code/Source/TrajectoryQuery.h @@ -0,0 +1,68 @@ +/* + * 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 + +#include + +#include + +#include + +namespace EMotionFX::MotionMatching +{ + class FeatureTrajectory; + + //! Builds the input trajectory query data for the motion matching algorithm. + //! Reads the number of past and future samples and the time ranges from the trajectory feature, + //! constructs the future trajectory based on the target and the past trajectory based on the trajectory history. + class EMFX_API TrajectoryQuery + { + public: + struct ControlPoint + { + AZ::Vector3 m_position; + AZ::Vector3 m_facingDirection; + }; + + enum EMode : AZ::u8 + { + MODE_TARGETDRIVEN = 0, + MODE_ONE = 1, + MODE_TWO = 2, + MODE_THREE = 3, + MODE_FOUR = 4 + }; + + void Update(const ActorInstance* actorInstance, + const FeatureTrajectory* trajectoryFeature, + const TrajectoryHistory& trajectoryHistory, + EMode mode, + AZ::Vector3 targetPos, + AZ::Vector3 targetFacingDir, + float timeDelta, + float pathRadius, + float pathSpeed); + + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color) const; + + const AZStd::vector& GetPastControlPoints() const { return m_pastControlPoints; } + const AZStd::vector& GetFutureControlPoints() const { return m_futureControlPoints; } + + private: + static void DebugDrawControlPoints(AzFramework::DebugDisplayRequests& debugDisplay, + const AZStd::vector& controlPoints, + const AZ::Color& color); + + AZStd::vector m_pastControlPoints; + AZStd::vector m_futureControlPoints; + }; +} // namespace EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Tests/FeatureMatrixTests.cpp b/Gems/MotionMatching/Code/Tests/FeatureMatrixTests.cpp new file mode 100644 index 0000000000..cfbb888580 --- /dev/null +++ b/Gems/MotionMatching/Code/Tests/FeatureMatrixTests.cpp @@ -0,0 +1,62 @@ +/* + * 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 + +namespace EMotionFX::MotionMatching +{ + class FeatureMatrixFixture + : public Fixture + { + public: + void SetUp() override + { + Fixture::SetUp(); + + // Construct 3x3 matrix: + // 1 2 3 + // 4 5 6 + // 7 8 9 + m_featureMatrix.resize(3, 3); + + float counter = 1.0f; + for (size_t row = 0; row < 3; ++row) + { + for (size_t column = 0; column < 3; ++column) + { + m_featureMatrix(row, column) = counter; + counter++; + } + } + } + + FeatureMatrix m_featureMatrix; + }; + + TEST_F(FeatureMatrixFixture, AccessOperators) + { + EXPECT_FLOAT_EQ(m_featureMatrix(1, 1), 5.0f); + EXPECT_FLOAT_EQ(m_featureMatrix(0, 2), 3.0f); + EXPECT_FLOAT_EQ(m_featureMatrix.coeff(2, 1), 8.0f); + EXPECT_FLOAT_EQ(m_featureMatrix.coeff(1, 2), 6.0f); + } + + TEST_F(FeatureMatrixFixture, SetValue) + { + m_featureMatrix(1, 1) = 100.0f; + EXPECT_FLOAT_EQ(m_featureMatrix(1, 1), 100.0f); + } + + TEST_F(FeatureMatrixFixture, Size) + { + EXPECT_EQ(m_featureMatrix.size(), 9); + EXPECT_EQ(m_featureMatrix.rows(), 3); + EXPECT_EQ(m_featureMatrix.cols(), 3); + } +} // EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Tests/FeatureSchemaTests.cpp b/Gems/MotionMatching/Code/Tests/FeatureSchemaTests.cpp new file mode 100644 index 0000000000..306e42c5cc --- /dev/null +++ b/Gems/MotionMatching/Code/Tests/FeatureSchemaTests.cpp @@ -0,0 +1,81 @@ +/* + * 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 +#include +#include + +namespace EMotionFX::MotionMatching +{ + class FeatureSchemaFixture + : public Fixture + { + public: + void SetUp() override + { + Fixture::SetUp(); + m_featureSchema = AZStd::make_unique(); + DefaultFeatureSchema(*m_featureSchema.get(), {}); + } + + void TearDown() override + { + Fixture::TearDown(); + m_featureSchema.reset(); + } + + AZStd::unique_ptr m_featureSchema; + }; + + TEST_F(FeatureSchemaFixture, AddFeature) + { + m_featureSchema->AddFeature(aznew FeaturePosition()); + m_featureSchema->AddFeature(aznew FeatureVelocity()); + m_featureSchema->AddFeature(aznew FeatureTrajectory()); + EXPECT_EQ(m_featureSchema->GetNumFeatures(), 9); + } + + TEST_F(FeatureSchemaFixture, Clear) + { + m_featureSchema->Clear(); + EXPECT_EQ(m_featureSchema->GetNumFeatures(), 0); + } + + TEST_F(FeatureSchemaFixture, GetNumFeatures) + { + EXPECT_EQ(m_featureSchema->GetNumFeatures(), 6); + } + + TEST_F(FeatureSchemaFixture, GetFeature) + { + EXPECT_EQ(m_featureSchema->GetFeature(1)->RTTI_GetType(), azrtti_typeid()); + EXPECT_STREQ(m_featureSchema->GetFeature(3)->GetName().c_str(), "Left Foot Velocity"); + } + + TEST_F(FeatureSchemaFixture, GetFeatures) + { + int counter = 0; + for (const Feature* feature : m_featureSchema->GetFeatures()) + { + AZ_UNUSED(feature); + counter++; + } + EXPECT_EQ(counter, 6); + } + + TEST_F(FeatureSchemaFixture, FindFeatureById) + { + const Feature* feature = m_featureSchema->GetFeature(1); + const AZ::TypeId id = feature->GetId(); + const Feature* result = m_featureSchema->FindFeatureById(id); + EXPECT_EQ(result, feature); + } +} // EMotionFX::MotionMatching diff --git a/Gems/MotionMatching/Code/Tests/Fixture.h b/Gems/MotionMatching/Code/Tests/Fixture.h new file mode 100644 index 0000000000..1edadadae5 --- /dev/null +++ b/Gems/MotionMatching/Code/Tests/Fixture.h @@ -0,0 +1,23 @@ +/* + * 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 EMotionFX::MotionMatching +{ + using Fixture = ComponentFixture< + AZ::MemoryComponent, + AZ::AssetManagerComponent, + AZ::JobManagerComponent, + AZ::StreamerComponent, + EMotionFX::Integration::SystemComponent, + MotionMatchingSystemComponent + >; +} diff --git a/Gems/MotionMatching/Code/Tests/MotionMatchingEditorTest.cpp b/Gems/MotionMatching/Code/Tests/MotionMatchingEditorTest.cpp new file mode 100644 index 0000000000..40217ff9bc --- /dev/null +++ b/Gems/MotionMatching/Code/Tests/MotionMatchingEditorTest.cpp @@ -0,0 +1,11 @@ +/* + * 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 + +AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); diff --git a/Gems/MotionMatching/Code/Tests/MotionMatchingTest.cpp b/Gems/MotionMatching/Code/Tests/MotionMatchingTest.cpp new file mode 100644 index 0000000000..40217ff9bc --- /dev/null +++ b/Gems/MotionMatching/Code/Tests/MotionMatchingTest.cpp @@ -0,0 +1,11 @@ +/* + * 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 + +AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); diff --git a/Gems/MotionMatching/Code/motionmatching_editor_files.cmake b/Gems/MotionMatching/Code/motionmatching_editor_files.cmake new file mode 100644 index 0000000000..e18de13f3c --- /dev/null +++ b/Gems/MotionMatching/Code/motionmatching_editor_files.cmake @@ -0,0 +1,12 @@ +# +# 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 +# +# + +set(FILES + Source/MotionMatchingEditorSystemComponent.cpp + Source/MotionMatchingEditorSystemComponent.h +) diff --git a/Gems/MotionMatching/Code/motionmatching_editor_shared_files.cmake b/Gems/MotionMatching/Code/motionmatching_editor_shared_files.cmake new file mode 100644 index 0000000000..6c797254dc --- /dev/null +++ b/Gems/MotionMatching/Code/motionmatching_editor_shared_files.cmake @@ -0,0 +1,11 @@ +# +# 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 +# +# + +set(FILES + Source/MotionMatchingEditorModule.cpp +) diff --git a/Gems/MotionMatching/Code/motionmatching_editor_tests_files.cmake b/Gems/MotionMatching/Code/motionmatching_editor_tests_files.cmake new file mode 100644 index 0000000000..cf91b5c3b5 --- /dev/null +++ b/Gems/MotionMatching/Code/motionmatching_editor_tests_files.cmake @@ -0,0 +1,11 @@ +# +# 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 +# +# + +set(FILES + Tests/MotionMatchingEditorTest.cpp +) diff --git a/Gems/MotionMatching/Code/motionmatching_files.cmake b/Gems/MotionMatching/Code/motionmatching_files.cmake new file mode 100644 index 0000000000..3a414467a4 --- /dev/null +++ b/Gems/MotionMatching/Code/motionmatching_files.cmake @@ -0,0 +1,52 @@ +# +# 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 +# +# + +set(FILES + Include/MotionMatching/MotionMatchingBus.h + Source/MotionMatchingModuleInterface.h + Source/MotionMatchingSystemComponent.cpp + Source/MotionMatchingSystemComponent.h + Source/Allocators.h + Source/BlendTreeMotionMatchNode.cpp + Source/BlendTreeMotionMatchNode.h + Source/EventData.cpp + Source/EventData.h + Source/Frame.cpp + Source/Frame.h + Source/Feature.cpp + Source/Feature.h + Source/FeatureMatrix.cpp + Source/FeatureMatrix.h + Source/FeaturePosition.cpp + Source/FeaturePosition.h + Source/FeatureSchema.cpp + Source/FeatureSchema.h + Source/FeatureSchemaDefault.cpp + Source/FeatureSchemaDefault.h + Source/FeatureTrajectory.h + Source/FeatureTrajectory.cpp + Source/FeatureVelocity.cpp + Source/FeatureVelocity.h + Source/PoseDataJointVelocities.cpp + Source/PoseDataJointVelocities.h + Source/TrajectoryHistory.cpp + Source/TrajectoryHistory.h + Source/TrajectoryQuery.cpp + Source/TrajectoryQuery.h + Source/FrameDatabase.cpp + Source/FrameDatabase.h + Source/ImGuiMonitor.cpp + Source/ImGuiMonitor.h + Source/ImGuiMonitorBus.h + Source/KdTree.cpp + Source/KdTree.h + Source/MotionMatchingData.cpp + Source/MotionMatchingData.h + Source/MotionMatchingInstance.cpp + Source/MotionMatchingInstance.h +) diff --git a/Gems/MotionMatching/Code/motionmatching_shared_files.cmake b/Gems/MotionMatching/Code/motionmatching_shared_files.cmake new file mode 100644 index 0000000000..ac0375129e --- /dev/null +++ b/Gems/MotionMatching/Code/motionmatching_shared_files.cmake @@ -0,0 +1,11 @@ +# +# 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 +# +# + +set(FILES + Source/MotionMatchingModule.cpp +) diff --git a/Gems/MotionMatching/Code/motionmatching_tests_files.cmake b/Gems/MotionMatching/Code/motionmatching_tests_files.cmake new file mode 100644 index 0000000000..e9d72ce9f9 --- /dev/null +++ b/Gems/MotionMatching/Code/motionmatching_tests_files.cmake @@ -0,0 +1,14 @@ +# +# 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 +# +# + +set(FILES + Tests/Fixture.h + Tests/FeatureMatrixTests.cpp + Tests/FeatureSchemaTests.cpp + Tests/MotionMatchingTest.cpp +) \ No newline at end of file diff --git a/Gems/MotionMatching/Docs/Diagrams/ArchitectureDiagram.drawio b/Gems/MotionMatching/Docs/Diagrams/ArchitectureDiagram.drawio new file mode 100644 index 0000000000..e986ab9682 --- /dev/null +++ b/Gems/MotionMatching/Docs/Diagrams/ArchitectureDiagram.drawio @@ -0,0 +1 @@ +7Vxbc5s6EP41nmkfnDEIA36M7aTNOcmctElvTx0FZFstIFfIid1fX0mIq3BCXOPLHPchNasLYi/frpYVHTAKl+8onM9uiI+Cjtnzlx0w7pim2bcc/p+grBSlZyjKlGI/oRk54Q7/RorYU9QF9lFc6sgICRiel4keiSLksRINUkqeyt0mJCjfdQ6nSCPceTDQqV+wz2YJ1e33cvp7hKez9M5GT7WEMO2sCPEM+uSpQAIXHTCihLDkV7gcoUBwL+VLMu5yTWu2MIoi1mTApyX9Ti+6lx/Il6+T7q+P6ObTY9dOZnmEwUI9cMe0Az7fcC6WzFaKD/avhVjnMIR0iqMOOOetvfmS/+VE+bSC3mVknrRZhTaGlqwLAzxV4zy+YETzOfmvqfpf3hkXCDDkEw4D/epKzDGBHsrI5SGlGTlTcPUuD1SjpIRLBNmCosLoh2pfTptXaTMqWJZqcPp0xvoH3YjFAZqwAo/1uUXfqwizN+LPHWIMR9P4bTLkkXBtqGGAGHOxZBR6TD38Z6ER8ZsRiYT4aobXcaC9BxrBwFsEkKERiVnjVZml9ZiPiDLMTfs80cWx1Nah0sxxso4h4b0mgTTUCeYGBIYTfjcFTIapri9hiAOBae9R8IjErEIBWBiITtm9i8ap7FWsAS0LJGWs7xAJEaMr3kW1dq2BQg6FnV03xZanHIkyeJkVUSjtCBX6TbPZc4DgPxRGvAIvHA0vlL7ckhgzTCKN6VtmSt+pMGVg60wxjBqm9NviibuOJ59RQDzMVm3zxAL9Q+PJYB1P7in8wf00oa1zBfQOT1MG2kMjn4cb6pJQNiNTEsHgIqcOKVlEPhLTCtzM+1wTAV+SXT84yq8URMEFI2UsQkvMvorhZ3119a3QMl6qmeXFSl3EDFJ2LuInTohIhFLapcTEZEDkV3pwSqF9rRBjsqAeeoZPWaTHPQRiz3QEIOkouPisUlDEnQd+LAd1W5dvpqWa2t9ARvFSk378hMMASt5JL6NajIJbUtESGNZ7L2+GA/8arshC8ImLyPuZXg1nhOLffFqYaoKUoNIT0y71uBMjleAoElHMbSo4o0K6gctSx2sYM0XwSBDAeYwfssdInPyQMEbCl/TiFcadub3UuG3D1Y3brjHuQVvGbfZ14VMYopPQtyV0p4rozqAG0XcqdNc5FkTnfKerwiBx+a3Ylg+TVwfiCewj9QT6xlqCwRgy+ADjEyi0BwoH4An0XVIe9r7HcW30e1KADRUgC+FTBTCt/p4VYAD26RXS3xLdz5zURbzkFkpOIfcRh+kW3IZuwTUOyy3ouYIcGT4s0AkXtocLfffwcKGnifdAo8U9m/fgSKM+Pe31r39P0Snc25ZVH96233VPNt3EpkHvOG06Xbee07vzZiiEJ9PelsO27IMzbud/lbDfNEX0F6AAmsbxvW2Dghp6SzBfdGE3WX2/aIKKciVrVeMq+pUt5C/wBmh4c0PEm9UbyDgwRFORQjqBzrZAB1iVd6eWue+cMtCjSB2FclMmcxRV8CNKC6lkvUIJGnwMQxL59zNRkVGSo2HVQcaLaFcPVr1nwWod0BjtAU3T6MPeDc4AqwIzRkWbkifSUKYGsPpVr1kt/mgZsCw9QNLUVdo3TIy5V1bWSvlNPTgF8AEFQw4sU+lcRyQgVM4MJvJfp1ylU68rzxqbqh9Ua+xkG43XJCKTEbsJSy39VfMmXKcJnh0x23fK9b7+jreunK4iB1GrVs/+tT45xL6fBJMVGc6FGcvH6g87/bGYi8ePqupwa0VWwK5Hp2LhWY1LNNtyiXYDjCm4xIeAiBik6AhtLdrd0/vU1+4fNvd5TZNoTV1eXUD0t+G2qdU4VouvmjtC8NJULTtC2zwp6auVtOmLnL0qqVZfWQ2xGispqG4vneo2om0l1beXJyV9SUmdI1BSTbOOWUmtVynpvnfAG+5mN9k5b67DjSup0jrG1lNtTnUPbFfjx8011t61xtZtDI5mE5za27Ftgu2642vHswneHtt3ynVHj3NvSSxLG/8R9qWOvWAUa8I4pak325FrexsDqDmKoYRTsyVv79WYHkheJC8qLr+Kc3ngXCjFSQPa0gDT1XMyu9UAV0/KlN9UXUWc/ZF3UoL23lY1rmkzWzsS6tZlorNDyG87IvAEyi0K8qe5Dxl6MwkIZHrrfws2X9QNu8SRP0QxS5VLltPX9Bujh8V0TOGTaKtPxMaMkp8odeTqVbg47FshNYrK4jn0+HKuZZ+xlVM+KuYLUuFQ8Qz7vtyuUMIgW5vZHXJxjcTOoM8XPuLXRn4t075zvhkZEW5hFGKpUIjr4xOKWa2qPW/ALytg+vkGu5m2uVZbytYgxxZgVf0gpJx+tMHYSMRZGl7J9F5WcHQNTe5AlzuokbGMJbOj0nnkqWf19yJeoybPXy/ftsSrBxVdfhl+/yVqo0ufJigYftIlQpwhMZO4oLdy4+ON4usBssNV5KOl1okLKvJvKZnyieJ7LM7uZT3Ozs5OeLJ9hWtY4ZXa/fZLsi1Nqns7qrHZSQ3nsI9qpOHBy3knlWU9kLrPQYOMzgHlIHeYd99cF5ym5X5piqH1HKSeOOxVfNvx5CAH28mG7SkHmdrbseUgB/phz024vq8c5PbYvlOuZ1842rHfPsrTku7+YHeNkPll/uG7BP/y7weCiz8= \ No newline at end of file diff --git a/Gems/MotionMatching/Docs/Diagrams/FeatureSchema.drawio b/Gems/MotionMatching/Docs/Diagrams/FeatureSchema.drawio new file mode 100644 index 0000000000..b2b17a1965 --- /dev/null +++ b/Gems/MotionMatching/Docs/Diagrams/FeatureSchema.drawio @@ -0,0 +1 @@ +5Z1dd6o4FIZ/jZd2QRJULmt72llrzqyeaS965hIlKlMEC7Ffv34SDCiJzhzt3nY0V+oGX0iel4+9ibFDr+Zvt0W0mP2RxzztEC9+69DrDiF+L+zLFxV5X0VCXwemRRLrldaBh+SD66Cno8sk5mVrRZHnqUgW7eA4zzI+Fq1YVBT5a3u1SZ62t7qIptwKPIyj1I4+JrGYraKDwFvHf+PJdFZv2ff0knlUr6wD5SyK89eNEP3WoVdFnovVu/nbFU9V59X9svrezY6lzY4VPBO/8oWP7OPHcDF4/pmO7srrx+w2e/y9S1YqL1G61A3ukF4q9YYjtcviXfdD73mp9nM4yTPRLStKl3IFP1hI0sP1cvluql5veCSWBVer1IJyz0b14mYjxae2cq86T/VBKV9uJku9SVFEf0sv5MW77vlmA0RCWKi34+VIvgxfZ4ngD4torGKv0sEyNhPzVH7y1e7lyyzm8fdRE4jGT9NCRe+WIk0yruNxVDzdSZlEKJt7F17QDpIqqtZcteqaqVYmaXqVp3lR7RoNY8bjWLdeHwh+ULXWBK3Zv/BC8LeNkAZ/y/M5F6r1Xr3UC1df0Udhbd/XtaUp1bHZhp3ZQAcjfRhNG+m10+QbbbY9jEfRjUcRjfedT0R1Nqn898LTvEJ/Sm4bTXqTCY7bgvA/3eazo7qNobuNHM1ti7xMRJJnp+S2ySSKI6RzG2P/N7f1drpNNf9XrECYtILttiKay3uhtdFWcrXXDDvI7hNt5KUo8ideY8lyhbhFSoeiNJlmykgSCpfxoYKRyHuiS71gnsRxustjxcpYyhXVJxFVbqXX3VAFmtsgDwZ/V95kXpCgZQEysD3ABuQisF1AsEzQxzJBc8oZyqvO0+naoWUGH+k+JwgsI4TUP6IN/MEWHxhoeBZfqlRl3eUblHb2Co9bmYvdJxttDrac/+pYwVOJ5KWd72zrB72FH3lS+fetLWOcfWuBMl8WY66/s5mdGDJN3rRDR0TFlAtLp2LStPlwTDV/VzD1gDCZOtiYfLcw9YEwmTrYmLaVFc4Yk3kneSgmUwcb07Yk/IwxhUCYTB1sTNuy1zPG1HT3ZzlZQtigAsdA+VCgTCFsUNsy9HMGZaY3B4MyhbBBbcuizxkUhQJlCmGDcizNbSqKnwZlCmGDCh0DBVWQsISQQdUHsDOgoEoSlhAyKOZYFuX3QihQ4XFBuZZH9aFAmULYoFzLowZQoEwhbFCu5VEhFChTCBuUY3kU8YBAWULYoBzLo+SRAATKFMIG5VgeRQgUKFMIGVTdDmdAUShQphA2KMee7RIGBcoUwgZFHAMVQIEyhbBBOVaZIFCVCUsIG5RjlQkCVZmwhLBBOVaZABsycewxE4FjlQkKNWbCEsIG5VhlgkKNmbCEsEE5VpmgUGMmLCFsUI5VJijUmAlLCBlU/ZzSGVBQYyYsIWxQjlUmKNSYCUsIGxRxDBTUmAlLCBuUY5UJCvVDDksIG5RjlQkK9VMOSwgblGOVCQpVmbCEsEE5VplgUJUJSwgZVN+xPIpBVSYsIWRQ9ZnWGVBQlQlLCBuUY3kUg6pMWELYoBzLoxjzgUCZQtigHMujWAAFyhTCBuVYHsV6UKBMIWxQjuVRrA8FyhTCBuVaHjWAAmUKYYNy7AkvC6FAmULYoBx7wht4QKAsIWxQjlUmAh8KlCmEDKouLToDylQ4GJQphA3KscpEQKFAmULYoPa7mRinUVkm42qyy6gQdviEEFpzWx46nIIx79+FsBnud59xTgytuYoPZRiEX8xwv1uQc2JozW5+KMP+8Y7D6C6cdp+v/yp/PvB7ckuHD/d/drdd82AnRQ8w//uhAnvSc/CP4hHBmoM/3DGf7lFmRd9qN4JuN3Y8u53kJPzxZDLq4ditb+XWX223/Z6MnNMFymJx6AVqUKdFX3SB2u+ZyTkhtM7ehw+dZlgM5cf1n1etVl//BRj99g8= \ No newline at end of file diff --git a/Gems/MotionMatching/Docs/Images/ArchitectureDiagram.png b/Gems/MotionMatching/Docs/Images/ArchitectureDiagram.png new file mode 100644 index 0000000000..5eb0507284 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/ArchitectureDiagram.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a4ae0e6c7e54ab84acd0582c7a5375ce96c73c4765cd69b542bc97609a3a25f +size 316431 diff --git a/Gems/MotionMatching/Docs/Images/FeatureSchema.png b/Gems/MotionMatching/Docs/Images/FeatureSchema.png new file mode 100644 index 0000000000..51fb8a9db4 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureSchema.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1e14441badf5f7c85d538aa09b1d1ae2af48c3263221930a058c6fd48cc60e3 +size 193077 diff --git a/Gems/MotionMatching/JupyterNotebooks/FeatureAnalysis.ipynb b/Gems/MotionMatching/JupyterNotebooks/FeatureAnalysis.ipynb new file mode 100644 index 0000000000..44059714f9 --- /dev/null +++ b/Gems/MotionMatching/JupyterNotebooks/FeatureAnalysis.ipynb @@ -0,0 +1,352 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d57026d3", + "metadata": {}, + "source": [ + "# Settings" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "26e1d687", + "metadata": {}, + "outputs": [], + "source": [ + "featureMatrixFilePath = 'E:/MotionMatchingFeatureMatrix.csv'" + ] + }, + { + "cell_type": "markdown", + "id": "a45e3d25", + "metadata": {}, + "source": [ + "# Load feature matrix" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25a44238", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import pandas as pd\n", + "import seaborn as sns\n", + "from sklearn import preprocessing\n", + "from sklearn.decomposition import PCA\n", + "\n", + "def PrintGreen(text):\n", + " print('\\x1b[6;30;42m' + text + '\\x1b[0m')\n", + " \n", + "def PrintRed(text):\n", + " print('\\33[41m' + text + '\\x1b[0m')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5bdc881e", + "metadata": {}, + "outputs": [], + "source": [ + "# Load the feature matrix from CSV\n", + "originalData = pd.read_csv(featureMatrixFilePath, na_values = 'null')\n", + "if originalData.shape[0] > 0 and originalData.shape[1] > 0:\n", + " PrintGreen(\"Loading succeeded\");\n", + "else:\n", + " PrintRed(\"Loading failed!\");\n", + "\n", + "print(\"frames = \" + str(originalData.shape[0]))\n", + "print(\"featureComponents = \" + str(originalData.shape[1]))\n", + "\n", + "# Ensure to show all columns\n", + "pd.set_option('max_columns', originalData.shape[1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e41c7caf", + "metadata": {}, + "outputs": [], + "source": [ + "originalData.head(15)" + ] + }, + { + "cell_type": "markdown", + "id": "b3bbc348", + "metadata": {}, + "source": [ + "# Data preparation\n", + "\n", + "1. Data Cleaning: We will remove unused feature components that are zeroed out for now as they are not implemented yet.\n", + "2. Feature Selection: Happened in the motion matching gem. So far we have a position, velocity and a trajectory feature.\n", + "3. Data Transformation: We will change the scale of our features by normalizing it using min-max normalization. We do not modify the distribution for now.\n", + "4. Feature Engineering / Data Augmentation: We will not derive new variables for now.\n", + "5. Dimensionality Reduction: We will not create compact projections of the data for now.\n", + "\n", + "# Data cleaning\n", + "Remove columns containing only 0.0" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2a64a465", + "metadata": {}, + "outputs": [], + "source": [ + "def CleanData(data):\n", + " # Remove columns with only zeros\n", + " cleanedData = data[data.columns[(data != 0).any()]]\n", + " \n", + " if cleanedData.shape[0] != data.shape[0]:\n", + " PrintRed(\"Frame count of original and cleaned data should match!\")\n", + " \n", + " if cleanedData.shape[1] < data.shape[1]:\n", + " PrintGreen(str(data.shape[1] - cleanedData.shape[1]) + \" feature components containing only 0.0 values removed\");\n", + " \n", + " print(\"frames = \" + str(cleanedData.shape[0]))\n", + " print(\"featureComponents = \" + str(cleanedData.shape[1]))\n", + " \n", + " return cleanedData\n", + "\n", + "\n", + "cleanedData = CleanData(originalData);\n", + "frameCount = cleanedData.shape[0]\n", + "cleanedFeatureComponentCount = cleanedData.shape[1]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "81b759dc", + "metadata": {}, + "outputs": [], + "source": [ + "cleanedData.head(15)" + ] + }, + { + "cell_type": "markdown", + "id": "b9e9a8e2", + "metadata": {}, + "source": [ + "# Feature analysis visualizations" + ] + }, + { + "cell_type": "markdown", + "id": "643dd550", + "metadata": {}, + "source": [ + "## Histogram per feature component showing value distributions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f3cbe721", + "metadata": {}, + "outputs": [], + "source": [ + "def Histogram(data):\n", + " image = data.hist(figsize = [32, 32])\n", + "\n", + " \n", + "Histogram(cleanedData)" + ] + }, + { + "cell_type": "markdown", + "id": "06cc1e64", + "metadata": {}, + "source": [ + "## Boxplot per feature component\n", + "Median in orange inside the box
\n", + "Box = Interquartile range, which means 50% of the data lies within the box
\n", + "Black line range = 99,3% of the values
\n", + "Semi-transparent outliers represent the rest 0.7%
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4ff8c258", + "metadata": {}, + "outputs": [], + "source": [ + "def BoxPlot(data, featureComponentCount):\n", + " minValuePerColumn = data.min(axis=0)\n", + " maxValuePerColumn = data.max(axis=0)\n", + "\n", + " fig1, ax1 = plt.subplots(figsize=(20,20))\n", + " ax1.set_title('Feature Component Boxplot')\n", + "\n", + " # Render outliers\n", + " flierprops = dict(marker='o', markerfacecolor='gainsboro', markersize=1, linestyle='none', markeredgecolor='gainsboro', alpha=0.005)\n", + " ax1.boxplot(data, vert=False, flierprops=flierprops)\n", + "\n", + " # Create an array containing values ranging from 1 to featureComponentCount\n", + " elementNumbers = np.array([i+1 for i in range(featureComponentCount)])\n", + "\n", + " plt.yticks(elementNumbers, data.columns)\n", + " plt.show()\n", + "\n", + "\n", + "BoxPlot(cleanedData, cleanedData.shape[1])" + ] + }, + { + "cell_type": "markdown", + "id": "023ab81b", + "metadata": {}, + "source": [ + "## Feature correlation heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "290aff93", + "metadata": {}, + "outputs": [], + "source": [ + "# not used in drawing, this just prints the values\n", + "correlationMatrix = cleanedData.corr()\n", + "\n", + "# plot the correlation heatmap\n", + "plt.figure(figsize=[32, 32])\n", + "sns.heatmap(data=correlationMatrix)" + ] + }, + { + "cell_type": "markdown", + "id": "2ce964ae", + "metadata": {}, + "source": [ + "## Scatterplot using PCA\n", + "Use principal component analysis to project the multi-dimensional data down to 2D" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d77c43aa", + "metadata": {}, + "outputs": [], + "source": [ + "def ScatterPlotPCA(data):\n", + " pca = PCA(n_components=2)\n", + " pca.fit(data)\n", + " pcaData = pca.transform(data)\n", + " \n", + " pca_x = pcaData[:, 0]\n", + " pca_y = pcaData[:, 1]\n", + " plt.figure(figsize=(16, 16))\n", + " plt.scatter(pca_x, pca_y, s=2.0, alpha=0.5)\n", + "\n", + " \n", + "ScatterPlotPCA(cleanedData)" + ] + }, + { + "cell_type": "markdown", + "id": "e3c4c80a", + "metadata": {}, + "source": [ + "# Data Transformation\n", + "# Normalization" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8c71d0a5", + "metadata": {}, + "outputs": [], + "source": [ + "# mean normalization\n", + "# normalized_df=(df-df.mean())/df.std()\n", + "\n", + "# min-max normalization\n", + "# normalized_df=(df-df.min())/(df.max()-df.min())\n", + "\n", + "# Note: Pandas automatically applies colomn-wise function in the code above.\n", + "\n", + "# Using sklearn\n", + "x = cleanedData.values\n", + "min_max_scaler = preprocessing.MinMaxScaler(feature_range=(0, 1))\n", + "x_scaled = min_max_scaler.fit_transform(x)\n", + "\n", + "normalizedData = pd.DataFrame(data=x_scaled, columns=cleanedData.columns) # copy column names from source\n", + "\n", + "# min values per column used to normalize the data\n", + "print(\"Minimum values per feature component / column\")\n", + "print(min_max_scaler.data_min_)\n", + "print(\"\")\n", + "\n", + "# max values per column used to normalize the data\n", + "print(\"Maximum values per feature component / column\")\n", + "print(min_max_scaler.data_max_)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b5bfd21", + "metadata": {}, + "outputs": [], + "source": [ + "normalizedData.head(15)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c094066c", + "metadata": {}, + "outputs": [], + "source": [ + "Histogram(normalizedData)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b81660c2", + "metadata": {}, + "outputs": [], + "source": [ + "ScatterPlotPCA(normalizedData)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Gems/MotionMatching/README.md b/Gems/MotionMatching/README.md new file mode 100644 index 0000000000..ecad3387f2 --- /dev/null +++ b/Gems/MotionMatching/README.md @@ -0,0 +1,48 @@ +# Motion Matching + +Motion matching is a data-driven animation technique that synthesizes motions based on existing animation data and the current character and input contexts. + +# Features + +A feature is a property extracted from the animation data and is used by the motion matching algorithm to find the next best matching frame. Examples of features are the position of the feet joints, the linear or angular velocity of the knee joints or the trajectory history and future trajectory of the root joint. We can also encode environment sensations like obstacle positions and height, the location of the sword of an enemy character or a football's position and velocity. + +Their purpose is to describe a frame of the animation by their key characteristics and sometimes enhance the actual keyframe data (pos/rot/scale per joint) by e.g. taking the time domain into account and calculate the velocity or acceleration, or a whole trajectory to describe where the given joint came from to reach the frame and the path it moves along in the near future. + +Features are responsible for each of the following: + +1. Extract the feature values for a given frame in the motion database and store them in the feature matrix. For example calculate the left foot joint linear velocity, convert it to relative-to the root joint model space for frame 134 and place the XYZ components in the feature matrix starting at column 9. +1. Extract the feature from the current input context/pose and fill the query vector with it. For example calculate the linear velocity of the left foot joint of the current character pose in relative-to the root joint model space and place the XYZ components in the feature query vector starting at position 9. +1. Calculate the cost of the feature so that the motion matching algorithm can weight it into search for the next best matching frame. An example would be calculating the squared distance between a frame in the motion matching database and the current character pose for the left foot joint. + +# Feature schema + +The feature schema is a set of features that define the criteria used in the motion matching algorithm and influences the runtime speed, memory used, and the results of the synthesized motion. It is the most influential, user-defined input to the system. + +The schema defines which features are extracted from the motion database while the actual extracted data is stored in the feature matrix. Along with the feature type, settings like the joint to extract the data from, a debug visualization color, how the residual is calculated or a custom feature is specified. + +The more features are selected by the user, the bigger the chances are that the searched and matched pose hits the expected result but the slower the algorithm will be and the more memory will be used. The key is to use crucial and independent elements that define a pose and its movement without being too strict on the wrong end. The root trajectory along with the left and right foot positions and velocities have been proven to be a good start here. + +# Feature matrix + +The feature matrix is an NxN matrix which stores the extracted feature values for all frames in our motion database based upon a given feature schema. The feature schema defines the order of the columns and values and is used to identify values and find their location inside the matrix. + +A 3D position feature storing XYZ values e.g. will use three columns in the feature matrix. Every component of a feature is linked to a column index, so e.g. the left foot position Y value might be at column index 6. The group of values or columns that belong to a given feature is what we call a feature block. The accumulated number of dimensions for all features in the schema, while the number of dimensions might vary per feature, form the number of columns of the feature matrix. + +Each row represents the features of a single frame of the motion database. The number of rows of the feature matrix is defined by the number. + +![Feature Schema](Docs/Images/FeatureSchema.png) + +# Trajectory History + +The trajectory history stores world space position and facing direction data of the root joint (motion extraction joint) with each game tick. The maximum recording time is adjustable but needs to be at least as long as the past trajectory window from the trajectory feature as the trajectory history is used to build the query for the past trajectory feature. + +# Motion Matching data + +Data based on a given skeleton but independent of the instance like the motion capture database, the feature schema or feature matrix is stored in here. It is just a wrapper to group the sharable data. + +# Motion Matching instance + +The instance is where everything comes together. It stores the trajectory history, the trajectory query along with the query vector, knows about the last lowest cost frame frame index and stores the time of the animation that the instance is currently playing. It is responsible for motion extraction, blending towards a new frame in the motion capture database in case the algorithm found a better matching frame and executes the actual search. + +# Architecture Diagram +![Class Diagram](Docs/Images/ArchitectureDiagram.png) \ No newline at end of file diff --git a/Gems/MotionMatching/gem.json b/Gems/MotionMatching/gem.json new file mode 100644 index 0000000000..60e8be01c0 --- /dev/null +++ b/Gems/MotionMatching/gem.json @@ -0,0 +1,21 @@ +{ + "gem_name": "MotionMatching", + "display_name": "Motion Matching", + "license": "Apache-2.0 Or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "type": "Code", + "summary": "Motion matching is a data-driven animation technique that synthesizes motions based on existing animation data and the current character and input contexts.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "Animation", + "Tools", + "Simulation" + ], + "icon_path": "preview.png", + "requirements": "", + "dependencies": [ + "EMotionFX"] +} diff --git a/Gems/MotionMatching/preview.png b/Gems/MotionMatching/preview.png new file mode 100644 index 0000000000..0f393ac886 --- /dev/null +++ b/Gems/MotionMatching/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ac9dd09bde78f389e3725ac49d61eff109857e004840bc0bc3881739df9618d +size 2217 diff --git a/engine.json b/engine.json index 5c64eed308..a476c1b769 100644 --- a/engine.json +++ b/engine.json @@ -49,6 +49,7 @@ "Gems/MessagePopup", "Gems/Metastream", "Gems/Microphone", + "Gems/MotionMatching", "Gems/Multiplayer", "Gems/MultiplayerCompression", "Gems/NvCloth", From 8f48e4fcb6736a38f6cea6357b882846b7191d3c Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Mon, 31 Jan 2022 11:04:13 +0000 Subject: [PATCH 346/394] Moved if section to the top Signed-off-by: Sergey Pereslavtsev --- Gems/PhysX/Code/Editor/DebugDraw.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gems/PhysX/Code/Editor/DebugDraw.cpp b/Gems/PhysX/Code/Editor/DebugDraw.cpp index 78d216a21a..ca5d4e1694 100644 --- a/Gems/PhysX/Code/Editor/DebugDraw.cpp +++ b/Gems/PhysX/Code/Editor/DebugDraw.cpp @@ -687,12 +687,6 @@ namespace PhysX [[maybe_unused]] const AZ::Vector3& colliderScale, [[maybe_unused]] const bool forceUniformScaling) const { - const int numColumns = heightfieldShapeConfig.GetNumColumns(); - const int numRows = heightfieldShapeConfig.GetNumRows(); - - const float minXBounds = -(numColumns * heightfieldShapeConfig.GetGridResolution().GetX()) / 2.0f; - const float minYBounds = -(numRows * heightfieldShapeConfig.GetGridResolution().GetY()) / 2.0f; - auto heights = heightfieldShapeConfig.GetSamples(); if (heights.empty()) @@ -700,6 +694,12 @@ namespace PhysX return; } + const int numColumns = heightfieldShapeConfig.GetNumColumns(); + const int numRows = heightfieldShapeConfig.GetNumRows(); + + const float minXBounds = -(numColumns * heightfieldShapeConfig.GetGridResolution().GetX()) / 2.0f; + const float minYBounds = -(numRows * heightfieldShapeConfig.GetGridResolution().GetY()) / 2.0f; + for (int xIndex = 0; xIndex < numColumns - 1; xIndex++) { for (int yIndex = 0; yIndex < numRows - 1; yIndex++) From cb28a4cd9bedfd4ac12672c8c877b2922efd139d Mon Sep 17 00:00:00 2001 From: Benjamin Jillich Date: Mon, 31 Jan 2022 13:30:53 +0100 Subject: [PATCH 347/394] Motion Matching: Added images for readme Signed-off-by: Benjamin Jillich --- Gems/MotionMatching/Docs/Images/FeatureHistograms.png | 3 +++ Gems/MotionMatching/Docs/Images/FeaturePositionRPE.png | 3 +++ Gems/MotionMatching/Docs/Images/FeaturePositionVis.png | 3 +++ Gems/MotionMatching/Docs/Images/FeatureScatterplotPCA.png | 3 +++ Gems/MotionMatching/Docs/Images/FeatureSharedRPE.png | 3 +++ Gems/MotionMatching/Docs/Images/FeatureTrajectoryRPE.png | 3 +++ Gems/MotionMatching/Docs/Images/FeatureTrajectoryVis.png | 3 +++ Gems/MotionMatching/Docs/Images/FeatureVelocityRPE.png | 3 +++ Gems/MotionMatching/Docs/Images/FeatureVelocityVis.png | 3 +++ Gems/MotionMatching/Docs/Images/TrajectoryHistory.png | 3 +++ 10 files changed, 30 insertions(+) create mode 100644 Gems/MotionMatching/Docs/Images/FeatureHistograms.png create mode 100644 Gems/MotionMatching/Docs/Images/FeaturePositionRPE.png create mode 100644 Gems/MotionMatching/Docs/Images/FeaturePositionVis.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureScatterplotPCA.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureSharedRPE.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureTrajectoryRPE.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureTrajectoryVis.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureVelocityRPE.png create mode 100644 Gems/MotionMatching/Docs/Images/FeatureVelocityVis.png create mode 100644 Gems/MotionMatching/Docs/Images/TrajectoryHistory.png diff --git a/Gems/MotionMatching/Docs/Images/FeatureHistograms.png b/Gems/MotionMatching/Docs/Images/FeatureHistograms.png new file mode 100644 index 0000000000..703b182bba --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureHistograms.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c66837b2ffcfd2e30cb732deb798786da47cc64279c80085da04309f40ffedf +size 173138 diff --git a/Gems/MotionMatching/Docs/Images/FeaturePositionRPE.png b/Gems/MotionMatching/Docs/Images/FeaturePositionRPE.png new file mode 100644 index 0000000000..45f36b5ee0 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeaturePositionRPE.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f5b83dff90690f8574d923ab6735303191be13b229bb448334cad5af8cf90ca +size 28817 diff --git a/Gems/MotionMatching/Docs/Images/FeaturePositionVis.png b/Gems/MotionMatching/Docs/Images/FeaturePositionVis.png new file mode 100644 index 0000000000..064065bc2f --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeaturePositionVis.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c8d33ae9d94dd53bad827502370de20279cb10b1ce2f0a7b372f45e831724dc +size 169026 diff --git a/Gems/MotionMatching/Docs/Images/FeatureScatterplotPCA.png b/Gems/MotionMatching/Docs/Images/FeatureScatterplotPCA.png new file mode 100644 index 0000000000..36a1d78b33 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureScatterplotPCA.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0f656935e7c642064d3c65295df8830dda6cd67f30ea6fddea9d1d2bcef075a +size 252438 diff --git a/Gems/MotionMatching/Docs/Images/FeatureSharedRPE.png b/Gems/MotionMatching/Docs/Images/FeatureSharedRPE.png new file mode 100644 index 0000000000..363f2cd46d --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureSharedRPE.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2671d3de458c4e799bcd34383f9630a242116c16f2a217d061e1b4e914ea3465 +size 57233 diff --git a/Gems/MotionMatching/Docs/Images/FeatureTrajectoryRPE.png b/Gems/MotionMatching/Docs/Images/FeatureTrajectoryRPE.png new file mode 100644 index 0000000000..5ff06f5d85 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureTrajectoryRPE.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d785f34da81b63fa90c15a6556fd4eb1aa796b4a00cda4371ded12cad5f016 +size 48699 diff --git a/Gems/MotionMatching/Docs/Images/FeatureTrajectoryVis.png b/Gems/MotionMatching/Docs/Images/FeatureTrajectoryVis.png new file mode 100644 index 0000000000..731bbec497 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureTrajectoryVis.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d342a61988f4e178e57941bf19007406422e638ece1091259b733a740ebae7af +size 149579 diff --git a/Gems/MotionMatching/Docs/Images/FeatureVelocityRPE.png b/Gems/MotionMatching/Docs/Images/FeatureVelocityRPE.png new file mode 100644 index 0000000000..5957cc7742 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureVelocityRPE.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91728049ab45766589cf09992b3d4e6e5fb3d4a9b51721cd505b8275cf45a620 +size 29802 diff --git a/Gems/MotionMatching/Docs/Images/FeatureVelocityVis.png b/Gems/MotionMatching/Docs/Images/FeatureVelocityVis.png new file mode 100644 index 0000000000..b8832c63e4 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/FeatureVelocityVis.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2991261105e34ecece1fbe27ada3f82487ef4de190fada75affb15242d05c29f +size 201487 diff --git a/Gems/MotionMatching/Docs/Images/TrajectoryHistory.png b/Gems/MotionMatching/Docs/Images/TrajectoryHistory.png new file mode 100644 index 0000000000..760a539a24 --- /dev/null +++ b/Gems/MotionMatching/Docs/Images/TrajectoryHistory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de1e1c38355595592025ae6dc0f0a597218845d436b96ff4ab33dcd720c05149 +size 120561 From 73ca7006180639c2ddc303b236f009a31f727a90 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich Date: Mon, 31 Jan 2022 16:08:03 +0100 Subject: [PATCH 348/394] Motion Matching: ReadMe.md update * Added several new sections (trajectory history, motion matching data, motion matching instance, etc. * Added images for the available feature visualizations and UI editors. * Added feature histogram and scatterplot. Signed-off-by: Benjamin Jillich --- Gems/MotionMatching/README.md | 117 ++++++++++++++++++++++++++++------ 1 file changed, 99 insertions(+), 18 deletions(-) diff --git a/Gems/MotionMatching/README.md b/Gems/MotionMatching/README.md index ecad3387f2..f07116fcd7 100644 --- a/Gems/MotionMatching/README.md +++ b/Gems/MotionMatching/README.md @@ -2,47 +2,128 @@ Motion matching is a data-driven animation technique that synthesizes motions based on existing animation data and the current character and input contexts. -# Features +https://user-images.githubusercontent.com/43751992/151820094-a7f0df93-bd09-4ea2-a34a-3d583815ff6c.mp4 -A feature is a property extracted from the animation data and is used by the motion matching algorithm to find the next best matching frame. Examples of features are the position of the feet joints, the linear or angular velocity of the knee joints or the trajectory history and future trajectory of the root joint. We can also encode environment sensations like obstacle positions and height, the location of the sword of an enemy character or a football's position and velocity. +## Setup -Their purpose is to describe a frame of the animation by their key characteristics and sometimes enhance the actual keyframe data (pos/rot/scale per joint) by e.g. taking the time domain into account and calculate the velocity or acceleration, or a whole trajectory to describe where the given joint came from to reach the frame and the path it moves along in the near future. +1. Add the `MotionMatching` gem to your project using the [Project Manager](https://docs.o3de.org/docs/user-guide/project-config/add-remove-gems/) or the [Command Line Interface (CLI)](https://docs.o3de.org/docs/user-guide/project-config/add-remove-gems/#using-the-command-line-interface-cli). See the documentation on [Adding and Removing Gems in a Project](https://docs.o3de.org/docs/user-guide/project-config/add-remove-gems/). +1. Compile your project and run. + +## Features + +A feature is a property extracted from the animation data and is used by the motion matching algorithm to find the next best matching frame. Examples of features are the position of the feet joints, the linear or angular velocity of the knee joints, or the trajectory history and future trajectory of the root joint. We can also encode environment sensations like obstacle positions and height, the location of the sword of an enemy character, or a football's position and velocity. + +Their purpose is to describe a frame of the animation by their key characteristics and sometimes enhance the actual keyframe data (pos/rot/scale per joint) by e.g. taking the time domain into account and calculating the velocity or acceleration, or a whole trajectory to describe where the given joint came from to reach the frame and the path it moves along in the near future. + +| Position Feature | Velocity Feature | Trajectory Feature | +| :------------- |:-------------| :-----| +| Matches joint positions | Matches joint velocities | Matches the trajectory history and future trajectory | +| ![Position Feature](https://user-images.githubusercontent.com/43751992/151818913-8ea11c40-3287-4fcf-aa7b-7209940cb852.png) | ![Velocity Feature](https://user-images.githubusercontent.com/43751992/151818945-546450ad-f970-4251-95d4-1d515e149d9b.png) | ![Trajectory Feature](https://user-images.githubusercontent.com/43751992/151819095-3cdb1524-957a-411e-9c0f-d2baa5a270c1.png) | Features are responsible for each of the following: -1. Extract the feature values for a given frame in the motion database and store them in the feature matrix. For example calculate the left foot joint linear velocity, convert it to relative-to the root joint model space for frame 134 and place the XYZ components in the feature matrix starting at column 9. -1. Extract the feature from the current input context/pose and fill the query vector with it. For example calculate the linear velocity of the left foot joint of the current character pose in relative-to the root joint model space and place the XYZ components in the feature query vector starting at position 9. -1. Calculate the cost of the feature so that the motion matching algorithm can weight it into search for the next best matching frame. An example would be calculating the squared distance between a frame in the motion matching database and the current character pose for the left foot joint. +1. Extract the feature values for a given frame in the motion database and store them in the feature matrix. For example, calculate the left foot joint linear velocity, convert it to relative to the root joint model space for frame 134 and place the XYZ components in the feature matrix starting at column 9. -# Feature schema +1. Extract the feature from the current input context/pose and fill the query vector with it. For example, calculate the linear velocity of the left foot joint of the current character pose in relative-to the root joint model space and place the XYZ components in the feature query vector starting at position 9. + +1. Calculate the cost of the feature so that the motion matching algorithm can weigh it in to search for the next best matching frame. An example would be calculating the squared distance between a frame in the motion matching database and the current character pose for the left foot joint. + +> Features are extracted and stored relative to a given joint, in most cases the motion extraction or root joint, and thus are in model-space. This makes the search algorithm invariant to the character location and orientation and the extracted features, like e.g. a joint position or velocity, translate and rotate along with the character. + + + + + + + + + + + + + + +
User-InterfaceProperty Descriptions
+ Shared Feature RPE + + Name: Display name used for feature identification and debug visualizations.
+ Joint: Joint name to extract the data from.
+ Relative To Joint: When extracting feature data, convert it to relative-space to the given joint.
+ Debug Draw: Are debug visualizations enabled for this feature?
+ Debug Draw Color: Color used for debug visualizations to identify the feature.
+ Cost Factor: The cost factor for the feature is multiplied with the actual and can be used to change a feature's influence in the motion matching search.
+ Residual: Use 'Squared' in case minimal differences should be ignored and larger differences should overweight others. Use 'Absolute' for linear differences and don't want the mentioned effect.
+
+ Trajectory Feature RPE + + Past Time Range: The time window the samples are distributed along for the trajectory history. [Default = 0.7 seconds]
+ Past Samples: The number of samples stored per frame for the past trajectory. [Default = 4 samples to represent the trajectory history]
+ Past Cost Factor: The cost factor is multiplied with the cost from the trajectory history and can be used to change the influence of the trajectory history match in the motion matching search.
+ Future Time Range: The time window the samples are distributed along for the future trajectory. [Default = 1.2 seconds]
+ Future Samples: The number of samples stored per frame for the future trajectory. [Default = 6 samples to represent the future trajectory]
+ Future Cost Factor: The cost factor is multiplied with the cost from the future trajectory and can be used to change the influence of the future trajectory match in the motion matching search.
+ Facing Axis: The facing direction of the character. Which axis of the joint transform is facing forward? [Default = Looking into Y-axis direction]
+
+ +## Feature schema The feature schema is a set of features that define the criteria used in the motion matching algorithm and influences the runtime speed, memory used, and the results of the synthesized motion. It is the most influential, user-defined input to the system. -The schema defines which features are extracted from the motion database while the actual extracted data is stored in the feature matrix. Along with the feature type, settings like the joint to extract the data from, a debug visualization color, how the residual is calculated or a custom feature is specified. +The schema defines which features are extracted from the motion database while the actual extracted data is stored in the feature matrix. Along with the feature type, settings like the joint to extract the data from, a debug visualization color, how the residual is calculated, or a custom feature is specified. The more features are selected by the user, the bigger the chances are that the searched and matched pose hits the expected result but the slower the algorithm will be and the more memory will be used. The key is to use crucial and independent elements that define a pose and its movement without being too strict on the wrong end. The root trajectory along with the left and right foot positions and velocities have been proven to be a good start here. -# Feature matrix +![Feature Schema](https://user-images.githubusercontent.com/43751992/151819276-7b5dedc0-475b-4eb4-bc27-f29d799646d0.png) -The feature matrix is an NxN matrix which stores the extracted feature values for all frames in our motion database based upon a given feature schema. The feature schema defines the order of the columns and values and is used to identify values and find their location inside the matrix. +## Feature matrix + +The feature matrix is a NxM matrix that stores the extracted feature values for all frames in our motion database based upon a given feature schema. The feature schema defines the order of the columns and values and is used to identify values and find their location inside the matrix. A 3D position feature storing XYZ values e.g. will use three columns in the feature matrix. Every component of a feature is linked to a column index, so e.g. the left foot position Y value might be at column index 6. The group of values or columns that belong to a given feature is what we call a feature block. The accumulated number of dimensions for all features in the schema, while the number of dimensions might vary per feature, form the number of columns of the feature matrix. Each row represents the features of a single frame of the motion database. The number of rows of the feature matrix is defined by the number. -![Feature Schema](Docs/Images/FeatureSchema.png) +> Memory usage: A motion capture database holding 1 hour of animation data together with a sample rate of 30 Hz to extract features, resulting in 108,000 frames, using the default feature schema having 59 features, will result in a feature matrix holding ~6.4 million values and use ~24.3 MB of memory. -# Trajectory History +## Frame database (Motion database) + +A set of frames from your animations sampled at a given sample rate is stored in the frame database. A frame object knows about its index in the frame database, the animation it belongs to, and the sample time in seconds. It does not hold the sampled pose for memory reasons as the `EMotionFX::Motion` already stores the transform keyframes. + +The sample rate of the animation might differ from the sample rate used for the frame database. For example, your animations might be recorded with 60 Hz while we only want to extract the features with a sample rate of 30 Hz. As the motion matching algorithm is blending between the frames in the motion database while playing the animation window between the jumps/blends, it can make sense to have animations with a higher sample rate than we use to extract the features. + +A frame of the motion database can be used to sample a pose from which we can extract the features. It also provides functionality to sample a pose with a time offset to that frame. This can be handy to calculate joint velocities or trajectory samples. + +When importing animations, frames that are within the range of a discard frame motion event are ignored and won't be added to the motion database. Discard motion events can be used to cut out sections of the imported animations that are unwanted like a stretching part between two dance cards. + +## Trajectory history The trajectory history stores world space position and facing direction data of the root joint (motion extraction joint) with each game tick. The maximum recording time is adjustable but needs to be at least as long as the past trajectory window from the trajectory feature as the trajectory history is used to build the query for the past trajectory feature. -# Motion Matching data +![Trajectory Feature](https://user-images.githubusercontent.com/43751992/151819315-beb8d9a1-69ca-49cd-bec0-ba2bae2dc469.png) -Data based on a given skeleton but independent of the instance like the motion capture database, the feature schema or feature matrix is stored in here. It is just a wrapper to group the sharable data. +## Motion Matching data -# Motion Matching instance +Data based on a given skeleton but independent of the instance like the motion capture database, the feature schema or feature matrix is stored here. It is just a wrapper to group the sharable data. -The instance is where everything comes together. It stores the trajectory history, the trajectory query along with the query vector, knows about the last lowest cost frame frame index and stores the time of the animation that the instance is currently playing. It is responsible for motion extraction, blending towards a new frame in the motion capture database in case the algorithm found a better matching frame and executes the actual search. +## Motion Matching instance -# Architecture Diagram -![Class Diagram](Docs/Images/ArchitectureDiagram.png) \ No newline at end of file +The instance is where everything comes together. It stores the trajectory history, the trajectory query along with the query vector, knows about the last lowest cost frame index, and stores the time of the animation that the instance is currently playing. It is responsible for motion extraction, blending towards a new frame in the motion capture database in case the algorithm found a better matching frame and executes the actual search. + +## Architecture +![Class Diagram](https://user-images.githubusercontent.com/43751992/151819361-878edcb5-2b1f-4867-bb7f-8ed5c09a075a.png) + +## Jupyter notebook + +### Feature histograms + +In the image below you can see histograms per feature component showing their value distributions across the motion database. They can provide interesting insights, like e.g. if the motion database is holding more moving forward animations than it has strafing or backward moving animations, or how many fast vs slow turning animations are in the database. This information can be used to see if there is still a need to record some animations or if some type of animation is overrepresented and will lead to ambiguity and decrease the quality of the resulting synthesized animation. + +![Feature Histograms](https://user-images.githubusercontent.com/43751992/151819418-63580dc0-4358-4034-b60d-e8f1cbe138e2.png) + +### Scatterplot using PCA + +The image below shows our high-dimensional feature matrix data projected down to two dimensions using principal component analysis. The density of the clusters and the distribution of the samples overall indicate how hard it is for the search algorithm to find a good matching frame candidate. + +> Clusters in the image after multiple projections might still be separatable over one of the diminished dimensions. + +![Feature Scatterplot PCA](https://user-images.githubusercontent.com/43751992/151819455-b1272ce8-423b-4037-9a7c-f4cd0044c25b.png) \ No newline at end of file From 5ec416ca1f90d1060fae4027411bec788c87be9e Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 31 Jan 2022 10:41:18 -0600 Subject: [PATCH 349/394] Asset processor: separate modtime scanning tests (#7217) * Move modtime scanning tests out of APM tests file and into its own file. Changes were kept to a minimum to get things compiling, this is just a move of code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix rebase compile errors Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../assetprocessor_test_files.cmake | 2 + .../tests/PathDependencyManagerTests.cpp | 8 +- .../native/tests/SourceFileRelocatorTests.cpp | 4 +- .../AssetProcessorManagerTest.cpp | 851 ------------------ .../assetmanager/AssetProcessorManagerTest.h | 141 ++- .../assetmanager/ModtimeScanningTests.cpp | 706 +++++++++++++++ .../tests/assetmanager/ModtimeScanningTests.h | 105 +++ 7 files changed, 927 insertions(+), 890 deletions(-) create mode 100644 Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.cpp create mode 100644 Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.h diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index 20ab4b706d..bc7b16cc79 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -30,6 +30,8 @@ set(FILES native/tests/assetBuilderSDK/SerializationDependenciesTests.cpp native/tests/assetmanager/AssetProcessorManagerTest.cpp native/tests/assetmanager/AssetProcessorManagerTest.h + native/tests/assetmanager/ModtimeScanningTests.cpp + native/tests/assetmanager/ModtimeScanningTests.h native/tests/utilities/assetUtilsTest.cpp native/tests/platformconfiguration/platformconfigurationtests.cpp native/tests/platformconfiguration/platformconfigurationtests.h diff --git a/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp b/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp index 1d6e92e47e..5103643833 100644 --- a/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp @@ -49,7 +49,7 @@ namespace UnitTests } struct PathDependencyBase - : UnitTest::TraceBusRedirector + : ::UnitTest::TraceBusRedirector { void Init(); void Destroy(); @@ -65,7 +65,7 @@ namespace UnitTests }; struct PathDependencyDeletionTest - : UnitTest::ScopedAllocatorSetupFixture + : ::UnitTest::ScopedAllocatorSetupFixture , PathDependencyBase { void SetUp() override @@ -357,7 +357,7 @@ namespace UnitTests } struct PathDependencyBenchmarks - : UnitTest::ScopedAllocatorFixture + : ::UnitTest::ScopedAllocatorFixture , PathDependencyBase { static inline constexpr int NumTestDependencies = 4; // Must be a multiple of 4 @@ -530,7 +530,7 @@ namespace UnitTests BENCHMARK_F(PathDependencyBenchmarksWrapperClass, BM_DeferredWildcardDependencyResolution)(benchmark::State& state) { - for (auto _ : state) + for ([[maybe_unused]] auto unused : state) { m_benchmarks->m_stateData->SetProductDependencies(m_benchmarks->m_dependencies); diff --git a/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp b/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp index 8d52ba23bd..bd2ef8b3cd 100644 --- a/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp @@ -191,7 +191,7 @@ namespace UnitTests m_data->m_perforceComponent = AZStd::make_unique(); m_data->m_perforceComponent->Activate(); - m_data->m_perforceComponent->SetConnection(new UnitTest::MockPerforceConnection(m_command)); + m_data->m_perforceComponent->SetConnection(new ::UnitTest::MockPerforceConnection(m_command)); } void TearDown() override @@ -876,7 +876,7 @@ namespace UnitTests QDir tempPath(m_tempDir.path()); auto filePath = QDir(tempPath.absoluteFilePath(m_data->m_scanFolder1.m_scanFolder.c_str())).absoluteFilePath("duplicate/file1.tif"); - + ASSERT_TRUE(AZ::IO::FileIOBase::GetInstance()->Exists(filePath.toUtf8().constData())); auto result = m_data->m_reporter->Delete(filePath.toUtf8().constData(), false); diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp index 0908d0fdb9..347d2a6842 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp @@ -22,108 +22,6 @@ using namespace AssetProcessor; -class AssetProcessorManager_Test - : public AssetProcessorManager -{ -public: - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, AssetProcessedImpl_DifferentProductDependenciesPerProduct_SavesCorrectlyToDatabase); - - friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies); - friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_DeferredResolution); - friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, SameFilenameForAllPlatforms); - - friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_SourcePath); - - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, DeleteFolder_SignalsDeleteOfContainedFiles); - - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_BasicTest); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_WithDifferentTypes_BasicTest); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_Reverse_BasicTest); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_MissingFiles_ReturnsNoPathWithPlaceholders); - - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_BeforeComputingDirtiness_AllDirty); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_EmptyDatabase_AllDirty); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_SameAsLastTime_NoneDirty); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_MoreThanLastTime_NewOneIsDirty); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_FewerThanLastTime_Dirty); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_ChangedPattern_CountsAsNew); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_ChangedPatternType_CountsAsNew); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_NewPattern_CountsAsNewBuilder); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_NewVersionNumber_IsNotANewBuilder); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_NewAnalysisFingerprint_IsNotANewBuilder); - - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_BasicTest); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_UpdateTest); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByUuid); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByName); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByUuid_UpdatesWhenTheyAppear); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByName_UpdatesWhenTheyAppear); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_WildcardMissingFiles_ByName_UpdatesWhenTheyAppear); - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, JobDependencyOrderOnce_MultipleJobs_EmitOK); - - friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, SourceFileProcessFailure_ClearsFingerprint); - - friend class GTEST_TEST_CLASS_NAME_(AbsolutePathProductDependencyTest, UnresolvedProductPathDependency_AssetProcessedTwice_DoesNotDuplicateDependency); - friend class GTEST_TEST_CLASS_NAME_(AbsolutePathProductDependencyTest, AbsolutePathProductDependency_RetryDeferredDependenciesWithMatchingSource_DependencyResolves); - friend class GTEST_TEST_CLASS_NAME_(AbsolutePathProductDependencyTest, UnresolvedProductPathDependency_AssetProcessedTwice_ValidatePathDependenciesMap); - friend class GTEST_TEST_CLASS_NAME_(AbsolutePathProductDependencyTest, UnresolvedSourceFileTypeProductPathDependency_DependencyHasNoProductOutput_ValidatePathDependenciesMap); - - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_FileUnchanged_WithoutModtimeSkipping); - - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_FileUnchanged); - - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_EnablePlatform_ShouldProcessFilesForPlatform); - - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyFile); - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyFile_AndThenRevert_ProcessesAgain); - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyFilesSameHash_BothProcess); - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyTimestamp); - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyTimestampNoHashing_ProcessesFile); - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_ModifyMetadataFile); - friend class GTEST_TEST_CLASS_NAME_(ModtimeScanningTest, ModtimeSkipping_DeleteFile); - friend class GTEST_TEST_CLASS_NAME_(DeleteTest, DeleteFolderSharedAcrossTwoScanFolders_CorrectFileAndFolderAreDeletedFromCache); - friend class GTEST_TEST_CLASS_NAME_(MetadataFileTest, MetadataFile_SourceFileExtensionDifferentCase); - - friend class AssetProcessorManagerTest; - friend struct ModtimeScanningTest; - friend struct JobDependencyTest; - friend struct ChainJobDependencyTest; - friend struct DeleteTest; - friend struct PathDependencyTest; - friend struct DuplicateProductsTest; - friend struct DuplicateProcessTest; - friend struct AbsolutePathProductDependencyTest; - friend struct WildcardSourceDependencyTest; - - explicit AssetProcessorManager_Test(PlatformConfiguration* config, QObject* parent = nullptr); - ~AssetProcessorManager_Test() override; - - bool CheckJobKeyToJobRunKeyMap(AZStd::string jobKey); - - int CountDirtyBuilders() const - { - int numDirty = 0; - for (const auto& element : m_builderDataCache) - { - if (element.second.m_isDirty) - { - ++numDirty; - } - } - return numDirty; - } - - bool IsBuilderDirty(const AZ::Uuid& builderBusId) const - { - auto finder = m_builderDataCache.find(builderBusId); - if (finder == m_builderDataCache.end()) - { - return true; - } - return finder->second.m_isDirty; - } -}; - AssetProcessorManager_Test::AssetProcessorManager_Test(AssetProcessor::PlatformConfiguration* config, QObject* parent /*= 0*/) :AssetProcessorManager(config, parent) { @@ -3839,632 +3737,6 @@ TEST_F(AssetProcessorManagerTest, SourceFileProcessFailure_ClearsFingerprint) ASSERT_EQ(source.m_analysisFingerprint, ""); } -void ModtimeScanningTest::SetUp() -{ - AssetProcessorManagerTest::SetUp(); - - m_data = AZStd::make_unique(); - - // We don't want the mock application manager to provide builder descriptors, mockBuilderInfoHandler will provide our own - m_mockApplicationManager->BusDisconnect(); - - m_data->m_mockBuilderInfoHandler.m_builderDesc = m_data->m_mockBuilderInfoHandler.CreateBuilderDesc("test builder", "{DF09DDC0-FD22-43B6-9E22-22C8574A6E1E}", { AssetBuilderSDK::AssetBuilderPattern("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard) }); - m_data->m_mockBuilderInfoHandler.BusConnect(); - - ASSERT_TRUE(m_mockApplicationManager->GetBuilderByID("txt files", m_data->m_builderTxtBuilder)); - - // Run this twice so the test builder doesn't get counted as a "new" builder and bypass the modtime skipping - m_assetProcessorManager->ComputeBuilderDirty(); - m_assetProcessorManager->ComputeBuilderDirty(); - - auto assetConnection = QObject::connect(m_assetProcessorManager.get(), &AssetProcessorManager::AssetToProcess, [this](JobDetails details) - { - m_data->m_processResults.push_back(AZStd::move(details)); - }); - - auto deletedConnection = QObject::connect(m_assetProcessorManager.get(), &AssetProcessorManager::SourceDeleted, [this](QString file) - { - m_data->m_deletedSources.push_back(file); - }); - - // Create the test file - const auto& scanFolder = m_config->GetScanFolderAt(0); - m_data->m_relativePathFromWatchFolder[0] = "modtimeTestFile.txt"; - m_data->m_absolutePath.push_back(QDir(scanFolder.ScanPath()).absoluteFilePath(m_data->m_relativePathFromWatchFolder[0])); - - m_data->m_relativePathFromWatchFolder[1] = "modtimeTestDependency.txt"; - m_data->m_absolutePath.push_back(QDir(scanFolder.ScanPath()).absoluteFilePath(m_data->m_relativePathFromWatchFolder[1])); - - m_data->m_relativePathFromWatchFolder[2] = "modtimeTestDependency.txt.assetinfo"; - m_data->m_absolutePath.push_back(QDir(scanFolder.ScanPath()).absoluteFilePath(m_data->m_relativePathFromWatchFolder[2])); - - for (const auto& path : m_data->m_absolutePath) - { - ASSERT_TRUE(UnitTestUtils::CreateDummyFile(path, "")); - } - - m_data->m_mockBuilderInfoHandler.m_dependencyFilePath = m_data->m_absolutePath[1].toUtf8().data(); - - // Add file to database with no modtime - { - AssetDatabaseConnection connection; - ASSERT_TRUE(connection.OpenDatabase()); - AzToolsFramework::AssetDatabase::FileDatabaseEntry fileEntry; - fileEntry.m_fileName = m_data->m_relativePathFromWatchFolder[0].toUtf8().data(); - fileEntry.m_modTime = 0; - fileEntry.m_isFolder = false; - fileEntry.m_scanFolderPK = scanFolder.ScanFolderID(); - - bool entryAlreadyExists; - ASSERT_TRUE(connection.InsertFile(fileEntry, entryAlreadyExists)); - ASSERT_FALSE(entryAlreadyExists); - - fileEntry.m_fileID = AzToolsFramework::AssetDatabase::InvalidEntryId; // Reset the id so we make a new entry - fileEntry.m_fileName = m_data->m_relativePathFromWatchFolder[1].toUtf8().data(); - ASSERT_TRUE(connection.InsertFile(fileEntry, entryAlreadyExists)); - ASSERT_FALSE(entryAlreadyExists); - - fileEntry.m_fileID = AzToolsFramework::AssetDatabase::InvalidEntryId; // Reset the id so we make a new entry - fileEntry.m_fileName = m_data->m_relativePathFromWatchFolder[2].toUtf8().data(); - ASSERT_TRUE(connection.InsertFile(fileEntry, entryAlreadyExists)); - ASSERT_FALSE(entryAlreadyExists); - } - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ASSERT_TRUE(BlockUntilIdle(5000)); - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 2); - ASSERT_EQ(m_data->m_processResults.size(), 2); - ASSERT_EQ(m_data->m_deletedSources.size(), 0); - - ProcessAssetJobs(); - - m_data->m_processResults.clear(); - m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; - - m_isIdling = false; -} - -void ModtimeScanningTest::TearDown() -{ - m_data = nullptr; - - AssetProcessorManagerTest::TearDown(); -} - -void ModtimeScanningTest::ProcessAssetJobs() -{ - m_data->m_productPaths.clear(); - - for (const auto& processResult : m_data->m_processResults) - { - auto file = QDir(processResult.m_destinationPath).absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName.toLower() + ".arc1"); - m_data->m_productPaths.emplace( - QDir(processResult.m_jobEntry.m_watchFolderPath) - .absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName) - .toUtf8() - .constData(), - file); - - // Create the file on disk - ASSERT_TRUE(UnitTestUtils::CreateDummyFile(file, "products.")); - - AssetBuilderSDK::ProcessJobResponse response; - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(file.toUtf8().constData(), AZ::Uuid::CreateNull(), 1)); - - QMetaObject::invokeMethod(m_assetProcessorManager.get(), "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResult.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); - } - - ASSERT_TRUE(BlockUntilIdle(5000)); - - m_isIdling = false; -} - -void ModtimeScanningTest::SimulateAssetScanner(QSet filePaths) -{ - QMetaObject::invokeMethod(m_assetProcessorManager.get(), "OnAssetScannerStatusChange", Qt::QueuedConnection, Q_ARG(AssetProcessor::AssetScanningStatus, AssetProcessor::AssetScanningStatus::Started)); - QMetaObject::invokeMethod(m_assetProcessorManager.get(), "AssessFilesFromScanner", Qt::QueuedConnection, Q_ARG(QSet, filePaths)); - QMetaObject::invokeMethod(m_assetProcessorManager.get(), "OnAssetScannerStatusChange", Qt::QueuedConnection, Q_ARG(AssetProcessor::AssetScanningStatus, AssetProcessor::AssetScanningStatus::Completed)); -} - -QSet ModtimeScanningTest::BuildFileSet() -{ - QSet filePaths; - - for (const auto& path : m_data->m_absolutePath) - { - QFileInfo fileInfo(path); - auto modtime = fileInfo.lastModified(); - AZ::u64 fileSize = fileInfo.size(); - filePaths.insert(AssetFileInfo(path, modtime, fileSize, m_config->GetScanFolderForFile(path), false)); - } - - return filePaths; -} - -void ModtimeScanningTest::ExpectWork(int createJobs, int processJobs) -{ - ASSERT_TRUE(BlockUntilIdle(5000)); - - EXPECT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, createJobs); - EXPECT_EQ(m_data->m_processResults.size(), processJobs); - EXPECT_FALSE(m_data->m_processResults[0].m_autoFail); - EXPECT_FALSE(m_data->m_processResults[1].m_autoFail); - EXPECT_EQ(m_data->m_deletedSources.size(), 0); - - m_isIdling = false; -} - -void ModtimeScanningTest::ExpectNoWork() -{ - // Since there's no work to do, the idle event isn't going to trigger, just process events a couple times - for (int i = 0; i < 10; ++i) - { - QCoreApplication::processEvents(QEventLoop::AllEvents, 10); - } - - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 0); - ASSERT_EQ(m_data->m_processResults.size(), 0); - ASSERT_EQ(m_data->m_deletedSources.size(), 0); - - m_isIdling = false; -} - -void ModtimeScanningTest::SetFileContents(QString filePath, QString contents) -{ - QFile file(filePath); - file.open(QIODevice::WriteOnly | QIODevice::Truncate); - file.write(contents.toUtf8().constData()); - file.close(); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_FileUnchanged_WithoutModtimeSkipping) -{ - using namespace AzToolsFramework::AssetSystem; - - // Make sure modtime skipping is disabled - // We're just going to do 1 quick sanity test to make sure the files are still processed when modtime skipping is turned off - m_assetProcessorManager->m_allowModtimeSkippingFeature = false; - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - // 2 create jobs but 0 process jobs because the file has already been processed before in SetUp - ExpectWork(2, 0); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_FileUnchanged) -{ - using namespace AzToolsFramework::AssetSystem; - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ExpectNoWork(); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_EnablePlatform_ShouldProcessFilesForPlatform) -{ - using namespace AzToolsFramework::AssetSystem; - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - // Enable android platform after the initial SetUp has already processed the files for pc - QDir tempPath(m_tempDir.path()); - AssetBuilderSDK::PlatformInfo androidPlatform("android", { "host", "renderer" }); - m_config->EnablePlatform(androidPlatform, true); - - // There's no way to remove scanfolders and adding a new one after enabling the platform will cause the pc assets to build as well, which we don't want - // Instead we'll just const cast the vector and modify the enabled platforms for the scanfolder - auto& platforms = const_cast&>(m_config->GetScanFolderAt(0).GetPlatforms()); - platforms.push_back(androidPlatform); - - // We need the builder fingerprints to be updated to reflect the newly enabled platform - m_assetProcessorManager->ComputeBuilderDirty(); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ExpectWork(4, 2); // CreateJobs = 4, 2 files * 2 platforms. ProcessJobs = 2, just the android platform jobs (pc is already processed) - - ASSERT_TRUE(m_data->m_processResults[0].m_destinationPath.contains("android")); - ASSERT_TRUE(m_data->m_processResults[1].m_destinationPath.contains("android")); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyTimestamp) -{ - // Update the timestamp on a file without changing its contents - // This should not cause any job to run since the hash of the file is the same before/after - // Additionally, the timestamp stored in the database should be updated - using namespace AzToolsFramework::AssetSystem; - - uint64_t timestamp = 1594923423; - - QString databaseName, scanfolderName; - m_config->ConvertToRelativePath(m_data->m_absolutePath[1], databaseName, scanfolderName); - auto* scanFolder = m_config->GetScanFolderForFile(m_data->m_absolutePath[1]); - - AzToolsFramework::AssetDatabase::FileDatabaseEntry fileEntry; - - m_assetProcessorManager.get()->m_stateData->GetFileByFileNameAndScanFolderId(databaseName, scanFolder->ScanFolderID(), fileEntry); - - ASSERT_NE(fileEntry.m_modTime, timestamp); - uint64_t existingTimestamp = fileEntry.m_modTime; - - // Modify the timestamp on just one file - AzToolsFramework::ToolsFileUtils::SetModificationTime(m_data->m_absolutePath[1].toUtf8().data(), timestamp); - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ExpectNoWork(); - - m_assetProcessorManager.get()->m_stateData->GetFileByFileNameAndScanFolderId(databaseName, scanFolder->ScanFolderID(), fileEntry); - - // The timestamp should be updated even though nothing processed - ASSERT_NE(fileEntry.m_modTime, existingTimestamp); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyTimestampNoHashing_ProcessesFile) -{ - // Update the timestamp on a file without changing its contents - // This should not cause any job to run since the hash of the file is the same before/after - // Additionally, the timestamp stored in the database should be updated - using namespace AzToolsFramework::AssetSystem; - - uint64_t timestamp = 1594923423; - - // Modify the timestamp on just one file - AzToolsFramework::ToolsFileUtils::SetModificationTime(m_data->m_absolutePath[1].toUtf8().data(), timestamp); - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, false); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ExpectWork(2, 2); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFile) -{ - using namespace AzToolsFramework::AssetSystem; - - SetFileContents(m_data->m_absolutePath[1].toUtf8().constData(), "hello world"); - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers the other test file to process as well - ExpectWork(2, 2); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFile_AndThenRevert_ProcessesAgain) -{ - using namespace AzToolsFramework::AssetSystem; - auto theFile = m_data->m_absolutePath[1].toUtf8(); - const char* theFileString = theFile.constData(); - - SetFileContents(theFileString, "hello world"); - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers the other test file to process as well - ExpectWork(2, 2); - ProcessAssetJobs(); - - m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; - m_data->m_processResults.clear(); - m_data->m_deletedSources.clear(); - - SetFileContents(theFileString, ""); - - filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - // Expect processing to happen again - ExpectWork(2, 2); -} - -struct LockedFileTest - : ModtimeScanningTest - , AssetProcessor::ConnectionBus::Handler -{ - MOCK_METHOD3(SendRaw, size_t (unsigned, unsigned, const QByteArray&)); - MOCK_METHOD3(SendPerPlatform, size_t (unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&, const QString&)); - MOCK_METHOD4(SendRawPerPlatform, size_t (unsigned, unsigned, const QByteArray&, const QString&)); - MOCK_METHOD2(SendRequest, unsigned (const AzFramework::AssetSystem::BaseAssetProcessorMessage&, const ResponseCallback&)); - MOCK_METHOD2(SendResponse, size_t (unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&)); - MOCK_METHOD1(RemoveResponseHandler, void (unsigned)); - - size_t Send(unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage& message) override - { - using SourceFileNotificationMessage = AzToolsFramework::AssetSystem::SourceFileNotificationMessage; - switch (message.GetMessageType()) - { - case SourceFileNotificationMessage::MessageType: - if (const auto sourceFileMessage = azrtti_cast(&message); sourceFileMessage != nullptr && - sourceFileMessage->m_type == SourceFileNotificationMessage::NotificationType::FileRemoved) - { - // The File Remove message will occur before an attempt to delete the file - // Wait for more than 1 File Remove message. - // This indicates the AP has attempted to delete the file once, failed to do so and is now retrying - ++m_deleteCounter; - - if(m_deleteCounter > 1 && m_callback) - { - m_callback(); - m_callback = {}; // Unset it to be safe, we only intend to run the callback once - } - } - break; - default: - break; - } - - return 0; - } - - void SetUp() override - { - ModtimeScanningTest::SetUp(); - - ConnectionBus::Handler::BusConnect(0); - } - - void TearDown() override - { - ConnectionBus::Handler::BusDisconnect(); - - ModtimeScanningTest::TearDown(); - } - - AZStd::atomic_int m_deleteCounter{ 0 }; - AZStd::function m_callback; -}; - -TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeleteFails) -{ - auto theFile = m_data->m_absolutePath[1].toUtf8(); - const char* theFileString = theFile.constData(); - auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); - - { - QFile file(theFileString); - file.remove(); - } - - ASSERT_GT(m_data->m_productPaths.size(), 0); - QFile product(productPath); - - ASSERT_TRUE(product.open(QIODevice::ReadOnly)); - - // Check if we can delete the file now, if we can't, proceed with the test - // If we can, it means the OS running this test doesn't lock open files so there's nothing to test - if (!AZ::IO::SystemFile::Delete(productPath.toUtf8().constData())) - { - QMetaObject::invokeMethod( - m_assetProcessorManager.get(), "AssessDeletedFile", Qt::QueuedConnection, Q_ARG(QString, QString(theFileString))); - - EXPECT_TRUE(BlockUntilIdle(5000)); - - EXPECT_TRUE(QFile::exists(productPath)); - EXPECT_EQ(m_data->m_deletedSources.size(), 0); - } - else - { - SUCCEED() << "Skipping test. OS does not lock open files."; - } -} - -TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeletesWhenReleased) -{ - // This test is intended to verify the AP will successfully retry deleting a source asset - // when one of its product assets is locked temporarily - // We'll lock the file by holding it open - - auto theFile = m_data->m_absolutePath[1].toUtf8(); - const char* theFileString = theFile.constData(); - auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); - - { - QFile file(theFileString); - file.remove(); - } - - ASSERT_GT(m_data->m_productPaths.size(), 0); - QFile product(productPath); - - // Open the file and keep it open to lock it - // We'll start a thread later to unlock the file - // This will allow us to test how AP handles trying to delete a locked file - ASSERT_TRUE(product.open(QIODevice::ReadOnly)); - - // Check if we can delete the file now, if we can't, proceed with the test - // If we can, it means the OS running this test doesn't lock open files so there's nothing to test - if (!AZ::IO::SystemFile::Delete(productPath.toUtf8().constData())) - { - m_deleteCounter = 0; - - // Set up a callback which will fire after at least 1 retry - // Unlock the file at that point so AP can successfully delete it - m_callback = [&product]() - { - product.close(); - }; - - QMetaObject::invokeMethod( - m_assetProcessorManager.get(), "AssessDeletedFile", Qt::QueuedConnection, Q_ARG(QString, QString(theFileString))); - - EXPECT_TRUE(BlockUntilIdle(5000)); - - EXPECT_FALSE(QFile::exists(productPath)); - EXPECT_EQ(m_data->m_deletedSources.size(), 1); - - EXPECT_GT(m_deleteCounter, 1); // Make sure the AP tried more than once to delete the file - m_errorAbsorber->ExpectAsserts(0); - } - else - { - SUCCEED() << "Skipping test. OS does not lock open files."; - } -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFilesSameHash_BothProcess) -{ - using namespace AzToolsFramework::AssetSystem; - - SetFileContents(m_data->m_absolutePath[1].toUtf8().constData(), "hello world"); - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers the other test file to process as well - ExpectWork(2, 2); - ProcessAssetJobs(); - - m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; - m_data->m_processResults.clear(); - m_data->m_deletedSources.clear(); - - // Make file 0 have the same contents as file 1 - SetFileContents(m_data->m_absolutePath[0].toUtf8().constData(), "hello world"); - - filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ExpectWork(1, 1); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyMetadataFile) -{ - using namespace AzToolsFramework::AssetSystem; - - SetFileContents(m_data->m_absolutePath[2].toUtf8().constData(), "hello world"); - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a metadata file - // that triggers the source file which is a dependency that triggers the other test file to process as well - ExpectWork(2, 2); -} - -TEST_F(ModtimeScanningTest, ModtimeSkipping_DeleteFile) -{ - using namespace AzToolsFramework::AssetSystem; - - // Enable the features we're testing - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - AssetUtilities::SetUseFileHashOverride(true, true); - - ASSERT_TRUE(QFile::remove(m_data->m_absolutePath[0])); - - // Feed in ONLY one file (the one we didn't delete) - QSet filePaths; - QFileInfo fileInfo(m_data->m_absolutePath[1]); - auto modtime = fileInfo.lastModified(); - AZ::u64 fileSize = fileInfo.size(); - filePaths.insert(AssetFileInfo(m_data->m_absolutePath[1], modtime, fileSize, &m_config->GetScanFolderAt(0), false)); - - SimulateAssetScanner(filePaths); - - QElapsedTimer timer; - timer.start(); - - do - { - QCoreApplication::processEvents(QEventLoop::AllEvents, 10); - } while (m_data->m_deletedSources.size() < m_data->m_relativePathFromWatchFolder[0].size() && timer.elapsed() < 5000); - - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 0); - ASSERT_EQ(m_data->m_processResults.size(), 0); - ASSERT_THAT(m_data->m_deletedSources, testing::ElementsAre(m_data->m_relativePathFromWatchFolder[0])); -} - -TEST_F(ModtimeScanningTest, ReprocessRequest_FileNotModified_FileProcessed) -{ - using namespace AzToolsFramework::AssetSystem; - - m_assetProcessorManager->RequestReprocess(m_data->m_absolutePath[0]); - - ASSERT_TRUE(BlockUntilIdle(5000)); - - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 1); - ASSERT_EQ(m_data->m_processResults.size(), 1); -} - -TEST_F(ModtimeScanningTest, ReprocessRequest_SourceWithDependency_BothWillProcess) -{ - using namespace AzToolsFramework::AssetSystem; - - using SourceFileDependencyEntry = AzToolsFramework::AssetDatabase::SourceFileDependencyEntry; - - SourceFileDependencyEntry newEntry1; - newEntry1.m_sourceDependencyID = AzToolsFramework::AssetDatabase::InvalidEntryId; - newEntry1.m_builderGuid = AZ::Uuid::CreateRandom(); - newEntry1.m_source = m_data->m_absolutePath[0].toUtf8().constData(); - newEntry1.m_dependsOnSource = m_data->m_absolutePath[1].toUtf8().constData(); - newEntry1.m_typeOfDependency = SourceFileDependencyEntry::DEP_SourceToSource; - - m_assetProcessorManager->RequestReprocess(m_data->m_absolutePath[0]); - ASSERT_TRUE(BlockUntilIdle(5000)); - - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 1); - ASSERT_EQ(m_data->m_processResults.size(), 1); - - m_assetProcessorManager->RequestReprocess(m_data->m_absolutePath[1]); - ASSERT_TRUE(BlockUntilIdle(5000)); - - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 3); - ASSERT_EQ(m_data->m_processResults.size(), 3); -} - -TEST_F(ModtimeScanningTest, ReprocessRequest_RequestFolder_SourceAssetsWillProcess) -{ - using namespace AzToolsFramework::AssetSystem; - - const auto& scanFolder = m_config->GetScanFolderAt(0); - - QString scanPath = scanFolder.ScanPath(); - m_assetProcessorManager->RequestReprocess(scanPath); - ASSERT_TRUE(BlockUntilIdle(5000)); - - // two text files are source assets, assetinfo is not - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 2); - ASSERT_EQ(m_data->m_processResults.size(), 2); -} - ////////////////////////////////////////////////////////////////////////// MockBuilderInfoHandler::~MockBuilderInfoHandler() @@ -5205,130 +4477,7 @@ TEST_F(ChainJobDependencyTest, TestChainDependency_Multi) } } -void DeleteTest::SetUp() -{ - AssetProcessorManagerTest::SetUp(); - m_data = AZStd::make_unique(); - - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - - // We don't want the mock application manager to provide builder descriptors, mockBuilderInfoHandler will provide our own - m_mockApplicationManager->BusDisconnect(); - - m_data->m_mockBuilderInfoHandler.m_builderDesc = m_data->m_mockBuilderInfoHandler.CreateBuilderDesc("test builder", "{DF09DDC0-FD22-43B6-9E22-22C8574A6E1E}", { AssetBuilderSDK::AssetBuilderPattern("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard) }); - m_data->m_mockBuilderInfoHandler.BusConnect(); - - ASSERT_TRUE(m_mockApplicationManager->GetBuilderByID("txt files", m_data->m_builderTxtBuilder)); - - // Run this twice so the test builder doesn't get counted as a "new" builder and bypass the modtime skipping - m_assetProcessorManager->ComputeBuilderDirty(); - m_assetProcessorManager->ComputeBuilderDirty(); - - auto setupConnectionsFunc = [this]() - { - QObject::connect(m_assetProcessorManager.get(), &AssetProcessorManager::AssetToProcess, [this](JobDetails details) - { - m_data->m_processResults.push_back(AZStd::move(details)); - }); - - QObject::connect(m_assetProcessorManager.get(), &AssetProcessorManager::SourceDeleted, [this](QString file) - { - m_data->m_deletedSources.push_back(file); - }); - }; - - auto createFileAndAddToDatabaseFunc = [this](const AssetProcessor::ScanFolderInfo* scanFolder, QString file) - { - using namespace AzToolsFramework::AssetDatabase; - - QString watchFolderPath = scanFolder->ScanPath(); - QString absPath(QDir(watchFolderPath).absoluteFilePath(file)); - UnitTestUtils::CreateDummyFile(absPath); - - m_data->m_absolutePath.push_back(absPath); - - AzToolsFramework::AssetDatabase::FileDatabaseEntry fileEntry; - fileEntry.m_fileName = file.toUtf8().constData(); - fileEntry.m_modTime = 0; - fileEntry.m_isFolder = false; - fileEntry.m_scanFolderPK = scanFolder->ScanFolderID(); - - bool entryAlreadyExists; - ASSERT_TRUE(m_assetProcessorManager->m_stateData->InsertFile(fileEntry, entryAlreadyExists)); - ASSERT_FALSE(entryAlreadyExists); - }; - - setupConnectionsFunc(); - - // Create test files - QDir tempPath(m_tempDir.path()); - const auto* scanFolder1 = m_config->GetScanFolderByPath(tempPath.absoluteFilePath("subfolder1")); - const auto* scanFolder4 = m_config->GetScanFolderByPath(tempPath.absoluteFilePath("subfolder4")); - - createFileAndAddToDatabaseFunc(scanFolder1, QString("textures/a.txt")); - createFileAndAddToDatabaseFunc(scanFolder4, QString("textures/b.txt")); - - // Run the test files through AP all the way to processing stage - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ASSERT_TRUE(BlockUntilIdle(5000)); - ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 2); - ASSERT_EQ(m_data->m_processResults.size(), 2); - ASSERT_EQ(m_data->m_deletedSources.size(), 0); - - ProcessAssetJobs(); - - m_data->m_processResults.clear(); - m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; - - // Reboot the APM since we added stuff to the database that needs to be loaded on-startup of the APM - m_assetProcessorManager.reset(new AssetProcessorManager_Test(m_config.get())); - - m_idleConnection = QObject::connect(m_assetProcessorManager.get(), &AssetProcessor::AssetProcessorManager::AssetProcessorManagerIdleState, [this](bool newState) - { - m_isIdling = newState; - }); - - setupConnectionsFunc(); - - m_assetProcessorManager->ComputeBuilderDirty(); -} - -TEST_F(DeleteTest, DeleteFolderSharedAcrossTwoScanFolders_CorrectFileAndFolderAreDeletedFromCache) -{ - // There was a bug where AP wasn't repopulating the "known folders" list when modtime skipping was enabled and no work was needed - // As a result, deleting a folder didn't count as a "folder", so the wrong code path was taken. This test makes sure the correct deletion events fire - - using namespace AzToolsFramework::AssetSystem; - - // Modtime skipping has to be on for this - m_assetProcessorManager->m_allowModtimeSkippingFeature = true; - - // Feed in the files from the asset scanner, no jobs should run since they're already up-to-date - QSet filePaths = BuildFileSet(); - SimulateAssetScanner(filePaths); - - ExpectNoWork(); - - // Delete one of the folders - QDir tempPath(m_tempDir.path()); - QString absPath(tempPath.absoluteFilePath("subfolder1/textures")); - QDir(absPath).removeRecursively(); - - AZStd::vector deletedFolders; - QObject::connect(m_assetProcessorManager.get(), &AssetProcessorManager::SourceFolderDeleted, [&deletedFolders](QString file) - { - deletedFolders.push_back(file.toUtf8().constData()); - }); - - m_assetProcessorManager->AssessDeletedFile(absPath); - ASSERT_TRUE(BlockUntilIdle(5000)); - - ASSERT_THAT(m_data->m_deletedSources, testing::UnorderedElementsAre("textures/a.txt")); - ASSERT_THAT(deletedFolders, testing::UnorderedElementsAre("textures")); -} void DuplicateProcessTest::SetUp() { diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h index c532b08016..4e644ea457 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h @@ -37,6 +37,114 @@ public: MOCK_METHOD1(GetAssetDatabaseLocation, bool(AZStd::string&)); }; +class AssetProcessorManager_Test : public AssetProcessor::AssetProcessorManager +{ +public: + friend class GTEST_TEST_CLASS_NAME_( + AssetProcessorManagerTest, AssetProcessedImpl_DifferentProductDependenciesPerProduct_SavesCorrectlyToDatabase); + + friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies); + friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_DeferredResolution); + friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, SameFilenameForAllPlatforms); + + friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_SourcePath); + + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, DeleteFolder_SignalsDeleteOfContainedFiles); + + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_BasicTest); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_WithDifferentTypes_BasicTest); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_Reverse_BasicTest); + friend class GTEST_TEST_CLASS_NAME_( + AssetProcessorManagerTest, QueryAbsolutePathDependenciesRecursive_MissingFiles_ReturnsNoPathWithPlaceholders); + + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_BeforeComputingDirtiness_AllDirty); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_EmptyDatabase_AllDirty); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_SameAsLastTime_NoneDirty); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_MoreThanLastTime_NewOneIsDirty); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_FewerThanLastTime_Dirty); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_ChangedPattern_CountsAsNew); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_ChangedPatternType_CountsAsNew); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_NewPattern_CountsAsNewBuilder); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_NewVersionNumber_IsNotANewBuilder); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, BuilderDirtiness_NewAnalysisFingerprint_IsNotANewBuilder); + + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_BasicTest); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_UpdateTest); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByUuid); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByName); + friend class GTEST_TEST_CLASS_NAME_( + AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByUuid_UpdatesWhenTheyAppear); + friend class GTEST_TEST_CLASS_NAME_( + AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_MissingFiles_ByName_UpdatesWhenTheyAppear); + friend class GTEST_TEST_CLASS_NAME_( + AssetProcessorManagerTest, UpdateSourceFileDependenciesDatabase_WildcardMissingFiles_ByName_UpdatesWhenTheyAppear); + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, JobDependencyOrderOnce_MultipleJobs_EmitOK); + + friend class GTEST_TEST_CLASS_NAME_(AssetProcessorManagerTest, SourceFileProcessFailure_ClearsFingerprint); + + friend class GTEST_TEST_CLASS_NAME_( + AbsolutePathProductDependencyTest, UnresolvedProductPathDependency_AssetProcessedTwice_DoesNotDuplicateDependency); + friend class GTEST_TEST_CLASS_NAME_( + AbsolutePathProductDependencyTest, AbsolutePathProductDependency_RetryDeferredDependenciesWithMatchingSource_DependencyResolves); + friend class GTEST_TEST_CLASS_NAME_( + AbsolutePathProductDependencyTest, UnresolvedProductPathDependency_AssetProcessedTwice_ValidatePathDependenciesMap); + friend class GTEST_TEST_CLASS_NAME_( + AbsolutePathProductDependencyTest, + UnresolvedSourceFileTypeProductPathDependency_DependencyHasNoProductOutput_ValidatePathDependenciesMap); + + friend class GTEST_TEST_CLASS_NAME_(DeleteTest, DeleteFolderSharedAcrossTwoScanFolders_CorrectFileAndFolderAreDeletedFromCache); + friend class GTEST_TEST_CLASS_NAME_(MetadataFileTest, MetadataFile_SourceFileExtensionDifferentCase); + + friend class AssetProcessorManagerTest; + friend struct JobDependencyTest; + friend struct ChainJobDependencyTest; + friend struct DeleteTest; + friend struct PathDependencyTest; + friend struct DuplicateProductsTest; + friend struct DuplicateProcessTest; + friend struct AbsolutePathProductDependencyTest; + friend struct WildcardSourceDependencyTest; + + explicit AssetProcessorManager_Test(AssetProcessor::PlatformConfiguration* config, QObject* parent = nullptr); + ~AssetProcessorManager_Test() override; + + bool CheckJobKeyToJobRunKeyMap(AZStd::string jobKey); + + int CountDirtyBuilders() const + { + int numDirty = 0; + for (const auto& element : m_builderDataCache) + { + if (element.second.m_isDirty) + { + ++numDirty; + } + } + return numDirty; + } + + bool IsBuilderDirty(const AZ::Uuid& builderBusId) const + { + auto finder = m_builderDataCache.find(builderBusId); + if (finder == m_builderDataCache.end()) + { + return true; + } + return finder->second.m_isDirty; + } + + void RecomputeDirtyBuilders() + { + // Run this twice so the test builder doesn't get counted as a "new" builder and bypass the modtime skipping + ComputeBuilderDirty(); + ComputeBuilderDirty(); + } + + using AssetProcessorManager::m_stateData; + using AssetProcessorManager::ComputeBuilderDirty; +}; + + class AssetProcessorManagerTest : public AssetProcessor::AssetProcessorTest { @@ -165,33 +273,6 @@ struct MockBuilderInfoHandler int m_createJobsCount = 0; }; -struct ModtimeScanningTest - : public AssetProcessorManagerTest -{ - void SetUp() override; - void TearDown() override; - - void ProcessAssetJobs(); - void SimulateAssetScanner(QSet filePaths); - QSet BuildFileSet(); - void ExpectWork(int createJobs, int processJobs); - void ExpectNoWork(); - void SetFileContents(QString filePath, QString contents); - - struct StaticData - { - QString m_relativePathFromWatchFolder[3]; - AZStd::vector m_absolutePath; - AZStd::vector m_processResults; - AZStd::unordered_multimap m_productPaths; - AZStd::vector m_deletedSources; - AZStd::shared_ptr m_builderTxtBuilder; - MockBuilderInfoHandler m_mockBuilderInfoHandler; - }; - - AZStd::unique_ptr m_data; -}; - struct MetadataFileTest : public AssetProcessorManagerTest @@ -274,9 +355,3 @@ struct DuplicateProductsTest { void SetupDuplicateProductsTest(QString& sourceFile, QDir& tempPath, QString& productFile, AZStd::vector& jobDetails, AssetBuilderSDK::ProcessJobResponse& response, bool multipleOutputs, QString extension); }; - -struct DeleteTest - : public ModtimeScanningTest -{ - void SetUp() override; -}; diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.cpp new file mode 100644 index 0000000000..6b3124ca00 --- /dev/null +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.cpp @@ -0,0 +1,706 @@ +/* + * 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 UnitTests +{ + using AssetFileInfo = AssetProcessor::AssetFileInfo; + + void ModtimeScanningTest::SetUpAssetProcessorManager() + { + using namespace AssetProcessor; + + m_assetProcessorManager->SetEnableModtimeSkippingFeature(true); + m_assetProcessorManager->RecomputeDirtyBuilders(); + + QObject::connect( + m_assetProcessorManager.get(), &AssetProcessorManager::AssetToProcess, + [this](JobDetails details) + { + m_data->m_processResults.push_back(AZStd::move(details)); + }); + + QObject::connect( + m_assetProcessorManager.get(), &AssetProcessorManager::SourceDeleted, + [this](QString file) + { + m_data->m_deletedSources.push_back(file); + }); + + m_idleConnection = QObject::connect( + m_assetProcessorManager.get(), &AssetProcessor::AssetProcessorManager::AssetProcessorManagerIdleState, + [this](bool newState) + { + m_isIdling = newState; + }); + } + + void ModtimeScanningTest::SetUp() + { + using namespace AssetProcessor; + + AssetProcessorManagerTest::SetUp(); + + m_data = AZStd::make_unique(); + + // We don't want the mock application manager to provide builder descriptors, mockBuilderInfoHandler will provide our own + m_mockApplicationManager->BusDisconnect(); + + m_data->m_mockBuilderInfoHandler.m_builderDesc = m_data->m_mockBuilderInfoHandler.CreateBuilderDesc( + "test builder", "{DF09DDC0-FD22-43B6-9E22-22C8574A6E1E}", + { AssetBuilderSDK::AssetBuilderPattern("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard) }); + m_data->m_mockBuilderInfoHandler.BusConnect(); + + ASSERT_TRUE(m_mockApplicationManager->GetBuilderByID("txt files", m_data->m_builderTxtBuilder)); + + SetUpAssetProcessorManager(); + + // Create the test file + const auto& scanFolder = m_config->GetScanFolderAt(0); + m_data->m_relativePathFromWatchFolder[0] = "modtimeTestFile.txt"; + m_data->m_absolutePath.push_back(QDir(scanFolder.ScanPath()).absoluteFilePath(m_data->m_relativePathFromWatchFolder[0])); + + m_data->m_relativePathFromWatchFolder[1] = "modtimeTestDependency.txt"; + m_data->m_absolutePath.push_back(QDir(scanFolder.ScanPath()).absoluteFilePath(m_data->m_relativePathFromWatchFolder[1])); + + m_data->m_relativePathFromWatchFolder[2] = "modtimeTestDependency.txt.assetinfo"; + m_data->m_absolutePath.push_back(QDir(scanFolder.ScanPath()).absoluteFilePath(m_data->m_relativePathFromWatchFolder[2])); + + for (const auto& path : m_data->m_absolutePath) + { + ASSERT_TRUE(UnitTestUtils::CreateDummyFile(path, "")); + } + + m_data->m_mockBuilderInfoHandler.m_dependencyFilePath = m_data->m_absolutePath[1].toUtf8().data(); + + // Add file to database with no modtime + { + AssetDatabaseConnection connection; + ASSERT_TRUE(connection.OpenDatabase()); + AzToolsFramework::AssetDatabase::FileDatabaseEntry fileEntry; + fileEntry.m_fileName = m_data->m_relativePathFromWatchFolder[0].toUtf8().data(); + fileEntry.m_modTime = 0; + fileEntry.m_isFolder = false; + fileEntry.m_scanFolderPK = scanFolder.ScanFolderID(); + + bool entryAlreadyExists; + ASSERT_TRUE(connection.InsertFile(fileEntry, entryAlreadyExists)); + ASSERT_FALSE(entryAlreadyExists); + + fileEntry.m_fileID = AzToolsFramework::AssetDatabase::InvalidEntryId; // Reset the id so we make a new entry + fileEntry.m_fileName = m_data->m_relativePathFromWatchFolder[1].toUtf8().data(); + ASSERT_TRUE(connection.InsertFile(fileEntry, entryAlreadyExists)); + ASSERT_FALSE(entryAlreadyExists); + + fileEntry.m_fileID = AzToolsFramework::AssetDatabase::InvalidEntryId; // Reset the id so we make a new entry + fileEntry.m_fileName = m_data->m_relativePathFromWatchFolder[2].toUtf8().data(); + ASSERT_TRUE(connection.InsertFile(fileEntry, entryAlreadyExists)); + ASSERT_FALSE(entryAlreadyExists); + } + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ASSERT_TRUE(BlockUntilIdle(5000)); + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 2); + ASSERT_EQ(m_data->m_processResults.size(), 2); + ASSERT_EQ(m_data->m_deletedSources.size(), 0); + + ProcessAssetJobs(); + + m_data->m_processResults.clear(); + m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; + + m_isIdling = false; + } + + void ModtimeScanningTest::TearDown() + { + m_data = nullptr; + + AssetProcessorManagerTest::TearDown(); + } + + void ModtimeScanningTest::ProcessAssetJobs() + { + m_data->m_productPaths.clear(); + + for (const auto& processResult : m_data->m_processResults) + { + auto file = + QDir(processResult.m_destinationPath).absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName.toLower() + ".arc1"); + m_data->m_productPaths.emplace( + QDir(processResult.m_jobEntry.m_watchFolderPath) + .absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName) + .toUtf8() + .constData(), + file); + + // Create the file on disk + ASSERT_TRUE(UnitTestUtils::CreateDummyFile(file, "products.")); + + AssetBuilderSDK::ProcessJobResponse response; + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(file.toUtf8().constData(), AZ::Uuid::CreateNull(), 1)); + + using JobEntry = AssetProcessor::JobEntry; + + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResult.m_jobEntry), + Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); + } + + ASSERT_TRUE(BlockUntilIdle(5000)); + + m_isIdling = false; + } + + void ModtimeScanningTest::SimulateAssetScanner(QSet filePaths) + { + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "OnAssetScannerStatusChange", Qt::QueuedConnection, + Q_ARG(AssetProcessor::AssetScanningStatus, AssetProcessor::AssetScanningStatus::Started)); + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "AssessFilesFromScanner", Qt::QueuedConnection, Q_ARG(QSet, filePaths)); + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "OnAssetScannerStatusChange", Qt::QueuedConnection, + Q_ARG(AssetProcessor::AssetScanningStatus, AssetProcessor::AssetScanningStatus::Completed)); + } + + QSet ModtimeScanningTest::BuildFileSet() + { + QSet filePaths; + + for (const auto& path : m_data->m_absolutePath) + { + QFileInfo fileInfo(path); + auto modtime = fileInfo.lastModified(); + AZ::u64 fileSize = fileInfo.size(); + filePaths.insert(AssetFileInfo(path, modtime, fileSize, m_config->GetScanFolderForFile(path), false)); + } + + return filePaths; + } + + void ModtimeScanningTest::ExpectWork(int createJobs, int processJobs) + { + ASSERT_TRUE(BlockUntilIdle(5000)); + + EXPECT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, createJobs); + EXPECT_EQ(m_data->m_processResults.size(), processJobs); + for (int i = 0; i < processJobs; ++i) + { + EXPECT_FALSE(m_data->m_processResults[i].m_autoFail); + } + EXPECT_EQ(m_data->m_deletedSources.size(), 0); + + m_isIdling = false; + } + + void ModtimeScanningTest::ExpectNoWork() + { + // Since there's no work to do, the idle event isn't going to trigger, just process events a couple times + for (int i = 0; i < 10; ++i) + { + QCoreApplication::processEvents(QEventLoop::AllEvents, 10); + } + + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 0); + ASSERT_EQ(m_data->m_processResults.size(), 0); + ASSERT_EQ(m_data->m_deletedSources.size(), 0); + + m_isIdling = false; + } + + void ModtimeScanningTest::SetFileContents(QString filePath, QString contents) + { + QFile file(filePath); + file.open(QIODevice::WriteOnly | QIODevice::Truncate); + file.write(contents.toUtf8().constData()); + file.close(); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_FileUnchanged_WithoutModtimeSkipping) + { + using namespace AzToolsFramework::AssetSystem; + + // Make sure modtime skipping is disabled + // We're just going to do 1 quick sanity test to make sure the files are still processed when modtime skipping is turned off + m_assetProcessorManager->SetEnableModtimeSkippingFeature(false); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + // 2 create jobs but 0 process jobs because the file has already been processed before in SetUp + ExpectWork(2, 0); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_FileUnchanged) + { + using namespace AzToolsFramework::AssetSystem; + + AssetUtilities::SetUseFileHashOverride(true, true); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ExpectNoWork(); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_EnablePlatform_ShouldProcessFilesForPlatform) + { + using namespace AzToolsFramework::AssetSystem; + + AssetUtilities::SetUseFileHashOverride(true, true); + + // Enable android platform after the initial SetUp has already processed the files for pc + QDir tempPath(m_tempDir.path()); + AssetBuilderSDK::PlatformInfo androidPlatform("android", { "host", "renderer" }); + m_config->EnablePlatform(androidPlatform, true); + + // There's no way to remove scanfolders and adding a new one after enabling the platform will cause the pc assets to build as well, + // which we don't want Instead we'll just const cast the vector and modify the enabled platforms for the scanfolder + auto& platforms = const_cast&>(m_config->GetScanFolderAt(0).GetPlatforms()); + platforms.push_back(androidPlatform); + + // We need the builder fingerprints to be updated to reflect the newly enabled platform + m_assetProcessorManager->ComputeBuilderDirty(); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ExpectWork( + 4, 2); // CreateJobs = 4, 2 files * 2 platforms. ProcessJobs = 2, just the android platform jobs (pc is already processed) + + ASSERT_TRUE(m_data->m_processResults[0].m_destinationPath.contains("android")); + ASSERT_TRUE(m_data->m_processResults[1].m_destinationPath.contains("android")); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyTimestamp) + { + // Update the timestamp on a file without changing its contents + // This should not cause any job to run since the hash of the file is the same before/after + // Additionally, the timestamp stored in the database should be updated + using namespace AzToolsFramework::AssetSystem; + + uint64_t timestamp = 1594923423; + + QString databaseName, scanfolderName; + m_config->ConvertToRelativePath(m_data->m_absolutePath[1], databaseName, scanfolderName); + auto* scanFolder = m_config->GetScanFolderForFile(m_data->m_absolutePath[1]); + + AzToolsFramework::AssetDatabase::FileDatabaseEntry fileEntry; + + m_assetProcessorManager->m_stateData->GetFileByFileNameAndScanFolderId(databaseName, scanFolder->ScanFolderID(), fileEntry); + + ASSERT_NE(fileEntry.m_modTime, timestamp); + uint64_t existingTimestamp = fileEntry.m_modTime; + + // Modify the timestamp on just one file + AzToolsFramework::ToolsFileUtils::SetModificationTime(m_data->m_absolutePath[1].toUtf8().data(), timestamp); + + AssetUtilities::SetUseFileHashOverride(true, true); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ExpectNoWork(); + + m_assetProcessorManager->m_stateData->GetFileByFileNameAndScanFolderId(databaseName, scanFolder->ScanFolderID(), fileEntry); + + // The timestamp should be updated even though nothing processed + ASSERT_NE(fileEntry.m_modTime, existingTimestamp); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyTimestampNoHashing_ProcessesFile) + { + // Update the timestamp on a file without changing its contents + // This should not cause any job to run since the hash of the file is the same before/after + // Additionally, the timestamp stored in the database should be updated + using namespace AzToolsFramework::AssetSystem; + + uint64_t timestamp = 1594923423; + + // Modify the timestamp on just one file + AzToolsFramework::ToolsFileUtils::SetModificationTime(m_data->m_absolutePath[1].toUtf8().data(), timestamp); + + AssetUtilities::SetUseFileHashOverride(true, false); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ExpectWork(2, 2); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFile) + { + using namespace AzToolsFramework::AssetSystem; + + SetFileContents(m_data->m_absolutePath[1].toUtf8().constData(), "hello world"); + + AssetUtilities::SetUseFileHashOverride(true, true); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers + // the other test file to process as well + ExpectWork(2, 2); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFile_AndThenRevert_ProcessesAgain) + { + using namespace AzToolsFramework::AssetSystem; + auto theFile = m_data->m_absolutePath[1].toUtf8(); + const char* theFileString = theFile.constData(); + + SetFileContents(theFileString, "hello world"); + + AssetUtilities::SetUseFileHashOverride(true, true); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers + // the other test file to process as well + ExpectWork(2, 2); + ProcessAssetJobs(); + + m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; + m_data->m_processResults.clear(); + m_data->m_deletedSources.clear(); + + SetFileContents(theFileString, ""); + + filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + // Expect processing to happen again + ExpectWork(2, 2); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFilesSameHash_BothProcess) + { + using namespace AzToolsFramework::AssetSystem; + + SetFileContents(m_data->m_absolutePath[1].toUtf8().constData(), "hello world"); + + AssetUtilities::SetUseFileHashOverride(true, true); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a dependency that triggers + // the other test file to process as well + ExpectWork(2, 2); + ProcessAssetJobs(); + + m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; + m_data->m_processResults.clear(); + m_data->m_deletedSources.clear(); + + // Make file 0 have the same contents as file 1 + SetFileContents(m_data->m_absolutePath[0].toUtf8().constData(), "hello world"); + + filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ExpectWork(1, 1); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyMetadataFile) + { + using namespace AzToolsFramework::AssetSystem; + + SetFileContents(m_data->m_absolutePath[2].toUtf8().constData(), "hello world"); + + AssetUtilities::SetUseFileHashOverride(true, true); + + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + // Even though we're only updating one file, we're expecting 2 createJob calls because our test file is a metadata file + // that triggers the source file which is a dependency that triggers the other test file to process as well + ExpectWork(2, 2); + } + + TEST_F(ModtimeScanningTest, ModtimeSkipping_DeleteFile) + { + using namespace AzToolsFramework::AssetSystem; + + AssetUtilities::SetUseFileHashOverride(true, true); + + ASSERT_TRUE(QFile::remove(m_data->m_absolutePath[0])); + + // Feed in ONLY one file (the one we didn't delete) + QSet filePaths; + QFileInfo fileInfo(m_data->m_absolutePath[1]); + auto modtime = fileInfo.lastModified(); + AZ::u64 fileSize = fileInfo.size(); + filePaths.insert(AssetFileInfo(m_data->m_absolutePath[1], modtime, fileSize, &m_config->GetScanFolderAt(0), false)); + + SimulateAssetScanner(filePaths); + + QElapsedTimer timer; + timer.start(); + + do + { + QCoreApplication::processEvents(QEventLoop::AllEvents, 10); + } while (m_data->m_deletedSources.size() < m_data->m_relativePathFromWatchFolder[0].size() && timer.elapsed() < 5000); + + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 0); + ASSERT_EQ(m_data->m_processResults.size(), 0); + ASSERT_THAT(m_data->m_deletedSources, testing::ElementsAre(m_data->m_relativePathFromWatchFolder[0])); + } + + TEST_F(ModtimeScanningTest, ReprocessRequest_FileNotModified_FileProcessed) + { + using namespace AzToolsFramework::AssetSystem; + + m_assetProcessorManager->RequestReprocess(m_data->m_absolutePath[0]); + + ASSERT_TRUE(BlockUntilIdle(5000)); + + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 1); + ASSERT_EQ(m_data->m_processResults.size(), 1); + } + + TEST_F(ModtimeScanningTest, ReprocessRequest_SourceWithDependency_BothWillProcess) + { + using namespace AzToolsFramework::AssetSystem; + + using SourceFileDependencyEntry = AzToolsFramework::AssetDatabase::SourceFileDependencyEntry; + + SourceFileDependencyEntry newEntry1; + newEntry1.m_sourceDependencyID = AzToolsFramework::AssetDatabase::InvalidEntryId; + newEntry1.m_builderGuid = AZ::Uuid::CreateRandom(); + newEntry1.m_source = m_data->m_absolutePath[0].toUtf8().constData(); + newEntry1.m_dependsOnSource = m_data->m_absolutePath[1].toUtf8().constData(); + newEntry1.m_typeOfDependency = SourceFileDependencyEntry::DEP_SourceToSource; + + m_assetProcessorManager->RequestReprocess(m_data->m_absolutePath[0]); + ASSERT_TRUE(BlockUntilIdle(5000)); + + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 1); + ASSERT_EQ(m_data->m_processResults.size(), 1); + + m_assetProcessorManager->RequestReprocess(m_data->m_absolutePath[1]); + ASSERT_TRUE(BlockUntilIdle(5000)); + + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 3); + ASSERT_EQ(m_data->m_processResults.size(), 3); + } + + TEST_F(ModtimeScanningTest, ReprocessRequest_RequestFolder_SourceAssetsWillProcess) + { + using namespace AzToolsFramework::AssetSystem; + + const auto& scanFolder = m_config->GetScanFolderAt(0); + + QString scanPath = scanFolder.ScanPath(); + m_assetProcessorManager->RequestReprocess(scanPath); + ASSERT_TRUE(BlockUntilIdle(5000)); + + // two text files are source assets, assetinfo is not + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 2); + ASSERT_EQ(m_data->m_processResults.size(), 2); + } + + void DeleteTest::SetUp() + { + AssetProcessorManagerTest::SetUp(); + + m_data = AZStd::make_unique(); + + // We don't want the mock application manager to provide builder descriptors, mockBuilderInfoHandler will provide our own + m_mockApplicationManager->BusDisconnect(); + + m_data->m_mockBuilderInfoHandler.m_builderDesc = m_data->m_mockBuilderInfoHandler.CreateBuilderDesc( + "test builder", "{DF09DDC0-FD22-43B6-9E22-22C8574A6E1E}", + { AssetBuilderSDK::AssetBuilderPattern("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard) }); + m_data->m_mockBuilderInfoHandler.BusConnect(); + + ASSERT_TRUE(m_mockApplicationManager->GetBuilderByID("txt files", m_data->m_builderTxtBuilder)); + + SetUpAssetProcessorManager(); + + auto createFileAndAddToDatabaseFunc = [this](const AssetProcessor::ScanFolderInfo* scanFolder, QString file) + { + using namespace AzToolsFramework::AssetDatabase; + + QString watchFolderPath = scanFolder->ScanPath(); + QString absPath(QDir(watchFolderPath).absoluteFilePath(file)); + UnitTestUtils::CreateDummyFile(absPath); + + m_data->m_absolutePath.push_back(absPath); + + AzToolsFramework::AssetDatabase::FileDatabaseEntry fileEntry; + fileEntry.m_fileName = file.toUtf8().constData(); + fileEntry.m_modTime = 0; + fileEntry.m_isFolder = false; + fileEntry.m_scanFolderPK = scanFolder->ScanFolderID(); + + bool entryAlreadyExists; + ASSERT_TRUE(m_assetProcessorManager->m_stateData->InsertFile(fileEntry, entryAlreadyExists)); + ASSERT_FALSE(entryAlreadyExists); + }; + + // Create test files + QDir tempPath(m_tempDir.path()); + const auto* scanFolder1 = m_config->GetScanFolderByPath(tempPath.absoluteFilePath("subfolder1")); + const auto* scanFolder4 = m_config->GetScanFolderByPath(tempPath.absoluteFilePath("subfolder4")); + + createFileAndAddToDatabaseFunc(scanFolder1, QString("textures/a.txt")); + createFileAndAddToDatabaseFunc(scanFolder4, QString("textures/b.txt")); + + // Run the test files through AP all the way to processing stage + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ASSERT_TRUE(BlockUntilIdle(5000)); + ASSERT_EQ(m_data->m_mockBuilderInfoHandler.m_createJobsCount, 2); + ASSERT_EQ(m_data->m_processResults.size(), 2); + ASSERT_EQ(m_data->m_deletedSources.size(), 0); + + ProcessAssetJobs(); + + m_data->m_processResults.clear(); + m_data->m_mockBuilderInfoHandler.m_createJobsCount = 0; + + // Reboot the APM since we added stuff to the database that needs to be loaded on-startup of the APM + m_assetProcessorManager.reset(new AssetProcessorManager_Test(m_config.get())); + + SetUpAssetProcessorManager(); + } + + TEST_F(DeleteTest, DeleteFolderSharedAcrossTwoScanFolders_CorrectFileAndFolderAreDeletedFromCache) + { + // There was a bug where AP wasn't repopulating the "known folders" list when modtime skipping was enabled and no work was needed + // As a result, deleting a folder didn't count as a "folder", so the wrong code path was taken. This test makes sure the correct + // deletion events fire + + using namespace AzToolsFramework::AssetSystem; + + // Feed in the files from the asset scanner, no jobs should run since they're already up-to-date + QSet filePaths = BuildFileSet(); + SimulateAssetScanner(filePaths); + + ExpectNoWork(); + + // Delete one of the folders + QDir tempPath(m_tempDir.path()); + QString absPath(tempPath.absoluteFilePath("subfolder1/textures")); + QDir(absPath).removeRecursively(); + + AZStd::vector deletedFolders; + QObject::connect( + m_assetProcessorManager.get(), &AssetProcessor::AssetProcessorManager::SourceFolderDeleted, + [&deletedFolders](QString file) + { + deletedFolders.push_back(file.toUtf8().constData()); + }); + + m_assetProcessorManager->AssessDeletedFile(absPath); + ASSERT_TRUE(BlockUntilIdle(5000)); + + ASSERT_THAT(m_data->m_deletedSources, testing::UnorderedElementsAre("textures/a.txt")); + ASSERT_THAT(deletedFolders, testing::UnorderedElementsAre("textures")); + } + + TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeleteFails) + { + auto theFile = m_data->m_absolutePath[1].toUtf8(); + const char* theFileString = theFile.constData(); + auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); + + { + QFile file(theFileString); + file.remove(); + } + + ASSERT_GT(m_data->m_productPaths.size(), 0); + QFile product(productPath); + + ASSERT_TRUE(product.open(QIODevice::ReadOnly)); + + // Check if we can delete the file now, if we can't, proceed with the test + // If we can, it means the OS running this test doesn't lock open files so there's nothing to test + if (!AZ::IO::SystemFile::Delete(productPath.toUtf8().constData())) + { + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "AssessDeletedFile", Qt::QueuedConnection, Q_ARG(QString, QString(theFileString))); + + EXPECT_TRUE(BlockUntilIdle(5000)); + + EXPECT_TRUE(QFile::exists(productPath)); + EXPECT_EQ(m_data->m_deletedSources.size(), 0); + } + else + { + SUCCEED() << "Skipping test. OS does not lock open files."; + } + } + + TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeletesWhenReleased) + { + // This test is intended to verify the AP will successfully retry deleting a source asset + // when one of its product assets is locked temporarily + // We'll lock the file by holding it open + + auto theFile = m_data->m_absolutePath[1].toUtf8(); + const char* theFileString = theFile.constData(); + auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); + + { + QFile file(theFileString); + file.remove(); + } + + ASSERT_GT(m_data->m_productPaths.size(), 0); + QFile product(productPath); + + // Open the file and keep it open to lock it + // We'll start a thread later to unlock the file + // This will allow us to test how AP handles trying to delete a locked file + ASSERT_TRUE(product.open(QIODevice::ReadOnly)); + + // Check if we can delete the file now, if we can't, proceed with the test + // If we can, it means the OS running this test doesn't lock open files so there's nothing to test + if (!AZ::IO::SystemFile::Delete(productPath.toUtf8().constData())) + { + m_deleteCounter = 0; + + // Set up a callback which will fire after at least 1 retry + // Unlock the file at that point so AP can successfully delete it + m_callback = [&product]() + { + product.close(); + }; + + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "AssessDeletedFile", Qt::QueuedConnection, Q_ARG(QString, QString(theFileString))); + + EXPECT_TRUE(BlockUntilIdle(5000)); + + EXPECT_FALSE(QFile::exists(productPath)); + EXPECT_EQ(m_data->m_deletedSources.size(), 1); + + EXPECT_GT(m_deleteCounter, 1); // Make sure the AP tried more than once to delete the file + m_errorAbsorber->ExpectAsserts(0); + } + else + { + SUCCEED() << "Skipping test. OS does not lock open files."; + } + } +} diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.h b/Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.h new file mode 100644 index 0000000000..ef57c70536 --- /dev/null +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/ModtimeScanningTests.h @@ -0,0 +1,105 @@ +/* + * 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 + +namespace UnitTests +{ + struct ModtimeScanningTest : AssetProcessorManagerTest + { + void SetUpAssetProcessorManager(); + void SetUp() override; + void TearDown() override; + + void ProcessAssetJobs(); + void SimulateAssetScanner(QSet filePaths); + QSet BuildFileSet(); + void ExpectWork(int createJobs, int processJobs); + void ExpectNoWork(); + void SetFileContents(QString filePath, QString contents); + + struct StaticData + { + QString m_relativePathFromWatchFolder[3]; + AZStd::vector m_absolutePath; + AZStd::vector m_processResults; + AZStd::unordered_multimap m_productPaths; + AZStd::vector m_deletedSources; + AZStd::shared_ptr m_builderTxtBuilder; + MockBuilderInfoHandler m_mockBuilderInfoHandler; + }; + + AZStd::unique_ptr m_data; + }; + + struct DeleteTest : ModtimeScanningTest + { + void SetUp() override; + }; + + + struct LockedFileTest + : ModtimeScanningTest + , AssetProcessor::ConnectionBus::Handler + { + MOCK_METHOD3(SendRaw, size_t(unsigned, unsigned, const QByteArray&)); + MOCK_METHOD3(SendPerPlatform, size_t(unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&, const QString&)); + MOCK_METHOD4(SendRawPerPlatform, size_t(unsigned, unsigned, const QByteArray&, const QString&)); + MOCK_METHOD2(SendRequest, unsigned(const AzFramework::AssetSystem::BaseAssetProcessorMessage&, const ResponseCallback&)); + MOCK_METHOD2(SendResponse, size_t(unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&)); + MOCK_METHOD1(RemoveResponseHandler, void(unsigned)); + + size_t Send(unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage& message) override + { + using SourceFileNotificationMessage = AzToolsFramework::AssetSystem::SourceFileNotificationMessage; + switch (message.GetMessageType()) + { + case SourceFileNotificationMessage::MessageType: + if (const auto sourceFileMessage = azrtti_cast(&message); + sourceFileMessage != nullptr && + sourceFileMessage->m_type == SourceFileNotificationMessage::NotificationType::FileRemoved) + { + // The File Remove message will occur before an attempt to delete the file + // Wait for more than 1 File Remove message. + // This indicates the AP has attempted to delete the file once, failed to do so and is now retrying + ++m_deleteCounter; + + if (m_deleteCounter > 1 && m_callback) + { + m_callback(); + m_callback = {}; // Unset it to be safe, we only intend to run the callback once + } + } + break; + default: + break; + } + + return 0; + } + + void SetUp() override + { + ModtimeScanningTest::SetUp(); + + AssetProcessor::ConnectionBus::Handler::BusConnect(0); + } + + void TearDown() override + { + AssetProcessor::ConnectionBus::Handler::BusDisconnect(); + + ModtimeScanningTest::TearDown(); + } + + AZStd::atomic_int m_deleteCounter{ 0 }; + AZStd::function m_callback; + }; +} From 8263a50f9709aa9f7cedaf927589940026bc3926 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 31 Jan 2022 11:11:42 -0600 Subject: [PATCH 350/394] Fixed issue with viewport not rendering when creating a new level Signed-off-by: Chris Galvan --- Code/Editor/EditorViewportWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 9a9e9f5ad3..7314908580 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -586,6 +586,7 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event) break; case eNotify_OnEndLoad: + case eNotify_OnEndCreate: UpdateScene(); SetDefaultCamera(); break; From 6311776b1073246410a614260dc9d267578db644 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 31 Jan 2022 09:26:23 -0800 Subject: [PATCH 351/394] Updating the RPC test level to use the new TestLevelEntity autocomponent; this way the level entity and player use a different autocomponent. Updating scripts to use the new component as well Signed-off-by: Gene Walters --- .../AutoComponent_RPC.prefab | 57 +- .../AutoComponent_RPC.scriptcanvas | 3085 ++++++++++++++++- ...oComponent_RPC_NetLevelEntity.scriptcanvas | 449 ++- 3 files changed, 3491 insertions(+), 100 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab index 758cb4fca8..35d5ef9527 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -568,22 +568,10 @@ "$type": "EditorScriptCanvasComponent", "Id": 14750978061505735417, "m_name": "GlobalGameData", - "m_assetHolder": { - "m_asset": { - "assetId": { - "guid": "{B16589A0-EA01-56BC-8141-91A3967FB95F}" - }, - "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" - } - }, "runtimeDataIsValid": true, - "runtimeDataOverrides": { - "source": { - "assetId": { - "guid": "{B16589A0-EA01-56BC-8141-91A3967FB95F}" - }, - "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" - } + "sourceHandle": { + "id": "{B16589A0-EA01-56BC-8141-91A3967FB95F}", + "path": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" } }, "Component_[16436925042043744033]": { @@ -636,6 +624,13 @@ "$type": "SelectionComponent", "Id": 12302672911455629152 }, + "Component_[12517591696100736853]": { + "$type": "GenericComponentWrapper", + "Id": 12517591696100736853, + "m_template": { + "$type": "AutomatedTesting::NetworkTestLevelEntityComponent" + } + }, "Component_[14169903623243423134]": { "$type": "EditorVisibilityComponent", "Id": 14169903623243423134 @@ -644,13 +639,6 @@ "$type": "EditorInspectorComponent", "Id": 14607413934411389854 }, - "Component_[15396284312416541768]": { - "$type": "GenericComponentWrapper", - "Id": 15396284312416541768, - "m_template": { - "$type": "Multiplayer::LocalPredictionPlayerInputComponent" - } - }, "Component_[15494977028055234270]": { "$type": "EditorDisabledCompositionComponent", "Id": 15494977028055234270 @@ -682,22 +670,10 @@ "$type": "EditorScriptCanvasComponent", "Id": 7256163899440301540, "m_name": "AutoComponent_RPC_NetLevelEntity", - "m_assetHolder": { - "m_asset": { - "assetId": { - "guid": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}" - }, - "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" - } - }, "runtimeDataIsValid": true, - "runtimeDataOverrides": { - "source": { - "assetId": { - "guid": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}" - }, - "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" - } + "sourceHandle": { + "id": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}", + "path": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" } }, "Component_[731336627222243355]": { @@ -730,13 +706,6 @@ "$type": "NetBindComponent" } }, - "Component_[9816897251206708579]": { - "$type": "GenericComponentWrapper", - "Id": 9816897251206708579, - "m_template": { - "$type": "AutomatedTesting::NetworkTestPlayerComponent" - } - }, "Component_[9880860858035405475]": { "$type": "EditorOnlyEntityComponent", "Id": 9880860858035405475 diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index c1c77b14fe..7f3f8181ae 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 2816238339133127497 + "id": 8397436129732444837 }, "Name": "AutoComponent_RPC", "Components": { @@ -37,7 +37,7 @@ } }, "Component_[9755768666831861951]": { - "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "$type": "EditorGraph", "Id": 9755768666831861951, "m_graphData": { "m_nodes": [ @@ -1734,6 +1734,1542 @@ { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" } @@ -3272,6 +4808,1542 @@ { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" } @@ -4723,7 +7795,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, + 360.0, 620.0 ] }, @@ -4953,15 +8025,16 @@ }, { "Key": { - "id": 2816238339133127497 + "id": 8397436129732444837 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "AnchorX": 260.0, - "AnchorY": 479.0 + "Scale": 0.8049999999999999, + "AnchorX": -166.45962524414063, + "AnchorY": -216.14906311035156 } } } diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas index 5d61fea3e7..70730a4496 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 7369225496155711251 + "id": 7558387155527535988 }, "Name": "AutoComponent_RPC_NetLevelEntity", "Components": { @@ -93,7 +93,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -108,6 +107,9 @@ "methodType": 2, "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", "className": "NetworkTestLevelEntityComponent", + "resultSlotIDs": [ + {} + ], "inputSlots": [ { "m_id": "{AE2A0AA3-99DD-4DE4-AFEA-7560F078943C}" @@ -688,6 +690,199 @@ } } }, + { + "Id": { + "id": 11750998249450 + }, + "Name": "SC-Node(IsNetEntityRoleAuthority)", + "Components": { + "Component_[17217487756380135718]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 17217487756380135718, + "Slots": [ + { + "id": { + "m_id": "{C58EF254-1A51-443B-B35E-B26831323D27}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{98927A53-663A-452D-ABAF-01D31F7D5D53}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{89F646CA-FBC6-45D2-916B-0B47474EE693}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3FFC81A6-5C31-4CBA-8253-5DF361F10610}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Is Role Authority", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Entity Id" + } + ], + "methodType": 2, + "methodName": "IsNetEntityRoleAuthority", + "className": "NetBindComponent", + "inputSlots": [ + { + "m_id": "{C58EF254-1A51-443B-B35E-B26831323D27}" + } + ], + "prettyClassName": "NetBindComponent" + } + } + }, + { + "Id": { + "id": 13206992162794 + }, + "Name": "SC-Node(Gate)", + "Components": { + "Component_[18126119383071583133]": { + "$type": "Gate", + "Id": 18126119383071583133, + "Slots": [ + { + "id": { + "m_id": "{3896AA13-516C-410F-AB9C-2CAA5E71AEF6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Condition", + "toolTip": "If true the node will signal the Output and proceed execution", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F651B19A-FD1A-44EB-9C16-0CDB44CD85AA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{78807DC9-82B7-4893-ADA4-53E51C2AD3D1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "True", + "toolTip": "Signaled if the condition provided evaluates to true.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3B353484-F14C-4D93-AD1D-6F3EDAE4B71C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "False", + "toolTip": "Signaled if the condition provided evaluates to false.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": false, + "label": "Condition" + } + ] + } + } + }, { "Id": { "id": 57025381737912 @@ -882,7 +1077,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -897,6 +1091,9 @@ "methodType": 2, "methodName": "AuthorityToClientNoParams_PlayFxByEntityId", "className": "NetworkTestLevelEntityComponent", + "resultSlotIDs": [ + {} + ], "inputSlots": [ { "m_id": "{029728DF-0939-4D64-A9A1-3DB4B8AF127E}" @@ -1036,7 +1233,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 4, "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" @@ -1223,34 +1419,6 @@ } } }, - { - "Id": { - "id": 57055446508984 - }, - "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", - "Components": { - "Component_[6292481678297438578]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6292481678297438578, - "sourceEndpoint": { - "nodeId": { - "id": 57012496836024 - }, - "slotId": { - "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 56986727032248 - }, - "slotId": { - "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" - } - } - } - } - }, { "Id": { "id": 10269167405311 @@ -1530,6 +1698,118 @@ } } } + }, + { + "Id": { + "id": 13030898503658 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", + "Components": { + "Component_[14235185264262332827]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14235185264262332827, + "sourceEndpoint": { + "nodeId": { + "id": 57012496836024 + }, + "slotId": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 11750998249450 + }, + "slotId": { + "m_id": "{98927A53-663A-452D-ABAF-01D31F7D5D53}" + } + } + } + } + }, + { + "Id": { + "id": 14005856079850 + }, + "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", + "Components": { + "Component_[16302238484508620286]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16302238484508620286, + "sourceEndpoint": { + "nodeId": { + "id": 11750998249450 + }, + "slotId": { + "m_id": "{89F646CA-FBC6-45D2-916B-0B47474EE693}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 13206992162794 + }, + "slotId": { + "m_id": "{F651B19A-FD1A-44EB-9C16-0CDB44CD85AA}" + } + } + } + } + }, + { + "Id": { + "id": 14302208823274 + }, + "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", + "Components": { + "Component_[3887593885874168259]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3887593885874168259, + "sourceEndpoint": { + "nodeId": { + "id": 11750998249450 + }, + "slotId": { + "m_id": "{3FFC81A6-5C31-4CBA-8253-5DF361F10610}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 13206992162794 + }, + "slotId": { + "m_id": "{3896AA13-516C-410F-AB9C-2CAA5E71AEF6}" + } + } + } + } + }, + { + "Id": { + "id": 14637216272362 + }, + "Name": "srcEndpoint=(If: True), destEndpoint=(Repeater: Start)", + "Components": { + "Component_[8721834474263401249]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8721834474263401249, + "sourceEndpoint": { + "nodeId": { + "id": 13206992162794 + }, + "slotId": { + "m_id": "{78807DC9-82B7-4893-ADA4-53E51C2AD3D1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56986727032248 + }, + "slotId": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + } + } + } + } } ] }, @@ -1571,6 +1851,37 @@ } } }, + { + "Key": { + "id": 11750998249450 + }, + "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": [ + 100.0, + 60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{73B270BC-9743-41C1-9E48-0CAB5A63AC97}" + } + } + } + }, { "Key": { "id": 11993350262154 @@ -1587,8 +1898,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -120.0, - 340.0 + 60.0, + 480.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1618,8 +1929,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 340.0, - 360.0 + 520.0, + 500.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1633,6 +1944,36 @@ } } }, + { + "Key": { + "id": 13206992162794 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "LogicNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 540.0, + 60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{3F73BD0E-D02D-4A48-9E25-F9FD4A0F1B89}" + } + } + } + }, { "Key": { "id": 16962627423626 @@ -1649,8 +1990,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 440.0, - -40.0 + 1240.0, + 0.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1680,8 +2021,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 80.0, - -60.0 + 860.0, + 0.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1740,8 +2081,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 800.0, - 260.0 + 980.0, + 400.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1770,8 +2111,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 420.0, - 100.0 + 1220.0, + 140.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1800,8 +2141,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 800.0, - 460.0 + 980.0, + 600.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1877,16 +2218,16 @@ }, { "Key": { - "id": 7369225496155711251 + "id": 7558387155527535988 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.7585823890144868, - "AnchorX": -205.64674377441406, - "AnchorY": -467.9781799316406 + "Scale": 0.9585879578077288, + "AnchorX": 488.2181091308594, + "AnchorY": -175.25778198242188 } } } @@ -1915,6 +2256,14 @@ "Key": 6462358712820489356, "Value": 1 }, + { + "Key": 8065262779685207188, + "Value": 1 + }, + { + "Key": 8452971738487658154, + "Value": 1 + }, { "Key": 10684225535275896474, "Value": 3 From 9573bc8032ae007da7c4213f291edf8c8ca10392 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 31 Jan 2022 09:38:45 -0800 Subject: [PATCH 352/394] Re-adding the Authority->Client RPC test now that ScriptCanvas is fixed for Editor play-mode Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_AutoComponent_RPC.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 827826cbcc..fb58d07ed8 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -67,10 +67,10 @@ def Multiplayer_AutoComponent_RPC(): helper.succeed_if_log_line_found('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) # Uncomment once editor game-play mode supports level entities with net-binding - #PLAYFX_RPC_WAIT_TIME_SECONDS = 1.1 # The server will send an RPC to play an fx on the client every second. - #helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity Activated on entity: NetLevelEntity", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) - #helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) - #helper.succeed_if_log_line_found('Script', "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + PLAYFX_RPC_WAIT_TIME_SECONDS = 1.1 # The server will send an RPC to play an fx on the client every second. + helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity Activated on entity: NetLevelEntity", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + helper.succeed_if_log_line_found('Script', "AutoComponent_RPC_NetLevelEntity: I'm a client playing some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) # Exit game mode From 4c426ea5a611ea8904554e9c4271c552ac2eaa6e Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Mon, 31 Jan 2022 09:44:41 -0800 Subject: [PATCH 353/394] Fixed compile issue in unity builds. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 40f82c8ec7..79c73495e0 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -22,6 +22,7 @@ namespace AZ namespace RPI { class MaterialTypeAsset; + class MaterialTypeAssetCreator; class MaterialFunctorSourceDataHolder; class JsonMaterialPropertySerializer; From 4919cb345059cba9bf40f3609efd4d65225513e9 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 31 Jan 2022 09:48:53 -0800 Subject: [PATCH 354/394] Minor code comment change Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_AutoComponent_RPC.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index fb58d07ed8..62ec410d3b 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -62,11 +62,12 @@ def Multiplayer_AutoComponent_RPC(): Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) # 4) Check the editor logs for expected and unexpected log output + # Authority->Autonomous RPC PLAYERID_RPC_WAIT_TIME_SECONDS = 1.0 # The player id is sent from the server as soon as the player script is spawned. 1 second should be more than enough time to send/receive that RPC. helper.succeed_if_log_line_found('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) helper.succeed_if_log_line_found('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) - # Uncomment once editor game-play mode supports level entities with net-binding + # Authority->Client RPC PLAYFX_RPC_WAIT_TIME_SECONDS = 1.1 # The server will send an RPC to play an fx on the client every second. helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity Activated on entity: NetLevelEntity", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) From 8710130d759287dab02ec7e20fb90c015a6f7d45 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:53:05 -0600 Subject: [PATCH 355/394] {ghi7197} update the prefab path for procedural prefabs (#7260) update the prefab path for procedural prefabs so that the prefab template can be found from the level prefab load event. It is important that it points to the realative/path/to/the.procprefab using the correct front slashes for the source asset path Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../PrefabGroup/PrefabGroupBehavior.cpp | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp index af21e7297c..5fce7a674a 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp @@ -318,13 +318,17 @@ namespace AZ::SceneAPI::Behaviors { AZ::Interface::Get()->RemoveAllTemplates(); + AZStd::string prefabTemplateName { relativeSourcePath }; + AZ::StringFunc::Path::ReplaceFullName(prefabTemplateName, filenameOnly.c_str()); + AZ::StringFunc::Replace(prefabTemplateName, "\\", "/"); // the source folder uses forward slash + // create prefab group for entire stack AzToolsFramework::Prefab::TemplateId prefabTemplateId; AzToolsFramework::Prefab::PrefabSystemScriptingBus::BroadcastResult( prefabTemplateId, &AzToolsFramework::Prefab::PrefabSystemScriptingBus::Events::CreatePrefabTemplate, entities, - filenameOnly); + prefabTemplateName); if (prefabTemplateId == AzToolsFramework::Prefab::InvalidTemplateId) { @@ -349,12 +353,12 @@ namespace AZ::SceneAPI::Behaviors prefabDom.Parse(outcome.GetValue().c_str()); auto prefabGroup = AZStd::make_shared(); - prefabGroup->SetName(relativeSourcePath); + prefabGroup->SetName(prefabTemplateName); prefabGroup->SetPrefabDom(AZStd::move(prefabDom)); prefabGroup->SetId(DataTypes::Utilities::CreateStableUuid( scene, azrtti_typeid(), - relativeSourcePath)); + prefabTemplateName)); manifestUpdates.emplace_back(prefabGroup); @@ -414,7 +418,7 @@ namespace AZ::SceneAPI::Behaviors AZ::StringFunc::Replace(relativeSourcePath, ".", "_"); AZStd::string filenameOnly{ relativeSourcePath }; AZ::StringFunc::Path::GetFileName(filenameOnly.c_str(), filenameOnly); - AZ::StringFunc::Path::ReplaceExtension(filenameOnly, "prefab"); + AZ::StringFunc::Path::ReplaceExtension(filenameOnly, "procprefab"); ManifestUpdates manifestUpdates; @@ -482,7 +486,10 @@ namespace AZ::SceneAPI::Behaviors // The originPath we pass to LoadTemplateFromString must be the relative path of the file AZ::IO::Path templateName(prefabGroup->GetName()); templateName.ReplaceExtension(AZ::Prefab::PrefabGroupAssetHandler::s_Extension); - templateName = relativePath / templateName; + if (!AZ::StringFunc::StartsWith(templateName.c_str(), relativePath.c_str())) + { + templateName = relativePath / templateName; + } auto templateId = prefabLoaderInterface->LoadTemplateFromString(sb.GetString(), templateName.Native().c_str()); if (templateId == InvalidTemplateId) @@ -569,11 +576,12 @@ namespace AZ::SceneAPI::Behaviors // Get the relative path of the source and then take just the path portion of it (no file name) AZ::IO::Path relativePath = context.GetScene().GetSourceFilename(); relativePath = relativePath.LexicallyRelative(AZStd::string_view(context.GetScene().GetWatchFolder())); - relativePath = relativePath.ParentPath(); + AZStd::string relativeSourcePath { AZStd::move(relativePath.ParentPath().Native()) }; + AZ::StringFunc::Replace(relativeSourcePath, "\\", "/"); // the source paths use forward slashes for (const auto* prefabGroup : prefabGroupCollection) { - auto result = CreateProductAssetData(prefabGroup, relativePath); + auto result = CreateProductAssetData(prefabGroup, relativeSourcePath); if (!result) { return Events::ProcessingResult::Failure; From b975111a93425731a540b3c1182421e15c77d72c Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:54:16 -0600 Subject: [PATCH 356/394] Add benchmarks and unit tests for GetSurfacePoints*. (#7216) * Add benchmarks and unit tests for GetSurfacePoints*. The benchmarks are very enlightening - the existing implementation of GetSurfacePointsFromRegion (and GetSurfacePointsFromList) is currently measurably *slower* than just calling GetSurfacePoints() many times in a loop. This is due to all of the extra allocation overhead that's currently happening with the way these data structures are built. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Small syntax improvement Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Small update to the benchmark to use filtered results. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed accidental extra include. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/SurfaceData/Code/CMakeLists.txt | 4 + .../SurfaceData/SurfaceDataSystemRequestBus.h | 7 + .../SurfaceData/Tests/SurfaceDataTestMocks.h | 54 ++-- .../SurfaceDataColliderComponent.cpp | 7 +- .../Components/SurfaceDataShapeComponent.cpp | 7 +- .../Source/SurfaceDataSystemComponent.cpp | 49 ++-- .../Code/Source/SurfaceDataSystemComponent.h | 4 + .../Code/Tests/SurfaceDataBenchmarks.cpp | 276 ++++++++++++++++++ .../SurfaceDataColliderComponentTest.cpp | 18 -- .../Code/Tests/SurfaceDataTest.cpp | 148 +++++++--- .../Code/Tests/SurfaceDataTestFixtures.cpp | 36 +++ .../Code/Tests/SurfaceDataTestFixtures.h | 43 +++ .../Code/surfacedata_tests_files.cmake | 3 + Gems/Vegetation/Code/Tests/VegetationMocks.h | 7 + 14 files changed, 551 insertions(+), 112 deletions(-) create mode 100644 Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp create mode 100644 Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.cpp create mode 100644 Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.h diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index 860053ca42..6cef8b6e25 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -102,4 +102,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_googletest( NAME Gem::SurfaceData.Tests ) + ly_add_googlebenchmark( + NAME Gem::SurfaceData.Benchmarks + TARGET Gem::SurfaceData.Tests + ) endif() diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h index 8dd3e02a53..616f069184 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataSystemRequestBus.h @@ -12,6 +12,7 @@ #include #include #include +#include #include namespace SurfaceData @@ -41,6 +42,12 @@ namespace SurfaceData virtual void GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, SurfacePointLists& surfacePointLists) const = 0; + // Get all surface points for every passed-in input position. Only the XY dimensions of each position are used. + virtual void GetSurfacePointsFromList( + AZStd::span inPositions, + const SurfaceTagVector& desiredTags, + SurfacePointLists& surfacePointLists) const = 0; + virtual SurfaceDataRegistryHandle RegisterSurfaceDataProvider(const SurfaceDataRegistryEntry& entry) = 0; virtual void UnregisterSurfaceDataProvider(const SurfaceDataRegistryHandle& handle) = 0; virtual void UpdateSurfaceDataProvider(const SurfaceDataRegistryHandle& handle, const SurfaceDataRegistryEntry& entry) = 0; diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h b/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h index 5e8acdc4c5..82a321756d 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/Tests/SurfaceDataTestMocks.h @@ -8,14 +8,15 @@ #pragma once #include -#include + +#include #include #include #include +#include #include #include -#include namespace UnitTest { @@ -23,23 +24,6 @@ namespace UnitTest : public ::testing::Test { protected: - AZ::ComponentApplication m_app; - AZ::Entity* m_systemEntity = nullptr; - - void SetUp() override - { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 128 * 1024 * 1024; - m_systemEntity = m_app.Create(appDesc); - m_app.AddEntity(m_systemEntity); - } - - void TearDown() override - { - m_app.Destroy(); - m_systemEntity = nullptr; - } - AZStd::unique_ptr CreateEntity() { return AZStd::make_unique(); @@ -57,14 +41,12 @@ namespace UnitTest template AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) { - m_app.RegisterComponentDescriptor(Component::CreateDescriptor()); return entity->CreateComponent(config); } template AZ::Component* CreateComponent(AZ::Entity* entity) { - m_app.RegisterComponentDescriptor(Component::CreateDescriptor()); return entity->CreateComponent(); } }; @@ -129,6 +111,29 @@ namespace UnitTest } }; + // Mock out a generic Physics Collider Component, which is a required dependency for adding a SurfaceDataColliderComponent. + struct MockPhysicsColliderComponent : public AZ::Component + { + public: + AZ_COMPONENT(MockPhysicsColliderComponent, "{4F7C36DE-6475-4E0A-96A7-BFAF21C07C95}", AZ::Component); + + void Activate() override + { + } + void Deactivate() override + { + } + + static void Reflect(AZ::ReflectContext* reflect) + { + AZ_UNUSED(reflect); + } + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC("PhysXColliderService", 0x4ff43f7c)); + } + }; + struct MockTransformHandler : public AZ::TransformBus::Handler { @@ -204,6 +209,13 @@ namespace UnitTest { } + void GetSurfacePointsFromList( + [[maybe_unused]] AZStd::span inPositions, + [[maybe_unused]] const SurfaceData::SurfaceTagVector& desiredTags, + [[maybe_unused]] SurfaceData::SurfacePointLists& surfacePointLists) const override + { + } + SurfaceData::SurfaceDataRegistryHandle RegisterSurfaceDataProvider(const SurfaceData::SurfaceDataRegistryEntry& entry) override { return RegisterEntry(entry, m_providers); diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp index 31bf4e7028..d7de299829 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp @@ -240,15 +240,16 @@ namespace SurfaceData point.m_entityId = GetEntityId(); point.m_position = hitPosition; point.m_normal = hitNormal; - AddMaxValueForMasks(point.m_masks, m_configuration.m_providerTags, 1.0f); + for (auto& tag : m_configuration.m_providerTags) + { + point.m_masks[tag] = 1.0f; + } surfacePointList.push_back(point); } } void SurfaceDataColliderComponent::ModifySurfacePoints(SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(Entity); - AZStd::lock_guard lock(m_cacheMutex); if (m_colliderBounds.IsValid() && !m_configuration.m_modifierTags.empty()) diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp index 890f8fba54..a45903498e 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp @@ -143,8 +143,6 @@ namespace SurfaceData void SurfaceDataShapeComponent::GetSurfacePoints(const AZ::Vector3& inPosition, SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(Entity); - AZStd::lock_guard lock(m_cacheMutex); if (m_shapeBoundsIsValid) @@ -160,7 +158,10 @@ namespace SurfaceData point.m_entityId = GetEntityId(); point.m_position = rayOrigin + intersectionDistance * rayDirection; point.m_normal = AZ::Vector3::CreateAxisZ(); - AddMaxValueForMasks(point.m_masks, m_configuration.m_providerTags, 1.0f); + for (auto& tag : m_configuration.m_providerTags) + { + point.m_masks[tag] = 1.0f; + } surfacePointList.push_back(point); } } diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp index 9c53b13fdc..a2a3bc352e 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp @@ -181,8 +181,6 @@ namespace SurfaceData void SurfaceDataSystemComponent::GetSurfacePoints(const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags, SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(Entity); - const bool hasDesiredTags = HasValidTags(desiredTags); const bool hasModifierTags = hasDesiredTags && HasMatchingTags(desiredTags, m_registeredModifierTags); @@ -228,42 +226,47 @@ namespace SurfaceData void SurfaceDataSystemComponent::GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, SurfacePointLists& surfacePointLists) const { - AZStd::lock_guard registrationLock(m_registrationMutex); - const size_t totalQueryPositions = aznumeric_cast(ceil(inRegion.GetXExtent() / stepSize.GetX())) * aznumeric_cast(ceil(inRegion.GetYExtent() / stepSize.GetY())); AZStd::vector inPositions; inPositions.reserve(totalQueryPositions); - surfacePointLists.clear(); - surfacePointLists.reserve(totalQueryPositions); - // Initialize our list-per-position list with every input position to query from the region. // This is inclusive on the min sides of inRegion, and exclusive on the max sides. for (float y = inRegion.GetMin().GetY(); y < inRegion.GetMax().GetY(); y += stepSize.GetY()) { for (float x = inRegion.GetMin().GetX(); x < inRegion.GetMax().GetX(); x += stepSize.GetX()) { - inPositions.emplace_back(AZ::Vector3(x, y, AZ::Constants::FloatMax)); - surfacePointLists.emplace_back(SurfaceData::SurfacePointList{}); + inPositions.emplace_back(x, y, AZ::Constants::FloatMax); } } + GetSurfacePointsFromList(inPositions, desiredTags, surfacePointLists); + } + + void SurfaceDataSystemComponent::GetSurfacePointsFromList( + AZStd::span inPositions, const SurfaceTagVector& desiredTags, SurfacePointLists& surfacePointLists) const + { + AZStd::lock_guard registrationLock(m_registrationMutex); + + const size_t totalQueryPositions = inPositions.size(); + + surfacePointLists.clear(); + surfacePointLists.resize(totalQueryPositions); + const bool hasDesiredTags = HasValidTags(desiredTags); const bool hasModifierTags = hasDesiredTags && HasMatchingTags(desiredTags, m_registeredModifierTags); // Loop through each data provider, and query all the points for each one. This allows us to check the tags and the overall - // AABB bounds just once per provider, instead of once per point. It also allows for an eventual optimization in which we could send - // the list of points directly into each SurfaceDataProvider. + // AABB bounds just once per provider, instead of once per point. It also allows for an eventual optimization in which we could + // send the list of points directly into each SurfaceDataProvider. for (const auto& entryPair : m_registeredSurfaceDataProviders) { const SurfaceDataRegistryEntry& entry = entryPair.second; bool alwaysApplies = !entry.m_bounds.IsValid(); - if ((!hasDesiredTags || hasModifierTags || HasMatchingTags(desiredTags, entry.m_tags)) && - ( alwaysApplies || AabbOverlaps2D(entry.m_bounds, inRegion) ) - ) + if (!hasDesiredTags || hasModifierTags || HasMatchingTags(desiredTags, entry.m_tags)) { for (size_t index = 0; index < totalQueryPositions; index++) { @@ -288,18 +291,16 @@ namespace SurfaceData const SurfaceDataRegistryEntry& entry = entryPair.second; bool alwaysApplies = !entry.m_bounds.IsValid(); - if (alwaysApplies || AabbOverlaps2D(entry.m_bounds, inRegion)) + for (size_t index = 0; index < totalQueryPositions; index++) { - for (size_t index = 0; index < totalQueryPositions; index++) + const auto& inPosition = inPositions[index]; + SurfacePointList& surfacePointList = surfacePointLists[index]; + if (!surfacePointList.empty()) { - const auto& inPosition = inPositions[index]; - SurfacePointList& surfacePointList = surfacePointLists[index]; - if (!surfacePointList.empty()) + if (alwaysApplies || AabbContains2D(entry.m_bounds, inPosition)) { - if (alwaysApplies || AabbContains2D(entry.m_bounds, inPosition)) - { - SurfaceDataModifierRequestBus::Event(entryPair.first, &SurfaceDataModifierRequestBus::Events::ModifySurfacePoints, surfacePointList); - } + SurfaceDataModifierRequestBus::Event( + entryPair.first, &SurfaceDataModifierRequestBus::Events::ModifySurfacePoints, surfacePointList); } } } @@ -318,6 +319,8 @@ namespace SurfaceData } } + + void SurfaceDataSystemComponent::CombineSortAndFilterNeighboringPoints(SurfacePointList& sourcePointList, bool hasDesiredTags, const SurfaceTagVector& desiredTags) const { AZ_PROFILE_FUNCTION(Entity); diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h index c329103efb..8914ee7972 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h @@ -42,6 +42,10 @@ namespace SurfaceData void GetSurfacePointsFromRegion( const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, SurfacePointLists& surfacePointListPerPosition) const override; + void GetSurfacePointsFromList( + AZStd::span inPositions, + const SurfaceTagVector& desiredTags, + SurfacePointLists& surfacePointLists) const override; SurfaceDataRegistryHandle RegisterSurfaceDataProvider(const SurfaceDataRegistryEntry& entry) override; void UnregisterSurfaceDataProvider(const SurfaceDataRegistryHandle& handle) override; diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp new file mode 100644 index 0000000000..65487c155b --- /dev/null +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataBenchmarks.cpp @@ -0,0 +1,276 @@ +/* + * 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 + * + */ + +#ifdef HAVE_BENCHMARK + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class SurfaceDataBenchmark : public ::benchmark::Fixture + { + public: + void internalSetUp() + { + m_surfaceDataSystemEntity = AZStd::make_unique(); + m_surfaceDataSystemEntity->CreateComponent(); + m_surfaceDataSystemEntity->Init(); + m_surfaceDataSystemEntity->Activate(); + } + + void internalTearDown() + { + m_surfaceDataSystemEntity.reset(); + } + + // Create an entity with a Transform component and a SurfaceDataShape component at the given position with the given tags. + AZStd::unique_ptr CreateBenchmarkEntity( + AZ::Vector3 worldPos, AZStd::span providerTags, AZStd::span modifierTags) + { + AZStd::unique_ptr entity = AZStd::make_unique(); + + auto transform = entity->CreateComponent(); + transform->SetLocalTM(AZ::Transform::CreateTranslation(worldPos)); + transform->SetWorldTM(AZ::Transform::CreateTranslation(worldPos)); + + SurfaceData::SurfaceDataShapeConfig surfaceConfig; + for (auto& providerTag : providerTags) + { + surfaceConfig.m_providerTags.push_back(SurfaceData::SurfaceTag(providerTag)); + } + for (auto& modifierTag : modifierTags) + { + surfaceConfig.m_modifierTags.push_back(SurfaceData::SurfaceTag(modifierTag)); + } + entity->CreateComponent(surfaceConfig); + + return entity; + } + + /* Create a set of shape surfaces in the world that we can use for benchmarking. + Each shape is centered in XY and is the XY size of the world, but with different Z heights and placements. + There are two boxes and one cylinder, layered like this: + + Top: + --- + |O| <- two boxes of equal XY size with a cylinder face-up in the center + --- + + Side: + |-----------| + | |<- entity 3, box that contains the other shapes + | |-------| | <- entity 2, cylinder inside entity 3 and intersecting entity 1 + | | | | + |-----------|<- entity 1, thin box + | |-------| | + | | + |-----------| + + This will give us either 2 or 3 generated surface points at every query point. The entity 1 surface will get the entity 2 and 3 + modifier tags added to it. The entity 2 surface will get the entity 3 modifier tag added to it. The entity 3 surface won't get + modified. + */ + AZStd::vector> CreateBenchmarkEntities(float worldSize) + { + AZStd::vector> testEntities; + float halfWorldSize = worldSize / 2.0f; + + // Create a large flat box with 1 provider tag. + AZStd::unique_ptr surface1 = CreateBenchmarkEntity( + AZ::Vector3(halfWorldSize, halfWorldSize, 10.0f), AZStd::array{ "surface1" }, {}); + { + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(worldSize, worldSize, 1.0f)); + auto shapeComponent = surface1->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + shapeComponent->SetConfiguration(boxConfig); + + surface1->Init(); + surface1->Activate(); + } + testEntities.push_back(AZStd::move(surface1)); + + // Create a large cylinder with 1 provider tag and 1 modifier tag. + AZStd::unique_ptr surface2 = CreateBenchmarkEntity( + AZ::Vector3(halfWorldSize, halfWorldSize, 20.0f), AZStd::array{ "surface2" }, AZStd::array{ "modifier2" }); + { + LmbrCentral::CylinderShapeConfig cylinderConfig; + cylinderConfig.m_height = 30.0f; + cylinderConfig.m_radius = halfWorldSize; + auto shapeComponent = surface2->CreateComponent(LmbrCentral::CylinderShapeComponentTypeId); + shapeComponent->SetConfiguration(cylinderConfig); + + surface2->Init(); + surface2->Activate(); + } + testEntities.push_back(AZStd::move(surface2)); + + // Create a large box with 1 provider tag and 1 modifier tag. + AZStd::unique_ptr surface3 = CreateBenchmarkEntity( + AZ::Vector3(halfWorldSize, halfWorldSize, 30.0f), AZStd::array{ "surface3" }, AZStd::array{ "modifier3" }); + { + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(worldSize, worldSize, 100.0f)); + auto shapeComponent = surface3->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + shapeComponent->SetConfiguration(boxConfig); + + surface3->Init(); + surface3->Activate(); + } + testEntities.push_back(AZStd::move(surface3)); + + return testEntities; + } + + SurfaceData::SurfaceTagVector CreateBenchmarkTagFilterList() + { + SurfaceData::SurfaceTagVector tagFilterList; + tagFilterList.emplace_back("surface1"); + tagFilterList.emplace_back("surface2"); + tagFilterList.emplace_back("surface3"); + tagFilterList.emplace_back("modifier2"); + tagFilterList.emplace_back("modifier3"); + return tagFilterList; + } + + protected: + void SetUp([[maybe_unused]] const benchmark::State& state) override + { + internalSetUp(); + } + void SetUp([[maybe_unused]] benchmark::State& state) override + { + internalSetUp(); + } + + void TearDown([[maybe_unused]] const benchmark::State& state) override + { + internalTearDown(); + } + void TearDown([[maybe_unused]] benchmark::State& state) override + { + internalTearDown(); + } + + AZStd::unique_ptr m_surfaceDataSystemEntity; + }; + + BENCHMARK_DEFINE_F(SurfaceDataBenchmark, BM_GetSurfacePoints)(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create our benchmark world + const float worldSize = aznumeric_cast(state.range(0)); + AZStd::vector> benchmarkEntities = CreateBenchmarkEntities(worldSize); + SurfaceData::SurfaceTagVector filterTags = CreateBenchmarkTagFilterList(); + + // Query every point in our world at 1 meter intervals. + for (auto _ : state) + { + // This is declared outside the loop so that the list of points doesn't fully reallocate on every query. + SurfaceData::SurfacePointList points; + + for (float y = 0.0f; y < worldSize; y += 1.0f) + { + for (float x = 0.0f; x < worldSize; x += 1.0f) + { + AZ::Vector3 queryPosition(x, y, 0.0f); + points.clear(); + + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, queryPosition, filterTags, points); + benchmark::DoNotOptimize(points); + } + } + } + } + + BENCHMARK_DEFINE_F(SurfaceDataBenchmark, BM_GetSurfacePointsFromRegion)(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create our benchmark world + float worldSize = aznumeric_cast(state.range(0)); + AZStd::vector> benchmarkEntities = CreateBenchmarkEntities(worldSize); + SurfaceData::SurfaceTagVector filterTags = CreateBenchmarkTagFilterList(); + + // Query every point in our world at 1 meter intervals. + for (auto _ : state) + { + SurfaceData::SurfacePointLists points; + + AZ::Aabb inRegion = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(worldSize)); + AZ::Vector2 stepSize(1.0f); + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, inRegion, stepSize, filterTags, + points); + benchmark::DoNotOptimize(points); + } + } + + BENCHMARK_DEFINE_F(SurfaceDataBenchmark, BM_GetSurfacePointsFromList)(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create our benchmark world + const float worldSize = aznumeric_cast(state.range(0)); + const int64_t worldSizeInt = state.range(0); + AZStd::vector> benchmarkEntities = CreateBenchmarkEntities(worldSize); + SurfaceData::SurfaceTagVector filterTags = CreateBenchmarkTagFilterList(); + + // Query every point in our world at 1 meter intervals. + for (auto _ : state) + { + AZStd::vector queryPositions; + queryPositions.reserve(worldSizeInt * worldSizeInt); + + for (float y = 0.0f; y < worldSize; y += 1.0f) + { + for (float x = 0.0f; x < worldSize; x += 1.0f) + { + queryPositions.emplace_back(x, y, 0.0f); + } + } + + SurfaceData::SurfacePointLists points; + + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromList, queryPositions, filterTags, points); + benchmark::DoNotOptimize(points); + } + } + + BENCHMARK_REGISTER_F(SurfaceDataBenchmark, BM_GetSurfacePoints) + ->Arg( 1024 ) + ->Arg( 2048 ) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_REGISTER_F(SurfaceDataBenchmark, BM_GetSurfacePointsFromRegion) + ->Arg( 1024 ) + ->Arg( 2048 ) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_REGISTER_F(SurfaceDataBenchmark, BM_GetSurfacePointsFromList) + ->Arg( 1024 ) + ->Arg( 2048 ) + ->Unit(::benchmark::kMillisecond); + +#endif +} + + diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp index 9b31c98759..b0aa5dd38f 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -23,23 +22,6 @@ namespace UnitTest { - // Mock out a generic Physics Collider Component, which is a required dependency for adding a SurfaceDataColliderComponent. - struct MockPhysicsColliderComponent - : public AZ::Component - { - public: - AZ_COMPONENT(MockPhysicsColliderComponent, "{4F7C36DE-6475-4E0A-96A7-BFAF21C07C95}", AZ::Component); - - void Activate() override {} - void Deactivate() override {} - - static void Reflect(AZ::ReflectContext* reflect) { AZ_UNUSED(reflect); } - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC("PhysXColliderService", 0x4ff43f7c)); - } - }; - class MockPhysicsWorldBusProvider : public AzPhysics::SimulatedBodyComponentRequestsBus::Handler { diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 177abd3824..1d339edc71 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -8,7 +8,6 @@ #include -#include #include #include #include @@ -22,6 +21,7 @@ #include #include #include +#include // Simple class for mocking out a surface provider, so that we can control exactly what points we expect to query in our tests. // This can be used to either provide a surface or modify a surface. @@ -175,61 +175,33 @@ class MockSurfaceProvider }; - - - TEST(SurfaceDataTest, ComponentsWithComponentApplication) { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 10 * 1024 * 1024; - appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; - appDesc.m_stackRecordLevels = 20; + AZ::Entity* testSystemEntity = new AZ::Entity(); + testSystemEntity->CreateComponent(); - AZ::ComponentApplication app; - AZ::Entity* systemEntity = app.Create(appDesc); - ASSERT_TRUE(systemEntity != nullptr); - app.RegisterComponentDescriptor(SurfaceData::SurfaceDataSystemComponent::CreateDescriptor()); - systemEntity->CreateComponent(); - - systemEntity->Init(); - systemEntity->Activate(); - - app.Destroy(); - ASSERT_TRUE(true); + testSystemEntity->Init(); + testSystemEntity->Activate(); + EXPECT_EQ(testSystemEntity->GetState(), AZ::Entity::State::Active); + testSystemEntity->Deactivate(); + delete testSystemEntity; } class SurfaceDataTestApp : public ::testing::Test { public: - SurfaceDataTestApp() - : m_application() - , m_systemEntity(nullptr) - { - } - void SetUp() override { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 50 * 1024 * 1024; - appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; - appDesc.m_stackRecordLevels = 20; - - AZ::ComponentApplication::StartupParameters appStartup; - appStartup.m_createStaticModulesCallback = - [](AZStd::vector& modules) - { - modules.emplace_back(new SurfaceData::SurfaceDataModule); - }; - - m_systemEntity = m_application.Create(appDesc, appStartup); - m_systemEntity->Init(); - m_systemEntity->Activate(); + m_surfaceDataSystemEntity = AZStd::make_unique(); + m_surfaceDataSystemEntity->CreateComponent(); + m_surfaceDataSystemEntity->Init(); + m_surfaceDataSystemEntity->Activate(); } void TearDown() override { - m_application.Destroy(); + m_surfaceDataSystemEntity.reset(); } bool ValidateRegionListSize(AZ::Aabb bounds, AZ::Vector2 stepSize, const SurfaceData::SurfacePointLists& outputLists) @@ -240,15 +212,43 @@ public: return (outputLists.size() == aznumeric_cast(ceil(bounds.GetXExtent() * stepSize.GetX()) * ceil(bounds.GetYExtent() * stepSize.GetY()))); } + void CompareSurfacePointListWithGetSurfacePoints( + SurfaceData::SurfacePointLists surfacePointLists, const SurfaceData::SurfaceTagVector& testTags) + { + for (auto& pointList : surfacePointLists) + { + AZ::Vector3 queryPosition(pointList[0].m_position.GetX(), pointList[0].m_position.GetY(), 16.0f); + SurfaceData::SurfacePointList singleQueryPointList; + + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, queryPosition, testTags, singleQueryPointList); + + // Verify the two point lists are the same size, then verify that each point in each list is equal. + ASSERT_EQ(pointList.size(), singleQueryPointList.size()); + for (size_t index = 0; index < pointList.size(); index++) + { + SurfaceData::SurfacePoint& point1 = pointList[index]; + SurfaceData::SurfacePoint& point2 = singleQueryPointList[index]; + + EXPECT_EQ(point1.m_entityId, point2.m_entityId); + EXPECT_EQ(point1.m_position, point2.m_position); + EXPECT_EQ(point1.m_normal, point2.m_normal); + ASSERT_EQ(point1.m_masks.size(), point2.m_masks.size()); + for (auto& mask : point1.m_masks) + { + EXPECT_EQ(mask.second, point2.m_masks[mask.first]); + } + } + } + } - AZ::ComponentApplication m_application; - AZ::Entity* m_systemEntity; // Test Surface Data tags that we can use for testing query functionality const AZ::Crc32 m_testSurface1Crc = AZ::Crc32("test_surface1"); const AZ::Crc32 m_testSurface2Crc = AZ::Crc32("test_surface2"); const AZ::Crc32 m_testSurfaceNoMatchCrc = AZ::Crc32("test_surface_no_match"); + AZStd::unique_ptr m_surfaceDataSystemEntity; }; TEST_F(SurfaceDataTestApp, SurfaceData_TestRegisteredTags) @@ -706,4 +706,64 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_DissimilarPoi } } -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); +TEST_F(SurfaceDataTestApp, SurfaceData_VerifyGetSurfacePointsFromRegionAndGetSurfacePointsMatch) +{ + // This ensures that both GetSurfacePointsFromRegion and GetSurfacePoints produce the same results. + + // Create a mock Surface Provider that covers from (0, 0) - (8, 8) in space. + // It defines points spaced 0.25 apart, with heights of 0 and 4, and with the tags "test_surface1" and "test_surface2". + // (We're creating points spaced more densely than we'll query just to verify that we only get back the queried points) + SurfaceData::SurfaceTagVector providerTags = { SurfaceData::SurfaceTag(m_testSurface1Crc), SurfaceData::SurfaceTag(m_testSurface2Crc) }; + MockSurfaceProvider mockProvider( + MockSurfaceProvider::ProviderType::SURFACE_PROVIDER, providerTags, AZ::Vector3(0.0f), AZ::Vector3(8.0f), + AZ::Vector3(0.25f, 0.25f, 4.0f)); + + // Query for all the surface points from (0, 0, 16) - (4, 4, 16) with a step size of 1. + SurfaceData::SurfacePointLists availablePointsPerPosition; + AZ::Vector2 stepSize(1.0f, 1.0f); + AZ::Aabb regionBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f, 0.0f, 16.0f), AZ::Vector3(4.0f, 4.0f, 16.0f)); + + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, providerTags, + availablePointsPerPosition); + + EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); + + // For each point entry returned from GetSurfacePointsFromRegion, call GetSurfacePoints and verify the results match. + CompareSurfacePointListWithGetSurfacePoints(availablePointsPerPosition, providerTags); +} + +TEST_F(SurfaceDataTestApp, SurfaceData_VerifyGetSurfacePointsFromListAndGetSurfacePointsMatch) +{ + // This ensures that both GetSurfacePointsFromList and GetSurfacePoints produce the same results. + + // Create a mock Surface Provider that covers from (0, 0) - (8, 8) in space. + // It defines points spaced 0.25 apart, with heights of 0 and 4, and with the tags "test_surface1" and "test_surface2". + // (We're creating points spaced more densely than we'll query just to verify that we only get back the queried points) + SurfaceData::SurfaceTagVector providerTags = { SurfaceData::SurfaceTag(m_testSurface1Crc), SurfaceData::SurfaceTag(m_testSurface2Crc) }; + MockSurfaceProvider mockProvider( + MockSurfaceProvider::ProviderType::SURFACE_PROVIDER, providerTags, AZ::Vector3(0.0f), AZ::Vector3(8.0f), + AZ::Vector3(0.25f, 0.25f, 4.0f)); + + // Query for all the surface points from (0, 0, 16) - (4, 4, 16) with a step size of 1. + SurfaceData::SurfacePointLists availablePointsPerPosition; + AZStd::vector queryPositions; + for (float y = 0.0f; y < 4.0f; y += 1.0f) + { + for (float x = 0.0f; x < 4.0f; x += 1.0f) + { + queryPositions.push_back(AZ::Vector3(x, y, 16.0f)); + } + } + + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromList, + queryPositions, providerTags, availablePointsPerPosition); + + EXPECT_EQ(availablePointsPerPosition.size(), 16); + + // For each point entry returned from GetSurfacePointsFromList, call GetSurfacePoints and verify the results match. + CompareSurfacePointListWithGetSurfacePoints(availablePointsPerPosition, providerTags); +} +// This uses custom test / benchmark hooks so that we can load LmbrCentral and use Shape components in our unit tests and benchmarks. +AZ_UNIT_TEST_HOOK(new UnitTest::SurfaceDataTestEnvironment, UnitTest::SurfaceDataBenchmarkEnvironment); diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.cpp new file mode 100644 index 0000000000..2ec531d2e4 --- /dev/null +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.cpp @@ -0,0 +1,36 @@ +/* + * 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 +#include +#include + + +namespace UnitTest +{ + void SurfaceDataTestEnvironment::AddGemsAndComponents() + { + AddDynamicModulePaths({ "LmbrCentral" }); + + AddComponentDescriptors({ + AzFramework::TransformComponent::CreateDescriptor(), + + SurfaceData::SurfaceDataSystemComponent::CreateDescriptor(), + SurfaceData::SurfaceDataColliderComponent::CreateDescriptor(), + SurfaceData::SurfaceDataShapeComponent::CreateDescriptor(), + + MockPhysicsColliderComponent::CreateDescriptor() + }); + } +} + diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.h b/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.h new file mode 100644 index 0000000000..fc27effd8b --- /dev/null +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTestFixtures.h @@ -0,0 +1,43 @@ +/* + * 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 + +namespace UnitTest +{ + // SurfaceData needs to use the GemTestEnvironment to load the LmbrCentral Gem so that Shape components can be used + // in the unit tests and benchmarks. + class SurfaceDataTestEnvironment + : public AZ::Test::GemTestEnvironment + { + public: + void AddGemsAndComponents() override; + }; + +#ifdef HAVE_BENCHMARK + //! The Benchmark environment is used for one time setup and tear down of shared resources + class SurfaceDataBenchmarkEnvironment + : public AZ::Test::BenchmarkEnvironmentBase + , public SurfaceDataTestEnvironment + + { + protected: + void SetUpBenchmark() override + { + SetupEnvironment(); + } + + void TearDownBenchmark() override + { + TeardownEnvironment(); + } + }; +#endif + +} diff --git a/Gems/SurfaceData/Code/surfacedata_tests_files.cmake b/Gems/SurfaceData/Code/surfacedata_tests_files.cmake index a65d51c47c..a334f7bf40 100644 --- a/Gems/SurfaceData/Code/surfacedata_tests_files.cmake +++ b/Gems/SurfaceData/Code/surfacedata_tests_files.cmake @@ -8,8 +8,11 @@ set(FILES Include/SurfaceData/Tests/SurfaceDataTestMocks.h + Tests/SurfaceDataBenchmarks.cpp Tests/SurfaceDataColliderComponentTest.cpp Tests/SurfaceDataTest.cpp + Tests/SurfaceDataTestFixtures.cpp + Tests/SurfaceDataTestFixtures.h Source/SurfaceDataModule.cpp Source/SurfaceDataModule.h ) diff --git a/Gems/Vegetation/Code/Tests/VegetationMocks.h b/Gems/Vegetation/Code/Tests/VegetationMocks.h index 8a8bfe6b76..c1d83fb68b 100644 --- a/Gems/Vegetation/Code/Tests/VegetationMocks.h +++ b/Gems/Vegetation/Code/Tests/VegetationMocks.h @@ -345,6 +345,13 @@ namespace UnitTest { } + void GetSurfacePointsFromList( + [[maybe_unused]] AZStd::span inPositions, + [[maybe_unused]] const SurfaceData::SurfaceTagVector& desiredTags, + [[maybe_unused]] SurfaceData::SurfacePointLists& surfacePointLists) const override + { + } + SurfaceData::SurfaceDataRegistryHandle RegisterSurfaceDataProvider([[maybe_unused]] const SurfaceData::SurfaceDataRegistryEntry& entry) override { ++m_count; From 5c3d5a290ae2f30ab1e256790bd7b3a8b20e98c9 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:51:41 -0700 Subject: [PATCH 357/394] Minor changes Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseProbeGridVisualizationComposite.azsl | 2 -- .../DiffuseProbeGridRelocationPass.cpp | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl index 2151541c06..e6b28da8c8 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridVisualizationComposite.azsl @@ -31,8 +31,6 @@ ShaderResourceGroup PassSrg : SRG_PerPass }; } -#include - // Vertex Shader VSOutput MainVS(VSInput input) { diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp index 70b54d70cc..3922be0481 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp @@ -128,12 +128,11 @@ namespace AZ AZ_Assert(rayTracingFeatureProcessor, "DiffuseProbeGridRelocationPass requires the RayTracingFeatureProcessor"); // reset the relocation iterations on the grids if the TLAS was updated - uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) - { - if (rayTracingDataRevision != m_rayTracingDataRevision) + uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); + if (rayTracingDataRevision != m_rayTracingDataRevision) + { + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { - // the TLAS changed, relocate probes diffuseProbeGrid->ResetRemainingRelocationIterations(); } } From c514e1b49017b91b9565c6ecad1ca156a7bbbffe Mon Sep 17 00:00:00 2001 From: hershey5045 <43485729+hershey5045@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:14:27 -0800 Subject: [PATCH 358/394] Small refactor on ImageComparison utils. (#7133) * Small refactor on ImageComparison utils. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Add aznumeric cast. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Correction on aznumeric cast. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Add unit test for new image comparison function. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> --- .../Code/Include/Atom/Utils/ImageComparison.h | 3 +++ .../Utils/Code/Source/ImageComparison.cpp | 19 +++++++++++-------- .../Utils/Code/Tests/ImageComparisonTests.cpp | 10 ++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h index 4126e9eb4a..58c3a1bd48 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h @@ -23,6 +23,9 @@ namespace AZ UnsupportedFormat }; + //! Calculates the maximum difference of the rgb channels between two image buffers. + int16_t CalcMaxChannelDifference(AZStd::array_view bufferA, AZStd::array_view bufferB, size_t index); + //! Compares two images and returns the RMS (root mean square) of the difference. //! @param buffer[A|B] the raw buffer of image data //! @param size[A|B] the dimensions of the image in the buffer diff --git a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp index 0bad268ba5..6fcc316791 100644 --- a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp +++ b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp @@ -14,6 +14,16 @@ namespace AZ { namespace Utils { + int16_t CalcMaxChannelDifference(AZStd::array_view bufferA, AZStd::array_view bufferB, size_t index) + { + // We use the max error from a single channel instead of accumulating the error from each channel. + // This normalizes differences so that for example black vs red has the same weight as black vs yellow. + const int16_t diffR = static_cast(abs(aznumeric_cast(bufferA[index]) - aznumeric_cast(bufferB[index]))); + const int16_t diffG = static_cast(abs(aznumeric_cast(bufferA[index + 1]) - aznumeric_cast(bufferB[index + 1]))); + const int16_t diffB = static_cast(abs(aznumeric_cast(bufferA[index + 2]) - aznumeric_cast(bufferB[index + 2]))); + return AZ::GetMax(AZ::GetMax(diffR, diffG), diffB); + } + ImageDiffResultCode CalcImageDiffRms( AZStd::span bufferA, const RHI::Size& sizeA, RHI::Format formatA, AZStd::span bufferB, const RHI::Size& sizeB, RHI::Format formatB, @@ -67,14 +77,7 @@ namespace AZ for (size_t i = 0; i < bufferA.size(); i += BytesPerPixel) { - // We use the max error from a single channel instead of accumulating the error from each channel. - // This normalizes differences so that for example black vs red has the same weight as black vs yellow. - const int16_t diffR = static_cast(abs(aznumeric_cast(bufferA[i]) - aznumeric_cast(bufferB[i]))); - const int16_t diffG = static_cast(abs(aznumeric_cast(bufferA[i + 1]) - aznumeric_cast(bufferB[i + 1]))); - const int16_t diffB = static_cast(abs(aznumeric_cast(bufferA[i + 2]) - aznumeric_cast(bufferB[i + 2]))); - const int16_t maxDiff = AZ::GetMax(AZ::GetMax(diffR, diffG), diffB); - - const float finalDiffNormalized = maxDiff / 255.0f; + const float finalDiffNormalized = aznumeric_cast(CalcMaxChannelDifference(bufferA, bufferB, i)) / 255.0f; const float squared = finalDiffNormalized * finalDiffNormalized; if (diffScore) diff --git a/Gems/Atom/Utils/Code/Tests/ImageComparisonTests.cpp b/Gems/Atom/Utils/Code/Tests/ImageComparisonTests.cpp index 29861e1dbb..2ec71ff848 100644 --- a/Gems/Atom/Utils/Code/Tests/ImageComparisonTests.cpp +++ b/Gems/Atom/Utils/Code/Tests/ImageComparisonTests.cpp @@ -127,6 +127,16 @@ namespace UnitTest EXPECT_EQ(0.0f, diffScore); } + + TEST_F(ImageComparisonTests, CheckMaxChannelDifference) + { + const AZStd::vector imageA = { 255, 255, 255 }; + const AZStd::vector imageB = { 0, 125, 255 }; + const int16_t maxChannelDiff = 255; + const int16_t res = CalcMaxChannelDifference(imageA, imageB, 0); + EXPECT_EQ(res, maxChannelDiff); + } + TEST_F(ImageComparisonTests, CheckThreshold_SmallImagesWithDifferences) { AZ::RHI::Size size{2, 2, 1}; From 0a5e61b8342e86223c3eda1fa3739f074a701c4a Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:17:20 -0600 Subject: [PATCH 359/394] Update default AZStd thread priority on Apple platforms to avoid being prevented from using 100% of a core (#7295) PAL-ified default thread priority for pthread platforms. Fix threads not getting named on Apple platforms by setting the thread name ptr on the thread_info struct. Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../std/parallel/internal/thread_Android.cpp | 7 +++++++ .../AzCore/std/parallel/internal/thread_Apple.cpp | 15 ++++++++++++++- .../std/parallel/internal/thread_UnixLike.cpp | 4 +++- .../AzCore/std/parallel/internal/thread_Linux.cpp | 7 +++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Android/AzCore/std/parallel/internal/thread_Android.cpp b/Code/Framework/AzCore/Platform/Android/AzCore/std/parallel/internal/thread_Android.cpp index 612296ebba..865d84516f 100644 --- a/Code/Framework/AzCore/Platform/Android/AzCore/std/parallel/internal/thread_Android.cpp +++ b/Code/Framework/AzCore/Platform/Android/AzCore/std/parallel/internal/thread_Android.cpp @@ -36,5 +36,12 @@ namespace AZStd { pthread_setname_np(tId, name); } + + uint8_t GetDefaultThreadPriority() + { + // pthread priority is an integer between >=1 and <=99 (although only range 1<=>32 is guaranteed) + // Don't use a scheduling policy value (e.g. SCHED_OTHER or SCHED_FIFO) here. + return 1; + } } } diff --git a/Code/Framework/AzCore/Platform/Common/Apple/AzCore/std/parallel/internal/thread_Apple.cpp b/Code/Framework/AzCore/Platform/Common/Apple/AzCore/std/parallel/internal/thread_Apple.cpp index bc89545faa..c39447b2f2 100644 --- a/Code/Framework/AzCore/Platform/Common/Apple/AzCore/std/parallel/internal/thread_Apple.cpp +++ b/Code/Framework/AzCore/Platform/Common/Apple/AzCore/std/parallel/internal/thread_Apple.cpp @@ -35,7 +35,7 @@ namespace AZStd void SetThreadPriority(int priority, pthread_attr_t& attr) { - if (priority == -1) + if (priority <= -1) { pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED); } @@ -59,5 +59,18 @@ namespace AZStd thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, (thread_policy_t)& policyData, 1); } } + + ////////////////////////////////////////////////////////////////////////////////// + // Apple pthread -> NSThread quality of service level map + // QOS class name | min pthread priority | max pthread priority | comment + // QOS_CLASS_USER_INTERACTIVE | 38 | 47 | Per-frame work + // QOS_CLASS_USER_INITIATED | 32 | 37 | Asynchronous / Cross frame work + // QOS_CLASS_DEFAULT | 21 | 31 | Streaming / Multiple frames deadline + // QOS_CLASS_UTILITY | 5 | 20 | Background asset download + // QOS_CLASS_BACKGROUN | 0 | 4 | Will be prevented from using whole core. + uint8_t GetDefaultThreadPriority() + { + return 10; + } } } diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/std/parallel/internal/thread_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/std/parallel/internal/thread_UnixLike.cpp index da5d95b9a4..5ff3b82b3f 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/std/parallel/internal/thread_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/std/parallel/internal/thread_UnixLike.cpp @@ -21,6 +21,7 @@ namespace AZStd void PreCreateSetThreadAffinity(int cpuId, pthread_attr_t& attr); void SetThreadPriority(int priority, pthread_attr_t& attr); void PostCreateThread(pthread_t tId, const char * name, int cpuId); + uint8_t GetDefaultThreadPriority(); } namespace Internal @@ -60,12 +61,13 @@ namespace AZStd } else { - priority = SCHED_OTHER; + priority = Platform::GetDefaultThreadPriority(); } if (desc->m_name) { name = desc->m_name; } + ti->m_name = name; cpuId = desc->m_cpuId; pthread_attr_setdetachstate(&attr, desc->m_isJoinable ? PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED); diff --git a/Code/Framework/AzCore/Platform/Linux/AzCore/std/parallel/internal/thread_Linux.cpp b/Code/Framework/AzCore/Platform/Linux/AzCore/std/parallel/internal/thread_Linux.cpp index 619658057b..10121cc2ed 100644 --- a/Code/Framework/AzCore/Platform/Linux/AzCore/std/parallel/internal/thread_Linux.cpp +++ b/Code/Framework/AzCore/Platform/Linux/AzCore/std/parallel/internal/thread_Linux.cpp @@ -55,5 +55,12 @@ namespace AZStd { pthread_setname_np(tId, name); } + + uint8_t GetDefaultThreadPriority() + { + // pthread priority is an integer between >=1 and <=99 (although only range 1<=>32 is guaranteed) + // Don't use a scheduling policy value (e.g. SCHED_OTHER or SCHED_FIFO) here. + return 1; + } } } From 564596fcf0ad4b802e92d148e4a7053bba05ee72 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 31 Jan 2022 15:34:42 -0600 Subject: [PATCH 360/394] Removed legacy PropertyResourceCtrl Signed-off-by: Chris Galvan --- Code/Editor/Controls/BitmapToolTip.cpp | 369 ---------- Code/Editor/Controls/BitmapToolTip.h | 88 --- Code/Editor/Controls/QBitmapPreviewDialog.cpp | 172 ----- Code/Editor/Controls/QBitmapPreviewDialog.h | 64 -- Code/Editor/Controls/QBitmapPreviewDialog.ui | 390 ----------- .../Controls/QBitmapPreviewDialogImp.cpp | 528 -------------- .../Editor/Controls/QBitmapPreviewDialogImp.h | 89 --- Code/Editor/Controls/QToolTipWidget.cpp | 642 ------------------ Code/Editor/Controls/QToolTipWidget.h | 148 ---- .../ReflectedPropertyControl/PropertyCtrl.cpp | 2 - .../PropertyResourceCtrl.cpp | 383 ----------- .../PropertyResourceCtrl.h | 118 ---- .../ReflectedPropertyControl/ReflectedVar.cpp | 6 - Code/Editor/editor_core_files.cmake | 7 - Code/Editor/editor_lib_files.cmake | 4 - 15 files changed, 3010 deletions(-) delete mode 100644 Code/Editor/Controls/BitmapToolTip.cpp delete mode 100644 Code/Editor/Controls/BitmapToolTip.h delete mode 100644 Code/Editor/Controls/QBitmapPreviewDialog.cpp delete mode 100644 Code/Editor/Controls/QBitmapPreviewDialog.h delete mode 100644 Code/Editor/Controls/QBitmapPreviewDialog.ui delete mode 100644 Code/Editor/Controls/QBitmapPreviewDialogImp.cpp delete mode 100644 Code/Editor/Controls/QBitmapPreviewDialogImp.h delete mode 100644 Code/Editor/Controls/QToolTipWidget.cpp delete mode 100644 Code/Editor/Controls/QToolTipWidget.h delete mode 100644 Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp delete mode 100644 Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.h diff --git a/Code/Editor/Controls/BitmapToolTip.cpp b/Code/Editor/Controls/BitmapToolTip.cpp deleted file mode 100644 index d639ac0677..0000000000 --- a/Code/Editor/Controls/BitmapToolTip.cpp +++ /dev/null @@ -1,369 +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 - * - */ - - -// Description : Tooltip that displays bitmap. - - -#include "EditorDefs.h" - -#include "BitmapToolTip.h" - -// Qt -#include - -// Editor -#include "Util/Image.h" -#include "Util/ImageUtil.h" - - -static const int STATIC_TEXT_C_HEIGHT = 42; -static const int HISTOGRAM_C_HEIGHT = 130; - -///////////////////////////////////////////////////////////////////////////// -// CBitmapToolTip -CBitmapToolTip::CBitmapToolTip(QWidget* parent) - : QWidget(parent, Qt::ToolTip) - , m_staticBitmap(new QLabel(this)) - , m_staticText(new QLabel(this)) - , m_rgbaHistogram(new CImageHistogramCtrl(this)) - , m_alphaChannelHistogram(new CImageHistogramCtrl(this)) -{ - m_nTimer = 0; - m_hToolWnd = nullptr; - m_bShowHistogram = true; - m_bShowFullsize = false; - m_eShowMode = ESHOW_RGB; - - connect(&m_timer, &QTimer::timeout, this, &CBitmapToolTip::OnTimer); - - auto* layout = new QVBoxLayout(this); - layout->setSizeConstraint(QLayout::SetFixedSize); - - layout->addWidget(m_staticBitmap); - layout->addWidget(m_staticText); - - auto* histogramLayout = new QHBoxLayout(); - histogramLayout->addWidget(m_rgbaHistogram); - histogramLayout->addWidget(m_alphaChannelHistogram); - m_alphaChannelHistogram->setVisible(false); - - layout->addLayout(histogramLayout); - - setLayout(layout); -} - -CBitmapToolTip::~CBitmapToolTip() -{ -} - -////////////////////////////////////////////////////////////////////////// -void CBitmapToolTip::GetShowMode(EShowMode& eShowMode, bool& bShowInOriginalSize) const -{ - bShowInOriginalSize = CheckVirtualKey(Qt::Key_Space); - eShowMode = ESHOW_RGB; - - if (m_bHasAlpha) - { - if (CheckVirtualKey(Qt::Key_Control)) - { - eShowMode = ESHOW_RGB_ALPHA; - } - else if (CheckVirtualKey(Qt::Key_Alt)) - { - eShowMode = ESHOW_ALPHA; - } - else if (CheckVirtualKey(Qt::Key_Shift)) - { - eShowMode = ESHOW_RGBA; - } - } - else if (m_bIsLimitedHDR) - { - if (CheckVirtualKey(Qt::Key_Shift)) - { - eShowMode = ESHOW_RGBE; - } - } -} - -const char* CBitmapToolTip::GetShowModeDescription(EShowMode eShowMode, [[maybe_unused]] bool bShowInOriginalSize) const -{ - switch (eShowMode) - { - case ESHOW_RGB: - return "RGB"; - case ESHOW_RGB_ALPHA: - return "RGB+A"; - case ESHOW_ALPHA: - return "Alpha"; - case ESHOW_RGBA: - return "RGBA"; - case ESHOW_RGBE: - return "RGBExp"; - } - - return ""; -} - -void CBitmapToolTip::RefreshViewmode() -{ - LoadImage(m_filename); - - if (m_eShowMode == ESHOW_RGB_ALPHA || m_eShowMode == ESHOW_RGBA) - { - m_rgbaHistogram->setVisible(true); - m_alphaChannelHistogram->setVisible(true); - } - else if (m_eShowMode == ESHOW_ALPHA) - { - m_rgbaHistogram->setVisible(false); - m_alphaChannelHistogram->setVisible(true); - } - else - { - m_rgbaHistogram->setVisible(true); - m_alphaChannelHistogram->setVisible(false); - } -} - -bool CBitmapToolTip::LoadImage(const QString& imageFilename) -{ - EShowMode eShowMode = ESHOW_RGB; - const char* pShowModeDescription = "RGB"; - bool bShowInOriginalSize = false; - - GetShowMode(eShowMode, bShowInOriginalSize); - pShowModeDescription = GetShowModeDescription(eShowMode, bShowInOriginalSize); - - QString convertedFileName = Path::GamePathToFullPath(Path::ReplaceExtension(imageFilename, ".dds")); - - // We need to check against both the image filename and the converted filename as it is possible that the - // converted file existed but failed to load previously and we reverted to loading the source asset. - bool alreadyLoadedImage = ((m_filename == convertedFileName) || (m_filename == imageFilename)); - if (alreadyLoadedImage && (m_eShowMode == eShowMode) && (m_bShowFullsize == bShowInOriginalSize)) - { - return true; - } - - CCryFile fileCheck; - if (!fileCheck.Open(convertedFileName.toUtf8().data(), "rb")) - { - // if we didn't find it, then default back to just using what we can find (if any) - convertedFileName = imageFilename; - } - else - { - fileCheck.Close(); - } - - m_eShowMode = eShowMode; - m_bShowFullsize = bShowInOriginalSize; - - CImageEx image; - image.SetHistogramEqualization(CheckVirtualKey(Qt::Key_Shift)); - bool loadedRequestedAsset = true; - if (!CImageUtil::LoadImage(convertedFileName, image)) - { - //Failed to load the requested asset, let's try loading the source asset if available. - loadedRequestedAsset = false; - if (!CImageUtil::LoadImage(imageFilename, image)) - { - m_staticBitmap->clear(); - return false; - } - } - - QString imginfo; - - m_filename = loadedRequestedAsset ? convertedFileName : imageFilename; - m_bHasAlpha = image.HasAlphaChannel(); - m_bIsLimitedHDR = image.IsLimitedHDR(); - - GetShowMode(eShowMode, bShowInOriginalSize); - pShowModeDescription = GetShowModeDescription(eShowMode, bShowInOriginalSize); - - if (m_bHasAlpha) - { - imginfo = tr("%1x%2 %3\nShowing %4 (ALT=Alpha, SHIFT=RGBA, CTRL=RGB+A, SPACE=see in original size)"); - } - else if (m_bIsLimitedHDR) - { - imginfo = tr("%1x%2 %3\nShowing %4 (SHIFT=see hist.-equalized, SPACE=see in original size)"); - } - else - { - imginfo = tr("%1x%2 %3\nShowing %4 (SPACE=see in original size)"); - } - - imginfo = imginfo.arg(image.GetWidth()).arg(image.GetHeight()).arg(image.GetFormatDescription()).arg(pShowModeDescription); - - m_staticText->setText(imginfo); - - int w = image.GetWidth(); - int h = image.GetHeight(); - int multiplier = (m_eShowMode == ESHOW_RGB_ALPHA ? 2 : 1); - int originalW = w * multiplier; - int originalH = h; - - if (!bShowInOriginalSize || (w == 0)) - { - w = 256; - } - if (!bShowInOriginalSize || (h == 0)) - { - h = 256; - } - - w *= multiplier; - - resize(w + 4, h + 4 + STATIC_TEXT_C_HEIGHT + HISTOGRAM_C_HEIGHT); - setVisible(true); - - CImageEx scaledImage; - - if (bShowInOriginalSize && (originalW < w)) - { - w = originalW; - } - if (bShowInOriginalSize && (originalH < h)) - { - h = originalH; - } - - scaledImage.Allocate(w, h); - - if (m_eShowMode == ESHOW_RGB_ALPHA) - { - CImageUtil::ScaleToDoubleFit(image, scaledImage); - } - else - { - CImageUtil::ScaleToFit(image, scaledImage); - } - - if (m_eShowMode == ESHOW_RGB || m_eShowMode == ESHOW_RGBE) - { - scaledImage.SwapRedAndBlue(); - scaledImage.FillAlpha(); - } - else if (m_eShowMode == ESHOW_ALPHA) - { - for (int hh = 0; hh < scaledImage.GetHeight(); hh++) - { - for (int ww = 0; ww < scaledImage.GetWidth(); ww++) - { - int a = scaledImage.ValueAt(ww, hh) >> 24; - scaledImage.ValueAt(ww, hh) = RGB(a, a, a); - } - } - } - else if (m_eShowMode == ESHOW_RGB_ALPHA) - { - int halfWidth = scaledImage.GetWidth() / 2; - for (int hh = 0; hh < scaledImage.GetHeight(); hh++) - { - for (int ww = 0; ww < halfWidth; ww++) - { - int r = GetRValue(scaledImage.ValueAt(ww, hh)); - int g = GetGValue(scaledImage.ValueAt(ww, hh)); - int b = GetBValue(scaledImage.ValueAt(ww, hh)); - int a = scaledImage.ValueAt(ww, hh) >> 24; - scaledImage.ValueAt(ww, hh) = RGB(b, g, r); - scaledImage.ValueAt(ww + halfWidth, hh) = RGB(a, a, a); - } - } - } - else //if (m_showMode == ESHOW_RGBA) - { - scaledImage.SwapRedAndBlue(); - } - - QImage qImage(scaledImage.GetWidth(), scaledImage.GetHeight(), QImage::Format_RGB32); - memcpy(qImage.bits(), scaledImage.GetData(), qImage.sizeInBytes()); - m_staticBitmap->setPixmap(QPixmap::fromImage(qImage)); - - if (m_bShowHistogram && scaledImage.GetData()) - { - m_rgbaHistogram->ComputeHistogram(image, CImageHistogram::eImageFormat_32BPP_BGRA); - m_rgbaHistogram->setDrawMode(EHistogramDrawMode::OverlappedRGB); - - m_alphaChannelHistogram->histogramDisplay()->CopyComputedDataFrom(m_rgbaHistogram->histogramDisplay()); - m_alphaChannelHistogram->setDrawMode(EHistogramDrawMode::AlphaChannel); - } - - return true; -} - -void CBitmapToolTip::OnTimer() -{ - /* - if (IsWindowVisible()) - { - if (m_bHaveAnythingToRender) - Invalidate(); - } - */ - if (m_hToolWnd) - { - QRect toolRc(m_toolRect); - QRect rc = geometry(); - QPoint cursorPos = QCursor::pos(); - toolRc.moveTopLeft(m_hToolWnd->mapToGlobal(toolRc.topLeft())); - if (!toolRc.contains(cursorPos) && !rc.contains(cursorPos)) - { - setVisible(false); - } - else - { - RefreshViewmode(); - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CBitmapToolTip::showEvent([[maybe_unused]] QShowEvent* event) -{ - QPoint cursorPos = QCursor::pos(); - move(cursorPos); - m_timer.start(500); -} - -////////////////////////////////////////////////////////////////////////// -void CBitmapToolTip::hideEvent([[maybe_unused]] QHideEvent* event) -{ - m_timer.stop(); -} - -////////////////////////////////////////////////////////////////////////// - -void CBitmapToolTip::keyPressEvent(QKeyEvent* event) -{ - if (event->key() == Qt::Key_Control || event->key() == Qt::Key_Alt || event->key() == Qt::Key_Shift) - { - RefreshViewmode(); - } -} - -void CBitmapToolTip::keyReleaseEvent(QKeyEvent* event) -{ - if (event->key() == Qt::Key_Control || event->key() == Qt::Key_Alt || event->key() == Qt::Key_Shift) - { - RefreshViewmode(); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBitmapToolTip::SetTool(QWidget* pWnd, const QRect& rect) -{ - assert(pWnd); - m_hToolWnd = pWnd; - m_toolRect = rect; -} - -#include diff --git a/Code/Editor/Controls/BitmapToolTip.h b/Code/Editor/Controls/BitmapToolTip.h deleted file mode 100644 index 5b7c56cbf3..0000000000 --- a/Code/Editor/Controls/BitmapToolTip.h +++ /dev/null @@ -1,88 +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 - * - */ - - -// Description : Tooltip that displays bitmap. - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_BITMAPTOOLTIP_H -#define CRYINCLUDE_EDITOR_CONTROLS_BITMAPTOOLTIP_H -#pragma once - - -#if !defined(Q_MOC_RUN) -#include "Controls/ImageHistogramCtrl.h" - -#include -#include -#endif - -////////////////////////////////////////////////////////////////////////// -class CBitmapToolTip - : public QWidget -{ - Q_OBJECT - // Construction -public: - - enum EShowMode - { - ESHOW_RGB = 0, - ESHOW_ALPHA, - ESHOW_RGBA, - ESHOW_RGB_ALPHA, - ESHOW_RGBE - }; - - CBitmapToolTip(QWidget* parent = nullptr); - virtual ~CBitmapToolTip(); - - bool Create(const RECT& rect); - - // Attributes -public: - - // Operations -public: - void RefreshViewmode(); - - bool LoadImage(const QString& imageFilename); - void SetTool(QWidget* pWnd, const QRect& rect); - - // Generated message map functions -protected: - void OnTimer(); - - void keyPressEvent(QKeyEvent* event) override; - void keyReleaseEvent(QKeyEvent* event) override; - - void showEvent(QShowEvent* event) override; - void hideEvent(QHideEvent* event) override; - -private: - void GetShowMode(EShowMode& showMode, bool& showInOriginalSize) const; - const char* GetShowModeDescription(EShowMode showMode, bool showInOriginalSize) const; - - QLabel* m_staticBitmap; - QLabel* m_staticText; - QString m_filename; - bool m_bShowHistogram; - EShowMode m_eShowMode; - bool m_bShowFullsize; - bool m_bHasAlpha; - bool m_bIsLimitedHDR; - CImageHistogramCtrl* m_rgbaHistogram; - CImageHistogramCtrl* m_alphaChannelHistogram; - int m_nTimer; - QWidget* m_hToolWnd; - QRect m_toolRect; - QTimer m_timer; -}; - - -#endif // CRYINCLUDE_EDITOR_CONTROLS_BITMAPTOOLTIP_H diff --git a/Code/Editor/Controls/QBitmapPreviewDialog.cpp b/Code/Editor/Controls/QBitmapPreviewDialog.cpp deleted file mode 100644 index 912db3708c..0000000000 --- a/Code/Editor/Controls/QBitmapPreviewDialog.cpp +++ /dev/null @@ -1,172 +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 "EditorDefs.h" - -#include "QBitmapPreviewDialog.h" -#include - -#include -#include -#include -#include - -void QBitmapPreviewDialog::ImageData::setRgba8888(const void* buffer, const int& w, const int& h) -{ - const unsigned long bytes = w * h * 4; - m_buffer.resize(bytes); - memcpy(m_buffer.data(), buffer, bytes); - m_image = QImage((uchar*)m_buffer.constData(), w, h, QImage::Format::Format_RGBA8888); -} - -static void fillChecker(int w, int h, unsigned int* dst) -{ - for (int y = 0; y < h; y++) - { - for (int x = 0; x < w; x++) - { - dst[y * w + x] = 0xFF000000 | (((x >> 2) + (y >> 2)) % 2 == 0 ? 0x007F7F7F : 0x00000000); - } - } -} - -QBitmapPreviewDialog::QBitmapPreviewDialog(QWidget* parent) - : QWidget(parent) - , ui(new Ui::QBitmapTooltip) -{ - ui->setupUi(this); - setAttribute(Qt::WA_TranslucentBackground); - setAttribute(Qt::WA_ShowWithoutActivating); - - // Clear label text - ui->m_placeholderBitmap->setText(""); - ui->m_placeholderHistogram->setText(""); - - ui->m_bitmapSize->setProperty("tableRow", "Odd"); - ui->m_Mips->setProperty("tableRow", "Even"); - ui->m_Mean->setProperty("tableRow", "Odd"); - ui->m_StdDev->setProperty("tableRow", "Even"); - ui->m_Median->setProperty("tableRow", "Odd"); - ui->m_labelForBitmapSize->setProperty("tooltipLabel", "content"); - ui->m_labelForMean->setProperty("tooltipLabel", "content"); - ui->m_labelForMedian->setProperty("tooltipLabel", "content"); - ui->m_labelForMips->setProperty("tooltipLabel", "content"); - ui->m_labelForStdDev->setProperty("tooltipLabel", "content"); - ui->m_vBitmapSize->setProperty("tooltipLabel", "content"); - ui->m_vMean->setProperty("tooltipLabel", "content"); - ui->m_vMedian->setProperty("tooltipLabel", "content"); - ui->m_vMips->setProperty("tooltipLabel", "content"); - ui->m_vStdDev->setProperty("tooltipLabel", "content"); - - // Initialize placeholder images - const int w = 64; - const int h = 64; - QByteArray buffer; - buffer.resize(w * h * 4); - unsigned int* dst = (unsigned int*)buffer.data(); - fillChecker(w, h, dst); - m_checker.setRgba8888(buffer.constData(), w, h); - - m_initialSize = window()->window()->geometry().size(); -} - -QBitmapPreviewDialog::~QBitmapPreviewDialog() -{ - delete ui; -} - -void QBitmapPreviewDialog::setImageRgba8888(const void* buffer, const int& w, const int& h, [[maybe_unused]] const QString& info) -{ - m_imageMain.setRgba8888(buffer, w, h); -} - - -QRect QBitmapPreviewDialog::getHistogramArea() -{ - return QRect(ui->m_placeholderHistogram->pos(), ui->m_placeholderHistogram->size()); -} - -void QBitmapPreviewDialog::setFullSize(const bool& fullSize) -{ - if (fullSize) - { - QSize desktop = QApplication::screenAt(ui->m_placeholderBitmap->pos())->availableGeometry().size(); - QSize image = m_imageMain.m_image.size(); - QPoint location = mapToGlobal(ui->m_placeholderBitmap->pos()); - QSize finalSize; - finalSize.setWidth((image.width() < (desktop.width() - location.x())) ? image.width() : (desktop.width() - location.x())); - finalSize.setHeight((image.height() < (desktop.height() - location.y())) ? image.height() : (desktop.height() - location.y())); - float scale = (finalSize.width() < finalSize.height()) ? finalSize.width() / float(m_imageMain.m_image.width()) : finalSize.height() / float(m_imageMain.m_image.height()); - ui->m_placeholderBitmap->setFixedSize(scale * m_imageMain.m_image.size()); - } - else - { - ui->m_placeholderBitmap->setFixedSize(256, 256); - } - - adjustSize(); - - update(); -} - -void QBitmapPreviewDialog::paintEvent(QPaintEvent* e) -{ - QWidget::paintEvent(e); - QRect rect(ui->m_placeholderBitmap->pos(), ui->m_placeholderBitmap->size()); - drawImageData(rect, m_imageMain); -} - -void QBitmapPreviewDialog::drawImageData(const QRect& rect, const ImageData& imgData) -{ - // Draw the - QPainter p(this); - p.drawImage(rect.topLeft(), m_checker.m_image.scaled(rect.size())); - p.drawImage(rect.topLeft(), imgData.m_image.scaled(rect.size())); - - // Draw border - QPen pen; - pen.setColor(QColor(0, 0, 0)); - p.drawRect(rect.top(), rect.left(), rect.width() - 1, rect.height()); -} - -void QBitmapPreviewDialog::setSize(QString _value) -{ - ui->m_vBitmapSize->setText(_value); -} - -void QBitmapPreviewDialog::setMips(QString _value) -{ - ui->m_vMips->setText(_value); -} - -void QBitmapPreviewDialog::setMean(QString _value) -{ - ui->m_vMean->setText(_value); -} - -void QBitmapPreviewDialog::setMedian(QString _value) -{ - ui->m_vMedian->setText(_value); -} - -void QBitmapPreviewDialog::setStdDev(QString _value) -{ - ui->m_vStdDev->setText(_value); -} - -QSize QBitmapPreviewDialog::GetCurrentBitmapSize() -{ - return ui->m_placeholderBitmap->size(); -} - -QSize QBitmapPreviewDialog::GetOriginalImageSize() -{ - return m_imageMain.m_image.size(); -} - - -#include diff --git a/Code/Editor/Controls/QBitmapPreviewDialog.h b/Code/Editor/Controls/QBitmapPreviewDialog.h deleted file mode 100644 index a5429bc8f0..0000000000 --- a/Code/Editor/Controls/QBitmapPreviewDialog.h +++ /dev/null @@ -1,64 +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 - * - */ -#ifndef QBITMAPPREVIEWDIALOG_H -#define QBITMAPPREVIEWDIALOG_H - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -class QLabel; - -namespace Ui { - class QBitmapTooltip; -} - -class QBitmapPreviewDialog - : public QWidget -{ - Q_OBJECT - - struct ImageData - { - QByteArray m_buffer; - QImage m_image; - - void setRgba8888(const void* buffer, const int& w, const int& h); - }; - -public: - explicit QBitmapPreviewDialog(QWidget* parent = 0); - virtual ~QBitmapPreviewDialog(); - QSize GetCurrentBitmapSize(); - QSize GetOriginalImageSize(); - -protected: - void setImageRgba8888(const void* buffer, const int& w, const int& h, const QString& info); - void setSize(QString _value); - void setMips(QString _value); - void setMean(QString _value); - void setMedian(QString _value); - void setStdDev(QString _value); - QRect getHistogramArea(); - void setFullSize(const bool& fullSize); - - void paintEvent(QPaintEvent* e) override; - -private: - void drawImageData(const QRect& rect, const ImageData& imgData); - -protected: - Ui::QBitmapTooltip* ui; - QSize m_initialSize; - ImageData m_checker; - ImageData m_imageMain; -}; - -#endif // QBITMAPPREVIEWDIALOG_H diff --git a/Code/Editor/Controls/QBitmapPreviewDialog.ui b/Code/Editor/Controls/QBitmapPreviewDialog.ui deleted file mode 100644 index 87b3a310ef..0000000000 --- a/Code/Editor/Controls/QBitmapPreviewDialog.ui +++ /dev/null @@ -1,390 +0,0 @@ - - - QBitmapTooltip - - - - 0 - 0 - 256 - 510 - - - - - 256 - 0 - - - - - 16777215 - 16777215 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 256 - - - - - 16777215 - 16777215 - - - - false - - - QFrame::NoFrame - - - QFrame::Sunken - - - Bitmap Area - - - Qt::AlignCenter - - - false - - - - - - - - 0 - 0 - - - - - 0 - 128 - - - - QFrame::NoFrame - - - QFrame::Sunken - - - Histogram Area - - - Qt::AlignCenter - - - - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Size: - - - - - - - Qt::RightToLeft - - - Size Value - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - DXT5 Mips: - - - - - - - Qt::RightToLeft - - - Size Value - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Mean: - - - - - - - Qt::RightToLeft - - - Size Value - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - StdDev: - - - - - - - Qt::RightToLeft - - - Size Value - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - 0 - 24 - - - - - 16777215 - 24 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Median: - - - - - - - Qt::RightToLeft - - - Size Value - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - diff --git a/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp b/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp deleted file mode 100644 index b47a535d2a..0000000000 --- a/Code/Editor/Controls/QBitmapPreviewDialogImp.cpp +++ /dev/null @@ -1,528 +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 "EditorDefs.h" - -#include "QBitmapPreviewDialogImp.h" - -// Cry -#include - -// EditorCore -#include -#include - -// QT -AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: class '...' needs to have dll-interface to be used by clients of class '...' -#include -#include -#include -#include -#include -AZ_POP_DISABLE_WARNING - -#include - -static const int kDefaultWidth = 256; -static const int kDefaultHeight = 256; - -QBitmapPreviewDialogImp::QBitmapPreviewDialogImp(QWidget* parent) - : QBitmapPreviewDialog(parent) - , m_image(new CImageEx()) - , m_showOriginalSize(false) - , m_showMode(ESHOW_RGB) - , m_histrogramMode(eHistogramMode_OverlappedRGB) -{ - setMouseTracking(true); - setImage(""); - ui->m_placeholderBitmap->setStyleSheet("background-color: rgba(0, 0, 0, 0);"); - ui->m_placeholderHistogram->setStyleSheet("background-color: rgba(0, 0, 0, 0);"); - - ui->m_labelForBitmapSize->setProperty("tooltipLabel", "Content"); - ui->m_labelForMean->setProperty("tooltipLabel", "Content"); - ui->m_labelForMedian->setProperty("tooltipLabel", "Content"); - ui->m_labelForMips->setProperty("tooltipLabel", "Content"); - ui->m_labelForStdDev->setProperty("tooltipLabel", "Content"); - - ui->m_vBitmapSize->setProperty("tooltipLabel", "Content"); - ui->m_vMean->setProperty("tooltipLabel", "Content"); - ui->m_vMedian->setProperty("tooltipLabel", "Content"); - ui->m_vMips->setProperty("tooltipLabel", "Content"); - ui->m_vStdDev->setProperty("tooltipLabel", "Content"); - - setUIStyleMode(EUISTYLE_IMAGE_ONLY); -} - -QBitmapPreviewDialogImp::~QBitmapPreviewDialogImp() -{ - SAFE_DELETE(m_image); -} - -void QBitmapPreviewDialogImp::setImage(const QString path) -{ - if (path.isEmpty() - || m_path == path - || !GetIEditor()->GetImageUtil()->LoadImage(path.toUtf8().data(), *m_image)) - { - return; - } - - m_showOriginalSize = isSizeSmallerThanDefault(); - m_path = path; - refreshData(); -} - -void QBitmapPreviewDialogImp::setShowMode(EShowMode mode) -{ - if (mode == ESHOW_NumModes) - { - return; - } - - m_showMode = mode; - refreshData(); - update(); -} - -void QBitmapPreviewDialogImp::toggleShowMode() -{ - m_showMode = (EShowMode)(((int)m_showMode + 1) % ESHOW_NumModes); - refreshData(); - update(); -} - -void QBitmapPreviewDialogImp::setUIStyleMode(EUIStyle mode) -{ - if (mode >= EUISTYLE_NumModes) - { - return; - } - - m_uiStyle = mode; - if (m_uiStyle == EUISTYLE_IMAGE_ONLY) - { - ui->m_placeholderHistogram->hide(); - - ui->m_labelForBitmapSize->hide(); - ui->m_labelForMean->hide(); - ui->m_labelForMedian->hide(); - ui->m_labelForMips->hide(); - ui->m_labelForStdDev->hide(); - - ui->m_vBitmapSize->hide(); - ui->m_vMean->hide(); - ui->m_vMedian->hide(); - ui->m_vMips->hide(); - ui->m_vStdDev->hide(); - } - else - { - ui->m_placeholderHistogram->show(); - - ui->m_labelForBitmapSize->show(); - ui->m_labelForMean->show(); - ui->m_labelForMedian->show(); - ui->m_labelForMips->show(); - ui->m_labelForStdDev->show(); - - ui->m_vBitmapSize->show(); - ui->m_vMean->show(); - ui->m_vMedian->show(); - ui->m_vMips->show(); - ui->m_vStdDev->show(); - } -} - -const QBitmapPreviewDialogImp::EShowMode& QBitmapPreviewDialogImp::getShowMode() const -{ - return m_showMode; -} - -void QBitmapPreviewDialogImp::setHistogramMode(EHistogramMode mode) -{ - if (mode == eHistogramMode_NumModes) - { - return; - } - - m_histrogramMode = mode; -} - -void QBitmapPreviewDialogImp::toggleHistrogramMode() -{ - m_histrogramMode = (EHistogramMode)(((int)m_histrogramMode + 1) % eHistogramMode_NumModes); - update(); -} - -const QBitmapPreviewDialogImp::EHistogramMode& QBitmapPreviewDialogImp::getHistogramMode() const -{ - return m_histrogramMode; -} - -void QBitmapPreviewDialogImp::toggleOriginalSize() -{ - m_showOriginalSize = !m_showOriginalSize; - - refreshData(); - update(); -} - -bool QBitmapPreviewDialogImp::isSizeSmallerThanDefault() -{ - return m_image->GetWidth() < kDefaultWidth && m_image->GetHeight() < kDefaultHeight; -} - -void QBitmapPreviewDialogImp::setOriginalSize(bool value) -{ - m_showOriginalSize = value; - - refreshData(); - update(); -} - - -const char* QBitmapPreviewDialogImp::GetShowModeDescription(EShowMode eShowMode, [[maybe_unused]] bool bShowInOriginalSize) const -{ - switch (eShowMode) - { - case ESHOW_RGB: - return "RGB"; - case ESHOW_RGB_ALPHA: - return "RGB+A"; - case ESHOW_ALPHA: - return "Alpha"; - case ESHOW_RGBA: - return "RGBA"; - case ESHOW_RGBE: - return "RGBExp"; - } - - return ""; -} - -const char* getHistrogramModeStr(QBitmapPreviewDialogImp::EHistogramMode mode, bool shortName) -{ - switch (mode) - { - case QBitmapPreviewDialogImp::eHistogramMode_Luminosity: - return shortName ? "Lum" : "Luminosity"; - case QBitmapPreviewDialogImp::eHistogramMode_OverlappedRGB: - return shortName ? "Overlap" : "Overlapped RGBA"; - case QBitmapPreviewDialogImp::eHistogramMode_SplitRGB: - return shortName ? "R|G|B" : "Split RGB"; - case QBitmapPreviewDialogImp::eHistogramMode_RedChannel: - return shortName ? "Red" : "Red Channel"; - case QBitmapPreviewDialogImp::eHistogramMode_GreenChannel: - return shortName ? "Green" : "Green Channel"; - case QBitmapPreviewDialogImp::eHistogramMode_BlueChannel: - return shortName ? "Blue" : "Blue Channel"; - case QBitmapPreviewDialogImp::eHistogramMode_AlphaChannel: - return shortName ? "Alpha" : "Alpha Channel"; - default: - break; - } - - return ""; -} - -void QBitmapPreviewDialogImp::refreshData() -{ - // Check if we have some usefull data loaded - if (m_image->GetWidth() * m_image->GetHeight() == 0) - { - return; - } - - int w = m_image->GetWidth(); - int h = m_image->GetHeight(); - - int multiplier = (m_showMode == ESHOW_RGB_ALPHA ? 2 : 1); - int originalW = w * multiplier; - int originalH = h; - - if (!m_showOriginalSize || (w == 0)) - { - w = kDefaultWidth; - } - if (!m_showOriginalSize || (h == 0)) - { - h = kDefaultHeight; - } - - w *= multiplier; - - CImageEx scaledImage; - - if (m_showOriginalSize && (originalW < w)) - { - w = originalW; - } - if (m_showOriginalSize && (originalH < h)) - { - h = originalH; - } - - scaledImage.Allocate(w, h); - - if (m_showMode == ESHOW_RGB_ALPHA) - { - GetIEditor()->GetImageUtil()->ScaleToDoubleFit(*m_image, scaledImage); - } - else - { - GetIEditor()->GetImageUtil()->ScaleToFit(*m_image, scaledImage); - } - - if (m_showMode == ESHOW_RGB || m_showMode == ESHOW_RGBE) - { - scaledImage.FillAlpha(); - } - else if (m_showMode == ESHOW_ALPHA) - { - for (int h2 = 0; h2 < scaledImage.GetHeight(); h2++) - { - for (int w2 = 0; w2 < scaledImage.GetWidth(); w2++) - { - int a = scaledImage.ValueAt(w2, h2) >> 24; - scaledImage.ValueAt(w2, h2) = RGB(a, a, a) | (a << 24); - } - } - } - else if (m_showMode == ESHOW_RGB_ALPHA) - { - int halfWidth = scaledImage.GetWidth() / 2; - for (int h2 = 0; h2 < scaledImage.GetHeight(); h2++) - { - for (int w2 = 0; w2 < halfWidth; w2++) - { - int r = GetRValue(scaledImage.ValueAt(w2, h2)); - int g = GetGValue(scaledImage.ValueAt(w2, h2)); - int b = GetBValue(scaledImage.ValueAt(w2, h2)); - int a = scaledImage.ValueAt(w2, h2) >> 24; - scaledImage.ValueAt(w2, h2) = RGB(r, g, b) | (a << 24); - scaledImage.ValueAt(w2 + halfWidth, h2) = RGB(a, a, a) | (a << 24); - } - } - } - - - setImageRgba8888(scaledImage.GetData(), w, h, ""); - setSize(QString().asprintf("%d x %d", m_image->GetWidth(), m_image->GetHeight())); - setMips(QString().asprintf("%d", m_image->GetNumberOfMipMaps())); - - setFullSize(m_showOriginalSize); - - // Compute histogram - m_histogram.ComputeHistogram((BYTE*)scaledImage.GetData(), w, h, CImageHistogram::eImageFormat_32BPP_RGBA); -} - -void QBitmapPreviewDialogImp::paintEvent(QPaintEvent* e) -{ - QBitmapPreviewDialog::paintEvent(e); - - //if showing original size hide other information so it's easier to see - if (m_showOriginalSize) - { - return; - } - if (m_uiStyle == EUISTYLE_IMAGE_ONLY) - { - return; - } - - QPainter p(this); - QPen pen; - QPainterPath path[4]; - - // Fill background color - QRect histogramRect = getHistogramArea(); - p.fillRect(histogramRect, QColor(255, 255, 255)); - - // Draw borders - pen.setColor(QColor(0, 0, 0)); - p.setPen(pen); - p.drawRect(histogramRect); - - // Draw histogram - - QVector drawChannels; - - switch (m_histrogramMode) - { - case eHistogramMode_Luminosity: - drawChannels.push_back(3); - break; - case eHistogramMode_SplitRGB: - drawChannels.push_back(0); - drawChannels.push_back(1); - drawChannels.push_back(2); - break; - case eHistogramMode_OverlappedRGB: - drawChannels.push_back(0); - drawChannels.push_back(1); - drawChannels.push_back(2); - break; - case eHistogramMode_RedChannel: - drawChannels.push_back(0); - break; - case eHistogramMode_GreenChannel: - drawChannels.push_back(1); - break; - case eHistogramMode_BlueChannel: - drawChannels.push_back(2); - break; - case eHistogramMode_AlphaChannel: - drawChannels.push_back(3); - break; - } - - int graphWidth = qMax(histogramRect.width(), 1); - int graphHeight = qMax(histogramRect.height() - 2, 0); - int graphBottom = histogramRect.bottom() + 1; - int currX[4] = {0, 0, 0, 0}; - int prevX[4] = {0, 0, 0, 0}; - float scale = 0.0f; - static const int numSubGraphs = 3; - const int subGraph = qCeil(graphWidth / numSubGraphs); - - // Fill background for Split RGB histogram - if (m_histrogramMode == eHistogramMode_SplitRGB) - { - const static QColor backgroundColor[numSubGraphs] = - { - QColor(255, 220, 220), - QColor(220, 255, 220), - QColor(220, 220, 255) - }; - - for (int i = 0; i < numSubGraphs; i++) - { - p.fillRect(histogramRect.left() + subGraph * i, - histogramRect.top(), - subGraph + (i == numSubGraphs - 1 ? 1 : 0), - histogramRect.height(), backgroundColor[i]); - } - } - - int lastHeight[CImageHistogram::kNumChannels] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX }; - - for (int x = 0; x < graphWidth; ++x) - { - for (int j = 0; j < drawChannels.size(); j++) - { - const int c = drawChannels[j]; - int& curr_x = currX[c]; - int& prev_x = prevX[c]; - int& last_height = lastHeight[c]; - QPainterPath& curr_path = path[c]; - - - curr_x = histogramRect.left() + x + 1; - int i = static_cast(((float)x / (graphWidth - 1)) * (CImageHistogram::kNumColorLevels - 1)); - if (m_histrogramMode == eHistogramMode_SplitRGB) - { - // Filter out to area which we are interested - const int k = x / subGraph; - if (k != c) - { - continue; - } - - i = qCeil((i - (subGraph * c)) * numSubGraphs); - i = qMin(i, CImageHistogram::kNumColorLevels - 1); - i = qMax(i, 0); - } - - if (m_histrogramMode == eHistogramMode_Luminosity) - { - scale = (float)m_histogram.m_lumCount[i] / m_histogram.m_maxLumCount; - } - else if (m_histogram.m_maxCount[c]) - { - scale = (float)m_histogram.m_count[c][i] / m_histogram.m_maxCount[c]; - } - - int height = static_cast(graphBottom - graphHeight * scale); - if (last_height == INT_MAX) - { - last_height = height; - } - - curr_path.moveTo(prev_x, last_height); - curr_path.lineTo(curr_x, height); - last_height = height; - - if (prev_x == INT_MAX) - { - prev_x = curr_x; - } - - prev_x = curr_x; - } - } - - static const QColor kChannelColor[4] = - { - QColor(255, 0, 0), - QColor(0, 255, 0), - QColor(0, 0, 255), - QColor(120, 120, 120) - }; - - for (int i = 0; i < drawChannels.size(); i++) - { - const int c = drawChannels[i]; - pen.setColor(kChannelColor[c]); - p.setPen(pen); - p.drawPath(path[c]); - } - - // Update histogram info - { - float mean = 0, stdDev = 0, median = 0; - - switch (m_histrogramMode) - { - case eHistogramMode_Luminosity: - case eHistogramMode_SplitRGB: - case eHistogramMode_OverlappedRGB: - mean = m_histogram.m_meanAvg; - stdDev = m_histogram.m_stdDevAvg; - median = m_histogram.m_medianAvg; - break; - case eHistogramMode_RedChannel: - mean = m_histogram.m_mean[0]; - stdDev = m_histogram.m_stdDev[0]; - median = m_histogram.m_median[0]; - break; - case eHistogramMode_GreenChannel: - mean = m_histogram.m_mean[1]; - stdDev = m_histogram.m_stdDev[1]; - median = m_histogram.m_median[1]; - break; - case eHistogramMode_BlueChannel: - mean = m_histogram.m_mean[2]; - stdDev = m_histogram.m_stdDev[2]; - median = m_histogram.m_median[2]; - break; - case eHistogramMode_AlphaChannel: - mean = m_histogram.m_mean[3]; - stdDev = m_histogram.m_stdDev[3]; - median = m_histogram.m_median[3]; - break; - } - QString val; - val.setNum(mean); - setMean(val); - val.setNum(stdDev); - setStdDev(val); - val.setNum(median); - setMedian(val); - } -} - -#include diff --git a/Code/Editor/Controls/QBitmapPreviewDialogImp.h b/Code/Editor/Controls/QBitmapPreviewDialogImp.h deleted file mode 100644 index 63de867e6c..0000000000 --- a/Code/Editor/Controls/QBitmapPreviewDialogImp.h +++ /dev/null @@ -1,89 +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 - * - */ -#ifndef QBITMAPPREVIEWDIALOG_IMP_H -#define QBITMAPPREVIEWDIALOG_IMP_H - -#if !defined(Q_MOC_RUN) -#include "QBitmapPreviewDialog.h" -#include -#endif - -class CImageEx; - -class QBitmapPreviewDialogImp - : public QBitmapPreviewDialog -{ - Q_OBJECT; -public: - - enum EUIStyle - { - EUISTYLE_IMAGE_ONLY, - EUISTYLE_IMAGE_HISTOGRAM, - EUISTYLE_NumModes - }; - - enum EShowMode - { - ESHOW_RGB = 0, - ESHOW_ALPHA, - ESHOW_RGBA, - ESHOW_RGB_ALPHA, - ESHOW_RGBE, - ESHOW_NumModes, - }; - - enum EHistogramMode - { - eHistogramMode_Luminosity, - eHistogramMode_OverlappedRGB, - eHistogramMode_SplitRGB, - eHistogramMode_RedChannel, - eHistogramMode_GreenChannel, - eHistogramMode_BlueChannel, - eHistogramMode_AlphaChannel, - eHistogramMode_NumModes, - }; - - explicit QBitmapPreviewDialogImp(QWidget* parent = 0); - virtual ~QBitmapPreviewDialogImp(); - - void setImage(const QString path); - - void setShowMode(EShowMode mode); - void toggleShowMode(); - void setUIStyleMode(EUIStyle mode); - const EShowMode& getShowMode() const; - - void setHistogramMode(EHistogramMode mode); - void toggleHistrogramMode(); - const EHistogramMode& getHistogramMode() const; - - void setOriginalSize(bool value); - void toggleOriginalSize(); - - bool isSizeSmallerThanDefault(); - void paintEvent(QPaintEvent* e) override; - -protected: - void refreshData(); - -private: - const char* GetShowModeDescription(EShowMode eShowMode, bool bShowInOriginalSize) const; - -private: - CImageEx* m_image; - QString m_path; - CImageHistogram m_histogram; - bool m_showOriginalSize; - EShowMode m_showMode; - EHistogramMode m_histrogramMode; - EUIStyle m_uiStyle; -}; - -#endif // QBITMAPPREVIEWDIALOG_IMP_H diff --git a/Code/Editor/Controls/QToolTipWidget.cpp b/Code/Editor/Controls/QToolTipWidget.cpp deleted file mode 100644 index 12a66a5d67..0000000000 --- a/Code/Editor/Controls/QToolTipWidget.cpp +++ /dev/null @@ -1,642 +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 "EditorDefs.h" - -#include - -#include "QBitmapPreviewDialogImp.h" -#include "qcoreapplication.h" -#include "qguiapplication.h" -#include "qapplication.h" -#include -#include -#include -#include - -void QToolTipWidget::RebuildLayout() -{ - if (m_title != nullptr) - { - m_title->hide(); - } - if (m_content != nullptr) - { - m_content->hide(); - } - if (m_specialContent != nullptr) - { - m_specialContent->hide(); - } - - //empty layout - while (m_layout->count() > 0) - { - m_layout->takeAt(0); - } - qDeleteAll(m_currentShortcuts); - m_currentShortcuts.clear(); - if (m_includeTextureShortcuts) - { - m_currentShortcuts.append(new QLabel(tr("Alt - Alpha"), this)); - m_currentShortcuts.back()->setProperty("tooltipLabel", "Shortcut"); - m_currentShortcuts.append(new QLabel(tr("Shift - RGBA"), this)); - m_currentShortcuts.back()->setProperty("tooltipLabel", "Shortcut"); - } - - if (m_title != nullptr && !m_title->text().isEmpty()) - { - m_layout->addWidget(m_title); - m_title->show(); - } - - for (QLabel* var : m_currentShortcuts) - { - if (var != nullptr) - { - m_layout->addWidget(var); - var->show(); - } - } - if (m_specialContent != nullptr) - { - m_layout->addWidget(m_specialContent); - m_specialContent->show(); - } - if (m_content != nullptr && !m_content->text().isEmpty()) - { - m_layout->addWidget(m_content); - m_content->show(); - } - m_background->adjustSize(); - adjustSize(); -} - -void QToolTipWidget::Hide() -{ - m_currentShortcuts.clear(); - hide(); -} - -void QToolTipWidget::Show(QPoint pos, ArrowDirection dir) -{ - if (!IsValid()) - { - return; - } - m_arrow->m_direction = dir; - pos = AdjustTipPosByArrowSize(pos, dir); - m_normalPos = pos; - move(pos); - RebuildLayout(); - show(); - m_arrow->show(); -} - -void QToolTipWidget::Display(QRect targetRect, ArrowDirection preferredArrowDir) -{ - if (!IsValid()) - { - return; - } - - KeepTipOnScreen(targetRect, preferredArrowDir); - - RebuildLayout(); - show(); - m_arrow->show(); -} - -void QToolTipWidget::TryDisplay(QPoint mousePos, const QRect& rect, [[maybe_unused]] ArrowDirection preferredArrowDir) -{ - if (rect.contains(mousePos)) - { - Display(rect, QToolTipWidget::ArrowDirection::ARROW_RIGHT); - } - else - { - hide(); - } - } - -void QToolTipWidget::TryDisplay(QPoint mousePos, const QWidget* widget, ArrowDirection preferredArrowDir) -{ - const QRect rect(widget->mapToGlobal(QPoint(0,0)), widget->size()); - TryDisplay(mousePos, rect, preferredArrowDir); -} - -void QToolTipWidget::SetTitle(QString title) -{ - if (!title.isEmpty()) - { - m_title->setText(title); - } - m_title->setProperty("tooltipLabel", "Title"); - - setWindowTitle("ToolTip - " + title); -} - -void QToolTipWidget::SetContent(QString content) -{ - m_content->setWordWrap(true); - - m_content->setProperty("tooltipLabel", "Content"); - //line-height is not supported via stylesheet so we use the html rich-text subset in QT for it. - m_content->setText(QString("%1").arg(content)); -} - -void QToolTipWidget::AppendContent(QString content) -{ - m_content->setText(m_content->text() + "\n\n" + content); - update(); - RebuildLayout(); - m_content->update(); - m_content->repaint(); -} - -QToolTipWidget::QToolTipWidget(QWidget* parent) - : QWidget(parent) -{ - m_background = new QWidget(this); - m_background->setProperty("tooltip", "Background"); - m_background->stackUnder(this); - m_title = new QLabel(this); - m_currentShortcuts = QVector(); - m_content = new QLabel(this); - m_specialContent = nullptr; - setWindowTitle("ToolTip"); - setObjectName("ToolTip"); - m_layout = new QVBoxLayout(this); - m_normalPos = QPoint(0, 0); - m_arrow = new QArrow(m_background); - setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint); - m_arrow->setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint); - m_arrow->setAttribute(Qt::WA_TranslucentBackground, true); - m_background->setLayout(m_layout); - m_arrow->setObjectName("ToolTipArrow"); - m_background->setObjectName("ToolTipBackground"); - - //we need a drop shadow for the background - QGraphicsDropShadowEffect* dropShadow = new QGraphicsDropShadowEffect(this); - dropShadow->setBlurRadius(m_shadowRadius); - dropShadow->setColor(Qt::black); - dropShadow->setOffset(0); - dropShadow->setEnabled(true); - m_background->setGraphicsEffect(dropShadow); - //we need a second drop shadow effect for the arrow - dropShadow = new QGraphicsDropShadowEffect(m_arrow); - dropShadow->setBlurRadius(m_shadowRadius); - dropShadow->setColor(Qt::black); - dropShadow->setOffset(0); - dropShadow->setEnabled(true); - m_arrow->setGraphicsEffect(dropShadow); -} - -QToolTipWidget::~QToolTipWidget() -{ -} - -void QToolTipWidget::AddSpecialContent(QString type, QString dataStream) -{ - if (type.isEmpty()) - { - m_includeTextureShortcuts = false; - if (m_specialContent != nullptr) - { - delete m_specialContent; - m_specialContent = nullptr; - } - return; - } - if (type == "TEXTURE") - { - if (m_specialContent == nullptr) - { - QCoreApplication::instance()->installEventFilter(this); //grab the event filter while displaying the advanced texture tooltip - m_specialContent = new QBitmapPreviewDialogImp(this); - } - QString path(dataStream); - qobject_cast(m_specialContent)->setImage(path); - // set default showmode to RGB - qobject_cast(m_specialContent)->setShowMode(QBitmapPreviewDialogImp::EShowMode::ESHOW_RGB); - QString dir = (path.split("/").count() > path.split("\\").count()) ? path.split("/").back() : path.split("\\").back(); - SetTitle(dir); - //always use default size but not image size - qobject_cast(m_specialContent)->setOriginalSize(false); - m_includeTextureShortcuts = true; - } - else if (type == "ADD TO CONTENT") - { - AppendContent(dataStream); - - m_includeTextureShortcuts = false; - if (m_specialContent != nullptr) - { - delete m_specialContent; - m_specialContent = nullptr; - } - } - else if (type == "REPLACE TITLE") - { - SetTitle(dataStream); - m_includeTextureShortcuts = false; - if (m_specialContent != nullptr) - { - delete m_specialContent; - m_specialContent = nullptr; - } - } - else if (type == "REPLACE CONTENT") - { - SetContent(dataStream); - m_includeTextureShortcuts = false; - if (m_specialContent != nullptr) - { - delete m_specialContent; - m_specialContent = nullptr; - } - } - else - { - m_includeTextureShortcuts = false; - if (m_specialContent != nullptr) - { - delete m_specialContent; - m_specialContent = nullptr; - } - return; - } - - m_special = type; -} - - -bool QToolTipWidget::eventFilter(QObject* obj, QEvent* event) -{ - if (event->type() == QEvent::KeyPress) - { - if (m_special == "TEXTURE" && m_specialContent != nullptr) - { - const QKeyEvent* ke = static_cast(event); - Qt::KeyboardModifiers mods = ke->modifiers(); - if (mods & Qt::KeyboardModifier::AltModifier) - { - ((QBitmapPreviewDialogImp*)m_specialContent)->setShowMode(QBitmapPreviewDialogImp::ESHOW_ALPHA); - } - else if (mods & Qt::KeyboardModifier::ShiftModifier && !(mods & Qt::KeyboardModifier::ControlModifier)) - { - ((QBitmapPreviewDialogImp*)m_specialContent)->setShowMode(QBitmapPreviewDialogImp::ESHOW_RGBA); - } - } - } - if (event->type() == QEvent::KeyRelease) - { - if (m_special == "TEXTURE" && m_specialContent != nullptr) - { - const QKeyEvent* ke = static_cast(event); - Qt::KeyboardModifiers mods = ke->modifiers(); - if (!(mods& Qt::KeyboardModifier::AltModifier) && !(mods & Qt::KeyboardModifier::ShiftModifier)) - { - ((QBitmapPreviewDialogImp*)m_specialContent)->setShowMode(QBitmapPreviewDialogImp::ESHOW_RGB); - } - } - } - return QWidget::eventFilter(obj, event); -} - -void QToolTipWidget::hideEvent(QHideEvent* event) -{ - QWidget::hideEvent(event); - m_arrow->hide(); -} - -void QToolTipWidget::UpdateOptionalData(QString optionalData) -{ - AddSpecialContent(m_special, optionalData); -} - - - -QPoint QToolTipWidget::AdjustTipPosByArrowSize(QPoint pos, ArrowDirection dir) -{ - switch (dir) - { - case QToolTipWidget::ArrowDirection::ARROW_UP: - { - m_arrow->move(pos); - pos.setY(pos.y() + 10); - m_arrow->setFixedSize(20, 10); - pos -= QPoint(m_shadowRadius, m_shadowRadius); - break; - } - case QToolTipWidget::ArrowDirection::ARROW_LEFT: - { - m_arrow->move(pos); - pos.setX(pos.x() + 10); - m_arrow->setFixedSize(10, 20); - pos -= QPoint(m_shadowRadius, m_shadowRadius); - break; - } - case QToolTipWidget::ArrowDirection::ARROW_RIGHT: - { - pos.setX(pos.x() - 10); - m_arrow->move(QPoint(pos.x() + width(), pos.y())); - m_arrow->setFixedSize(10, 20); - pos -= QPoint(-m_shadowRadius, m_shadowRadius); - break; - } - case QToolTipWidget::ArrowDirection::ARROW_DOWN: - { - pos.setY(pos.y() - 10); - m_arrow->move(QPoint(pos.x(), pos.y() + height())); - m_arrow->setFixedSize(20, 10); - pos -= QPoint(m_shadowRadius, -m_shadowRadius); - break; - } - default: - m_arrow->move(-10, -10); - break; - } - return pos; -} - -bool QToolTipWidget::IsValid() -{ - if (m_title->text().isEmpty() || - (m_content->text().isEmpty() && m_specialContent == nullptr)) - { - return false; - } - return true; -} - -void QToolTipWidget::KeepTipOnScreen(QRect targetRect, ArrowDirection preferredArrowDir) -{ - QRect desktop = QApplication::desktop()->availableGeometry(this); - - if (this->isHidden()) - { - setAttribute(Qt::WA_DontShowOnScreen, true); - Show(QPoint(0, 0), preferredArrowDir); - hide(); - setAttribute(Qt::WA_DontShowOnScreen, false); - } - //else assume the size is right - - //calculate initial rect - QRect tipRect = QRect(0, 0, 0, 0); - switch (preferredArrowDir) - { - case QToolTipWidget::ArrowDirection::ARROW_UP: - { - //tip is below the widget with a left alignment - tipRect.setTopLeft(AdjustTipPosByArrowSize(targetRect.bottomLeft(), preferredArrowDir)); - break; - } - case QToolTipWidget::ArrowDirection::ARROW_LEFT: - { - //tip is on the right with the top being even - tipRect.setTopLeft(AdjustTipPosByArrowSize(targetRect.topRight(), preferredArrowDir)); - break; - } - case QToolTipWidget::ArrowDirection::ARROW_RIGHT: - { - //tip is on the left with the top being even - tipRect.setY(targetRect.top()); - tipRect.setX(targetRect.left() - width()); - tipRect.setTopLeft(AdjustTipPosByArrowSize(tipRect.topLeft(), preferredArrowDir)); - break; - } - case QToolTipWidget::ArrowDirection::ARROW_DOWN: - { - //tip is above the widget with a left alignment - tipRect.setX(targetRect.left()); - tipRect.setY(targetRect.top() - height()); - tipRect.setTopLeft(AdjustTipPosByArrowSize(tipRect.topLeft(), preferredArrowDir)); - break; - } - default: - { - //tip is on the right with the top being even - preferredArrowDir = QToolTipWidget::ArrowDirection::ARROW_LEFT; - tipRect.setTopLeft(AdjustTipPosByArrowSize(targetRect.topRight(), QToolTipWidget::ArrowDirection::ARROW_LEFT)); - break; - } - } - tipRect.setSize(size()); - - //FixPositioning - if (preferredArrowDir == ArrowDirection::ARROW_LEFT || preferredArrowDir == ArrowDirection::ARROW_RIGHT) - { - if (tipRect.left() <= desktop.left()) - { - m_arrow->m_direction = ArrowDirection::ARROW_LEFT; - tipRect.setTopLeft(AdjustTipPosByArrowSize(targetRect.topRight(), m_arrow->m_direction)); - } - else if (tipRect.right() >= desktop.right()) - { - m_arrow->m_direction = ArrowDirection::ARROW_RIGHT; - tipRect.setLeft(targetRect.left() - width()); - tipRect.setTopLeft(AdjustTipPosByArrowSize(tipRect.topLeft(), m_arrow->m_direction)); - } - } - else if (preferredArrowDir == ArrowDirection::ARROW_UP || preferredArrowDir == ArrowDirection::ARROW_DOWN) - { - if (tipRect.top() <= desktop.top()) - { - m_arrow->m_direction = ArrowDirection::ARROW_UP; - tipRect.setTopLeft(AdjustTipPosByArrowSize(targetRect.bottomLeft(), m_arrow->m_direction)); - } - else if (tipRect.bottom() >= desktop.bottom()) - { - m_arrow->m_direction = ArrowDirection::ARROW_DOWN; - tipRect.setY(targetRect.top() - height()); - tipRect.setTopLeft(AdjustTipPosByArrowSize(tipRect.topLeft(), m_arrow->m_direction)); - } - } - - //Nudge tip without arrow - if (preferredArrowDir == ArrowDirection::ARROW_UP || preferredArrowDir == ArrowDirection::ARROW_DOWN) - { - if (tipRect.left() <= desktop.left()) - { - tipRect.setLeft(desktop.left()); - } - else if (tipRect.right() >= desktop.right()) - { - tipRect.setLeft(desktop.right() - width()); - } - } - else if (preferredArrowDir == ArrowDirection::ARROW_RIGHT || preferredArrowDir == ArrowDirection::ARROW_LEFT) - { - if (tipRect.top() <= desktop.top()) - { - tipRect.setTop(desktop.top()); - } - else if (tipRect.bottom() >= desktop.bottom()) - { - tipRect.setTop(desktop.bottom() - height()); - } - } - - - m_normalPos = tipRect.topLeft(); - move(m_normalPos); -} - -QPolygonF QToolTipWidget::QArrow::CreateArrow() -{ - QVector vertex; - //3 points in triangle - vertex.reserve(3); - //all magic number below are given in order to draw smooth transitions between tooltip and arrow - if (m_direction == ArrowDirection::ARROW_UP) - { - vertex.push_back(QPointF(10, 1)); - vertex.push_back(QPointF(19, 10)); - vertex.push_back(QPointF(0, 10)); - } - else if (m_direction == ArrowDirection::ARROW_RIGHT) - { - vertex.push_back(QPointF(9, 10)); - vertex.push_back(QPointF(0, 19)); - vertex.push_back(QPointF(0, 1)); - } - else if (m_direction == ArrowDirection::ARROW_LEFT) - { - vertex.push_back(QPointF(1, 10)); - vertex.push_back(QPointF(10, 19)); - vertex.push_back(QPointF(10, 0)); - } - else //ArrowDirection::ARROW_DOWN - { - vertex.push_back(QPointF(10, 10)); - vertex.push_back(QPointF(19, 0)); - vertex.push_back(QPointF(0, 0)); - } - return QPolygonF(vertex); -} - -void QToolTipWidget::QArrow::paintEvent([[maybe_unused]] QPaintEvent* event) -{ - QColor color(255, 255, 255, 255); - QPainter painter(this); - painter.fillRect(rect(), Qt::transparent); //force transparency - painter.setRenderHint(QPainter::Antialiasing, false); - painter.setBrush(color); - painter.setPen(Qt::NoPen); - painter.drawPolygon(CreateArrow()); - //painter.setRenderHint(QPainter::Antialiasing, false); -} - -QToolTipWrapper::QToolTipWrapper(QWidget* parent) - : QObject(parent) -{ -} - -void QToolTipWrapper::SetTitle(QString title) -{ - m_title = title; -} - -void QToolTipWrapper::SetContent(QString content) -{ - AddSpecialContent("REPLACE CONTENT", content); -} - -void QToolTipWrapper::AppendContent(QString content) -{ - AddSpecialContent("ADD TO CONTENT", content); -} - -void QToolTipWrapper::AddSpecialContent(QString type, QString dataStream) -{ - if (type == "REPLACE CONTENT") - { - m_contentOperations.clear(); - } - m_contentOperations.push_back({type, dataStream}); -} - -void QToolTipWrapper::UpdateOptionalData(QString optionalData) -{ - m_contentOperations.push_back({"UPDATE OPTIONAL", optionalData}); -} - -void QToolTipWrapper::Display(QRect targetRect, QToolTipWidget::ArrowDirection preferredArrowDir) -{ - GetOrCreateToolTip()->Display(targetRect, preferredArrowDir); -} - -void QToolTipWrapper::TryDisplay(QPoint mousePos, const QWidget * widget, QToolTipWidget::ArrowDirection preferredArrowDir) -{ - GetOrCreateToolTip()->TryDisplay(mousePos, widget, preferredArrowDir); -} - -void QToolTipWrapper::TryDisplay(QPoint mousePos, const QRect & widget, QToolTipWidget::ArrowDirection preferredArrowDir) -{ - GetOrCreateToolTip()->TryDisplay(mousePos, widget, preferredArrowDir); -} - -void QToolTipWrapper::hide() -{ - DestroyToolTip(); -} - -void QToolTipWrapper::show() -{ - GetOrCreateToolTip()->show(); -} - -bool QToolTipWrapper::isVisible() const -{ - return m_actualTooltip && m_actualTooltip->isVisible(); -} - -void QToolTipWrapper::update() -{ - if (m_actualTooltip) - { - m_actualTooltip->update(); - } -} - -void QToolTipWrapper::ReplayContentOperations(QToolTipWidget* tooltipWidget) -{ - tooltipWidget->SetTitle(m_title); - for (const auto& operation : m_contentOperations) - { - if (operation.first == "UPDATE OPTIONAL") - { - tooltipWidget->UpdateOptionalData(operation.second); - } - else - { - tooltipWidget->AddSpecialContent(operation.first, operation.second); - } - } -} - -QToolTipWidget * QToolTipWrapper::GetOrCreateToolTip() -{ - if (!m_actualTooltip) - { - QToolTipWidget* tooltipWidget = new QToolTipWidget(static_cast(parent())); - tooltipWidget->setAttribute(Qt::WA_DeleteOnClose); - ReplayContentOperations(tooltipWidget); - m_actualTooltip = tooltipWidget; - } - return m_actualTooltip.data(); -} - -void QToolTipWrapper::DestroyToolTip() -{ - if (m_actualTooltip) - { - m_actualTooltip->deleteLater(); - } -} diff --git a/Code/Editor/Controls/QToolTipWidget.h b/Code/Editor/Controls/QToolTipWidget.h deleted file mode 100644 index 813f2a75fb..0000000000 --- a/Code/Editor/Controls/QToolTipWidget.h +++ /dev/null @@ -1,148 +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 - * - */ -#ifndef QToolTipWidget_h__ -#define QToolTipWidget_h__ - -#include "EditorCoreAPI.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -class IQToolTip -{ -public: - virtual void SetTitle(QString title) = 0; - virtual void SetContent(QString content) = 0; - virtual void AppendContent(QString content) = 0; - virtual void AddSpecialContent(QString type, QString dataStream) = 0; - virtual void UpdateOptionalData(QString optionalData) = 0; -}; - -class EDITOR_CORE_API QToolTipWidget - : public QWidget - , public IQToolTip -{ -public: - enum class ArrowDirection - { - ARROW_UP, - ARROW_LEFT, - ARROW_RIGHT, - ARROW_DOWN - }; - class QArrow - : public QWidget - { - public: - ArrowDirection m_direction; - QPoint m_pos; - QArrow(QWidget* parent) - : QWidget(parent){ setWindowFlags(Qt::ToolTip); } - virtual ~QArrow(){} - - QPolygonF CreateArrow(); - virtual void paintEvent(QPaintEvent*) override; - }; - QToolTipWidget(QWidget* parent); - ~QToolTipWidget(); - void SetTitle(QString title) override; - void SetContent(QString content) override; - void AppendContent(QString content) override; - void AddSpecialContent(QString type, QString dataStream) override; - void UpdateOptionalData(QString optionalData) override; - void Display(QRect targetRect, ArrowDirection preferredArrowDir); - - //! Displays the tooltip on the given widget, only if the mouse is over it. - void TryDisplay(QPoint mousePos, const QWidget* widget, ArrowDirection preferredArrowDir); - - //! Displays the tooltip on the given rect, only if the mouse is over it. - void TryDisplay(QPoint mousePos, const QRect& widget, ArrowDirection preferredArrowDir); - - void Hide(); - -protected: - void Show(QPoint pos, ArrowDirection dir); - bool IsValid(); - void KeepTipOnScreen(QRect targetRect, ArrowDirection preferredArrowDir); - QPoint AdjustTipPosByArrowSize(QPoint pos, ArrowDirection dir); - virtual bool eventFilter(QObject* obj, QEvent* event) override; - void RebuildLayout(); - virtual void hideEvent(QHideEvent*) override; - - QLabel* m_title; - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - QVector m_currentShortcuts; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - //can be anything from QLabel to QBitMapPreviewDialog - //must allow movement, and show/hide calls - QLabel* m_content; - QWidget* m_specialContent; - QWidget* m_background; - QVBoxLayout* m_layout; - QString m_special; - QPoint m_normalPos; - QArrow* m_arrow; - const int m_shadowRadius = 5; - bool m_includeTextureShortcuts; //added since Qt does not support modifier only shortcuts -}; - -// HACK: The EditorUI_QT classes all were keeping persistent references to QToolTipWidgets around -// This led to many, many top-level widget creations, which led to many platform-side window allocations -// which led to crashes in Qt5.15. As this is legacy code, this is a drop-in replacement that only -// allocates the actual QToolTipWidget (and thus platform window) while the tooltip is visible -class EDITOR_CORE_API QToolTipWrapper - : public QObject - , public IQToolTip -{ -public: - QToolTipWrapper(QWidget* parent); - - void SetTitle(QString title) override; - void SetContent(QString content) override; - void AppendContent(QString content) override; - void AddSpecialContent(QString type, QString dataStream) override; - void UpdateOptionalData(QString optionalData) override; - - void Display(QRect targetRect, QToolTipWidget::ArrowDirection preferredArrowDir); - void TryDisplay(QPoint mousePos, const QWidget* widget, QToolTipWidget::ArrowDirection preferredArrowDir); - void TryDisplay(QPoint mousePos, const QRect& widget, QToolTipWidget::ArrowDirection preferredArrowDir); - void hide(); - void show(); - bool isVisible() const; - void update(); - void repaint(){update();} //Things really shouldn't be calling repaint on these... - - void Hide(){hide();} - void close(){hide();} - -private: - void ReplayContentOperations(QToolTipWidget* tooltipWidget); - - QToolTipWidget* GetOrCreateToolTip(); - void DestroyToolTip(); - - AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // conditional expression is constant, needs to have dll-interface to be used by clients of class 'AzQtComponents::FilteredSearchWidget' - QPointer m_actualTooltip; - AZ_POP_DISABLE_WARNING - - QString m_title; - AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // conditional expression is constant, needs to have dll-interface to be used by clients of class 'AzQtComponents::FilteredSearchWidget' - QVector> m_contentOperations; - AZ_POP_DISABLE_WARNING -}; - - -#endif // QToolTipWidget_h__ diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp index 68c4acb95e..50d053ab9e 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyCtrl.cpp @@ -10,7 +10,6 @@ // Editor #include "PropertyCtrl.h" -#include "PropertyResourceCtrl.h" #include "PropertyGenericCtrl.h" #include "PropertyMiscCtrl.h" #include "PropertyMotionCtrl.h" @@ -21,7 +20,6 @@ void RegisterReflectedVarHandlers() if (!registered) { registered = true; - EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew FileResourceSelectorWidgetHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew SequencePropertyHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew SequenceIdPropertyHandler()); EBUS_EVENT(AzToolsFramework::PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew LocalStringPropertyHandler()); diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp deleted file mode 100644 index d26e978ae8..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp +++ /dev/null @@ -1,383 +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 "EditorDefs.h" - -#include "PropertyResourceCtrl.h" - -// Qt -#include -#include - -// AzToolsFramework -#include -#include -#include - -// Editor -#include "Controls/QToolTipWidget.h" -#include "Controls/BitmapToolTip.h" - - -BrowseButton::BrowseButton(PropertyType type, QWidget* parent /*= nullptr*/) - : QToolButton(parent) - , m_propertyType(type) -{ - setAutoRaise(true); - setIcon(QIcon(QStringLiteral(":/stylesheet/img/UI20/browse-edit.svg"))); - connect(this, &QAbstractButton::clicked, this, &BrowseButton::OnClicked); -} - -void BrowseButton::SetPathAndEmit(const QString& path) -{ - //only emit if path changes. Old property control - if (path != m_path) - { - m_path = path; - emit PathChanged(m_path); - } -} - -class FileBrowseButton - : public BrowseButton -{ -public: - AZ_CLASS_ALLOCATOR(FileBrowseButton, AZ::SystemAllocator, 0); - FileBrowseButton(PropertyType type, QWidget* pParent = nullptr) - : BrowseButton(type, pParent) - { - setToolTip("Browse..."); - } - -private: - void OnClicked() override - { - QString tempValue(""); - if (!m_path.isEmpty() && !Path::GetExt(m_path).isEmpty()) - { - tempValue = m_path; - } - - AssetSelectionModel selection; - - if (m_propertyType == ePropertyTexture) - { - // Filters for texture. - selection = AssetSelectionModel::AssetGroupSelection("Texture"); - } - else - { - return; - } - - AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::BrowseForAssets, selection); - if (selection.IsValid()) - { - QString newPath = Path::FullPathToGamePath(selection.GetResult()->GetFullPath().c_str()).c_str(); - - switch (m_propertyType) - { - case ePropertyTexture: - newPath.replace("\\\\", "/"); - if (newPath.size() > MAX_PATH) - { - newPath.resize(MAX_PATH); - } - } - - SetPathAndEmit(newPath); - } - } -}; - -class AudioControlSelectorButton - : public BrowseButton -{ -public: - AZ_CLASS_ALLOCATOR(AudioControlSelectorButton, AZ::SystemAllocator, 0); - - AudioControlSelectorButton(PropertyType type, QWidget* pParent = nullptr) - : BrowseButton(type, pParent) - { - setToolTip(tr("Select Audio Control")); - } - -private: - void OnClicked() override - { - AZStd::string resourceResult; - auto ConvertLegacyAudioPropertyType = [](const PropertyType type) -> AzToolsFramework::AudioPropertyType - { - switch (type) - { - case ePropertyAudioTrigger: - return AzToolsFramework::AudioPropertyType::Trigger; - case ePropertyAudioRTPC: - return AzToolsFramework::AudioPropertyType::Rtpc; - case ePropertyAudioSwitch: - return AzToolsFramework::AudioPropertyType::Switch; - case ePropertyAudioSwitchState: - return AzToolsFramework::AudioPropertyType::SwitchState; - case ePropertyAudioEnvironment: - return AzToolsFramework::AudioPropertyType::Environment; - case ePropertyAudioPreloadRequest: - return AzToolsFramework::AudioPropertyType::Preload; - default: - return AzToolsFramework::AudioPropertyType::NumTypes; - } - }; - - auto propType = ConvertLegacyAudioPropertyType(m_propertyType); - if (propType != AzToolsFramework::AudioPropertyType::NumTypes) - { - AzToolsFramework::AudioControlSelectorRequestBus::EventResult( - resourceResult, propType, &AzToolsFramework::AudioControlSelectorRequestBus::Events::SelectResource, - AZStd::string_view{ m_path.toUtf8().constData() }); - SetPathAndEmit(QString{ resourceResult.c_str() }); - } - } -}; - -class TextureEditButton - : public BrowseButton -{ -public: - AZ_CLASS_ALLOCATOR(TextureEditButton, AZ::SystemAllocator, 0); - TextureEditButton(QWidget* pParent = nullptr) - : BrowseButton(ePropertyTexture, pParent) - { - setIcon(QIcon(QStringLiteral(":/stylesheet/img/UI20/open-in-internal-app.svg"))); - setToolTip(tr("Launch default editor")); - } - -private: - void OnClicked() override - { - CFileUtil::EditTextureFile(m_path.toUtf8().data(), true); - } -}; - -FileResourceSelectorWidget::FileResourceSelectorWidget(QWidget* pParent /*= nullptr*/) - : QWidget(pParent) - , m_propertyType(ePropertyInvalid) - , m_tooltip(nullptr) -{ - m_pathEdit = new QLineEdit; - m_mainLayout = new QHBoxLayout(this); - m_mainLayout->addWidget(m_pathEdit, 1); - - m_mainLayout->setContentsMargins(0, 0, 0, 0); - -// KDAB just ported the MFC texture preview tooltip, but looks like Amazon added their own. Not sure which to use. -// To switch to Amazon QToolTipWidget, remove FileResourceSelectorWidget::event and m_previewTooltip -#ifdef USE_QTOOLTIPWIDGET - m_tooltip = new QToolTipWidget(this); - - installEventFilter(this); -#endif - connect(m_pathEdit, &QLineEdit::editingFinished, this, [this]() { OnPathChanged(m_pathEdit->text()); }); -} - -bool FileResourceSelectorWidget::eventFilter([[maybe_unused]] QObject* obj, QEvent* event) -{ - if (m_propertyType == ePropertyTexture) - { - if (event->type() == QEvent::ToolTip) - { - QHelpEvent* e = (QHelpEvent*)event; - - m_tooltip->AddSpecialContent("TEXTURE", m_path); - m_tooltip->TryDisplay(e->globalPos(), m_pathEdit, QToolTipWidget::ArrowDirection::ARROW_RIGHT); - - return true; - } - - if (event->type() == QEvent::Leave) - { - m_tooltip->hide(); - } - } - - return false; -} - -void FileResourceSelectorWidget::SetPropertyType(PropertyType type) -{ - if (m_propertyType == type) - { - return; - } - - //if the property type changed for some reason, delete all the existing widgets - if (!m_buttons.isEmpty()) - { - qDeleteAll(m_buttons.begin(), m_buttons.end()); - m_buttons.clear(); - } - - m_previewToolTip.reset(); - m_propertyType = type; - - switch (type) - { - case ePropertyTexture: - AddButton(new FileBrowseButton(type)); - AddButton(new TextureEditButton); - m_previewToolTip.reset(new CBitmapToolTip); - break; - case ePropertyAudioTrigger: - case ePropertyAudioSwitch: - case ePropertyAudioSwitchState: - case ePropertyAudioRTPC: - case ePropertyAudioEnvironment: - case ePropertyAudioPreloadRequest: - AddButton(new AudioControlSelectorButton(type)); - break; - default: - break; - } - - m_mainLayout->invalidate(); -} - -void FileResourceSelectorWidget::AddButton(BrowseButton* button) -{ - m_mainLayout->addWidget(button); - m_buttons.push_back(button); - connect(button, &BrowseButton::PathChanged, this, &FileResourceSelectorWidget::OnPathChanged); -} - -void FileResourceSelectorWidget::OnPathChanged(const QString& path) -{ - bool changed = SetPath(path); - if (changed) - { - emit PathChanged(m_path); - } -} - -bool FileResourceSelectorWidget::SetPath(const QString& path) -{ - bool changed = false; - - const QString newPath = path.toLower(); - if (m_path != newPath) - { - m_path = newPath; - UpdateWidgets(); - - changed = true; - } - - return changed; -} - - -void FileResourceSelectorWidget::UpdateWidgets() -{ - m_pathEdit->setText(m_path); - - foreach(BrowseButton * button, m_buttons) - { - button->SetPath(m_path); - } - - if (m_previewToolTip) - { - m_previewToolTip->SetTool(this, rect()); - } -} - -QString FileResourceSelectorWidget::GetPath() const -{ - return m_path; -} - - - -QWidget* FileResourceSelectorWidget::GetLastInTabOrder() -{ - return m_buttons.empty() ? nullptr : m_buttons.last(); -} - -QWidget* FileResourceSelectorWidget::GetFirstInTabOrder() -{ - return m_buttons.empty() ? nullptr : m_buttons.first(); -} - -void FileResourceSelectorWidget::UpdateTabOrder() -{ - if (m_buttons.count() >= 2) - { - for (int i = 0; i < m_buttons.count() - 1; ++i) - { - setTabOrder(m_buttons[i], m_buttons[i + 1]); - } - } -} - -bool FileResourceSelectorWidget::event(QEvent* event) -{ - if (event->type() == QEvent::ToolTip && m_previewToolTip && !m_previewToolTip->isVisible()) - { - if (!m_path.isEmpty()) - { - m_previewToolTip->LoadImage(m_path); - m_previewToolTip->setVisible(true); - } - event->accept(); - return true; - } - - if (event->type() == QEvent::Resize && m_previewToolTip) - { - m_previewToolTip->SetTool(this, rect()); - } - - return QWidget::event(event); -} - -QWidget* FileResourceSelectorWidgetHandler::CreateGUI(QWidget* pParent) -{ - FileResourceSelectorWidget* newCtrl = aznew FileResourceSelectorWidget(pParent); - connect(newCtrl, &FileResourceSelectorWidget::PathChanged, newCtrl, [newCtrl]() - { - EBUS_EVENT(AzToolsFramework::PropertyEditorGUIMessages::Bus, RequestWrite, newCtrl); - }); - return newCtrl; -} - -void FileResourceSelectorWidgetHandler::ConsumeAttribute(FileResourceSelectorWidget* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) -{ - Q_UNUSED(GUI); - Q_UNUSED(attrib); - Q_UNUSED(attrValue); - Q_UNUSED(debugName); -} - -void FileResourceSelectorWidgetHandler::WriteGUIValuesIntoProperty(size_t index, FileResourceSelectorWidget* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) -{ - Q_UNUSED(index); - Q_UNUSED(node); - CReflectedVarResource val = instance; - val.m_propertyType = GUI->GetPropertyType(); - val.m_path = GUI->GetPath().toUtf8().data(); - instance = static_cast(val); -} - -bool FileResourceSelectorWidgetHandler::ReadValuesIntoGUI(size_t index, FileResourceSelectorWidget* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) -{ - Q_UNUSED(index); - Q_UNUSED(node); - CReflectedVarResource val = instance; - GUI->SetPropertyType(val.m_propertyType); - GUI->SetPath(val.m_path.c_str()); - return false; -} - -#include diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.h b/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.h deleted file mode 100644 index 087ee9f1db..0000000000 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyResourceCtrl.h +++ /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 - * - */ - -#ifndef CRYINCLUDE_EDITOR_UTILS_PROPERTYRESOURCECTRL_H -#define CRYINCLUDE_EDITOR_UTILS_PROPERTYRESOURCECTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include "ReflectedVar.h" -#include "Util/VariablePropertyType.h" -#include -#include -#include -#endif - -class QLineEdit; -class QHBoxLayout; -class CBitmapToolTip; -class QToolTipWidget; - -class BrowseButton - : public QToolButton -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(BrowseButton, AZ::SystemAllocator, 0); - - BrowseButton(PropertyType type, QWidget* parent = nullptr); - - void SetPath(const QString& path) { m_path = path; } - QString GetPath() const { return m_path; } - - PropertyType GetPropertyType() const {return m_propertyType; } - -signals: - void PathChanged(const QString& path); - -protected: - void SetPathAndEmit(const QString& path); - virtual void OnClicked() = 0; - - PropertyType m_propertyType; - QString m_path; -}; - -class FileResourceSelectorWidget - : public QWidget -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(FileResourceSelectorWidget, AZ::SystemAllocator, 0); - FileResourceSelectorWidget(QWidget* pParent = nullptr); - - bool SetPath(const QString& path); - QString GetPath() const; - void SetPropertyType(PropertyType type); - PropertyType GetPropertyType() const { return m_propertyType; } - - QWidget* GetFirstInTabOrder(); - QWidget* GetLastInTabOrder(); - void UpdateTabOrder(); - - bool eventFilter(QObject* obj, QEvent* event) override; - -signals: - void PathChanged(const QString& path); - -protected: - bool event(QEvent* event) override; - -private: - void OnAssignClicked(); - void OnMaterialClicked(); - - void UpdateWidgets(); - void AddButton(BrowseButton* button); - void OnPathChanged(const QString& path); - -private: - QLineEdit* m_pathEdit; - PropertyType m_propertyType; - QString m_path; - - QHBoxLayout* m_mainLayout; - QVector m_buttons; - QScopedPointer m_previewToolTip; - QToolTipWidget* m_tooltip; -}; - -class FileResourceSelectorWidgetHandler - : QObject - , public AzToolsFramework::PropertyHandler < CReflectedVarResource, FileResourceSelectorWidget > -{ - Q_OBJECT -public: - AZ_CLASS_ALLOCATOR(FileResourceSelectorWidgetHandler, AZ::SystemAllocator, 0); - - virtual AZ::u32 GetHandlerName(void) const override { return AZ_CRC("Resource", 0xbc91f416); } - virtual bool IsDefaultHandler() const override { return true; } - virtual QWidget* GetFirstInTabOrder(FileResourceSelectorWidget* widget) override { return widget->GetFirstInTabOrder(); } - virtual QWidget* GetLastInTabOrder(FileResourceSelectorWidget* widget) override { return widget->GetLastInTabOrder(); } - virtual void UpdateWidgetInternalTabbing(FileResourceSelectorWidget* widget) override { widget->UpdateTabOrder(); } - - virtual QWidget* CreateGUI(QWidget* pParent) override; - virtual void ConsumeAttribute(FileResourceSelectorWidget* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; - virtual void WriteGUIValuesIntoProperty(size_t index, FileResourceSelectorWidget* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override; - virtual bool ReadValuesIntoGUI(size_t index, FileResourceSelectorWidget* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override; -}; - -#endif // CRYINCLUDE_EDITOR_UTILS_PROPERTYRESOURCECTRL_H diff --git a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp index 263c17a8bb..268faaa335 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/ReflectedVar.cpp @@ -70,12 +70,6 @@ void ReflectedVarInit::setupReflection(AZ::SerializeContext* serializeContext) AZ::EditContext* ec = serializeContext->GetEditContext(); if (ec) { - ec->Class< CReflectedVarResource >("VarResource", "Resource") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &CReflectedVarResource::varName) - ->Attribute(AZ::Edit::Attributes::DescriptionTextOverride, &CReflectedVarResource::description) - ; - ec->Class< CReflectedVarUser >("VarUser", "") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::NameLabelOverride, &CReflectedVarUser::varName) diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 4cf092e774..447d763a63 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -22,13 +22,6 @@ set(FILES Controls/ReflectedPropertyControl/ReflectedVar.h Controls/ReflectedPropertyControl/ReflectedVarWrapper.cpp Controls/ReflectedPropertyControl/ReflectedVarWrapper.h - Controls/QBitmapPreviewDialog.cpp - Controls/QBitmapPreviewDialog.h - Controls/QBitmapPreviewDialog.ui - Controls/QBitmapPreviewDialogImp.cpp - Controls/QBitmapPreviewDialogImp.h - Controls/QToolTipWidget.h - Controls/QToolTipWidget.cpp UsedResources.cpp LyViewPaneNames.h QtViewPaneManager.cpp diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 7908d1e720..53cfe243b1 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -313,8 +313,6 @@ set(FILES AssetEditor/AssetEditorWindow.ui Commands/CommandManager.cpp Commands/CommandManager.h - Controls/BitmapToolTip.cpp - Controls/BitmapToolTip.h Controls/ConsoleSCB.cpp Controls/ConsoleSCB.h Controls/ConsoleSCB.ui @@ -336,8 +334,6 @@ set(FILES Controls/ReflectedPropertyControl/PropertyMiscCtrl.h Controls/ReflectedPropertyControl/PropertyMotionCtrl.cpp Controls/ReflectedPropertyControl/PropertyMotionCtrl.h - Controls/ReflectedPropertyControl/PropertyResourceCtrl.cpp - Controls/ReflectedPropertyControl/PropertyResourceCtrl.h Controls/ReflectedPropertyControl/PropertyCtrl.cpp Controls/ReflectedPropertyControl/PropertyCtrl.h MainStatusBar.cpp From b455b915a87792dc040b8ec154455d6bbe57ac31 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Mon, 31 Jan 2022 16:10:03 -0600 Subject: [PATCH 361/394] Making terrain query resolution a single float instead of a Vector2 (#7186) * Making terrain query resolution a single float instead of a Vector2 Signed-off-by: Ken Pruiksma * Keeping the concept of different x/y step sizes in region queries since that may be useful and is separate from query resolution. Also keeping the concept of different x/y step sizes in physics since that's independent of the terrain gem. Signed-off-by: Ken Pruiksma * Formatting cleanups Signed-off-by: Ken Pruiksma * A few more minor cleanups Signed-off-by: Ken Pruiksma * Added support to convert serialized Vector2 query resolution to a single float. Signed-off-by: Ken Pruiksma * Switch ray intersection check back to using separate values for x and y resolution Signed-off-by: Ken Pruiksma * Fixing new unit tests added to use float query resolution. Signed-off-by: Ken Pruiksma * Updating automated test Signed-off-by: Ken Pruiksma --- .../Terrain_World_ConfigurationWorks.py | 5 +- Code/Editor/GameExporter.cpp | 4 +- .../Physics/ShapeConfiguration.cpp | 2 +- .../AzFramework/Physics/ShapeConfiguration.h | 4 +- .../Terrain/TerrainDataRequestBus.h | 4 +- .../Mocks/Terrain/MockTerrainDataRequestBus.h | 4 +- Gems/PhysX/Code/Source/Utils.cpp | 2 +- .../TerrainHeightGradientListComponent.cpp | 2 +- .../TerrainHeightGradientListComponent.h | 2 +- .../TerrainPhysicsColliderComponent.cpp | 4 +- .../Components/TerrainWorldComponent.cpp | 63 ++++++++++++++++--- .../Source/Components/TerrainWorldComponent.h | 18 +++++- .../TerrainWorldDebuggerComponent.cpp | 21 ++++--- .../TerrainWorldDebuggerComponent.h | 2 +- .../TerrainRaycast/TerrainRaycastContext.cpp | 5 +- .../TerrainFeatureProcessor.cpp | 7 +-- .../TerrainRenderer/TerrainMeshManager.cpp | 5 +- .../Source/TerrainSystem/TerrainSystem.cpp | 16 ++--- .../Code/Source/TerrainSystem/TerrainSystem.h | 6 +- .../Tests/TerrainHeightGradientListTests.cpp | 4 +- .../Tests/TerrainPhysicsColliderTests.cpp | 16 ++--- .../Code/Tests/TerrainSystemBenchmarks.cpp | 54 ++++++++-------- Gems/Terrain/Code/Tests/TerrainSystemTest.cpp | 26 +++----- 23 files changed, 167 insertions(+), 109 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_World_ConfigurationWorks.py b/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_World_ConfigurationWorks.py index bb5dcb3bea..41dc6b92af 100644 --- a/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_World_ConfigurationWorks.py +++ b/AutomatedTesting/Gem/PythonTests/Terrain/EditorScripts/Terrain_World_ConfigurationWorks.py @@ -93,7 +93,7 @@ def Terrain_World_ConfigurationWorks(): # 5) Set the base Terrain World values world_bounds_max = azmath.Vector3(1100.0, 1100.0, 1100.0) world_bounds_min = azmath.Vector3(10.0, 10.0, 10.0) - height_query_resolution = azmath.Vector2(1.0, 1.0) + height_query_resolution = 1.0 hydra.set_component_property_value(terrain_world_component, "Configuration|World Bounds (Max)", world_bounds_max) hydra.set_component_property_value(terrain_world_component, "Configuration|World Bounds (Min)", world_bounds_min) hydra.set_component_property_value(terrain_world_component, "Configuration|Height Query Resolution (m)", height_query_resolution) @@ -148,7 +148,7 @@ def Terrain_World_ConfigurationWorks(): # 13) Check height value is the expected one when query resolution is changed testpoint = terrain.TerrainDataRequestBus(bus.Broadcast, 'GetHeightFromFloats', 10.5, 10.5, CLAMP) - height_query_resolution = azmath.Vector2(0.5, 0.5) + height_query_resolution = 0.5 hydra.set_component_property_value(terrain_world_component, "Configuration|Height Query Resolution (m)", height_query_resolution) general.idle_wait_frames(1) testpoint2 = terrain.TerrainDataRequestBus(bus.Broadcast, 'GetHeightFromFloats', 10.5, 10.5, CLAMP) @@ -165,4 +165,3 @@ if __name__ == "__main__": from editor_python_test_tools.utils import Report Report.start_test(Terrain_World_ConfigurationWorks) - diff --git a/Code/Editor/GameExporter.cpp b/Code/Editor/GameExporter.cpp index a768861b90..635281aee5 100644 --- a/Code/Editor/GameExporter.cpp +++ b/Code/Editor/GameExporter.cpp @@ -317,8 +317,8 @@ void CGameExporter::ExportLevelInfo(const QString& path) root->setAttr("Name", levelName.toUtf8().data()); auto terrain = AzFramework::Terrain::TerrainDataRequestBus::FindFirstHandler(); const AZ::Aabb terrainAabb = terrain ? terrain->GetTerrainAabb() : AZ::Aabb::CreateFromPoint(AZ::Vector3::CreateZero()); - const AZ::Vector2 terrainGridResolution = terrain ? terrain->GetTerrainHeightQueryResolution() : AZ::Vector2::CreateOne(); - const int compiledHeightmapSize = static_cast(terrainAabb.GetXExtent() / terrainGridResolution.GetX()); + const float terrainGridResolution = terrain ? terrain->GetTerrainHeightQueryResolution() : 1.0f; + const int compiledHeightmapSize = static_cast(terrainAabb.GetXExtent() / terrainGridResolution); root->setAttr("HeightmapSize", compiledHeightmapSize); ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp index db8004d83a..bc38fe78fd 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp @@ -378,7 +378,7 @@ namespace Physics m_cachedNativeHeightfield = cachedNativeHeightfield; } - AZ::Vector2 HeightfieldShapeConfiguration::GetGridResolution() const + const AZ::Vector2& HeightfieldShapeConfiguration::GetGridResolution() const { return m_gridResolution; } diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h index bd9d6a6aa7..26af746128 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h @@ -221,7 +221,7 @@ namespace Physics const void* GetCachedNativeHeightfield() const; void* GetCachedNativeHeightfield(); void SetCachedNativeHeightfield(void* cachedNativeHeightfield); - AZ::Vector2 GetGridResolution() const; + const AZ::Vector2& GetGridResolution() const; void SetGridResolution(const AZ::Vector2& gridSpacing); int32_t GetNumColumns() const; void SetNumColumns(int32_t numColumns); @@ -235,7 +235,7 @@ namespace Physics void SetMaxHeightBounds(float maxBounds); private: - //! The number of meters between each heightfield sample. + //! The number of meters between each heightfield sample in x and y. AZ::Vector2 m_gridResolution{ 1.0f }; //! The number of columns in the heightfield sample grid. int32_t m_numColumns{ 0 }; diff --git a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h index f9ef264ab1..7909a7ec83 100644 --- a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h @@ -50,8 +50,8 @@ namespace AzFramework static AZ::Vector3 GetDefaultTerrainNormal() { return AZ::Vector3::CreateAxisZ(); } // System-level queries to understand world size and resolution - virtual AZ::Vector2 GetTerrainHeightQueryResolution() const = 0; - virtual void SetTerrainHeightQueryResolution(AZ::Vector2 queryResolution) = 0; + virtual float GetTerrainHeightQueryResolution() const = 0; + virtual void SetTerrainHeightQueryResolution(float queryResolution) = 0; virtual AZ::Aabb GetTerrainAabb() const = 0; virtual void SetTerrainAabb(const AZ::Aabb& worldBounds) = 0; diff --git a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h index f5af0ff486..4b9658eebb 100644 --- a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h @@ -49,8 +49,8 @@ namespace UnitTest AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); } - MOCK_CONST_METHOD0(GetTerrainHeightQueryResolution, AZ::Vector2()); - MOCK_METHOD1(SetTerrainHeightQueryResolution, void(AZ::Vector2)); + MOCK_CONST_METHOD0(GetTerrainHeightQueryResolution, float()); + MOCK_METHOD1(SetTerrainHeightQueryResolution, void(float)); MOCK_CONST_METHOD0(GetTerrainAabb, AZ::Aabb()); MOCK_METHOD1(SetTerrainAabb, void(const AZ::Aabb&)); MOCK_CONST_METHOD3(GetHeight, float(const AZ::Vector3&, Sampler, bool*)); diff --git a/Gems/PhysX/Code/Source/Utils.cpp b/Gems/PhysX/Code/Source/Utils.cpp index 950404820d..cc4ef2a12c 100644 --- a/Gems/PhysX/Code/Source/Utils.cpp +++ b/Gems/PhysX/Code/Source/Utils.cpp @@ -133,7 +133,7 @@ namespace PhysX { physx::PxHeightField* heightfield = nullptr; - const AZ::Vector2 gridSpacing = heightfieldConfig.GetGridResolution(); + const AZ::Vector2& gridSpacing = heightfieldConfig.GetGridResolution(); const int32_t numCols = heightfieldConfig.GetNumColumns(); const int32_t numRows = heightfieldConfig.GetNumRows(); diff --git a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp index 1e7b66ab9d..69cc37c85d 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp @@ -266,7 +266,7 @@ namespace Terrain LmbrCentral::ShapeComponentRequestsBus::EventResult(m_cachedShapeBounds, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::GetEncompassingAabb); // Get the height range of the entire world - m_cachedHeightQueryResolution = AZ::Vector2(1.0f); + m_cachedHeightQueryResolution = 1.0f; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( m_cachedHeightQueryResolution, &AzFramework::Terrain::TerrainDataRequestBus::Events::GetTerrainHeightQueryResolution); diff --git a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.h b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.h index c90f4e04d9..4424a67593 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.h @@ -92,7 +92,7 @@ namespace Terrain float m_cachedMinWorldHeight{ 0.0f }; float m_cachedMaxWorldHeight{ 0.0f }; - AZ::Vector2 m_cachedHeightQueryResolution{ 1.0f, 1.0f }; + float m_cachedHeightQueryResolution{ 1.0f }; AZ::Aabb m_cachedShapeBounds; // prevent recursion in case user attaches cyclic dependences diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index d70915a861..457c74a6dd 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -383,11 +383,11 @@ namespace Terrain AZ::Vector2 TerrainPhysicsColliderComponent::GetHeightfieldGridSpacing() const { - AZ::Vector2 gridResolution = AZ::Vector2(1.0f); + float gridResolution = 1.0f; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( gridResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); - return gridResolution; + return AZ::Vector2(gridResolution); } void TerrainPhysicsColliderComponent::GetHeightfieldGridSize(int32_t& numColumns, int32_t& numRows) const diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp index 8b612b86ce..74ae7ed24f 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp @@ -7,9 +7,9 @@ */ #include +#include #include #include -#include #include #include #include @@ -17,13 +17,60 @@ namespace Terrain { + + AZ::JsonSerializationResult::Result JsonTerrainWorldConfigSerializer::Load( + void* outputValue, [[maybe_unused]] const AZ::Uuid& outputValueTypeId, + const rapidjson::Value& inputValue, AZ::JsonDeserializerContext& context) + { + namespace JSR = AZ::JsonSerializationResult; + + auto configInstance = reinterpret_cast(outputValue); + AZ_Assert(configInstance, "Output value for JsonTerrainWorldConfigSerializer can't be null."); + + JSR::ResultCode result(JSR::Tasks::ReadField); + + result.Combine(ContinueLoadingFromJsonObjectField( + &configInstance->m_worldMin, azrtti_typeidm_worldMin)>(), inputValue, "WorldMin", context)); + + result.Combine(ContinueLoadingFromJsonObjectField( + &configInstance->m_worldMax, azrtti_typeidm_worldMax)>(), inputValue, "WorldMax", context)); + + rapidjson::Value::ConstMemberIterator itr = inputValue.FindMember("HeightQueryResolution"); + if (itr != inputValue.MemberEnd()) + { + if (itr->value.IsArray()) + { + // Version 1 stored a Vector2 (serialized as a json array) to have a separate x and y + // query resolution. Now this is only one value, so just take the x value from the Vector2. + configInstance->m_heightQueryResolution = itr->value.GetArray().Begin()->GetFloat(); + } + else + { + result.Combine(ContinueLoadingFromJsonObjectField( + &configInstance->m_heightQueryResolution, azrtti_typeidm_heightQueryResolution)>(), inputValue, "HeightQueryResolution", context)); + } + } + + return context.Report(result, + result.GetProcessing() != JSR::Processing::Halted ? + "Successfully loaded TerrainWorldConfig information." : + "Failed to load TerrainWorldConfig information."); + } + + AZ_CLASS_ALLOCATOR_IMPL(JsonTerrainWorldConfigSerializer, AZ::SystemAllocator, 0); + void TerrainWorldConfig::Reflect(AZ::ReflectContext* context) { + if (auto jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer()->HandlesType(); + } + AZ::SerializeContext* serialize = azrtti_cast(context); if (serialize) { serialize->Class() - ->Version(1) + ->Version(2) ->Field("WorldMin", &TerrainWorldConfig::m_worldMin) ->Field("WorldMax", &TerrainWorldConfig::m_worldMax) ->Field("HeightQueryResolution", &TerrainWorldConfig::m_heightQueryResolution) @@ -131,9 +178,9 @@ namespace Terrain return false; } - float TerrainWorldConfig::NumberOfSamples(AZ::Vector3* min, AZ::Vector3* max, AZ::Vector2* heightQuery) + float TerrainWorldConfig::NumberOfSamples(const AZ::Vector3& min, const AZ::Vector3& max, float heightQuery) { - float numberOfSamples = ((max->GetX() - min->GetX()) / heightQuery->GetX()) * ((max->GetY() - min->GetY()) / heightQuery->GetY()); + float numberOfSamples = ((max.GetX() - min.GetX()) / heightQuery) * ((max.GetY() - min.GetY()) / heightQuery); return numberOfSamples; } @@ -151,21 +198,21 @@ namespace Terrain { AZ::Vector3 minValue = *static_cast(newValue); - return DetermineMessage(NumberOfSamples(&minValue, &m_worldMax, &m_heightQueryResolution)); + return DetermineMessage(NumberOfSamples(minValue, m_worldMax, m_heightQueryResolution)); } AZ::Outcome TerrainWorldConfig::ValidateWorldMax(void* newValue, [[maybe_unused]] const AZ::Uuid& valueType) { AZ::Vector3 maxValue = *static_cast(newValue); - return DetermineMessage(NumberOfSamples(&m_worldMin, &maxValue, &m_heightQueryResolution)); + return DetermineMessage(NumberOfSamples(m_worldMin, maxValue, m_heightQueryResolution)); } AZ::Outcome TerrainWorldConfig::ValidateWorldHeight(void* newValue, [[maybe_unused]] const AZ::Uuid& valueType) { - AZ::Vector2 heightValue = *static_cast(newValue); + float heightValue = *static_cast(newValue); - return DetermineMessage(NumberOfSamples(&m_worldMin, &m_worldMax, &heightValue)); + return DetermineMessage(NumberOfSamples(m_worldMin, m_worldMax, heightValue)); } } // namespace Terrain diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.h b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.h index a396bcefc8..e8f464a748 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include namespace LmbrCentral @@ -21,6 +23,18 @@ namespace LmbrCentral namespace Terrain { + // Custom JSON serializer for TerrainWorldConfig to handle version conversion + class JsonTerrainWorldConfigSerializer : public AZ::BaseJsonSerializer + { + public: + AZ_RTTI(Terrain::JsonTerrainWorldConfigSerializer, "{910BC31F-CD49-488E-8004-227D9FEB5A16}", AZ::BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + + AZ::JsonSerializationResult::Result Load( + void* outputValue, const AZ::Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + AZ::JsonDeserializerContext& context) override; + }; + class TerrainWorldConfig : public AZ::ComponentConfig { @@ -31,13 +45,13 @@ namespace Terrain AZ::Vector3 m_worldMin{ 0.0f, 0.0f, 0.0f }; AZ::Vector3 m_worldMax{ 1024.0f, 1024.0f, 1024.0f }; - AZ::Vector2 m_heightQueryResolution{ 1.0f, 1.0f }; + float m_heightQueryResolution{ 1.0f }; private: AZ::Outcome ValidateWorldMin(void* newValue, const AZ::Uuid& valueType); AZ::Outcome ValidateWorldMax(void* newValue, const AZ::Uuid& valueType); AZ::Outcome ValidateWorldHeight(void* newValue, const AZ::Uuid& valueType); - float NumberOfSamples(AZ::Vector3* min, AZ::Vector3* max, AZ::Vector2* heightQuery); + float NumberOfSamples(const AZ::Vector3& min, const AZ::Vector3& max, float heightQuery); AZ::Outcome DetermineMessage(float numSamples); }; diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index f684727d33..7b8020c3ad 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -227,12 +227,12 @@ namespace Terrain float worldMinZ = worldBounds.GetMin().GetZ(); // Get the terrain height data resolution - AZ::Vector2 heightDataResolution = AZ::Vector2(1.0f); + float heightDataResolution = 1.0f; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( heightDataResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); // Get the size of a wireframe sector in world space - const AZ::Vector2 sectorSize = heightDataResolution * SectorSizeInGridPoints; + const AZ::Vector2 sectorSize = AZ::Vector2(heightDataResolution * SectorSizeInGridPoints); // Try to get the current camera position, or default to (0,0) if we can't. AZ::Vector3 cameraPos = AZ::Vector3::CreateZero(); @@ -317,7 +317,7 @@ namespace Terrain } - void TerrainWorldDebuggerComponent::RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution) + void TerrainWorldDebuggerComponent::RebuildSectorWireframe(WireframeSector& sector, float gridResolution) { if (!sector.m_isDirty) { @@ -337,11 +337,11 @@ namespace Terrain // Since we're processing lines based on the grid points and going backwards, this will give us (*--*--*). AZ::Aabb region = sector.m_aabb; - region.SetMax(region.GetMax() + AZ::Vector3(gridResolution.GetX(), gridResolution.GetY(), 0.0f)); + region.SetMax(region.GetMax() + AZ::Vector3(gridResolution, gridResolution, 0.0f)); // We need 4 vertices for each grid point in our sector to hold the _| shape. - const size_t numSamplesX = aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX())); - const size_t numSamplesY = aznumeric_cast(ceil(region.GetExtents().GetY() / gridResolution.GetY())); + const size_t numSamplesX = aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution)); + const size_t numSamplesY = aznumeric_cast(ceil(region.GetExtents().GetY() / gridResolution)); sector.m_lineVertices.clear(); sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); @@ -360,8 +360,8 @@ namespace Terrain // there is one. if ((xIndex > 0) && (yIndex > 0)) { - float x = surfacePoint.m_position.GetX() - gridResolution.GetX(); - float y = surfacePoint.m_position.GetY() - gridResolution.GetY(); + float x = surfacePoint.m_position.GetX() - gridResolution; + float y = surfacePoint.m_position.GetY() - gridResolution; sector.m_lineVertices.emplace_back(AZ::Vector3(x, surfacePoint.m_position.GetY(), previousHeight)); sector.m_lineVertices.emplace_back(surfacePoint.m_position); @@ -374,9 +374,10 @@ namespace Terrain previousHeight = surfacePoint.m_position.GetZ(); rowHeights[xIndex] = surfacePoint.m_position.GetZ(); }; - + + AZ::Vector2 stepSize = AZ::Vector2(gridResolution); AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, - region, gridResolution, ProcessHeightValue, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); + region, stepSize, ProcessHeightValue, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); } void TerrainWorldDebuggerComponent::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h index cb308effe6..13c602c48d 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h @@ -93,7 +93,7 @@ namespace Terrain bool m_isDirty{ true }; }; - void RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution); + void RebuildSectorWireframe(WireframeSector& sector, float gridResolution); void MarkDirtySectors(const AZ::Aabb& dirtyRegion); void DrawWorldBounds(AzFramework::DebugDisplayRequests& debugDisplay); void DrawWireframe(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); diff --git a/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp index d42388db60..1f05c44314 100644 --- a/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp +++ b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp @@ -377,10 +377,11 @@ AzFramework::RenderGeometry::RayResult TerrainRaycastContext::RayIntersect( const AzFramework::RenderGeometry::RayRequest& ray) { const AZ::Aabb terrainWorldBounds = m_terrainSystem.GetTerrainAabb(); - const AZ::Vector2 terrainResolution = m_terrainSystem.GetTerrainHeightQueryResolution(); + const float terrainResolution = m_terrainSystem.GetTerrainHeightQueryResolution(); + const AZ::Vector2 terrainResolution2d(terrainResolution); AzFramework::RenderGeometry::RayResult rayIntersectionResult; FindNearestIntersectionIterative(m_terrainSystem, - terrainResolution, + terrainResolution2d, terrainWorldBounds, ray.m_startWorldPosition, ray.m_endWorldPosition, diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index d9bdcb97bc..17cded8c97 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -159,11 +159,10 @@ namespace Terrain m_dirtyRegion.AddAabb(regionToUpdate); m_dirtyRegion.Clamp(worldBounds); - AZ::Vector2 queryResolution2D = AZ::Vector2(1.0f); + float queryResolution = 1.0f; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - queryResolution2D, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); + queryResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); // Currently query resolution is multidimensional but the rendering system only supports this changing in one dimension. - float queryResolution = queryResolution2D.GetX(); m_terrainBounds = worldBounds; m_sampleSpacing = queryResolution; @@ -209,7 +208,7 @@ namespace Terrain int32_t xStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetX() / m_sampleSpacing)); int32_t yStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetY() / m_sampleSpacing)); - + AZ::Vector2 stepSize(m_sampleSpacing); AZ::Vector3 maxBound( m_dirtyRegion.GetMax().GetX() + m_sampleSpacing, m_dirtyRegion.GetMax().GetY() + m_sampleSpacing, 0.0f); diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp index 7a36110579..78d0338ca5 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp @@ -203,11 +203,10 @@ namespace Terrain AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); - AZ::Vector2 queryResolution2D = AZ::Vector2(1.0f); + float queryResolution = 1.0f; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - queryResolution2D, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); + queryResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); // Currently query resolution is multidimensional but the rendering system only supports this changing in one dimension. - float queryResolution = queryResolution2D.GetX(); // Sectors need to be rebuilt if the world bounds change in the x/y, or the sample spacing changes. m_rebuildSectors = m_rebuildSectors || diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 35e6992db3..8976faadac 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -134,7 +134,7 @@ void TerrainSystem::SetTerrainAabb(const AZ::Aabb& worldBounds) m_terrainSettingsDirty = true; } -void TerrainSystem::SetTerrainHeightQueryResolution(AZ::Vector2 queryResolution) +void TerrainSystem::SetTerrainHeightQueryResolution(float queryResolution) { m_requestedSettings.m_heightQueryResolution = queryResolution; m_terrainSettingsDirty = true; @@ -145,7 +145,7 @@ AZ::Aabb TerrainSystem::GetTerrainAabb() const return m_currentSettings.m_worldBounds; } -AZ::Vector2 TerrainSystem::GetTerrainHeightQueryResolution() const +float TerrainSystem::GetTerrainHeightQueryResolution() const { return m_currentSettings.m_heightQueryResolution; } @@ -204,7 +204,7 @@ float TerrainSystem::GetHeightSynchronous(float x, float y, Sampler sampler, boo AZ::Vector2 normalizedDelta; AZ::Vector2 pos0; ClampPosition(x, y, pos0, normalizedDelta); - const AZ::Vector2 pos1 = pos0 + m_currentSettings.m_heightQueryResolution; + const AZ::Vector2 pos1 = pos0 + AZ::Vector2(m_currentSettings.m_heightQueryResolution); const float heightX0Y0 = GetTerrainAreaHeight(pos0.GetX(), pos0.GetY(), terrainExists); const float heightX1Y0 = GetTerrainAreaHeight(pos1.GetX(), pos0.GetY(), terrainExists); @@ -331,11 +331,11 @@ AZ::Vector3 TerrainSystem::GetNormalSynchronous(float x, float y, Sampler sample return outNormal; } } - const AZ::Vector2 range = (m_currentSettings.m_heightQueryResolution / 2.0f); - const AZ::Vector2 left (x - range.GetX(), y); - const AZ::Vector2 right(x + range.GetX(), y); - const AZ::Vector2 up (x, y - range.GetY()); - const AZ::Vector2 down (x, y + range.GetY()); + float range = m_currentSettings.m_heightQueryResolution / 2.0f; + const AZ::Vector2 left (x - range, y); + const AZ::Vector2 right(x + range, y); + const AZ::Vector2 up (x, y - range); + const AZ::Vector2 down (x, y + range); AZ::Vector3 v1(up.GetX(), up.GetY(), GetHeightSynchronous(up.GetX(), up.GetY(), sampler, &terrainExists)); AZ::Vector3 v2(left.GetX(), left.GetY(), GetHeightSynchronous(left.GetX(), left.GetY(), sampler, &terrainExists)); diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h index 1cdb6e52b1..e0457b80af 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h @@ -54,8 +54,8 @@ namespace Terrain /////////////////////////////////////////// // TerrainDataRequestBus::Handler Impl - AZ::Vector2 GetTerrainHeightQueryResolution() const override; - void SetTerrainHeightQueryResolution(AZ::Vector2 queryResolution) override; + float GetTerrainHeightQueryResolution() const override; + void SetTerrainHeightQueryResolution(float queryResolution) override; AZ::Aabb GetTerrainAabb() const override; void SetTerrainAabb(const AZ::Aabb& worldBounds) override; @@ -213,7 +213,7 @@ namespace Terrain struct TerrainSystemSettings { AZ::Aabb m_worldBounds; - AZ::Vector2 m_heightQueryResolution{ 1.0f }; + float m_heightQueryResolution{ 1.0f }; bool m_systemActive{ false }; }; diff --git a/Gems/Terrain/Code/Tests/TerrainHeightGradientListTests.cpp b/Gems/Terrain/Code/Tests/TerrainHeightGradientListTests.cpp index 77139a5209..976129030a 100644 --- a/Gems/Terrain/Code/Tests/TerrainHeightGradientListTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainHeightGradientListTests.cpp @@ -149,7 +149,7 @@ TEST_F(TerrainHeightGradientListComponentTest, TerrainHeightGradientListReturnsH const float worldMax = 10000.0f; const AZ::Aabb worldAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(min), AZ::Vector3(worldMax)); NiceMock mockterrainDataRequests; - ON_CALL(mockterrainDataRequests, GetTerrainHeightQueryResolution).WillByDefault(Return(AZ::Vector2(1.0f))); + ON_CALL(mockterrainDataRequests, GetTerrainHeightQueryResolution).WillByDefault(Return(1.0f)); ON_CALL(mockterrainDataRequests, GetTerrainAabb).WillByDefault(Return(worldAabb)); // Ensure the cached values in the HeightGradientListComponent are up to date. @@ -198,7 +198,7 @@ TEST_F(TerrainHeightGradientListComponentTest, TerrainHeightGradientListGetHeigh const float worldMax = 10000.0f; const AZ::Aabb worldAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(min), AZ::Vector3(worldMax)); NiceMock mockterrainDataRequests; - ON_CALL(mockterrainDataRequests, GetTerrainHeightQueryResolution).WillByDefault(Return(AZ::Vector2(1.0f))); + ON_CALL(mockterrainDataRequests, GetTerrainHeightQueryResolution).WillByDefault(Return(1.0f)); ON_CALL(mockterrainDataRequests, GetTerrainAabb).WillByDefault(Return(worldAabb)); // Ensure the cached values in the HeightGradientListComponent are up to date. diff --git a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp index bc4818e62a..43b122c6e9 100644 --- a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp @@ -169,7 +169,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsAligned const AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(boundsMin), AZ::Vector3(boundsMax)); ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); - const AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); @@ -197,7 +197,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderExpandsMinBoun const AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(boundsMin), AZ::Vector3(boundsMax)); ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); @@ -226,7 +226,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderExpandsMaxBoun const AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(boundsMin), AZ::Vector3(boundsMax)); ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); @@ -254,7 +254,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsRetu const AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(boundsMin), AZ::Vector3(boundsMax)); ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( @@ -291,7 +291,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsRelativ const AZ::Vector3 boundsMax = AZ::Vector3(256.0f, 256.0f, 32768.0f); const float mockHeight = 32768.0f; - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); @@ -410,7 +410,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); const float mockHeight = 32768.0f; - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; AzFramework::SurfaceData::SurfaceTagWeight tagWeight1(tag1, 1.0f); AzFramework::SurfaceData::SurfaceTagWeight tagWeight2(tag2, 1.0f); @@ -490,7 +490,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMateria ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); const float mockHeight = 32768.0f; - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; AzFramework::SurfaceData::SurfaceTagWeight tagWeight1(tag1, 1.0f); AzFramework::SurfaceData::SurfaceTagWeight tagWeight2(tag2, 1.0f); @@ -554,7 +554,7 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderDefaultMateria ON_CALL(boxShape, GetEncompassingAabb).WillByDefault(Return(bounds)); const float mockHeight = 32768.0f; - AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); + float mockHeightResolution = 1.0f; const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); AzFramework::SurfaceData::SurfaceTagWeight tagWeight1(tag1, 1.0f); diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp index 85dd5dc0c4..e54747abcc 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -117,7 +117,7 @@ namespace UnitTest // Create a terrain system with reasonable defaults for testing, but with the ability to override the defaults // on a test-by-test basis. AZStd::unique_ptr CreateAndActivateTerrainSystem( - AZ::Vector2 queryResolution = AZ::Vector2(1.0f), + float queryResolution = 1.0f, AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-128.0f), AZ::Vector3(128.0f))) { // Create the terrain system and give it one tick to fully initialize itself. @@ -216,7 +216,7 @@ namespace UnitTest void RunTerrainApiBenchmark( benchmark::State& state, AZStd::function ApiCaller) { @@ -228,7 +228,7 @@ namespace UnitTest // Set up our world bounds and query resolution AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-boundsRange / 2.0f), AZ::Vector3(boundsRange / 2.0f)); - AZ::Vector2 queryResolution = AZ::Vector2(1.0f); + float queryResolution = 1.0f; // Create a Random Gradient to use as our height provider const uint32_t heightRandomSeed = 12345; @@ -281,17 +281,17 @@ namespace UnitTest surfaceGradientShapeRequests.clear(); } - void GenerateInputPositionsList(const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, AZStd::vector& positions) + void GenerateInputPositionsList(float queryResolution, const AZ::Aabb& worldBounds, AZStd::vector& positions) { - const size_t numSamplesX = aznumeric_cast(ceil(worldBounds.GetExtents().GetX() / queryResolution.GetX())); - const size_t numSamplesY = aznumeric_cast(ceil(worldBounds.GetExtents().GetY() / queryResolution.GetY())); + const size_t numSamplesX = aznumeric_cast(ceil(worldBounds.GetExtents().GetX() / queryResolution)); + const size_t numSamplesY = aznumeric_cast(ceil(worldBounds.GetExtents().GetY() / queryResolution)); for (size_t y = 0; y < numSamplesY; y++) { - float fy = aznumeric_cast(worldBounds.GetMin().GetY() + (y * queryResolution.GetY())); + float fy = aznumeric_cast(worldBounds.GetMin().GetY() + (y * queryResolution)); for (size_t x = 0; x < numSamplesX; x++) { - float fx = aznumeric_cast(worldBounds.GetMin().GetX() + (x * queryResolution.GetX())); + float fx = aznumeric_cast(worldBounds.GetMin().GetX() + (x * queryResolution)); positions.emplace_back(fx, fy, 0.0f); } } @@ -307,7 +307,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { float worldMinZ = worldBounds.GetMin().GetZ(); @@ -343,7 +343,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, @@ -351,9 +351,10 @@ namespace UnitTest { benchmark::DoNotOptimize(surfacePoint.m_position.GetZ()); }; - + + AZ::Vector2 stepSize = AZ::Vector2(queryResolution); AzFramework::Terrain::TerrainDataRequestBus::Broadcast( - &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, worldBounds, stepSize, perPositionCallback, sampler); } ); } @@ -375,7 +376,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + [this]([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { AZStd::vector inPositions; @@ -409,7 +410,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) @@ -440,7 +441,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, @@ -449,8 +450,9 @@ namespace UnitTest benchmark::DoNotOptimize(surfacePoint.m_normal); }; + AZ::Vector2 stepSize = AZ::Vector2(queryResolution); AzFramework::Terrain::TerrainDataRequestBus::Broadcast( - &AzFramework::Terrain::TerrainDataRequests::ProcessNormalsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + &AzFramework::Terrain::TerrainDataRequests::ProcessNormalsFromRegion, worldBounds, stepSize, perPositionCallback, sampler); } ); } @@ -469,7 +471,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + [this]([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { AZStd::vector inPositions; @@ -500,7 +502,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; @@ -532,7 +534,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, @@ -541,8 +543,9 @@ namespace UnitTest benchmark::DoNotOptimize(surfacePoint.m_surfaceTags); }; + AZ::Vector2 stepSize = AZ::Vector2(queryResolution); AzFramework::Terrain::TerrainDataRequestBus::Broadcast( - &AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, worldBounds, stepSize, perPositionCallback, sampler); } ); } @@ -561,7 +564,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + [this]([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { AZStd::vector inPositions; @@ -592,7 +595,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { AzFramework::SurfaceData::SurfacePoint surfacePoint; @@ -624,7 +627,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + []([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, @@ -633,8 +636,9 @@ namespace UnitTest benchmark::DoNotOptimize(surfacePoint); }; + AZ::Vector2 stepSize = AZ::Vector2(queryResolution); AzFramework::Terrain::TerrainDataRequestBus::Broadcast( - &AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromRegion, worldBounds, stepSize, perPositionCallback, sampler); } ); } @@ -653,7 +657,7 @@ namespace UnitTest // Run the benchmark RunTerrainApiBenchmark( state, - [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + [this]([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, AzFramework::Terrain::TerrainDataRequests::Sampler sampler) { AZStd::vector inPositions; diff --git a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp index ddccdbc49c..2c01a3d455 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp @@ -120,7 +120,7 @@ namespace UnitTest // Create a terrain system with reasonable defaults for testing, but with the ability to override the defaults // on a test-by-test basis. AZStd::unique_ptr CreateAndActivateTerrainSystem( - AZ::Vector2 queryResolution = AZ::Vector2(1.0f), + float queryResolution = 1.0f, AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-128.0f), AZ::Vector3(128.0f))) { // Create the terrain system and give it one tick to fully initialize itself. @@ -363,8 +363,7 @@ namespace UnitTest // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution that exactly matches // the frequency of our sine wave. If our height queries rely on the query resolution, we should always get a value of 0. - const AZ::Vector2 queryResolution(frequencyMeters); - auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + auto terrainSystem = CreateAndActivateTerrainSystem(frequencyMeters); // Test an arbitrary set of points that should all produce non-zero heights with the EXACT sampler. They're not aligned with the // query resolution, or with the 0 points on the sine wave. @@ -414,7 +413,7 @@ namespace UnitTest // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 0.25 meter // intervals. - const AZ::Vector2 queryResolution(0.25f); + const float queryResolution = 0.25f; auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); // Test some points and verify that the results always go "downward", whether they're in positive or negative space. @@ -476,8 +475,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(frequencyMeters); - auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + auto terrainSystem = CreateAndActivateTerrainSystem(frequencyMeters); // Test some points and verify that the results are the expected bilinear filtered result, // whether they're in positive or negative space. @@ -664,8 +662,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(frequencyMeters); - auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + auto terrainSystem = CreateAndActivateTerrainSystem(frequencyMeters); // Test some points and verify that the results are the expected bilinear filtered result, // whether they're in positive or negative space. @@ -762,8 +759,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(frequencyMeters); - auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + auto terrainSystem = CreateAndActivateTerrainSystem(frequencyMeters); const NormalTestPoint testPoints[] = { @@ -852,8 +848,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(frequencyMeters); - auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + auto terrainSystem = CreateAndActivateTerrainSystem(frequencyMeters); const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f); const AZ::Vector2 stepSize(1.0f); @@ -911,8 +906,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(frequencyMeters); - auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + auto terrainSystem = CreateAndActivateTerrainSystem(frequencyMeters); const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f); const AZ::Vector2 stepSize(1.0f); @@ -960,7 +954,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(1.0f); + const float queryResolution = 1.0f; auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-3.0f, -3.0f, -1.0f, 3.0f, 3.0f, 1.0f); @@ -1006,7 +1000,7 @@ namespace UnitTest }); // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. - const AZ::Vector2 queryResolution(1.0f); + const float queryResolution = 1.0f; auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-3.0f, -3.0f, -1.0f, 3.0f, 3.0f, 1.0f); From 96dcd1fc265f705d0ca5c22db3a5f7fdc581b371 Mon Sep 17 00:00:00 2001 From: hershey5045 <43485729+hershey5045@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:27:55 -0800 Subject: [PATCH 362/394] Atom/rbarrand/export screenshot diff (#7300) * Small refactor on ImageComparison utils. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Add aznumeric cast. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Correction on aznumeric cast. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Add unit test for new image comparison function. Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> * Use span instead of array_view Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> --- Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h | 2 +- Gems/Atom/Utils/Code/Source/ImageComparison.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h index 58c3a1bd48..975d9a4321 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImageComparison.h @@ -24,7 +24,7 @@ namespace AZ }; //! Calculates the maximum difference of the rgb channels between two image buffers. - int16_t CalcMaxChannelDifference(AZStd::array_view bufferA, AZStd::array_view bufferB, size_t index); + int16_t CalcMaxChannelDifference(AZStd::span bufferA, AZStd::span bufferB, size_t index); //! Compares two images and returns the RMS (root mean square) of the difference. //! @param buffer[A|B] the raw buffer of image data diff --git a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp index 6fcc316791..16cb449516 100644 --- a/Gems/Atom/Utils/Code/Source/ImageComparison.cpp +++ b/Gems/Atom/Utils/Code/Source/ImageComparison.cpp @@ -14,7 +14,7 @@ namespace AZ { namespace Utils { - int16_t CalcMaxChannelDifference(AZStd::array_view bufferA, AZStd::array_view bufferB, size_t index) + int16_t CalcMaxChannelDifference(AZStd::span bufferA, AZStd::span bufferB, size_t index) { // We use the max error from a single channel instead of accumulating the error from each channel. // This normalizes differences so that for example black vs red has the same weight as black vs yellow. From 2dbc961ea8a776d108620cac746ae9962f603fdf Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:31:24 -0800 Subject: [PATCH 363/394] Reorder and Remove unnecessary GCC ignore warning flags - Reordered warning flags (#7297) - Removed unnecessary ignore warning flags Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- .../Common/GCC/Configurations_gcc.cmake | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/cmake/Platform/Common/GCC/Configurations_gcc.cmake b/cmake/Platform/Common/GCC/Configurations_gcc.cmake index 3db96306ee..9963c62d39 100644 --- a/cmake/Platform/Common/GCC/Configurations_gcc.cmake +++ b/cmake/Platform/Common/GCC/Configurations_gcc.cmake @@ -33,6 +33,8 @@ ly_append_configurations_options( COMPILATION_CXX -fno-exceptions -fvisibility=hidden + -fvisibility-inlines-hidden + -Wall -Werror @@ -40,40 +42,33 @@ ly_append_configurations_options( ${LY_GCC_GPROF_FLAGS} # Disabled warnings - -Wno-format-security - -Wno-multichar + -Wno-array-bounds + -Wno-attributes + -Wno-class-memaccess + -Wno-comment + -Wno-delete-non-virtual-dtor + -Wno-enum-compare + -Wno-format-overflow + -Wno-format-truncation + -Wno-int-in-bool-context + -Wno-logical-not-parentheses + -Wno-memset-elt-size + -Wno-nonnull-compare -Wno-parentheses + -Wno-reorder + -Wno-restrict + -Wno-return-local-addr + -Wno-sequence-point + -Wno-sign-compare + -Wno-strict-aliasing + -Wno-stringop-overflow + -Wno-stringop-truncation -Wno-switch - -Wno-tautological-compare - -Wno-unknown-pragmas - -Wno-unused-function + -Wno-uninitialized + -Wno-unused-but-set-variable + -Wno-unused-result -Wno-unused-value -Wno-unused-variable - -Wno-format-truncation - -Wno-uninitialized - -Wno-array-bounds - -Wno-nonnull-compare - -Wno-strict-aliasing - -Wno-unused-result - -Wno-sign-compare - -Wno-return-local-addr - -Wno-stringop-overflow - -Wno-attributes - -Wno-logical-not-parentheses - -Wno-stringop-truncation - -Wno-memset-elt-size - -Wno-unused-but-set-variable - -Wno-enum-compare - -Wno-int-in-bool-context - -Wno-sequence-point - -Wno-comment - -Wno-restrict - -Wno-format-overflow - -fvisibility-inlines-hidden - -Wno-invalid-offsetof - -Wno-class-memaccess - -Wno-delete-non-virtual-dtor - -Wno-reorder COMPILATION_DEBUG -O0 # No optimization @@ -88,4 +83,3 @@ ly_append_configurations_options( ) include(cmake/Platform/Common/TargetIncludeSystemDirectories_supported.cmake) - From ad6392e364a646c38d06a311b416f0f1ad451c23 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 31 Jan 2022 15:03:17 -0800 Subject: [PATCH 364/394] decal P1 test for null renderer Signed-off-by: Scott Murray --- .../Atom/atom_utils/atom_constants.py | 6 + .../hydra_AtomEditorComponents_DecalAdded.py | 127 ++++++++++++------ .../editor_entity_utils.py | 8 ++ .../decal/airship_symbol_decal.material | 36 +++++ .../Materials/decal/airship_symbol_decal.tif | 3 + .../Materials/decal/scorch_01_decal.material | 35 +++++ .../Materials/decal/scorch_01_decal.tif | 3 + 7 files changed, 176 insertions(+), 42 deletions(-) create mode 100644 AutomatedTesting/Materials/decal/airship_symbol_decal.material create mode 100644 AutomatedTesting/Materials/decal/airship_symbol_decal.tif create mode 100644 AutomatedTesting/Materials/decal/scorch_01_decal.material create mode 100644 AutomatedTesting/Materials/decal/scorch_01_decal.tif diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py index 339108090f..0f13dd6b20 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/atom_constants.py @@ -87,12 +87,18 @@ class AtomComponentProperties: def decal(property: str = 'name') -> str: """ Decal component properties. + - 'Attenuation Angle' controls how much the angle between geometry and decal impacts opacity. 0-1 Radians + - 'Opacity' where one is opaque and zero is transparent + - 'Sort Key' 0-255 stacking z-sort like key to define which decal is on top of another - 'Material' the material Asset.id of the decal. :param property: From the last element of the property tree path. Default 'name' for component name string. :return: Full property path OR component name if no property specified. """ properties = { 'name': 'Decal', + 'Attenuation Angle': 'Controller|Configuration|Attenuation Angle', + 'Opacity': 'Controller|Configuration|Opacity', + 'Sort Key': 'Controller|Configuration|Sort Key', 'Material': 'Controller|Configuration|Material', } return properties[property] diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py index eb5e24e3a6..238a2e31cb 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py @@ -8,49 +8,61 @@ SPDX-License-Identifier: Apache-2.0 OR MIT class Tests: camera_creation = ( "Camera Entity successfully created", - "Camera Entity failed to be created") + "P0: Camera Entity failed to be created") camera_component_added = ( "Camera component was added to entity", - "Camera component failed to be added to entity") + "P0: Camera component failed to be added to entity") camera_component_check = ( "Entity has a Camera component", - "Entity failed to find Camera component") + "P0: Entity failed to find Camera component") creation_undo = ( "UNDO Entity creation success", - "UNDO Entity creation failed") + "P0: UNDO Entity creation failed") creation_redo = ( "REDO Entity creation success", - "REDO Entity creation failed") + "P0: REDO Entity creation failed") decal_creation = ( "Decal Entity successfully created", - "Decal Entity failed to be created") + "P0: Decal Entity failed to be created") decal_component = ( "Entity has a Decal component", - "Entity failed to find Decal component") + "P0: Entity failed to find Decal component") + decal_component_removed = ( + "Decal component removed", + "P0: Decal component failed to be removed") material_property_set = ( "Material property set on Decal component", - "Couldn't set Material property on Decal component") + "P0: Couldn't set Material property on Decal component") + attenuation_property_set = ( + "Attenuation Angle property set on Decal component", + "P1: Couldn't set Attenuation Angle property on Decal component") + opacity_property_set = ( + "Opacity property set on Decal component", + "P1: Coudn't set Opacity property on Decal component") + sort_key_property_set = ( + "Sort Key property set on Decal component", + "P1: Couldn't set Sort Key property on Decal component") enter_game_mode = ( "Entered game mode", - "Failed to enter game mode") + "P0: Failed to enter game mode") exit_game_mode = ( "Exited game mode", - "Couldn't exit game mode") + "P0: Couldn't exit game mode") is_visible = ( "Entity is visible", - "Entity was not visible") + "P0: Entity was not visible") is_hidden = ( "Entity is hidden", - "Entity was not hidden") + "P0: Entity was not hidden") entity_deleted = ( "Entity deleted", - "Entity was not deleted") + "P0: Entity was not deleted") deletion_undo = ( "UNDO deletion success", - "UNDO deletion failed") + "P0: UNDO deletion failed") deletion_redo = ( "REDO deletion success", - "REDO deletion failed") + "P0: REDO deletion failed") def AtomEditorComponents_Decal_AddedToEntity(): @@ -71,14 +83,18 @@ def AtomEditorComponents_Decal_AddedToEntity(): 2) Add Decal component to Decal entity. 3) UNDO the entity creation and component addition. 4) REDO the entity creation and component addition. - 5) Enter/Exit game mode. - 6) Test IsHidden. - 7) Test IsVisible. - 8) Set Material property on Decal component. - 9) Delete Decal entity. - 10) UNDO deletion. - 11) REDO deletion. - 12) Look for errors and asserts. + 5) Set Material property on Decal component. + 6) Set Attenuation Angle property on Decal component. + 7) Set Opacity property on Decal component + 8) Set Sort Key property on Decal Component + 9) Remove Decal component then UNDO the remove + 10) Enter/Exit game mode. + 11) Test IsHidden. + 12) Test IsVisible. + 13) Delete Decal entity. + 14) UNDO deletion. + 15) REDO deletion. + 16) Look for errors and asserts. :return: None """ @@ -130,42 +146,69 @@ def AtomEditorComponents_Decal_AddedToEntity(): general.idle_wait_frames(1) Report.result(Tests.creation_redo, decal_entity.exists()) - # 5. Enter/Exit game mode. - TestHelper.enter_game_mode(Tests.enter_game_mode) - general.idle_wait_frames(1) - TestHelper.exit_game_mode(Tests.exit_game_mode) - - # 6. Test IsHidden. - decal_entity.set_visibility_state(False) - Report.result(Tests.is_hidden, decal_entity.is_hidden() is True) - - # 7. Test IsVisible. - decal_entity.set_visibility_state(True) - general.idle_wait_frames(1) - Report.result(Tests.is_visible, decal_entity.is_visible() is True) - - # 8. Set Material property on Decal component. + # 5. Set Material property on Decal component. decal_material_asset_path = os.path.join("materials", "basic_grey.azmaterial") decal_material_asset = Asset.find_asset_by_path(decal_material_asset_path, False) decal_component.set_component_property_value(AtomComponentProperties.decal('Material'), decal_material_asset.id) get_material_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Material')) Report.result(Tests.material_property_set, get_material_property == decal_material_asset.id) - # 9. Delete Decal entity. + # 6. Set Attenuation Angle property on Decal component + decal_component.set_component_property_value(AtomComponentProperties.decal('Attenuation Angle'), value=0.75) + get_attenuation_property = decal_component.get_component_property_value( + AtomComponentProperties.decal('Attenuation Angle')) + Report.result(Tests.attenuation_property_set, get_attenuation_property == 0.75) + + # 7. Set Opacity property on Decal component + decal_component.set_component_property_value(AtomComponentProperties.decal('Opacity'), value=0.5) + get_opacity_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Opacity')) + Report.result(Tests.opacity_property_set, get_opacity_property == 0.5) + + # 8. Set Sort Key property on Decal component + decal_component.set_component_property_value(AtomComponentProperties.decal('Sort Key'), value=255.0) + get_sort_key_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Sort Key')) + Report.result(Tests.sort_key_property_set, get_sort_key_property == 255.0) + decal_component.set_component_property_value(AtomComponentProperties.decal('Sort Key'), value=0) + get_sort_key_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Sort Key')) + Report.result(Tests.sort_key_property_set, get_sort_key_property == 0) + + # 9. Remove Decal component then UNDO the remove + decal_component.remove() + general.idle_wait_frames(1) + Report.result(Tests.decal_component_removed, not decal_entity.has_component(AtomComponentProperties.decal())) + general.undo() + general.idle_wait_frames(1) + Report.result(Tests.decal_component, decal_entity.has_component(AtomComponentProperties.decal())) + + # 10. Enter/Exit game mode. + TestHelper.enter_game_mode(Tests.enter_game_mode) + general.idle_wait_frames(1) + TestHelper.exit_game_mode(Tests.exit_game_mode) + + # 11. Test IsHidden. + decal_entity.set_visibility_state(False) + Report.result(Tests.is_hidden, decal_entity.is_hidden() is True) + + # 12. Test IsVisible. + decal_entity.set_visibility_state(True) + general.idle_wait_frames(1) + Report.result(Tests.is_visible, decal_entity.is_visible() is True) + + # 13. Delete Decal entity. decal_entity.delete() Report.result(Tests.entity_deleted, not decal_entity.exists()) - # 10. UNDO deletion. + # 14. UNDO deletion. general.undo() general.idle_wait_frames(1) Report.result(Tests.deletion_undo, decal_entity.exists()) - # 11. REDO deletion. + # 15. REDO deletion. general.redo() general.idle_wait_frames(1) Report.result(Tests.deletion_redo, not decal_entity.exists()) - # 12. Look for errors and asserts. + # 16. Look for errors and asserts. TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) for error_info in error_tracer.errors: Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}") diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index d8d4a77a65..7803d8caa6 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -34,6 +34,7 @@ class EditorComponent: EditorEntity.add_component() or Entity.add_components() or EditorEntity.get_components_of_type() which also assigns self.id and self.type_id to the EditorComponent object. self.type_id is the UUID for the component type as provided by an ebus call. + self.id is an azlmbr.entity.EntityComponentIdPair which contains both entity and component id's """ def __init__(self, type_id: uuid): @@ -270,6 +271,13 @@ class EditorComponent: warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) + def remove(self): + """ + Removes the component from its associated entity. Essentially a delete since only UNDO can return it. + :return: None + """ + editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", [self.id]) + @staticmethod def get_type_ids(component_names: list, entity_type: EditorEntityType = EditorEntityType.GAME) -> list: """ diff --git a/AutomatedTesting/Materials/decal/airship_symbol_decal.material b/AutomatedTesting/Materials/decal/airship_symbol_decal.material new file mode 100644 index 0000000000..40060aafeb --- /dev/null +++ b/AutomatedTesting/Materials/decal/airship_symbol_decal.material @@ -0,0 +1,36 @@ +{ + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 4, + "properties": { + "baseColor": { + "textureMap": "Materials/decal/airship_symbol_decal.tif" + }, + "general": { + "doubleSided": true + }, + "metallic": { + "useTexture": false + }, + "normal": { + "useTexture": false + }, + "opacity": { + "alphaSource": "Split", + "factor": 0.6899999976158142, + "mode": "Cutout", + "textureMap": "Materials/decal/airship_symbol_decal.tif" + }, + "roughness": { + "useTexture": false + }, + "specularF0": { + "useTexture": false + }, + "uv": { + "center": [ + 0.0, + 1.0 + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Materials/decal/airship_symbol_decal.tif b/AutomatedTesting/Materials/decal/airship_symbol_decal.tif new file mode 100644 index 0000000000..9b571a14fa --- /dev/null +++ b/AutomatedTesting/Materials/decal/airship_symbol_decal.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2252ba28e19432d99e58fa03b672f855e1f520805eda71764e076fe349e1915a +size 4205906 diff --git a/AutomatedTesting/Materials/decal/scorch_01_decal.material b/AutomatedTesting/Materials/decal/scorch_01_decal.material new file mode 100644 index 0000000000..3f700d483a --- /dev/null +++ b/AutomatedTesting/Materials/decal/scorch_01_decal.material @@ -0,0 +1,35 @@ +{ + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 4, + "properties": { + "baseColor": { + "textureMap": "Materials/decal/scorch_01_decal.tif" + }, + "general": { + "doubleSided": true + }, + "metallic": { + "useTexture": false + }, + "normal": { + "useTexture": false + }, + "opacity": { + "factor": 1.0, + "mode": "Blended", + "textureMap": "Materials/decal/scorch_01_decal.tif" + }, + "roughness": { + "useTexture": false + }, + "specularF0": { + "useTexture": false + }, + "uv": { + "center": [ + 0.0, + 1.0 + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Materials/decal/scorch_01_decal.tif b/AutomatedTesting/Materials/decal/scorch_01_decal.tif new file mode 100644 index 0000000000..935388bd93 --- /dev/null +++ b/AutomatedTesting/Materials/decal/scorch_01_decal.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:889072da11d2034a0d37ec6ae81b551a61b62d6d602965b0b919a999c56d67e2 +size 16793812 From e1c7dce7a737b68876b8054072e72cdde12c8545 Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Mon, 31 Jan 2022 15:45:34 -0800 Subject: [PATCH 365/394] Fixes issue with painters being saved and not restored in some cases, which would print numerous warnings in the VS console. (#7296) Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../UI/Prefab/PrefabUiHandler.cpp | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabUiHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabUiHandler.cpp index cc0018753e..69d6ae82ca 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabUiHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabUiHandler.cpp @@ -306,41 +306,37 @@ namespace AzToolsFramework { // Only show the close icon if the prefab is expanded. // This allows the prefab container to be opened if it was collapsed during propagation. - if (!isExpanded) + if (isExpanded) { - return; - } + // Use the same color as the background. + QColor backgroundColor = m_backgroundColor; + if (isSelected) + { + backgroundColor = m_backgroundSelectedColor; + } + else if (isHovered) + { + backgroundColor = m_backgroundHoverColor; + } - // Use the same color as the background. - QColor backgroundColor = m_backgroundColor; - if (isSelected) - { - backgroundColor = m_backgroundSelectedColor; - } - else if (isHovered) - { - backgroundColor = m_backgroundHoverColor; - } + // Paint a rect to cover up the expander. + QRect rect = QRect(0, 0, 16, 16); + rect.translate(option.rect.topLeft() + offset); + painter->fillRect(rect, backgroundColor); - // Paint a rect to cover up the expander. - QRect rect = QRect(0, 0, 16, 16); - rect.translate(option.rect.topLeft() + offset); - painter->fillRect(rect, backgroundColor); - - // Paint the icon. - QIcon closeIcon = QIcon(m_prefabEditCloseIconPath); - painter->drawPixmap(option.rect.topLeft() + offset, closeIcon.pixmap(iconSize)); + // Paint the icon. + QIcon closeIcon = QIcon(m_prefabEditCloseIconPath); + painter->drawPixmap(option.rect.topLeft() + offset, closeIcon.pixmap(iconSize)); + } } else { // Only show the edit icon on hover. - if (!isHovered) + if (isHovered) { - return; + QIcon openIcon = QIcon(m_prefabEditOpenIconPath); + painter->drawPixmap(option.rect.topLeft() + offset, openIcon.pixmap(iconSize)); } - - QIcon openIcon = QIcon(m_prefabEditOpenIconPath); - painter->drawPixmap(option.rect.topLeft() + offset, openIcon.pixmap(iconSize)); } painter->restore(); From dc598a8b3cadd4aeaf60b0ad8ef3441185a8e079 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sun, 30 Jan 2022 00:33:02 -0600 Subject: [PATCH 366/394] =?UTF-8?q?Atom=20Tools:=20move=20boilerplate=20do?= =?UTF-8?q?cument=20management=20code=20to=20atom=20tools=20framework=20?= =?UTF-8?q?=E2=80=A2=20Moved=20all=20of=20the=20common=20save=20and=20load?= =?UTF-8?q?=20code=20to=20the=20document=20base=20class=20=E2=80=A2=20Move?= =?UTF-8?q?d=20undo=20and=20redo=20support=20to=20document=20base=20class?= =?UTF-8?q?=20but=20will=20probably=20extract=20to=20its=20own=20class=20o?= =?UTF-8?q?r=20replace=20with=20one=20from=20AzTF=20=E2=80=A2=20Streamline?= =?UTF-8?q?d=20material=20editor,=20shader=20management=20console,=20and?= =?UTF-8?q?=20other=20tools=20with=20updated=20document=20code=20=E2=80=A2?= =?UTF-8?q?=20Cleaned=20up=20some=20of=20shader=20management=20console=20l?= =?UTF-8?q?oading=20code,=20added=20support=20for=20saving,=20as=20well=20?= =?UTF-8?q?as=20getting=20and=20setting=20the=20shader=20variant=20list=20?= =?UTF-8?q?source=20data=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guthrie Adams --- .../Document/AtomToolsDocument.h | 54 +- .../Document/AtomToolsDocumentRequestBus.h | 3 - .../DynamicProperty/DynamicProperty.h | 2 +- .../Source/Document/AtomToolsDocument.cpp | 269 ++++++++-- .../AtomToolsDocumentSystemComponent.cpp | 1 - .../Code/Source/Document/MaterialDocument.cpp | 486 +++++------------- .../Code/Source/Document/MaterialDocument.h | 61 +-- .../Viewport/MaterialViewportComponent.cpp | 24 +- .../MaterialInspector/MaterialInspector.h | 3 +- .../ViewportSettingsInspector.h | 3 +- .../ShaderManagementConsoleDocument.cpp | 185 ++++--- .../ShaderManagementConsoleDocument.h | 37 +- ...haderManagementConsoleDocumentRequestBus.h | 14 +- .../ShaderManagementConsoleApplication.cpp | 2 + .../Window/ShaderManagementConsoleWindow.cpp | 2 - 15 files changed, 569 insertions(+), 577 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h index bf18d36c2c..b7188286a1 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h @@ -7,8 +7,9 @@ */ #pragma once -#include #include +#include +#include namespace AtomToolsFramework { @@ -17,6 +18,7 @@ namespace AtomToolsFramework */ class AtomToolsDocument : public AtomToolsDocumentRequestBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler { public: AZ_RTTI(AtomToolsDocument, "{8992DF74-88EC-438C-B280-6E71D4C0880B}"); @@ -28,10 +30,8 @@ namespace AtomToolsFramework const AZ::Uuid& GetId() const; - //////////////////////////////////////////////////////////////////////// - // AtomToolsDocumentRequestBus::Handler implementation + // AtomToolsDocumentRequestBus::Handler overrides... AZStd::string_view GetAbsolutePath() const override; - AZStd::string_view GetRelativePath() const override; const AZStd::any& GetPropertyValue(const AZ::Name& propertyId) const override; const AtomToolsFramework::DynamicProperty& GetProperty(const AZ::Name& propertyId) const override; bool IsPropertyGroupVisible(const AZ::Name& propertyGroupFullName) const override; @@ -51,21 +51,59 @@ namespace AtomToolsFramework bool Redo() override; bool BeginEdit() override; bool EndEdit() override; - //////////////////////////////////////////////////////////////////////// protected: + virtual void Clear(); + + virtual bool OpenSucceeded(); + virtual bool OpenFailed(); + + virtual bool ReopenRecordState(); + virtual bool ReopenRestoreState(); + + virtual bool SaveSucceeded(); + virtual bool SaveFailed(); // Unique id of this document AZ::Uuid m_id = AZ::Uuid::CreateRandom(); - // Relative path to the material source file - AZStd::string m_relativePath; - // Absolute path to the material source file AZStd::string m_absolutePath; + AZStd::string m_savePathNormalized; + AZStd::any m_invalidValue; AtomToolsFramework::DynamicProperty m_invalidProperty; + + // Set of assets that can trigger a document reload + AZStd::unordered_set m_sourceDependencies; + + // Track if document saved itself last to skip external modification notification + bool m_saveTriggeredInternally = false; + + // Variables needed for tracking the undo and redo state of this document + + // Function to be bound for undo and redo + using UndoRedoFunction = AZStd::function; + + // A pair of functions, where first is the undo operation and second is the redo operation + using UndoRedoFunctionPair = AZStd::pair; + + // Container for all of the active undo and redo functions and state + using UndoRedoHistory = AZStd::vector; + + // Container of undo commands + UndoRedoHistory m_undoHistory; + UndoRedoHistory m_undoHistoryBeforeReopen; + + // The current position in the undo redo history + int m_undoHistoryIndex = {}; + int m_undoHistoryIndexBeforeReopen = {}; + + void AddUndoRedoHistory(const UndoRedoFunction& undoCommand, const UndoRedoFunction& redoCommand); + + // AzToolsFramework::AssetSystemBus::Handler overrides... + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid sourceUUID) override; }; } // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentRequestBus.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentRequestBus.h index 6a21a8a2df..b6b3f65110 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentRequestBus.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentRequestBus.h @@ -25,9 +25,6 @@ namespace AtomToolsFramework //! Get absolute path of document virtual AZStd::string_view GetAbsolutePath() const = 0; - //! Get relative path of document - virtual AZStd::string_view GetRelativePath() const = 0; - //! Return property value //! If the document is not open or the id can't be found, an invalid value is returned instead. virtual const AZStd::any& GetPropertyValue(const AZ::Name& propertyFullName) const = 0; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h index 68e5e38cbd..5af0fcc845 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h @@ -111,7 +111,7 @@ namespace AtomToolsFramework AZStd::string GetDescription() const; AZStd::vector> GetEnumValues() const; - // Handles changes from the ReflectedPropertyEditor and sends notification to the material document. + // Handles changes from the ReflectedPropertyEditor and sends notification. AZ::u32 OnDataChanged() const; template diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp index 1e2c685c3c..5941360b5d 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp @@ -6,8 +6,10 @@ * */ +#include #include #include +#include namespace AtomToolsFramework { @@ -19,6 +21,7 @@ namespace AtomToolsFramework AtomToolsDocument::~AtomToolsDocument() { + AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsDocumentNotificationBus::Events::OnDocumentDestroyed, m_id); AtomToolsDocumentRequestBus::Handler::BusDisconnect(); } @@ -33,11 +36,6 @@ namespace AtomToolsFramework return m_absolutePath; } - AZStd::string_view AtomToolsDocument::GetRelativePath() const - { - return m_relativePath; - } - const AZStd::any& AtomToolsDocument::GetPropertyValue([[maybe_unused]] const AZ::Name& propertyId) const { AZ_UNUSED(propertyId); @@ -66,49 +64,140 @@ namespace AtomToolsFramework AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); } - bool AtomToolsDocument::Open([[maybe_unused]] AZStd::string_view loadPath) + bool AtomToolsDocument::Open(AZStd::string_view loadPath) { - AZ_UNUSED(loadPath); - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); - return false; + Clear(); + + m_absolutePath = loadPath; + if (!AzFramework::StringFunc::Path::Normalize(m_absolutePath)) + { + AZ_Error("AtomToolsDocument", false, "Document path could not be normalized: '%s'.", m_absolutePath.c_str()); + return OpenFailed(); + } + + if (AzFramework::StringFunc::Path::IsRelative(m_absolutePath.c_str())) + { + AZ_Error("AtomToolsDocument", false, "Document path must be absolute: '%s'.", m_absolutePath.c_str()); + return OpenFailed(); + } + + return true; } bool AtomToolsDocument::Reopen() { - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); - return false; + if (!ReopenRecordState()) + { + return false; + } + + const auto loadPath = m_absolutePath; + if (!Open(loadPath)) + { + return false; + } + + if (!ReopenRestoreState()) + { + return false; + } + + return true; } bool AtomToolsDocument::Save() { - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); - return false; + m_savePathNormalized = m_absolutePath; + if (!AzFramework::StringFunc::Path::Normalize(m_savePathNormalized)) + { + AZ_Error("AtomToolsDocument", false, "Document save path could not be normalized: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); + } + + if (!IsOpen()) + { + AZ_Error("AtomToolsDocument", false, "Document is not open to be saved: '%s'.", m_absolutePath.c_str()); + return SaveFailed(); + } + + if (!IsSavable()) + { + AZ_Error("AtomToolsDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str()); + return SaveFailed(); + } + + return true; } - bool AtomToolsDocument::SaveAsCopy([[maybe_unused]] AZStd::string_view savePath) + bool AtomToolsDocument::SaveAsCopy(AZStd::string_view savePath) { - AZ_UNUSED(savePath); - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); - return false; + m_savePathNormalized = savePath; + if (!AzFramework::StringFunc::Path::Normalize(m_savePathNormalized)) + { + AZ_Error("AtomToolsDocument", false, "Document save path could not be normalized: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); + } + + if (!IsOpen()) + { + AZ_Error("AtomToolsDocument", false, "Document is not open to be saved: '%s'.", m_absolutePath.c_str()); + return SaveFailed(); + } + + if (!IsSavable()) + { + AZ_Error("AtomToolsDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str()); + return SaveFailed(); + } + + return true; } - - bool AtomToolsDocument::SaveAsChild([[maybe_unused]] AZStd::string_view savePath) + bool AtomToolsDocument::SaveAsChild(AZStd::string_view savePath) { - AZ_UNUSED(savePath); - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); - return false; + m_savePathNormalized = savePath; + if (!AzFramework::StringFunc::Path::Normalize(m_savePathNormalized)) + { + AZ_Error("AtomToolsDocument", false, "Document save path could not be normalized: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); + } + + if (!IsOpen()) + { + AZ_Error("AtomToolsDocument", false, "Document is not open to be saved: '%s'.", m_absolutePath.c_str()); + return SaveFailed(); + } + + if (m_absolutePath == m_savePathNormalized || m_sourceDependencies.find(m_savePathNormalized) != m_sourceDependencies.end()) + { + AZ_Error("AtomToolsDocument", false, "Document can't be saved over a dependancy: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); + } + + return true; } bool AtomToolsDocument::Close() { - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); - return false; + if (!IsOpen()) + { + AZ_Error("AtomToolsDocument", false, "Document is not open."); + return false; + } + + AZ_TracePrintf("AtomToolsDocument", "Document closed: '%s'.\n", m_absolutePath.c_str()); + + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentClosed, m_id); + + // Clearing after notification so paths are still available + Clear(); + return true; } bool AtomToolsDocument::IsOpen() const { - return false; + return !m_id.IsNull() && !m_absolutePath.empty(); } bool AtomToolsDocument::IsModified() const @@ -123,23 +212,41 @@ namespace AtomToolsFramework bool AtomToolsDocument::CanUndo() const { - return false; + // Undo will only be allowed if something has been recorded and we're not at the beginning of history + return IsOpen() && !m_undoHistory.empty() && m_undoHistoryIndex > 0; } bool AtomToolsDocument::CanRedo() const { - return false; + // Redo will only be allowed if something has been recorded and we're not at the end of history + return IsOpen() && !m_undoHistory.empty() && m_undoHistoryIndex < m_undoHistory.size(); } bool AtomToolsDocument::Undo() { - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); + if (CanUndo()) + { + // The history index is one beyond the last executed command. Decrement the index then execute undo. + m_undoHistory[--m_undoHistoryIndex].first(); + AZ_TracePrintf("AtomToolsDocument", "Document undo: '%s'.\n", m_absolutePath.c_str()); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); + return true; + } return false; } bool AtomToolsDocument::Redo() { - AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); + if (CanRedo()) + { + // Execute the current redo command then move the history index to the next position. + m_undoHistory[m_undoHistoryIndex++].second(); + AZ_TracePrintf("AtomToolsDocument", "Document redo: '%s'.\n", m_absolutePath.c_str()); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); + return true; + } return false; } @@ -154,4 +261,108 @@ namespace AtomToolsFramework AZ_Error("AtomToolsDocument", false, "%s not implemented.", __FUNCTION__); return false; } + + void AtomToolsDocument::Clear() + { + AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); + + m_absolutePath.clear(); + m_sourceDependencies.clear(); + m_saveTriggeredInternally = {}; + m_undoHistory.clear(); + m_undoHistoryIndex = {}; + } + + bool AtomToolsDocument::OpenSucceeded() + { + AZ_TracePrintf("AtomToolsDocument", "Document opened: '%s'.\n", m_absolutePath.c_str()); + AzToolsFramework::AssetSystemBus::Handler::BusConnect(); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentOpened, m_id); + return true; + } + + bool AtomToolsDocument::OpenFailed() + { + AZ_TracePrintf("AtomToolsDocument", "Document could not opened: '%s'.\n", m_absolutePath.c_str()); + Clear(); + return false; + } + + bool AtomToolsDocument::ReopenRecordState() + { + // Store history and property changes that should be reapplied after reload + m_undoHistoryBeforeReopen = m_undoHistory; + m_undoHistoryIndexBeforeReopen = m_undoHistoryIndex; + return true; + } + + bool AtomToolsDocument::ReopenRestoreState() + { + m_undoHistory = m_undoHistoryBeforeReopen; + m_undoHistoryIndex = m_undoHistoryIndexBeforeReopen; + m_undoHistoryBeforeReopen = {}; + m_undoHistoryIndexBeforeReopen = {}; + return true; + } + + bool AtomToolsDocument::SaveSucceeded() + { + m_saveTriggeredInternally = true; + + AZ_TracePrintf("AtomToolsDocument", "Document saved: '%s'.\n", m_savePathNormalized.c_str()); + + // Auto add or checkout saved file + AzToolsFramework::SourceControlCommandBus::Broadcast( + &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, m_savePathNormalized.c_str(), true, + [](bool, const AzToolsFramework::SourceControlFileInfo&) {}); + + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentSaved, m_id); + return true; + } + + bool AtomToolsDocument::SaveFailed() + { + AZ_TracePrintf("AtomToolsDocument", "Document not saved: '%s'.\n", m_savePathNormalized.c_str()); + return false; + } + + void AtomToolsDocument::AddUndoRedoHistory(const UndoRedoFunction& undoCommand, const UndoRedoFunction& redoCommand) + { + // Wipe any state beyond the current history index + m_undoHistory.erase(m_undoHistory.begin() + m_undoHistoryIndex, m_undoHistory.end()); + + // Add undo and redo operations using functions that capture state and restore it when executed + m_undoHistory.emplace_back(undoCommand, redoCommand); + + // Assign the index to the end of history + m_undoHistoryIndex = aznumeric_cast(m_undoHistory.size()); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); + } + + void AtomToolsDocument::SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid sourceUUID) + { + const auto sourcePath = AZ::RPI::AssetUtils::ResolvePathReference(scanFolder, relativePath); + + if (m_absolutePath == sourcePath) + { + // ignore notifications caused by saving the open document + if (!m_saveTriggeredInternally) + { + AZ_TracePrintf("AtomToolsDocument", "Document changed externally: '%s'.\n", m_absolutePath.c_str()); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentExternallyModified, m_id); + } + m_saveTriggeredInternally = false; + } + else if (m_sourceDependencies.find(sourcePath) != m_sourceDependencies.end()) + { + AZ_TracePrintf("AtomToolsDocument", "Document dependency changed: '%s'.\n", m_absolutePath.c_str()); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentDependencyModified, m_id); + } + } + } // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp index d554c68451..b5a3f5322c 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp @@ -77,7 +77,6 @@ namespace AtomToolsFramework ->Attribute(AZ::Script::Attributes::Category, "Editor") ->Attribute(AZ::Script::Attributes::Module, "atomtools") ->Event("GetAbsolutePath", &AtomToolsDocumentRequestBus::Events::GetAbsolutePath) - ->Event("GetRelativePath", &AtomToolsDocumentRequestBus::Events::GetRelativePath) ->Event("GetPropertyValue", &AtomToolsDocumentRequestBus::Events::GetPropertyValue) ->Event("SetPropertyValue", &AtomToolsDocumentRequestBus::Events::SetPropertyValue) ->Event("Open", &AtomToolsDocumentRequestBus::Events::Open) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index c441762710..a8404baec1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -12,16 +12,11 @@ #include #include #include -#include -#include -#include #include #include #include #include #include -#include -#include #include namespace MaterialEditor @@ -30,14 +25,12 @@ namespace MaterialEditor : AtomToolsFramework::AtomToolsDocument() { MaterialDocumentRequestBus::Handler::BusConnect(m_id); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentCreated, m_id); } MaterialDocument::~MaterialDocument() { - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentDestroyed, m_id); MaterialDocumentRequestBus::Handler::BusDisconnect(); - Clear(); + AZ::TickBus::Handler::BusDisconnect(); } AZ::Data::Asset MaterialDocument::GetAsset() const @@ -62,19 +55,16 @@ namespace MaterialEditor const AZStd::any& MaterialDocument::GetPropertyValue(const AZ::Name& propertyId) const { - using namespace AZ; - using namespace RPI; - if (!IsOpen()) { - AZ_Error("MaterialDocument", false, "Material document is not open."); + AZ_Error("MaterialDocument", false, "Document is not open."); return m_invalidValue; } const auto it = m_properties.find(propertyId); if (it == m_properties.end()) { - AZ_Error("MaterialDocument", false, "Material document property could not be found: '%s'.", propertyId.GetCStr()); + AZ_Error("MaterialDocument", false, "Document property could not be found: '%s'.", propertyId.GetCStr()); return m_invalidValue; } @@ -86,14 +76,14 @@ namespace MaterialEditor { if (!IsOpen()) { - AZ_Error("MaterialDocument", false, "Material document is not open."); + AZ_Error("MaterialDocument", false, "Document is not open."); return m_invalidProperty; } const auto it = m_properties.find(propertyId); if (it == m_properties.end()) { - AZ_Error("MaterialDocument", false, "Material document property could not be found: '%s'.", propertyId.GetCStr()); + AZ_Error("MaterialDocument", false, "Document property could not be found: '%s'.", propertyId.GetCStr()); return m_invalidProperty; } @@ -105,14 +95,14 @@ namespace MaterialEditor { if (!IsOpen()) { - AZ_Error("MaterialDocument", false, "Material document is not open."); + AZ_Error("MaterialDocument", false, "Document is not open."); return false; } const auto it = m_propertyGroupVisibility.find(propertyGroupFullName); if (it == m_propertyGroupVisibility.end()) { - AZ_Error("MaterialDocument", false, "Material document property group could not be found: '%s'.", propertyGroupFullName.GetCStr()); + AZ_Error("MaterialDocument", false, "Document property group could not be found: '%s'.", propertyGroupFullName.GetCStr()); return false; } @@ -121,25 +111,21 @@ namespace MaterialEditor void MaterialDocument::SetPropertyValue(const AZ::Name& propertyId, const AZStd::any& value) { - using namespace AZ; - using namespace RPI; - if (!IsOpen()) { - AZ_Error("MaterialDocument", false, "Material document is not open."); + AZ_Error("MaterialDocument", false, "Document is not open."); return; } const auto it = m_properties.find(propertyId); if (it == m_properties.end()) { - AZ_Error("MaterialDocument", false, "Material document property could not be found: '%s'.", propertyId.GetCStr()); + AZ_Error("MaterialDocument", false, "Document property could not be found: '%s'.", propertyId.GetCStr()); return; } // This first converts to an acceptable runtime type in case the value came from script - const AZ::RPI::MaterialPropertyValue propertyValue = - AtomToolsFramework::ConvertToRuntimeType(value); + const AZ::RPI::MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(value); AtomToolsFramework::DynamicProperty& property = it->second; property.SetValue(AtomToolsFramework::ConvertToEditableType(propertyValue)); @@ -149,88 +135,41 @@ namespace MaterialEditor { if (m_materialInstance->SetPropertyValue(propertyIndex, propertyValue)) { - MaterialPropertyFlags dirtyFlags = m_materialInstance->GetPropertyDirtyFlags(); + AZ::RPI::MaterialPropertyFlags dirtyFlags = m_materialInstance->GetPropertyDirtyFlags(); Recompile(); EditorMaterialFunctorResult result = RunEditorMaterialFunctors(dirtyFlags); - for (const Name& changedPropertyGroupName : result.m_updatedPropertyGroups) + for (const AZ::Name& changedPropertyGroupName : result.m_updatedPropertyGroups) { - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentPropertyGroupVisibilityChanged, m_id, changedPropertyGroupName, IsPropertyGroupVisible(changedPropertyGroupName)); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentPropertyGroupVisibilityChanged, m_id, + changedPropertyGroupName, IsPropertyGroupVisible(changedPropertyGroupName)); } - for (const Name& changedPropertyName : result.m_updatedProperties) + for (const AZ::Name& changedPropertyName : result.m_updatedProperties) { - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentPropertyConfigModified, m_id, GetProperty(changedPropertyName)); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentPropertyConfigModified, m_id, + GetProperty(changedPropertyName)); } } } - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentPropertyValueModified, m_id, property); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentModified, m_id); - } - - bool MaterialDocument::Open(AZStd::string_view loadPath) - { - if (!OpenInternal(loadPath)) - { - Clear(); - AZ_Error("MaterialDocument", false, "Material document could not be opened: '%s'.", loadPath.data()); - return false; - } - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentOpened, m_id); - return true; - } - - bool MaterialDocument::Reopen() - { - // Store history and property changes that should be reapplied after reload - auto undoHistoryToRestore = m_undoHistory; - auto undoHistoryIndexToRestore = m_undoHistoryIndex; - PropertyValueMap propertyValuesToRestore; - for (const auto& propertyPair : m_properties) - { - const AtomToolsFramework::DynamicProperty& property = propertyPair.second; - if (!AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_parentValue)) - { - propertyValuesToRestore[property.GetId()] = property.GetValue(); - } - } - - // Reopen the same document - const AZStd::string loadPath = m_absolutePath; - if (!OpenInternal(loadPath)) - { - Clear(); - return false; - } - - RestorePropertyValues(propertyValuesToRestore); - AZStd::swap(undoHistoryToRestore, m_undoHistory); - AZStd::swap(undoHistoryIndexToRestore, m_undoHistoryIndex); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentOpened, m_id); - return true; + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentPropertyValueModified, m_id, property); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentModified, m_id); } bool MaterialDocument::Save() { - using namespace AZ; - using namespace RPI; - - if (!IsOpen()) + if (!AtomToolsDocument::Save()) { - AZ_Error("MaterialDocument", false, "Material document is not open to be saved: '%s'.", m_absolutePath.c_str()); - return false; - } - - if (!IsSavable()) - { - AZ_Error("MaterialDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str()); return false; } // create source data from properties - MaterialSourceData sourceData; + AZ::RPI::MaterialSourceData sourceData; sourceData.m_materialTypeVersion = m_materialAsset->GetMaterialTypeAsset()->GetVersion(); sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(m_absolutePath, m_materialSourceData.m_materialType); sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(m_absolutePath, m_materialSourceData.m_parentMaterial); @@ -243,14 +182,14 @@ namespace MaterialEditor if (!savedProperties) { - return false; + return SaveFailed(); } // write sourceData to .material file if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_absolutePath, sourceData)) { - AZ_Error("MaterialDocument", false, "Material document could not be saved: '%s'.", m_absolutePath.c_str()); - return false; + AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_absolutePath.c_str()); + return SaveFailed(); } // after saving, reset to a clean state @@ -262,181 +201,97 @@ namespace MaterialEditor property.SetConfig(propertyConfig); } - // Auto add or checkout saved file - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, - m_absolutePath.c_str(), true, [](bool, const AzToolsFramework::SourceControlFileInfo&) {}); - - AZ_TracePrintf("MaterialDocument", "Material document saved: '%s'.\n", m_absolutePath.data()); - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentSaved, m_id); - - m_saveTriggeredInternally = true; - return true; + return SaveSucceeded(); } bool MaterialDocument::SaveAsCopy(AZStd::string_view savePath) { - using namespace AZ; - using namespace RPI; - - if (!IsOpen()) + if (!AtomToolsDocument::SaveAsCopy(savePath)) { - AZ_Error("MaterialDocument", false, "Material document is not open to be saved: '%s'.", m_absolutePath.c_str()); - return false; - } - - if (!IsSavable()) - { - AZ_Error("MaterialDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str()); - return false; - } - - AZStd::string normalizedSavePath = savePath; - if (!AzFramework::StringFunc::Path::Normalize(normalizedSavePath)) - { - AZ_Error("MaterialDocument", false, "Material document save path could not be normalized: '%s'.", normalizedSavePath.c_str()); return false; } // create source data from properties - MaterialSourceData sourceData; + AZ::RPI::MaterialSourceData sourceData; sourceData.m_materialTypeVersion = m_materialAsset->GetMaterialTypeAsset()->GetVersion(); - sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(normalizedSavePath, m_materialSourceData.m_materialType); - sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(normalizedSavePath, m_materialSourceData.m_parentMaterial); + sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_materialSourceData.m_materialType); + sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_materialSourceData.m_parentMaterial); // populate sourceData with modified or overwritten properties - const bool savedProperties = SavePropertiesToSourceData(normalizedSavePath, sourceData, [](const AtomToolsFramework::DynamicProperty& property) + const bool savedProperties = SavePropertiesToSourceData(m_savePathNormalized, sourceData, [](const AtomToolsFramework::DynamicProperty& property) { return !AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_parentValue); }); if (!savedProperties) { - return false; + return SaveFailed(); } // write sourceData to .material file - if (!AZ::RPI::JsonUtils::SaveObjectToFile(normalizedSavePath, sourceData)) + if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) { - AZ_Error("MaterialDocument", false, "Material document could not be saved: '%s'.", normalizedSavePath.c_str()); - return false; + AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); } - // Auto add or checkout saved file - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, - normalizedSavePath.c_str(), true, [](bool, const AzToolsFramework::SourceControlFileInfo&) {}); - - AZ_TracePrintf("MaterialDocument", "Material document saved: '%s'.\n", normalizedSavePath.c_str()); - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentSaved, m_id); - // If the document is saved to a new file we need to reopen the new document to update assets, paths, property deltas. - if (!Open(normalizedSavePath)) + if (!Open(m_savePathNormalized)) { - return false; + return SaveFailed(); } - // Setting flag after reopening becausse it's cleared on open - m_saveTriggeredInternally = true; - return true; + return SaveSucceeded(); } bool MaterialDocument::SaveAsChild(AZStd::string_view savePath) { - using namespace AZ; - using namespace RPI; - - if (!IsOpen()) + if (!AtomToolsDocument::SaveAsChild(savePath)) { - AZ_Error("MaterialDocument", false, "Material document is not open to be saved: '%s'.", m_absolutePath.c_str()); - return false; - } - - AZStd::string normalizedSavePath = savePath; - if (!AzFramework::StringFunc::Path::Normalize(normalizedSavePath)) - { - AZ_Error("MaterialDocument", false, "Material document save path could not be normalized: '%s'.", normalizedSavePath.c_str()); - return false; - } - - if (m_absolutePath == normalizedSavePath) - { - // ToDo: this should scan the entire hierarchy so we don't overwrite parent's parent, for example - AZ_Error("MaterialDocument", false, "Can't overwrite parent material with a child that depends on it."); return false; } // create source data from properties - MaterialSourceData sourceData; + AZ::RPI::MaterialSourceData sourceData; sourceData.m_materialTypeVersion = m_materialAsset->GetMaterialTypeAsset()->GetVersion(); - sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(normalizedSavePath, m_materialSourceData.m_materialType); + sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_materialSourceData.m_materialType); // Only assign a parent path if the source was a .material - if (AzFramework::StringFunc::Path::IsExtension(m_relativePath.c_str(), MaterialSourceData::Extension)) + if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), AZ::RPI::MaterialSourceData::Extension)) { - sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(normalizedSavePath, m_absolutePath); + sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_absolutePath); } // populate sourceData with modified properties - const bool savedProperties = SavePropertiesToSourceData(normalizedSavePath, sourceData, [](const AtomToolsFramework::DynamicProperty& property) + const bool savedProperties = SavePropertiesToSourceData(m_savePathNormalized, sourceData, [](const AtomToolsFramework::DynamicProperty& property) { return !AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_originalValue); }); if (!savedProperties) { - return false; + return SaveFailed(); } // write sourceData to .material file - if (!AZ::RPI::JsonUtils::SaveObjectToFile(normalizedSavePath, sourceData)) + if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) { - AZ_Error("MaterialDocument", false, "Material document could not be saved: '%s'.", normalizedSavePath.c_str()); - return false; + AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); } - // Auto add or checkout saved file - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, - normalizedSavePath.c_str(), true, [](bool, const AzToolsFramework::SourceControlFileInfo&) {}); - - AZ_TracePrintf("MaterialDocument", "Material document saved: '%s'.\n", normalizedSavePath.c_str()); - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentSaved, m_id); - // If the document is saved to a new file we need to reopen the new document to update assets, paths, property deltas. - if (!Open(normalizedSavePath)) + if (!Open(m_savePathNormalized)) { - return false; + return SaveFailed(); } - // Setting flag after reopening becausse it's cleared on open - m_saveTriggeredInternally = true; - return true; - } - - bool MaterialDocument::Close() - { - using namespace AZ; - using namespace RPI; - - if (!IsOpen()) - { - AZ_Error("MaterialDocument", false, "Material document is not open."); - return false; - } - - AZ_TracePrintf("MaterialDocument", "Material document closed: '%s'.\n", m_absolutePath.c_str()); - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentClosed, m_id); - - // Clearing after notification so paths are still available - Clear(); - return true; + return SaveSucceeded(); } bool MaterialDocument::IsOpen() const { - return !m_absolutePath.empty() && !m_relativePath.empty() && m_materialAsset.IsReady() && m_materialInstance; + return AtomToolsDocument::IsOpen() && m_materialAsset.IsReady() && m_materialInstance; } bool MaterialDocument::IsModified() const @@ -454,44 +309,6 @@ namespace MaterialEditor return AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), AZ::RPI::MaterialSourceData::Extension); } - bool MaterialDocument::CanUndo() const - { - // Undo will only be allowed if something has been recorded and we're not at the beginning of history - return IsOpen() && !m_undoHistory.empty() && m_undoHistoryIndex > 0; - } - - bool MaterialDocument::CanRedo() const - { - // Redo will only be allowed if something has been recorded and we're not at the end of history - return IsOpen() && !m_undoHistory.empty() && m_undoHistoryIndex < m_undoHistory.size(); - } - - bool MaterialDocument::Undo() - { - if (CanUndo()) - { - // The history index is one beyond the last executed command. Decrement the index then execute undo. - m_undoHistory[--m_undoHistoryIndex].first(); - AZ_TracePrintf("MaterialDocument", "Material document undo: '%s'.\n", m_absolutePath.c_str()); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); - return true; - } - return false; - } - - bool MaterialDocument::Redo() - { - if (CanRedo()) - { - // Execute the current redo command then move the history index to the next position. - m_undoHistory[m_undoHistoryIndex++].second(); - AZ_TracePrintf("MaterialDocument", "Material document redo: '%s'.\n", m_absolutePath.c_str()); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); - return true; - } - return false; - } - bool MaterialDocument::BeginEdit() { // Save the current properties as a momento for undo before any changes are applied @@ -524,17 +341,9 @@ namespace MaterialEditor if (!propertyValuesForUndo.empty() && !propertyValuesForRedo.empty()) { - // Wipe any state beyond the current history index - m_undoHistory.erase(m_undoHistory.begin() + m_undoHistoryIndex, m_undoHistory.end()); - - // Add undo and redo operations using lambdas that will capture property state and restore it when executed - m_undoHistory.emplace_back( + AddUndoRedoHistory( [this, propertyValuesForUndo]() { RestorePropertyValues(propertyValuesForUndo); }, [this, propertyValuesForRedo]() { RestorePropertyValues(propertyValuesForRedo); }); - - // Assign the index to the end of history - m_undoHistoryIndex = aznumeric_cast(m_undoHistory.size()); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); } m_propertyValuesBeforeEdit.clear(); @@ -553,51 +362,25 @@ namespace MaterialEditor } } - void MaterialDocument::SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid sourceUUID) - { - const auto sourcePath = AZ::RPI::AssetUtils::ResolvePathReference(scanFolder, relativePath); - - if (m_absolutePath == sourcePath) - { - // ignore notifications caused by saving the open document - if (!m_saveTriggeredInternally) - { - AZ_TracePrintf("MaterialDocument", "Material document changed externally: '%s'.\n", m_absolutePath.c_str()); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( - &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentExternallyModified, m_id); - } - m_saveTriggeredInternally = false; - } - else if (m_sourceDependencies.find(sourcePath) != m_sourceDependencies.end()) - { - AZ_TracePrintf("MaterialDocument", "Material document dependency changed: '%s'.\n", m_absolutePath.c_str()); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( - &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentDependencyModified, m_id); - } - } - bool MaterialDocument::SavePropertiesToSourceData( const AZStd::string& exportPath, AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const { - using namespace AZ; - using namespace RPI; - bool result = true; // populate sourceData with properties that meet the filter m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { - Name propertyId{propertyIdContext + propertyDefinition->GetName()}; + AZ::Name propertyId{propertyIdContext + propertyDefinition->GetName()}; const auto it = m_properties.find(propertyId); if (it != m_properties.end() && propertyFilter(it->second)) { - MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); + AZ::RPI::MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); if (propertyValue.IsValid()) { if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId, *propertyDefinition, propertyValue)) { - AZ_Error("MaterialDocument", false, "Material document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); + AZ_Error("MaterialDocument", false, "Document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); result = false; return false; } @@ -613,52 +396,21 @@ namespace MaterialEditor return result; } - bool MaterialDocument::OpenInternal(AZStd::string_view loadPath) + bool MaterialDocument::Open(AZStd::string_view loadPath) { - using namespace AZ; - using namespace RPI; - - Clear(); - - m_absolutePath = loadPath; - if (!AzFramework::StringFunc::Path::Normalize(m_absolutePath)) + if (!AtomToolsDocument::Open(loadPath)) { - AZ_Error("MaterialDocument", false, "Material document path could not be normalized: '%s'.", m_absolutePath.c_str()); - return false; - } - - if (AzFramework::StringFunc::Path::IsRelative(m_absolutePath.c_str())) - { - AZ_Error("MaterialDocument", false, "Material document path must be absolute: '%s'.", m_absolutePath.c_str()); - return false; - } - - bool result = false; - Data::AssetInfo sourceAssetInfo; - AZStd::string watchFolder; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(result, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, - m_absolutePath.c_str(), sourceAssetInfo, watchFolder); - if (!result) - { - AZ_Error("MaterialDocument", false, "Could not find source material: '%s'.", m_absolutePath.c_str()); - return false; - } - - m_relativePath = sourceAssetInfo.m_relativePath; - if (!AzFramework::StringFunc::Path::Normalize(m_relativePath)) - { - AZ_Error("MaterialDocument", false, "Material document path could not be normalized: '%s'.", m_relativePath.c_str()); return false; } // The material document and inspector are constructed from source data - if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), MaterialSourceData::Extension)) + if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), AZ::RPI::MaterialSourceData::Extension)) { // Load the material source data so that we can check properties and create a material asset from it if (!AZ::RPI::JsonUtils::LoadObjectFromFile(m_absolutePath, m_materialSourceData)) { AZ_Error("MaterialDocument", false, "Material source data could not be loaded: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } // We always need the absolute path for the material type and parent material to load source data and resolving @@ -666,33 +418,34 @@ namespace MaterialEditor if (!m_materialSourceData.m_parentMaterial.empty()) { m_materialSourceData.m_parentMaterial = - AssetUtils::ResolvePathReference(m_absolutePath, m_materialSourceData.m_parentMaterial); + AZ::RPI::AssetUtils::ResolvePathReference(m_absolutePath, m_materialSourceData.m_parentMaterial); } if (!m_materialSourceData.m_materialType.empty()) { - m_materialSourceData.m_materialType = AssetUtils::ResolvePathReference(m_absolutePath, m_materialSourceData.m_materialType); + m_materialSourceData.m_materialType = + AZ::RPI::AssetUtils::ResolvePathReference(m_absolutePath, m_materialSourceData.m_materialType); } // Load the material type source data which provides the layout and default values of all of the properties - auto materialTypeOutcome = MaterialUtils::LoadMaterialTypeSourceData(m_materialSourceData.m_materialType); + auto materialTypeOutcome = AZ::RPI::MaterialUtils::LoadMaterialTypeSourceData(m_materialSourceData.m_materialType); if (!materialTypeOutcome.IsSuccess()) { AZ_Error("MaterialDocument", false, "Material type source data could not be loaded: '%s'.", m_materialSourceData.m_materialType.c_str()); - return false; + return OpenFailed(); } m_materialTypeSourceData = materialTypeOutcome.TakeValue(); } - else if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), MaterialTypeSourceData::Extension)) + else if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), AZ::RPI::MaterialTypeSourceData::Extension)) { // A material document can be created or loaded from material or material type source data. If we are attempting to load // material type source data then the material source data object can be created just by referencing the document path as the // material type path. - auto materialTypeOutcome = MaterialUtils::LoadMaterialTypeSourceData(m_absolutePath); + auto materialTypeOutcome = AZ::RPI::MaterialUtils::LoadMaterialTypeSourceData(m_absolutePath); if (!materialTypeOutcome.IsSuccess()) { AZ_Error("MaterialDocument", false, "Material type source data could not be loaded: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } m_materialTypeSourceData = materialTypeOutcome.TakeValue(); @@ -702,8 +455,8 @@ namespace MaterialEditor } else { - AZ_Error("MaterialDocument", false, "Material document extension not supported: '%s'.", m_absolutePath.c_str()); - return false; + AZ_Error("MaterialDocument", false, "Document extension not supported: '%s'.", m_absolutePath.c_str()); + return OpenFailed(); } const bool elevateWarnings = false; @@ -714,44 +467,44 @@ namespace MaterialEditor // we can create the asset dynamically from the source data. // Long term, the material document should not be concerned with assets at all. The viewport window should be the // only thing concerned with assets or instances. - auto materialAssetResult = - m_materialSourceData.CreateMaterialAssetFromSourceData(Uuid::CreateRandom(), m_absolutePath, elevateWarnings, &m_sourceDependencies); + auto materialAssetResult = m_materialSourceData.CreateMaterialAssetFromSourceData( + AZ::Uuid::CreateRandom(), m_absolutePath, elevateWarnings, &m_sourceDependencies); if (!materialAssetResult) { AZ_Error("MaterialDocument", false, "Material asset could not be created from source data: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } m_materialAsset = materialAssetResult.GetValue(); if (!m_materialAsset.IsReady()) { AZ_Error("MaterialDocument", false, "Material asset is not ready: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } const auto& materialTypeAsset = m_materialAsset->GetMaterialTypeAsset(); if (!materialTypeAsset.IsReady()) { AZ_Error("MaterialDocument", false, "Material type asset is not ready: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } AZStd::span parentPropertyValues = materialTypeAsset->GetDefaultPropertyValues(); - AZ::Data::Asset parentMaterialAsset; + AZ::Data::Asset parentMaterialAsset; if (!m_materialSourceData.m_parentMaterial.empty()) { AZ::RPI::MaterialSourceData parentMaterialSourceData; if (!AZ::RPI::JsonUtils::LoadObjectFromFile(m_materialSourceData.m_parentMaterial, parentMaterialSourceData)) { AZ_Error("MaterialDocument", false, "Material parent source data could not be loaded for: '%s'.", m_materialSourceData.m_parentMaterial.c_str()); - return false; + return OpenFailed(); } - const auto parentMaterialAssetIdResult = AssetUtils::MakeAssetId(m_materialSourceData.m_parentMaterial, 0); + const auto parentMaterialAssetIdResult = AZ::RPI::AssetUtils::MakeAssetId(m_materialSourceData.m_parentMaterial, 0); if (!parentMaterialAssetIdResult) { AZ_Error("MaterialDocument", false, "Material parent asset ID could not be created: '%s'.", m_materialSourceData.m_parentMaterial.c_str()); - return false; + return OpenFailed(); } auto parentMaterialAssetResult = parentMaterialSourceData.CreateMaterialAssetFromSourceData( @@ -759,7 +512,7 @@ namespace MaterialEditor if (!parentMaterialAssetResult) { AZ_Error("MaterialDocument", false, "Material parent asset could not be created from source data: '%s'.", m_materialSourceData.m_parentMaterial.c_str()); - return false; + return OpenFailed(); } parentMaterialAsset = parentMaterialAssetResult.GetValue(); @@ -767,11 +520,11 @@ namespace MaterialEditor } // Creating a material from a material asset will fail if a texture is referenced but not loaded - m_materialInstance = Material::Create(m_materialAsset); + m_materialInstance = AZ::RPI::Material::Create(m_materialAsset); if (!m_materialInstance) { AZ_Error("MaterialDocument", false, "Material instance could not be created: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } // Pipeline State Object changes are always allowed in the material editor because it only runs on developer systems @@ -781,7 +534,7 @@ namespace MaterialEditor // Populate the property map from a combination of source data and assets // Assets must still be used for now because they contain the final accumulated value after all other materials // in the hierarchy are applied - m_materialTypeSourceData.EnumeratePropertyGroups([this, &parentPropertyValues](const AZStd::string& propertyIdContext, const MaterialTypeSourceData::PropertyGroup* propertyGroup) + m_materialTypeSourceData.EnumeratePropertyGroups([this, &parentPropertyValues](const AZStd::string& propertyIdContext, const AZ::RPI::MaterialTypeSourceData::PropertyGroup* propertyGroup) { AtomToolsFramework::DynamicPropertyConfig propertyConfig; @@ -813,7 +566,7 @@ namespace MaterialEditor // Populate the property group visibility map // TODO: Support populating the Material Editor with nested property groups, not just the top level. - for (const AZStd::unique_ptr& propertyGroup : m_materialTypeSourceData.GetPropertyLayout().m_propertyGroups) + for (const AZStd::unique_ptr& propertyGroup : m_materialTypeSourceData.GetPropertyLayout().m_propertyGroups) { m_propertyGroupVisibility[AZ::Name{propertyGroup->GetName()}] = true; } @@ -856,15 +609,15 @@ namespace MaterialEditor m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); //Add UV name customization properties - const RPI::MaterialUvNameMap& uvNameMap = materialTypeAsset->GetUvNameMap(); - for (const RPI::UvNamePair& uvNamePair : uvNameMap) + const AZ::RPI::MaterialUvNameMap& uvNameMap = materialTypeAsset->GetUvNameMap(); + for (const AZ::RPI::UvNamePair& uvNamePair : uvNameMap) { const AZStd::string shaderInput = uvNamePair.m_shaderInput.ToString(); const AZStd::string uvName = uvNamePair.m_uvName.GetStringView(); propertyConfig = {}; propertyConfig.m_dataType = AtomToolsFramework::DynamicPropertyType::String; - propertyConfig.m_id = MaterialPropertyId(UvGroupName, shaderInput); + propertyConfig.m_id = AZ::RPI::MaterialPropertyId(UvGroupName, shaderInput); propertyConfig.m_name = shaderInput; propertyConfig.m_displayName = shaderInput; propertyConfig.m_groupName = "UV Sets"; @@ -878,15 +631,15 @@ namespace MaterialEditor } // Add material functors that are in the top-level functors list. - const MaterialFunctorSourceData::EditorContext editorContext = - MaterialFunctorSourceData::EditorContext(m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); - for (Ptr functorData : m_materialTypeSourceData.m_materialFunctorSourceData) + const AZ::RPI::MaterialFunctorSourceData::EditorContext editorContext = + AZ::RPI::MaterialFunctorSourceData::EditorContext(m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); + for (Ptr functorData : m_materialTypeSourceData.m_materialFunctorSourceData) { - MaterialFunctorSourceData::FunctorResult result2 = functorData->CreateFunctor(editorContext); + AZ::RPI::MaterialFunctorSourceData::FunctorResult result2 = functorData->CreateFunctor(editorContext); if (result2.IsSuccess()) { - Ptr& functor = result2.GetValue(); + Ptr& functor = result2.GetValue(); if (functor != nullptr) { m_editorFunctors.push_back(functor); @@ -895,24 +648,24 @@ namespace MaterialEditor else { AZ_Error("MaterialDocument", false, "Material functors were not created: '%s'.", m_absolutePath.c_str()); - return false; + return OpenFailed(); } } // Add any material functors that are located inside each property group. bool enumerateResult = m_materialTypeSourceData.EnumeratePropertyGroups( - [this](const AZStd::string&, const MaterialTypeSourceData::PropertyGroup* propertyGroup) + [this](const AZStd::string&, const AZ::RPI::MaterialTypeSourceData::PropertyGroup* propertyGroup) { - const MaterialFunctorSourceData::EditorContext editorContext = MaterialFunctorSourceData::EditorContext( + const AZ::RPI::MaterialFunctorSourceData::EditorContext editorContext = AZ::RPI::MaterialFunctorSourceData::EditorContext( m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); - for (Ptr functorData : propertyGroup->GetFunctors()) + for (Ptr functorData : propertyGroup->GetFunctors()) { - MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor(editorContext); + AZ::RPI::MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor(editorContext); if (result.IsSuccess()) { - Ptr& functor = result.GetValue(); + Ptr& functor = result.GetValue(); if (functor != nullptr) { m_editorFunctors.push_back(functor); @@ -930,18 +683,35 @@ namespace MaterialEditor if (!enumerateResult) { - return false; + return OpenFailed(); } AZ::RPI::MaterialPropertyFlags dirtyFlags; dirtyFlags.set(); // Mark all properties as dirty since we just loaded the material and need to initialize property visibility RunEditorMaterialFunctors(dirtyFlags); - // Connecting to bus to monitor external changes - AzToolsFramework::AssetSystemBus::Handler::BusConnect(); + return OpenSucceeded(); + } - AZ_TracePrintf("MaterialDocument", "Material document opened: '%s'.\n", m_absolutePath.c_str()); - return true; + bool MaterialDocument::ReopenRecordState() + { + m_propertyValuesBeforeReopen.clear(); + for (const auto& propertyPair : m_properties) + { + const AtomToolsFramework::DynamicProperty& property = propertyPair.second; + if (!AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_parentValue)) + { + m_propertyValuesBeforeReopen[property.GetId()] = property.GetValue(); + } + } + return AtomToolsDocument::ReopenRecordState(); + } + + bool MaterialDocument::ReopenRestoreState() + { + RestorePropertyValues(m_propertyValuesBeforeReopen); + m_propertyValuesBeforeReopen.clear(); + return AtomToolsDocument::ReopenRestoreState(); } void MaterialDocument::Recompile() @@ -955,23 +725,18 @@ namespace MaterialEditor void MaterialDocument::Clear() { + AtomToolsFramework::AtomToolsDocument::Clear(); + AZ::TickBus::Handler::BusDisconnect(); - AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); m_materialAsset = {}; m_materialInstance = {}; - m_absolutePath.clear(); - m_relativePath.clear(); - m_sourceDependencies.clear(); - m_saveTriggeredInternally = {}; m_compilePending = {}; m_properties.clear(); m_editorFunctors.clear(); m_materialTypeSourceData = AZ::RPI::MaterialTypeSourceData(); m_materialSourceData = AZ::RPI::MaterialSourceData(); m_propertyValuesBeforeEdit.clear(); - m_undoHistory.clear(); - m_undoHistoryIndex = {}; } void MaterialDocument::RestorePropertyValues(const PropertyValueMap& propertyValues) @@ -1040,5 +805,4 @@ namespace MaterialEditor return result; } - } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h index c975824e22..6557b5a326 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -28,7 +27,6 @@ namespace MaterialEditor : public AtomToolsFramework::AtomToolsDocument , public MaterialDocumentRequestBus::Handler , private AZ::TickBus::Handler - , private AzToolsFramework::AssetSystemBus::Handler { public: AZ_RTTI(MaterialDocument, "{DBA269AE-892B-415C-8FA1-166B94B0E045}"); @@ -38,37 +36,26 @@ namespace MaterialEditor MaterialDocument(); virtual ~MaterialDocument(); - //////////////////////////////////////////////////////////////////////// - // AtomToolsFramework::AtomToolsDocument - //////////////////////////////////////////////////////////////////////// + // AtomToolsFramework::AtomToolsDocument overrides... const AZStd::any& GetPropertyValue(const AZ::Name& propertyId) const override; const AtomToolsFramework::DynamicProperty& GetProperty(const AZ::Name& propertyId) const override; bool IsPropertyGroupVisible(const AZ::Name& propertyGroupFullName) const override; void SetPropertyValue(const AZ::Name& propertyId, const AZStd::any& value) override; bool Open(AZStd::string_view loadPath) override; - bool Reopen() override; bool Save() override; bool SaveAsCopy(AZStd::string_view savePath) override; bool SaveAsChild(AZStd::string_view savePath) override; - bool Close() override; bool IsOpen() const override; bool IsModified() const override; bool IsSavable() const override; - bool CanUndo() const override; - bool CanRedo() const override; - bool Undo() override; - bool Redo() override; bool BeginEdit() override; bool EndEdit() override; - //////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////// - // MaterialDocumentRequestBus::Handler implementation + // MaterialDocumentRequestBus::Handler overrides... AZ::Data::Asset GetAsset() const override; AZ::Data::Instance GetInstance() const override; const AZ::RPI::MaterialSourceData* GetMaterialSourceData() const override; const AZ::RPI::MaterialTypeSourceData* GetMaterialTypeSourceData() const override; - //////////////////////////////////////////////////////////////////////// private: @@ -84,34 +71,19 @@ namespace MaterialEditor // Map of document's property group visibility flags using PropertyGroupVisibilityMap = AZStd::unordered_map; - // Function to be bound for undo and redo - using UndoRedoFunction = AZStd::function; - - // A pair of functions, where first is the undo operation and second is the redo operation - using UndoRedoFunctionPair = AZStd::pair; - - // Container for all of the active undo and redo functions and state - using UndoRedoHistory = AZStd::vector; - - //////////////////////////////////////////////////////////////////////// - // AZ::TickBus interface implementation + // AZ::TickBus overrides... void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - //////////////////////////////////////////////////////////////////////// - - ////////////////////////////////////////////////////////////////////////// - // AzToolsFramework::AssetSystemBus::Handler overrides... - void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid sourceUUID) override; - ////////////////////////////////////////////////////////////////////////// bool SavePropertiesToSourceData( const AZStd::string& exportPath, AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const; - bool OpenInternal(AZStd::string_view loadPath); + void Clear() override; + + bool ReopenRecordState() override; + bool ReopenRestoreState() override; void Recompile(); - void Clear(); - void RestorePropertyValues(const PropertyValueMap& propertyValues); struct EditorMaterialFunctorResult @@ -131,12 +103,6 @@ namespace MaterialEditor // Material instance being edited AZ::Data::Instance m_materialInstance; - // Set of assets that can trigger a document reload - AZStd::unordered_set m_sourceDependencies; - - // Track if document saved itself last to skip external modification notification - bool m_saveTriggeredInternally = false; - // If material instance value(s) were modified, do we need to recompile on next tick? bool m_compilePending = false; @@ -155,19 +121,10 @@ namespace MaterialEditor // Source data for material AZ::RPI::MaterialSourceData m_materialSourceData; - // Variables needed for tracking the undo and redo state of this document - // State of property values prior to an edit, used for restoration during undo PropertyValueMap m_propertyValuesBeforeEdit; - // Container of undo commands - UndoRedoHistory m_undoHistory; - - // The current position in the undo redo history - int m_undoHistoryIndex = 0; - - AZStd::any m_invalidValue; - - AtomToolsFramework::DynamicProperty m_invalidProperty; + // State of property values prior to reopen + PropertyValueMap m_propertyValuesBeforeReopen; }; } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp index b2f1cdc9c1..a7b1fcc0c9 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp @@ -170,11 +170,14 @@ namespace MaterialEditor { m_lightingPresetAssets[info.m_assetId] = { info.m_assetId, info.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(info.m_assetId); + return; } - else if (AZ::StringFunc::EndsWith(info.m_relativePath.c_str(), ".modelpreset.azasset")) + + if (AZ::StringFunc::EndsWith(info.m_relativePath.c_str(), ".modelpreset.azasset")) { m_modelPresetAssets[info.m_assetId] = { info.m_assetId, info.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(info.m_assetId); + return; } }; @@ -436,24 +439,20 @@ namespace MaterialEditor auto ReloadLightingAndModelPresets = [this, &assetId](AZ::Data::AssetCatalogRequests* assetCatalogRequests) { AZ::Data::AssetInfo assetInfo = assetCatalogRequests->GetAssetInfoById(assetId); - AZ::Data::Asset* modifiedPresetAsset{}; if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".lightingpreset.azasset")) { m_lightingPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); - modifiedPresetAsset = &m_lightingPresetAssets[assetInfo.m_assetId]; + m_lightingPresetAssets[assetInfo.m_assetId].QueueLoad(); + return; } - else if (AzFramework::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) + + if (AzFramework::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) { m_modelPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); - modifiedPresetAsset = &m_modelPresetAssets[assetInfo.m_assetId]; - } - - // Queue a load on the changed asset - if (modifiedPresetAsset != nullptr) - { - modifiedPresetAsset->QueueLoad(); + m_modelPresetAssets[assetInfo.m_assetId].QueueLoad(); + return; } }; AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(ReloadLightingAndModelPresets)); @@ -470,11 +469,14 @@ namespace MaterialEditor { AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetInfo.m_assetId); m_lightingPresetAssets.erase(assetId); + return; } + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) { AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetInfo.m_assetId); m_modelPresetAssets.erase(assetId); + return; } } } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h index a4cd2b7616..690e8add86 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h @@ -19,8 +19,7 @@ namespace MaterialEditor { - //! Provides controls for viewing and editing a material document settings. - //! The settings can be divided into cards, with each one showing a subset of properties. + //! Provides controls for viewing and editing document settings. class MaterialInspector : public AtomToolsFramework::InspectorWidget , public AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h index 464a55aa7f..ad4629550f 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h @@ -21,8 +21,7 @@ namespace MaterialEditor { - //! Provides controls for viewing and editing a material document settings. - //! The settings can be divided into cards, with each one showing a subset of properties. + //! Provides controls for viewing and editing lighting and model preset settings. class ViewportSettingsInspector : public AtomToolsFramework::InspectorWidget , private AzToolsFramework::IPropertyEditorNotify diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp index 2b7767635e..be5adfe4bf 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include namespace ShaderManagementConsole @@ -20,28 +18,32 @@ namespace ShaderManagementConsole : AtomToolsFramework::AtomToolsDocument() { ShaderManagementConsoleDocumentRequestBus::Handler::BusConnect(m_id); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentCreated, m_id); } ShaderManagementConsoleDocument::~ShaderManagementConsoleDocument() { - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentDestroyed, m_id); ShaderManagementConsoleDocumentRequestBus::Handler::BusDisconnect(); - Clear(); } - size_t ShaderManagementConsoleDocument::GetShaderOptionCount() const + void ShaderManagementConsoleDocument::SetShaderVariantListSourceData(const AZ::RPI::ShaderVariantListSourceData& sourceData) { - auto layout = m_shaderAsset->GetShaderOptionGroupLayout(); - auto& shaderOptionDescriptors = layout->GetShaderOptions(); - return shaderOptionDescriptors.size(); + m_shaderVariantListSourceData = sourceData; + AZStd::string shaderPath = m_shaderVariantListSourceData.m_shaderFilePath; + AzFramework::StringFunc::Path::ReplaceExtension(shaderPath, AZ::RPI::ShaderAsset::Extension); + + m_shaderAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath(shaderPath.c_str()); + if (!m_shaderAsset) + { + AZ_Error("ShaderManagementConsoleDocument", false, "Could not load shader asset: %s.", shaderPath.c_str()); + } + + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentModified, m_id); } - const AZ::RPI::ShaderOptionDescriptor& ShaderManagementConsoleDocument::GetShaderOptionDescriptor(size_t index) const + const AZ::RPI::ShaderVariantListSourceData& ShaderManagementConsoleDocument::GetShaderVariantListSourceData() const { - auto layout = m_shaderAsset->GetShaderOptionGroupLayout(); - auto& shaderOptionDescriptors = layout->GetShaderOptions(); - return shaderOptionDescriptors[index]; + return m_shaderVariantListSourceData; } size_t ShaderManagementConsoleDocument::GetShaderVariantCount() const @@ -54,92 +56,115 @@ namespace ShaderManagementConsole return m_shaderVariantListSourceData.m_shaderVariants[index]; } - bool ShaderManagementConsoleDocument::Open(AZStd::string_view loadPath) + size_t ShaderManagementConsoleDocument::GetShaderOptionCount() const { - Clear(); - - m_absolutePath = loadPath; - if (!AzFramework::StringFunc::Path::Normalize(m_absolutePath)) + if (IsOpen()) { - AZ_Error("ShaderManagementConsoleDocument", false, "Document path could not be normalized: '%s'.", m_absolutePath.c_str()); - return false; + const auto& layout = m_shaderAsset->GetShaderOptionGroupLayout(); + const auto& shaderOptionDescriptors = layout->GetShaderOptions(); + return shaderOptionDescriptors.size(); } - - if (AzFramework::StringFunc::Path::IsRelative(m_absolutePath.c_str())) - { - AZ_Error("ShaderManagementConsoleDocument", false, "Document path must be absolute: '%s'.", m_absolutePath.c_str()); - return false; - } - - if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), AZ::RPI::ShaderVariantListSourceData::Extension)) - { - // Load the shader config data and create a shader config asset from it - if (!AZ::RPI::JsonUtils::LoadObjectFromFile(m_absolutePath, m_shaderVariantListSourceData)) - { - AZ_Error("ShaderManagementConsoleDocument", false, "Failed loading shader variant list data: '%s.'", m_absolutePath.c_str()); - return false; - } - } - - bool result = false; - AZ::Data::AssetInfo sourceAssetInfo; - AZStd::string watchFolder; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult( - result, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, m_absolutePath.c_str(), sourceAssetInfo, - watchFolder); - if (!result) - { - AZ_Error("ShaderManagementConsoleDocument", false, "Could not find source data: '%s'.", m_absolutePath.c_str()); - return false; - } - - m_relativePath = m_shaderVariantListSourceData.m_shaderFilePath; - if (!AzFramework::StringFunc::Path::Normalize(m_relativePath)) - { - AZ_Error("ShaderManagementConsoleDocument", false, "Shader path could not be normalized: '%s'.", m_relativePath.c_str()); - return false; - } - - AZStd::string shaderPath = m_relativePath; - AzFramework::StringFunc::Path::ReplaceExtension(shaderPath, AZ::RPI::ShaderAsset::Extension); - - m_shaderAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath(shaderPath.c_str()); - if (!m_shaderAsset) - { - AZ_Error("ShaderManagementConsoleDocument", false, "Could not load shader asset: %s.", shaderPath.c_str()); - return false; - } - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentOpened, m_id); - - AZ_TracePrintf("ShaderManagementConsoleDocument", "Document opened: '%s'\n", m_absolutePath.c_str()); - return true; + return 0; } - bool ShaderManagementConsoleDocument::Close() + const AZ::RPI::ShaderOptionDescriptor& ShaderManagementConsoleDocument::GetShaderOptionDescriptor(size_t index) const { - if (!IsOpen()) + if (IsOpen()) + { + const auto& layout = m_shaderAsset->GetShaderOptionGroupLayout(); + const auto& shaderOptionDescriptors = layout->GetShaderOptions(); + return shaderOptionDescriptors.at(index); + } + return m_invalidDescriptor; + } + + bool ShaderManagementConsoleDocument::Open(AZStd::string_view loadPath) + { + if (!AtomToolsDocument::Open(loadPath)) { - AZ_Error("ShaderManagementConsoleDocument", false, "Document is not open"); return false; } - Clear(); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentClosed, m_id); - AZ_TracePrintf("ShaderManagementConsoleDocument", "Document closed\n"); - return true; + if (!AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), AZ::RPI::ShaderVariantListSourceData::Extension)) + { + AZ_Error("ShaderManagementConsoleDocument", false, "Document extension is not supported: '%s.'", m_absolutePath.c_str()); + return OpenFailed(); + } + + // Load the shader config data and create a shader config asset from it + AZ::RPI::ShaderVariantListSourceData sourceData; + if (!AZ::RPI::JsonUtils::LoadObjectFromFile(m_absolutePath, sourceData)) + { + AZ_Error("ShaderManagementConsoleDocument", false, "Failed loading shader variant list data: '%s.'", m_absolutePath.c_str()); + return OpenFailed(); + } + + SetShaderVariantListSourceData(sourceData); + return IsOpen() ? OpenSucceeded() : OpenFailed(); + } + + bool ShaderManagementConsoleDocument::Save() + { + if (!AtomToolsDocument::Save()) + { + return false; + } + + return SaveSourceData(); + } + + bool ShaderManagementConsoleDocument::SaveAsCopy(AZStd::string_view savePath) + { + if (!AtomToolsDocument::SaveAsCopy(savePath)) + { + return false; + } + + return SaveSourceData(); + } + + bool ShaderManagementConsoleDocument::SaveAsChild(AZStd::string_view savePath) + { + if (!AtomToolsDocument::SaveAsChild(savePath)) + { + return false; + } + + return SaveSourceData(); } bool ShaderManagementConsoleDocument::IsOpen() const { - return !m_absolutePath.empty() && !m_relativePath.empty(); + return AtomToolsDocument::IsOpen() && m_shaderAsset.IsReady(); + } + + bool ShaderManagementConsoleDocument::IsModified() const + { + return false; + } + + bool ShaderManagementConsoleDocument::IsSavable() const + { + return true; } void ShaderManagementConsoleDocument::Clear() { - m_absolutePath.clear(); - m_relativePath.clear(); + AtomToolsFramework::AtomToolsDocument::Clear(); + m_shaderVariantListSourceData = {}; m_shaderAsset = {}; } + + bool ShaderManagementConsoleDocument::SaveSourceData() + { + if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, m_shaderVariantListSourceData)) + { + AZ_Error("ShaderManagementConsoleDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); + return SaveFailed(); + } + + m_absolutePath = m_savePathNormalized; + return SaveSucceeded(); + } } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h index bd51616f7a..2c22880ffe 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h @@ -29,40 +29,35 @@ namespace ShaderManagementConsole AZ_DISABLE_COPY(ShaderManagementConsoleDocument); ShaderManagementConsoleDocument(); - virtual ~ShaderManagementConsoleDocument(); + ~ShaderManagementConsoleDocument(); - //////////////////////////////////////////////////////////////////////// - // AtomToolsFramework::AtomToolsDocument - //////////////////////////////////////////////////////////////////////// + // AtomToolsFramework::AtomToolsDocument overrides... bool Open(AZStd::string_view loadPath) override; - bool Close() override; + bool Save() override; + bool SaveAsCopy(AZStd::string_view savePath) override; + bool SaveAsChild(AZStd::string_view savePath) override; bool IsOpen() const override; - //////////////////////////////////////////////////////////////////////// + bool IsModified() const override; + bool IsSavable() const override; - //////////////////////////////////////////////////////////////////////// - // ShaderManagementConsoleDocumentRequestBus::Handler implementation - size_t GetShaderOptionCount() const override; - const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const override; + // ShaderManagementConsoleDocumentRequestBus::Handler overridfes... + void SetShaderVariantListSourceData(const AZ::RPI::ShaderVariantListSourceData& sourceData) override; + const AZ::RPI::ShaderVariantListSourceData& GetShaderVariantListSourceData() const override; size_t GetShaderVariantCount() const override; const AZ::RPI::ShaderVariantListSourceData::VariantInfo& GetShaderVariantInfo(size_t index) const override; - //////////////////////////////////////////////////////////////////////// + size_t GetShaderOptionCount() const override; + const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const override; private: - // Function to be bound for undo and redo - using UndoRedoFunction = AZStd::function; - - // A pair of functions, where first is the undo operation and second is the redo operation - using UndoRedoFunctionPair = AZStd::pair; - - // Container for all of the active undo and redo functions and state - using UndoRedoHistory = AZStd::vector; - - void Clear(); + void Clear() override; + bool SaveSourceData(); // Source data for shader variant list AZ::RPI::ShaderVariantListSourceData m_shaderVariantListSourceData; // Shader asset for the corresponding shader variant list AZ::Data::Asset m_shaderAsset; + + const AZ::RPI::ShaderOptionDescriptor m_invalidDescriptor; }; } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentRequestBus.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentRequestBus.h index d0e6aea5b9..e58ee34ed1 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentRequestBus.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocumentRequestBus.h @@ -23,17 +23,23 @@ namespace ShaderManagementConsole static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; typedef AZ::Uuid BusIdType; - //! Get the number of options - virtual size_t GetShaderOptionCount() const = 0; + //! Set the shader variant list + virtual void SetShaderVariantListSourceData(const AZ::RPI::ShaderVariantListSourceData& sourceData) = 0; - //! Get the descriptor for the shader option at the specified index - virtual const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const = 0; + //! Get the shader variant list + virtual const AZ::RPI::ShaderVariantListSourceData& GetShaderVariantListSourceData() const = 0; //! Get the number of shader variants virtual size_t GetShaderVariantCount() const = 0; //! Get the information for the shader variant at the specified index virtual const AZ::RPI::ShaderVariantListSourceData::VariantInfo& GetShaderVariantInfo(size_t index) const = 0; + + //! Get the number of options + virtual size_t GetShaderOptionCount() const = 0; + + //! Get the descriptor for the shader option at the specified index + virtual const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const = 0; }; using ShaderManagementConsoleDocumentRequestBus = AZ::EBus; diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp index ba8038319b..aa0c378ff0 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp @@ -84,6 +84,8 @@ namespace ShaderManagementConsole ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) ->Attribute(AZ::Script::Attributes::Category, "Editor") ->Attribute(AZ::Script::Attributes::Module, "shadermanagementconsole") + ->Event("SetShaderVariantListSourceData", &ShaderManagementConsoleDocumentRequestBus::Events::SetShaderVariantListSourceData) + ->Event("GetShaderVariantListSourceData", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderVariantListSourceData) ->Event("GetShaderOptionCount", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderOptionCount) ->Event("GetShaderOptionDescriptor", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderOptionDescriptor) ->Event("GetShaderVariantCount", &ShaderManagementConsoleDocumentRequestBus::Events::GetShaderVariantCount) diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp index f4672d670e..04a8a71191 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp @@ -61,8 +61,6 @@ namespace ShaderManagementConsole m_actionNew->setEnabled(false); m_actionSaveAsChild->setVisible(false); m_actionSaveAsChild->setEnabled(false); - m_actionSaveAll->setVisible(false); - m_actionSaveAll->setEnabled(false); OnDocumentOpened(AZ::Uuid::CreateNull()); } From e273f3ef6a1f73e6f9ba31df3e5b35f0efbdbb31 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sun, 30 Jan 2022 01:01:10 -0600 Subject: [PATCH 367/394] Updating comments Signed-off-by: Guthrie Adams --- .../Application/AtomToolsApplication.h | 2 +- .../Document/AtomToolsDocument.h | 24 ++++++---- .../Source/Document/AtomToolsDocument.cpp | 47 +++++++++---------- .../AtomToolsDocumentSystemComponent.h | 2 +- .../PreviewRendererCaptureState.h | 4 +- .../Code/Source/Document/MaterialDocument.h | 1 + .../Viewport/MaterialViewportComponent.cpp | 4 +- .../ShaderManagementConsoleDocument.h | 4 +- 8 files changed, 49 insertions(+), 39 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h index 06a9f65ec1..016bc5c5e2 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h @@ -111,7 +111,7 @@ namespace AtomToolsFramework AZStd::unique_ptr m_styleManager; - //! Local user settings are used to store material browser tree expansion state + //! Local user settings are used to store asset browser tree expansion state AZ::UserSettingsProvider m_localUserSettings; //! Are local settings loaded diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h index b7188286a1..c2ef7f9594 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h @@ -58,29 +58,36 @@ namespace AtomToolsFramework virtual bool OpenSucceeded(); virtual bool OpenFailed(); - virtual bool ReopenRecordState(); - virtual bool ReopenRestoreState(); - virtual bool SaveSucceeded(); virtual bool SaveFailed(); - // Unique id of this document + //! Record state that needs to be restored after a document is reopened. + //! This can be overridden to record additional data. + virtual bool ReopenRecordState(); + + //! Restore state that was recorded prior to document being reloaded. + //! This can be overridden to restore additional data. + virtual bool ReopenRestoreState(); + + //! The unique id of this document, used for all bus notifications and requests. AZ::Uuid m_id = AZ::Uuid::CreateRandom(); - // Absolute path to the material source file + //! The absolute path to the document source file. AZStd::string m_absolutePath; + //! The normalized, absolute path where the document will be saved. AZStd::string m_savePathNormalized; AZStd::any m_invalidValue; AtomToolsFramework::DynamicProperty m_invalidProperty; - // Set of assets that can trigger a document reload + //! This contains absolute paths of other source files that affect this document. + //! If any of the source files in this container are modified, the document system will he notified to reload this document. AZStd::unordered_set m_sourceDependencies; - // Track if document saved itself last to skip external modification notification - bool m_saveTriggeredInternally = false; + //! If this flag is true then the next source file change notification for this document will be ignored. + bool m_ignoreSourceFileChangeToSelf = false; // Variables needed for tracking the undo and redo state of this document @@ -101,6 +108,7 @@ namespace AtomToolsFramework int m_undoHistoryIndex = {}; int m_undoHistoryIndexBeforeReopen = {}; + //! Add new undo redo command functions at the current position in the undo history. void AddUndoRedoHistory(const UndoRedoFunction& undoCommand, const UndoRedoFunction& redoCommand); // AzToolsFramework::AssetSystemBus::Handler overrides... diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp index 5941360b5d..1daf578679 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp @@ -122,7 +122,7 @@ namespace AtomToolsFramework if (!IsSavable()) { - AZ_Error("AtomToolsDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str()); + AZ_Error("AtomToolsDocument", false, "Document type can not be saved: '%s'.", m_absolutePath.c_str()); return SaveFailed(); } @@ -146,7 +146,7 @@ namespace AtomToolsFramework if (!IsSavable()) { - AZ_Error("AtomToolsDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str()); + AZ_Error("AtomToolsDocument", false, "Document type can not be saved: '%s'.", m_absolutePath.c_str()); return SaveFailed(); } @@ -170,7 +170,7 @@ namespace AtomToolsFramework if (m_absolutePath == m_savePathNormalized || m_sourceDependencies.find(m_savePathNormalized) != m_sourceDependencies.end()) { - AZ_Error("AtomToolsDocument", false, "Document can't be saved over a dependancy: '%s'.", m_savePathNormalized.c_str()); + AZ_Error("AtomToolsDocument", false, "Document can not be saved over a dependancy: '%s'.", m_savePathNormalized.c_str()); return SaveFailed(); } @@ -268,7 +268,7 @@ namespace AtomToolsFramework m_absolutePath.clear(); m_sourceDependencies.clear(); - m_saveTriggeredInternally = {}; + m_ignoreSourceFileChangeToSelf = {}; m_undoHistory.clear(); m_undoHistoryIndex = {}; } @@ -289,26 +289,9 @@ namespace AtomToolsFramework return false; } - bool AtomToolsDocument::ReopenRecordState() - { - // Store history and property changes that should be reapplied after reload - m_undoHistoryBeforeReopen = m_undoHistory; - m_undoHistoryIndexBeforeReopen = m_undoHistoryIndex; - return true; - } - - bool AtomToolsDocument::ReopenRestoreState() - { - m_undoHistory = m_undoHistoryBeforeReopen; - m_undoHistoryIndex = m_undoHistoryIndexBeforeReopen; - m_undoHistoryBeforeReopen = {}; - m_undoHistoryIndexBeforeReopen = {}; - return true; - } - bool AtomToolsDocument::SaveSucceeded() { - m_saveTriggeredInternally = true; + m_ignoreSourceFileChangeToSelf = true; AZ_TracePrintf("AtomToolsDocument", "Document saved: '%s'.\n", m_savePathNormalized.c_str()); @@ -328,6 +311,22 @@ namespace AtomToolsFramework return false; } + bool AtomToolsDocument::ReopenRecordState() + { + m_undoHistoryBeforeReopen = m_undoHistory; + m_undoHistoryIndexBeforeReopen = m_undoHistoryIndex; + return true; + } + + bool AtomToolsDocument::ReopenRestoreState() + { + m_undoHistory = m_undoHistoryBeforeReopen; + m_undoHistoryIndex = m_undoHistoryIndexBeforeReopen; + m_undoHistoryBeforeReopen = {}; + m_undoHistoryIndexBeforeReopen = {}; + return true; + } + void AtomToolsDocument::AddUndoRedoHistory(const UndoRedoFunction& undoCommand, const UndoRedoFunction& redoCommand) { // Wipe any state beyond the current history index @@ -349,13 +348,13 @@ namespace AtomToolsFramework if (m_absolutePath == sourcePath) { // ignore notifications caused by saving the open document - if (!m_saveTriggeredInternally) + if (!m_ignoreSourceFileChangeToSelf) { AZ_TracePrintf("AtomToolsDocument", "Document changed externally: '%s'.\n", m_absolutePath.c_str()); AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentExternallyModified, m_id); } - m_saveTriggeredInternally = false; + m_ignoreSourceFileChangeToSelf = false; } else if (m_sourceDependencies.find(sourcePath) != m_sourceDependencies.end()) { diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h index 58470e3582..5c7454e5c7 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h @@ -24,7 +24,7 @@ AZ_POP_DISABLE_WARNING namespace AtomToolsFramework { - //! AtomToolsDocumentSystemComponent is the central component of the Material Editor Core gem + //! AtomToolsDocumentSystemComponent is the central component for managing documents class AtomToolsDocumentSystemComponent : public AZ::Component , private AtomToolsDocumentNotificationBus::Handler diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/PreviewRenderer/PreviewRendererCaptureState.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/PreviewRenderer/PreviewRendererCaptureState.h index 74195ab396..55f0507014 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/PreviewRenderer/PreviewRendererCaptureState.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/PreviewRenderer/PreviewRendererCaptureState.h @@ -14,7 +14,7 @@ namespace AtomToolsFramework { - //! PreviewRendererCaptureState renders a thumbnail to a pixmap and notifies MaterialOrModelThumbnail once finished + //! PreviewRendererCaptureState renders a preview to an image class PreviewRendererCaptureState final : public PreviewRendererState , public AZ::TickBus::Handler @@ -31,7 +31,7 @@ namespace AtomToolsFramework //! AZ::Render::FrameCaptureNotificationBus::Handler overrides... void OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string& info) override; - //! This is necessary to suspend capture to allow a frame for Material and Mesh components to assign materials + //! This is necessary to suspend capture until preview scene is ready int m_ticksToCapture = 1; }; } // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h index 6557b5a326..99e2af7a73 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h @@ -77,6 +77,7 @@ namespace MaterialEditor bool SavePropertiesToSourceData( const AZStd::string& exportPath, AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const; + // AtomToolsFramework::AtomToolsDocument overrides... void Clear() override; bool ReopenRecordState() override; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp index a7b1fcc0c9..f25d83556d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp @@ -442,16 +442,16 @@ namespace MaterialEditor if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".lightingpreset.azasset")) { m_lightingPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; - AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); m_lightingPresetAssets[assetInfo.m_assetId].QueueLoad(); + AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); return; } if (AzFramework::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) { m_modelPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; - AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); m_modelPresetAssets[assetInfo.m_assetId].QueueLoad(); + AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); return; } }; diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h index 2c22880ffe..4ad951e463 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h @@ -49,7 +49,9 @@ namespace ShaderManagementConsole const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const override; private: + // AtomToolsFramework::AtomToolsDocument overrides... void Clear() override; + bool SaveSourceData(); // Source data for shader variant list @@ -58,6 +60,6 @@ namespace ShaderManagementConsole // Shader asset for the corresponding shader variant list AZ::Data::Asset m_shaderAsset; - const AZ::RPI::ShaderOptionDescriptor m_invalidDescriptor; + AZ::RPI::ShaderOptionDescriptor m_invalidDescriptor; }; } // namespace ShaderManagementConsole From 9ded52b1413ec077707232d768551ed7f159d796 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Mon, 31 Jan 2022 10:55:59 -0600 Subject: [PATCH 368/394] Wrapping redundant save logic into function in the material editor document class Signed-off-by: Guthrie Adams --- .../Code/Source/Document/MaterialDocument.cpp | 69 ++++++------------- .../Code/Source/Document/MaterialDocument.h | 3 +- 2 files changed, 23 insertions(+), 49 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index a8404baec1..c5b5bec8df 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -168,30 +168,20 @@ namespace MaterialEditor return false; } - // create source data from properties + // populate sourceData with modified or overridden properties and save object AZ::RPI::MaterialSourceData sourceData; sourceData.m_materialTypeVersion = m_materialAsset->GetMaterialTypeAsset()->GetVersion(); sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(m_absolutePath, m_materialSourceData.m_materialType); sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(m_absolutePath, m_materialSourceData.m_parentMaterial); - - // populate sourceData with modified or overwritten properties - const bool savedProperties = SavePropertiesToSourceData(m_absolutePath, sourceData, [](const AtomToolsFramework::DynamicProperty& property) - { + auto propertyFilter = [](const AtomToolsFramework::DynamicProperty& property) { return !AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_parentValue); - }); + }; - if (!savedProperties) + if (!SaveSourceData(sourceData, propertyFilter)) { return SaveFailed(); } - // write sourceData to .material file - if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_absolutePath, sourceData)) - { - AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_absolutePath.c_str()); - return SaveFailed(); - } - // after saving, reset to a clean state for (auto& propertyPair : m_properties) { @@ -211,30 +201,20 @@ namespace MaterialEditor return false; } - // create source data from properties + // populate sourceData with modified or overridden properties and save object AZ::RPI::MaterialSourceData sourceData; sourceData.m_materialTypeVersion = m_materialAsset->GetMaterialTypeAsset()->GetVersion(); sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_materialSourceData.m_materialType); sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_materialSourceData.m_parentMaterial); - - // populate sourceData with modified or overwritten properties - const bool savedProperties = SavePropertiesToSourceData(m_savePathNormalized, sourceData, [](const AtomToolsFramework::DynamicProperty& property) - { + auto propertyFilter = [](const AtomToolsFramework::DynamicProperty& property) { return !AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_parentValue); - }); + }; - if (!savedProperties) + if (!SaveSourceData(sourceData, propertyFilter)) { return SaveFailed(); } - // write sourceData to .material file - if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) - { - AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); - return SaveFailed(); - } - // If the document is saved to a new file we need to reopen the new document to update assets, paths, property deltas. if (!Open(m_savePathNormalized)) { @@ -251,7 +231,7 @@ namespace MaterialEditor return false; } - // create source data from properties + // populate sourceData with modified or overridden properties and save object AZ::RPI::MaterialSourceData sourceData; sourceData.m_materialTypeVersion = m_materialAsset->GetMaterialTypeAsset()->GetVersion(); sourceData.m_materialType = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_materialSourceData.m_materialType); @@ -262,24 +242,15 @@ namespace MaterialEditor sourceData.m_parentMaterial = AtomToolsFramework::GetExteralReferencePath(m_savePathNormalized, m_absolutePath); } - // populate sourceData with modified properties - const bool savedProperties = SavePropertiesToSourceData(m_savePathNormalized, sourceData, [](const AtomToolsFramework::DynamicProperty& property) - { + auto propertyFilter = [](const AtomToolsFramework::DynamicProperty& property) { return !AtomToolsFramework::ArePropertyValuesEqual(property.GetValue(), property.GetConfig().m_originalValue); - }); + }; - if (!savedProperties) + if (!SaveSourceData(sourceData, propertyFilter)) { return SaveFailed(); } - // write sourceData to .material file - if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) - { - AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); - return SaveFailed(); - } - // If the document is saved to a new file we need to reopen the new document to update assets, paths, property deltas. if (!Open(m_savePathNormalized)) { @@ -362,13 +333,12 @@ namespace MaterialEditor } } - bool MaterialDocument::SavePropertiesToSourceData( - const AZStd::string& exportPath, AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const + bool MaterialDocument::SaveSourceData(AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const { - bool result = true; + bool addPropertiesResult = true; // populate sourceData with properties that meet the filter - m_materialTypeSourceData.EnumerateProperties([&](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { + m_materialTypeSourceData.EnumerateProperties([&, this](const AZStd::string& propertyIdContext, const auto& propertyDefinition) { AZ::Name propertyId{propertyIdContext + propertyDefinition->GetName()}; @@ -381,7 +351,7 @@ namespace MaterialEditor if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId, *propertyDefinition, propertyValue)) { AZ_Error("MaterialDocument", false, "Document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); - result = false; + addPropertiesResult = false; return false; } @@ -393,7 +363,12 @@ namespace MaterialEditor return true; }); - return result; + if (!addPropertiesResult || !AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) + { + AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); + return false; + } + return true; } bool MaterialDocument::Open(AZStd::string_view loadPath) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h index 99e2af7a73..b03d0943fa 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h @@ -74,8 +74,7 @@ namespace MaterialEditor // AZ::TickBus overrides... void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - bool SavePropertiesToSourceData( - const AZStd::string& exportPath, AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const; + bool SaveSourceData(AZ::RPI::MaterialSourceData& sourceData, PropertyFilterFunction propertyFilter) const; // AtomToolsFramework::AtomToolsDocument overrides... void Clear() override; From 8617d34724d459e728ea96c97ad528501ab308aa Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Mon, 31 Jan 2022 15:38:20 -0600 Subject: [PATCH 369/394] updated comment Signed-off-by: Guthrie Adams --- .../Include/AtomToolsFramework/Document/AtomToolsDocument.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h index c2ef7f9594..cb64d23cd0 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocument.h @@ -83,7 +83,7 @@ namespace AtomToolsFramework AtomToolsFramework::DynamicProperty m_invalidProperty; //! This contains absolute paths of other source files that affect this document. - //! If any of the source files in this container are modified, the document system will he notified to reload this document. + //! If any of the source files in this container are modified, the document system is notified to reload this document. AZStd::unordered_set m_sourceDependencies; //! If this flag is true then the next source file change notification for this document will be ignored. From 66be8543cdf31e75c753210d68bfba6f9293028c Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Mon, 31 Jan 2022 16:21:32 -0600 Subject: [PATCH 370/394] fixing merge issues Signed-off-by: Guthrie Adams --- .../Code/Source/Document/MaterialDocument.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index c5b5bec8df..f25400721e 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -348,7 +348,7 @@ namespace MaterialEditor AZ::RPI::MaterialPropertyValue propertyValue = AtomToolsFramework::ConvertToRuntimeType(it->second.GetValue()); if (propertyValue.IsValid()) { - if (!AtomToolsFramework::ConvertToExportFormat(exportPath, propertyId, *propertyDefinition, propertyValue)) + if (!AtomToolsFramework::ConvertToExportFormat(m_savePathNormalized, propertyId, *propertyDefinition, propertyValue)) { AZ_Error("MaterialDocument", false, "Document property could not be converted: '%s' in '%s'.", propertyId.GetCStr(), m_absolutePath.c_str()); addPropertiesResult = false; @@ -608,13 +608,13 @@ namespace MaterialEditor // Add material functors that are in the top-level functors list. const AZ::RPI::MaterialFunctorSourceData::EditorContext editorContext = AZ::RPI::MaterialFunctorSourceData::EditorContext(m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); - for (Ptr functorData : m_materialTypeSourceData.m_materialFunctorSourceData) + for (AZ::RPI::Ptr functorData : m_materialTypeSourceData.m_materialFunctorSourceData) { AZ::RPI::MaterialFunctorSourceData::FunctorResult result2 = functorData->CreateFunctor(editorContext); if (result2.IsSuccess()) { - Ptr& functor = result2.GetValue(); + AZ::RPI::Ptr& functor = result2.GetValue(); if (functor != nullptr) { m_editorFunctors.push_back(functor); @@ -634,13 +634,13 @@ namespace MaterialEditor const AZ::RPI::MaterialFunctorSourceData::EditorContext editorContext = AZ::RPI::MaterialFunctorSourceData::EditorContext( m_materialSourceData.m_materialType, m_materialAsset->GetMaterialPropertiesLayout()); - for (Ptr functorData : propertyGroup->GetFunctors()) + for (AZ::RPI::Ptr functorData : propertyGroup->GetFunctors()) { AZ::RPI::MaterialFunctorSourceData::FunctorResult result = functorData->CreateFunctor(editorContext); if (result.IsSuccess()) { - Ptr& functor = result.GetValue(); + AZ::RPI::Ptr& functor = result.GetValue(); if (functor != nullptr) { m_editorFunctors.push_back(functor); From f5fcab75d686f3a304e5a02675d1280b07e57252 Mon Sep 17 00:00:00 2001 From: AMZN-nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Mon, 31 Jan 2022 17:06:06 -0800 Subject: [PATCH 371/394] Display Gem Icons in Gem Catalog (#7294) Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Co-authored-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../Gem/PythonCoverage/preview.png | 4 +-- AutomatedTesting/Gem/Sponza/preview.png | 3 ++ AutomatedTesting/Gem/preview.png | 4 +-- .../Source/GemCatalog/GemCatalogScreen.cpp | 8 +++-- .../Source/GemCatalog/GemFilterWidget.cpp | 2 +- .../Source/GemCatalog/GemInspector.cpp | 7 ++++- .../Source/GemCatalog/GemInspector.h | 3 +- .../Source/GemCatalog/GemItemDelegate.cpp | 31 +++++++++++++------ .../Source/GemCatalog/GemItemDelegate.h | 13 +++++--- .../Source/ProjectManagerDefs.h | 2 ++ Gems/AssetValidation/preview.png | 4 +-- .../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/RHI/DX12/preview.png | 3 ++ Gems/Atom/RHI/Metal/preview.png | 3 ++ Gems/Atom/RHI/Null/preview.png | 3 ++ Gems/Atom/RHI/Vulkan/preview.png | 3 ++ Gems/Atom/RHI/preview.png | 3 ++ Gems/Atom/RPI/preview.png | 3 ++ .../Atom/Tools/AtomToolsFramework/preview.png | 3 ++ Gems/Atom/Tools/MaterialEditor/preview.png | 3 ++ Gems/Atom/preview.png | 3 ++ .../ReferenceMaterials/preview.png | 3 ++ Gems/AtomContent/Sponza/preview.png | 3 ++ Gems/AtomContent/preview.png | 3 ++ Gems/AtomLyIntegration/AtomBridge/preview.png | 3 ++ Gems/AtomLyIntegration/AtomFont/preview.png | 3 ++ .../AtomImGuiTools/preview.png | 3 ++ .../AtomViewportDisplayIcons/preview.png | 3 ++ .../AtomViewportDisplayInfo/preview.png | 3 ++ .../CommonFeatures/preview.png | 3 ++ .../EMotionFXAtom/preview.png | 3 ++ Gems/AtomLyIntegration/ImguiAtom/preview.png | 3 ++ .../DccScriptingInterface/preview.png | 3 ++ Gems/AtomLyIntegration/preview.png | 3 ++ Gems/AtomTressFX/preview.png | 3 ++ Gems/AudioEngineWwise/preview.png | 4 +-- Gems/AudioSystem/preview.png | 4 +-- Gems/CrashReporting/preview.png | 4 +-- Gems/CustomAssetExample/preview.png | 4 +-- Gems/DebugDraw/preview.png | 4 +-- Gems/EMotionFX/preview.png | 3 ++ Gems/EditorPythonBindings/preview.png | 4 +-- Gems/ExpressionEvaluation/preview.png | 4 +-- Gems/GraphModel/preview.png | 3 ++ Gems/LandscapeCanvas/preview.png | 3 ++ Gems/LmbrCentral/preview.png | 4 +-- Gems/Maestro/preview.png | 4 +-- Gems/MotionMatching/preview.png | 4 +-- Gems/MultiplayerCompression/preview.png | 4 +-- Gems/NvCloth/preview.png | 4 +-- Gems/Prefab/PrefabBuilder/preview.png | 3 ++ Gems/Presence/preview.png | 4 +-- Gems/PrimitiveAssets/preview.png | 4 +-- Gems/Profiler/preview.png | 4 +-- Gems/PythonAssetBuilder/preview.png | 4 +-- Gems/QtForPython/preview.png | 4 +-- Gems/ScriptedEntityTweener/preview.png | 4 +-- Gems/SliceFavorites/preview.png | 4 +-- Gems/StartingPointCamera/preview.png | 4 +-- Gems/StartingPointInput/preview.png | 4 +-- Gems/StartingPointMovement/preview.png | 4 +-- Gems/Terrain/preview.png | 3 ++ Gems/TestAssetBuilder/preview.png | 4 +-- Gems/TextureAtlas/preview.png | 4 +-- Gems/VideoPlaybackFramework/preview.png | 4 +-- Gems/WhiteBox/preview.png | 4 +-- 70 files changed, 205 insertions(+), 79 deletions(-) create mode 100644 AutomatedTesting/Gem/Sponza/preview.png create mode 100644 Gems/Atom/Asset/ImageProcessingAtom/preview.png create mode 100644 Gems/Atom/Asset/Shader/preview.png create mode 100644 Gems/Atom/Bootstrap/preview.png create mode 100644 Gems/Atom/Component/DebugCamera/preview.png create mode 100644 Gems/Atom/Feature/Common/preview.png create mode 100644 Gems/Atom/RHI/DX12/preview.png create mode 100644 Gems/Atom/RHI/Metal/preview.png create mode 100644 Gems/Atom/RHI/Null/preview.png create mode 100644 Gems/Atom/RHI/Vulkan/preview.png create mode 100644 Gems/Atom/RHI/preview.png create mode 100644 Gems/Atom/RPI/preview.png create mode 100644 Gems/Atom/Tools/AtomToolsFramework/preview.png create mode 100644 Gems/Atom/Tools/MaterialEditor/preview.png create mode 100644 Gems/Atom/preview.png create mode 100644 Gems/AtomContent/ReferenceMaterials/preview.png create mode 100644 Gems/AtomContent/Sponza/preview.png create mode 100644 Gems/AtomContent/preview.png create mode 100644 Gems/AtomLyIntegration/AtomBridge/preview.png create mode 100644 Gems/AtomLyIntegration/AtomFont/preview.png create mode 100644 Gems/AtomLyIntegration/AtomImGuiTools/preview.png create mode 100644 Gems/AtomLyIntegration/AtomViewportDisplayIcons/preview.png create mode 100644 Gems/AtomLyIntegration/AtomViewportDisplayInfo/preview.png create mode 100644 Gems/AtomLyIntegration/CommonFeatures/preview.png create mode 100644 Gems/AtomLyIntegration/EMotionFXAtom/preview.png create mode 100644 Gems/AtomLyIntegration/ImguiAtom/preview.png create mode 100644 Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png create mode 100644 Gems/AtomLyIntegration/preview.png create mode 100644 Gems/AtomTressFX/preview.png create mode 100644 Gems/EMotionFX/preview.png create mode 100644 Gems/GraphModel/preview.png create mode 100644 Gems/LandscapeCanvas/preview.png create mode 100644 Gems/Prefab/PrefabBuilder/preview.png create mode 100644 Gems/Terrain/preview.png diff --git a/AutomatedTesting/Gem/PythonCoverage/preview.png b/AutomatedTesting/Gem/PythonCoverage/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/AutomatedTesting/Gem/PythonCoverage/preview.png +++ b/AutomatedTesting/Gem/PythonCoverage/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/AutomatedTesting/Gem/Sponza/preview.png b/AutomatedTesting/Gem/Sponza/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/AutomatedTesting/Gem/Sponza/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/AutomatedTesting/Gem/preview.png b/AutomatedTesting/Gem/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/AutomatedTesting/Gem/preview.png +++ b/AutomatedTesting/Gem/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp index ebabff45cc..8f8c8fb3cb 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp @@ -98,15 +98,17 @@ namespace O3DE::ProjectManager constexpr int minHeaderSectionWidth = 100; AdjustableHeaderWidget* listHeaderWidget = new AdjustableHeaderWidget( - QStringList{ tr("Gem Name"), tr("Gem Summary"), tr("Status") }, + QStringList{ tr("Gem Image"), tr("Gem Name"), tr("Gem Summary"), tr("Status") }, QVector{ - GemItemDelegate::s_defaultSummaryStartX - 30, + GemPreviewImageWidth + AdjustableHeaderWidget::s_headerTextIndent, + -GemPreviewImageWidth - AdjustableHeaderWidget::s_headerTextIndent + GemItemDelegate::s_defaultSummaryStartX - 30, 0, // Section is set to stretch to fit - GemItemDelegate::s_buttonWidth + GemItemDelegate::s_itemMargins.left() + GemItemDelegate::s_itemMargins.right() + GemItemDelegate::s_contentMargins.right() + GemItemDelegate::s_statusIconSize + GemItemDelegate::s_statusButtonSpacing + GemItemDelegate::s_buttonWidth + GemItemDelegate::s_contentMargins.right() }, minHeaderSectionWidth, QVector { + QHeaderView::ResizeMode::Fixed, QHeaderView::ResizeMode::Interactive, QHeaderView::ResizeMode::Stretch, QHeaderView::ResizeMode::Fixed diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp index d960145057..e46f71106b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp @@ -116,7 +116,7 @@ namespace O3DE::ProjectManager // Separating line QFrame* hLine = new QFrame(); hLine->setFrameShape(QFrame::HLine); - hLine->setStyleSheet("color: #666666;"); + hLine->setObjectName("horizontalSeparatingLine"); vLayout->addWidget(hLine); UpdateCollapseState(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp index 8bdd1f0f0f..f6689281b8 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp @@ -8,7 +8,9 @@ #include #include +#include +#include #include #include #include @@ -118,10 +120,12 @@ namespace O3DE::ProjectManager { m_dependingGems->Update(tr("Depending Gems"), tr("The following Gems will be automatically enabled with this Gem."), dependingGemTags); m_dependingGems->show(); + m_dependingGemsSpacer->changeSize(0, 20, QSizePolicy::Fixed, QSizePolicy::Fixed); } else { m_dependingGems->hide(); + m_dependingGemsSpacer->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed); } // Additional information @@ -246,7 +250,8 @@ namespace O3DE::ProjectManager m_dependingGems = new GemsSubWidget(); connect(m_dependingGems, &GemsSubWidget::TagClicked, this, [this](const Tag& tag){ emit TagClicked(tag); }); m_mainLayout->addWidget(m_dependingGems); - m_mainLayout->addSpacing(20); + m_dependingGemsSpacer = new QSpacerItem(0, 20, QSizePolicy::Fixed, QSizePolicy::Fixed); + m_mainLayout->addSpacerItem(m_dependingGemsSpacer); // Additional information QLabel* additionalInfoLabel = CreateStyledLabel(m_mainLayout, 14, s_headerColor); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h index c71d43eaac..96cbe23ee9 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.h @@ -75,8 +75,9 @@ namespace O3DE::ProjectManager QLabel* m_requirementsTextLabel = nullptr; QSpacerItem* m_requirementsMainSpacer = nullptr; - // Depending and conflicting gems + // Depending gems GemsSubWidget* m_dependingGems = nullptr; + QSpacerItem* m_dependingGemsSpacer = nullptr; // Additional information QLabel* m_versionLabel = nullptr; diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index 1733257e3b..2b9c21bff7 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -25,6 +26,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -117,18 +119,27 @@ namespace O3DE::ProjectManager painter->restore(); } + // Gem preview + QString previewPath = QDir(GemModel::GetPath(modelIndex)).filePath(ProjectPreviewImagePath); + QPixmap gemPreviewImage(previewPath); + QRect gemPreviewRect( + contentRect.left() + AdjustableHeaderWidget::s_headerTextIndent, + contentRect.center().y() - GemPreviewImageHeight / 2, + GemPreviewImageWidth, GemPreviewImageHeight); + painter->drawPixmap(gemPreviewRect, gemPreviewImage); + // Gem name QString gemName = GemModel::GetDisplayName(modelIndex); QFont gemNameFont(options.font); QPair nameXBounds = CalcColumnXBounds(HeaderOrder::Name); const int nameStartX = nameXBounds.first; - const int firstColumnTextStartX = s_itemMargins.left() + nameStartX + AdjustableHeaderWidget::s_headerTextIndent; - const int firstColumnMaxTextWidth = nameXBounds.second - nameStartX - AdjustableHeaderWidget::s_headerTextIndent; + const int nameColumnTextStartX = s_itemMargins.left() + nameStartX + AdjustableHeaderWidget::s_headerTextIndent; + const int nameColumnMaxTextWidth = nameXBounds.second - nameStartX - AdjustableHeaderWidget::s_headerTextIndent; gemNameFont.setPixelSize(static_cast(s_gemNameFontSize)); gemNameFont.setBold(true); - gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth); + gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, nameColumnMaxTextWidth); QRect gemNameRect = GetTextRect(gemNameFont, gemName, s_gemNameFontSize); - gemNameRect.moveTo(firstColumnTextStartX, contentRect.top()); + gemNameRect.moveTo(nameColumnTextStartX, contentRect.top()); painter->setFont(gemNameFont); painter->setPen(m_textColor); gemNameRect = painter->boundingRect(gemNameRect, Qt::TextSingleLine, gemName); @@ -136,9 +147,9 @@ namespace O3DE::ProjectManager // Gem creator QString gemCreator = GemModel::GetCreator(modelIndex); - gemCreator = standardFontMetrics.elidedText(gemCreator, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth); + gemCreator = standardFontMetrics.elidedText(gemCreator, Qt::TextElideMode::ElideRight, nameColumnMaxTextWidth); QRect gemCreatorRect = GetTextRect(standardFont, gemCreator, s_fontSize); - gemCreatorRect.moveTo(firstColumnTextStartX, contentRect.top() + gemNameRect.height()); + gemCreatorRect.moveTo(nameColumnTextStartX, contentRect.top() + gemNameRect.height()); painter->setFont(standardFont); gemCreatorRect = painter->boundingRect(gemCreatorRect, Qt::TextSingleLine, gemCreator); @@ -161,7 +172,7 @@ namespace O3DE::ProjectManager QRect GemItemDelegate::CalcSummaryRect(const QRect& contentRect, bool hasTags) const { - const int featureTagAreaHeight = 30; + const int featureTagAreaHeight = 40; const int summaryHeight = contentRect.height() - (hasTags * featureTagAreaHeight); const auto [summaryStartX, summaryEndX] = CalcColumnXBounds(HeaderOrder::Summary); @@ -316,7 +327,7 @@ namespace O3DE::ProjectManager QRect GemItemDelegate::CalcButtonRect(const QRect& contentRect) const { - const QPoint topLeft = QPoint( + const QPoint topLeft = QPoint( s_itemMargins.left() + CalcColumnXBounds(HeaderOrder::Status).first + AdjustableHeaderWidget::s_headerTextIndent + s_statusIconSize + s_statusButtonSpacing, contentRect.center().y() - s_buttonHeight / 2); @@ -327,7 +338,7 @@ namespace O3DE::ProjectManager void GemItemDelegate::DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const { const GemInfo::Platforms platforms = GemModel::GetPlatforms(modelIndex); - int startX = 0; + int startX = s_itemMargins.left() + CalcColumnXBounds(HeaderOrder::Name).first + AdjustableHeaderWidget::s_headerTextIndent; // Iterate and draw the platforms in the order they are defined in the enum. for (int i = 0; i < GemInfo::NumPlatforms; ++i) @@ -453,7 +464,7 @@ namespace O3DE::ProjectManager } else { - circleCenter = buttonRect.center() + QPoint(-buttonRect.width() / 2 + s_buttonBorderRadius, 1); + circleCenter = buttonRect.center() + QPoint(-buttonRect.width() / 2 + s_buttonBorderRadius + 1, 1); } // Rounded rect diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h index a08fcb0a4b..f034ffce10 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h @@ -47,11 +47,11 @@ namespace O3DE::ProjectManager inline constexpr static int s_height = 105; // Gem item total height inline constexpr static qreal s_gemNameFontSize = 13.0; inline constexpr static qreal s_fontSize = 12.0; - inline constexpr static int s_defaultSummaryStartX = 190; + inline constexpr static int s_defaultSummaryStartX = 270; // Margin and borders - inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/16, /*top=*/8, /*right=*/16, /*bottom=*/8); // Item border distances - inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/20, /*top=*/12, /*right=*/20, /*bottom=*/12); // Distances of the elements within an item to the item borders + inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/16, /*top=*/5, /*right=*/16, /*bottom=*/5); // Item border distances + inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/10, /*top=*/12, /*right=*/20, /*bottom=*/12); // Distances of the elements within an item to the item borders inline constexpr static int s_borderWidth = 4; inline constexpr static int s_extraSummarySpacing = s_itemMargins.right(); @@ -68,8 +68,13 @@ namespace O3DE::ProjectManager inline constexpr static int s_featureTagBorderMarginY = 3; inline constexpr static int s_featureTagSpacing = 7; + // Status icon + inline constexpr static int s_statusIconSize = 16; + inline constexpr static int s_statusButtonSpacing = 5; + enum class HeaderOrder { + Preview, Name, Summary, Status @@ -109,8 +114,6 @@ namespace O3DE::ProjectManager // Status icons void SetStatusIcon(QPixmap& m_iconPixmap, const QString& iconPath); - inline constexpr static int s_statusIconSize = 16; - inline constexpr static int s_statusButtonSpacing = 5; QPixmap m_unknownStatusPixmap; QPixmap m_notDownloadedPixmap; diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h index f184fd2e17..9b2cd73d77 100644 --- a/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h +++ b/Code/Tools/ProjectManager/Source/ProjectManagerDefs.h @@ -15,6 +15,8 @@ namespace O3DE::ProjectManager inline constexpr static int ProjectPreviewImageWidth = 210; inline constexpr static int ProjectPreviewImageHeight = 280; inline constexpr static int ProjectTemplateImageWidth = 92; + inline constexpr static int GemPreviewImageWidth = 70; + inline constexpr static int GemPreviewImageHeight = 40; inline constexpr static int ProjectCommandLineTimeoutSeconds = 30; static const QString ProjectBuildDirectoryName = "build"; diff --git a/Gems/AssetValidation/preview.png b/Gems/AssetValidation/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/AssetValidation/preview.png +++ b/Gems/AssetValidation/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/preview.png b/Gems/Atom/Asset/ImageProcessingAtom/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Asset/Shader/preview.png b/Gems/Atom/Asset/Shader/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Asset/Shader/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Bootstrap/preview.png b/Gems/Atom/Bootstrap/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Bootstrap/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Component/DebugCamera/preview.png b/Gems/Atom/Component/DebugCamera/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Component/DebugCamera/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Feature/Common/preview.png b/Gems/Atom/Feature/Common/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Feature/Common/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/RHI/DX12/preview.png b/Gems/Atom/RHI/DX12/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/RHI/DX12/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/RHI/Metal/preview.png b/Gems/Atom/RHI/Metal/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/RHI/Metal/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/RHI/Null/preview.png b/Gems/Atom/RHI/Null/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/RHI/Null/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/RHI/Vulkan/preview.png b/Gems/Atom/RHI/Vulkan/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/RHI/Vulkan/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/RHI/preview.png b/Gems/Atom/RHI/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/RHI/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/RPI/preview.png b/Gems/Atom/RPI/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/RPI/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Tools/AtomToolsFramework/preview.png b/Gems/Atom/Tools/AtomToolsFramework/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/Tools/MaterialEditor/preview.png b/Gems/Atom/Tools/MaterialEditor/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/Tools/MaterialEditor/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Atom/preview.png b/Gems/Atom/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Atom/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomContent/ReferenceMaterials/preview.png b/Gems/AtomContent/ReferenceMaterials/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomContent/ReferenceMaterials/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomContent/Sponza/preview.png b/Gems/AtomContent/Sponza/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomContent/Sponza/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomContent/preview.png b/Gems/AtomContent/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomContent/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/AtomBridge/preview.png b/Gems/AtomLyIntegration/AtomBridge/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomBridge/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/AtomFont/preview.png b/Gems/AtomLyIntegration/AtomFont/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomFont/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/preview.png b/Gems/AtomLyIntegration/AtomImGuiTools/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomImGuiTools/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/preview.png b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/preview.png b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/CommonFeatures/preview.png b/Gems/AtomLyIntegration/CommonFeatures/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/preview.png b/Gems/AtomLyIntegration/EMotionFXAtom/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/ImguiAtom/preview.png b/Gems/AtomLyIntegration/ImguiAtom/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/ImguiAtom/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomLyIntegration/preview.png b/Gems/AtomLyIntegration/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomLyIntegration/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AtomTressFX/preview.png b/Gems/AtomTressFX/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/AtomTressFX/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AudioEngineWwise/preview.png b/Gems/AudioEngineWwise/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/AudioEngineWwise/preview.png +++ b/Gems/AudioEngineWwise/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/AudioSystem/preview.png b/Gems/AudioSystem/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/AudioSystem/preview.png +++ b/Gems/AudioSystem/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/CrashReporting/preview.png b/Gems/CrashReporting/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/CrashReporting/preview.png +++ b/Gems/CrashReporting/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/CustomAssetExample/preview.png b/Gems/CustomAssetExample/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/CustomAssetExample/preview.png +++ b/Gems/CustomAssetExample/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/DebugDraw/preview.png b/Gems/DebugDraw/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/DebugDraw/preview.png +++ b/Gems/DebugDraw/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/EMotionFX/preview.png b/Gems/EMotionFX/preview.png new file mode 100644 index 0000000000..b3b6192ad5 --- /dev/null +++ b/Gems/EMotionFX/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0f8ffb4980f6cfc34135f4a4b9967293ff34bcdb37019181cb22c6a07067ce8 +size 57461 diff --git a/Gems/EditorPythonBindings/preview.png b/Gems/EditorPythonBindings/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/EditorPythonBindings/preview.png +++ b/Gems/EditorPythonBindings/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/ExpressionEvaluation/preview.png b/Gems/ExpressionEvaluation/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/ExpressionEvaluation/preview.png +++ b/Gems/ExpressionEvaluation/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/GraphModel/preview.png b/Gems/GraphModel/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/GraphModel/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/LandscapeCanvas/preview.png b/Gems/LandscapeCanvas/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/LandscapeCanvas/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/LmbrCentral/preview.png b/Gems/LmbrCentral/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/LmbrCentral/preview.png +++ b/Gems/LmbrCentral/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Maestro/preview.png b/Gems/Maestro/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/Maestro/preview.png +++ b/Gems/Maestro/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/MotionMatching/preview.png b/Gems/MotionMatching/preview.png index 0f393ac886..2979dbb6a4 100644 --- a/Gems/MotionMatching/preview.png +++ b/Gems/MotionMatching/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ac9dd09bde78f389e3725ac49d61eff109857e004840bc0bc3881739df9618d -size 2217 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/MultiplayerCompression/preview.png b/Gems/MultiplayerCompression/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/MultiplayerCompression/preview.png +++ b/Gems/MultiplayerCompression/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/NvCloth/preview.png b/Gems/NvCloth/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/NvCloth/preview.png +++ b/Gems/NvCloth/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Prefab/PrefabBuilder/preview.png b/Gems/Prefab/PrefabBuilder/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Prefab/PrefabBuilder/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Presence/preview.png b/Gems/Presence/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/Presence/preview.png +++ b/Gems/Presence/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/PrimitiveAssets/preview.png b/Gems/PrimitiveAssets/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/PrimitiveAssets/preview.png +++ b/Gems/PrimitiveAssets/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Profiler/preview.png b/Gems/Profiler/preview.png index 0f393ac886..2979dbb6a4 100644 --- a/Gems/Profiler/preview.png +++ b/Gems/Profiler/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ac9dd09bde78f389e3725ac49d61eff109857e004840bc0bc3881739df9618d -size 2217 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/PythonAssetBuilder/preview.png b/Gems/PythonAssetBuilder/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/PythonAssetBuilder/preview.png +++ b/Gems/PythonAssetBuilder/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/QtForPython/preview.png b/Gems/QtForPython/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/QtForPython/preview.png +++ b/Gems/QtForPython/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/ScriptedEntityTweener/preview.png b/Gems/ScriptedEntityTweener/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/ScriptedEntityTweener/preview.png +++ b/Gems/ScriptedEntityTweener/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/SliceFavorites/preview.png b/Gems/SliceFavorites/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/SliceFavorites/preview.png +++ b/Gems/SliceFavorites/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/StartingPointCamera/preview.png b/Gems/StartingPointCamera/preview.png index a8457c7f6e..2979dbb6a4 100644 --- a/Gems/StartingPointCamera/preview.png +++ b/Gems/StartingPointCamera/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7917fbf6e4e3a89e3432b8f48822b660bb245d2b84bb8efdf9f715593c0973df -size 38792 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/StartingPointInput/preview.png b/Gems/StartingPointInput/preview.png index a8457c7f6e..2979dbb6a4 100644 --- a/Gems/StartingPointInput/preview.png +++ b/Gems/StartingPointInput/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7917fbf6e4e3a89e3432b8f48822b660bb245d2b84bb8efdf9f715593c0973df -size 38792 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/StartingPointMovement/preview.png b/Gems/StartingPointMovement/preview.png index a8457c7f6e..2979dbb6a4 100644 --- a/Gems/StartingPointMovement/preview.png +++ b/Gems/StartingPointMovement/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7917fbf6e4e3a89e3432b8f48822b660bb245d2b84bb8efdf9f715593c0973df -size 38792 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/Terrain/preview.png b/Gems/Terrain/preview.png new file mode 100644 index 0000000000..2979dbb6a4 --- /dev/null +++ b/Gems/Terrain/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/TestAssetBuilder/preview.png b/Gems/TestAssetBuilder/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/TestAssetBuilder/preview.png +++ b/Gems/TestAssetBuilder/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/TextureAtlas/preview.png b/Gems/TextureAtlas/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/TextureAtlas/preview.png +++ b/Gems/TextureAtlas/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/VideoPlaybackFramework/preview.png b/Gems/VideoPlaybackFramework/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/VideoPlaybackFramework/preview.png +++ b/Gems/VideoPlaybackFramework/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 diff --git a/Gems/WhiteBox/preview.png b/Gems/WhiteBox/preview.png index 2f1ed47754..2979dbb6a4 100644 --- a/Gems/WhiteBox/preview.png +++ b/Gems/WhiteBox/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 +oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 +size 1232 From dd0f21b46067899a854122215b0ac69d7fd93862 Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Tue, 1 Feb 2022 09:36:42 +0000 Subject: [PATCH 372/394] Fix incorrect icon rendering (#6454) * fix incorrect icon rendering Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add redundant parens Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add tests for icon display fixes Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update references to EditorVisibleEntityDataCache to EditorVisibleEntityDataCacheInterface Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * updates following review feedback and remaining updates for EditorVisibleEntityDataCacheInterface Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../AzManipulatorTestFramework.h | 2 - .../ViewportInteraction.h | 23 +--- .../Source/ViewportInteraction.cpp | 55 --------- .../PropertyEditor/PropertyEntityIdCtrl.cpp | 2 +- .../UnitTest/AzToolsFrameworkTestHelpers.cpp | 55 +++++++++ .../UnitTest/AzToolsFrameworkTestHelpers.h | 39 +++++- .../MockEditorViewportIconDisplayInterface.h | 27 ++++ ...ockEditorVisibleEntityDataCacheInterface.h | 37 ++++++ .../UnitTest/Mocks/MockFocusModeInterface.h | 29 +++++ .../EditorDefaultSelection.cpp | 3 +- .../EditorDefaultSelection.h | 13 +- .../ViewportSelection/EditorHelpers.cpp | 30 +++-- .../ViewportSelection/EditorHelpers.h | 6 +- .../EditorInteractionSystemComponent.cpp | 2 +- ...ractionSystemViewportSelectionRequestBus.h | 4 +- .../EditorPickEntitySelection.cpp | 2 +- .../EditorPickEntitySelection.h | 6 +- .../EditorTransformComponentSelection.cpp | 6 +- .../EditorTransformComponentSelection.h | 10 +- .../EditorVisibleEntityDataCache.h | 56 ++++++--- .../aztoolsframeworktestcommon_files.cmake | 3 + ...EditorTransformComponentSelectionTests.cpp | 2 +- .../Tests/EditorViewportIconTests.cpp | 116 ++++++++++++++++++ .../Viewport/ViewportEditorModeTests.cpp | 6 +- .../Tests/aztoolsframeworktests_files.cmake | 1 + 25 files changed, 397 insertions(+), 138 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorViewportIconDisplayInterface.h create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorVisibleEntityDataCacheInterface.h create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockFocusModeInterface.h create mode 100644 Code/Framework/AzToolsFramework/Tests/EditorViewportIconTests.cpp diff --git a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/AzManipulatorTestFramework.h b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/AzManipulatorTestFramework.h index 865a571d3b..b5251d6e97 100644 --- a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/AzManipulatorTestFramework.h +++ b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/AzManipulatorTestFramework.h @@ -47,8 +47,6 @@ namespace AzManipulatorTestFramework virtual void UpdateVisibility() = 0; //! Sets if sticky select is enabled or not. virtual void SetStickySelect(bool enabled) = 0; - //! Gets default Editor Camera Position. - virtual AZ::Vector3 DefaultEditorCameraPosition() const = 0; //! Sets if icons are visible in the viewport. virtual void SetIconsVisible(bool visible) = 0; //! Sets if helpers are visible in the viewport. diff --git a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h index f29245bb34..3de54e9e6d 100644 --- a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h +++ b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h @@ -10,6 +10,7 @@ #include #include +#include namespace AzFramework { @@ -22,7 +23,7 @@ namespace AzManipulatorTestFramework class ViewportInteraction : public ViewportInteractionInterface , public AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::Handler - , public AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler + , public UnitTest::ViewportSettingsTestImpl , private AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler { public: @@ -50,19 +51,6 @@ namespace AzManipulatorTestFramework const AzFramework::ScreenPoint& screenPosition) override; float DeviceScalingFactor() override; - // ViewportSettingsRequestBus overrides ... - bool GridSnappingEnabled() const override; - float GridSize() const override; - bool ShowGrid() const override; - bool AngleSnappingEnabled() const override; - float AngleStep() const override; - float ManipulatorLineBoundWidth() const override; - float ManipulatorCircleBoundWidth() const override; - bool StickySelectEnabled() const override; - AZ::Vector3 DefaultEditorCameraPosition() const override; - bool IconsVisible() const override; - bool HelpersVisible() const override; - // EditorEntityViewportInteractionRequestBus overrides ... void FindVisibleEntities(AZStd::vector& visibleEntities) override; @@ -72,12 +60,5 @@ namespace AzManipulatorTestFramework AzFramework::EntityVisibilityQuery m_entityVisibilityQuery; AZStd::shared_ptr m_debugDisplayRequests; AzFramework::CameraState m_cameraState; - float m_gridSize = 1.0f; - float m_angularStep = 0.0f; - bool m_gridSnapping = false; - bool m_angularSnapping = false; - bool m_stickySelect = true; - bool m_iconsVisible = true; - bool m_helpersVisible = true; }; } // namespace AzManipulatorTestFramework diff --git a/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp b/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp index b7fd5e2b73..0eac957a0a 100644 --- a/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp +++ b/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp @@ -37,46 +37,6 @@ namespace AzManipulatorTestFramework return m_cameraState; } - bool ViewportInteraction::GridSnappingEnabled() const - { - return m_gridSnapping; - } - - float ViewportInteraction::GridSize() const - { - return m_gridSize; - } - - bool ViewportInteraction::ShowGrid() const - { - return false; - } - - bool ViewportInteraction::AngleSnappingEnabled() const - { - return m_angularSnapping; - } - - float ViewportInteraction::AngleStep() const - { - return m_angularStep; - } - - float ViewportInteraction::ManipulatorLineBoundWidth() const - { - return 0.1f; - } - - float ViewportInteraction::ManipulatorCircleBoundWidth() const - { - return 0.1f; - } - - bool ViewportInteraction::StickySelectEnabled() const - { - return m_stickySelect; - } - void ViewportInteraction::FindVisibleEntities(AZStd::vector& visibleEntitiesOut) { visibleEntitiesOut.assign(m_entityVisibilityQuery.Begin(), m_entityVisibilityQuery.End()); @@ -127,11 +87,6 @@ namespace AzManipulatorTestFramework m_helpersVisible = visible; } - AZ::Vector3 ViewportInteraction::DefaultEditorCameraPosition() const - { - return {}; - } - void ViewportInteraction::SetGridSize(float size) { m_gridSize = size; @@ -162,14 +117,4 @@ namespace AzManipulatorTestFramework { return 1.0f; } - - bool ViewportInteraction::IconsVisible() const - { - return m_iconsVisible; - } - - bool ViewportInteraction::HelpersVisible() const - { - return m_helpersVisible; - } } // namespace AzManipulatorTestFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEntityIdCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEntityIdCtrl.cpp index 7a9a5a4d7a..6d32145742 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEntityIdCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEntityIdCtrl.cpp @@ -122,7 +122,7 @@ namespace AzToolsFramework EditorInteractionSystemViewportSelectionRequestBus::Event( GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetHandler, - [](const EditorVisibleEntityDataCache* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) + [](const EditorVisibleEntityDataCacheInterface* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { return AZStd::make_unique(entityDataCache, viewportEditorModeTracker); }); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp index 7f877facb6..dca1da64d8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp @@ -90,6 +90,61 @@ namespace UnitTest return AZStd::string(keyText.toUtf8().data()); } + bool ViewportSettingsTestImpl::GridSnappingEnabled() const + { + return m_gridSnapping; + } + + float ViewportSettingsTestImpl::GridSize() const + { + return m_gridSize; + } + + bool ViewportSettingsTestImpl::ShowGrid() const + { + return false; + } + + bool ViewportSettingsTestImpl::AngleSnappingEnabled() const + { + return m_angularSnapping; + } + + float ViewportSettingsTestImpl::AngleStep() const + { + return m_angularStep; + } + + float ViewportSettingsTestImpl::ManipulatorLineBoundWidth() const + { + return 0.1f; + } + + float ViewportSettingsTestImpl::ManipulatorCircleBoundWidth() const + { + return 0.1f; + } + + bool ViewportSettingsTestImpl::StickySelectEnabled() const + { + return m_stickySelect; + } + + bool ViewportSettingsTestImpl::IconsVisible() const + { + return m_iconsVisible; + } + + bool ViewportSettingsTestImpl::HelpersVisible() const + { + return m_helpersVisible; + } + + AZ::Vector3 ViewportSettingsTestImpl::DefaultEditorCameraPosition() const + { + return {}; + } + bool TestWidget::eventFilter(QObject* watched, QEvent* event) { AZ_UNUSED(watched); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h index 2c60ca914c..e5a655cfee 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h @@ -91,6 +91,43 @@ namespace UnitTest /// @param modifiers Optional keyboard modifiers to include during the wheel events, defaults to Qt::NoModifier AZStd::string QtKeyToAzString(Qt::Key key, Qt::KeyboardModifiers modifiers = Qt::NoModifier); + //! Test implementation of the ViewportSettingsRequestBus. + //! @note Can be used to customize viewport settings during test execution. + class ViewportSettingsTestImpl : public AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler + { + public: + void Connect(const AzFramework::ViewportId viewportId) + { + AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler::BusConnect(viewportId); + } + + void Disconnect() + { + AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler::BusDisconnect(); + } + + // ViewportSettingsRequestBus overrides ... + bool GridSnappingEnabled() const override; + float GridSize() const override; + bool ShowGrid() const override; + bool AngleSnappingEnabled() const override; + float AngleStep() const override; + float ManipulatorLineBoundWidth() const override; + float ManipulatorCircleBoundWidth() const override; + bool StickySelectEnabled() const override; + AZ::Vector3 DefaultEditorCameraPosition() const override; + bool IconsVisible() const override; + bool HelpersVisible() const override; + + float m_gridSize = 1.0f; + float m_angularStep = 0.0f; + bool m_gridSnapping = false; + bool m_angularSnapping = false; + bool m_stickySelect = true; + bool m_iconsVisible = true; + bool m_helpersVisible = true; + }; + /// Test widget to store QActions generated by EditorTransformComponentSelection. class TestWidget : public QWidget { @@ -207,7 +244,7 @@ namespace UnitTest m_editorActions.Connect(); const auto viewportHandlerBuilder = - [this](const AzToolsFramework::EditorVisibleEntityDataCache* entityDataCache, + [this](const AzToolsFramework::EditorVisibleEntityDataCacheInterface* entityDataCache, [[maybe_unused]] AzToolsFramework::ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { // create the default viewport (handles ComponentMode) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorViewportIconDisplayInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorViewportIconDisplayInterface.h new file mode 100644 index 0000000000..be29837b59 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorViewportIconDisplayInterface.h @@ -0,0 +1,27 @@ +/* + * 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 UnitTest +{ + class MockEditorViewportIconDisplayInterface : public AZ::Interface::Registrar + { + public: + virtual ~MockEditorViewportIconDisplayInterface() = default; + + //! AzToolsFramework::EditorViewportIconDisplayInterface overrides ... + MOCK_METHOD1(DrawIcon, void(const DrawParameters&)); + MOCK_METHOD1(GetOrLoadIconForPath, IconId(AZStd::string_view path)); + MOCK_METHOD1(GetIconLoadStatus, IconLoadStatus(IconId icon)); + }; +} // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorVisibleEntityDataCacheInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorVisibleEntityDataCacheInterface.h new file mode 100644 index 0000000000..4fc35fa9aa --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockEditorVisibleEntityDataCacheInterface.h @@ -0,0 +1,37 @@ +/* + * 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 UnitTest +{ + class MockEditorVisibleEntityDataCacheInterface : public AzToolsFramework::EditorVisibleEntityDataCacheInterface + { + using ComponentEntityAccentType = AzToolsFramework::Components::EditorSelectionAccentSystemComponent::ComponentEntityAccentType; + + public: + virtual ~MockEditorVisibleEntityDataCacheInterface() = default; + + // AzToolsFramework::EditorVisibleEntityDataCacheInterface overrides ... + MOCK_CONST_METHOD0(VisibleEntityDataCount, size_t()); + MOCK_CONST_METHOD1(GetVisibleEntityPosition, AZ::Vector3(size_t)); + MOCK_CONST_METHOD1(GetVisibleEntityTransform, const AZ::Transform&(size_t)); + MOCK_CONST_METHOD1(GetVisibleEntityId, AZ::EntityId(size_t)); + MOCK_CONST_METHOD1(GetVisibleEntityAccent, ComponentEntityAccentType(size_t)); + MOCK_CONST_METHOD1(IsVisibleEntityLocked, bool(size_t)); + MOCK_CONST_METHOD1(IsVisibleEntityVisible, bool(size_t)); + MOCK_CONST_METHOD1(IsVisibleEntitySelected, bool(size_t)); + MOCK_CONST_METHOD1(IsVisibleEntityIconHidden, bool(size_t)); + MOCK_CONST_METHOD1(IsVisibleEntityIndividuallySelectableInViewport, bool(size_t)); + MOCK_CONST_METHOD1(GetVisibleEntityIndexFromId, AZStd::optional(AZ::EntityId entityId)); + }; +} // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockFocusModeInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockFocusModeInterface.h new file mode 100644 index 0000000000..7bb5db14c5 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/Mocks/MockFocusModeInterface.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 + +#include + +namespace UnitTest +{ + class MockFocusModeInterface : public AZ::Interface::Registrar + { + public: + virtual ~MockFocusModeInterface() = default; + + // AzToolsFramework::FocusModeInterface overrides ... + MOCK_METHOD1(SetFocusRoot, void(AZ::EntityId entityId)); + MOCK_METHOD1(ClearFocusRoot, void(AzFramework::EntityContextId entityContextId)); + MOCK_METHOD1(GetFocusRoot, AZ::EntityId(AzFramework::EntityContextId entityContextId)); + MOCK_METHOD1(GetFocusedEntities, AzToolsFramework::EntityIdList(AzFramework::EntityContextId entityContextId)); + MOCK_CONST_METHOD1(IsInFocusSubTree, bool(AZ::EntityId entityId)); + }; +} // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.cpp index 1541d4678e..4ae22ca899 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.cpp @@ -21,9 +21,8 @@ namespace AzToolsFramework AZ_CLASS_ALLOCATOR_IMPL(EditorDefaultSelection, AZ::SystemAllocator, 0) EditorDefaultSelection::EditorDefaultSelection( - const EditorVisibleEntityDataCache* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) + const EditorVisibleEntityDataCacheInterface* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) : m_phantomWidget(nullptr) - , m_entityDataCache(entityDataCache) , m_viewportEditorModeTracker(viewportEditorModeTracker) , m_componentModeCollection(viewportEditorModeTracker) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.h index f44de0d6eb..f940a3e6b2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorDefaultSelection.h @@ -27,7 +27,8 @@ namespace AzToolsFramework AZ_CLASS_ALLOCATOR_DECL //! @cond - EditorDefaultSelection(const EditorVisibleEntityDataCache* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker); + EditorDefaultSelection( + const EditorVisibleEntityDataCacheInterface* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker); EditorDefaultSelection(const EditorDefaultSelection&) = delete; EditorDefaultSelection& operator=(const EditorDefaultSelection&) = delete; virtual ~EditorDefaultSelection(); @@ -85,10 +86,8 @@ namespace AzToolsFramework QWidget m_phantomWidget; //!< The phantom widget responsible for holding QActions while in ComponentMode. QWidget* m_phantomOverrideWidget = nullptr; //!< It's possible to override the phantom widget in special circumstances (eg testing). ComponentModeFramework::ComponentModeCollection m_componentModeCollection; //!< Handles all active ComponentMode types. - AZStd::unique_ptr m_transformComponentSelection = - nullptr; //!< Viewport selection (responsible for - //!< manipulators and transform modifications). - const EditorVisibleEntityDataCache* m_entityDataCache = nullptr; //!< Reference to cached visible EntityData. + //! Viewport selection (responsible for manipulators and transform modifications). + AZStd::unique_ptr m_transformComponentSelection = nullptr; //! Mapping between passed ActionOverride (AddActionOverride) and allocated QAction. struct ActionOverrideMapping @@ -112,7 +111,7 @@ namespace AzToolsFramework AZStd::shared_ptr m_manipulatorManager; //!< The default manipulator manager. ViewportInteraction::MouseInteraction m_currentInteraction; //!< Current mouse interaction to be used for drawing manipulators. - ViewportEditorModeTrackerInterface* m_viewportEditorModeTracker = nullptr; //!< Tracker for activating/deactivating viewport editor modes. - + //! Tracker for activating/deactivating viewport editor modes. + ViewportEditorModeTrackerInterface* m_viewportEditorModeTracker = nullptr; }; } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp index ace2156d85..9b82129582 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp @@ -159,7 +159,7 @@ namespace AzToolsFramework return false; } - EditorHelpers::EditorHelpers(const EditorVisibleEntityDataCache* entityDataCache) + EditorHelpers::EditorHelpers(const EditorVisibleEntityDataCacheInterface* entityDataCache) : m_entityDataCache(entityDataCache) { m_focusModeInterface = AZ::Interface::Get(); @@ -344,9 +344,19 @@ namespace AzToolsFramework continue; } - int iconTextureId = 0; - EditorEntityIconComponentRequestBus::EventResult( - iconTextureId, entityId, &EditorEntityIconComponentRequests::GetEntityIconTextureId); + const AZ::Vector3& entityPosition = m_entityDataCache->GetVisibleEntityPosition(entityCacheIndex); + const AZ::Vector3 entityCameraVector = entityPosition - cameraState.m_position; + + if (const float directionFromCamera = entityCameraVector.Dot(cameraState.m_forward); directionFromCamera < 0.0f) + { + continue; + } + + const float distanceFromCamera = entityCameraVector.GetLength(); + if (distanceFromCamera < cameraState.m_nearClip) + { + continue; + } using ComponentEntityAccentType = Components::EditorSelectionAccentSystemComponent::ComponentEntityAccentType; const AZ::Color iconHighlight = [this, entityCacheIndex]() @@ -364,13 +374,13 @@ namespace AzToolsFramework return AZ::Color(1.0f, 1.0f, 1.0f, 1.0f); }(); - const AZ::Vector3& entityPosition = m_entityDataCache->GetVisibleEntityPosition(entityCacheIndex); - const float distanceFromCamera = cameraState.m_position.GetDistance(entityPosition); - const float iconSize = GetIconSize(distanceFromCamera); + int iconTextureId = 0; + EditorEntityIconComponentRequestBus::EventResult( + iconTextureId, entityId, &EditorEntityIconComponentRequestBus::Events::GetEntityIconTextureId); - editorViewportIconDisplay->DrawIcon({ viewportInfo.m_viewportId, iconTextureId, iconHighlight, entityPosition, - EditorViewportIconDisplayInterface::CoordinateSpace::WorldSpace, - AZ::Vector2{ iconSize, iconSize } }); + editorViewportIconDisplay->DrawIcon(EditorViewportIconDisplayInterface::DrawParameters{ + viewportInfo.m_viewportId, iconTextureId, iconHighlight, entityPosition, + EditorViewportIconDisplayInterface::CoordinateSpace::WorldSpace, AZ::Vector2(GetIconSize(distanceFromCamera)) }); } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h index 358e6d9117..b21e0b6737 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h @@ -24,7 +24,7 @@ namespace AzFramework namespace AzToolsFramework { - class EditorVisibleEntityDataCache; + class EditorVisibleEntityDataCacheInterface; class FocusModeInterface; namespace ViewportInteraction @@ -64,7 +64,7 @@ namespace AzToolsFramework //! An EditorVisibleEntityDataCache must be passed to EditorHelpers to allow it to //! efficiently read entity data without resorting to EBus calls. - explicit EditorHelpers(const EditorVisibleEntityDataCache* entityDataCache); + explicit EditorHelpers(const EditorVisibleEntityDataCacheInterface* entityDataCache); EditorHelpers(const EditorHelpers&) = delete; EditorHelpers& operator=(const EditorHelpers&) = delete; ~EditorHelpers() = default; @@ -103,7 +103,7 @@ namespace AzToolsFramework AZStd::unique_ptr m_invalidClicks; //!< Display for invalid click behavior. - const EditorVisibleEntityDataCache* m_entityDataCache = nullptr; //!< Entity Data queried by the EditorHelpers. + const EditorVisibleEntityDataCacheInterface* m_entityDataCache = nullptr; //!< Entity Data queried by the EditorHelpers. const FocusModeInterface* m_focusModeInterface = nullptr; //!< API to interact with focus mode functionality. }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp index 5d03231aab..17ffa2fdc1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp @@ -84,7 +84,7 @@ namespace AzToolsFramework void EditorInteractionSystemComponent::SetDefaultHandler() { SetHandler( - [](const EditorVisibleEntityDataCache* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) + [](const EditorVisibleEntityDataCacheInterface* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { return AZStd::make_unique(entityDataCache, viewportEditorModeTracker); }); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h index 3579460ca0..78fd8d3429 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h @@ -16,7 +16,7 @@ namespace AzToolsFramework { - class EditorVisibleEntityDataCache; + class EditorVisibleEntityDataCacheInterface; class ViewportEditorModeTrackerInterface; //! Bus to handle all mouse events originating from the viewport. @@ -34,7 +34,7 @@ namespace AzToolsFramework //! Alias for factory function to create a new type implementing the ViewportSelectionRequests interface. using ViewportSelectionRequestsBuilderFn = AZStd::function( - const EditorVisibleEntityDataCache*, ViewportEditorModeTrackerInterface*)>; + const EditorVisibleEntityDataCacheInterface*, ViewportEditorModeTrackerInterface*)>; //! Interface for system component implementing the ViewportSelectionRequests interface. //! This interface also includes a setter to set a custom handler also implementing diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp index 059b265f51..a853a9182d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp @@ -17,7 +17,7 @@ namespace AzToolsFramework AZ_CLASS_ALLOCATOR_IMPL(EditorPickEntitySelection, AZ::SystemAllocator, 0) EditorPickEntitySelection::EditorPickEntitySelection( - const EditorVisibleEntityDataCache* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) + const EditorVisibleEntityDataCacheInterface* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker) : m_editorHelpers(AZStd::make_unique(entityDataCache)) , m_viewportEditorModeTracker(viewportEditorModeTracker) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.h index 62fa4161b7..f941108ef8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.h @@ -13,6 +13,7 @@ namespace AzToolsFramework { + class EditorVisibleEntityDataCacheInterface; class ViewportEditorModeTrackerInterface; //! Viewport interaction that will handle assigning an entity in the viewport to @@ -23,7 +24,7 @@ namespace AzToolsFramework AZ_CLASS_ALLOCATOR_DECL EditorPickEntitySelection( - const EditorVisibleEntityDataCache* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker); + const EditorVisibleEntityDataCacheInterface* entityDataCache, ViewportEditorModeTrackerInterface* viewportEditorModeTracker); ~EditorPickEntitySelection(); private: @@ -35,6 +36,7 @@ namespace AzToolsFramework AZStd::unique_ptr m_editorHelpers; //!< Editor visualization of entities (icons, shapes, debug visuals etc). AZ::EntityId m_hoveredEntityId; //!< What EntityId is the mouse currently hovering over (if any). AZ::EntityId m_cachedEntityIdUnderCursor; //!< Store the EntityId on each mouse move for use in Display. - ViewportEditorModeTrackerInterface* m_viewportEditorModeTracker = nullptr; //!< Tracker for activating/deactivating viewport editor modes. + //! Tracker for activating/deactivating viewport editor modes. + ViewportEditorModeTrackerInterface* m_viewportEditorModeTracker = nullptr; }; } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp index b14f58fafa..5c5cdcb4b4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp @@ -381,7 +381,7 @@ namespace AzToolsFramework EntityIdContainer& selectedEntityIdsBeforeBoxSelect, EntityIdContainer& potentialSelectedEntityIds, EntityIdContainer& potentialDeselectedEntityIds, - const EditorVisibleEntityDataCache& entityDataCache, + const EditorVisibleEntityDataCacheInterface& entityDataCache, const int viewportId, const ViewportInteraction::KeyboardModifiers currentKeyboardModifiers, const ViewportInteraction::KeyboardModifiers& previousKeyboardModifiers) @@ -958,7 +958,7 @@ namespace AzToolsFramework // (useful in the context of drawing when we only care about entities we can see) // note: return the index if it is selectable, nullopt otherwise static AZStd::optional SelectableInVisibleViewportCache( - const EditorVisibleEntityDataCache& entityDataCache, const AZ::EntityId entityId) + const EditorVisibleEntityDataCacheInterface& entityDataCache, const AZ::EntityId entityId) { if (auto entityIndex = entityDataCache.GetVisibleEntityIndexFromId(entityId)) { @@ -1002,7 +1002,7 @@ namespace AzToolsFramework } } - EditorTransformComponentSelection::EditorTransformComponentSelection(const EditorVisibleEntityDataCache* entityDataCache) + EditorTransformComponentSelection::EditorTransformComponentSelection(const EditorVisibleEntityDataCacheInterface* entityDataCache) : m_entityDataCache(entityDataCache) { const AzFramework::EntityContextId entityContextId = GetEntityContextId(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h index 7b3ba08894..0465a7920f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h @@ -34,7 +34,7 @@ namespace AzToolsFramework { - class EditorVisibleEntityDataCache; + class EditorVisibleEntityDataCacheInterface; using EntityIdSet = AZStd::unordered_set; //!< Alias for unordered_set of EntityIds. @@ -167,7 +167,7 @@ namespace AzToolsFramework AZ_CLASS_ALLOCATOR_DECL EditorTransformComponentSelection() = default; - explicit EditorTransformComponentSelection(const EditorVisibleEntityDataCache* entityDataCache); + explicit EditorTransformComponentSelection(const EditorVisibleEntityDataCacheInterface* entityDataCache); EditorTransformComponentSelection(const EditorTransformComponentSelection&) = delete; EditorTransformComponentSelection& operator=(const EditorTransformComponentSelection&) = delete; virtual ~EditorTransformComponentSelection(); @@ -325,10 +325,8 @@ namespace AzToolsFramework AZ::EntityId m_currentEntityIdUnderCursor; //!< Store the EntityId on each mouse move for use in Display. AZ::EntityId m_editorCameraComponentEntityId; //!< The EditorCameraComponent EntityId if it is set. EntityIdSet m_selectedEntityIds; //!< Represents the current entities in the selection. - - const EditorVisibleEntityDataCache* m_entityDataCache = nullptr; //!< A cache of packed EntityData that can be - //!< iterated over efficiently without the need - //!< to make individual EBus calls. + //! A cache of packed EntityData that can be iterated over efficiently without the need to make individual EBus calls. + const EditorVisibleEntityDataCacheInterface* m_entityDataCache = nullptr; AZStd::unique_ptr m_editorHelpers; //!< Editor visualization of entities (icons, shapes, debug visuals etc). EntityIdManipulators m_entityIdManipulators; //!< Mapping from a Manipulator to potentially many EntityIds. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.h index 4262d334df..44dc570d5a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.h @@ -20,10 +20,36 @@ namespace AzToolsFramework { + //! Read-only interface for EditorVisibleEntityDataCache to be used by systems that want to efficiently + //! query the state of visible entities in the viewport. + class EditorVisibleEntityDataCacheInterface + { + using ComponentEntityAccentType = Components::EditorSelectionAccentSystemComponent::ComponentEntityAccentType; + + public: + virtual ~EditorVisibleEntityDataCacheInterface() = default; + + virtual size_t VisibleEntityDataCount() const = 0; + virtual AZ::Vector3 GetVisibleEntityPosition(size_t index) const = 0; + virtual const AZ::Transform& GetVisibleEntityTransform(size_t index) const = 0; + virtual AZ::EntityId GetVisibleEntityId(size_t index) const = 0; + virtual ComponentEntityAccentType GetVisibleEntityAccent(size_t index) const = 0; + virtual bool IsVisibleEntityLocked(size_t index) const = 0; + virtual bool IsVisibleEntityVisible(size_t index) const = 0; + virtual bool IsVisibleEntitySelected(size_t index) const = 0; + virtual bool IsVisibleEntityIconHidden(size_t index) const = 0; + //! Returns true if the entity is individually selectable (none of its ancestors are a closed container entity). + //! @note It may still be desirable to be able to 'click' an entity that is a descendant of a closed container + //! to select the container itself, not the individual entity. + virtual bool IsVisibleEntityIndividuallySelectableInViewport(size_t index) const = 0; + virtual AZStd::optional GetVisibleEntityIndexFromId(AZ::EntityId entityId) const = 0; + }; + //! A cache of packed EntityData that can be iterated over efficiently without //! the need to make individual EBus calls class EditorVisibleEntityDataCache - : private EditorEntityVisibilityNotificationBus::Router + : public EditorVisibleEntityDataCacheInterface + , private EditorEntityVisibilityNotificationBus::Router , private EditorEntityLockComponentNotificationBus::Router , private AZ::TransformNotificationBus::Router , private EditorComponentSelectionNotificationsBus::Router @@ -45,22 +71,18 @@ namespace AzToolsFramework void CalculateVisibleEntityDatas(const AzFramework::ViewportInfo& viewportInfo); - //! EditorVisibleEntityDataCache interface - size_t VisibleEntityDataCount() const; - AZ::Vector3 GetVisibleEntityPosition(size_t index) const; - const AZ::Transform& GetVisibleEntityTransform(size_t index) const; - AZ::EntityId GetVisibleEntityId(size_t index) const; - ComponentEntityAccentType GetVisibleEntityAccent(size_t index) const; - bool IsVisibleEntityLocked(size_t index) const; - bool IsVisibleEntityVisible(size_t index) const; - bool IsVisibleEntitySelected(size_t index) const; - bool IsVisibleEntityIconHidden(size_t index) const; - //! Returns true if the entity is individually selectable (none of its ancestors are a closed container entity). - //! @note It may still be desirable to be able to 'click' an entity that is a descendant of a closed container - //! to select the container itself, not the individual entity. - bool IsVisibleEntityIndividuallySelectableInViewport(size_t index) const; - - AZStd::optional GetVisibleEntityIndexFromId(AZ::EntityId entityId) const; + //! EditorVisibleEntityDataCacheInterface overrides ... + size_t VisibleEntityDataCount() const override; + AZ::Vector3 GetVisibleEntityPosition(size_t index) const override; + const AZ::Transform& GetVisibleEntityTransform(size_t index) const override; + AZ::EntityId GetVisibleEntityId(size_t index) const override; + ComponentEntityAccentType GetVisibleEntityAccent(size_t index) const override; + bool IsVisibleEntityLocked(size_t index) const override; + bool IsVisibleEntityVisible(size_t index) const override; + bool IsVisibleEntitySelected(size_t index) const override; + bool IsVisibleEntityIconHidden(size_t index) const override; + bool IsVisibleEntityIndividuallySelectableInViewport(size_t index) const override; + AZStd::optional GetVisibleEntityIndexFromId(AZ::EntityId entityId) const override; void AddEntityIds(const EntityIdList& entityIds); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframeworktestcommon_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframeworktestcommon_files.cmake index b70407ac68..4259a6ee9c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframeworktestcommon_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframeworktestcommon_files.cmake @@ -9,6 +9,9 @@ set(FILES UnitTest/AzToolsFrameworkTestHelpers.cpp UnitTest/AzToolsFrameworkTestHelpers.h + UnitTest/Mocks/MockFocusModeInterface.h + UnitTest/Mocks/MockEditorVisibleEntityDataCacheInterface.h + UnitTest/Mocks/MockEditorViewportIconDisplayInterface.h UnitTest/ToolsTestApplication.cpp UnitTest/ToolsTestApplication.h ) diff --git a/Code/Framework/AzToolsFramework/Tests/EditorTransformComponentSelectionTests.cpp b/Code/Framework/AzToolsFramework/Tests/EditorTransformComponentSelectionTests.cpp index dc9e1180b7..29d72a8270 100644 --- a/Code/Framework/AzToolsFramework/Tests/EditorTransformComponentSelectionTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/EditorTransformComponentSelectionTests.cpp @@ -265,7 +265,7 @@ namespace UnitTest using AzToolsFramework::EditorInteractionSystemViewportSelectionRequestBus; EditorInteractionSystemViewportSelectionRequestBus::Event( AzToolsFramework::GetEntityContextId(), &EditorInteractionSystemViewportSelectionRequestBus::Events::SetHandler, - [](const AzToolsFramework::EditorVisibleEntityDataCache* entityDataCache, + [](const AzToolsFramework::EditorVisibleEntityDataCacheInterface* entityDataCache, [[maybe_unused]] AzToolsFramework::ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { return AZStd::make_unique(entityDataCache, viewportEditorModeTracker); diff --git a/Code/Framework/AzToolsFramework/Tests/EditorViewportIconTests.cpp b/Code/Framework/AzToolsFramework/Tests/EditorViewportIconTests.cpp new file mode 100644 index 0000000000..46ce9804e6 --- /dev/null +++ b/Code/Framework/AzToolsFramework/Tests/EditorViewportIconTests.cpp @@ -0,0 +1,116 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class EditorViewportIconFixture : public AllocatorsTestFixture + { + public: + inline static constexpr AzFramework::ViewportId TestViewportId = 2468; + + void SetUp() override + { + AllocatorsTestFixture::SetUp(); + + m_focusModeMock = AZStd::make_unique<::testing::NiceMock>(); + m_editorViewportIconDisplayMock = AZStd::make_unique<::testing::NiceMock>(); + m_entityVisibleEntityDataCacheMock = AZStd::make_unique<::testing::NiceMock>(); + m_editorHelpers = AZStd::make_unique(m_entityVisibleEntityDataCacheMock.get()); + m_viewportSettings = AZStd::make_unique(); + + m_viewportSettings->Connect(TestViewportId); + m_viewportSettings->m_helpersVisible = false; + m_viewportSettings->m_iconsVisible = true; + + m_cameraState = AzFramework::CreateDefaultCamera(AZ::Transform::CreateIdentity(), AZ::Vector2(1024.0f, 768.0f)); + + using ::testing::_; + using ::testing::Return; + ON_CALL(*m_entityVisibleEntityDataCacheMock, VisibleEntityDataCount()).WillByDefault(Return(1)); + ON_CALL(*m_entityVisibleEntityDataCacheMock, GetVisibleEntityId(_)).WillByDefault(Return(AZ::EntityId())); + ON_CALL(*m_entityVisibleEntityDataCacheMock, IsVisibleEntityIconHidden(_)).WillByDefault(Return(false)); + ON_CALL(*m_entityVisibleEntityDataCacheMock, IsVisibleEntityVisible(_)).WillByDefault(Return(true)); + ON_CALL(*m_focusModeMock, IsInFocusSubTree(_)).WillByDefault(Return(true)); + } + + void TearDown() override + { + m_viewportSettings->Disconnect(); + m_viewportSettings.reset(); + m_editorHelpers.reset(); + m_entityVisibleEntityDataCacheMock.reset(); + m_editorViewportIconDisplayMock.reset(); + m_focusModeMock.reset(); + + AllocatorsTestFixture::TearDown(); + } + + AZStd::unique_ptr m_viewportSettings; + AZStd::unique_ptr m_editorHelpers; + AZStd::unique_ptr<::testing::NiceMock> m_focusModeMock; + AZStd::unique_ptr<::testing::NiceMock> m_entityVisibleEntityDataCacheMock; + AZStd::unique_ptr<::testing::NiceMock> m_editorViewportIconDisplayMock; + AzFramework::CameraState m_cameraState; + }; + + TEST_F(EditorViewportIconFixture, ViewportIconsAreNotDisplayedWhenInBetweenCameraAndNearClipPlane) + { + NullDebugDisplayRequests nullDebugDisplayRequests; + + const auto insideNearClip = m_cameraState.m_nearClip * 0.5f; + + using ::testing::_; + using ::testing::Return; + // given + // entity position (where icon will be drawn) is in between near clip plane and camera position + ON_CALL(*m_entityVisibleEntityDataCacheMock, GetVisibleEntityPosition(_)) + .WillByDefault(Return(AZ::Vector3(0.0f, insideNearClip, 0.0f))); + + EXPECT_CALL(*m_editorViewportIconDisplayMock, DrawIcon(_)).Times(0); + + // when + m_editorHelpers->DisplayHelpers( + AzFramework::ViewportInfo{ TestViewportId }, m_cameraState, nullDebugDisplayRequests, + [](AZ::EntityId) + { + return true; + }); + } + + TEST_F(EditorViewportIconFixture, ViewportIconsAreNotDisplayedWhenBehindCamera) + { + NullDebugDisplayRequests nullDebugDisplayRequests; + + using ::testing::_; + using ::testing::Return; + // given + // entity position (where icon will be drawn) behind the camera position + ON_CALL(*m_entityVisibleEntityDataCacheMock, GetVisibleEntityPosition(_)).WillByDefault(Return(AZ::Vector3(0.0f, -1.0f, 0.0f))); + + EXPECT_CALL(*m_editorViewportIconDisplayMock, DrawIcon(_)).Times(0); + + // when + m_editorHelpers->DisplayHelpers( + AzFramework::ViewportInfo{ TestViewportId }, m_cameraState, nullDebugDisplayRequests, + [](AZ::EntityId) + { + return true; + }); + } +} // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/Tests/Viewport/ViewportEditorModeTests.cpp b/Code/Framework/AzToolsFramework/Tests/Viewport/ViewportEditorModeTests.cpp index 85b65f3edf..96e56d0c6a 100644 --- a/Code/Framework/AzToolsFramework/Tests/Viewport/ViewportEditorModeTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Viewport/ViewportEditorModeTests.cpp @@ -573,7 +573,7 @@ namespace UnitTest using AzToolsFramework::EditorInteractionSystemViewportSelectionRequestBus; EditorInteractionSystemViewportSelectionRequestBus::Event( AzToolsFramework::GetEntityContextId(), &EditorInteractionSystemViewportSelectionRequestBus::Events::SetHandler, - [](const AzToolsFramework::EditorVisibleEntityDataCache* entityDataCache, + [](const AzToolsFramework::EditorVisibleEntityDataCacheInterface* entityDataCache, [[maybe_unused]] AzToolsFramework::ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { return AZStd::make_unique(entityDataCache, viewportEditorModeTracker); @@ -591,7 +591,7 @@ namespace UnitTest using AzToolsFramework::EditorInteractionSystemViewportSelectionRequestBus; EditorInteractionSystemViewportSelectionRequestBus::Event( AzToolsFramework::GetEntityContextId(), &EditorInteractionSystemViewportSelectionRequestBus::Events::SetHandler, - [](const AzToolsFramework::EditorVisibleEntityDataCache* entityDataCache, + [](const AzToolsFramework::EditorVisibleEntityDataCacheInterface* entityDataCache, [[maybe_unused]] AzToolsFramework::ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { return AZStd::make_unique(entityDataCache, viewportEditorModeTracker); @@ -599,7 +599,7 @@ namespace UnitTest EditorInteractionSystemViewportSelectionRequestBus::Event( AzToolsFramework::GetEntityContextId(), &EditorInteractionSystemViewportSelectionRequestBus::Events::SetHandler, - [](const AzToolsFramework::EditorVisibleEntityDataCache* entityDataCache, + [](const AzToolsFramework::EditorVisibleEntityDataCacheInterface* entityDataCache, [[maybe_unused]] AzToolsFramework::ViewportEditorModeTrackerInterface* viewportEditorModeTracker) { return AZStd::make_unique(entityDataCache, viewportEditorModeTracker); diff --git a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake index 2631a84325..b23713f891 100644 --- a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake +++ b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake @@ -24,6 +24,7 @@ set(FILES ComponentModeTests.cpp EditorTransformComponentSelectionTests.cpp EditorVertexSelectionTests.cpp + EditorViewportIconTests.cpp Entity/EditorEntityContextComponentTests.cpp Entity/EditorEntityHelpersTests.cpp Entity/EditorEntitySearchComponentTests.cpp From 27b84761dea017667d9c64f3eab2e99a0c25aa38 Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:55:03 +0100 Subject: [PATCH 373/394] Adding Collapse All tooltip in the Asset Browser (#7236) * Added Collapse All Tooltip Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Changed tooltip duration Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Changed tooltip from .ui file Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Removed custom tooltip duration Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui index 2cc7c57ccd..e07a5cda95 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui @@ -78,10 +78,7 @@ Qt::ClickFocus - - - - 3 + Collapse All From 1dd4898713fbbcc99557dd0c611d6818151dfd33 Mon Sep 17 00:00:00 2001 From: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> Date: Tue, 1 Feb 2022 06:47:11 -0800 Subject: [PATCH 374/394] LYN-8551 Terrain: Renderer: Create compute pass for clipmaps (#7116) * Allocate a pass that will be used to generate clipmap Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Fix some small issues Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Rename the pass to avoid future conflict. Move assets to terrain gem. Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Turn the pass off Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Move pass templates to Terrain gem Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * move load template to private Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Add macro texture compute pass Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> * Fix uncleaned code from previous commit Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com> --- AutomatedTesting/Passes/MainPipeline.pass | 12 +++- .../TerrainDetailTextureComputePass.pass | 52 +++++++++++++++++ .../TerrainMacroTextureComputePass.pass | 52 +++++++++++++++++ .../Passes/TerrainPassTemplates.azasset | 17 ++++++ .../TerrainDetailTextureComputePass.azsl | 18 ++++++ .../TerrainDetailTextureComputePass.shader | 14 +++++ .../TerrainDetailTextureComputePassSrg.azsli | 16 +++++ .../TerrainMacroTextureComputePass.azsl | 18 ++++++ .../TerrainMacroTextureComputePass.shader | 14 +++++ .../TerrainMacroTextureComputePassSrg.azsli | 16 +++++ .../Passes/TerrainDetailTextureComputePass.h | 55 ++++++++++++++++++ .../Passes/TerrainMacroTextureComputePass.h | 55 ++++++++++++++++++ .../Components/TerrainSystemComponent.cpp | 24 ++++++++ .../Components/TerrainSystemComponent.h | 7 +++ .../TerrainDetailTextureComputePass.cpp | 58 +++++++++++++++++++ .../Passes/TerrainMacroTextureComputePass.cpp | 58 +++++++++++++++++++ .../TerrainFeatureProcessor.cpp | 11 ++-- Gems/Terrain/Code/terrain_files.cmake | 4 ++ 18 files changed, 495 insertions(+), 6 deletions(-) create mode 100644 Gems/Terrain/Assets/Passes/TerrainDetailTextureComputePass.pass create mode 100644 Gems/Terrain/Assets/Passes/TerrainMacroTextureComputePass.pass create mode 100644 Gems/Terrain/Assets/Passes/TerrainPassTemplates.azasset create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.azsl create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.shader create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePassSrg.azsli create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.azsl create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.shader create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePassSrg.azsli create mode 100644 Gems/Terrain/Code/Include/Terrain/Passes/TerrainDetailTextureComputePass.h create mode 100644 Gems/Terrain/Code/Include/Terrain/Passes/TerrainMacroTextureComputePass.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainDetailTextureComputePass.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainMacroTextureComputePass.cpp diff --git a/AutomatedTesting/Passes/MainPipeline.pass b/AutomatedTesting/Passes/MainPipeline.pass index c34c556983..39b992a11d 100644 --- a/AutomatedTesting/Passes/MainPipeline.pass +++ b/AutomatedTesting/Passes/MainPipeline.pass @@ -42,6 +42,16 @@ "RayTracingAccelerationStructurePass" ] }, + { + "Name": "TerrainDetailTextureComputePass", + "TemplateName": "TerrainDetailTextureComputePassTemplate", + "Enabled": false + }, + { + "Name": "TerrainMacroTextureComputePass", + "TemplateName": "TerrainMacroTextureComputePassTemplate", + "Enabled": false + }, { "Name": "DepthPrePass", "TemplateName": "DepthMSAAParentTemplate", @@ -215,7 +225,7 @@ // Note: The following two lines represent the choice of rendering pipeline for the hair. // You can either choose to use PPLL or ShortCut and accordingly change the flag // 'm_usePPLLRenderTechnique' in the class 'HairFeatureProcessor.cpp' -// "TemplateName": "HairParentPassTemplate", + // "TemplateName": "HairParentPassTemplate", "TemplateName": "HairParentShortCutPassTemplate", "Enabled": true, "Connections": [ diff --git a/Gems/Terrain/Assets/Passes/TerrainDetailTextureComputePass.pass b/Gems/Terrain/Assets/Passes/TerrainDetailTextureComputePass.pass new file mode 100644 index 0000000000..b880979615 --- /dev/null +++ b/Gems/Terrain/Assets/Passes/TerrainDetailTextureComputePass.pass @@ -0,0 +1,52 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + // Note: all the data here works as placeholders. + "PassTemplate": { + "Name": "TerrainDetailTextureComputePassTemplate", + "PassClass": "TerrainDetailTextureComputePass", + "Slots": [ + { + "Name": "DetailTextureClipmapOutput", + "ShaderInputName": "m_detailTexClipmap", + "SlotType": "Output", + "ScopeAttachmentUsage": "Shader" + } + ], + "ImageAttachments": [ + { + "Name": "DetailTextureClipmap", + "ImageDescriptor": { + "Format": "R32G32B32A32_FLOAT", + "BindFlags": "3", + "SharedQueueMask": "1", + "Size": { + "Width": 1024, + "Height": 1024 + } + } + } + ], + "Connections": [ + { + "LocalSlot": "DetailTextureClipmapOutput", + "AttachmentRef": { + "Pass": "This", + "Attachment": "DetailTextureClipmap" + } + } + ], + "PassData": { + "$type": "Terrain::TerrainDetailTextureComputePassData", + "ShaderAsset": { + "FilePath": "Shaders/Terrain/TerrainDetailTextureComputePass.shader" + }, + "Target Thread Count X": 1024, + "Target Thread Count Y": 1024, + "Target Thread Count Z": 1 + } + } + } +} diff --git a/Gems/Terrain/Assets/Passes/TerrainMacroTextureComputePass.pass b/Gems/Terrain/Assets/Passes/TerrainMacroTextureComputePass.pass new file mode 100644 index 0000000000..ecb31acf69 --- /dev/null +++ b/Gems/Terrain/Assets/Passes/TerrainMacroTextureComputePass.pass @@ -0,0 +1,52 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + // Note: all the data here works as placeholders. + "PassTemplate": { + "Name": "TerrainMacroTextureComputePassTemplate", + "PassClass": "TerrainMacroTextureComputePass", + "Slots": [ + { + "Name": "MacroTextureClipmapOutput", + "ShaderInputName": "m_macroTexClipmap", + "SlotType": "Output", + "ScopeAttachmentUsage": "Shader" + } + ], + "ImageAttachments": [ + { + "Name": "MacroTextureClipmap", + "ImageDescriptor": { + "Format": "R32G32B32A32_FLOAT", + "BindFlags": "3", + "SharedQueueMask": "1", + "Size": { + "Width": 1024, + "Height": 1024 + } + } + } + ], + "Connections": [ + { + "LocalSlot": "MacroTextureClipmapOutput", + "AttachmentRef": { + "Pass": "This", + "Attachment": "MacroTextureClipmap" + } + } + ], + "PassData": { + "$type": "Terrain::TerrainMacroTextureComputePassData", + "ShaderAsset": { + "FilePath": "Shaders/Terrain/TerrainMacroTextureComputePass.shader" + }, + "Target Thread Count X": 1024, + "Target Thread Count Y": 1024, + "Target Thread Count Z": 1 + } + } + } +} diff --git a/Gems/Terrain/Assets/Passes/TerrainPassTemplates.azasset b/Gems/Terrain/Assets/Passes/TerrainPassTemplates.azasset new file mode 100644 index 0000000000..8b20edb6b9 --- /dev/null +++ b/Gems/Terrain/Assets/Passes/TerrainPassTemplates.azasset @@ -0,0 +1,17 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "AssetAliasesSourceData", + "ClassData": { + "AssetPaths": [ + { + "Name": "TerrainDetailTextureComputePassTemplate", + "Path": "Passes/TerrainDetailTextureComputePass.pass" + }, + { + "Name": "TerrainMacroTextureComputePassTemplate", + "Path": "Passes/TerrainMacroTextureComputePass.pass" + } + ] + } +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.azsl new file mode 100644 index 0000000000..a982e1aa49 --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.azsl @@ -0,0 +1,18 @@ +/* + * 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 "TerrainDetailTextureComputePassSrg.azsli" + +[numthreads(32,32,1)] +void MainCS( + uint3 dispatchThreadID : SV_DispatchThreadID, + uint3 groupID : SV_GroupID, + uint groupIndex : SV_GroupIndex) +{ + // Simple code to paint the whole image yellow for debug purpose before we actually write clipmap generation code + PassSrg::m_detailTexClipmap[dispatchThreadID.xy].rgba = float4(1.0, 1.0, 0.0, 1.0); +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.shader b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.shader new file mode 100644 index 0000000000..6b0488aaaa --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePass.shader @@ -0,0 +1,14 @@ +{ + "Source": "TerrainDetailTextureComputePass.azsl", + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "MainCS", + "type": "Compute" + } + ] + } +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePassSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePassSrg.azsli new file mode 100644 index 0000000000..aaa67b52da --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailTextureComputePassSrg.azsli @@ -0,0 +1,16 @@ +/* + * 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 + +ShaderResourceGroup PassSrg : SRG_PerPass +{ + RWTexture2D m_detailTexClipmap; +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.azsl new file mode 100644 index 0000000000..287002cf09 --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.azsl @@ -0,0 +1,18 @@ +/* + * 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 "TerrainMacroTextureComputePassSrg.azsli" + +[numthreads(32,32,1)] +void MainCS( + uint3 dispatchThreadID : SV_DispatchThreadID, + uint3 groupID : SV_GroupID, + uint groupIndex : SV_GroupIndex) +{ + // Simple code to paint the whole image magenta for debug purpose before we actually write clipmap generation code + PassSrg::m_macroTexClipmap[dispatchThreadID.xy].rgba = float4(1.0, 0.0, 1.0, 1.0); +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.shader b/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.shader new file mode 100644 index 0000000000..5e043dea12 --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePass.shader @@ -0,0 +1,14 @@ +{ + "Source": "TerrainMacroTextureComputePass.azsl", + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "MainCS", + "type": "Compute" + } + ] + } +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePassSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePassSrg.azsli new file mode 100644 index 0000000000..462e5cee34 --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainMacroTextureComputePassSrg.azsli @@ -0,0 +1,16 @@ +/* + * 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 + +ShaderResourceGroup PassSrg : SRG_PerPass +{ + RWTexture2D m_macroTexClipmap; +} diff --git a/Gems/Terrain/Code/Include/Terrain/Passes/TerrainDetailTextureComputePass.h b/Gems/Terrain/Code/Include/Terrain/Passes/TerrainDetailTextureComputePass.h new file mode 100644 index 0000000000..b7d5138d7f --- /dev/null +++ b/Gems/Terrain/Code/Include/Terrain/Passes/TerrainDetailTextureComputePass.h @@ -0,0 +1,55 @@ +/* + * 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 +#include +#include +#include + +namespace Terrain +{ + class TerrainFeatureProcessor; + + struct TerrainDetailTextureComputePassData + : public AZ::RPI::ComputePassData + { + AZ_RTTI(Terrain::TerrainDetailTextureComputePassData, "{387F7457-16E5-4AA6-8D96-56ED4532CA8D}", AZ::RPI::ComputePassData); + AZ_CLASS_ALLOCATOR(Terrain::TerrainDetailTextureComputePassData, AZ::SystemAllocator, 0); + + TerrainDetailTextureComputePassData() = default; + virtual ~TerrainDetailTextureComputePassData() = default; + + static void Reflect(AZ::ReflectContext* context); + }; + + class TerrainDetailTextureComputePass + : public AZ::RPI::ComputePass + { + AZ_RPI_PASS(TerrainDetailTextureComputePass); + + public: + AZ_RTTI(Terrain::TerrainDetailTextureComputePass, "{69A8207B-3311-4BB1-BD4E-A08B5E0424B5}", AZ::RPI::ComputePass); + AZ_CLASS_ALLOCATOR(Terrain::TerrainDetailTextureComputePass, AZ::SystemAllocator, 0); + virtual ~TerrainDetailTextureComputePass() = default; + + static AZ::RPI::Ptr Create(const AZ::RPI::PassDescriptor& descriptor); + + void SetFeatureProcessor(); + + void CompileResources(const AZ::RHI::FrameGraphCompileContext& context) override; + private: + TerrainDetailTextureComputePass(const AZ::RPI::PassDescriptor& descriptor); + + void BuildCommandListInternal(const AZ::RHI::FrameGraphExecuteContext& context) override; + + TerrainFeatureProcessor* m_terrainFeatureProcessor; + }; +} // namespace AZ::Render diff --git a/Gems/Terrain/Code/Include/Terrain/Passes/TerrainMacroTextureComputePass.h b/Gems/Terrain/Code/Include/Terrain/Passes/TerrainMacroTextureComputePass.h new file mode 100644 index 0000000000..5cadea0706 --- /dev/null +++ b/Gems/Terrain/Code/Include/Terrain/Passes/TerrainMacroTextureComputePass.h @@ -0,0 +1,55 @@ +/* + * 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 +#include +#include +#include + +namespace Terrain +{ + class TerrainFeatureProcessor; + + struct TerrainMacroTextureComputePassData + : public AZ::RPI::ComputePassData + { + AZ_RTTI(Terrain::TerrainMacroTextureComputePassData, "{BB11DACF-AF47-402D-92C6-33C644F6F530}", AZ::RPI::ComputePassData); + AZ_CLASS_ALLOCATOR(Terrain::TerrainMacroTextureComputePassData, AZ::SystemAllocator, 0); + + TerrainMacroTextureComputePassData() = default; + virtual ~TerrainMacroTextureComputePassData() = default; + + static void Reflect(AZ::ReflectContext* context); + }; + + class TerrainMacroTextureComputePass + : public AZ::RPI::ComputePass + { + AZ_RPI_PASS(TerrainMacroTextureComputePass); + + public: + AZ_RTTI(Terrain::TerrainMacroTextureComputePass, "{E493C3D2-D657-49ED-A5B1-A29B2995F6A8}", AZ::RPI::ComputePass); + AZ_CLASS_ALLOCATOR(Terrain::TerrainMacroTextureComputePass, AZ::SystemAllocator, 0); + virtual ~TerrainMacroTextureComputePass() = default; + + static AZ::RPI::Ptr Create(const AZ::RPI::PassDescriptor& descriptor); + + void SetFeatureProcessor(); + + void CompileResources(const AZ::RHI::FrameGraphCompileContext& context) override; + private: + TerrainMacroTextureComputePass(const AZ::RPI::PassDescriptor& descriptor); + + void BuildCommandListInternal(const AZ::RHI::FrameGraphExecuteContext& context) override; + + TerrainFeatureProcessor* m_terrainFeatureProcessor; + }; +} // namespace AZ::Render diff --git a/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.cpp index 5357ccce32..ae321b37ff 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.cpp @@ -14,6 +14,8 @@ #include #include +#include +#include namespace Terrain { @@ -63,11 +65,33 @@ namespace Terrain // every time an entity is added or removed to a level. If this ever changes, the Terrain System ownership could move into // the level component. m_terrainSystem = new TerrainSystem(); + + auto* passSystem = AZ::RPI::PassSystemInterface::Get(); + AZ_Assert(passSystem, "Cannot get the pass system."); + + // Setup handler for load pass templates mappings + m_loadTemplatesHandler = AZ::RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler([this]() { this->LoadPassTemplateMappings(); }); + passSystem->ConnectEvent(m_loadTemplatesHandler); + + // Register terrain system related passes + passSystem->AddPassCreator(AZ::Name("TerrainDetailTextureComputePass"), &TerrainDetailTextureComputePass::Create); + passSystem->AddPassCreator(AZ::Name("TerrainMacroTextureComputePass"), &TerrainDetailTextureComputePass::Create); } void TerrainSystemComponent::Deactivate() { + m_loadTemplatesHandler.Disconnect(); + delete m_terrainSystem; m_terrainSystem = nullptr; } + + void TerrainSystemComponent::LoadPassTemplateMappings() + { + auto* passSystem = AZ::RPI::PassSystemInterface::Get(); + AZ_Assert(passSystem, "Cannot get the pass system."); + + const char* passTemplatesFile = "Passes/TerrainPassTemplates.azasset"; + passSystem->LoadPassTemplateMappings(passTemplatesFile); + } } diff --git a/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.h b/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.h index b294c0473a..586c9c6be3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainSystemComponent.h @@ -9,6 +9,7 @@ #pragma once #include +#include namespace Terrain { @@ -36,5 +37,11 @@ namespace Terrain //////////////////////////////////////////////////////////////////////// TerrainSystem* m_terrainSystem{ nullptr }; + + private: + //! Used for loading the pass templates of the terrain gem. + AZ::RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler m_loadTemplatesHandler; + + void LoadPassTemplateMappings(); }; } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainDetailTextureComputePass.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainDetailTextureComputePass.cpp new file mode 100644 index 0000000000..0bfbfa134d --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainDetailTextureComputePass.cpp @@ -0,0 +1,58 @@ +/* + * 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 +#include + +namespace Terrain +{ + void TerrainDetailTextureComputePassData::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1); + } + } + + AZ::RPI::Ptr TerrainDetailTextureComputePass::Create(const AZ::RPI::PassDescriptor& descriptor) + { + AZ::RPI::Ptr pass = aznew TerrainDetailTextureComputePass(descriptor); + return pass; + } + + TerrainDetailTextureComputePass::TerrainDetailTextureComputePass(const AZ::RPI::PassDescriptor& descriptor) + : AZ::RPI::ComputePass(descriptor) + { + const TerrainDetailTextureComputePass* passData = AZ::RPI::PassUtils::GetPassData(descriptor); + if (passData) + { + // Copy data to pass + + } + } + + void TerrainDetailTextureComputePass::BuildCommandListInternal(const AZ::RHI::FrameGraphExecuteContext& context) + { + ComputePass::BuildCommandListInternal(context); + } + + void TerrainDetailTextureComputePass::SetFeatureProcessor() + { + m_terrainFeatureProcessor = GetRenderPipeline()->GetScene()->GetFeatureProcessor(); + } + + void TerrainDetailTextureComputePass::CompileResources(const AZ::RHI::FrameGraphCompileContext& context) + { + ComputePass::CompileResources(context); + } + +} // namespace Terrain diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainMacroTextureComputePass.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainMacroTextureComputePass.cpp new file mode 100644 index 0000000000..32eb849db3 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainMacroTextureComputePass.cpp @@ -0,0 +1,58 @@ +/* + * 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 +#include + +namespace Terrain +{ + void TerrainMacroTextureComputePassData::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1); + } + } + + AZ::RPI::Ptr TerrainMacroTextureComputePass::Create(const AZ::RPI::PassDescriptor& descriptor) + { + AZ::RPI::Ptr pass = aznew TerrainMacroTextureComputePass(descriptor); + return pass; + } + + TerrainMacroTextureComputePass::TerrainMacroTextureComputePass(const AZ::RPI::PassDescriptor& descriptor) + : AZ::RPI::ComputePass(descriptor) + { + const TerrainMacroTextureComputePass* passData = AZ::RPI::PassUtils::GetPassData(descriptor); + if (passData) + { + // Copy data to pass + + } + } + + void TerrainMacroTextureComputePass::BuildCommandListInternal(const AZ::RHI::FrameGraphExecuteContext& context) + { + ComputePass::BuildCommandListInternal(context); + } + + void TerrainMacroTextureComputePass::SetFeatureProcessor() + { + m_terrainFeatureProcessor = GetRenderPipeline()->GetScene()->GetFeatureProcessor(); + } + + void TerrainMacroTextureComputePass::CompileResources(const AZ::RHI::FrameGraphCompileContext& context) + { + ComputePass::CompileResources(context); + } + +} // namespace Terrain diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index 17cded8c97..e33f951bb1 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -6,12 +6,13 @@ * */ +#include +#include #include #include - #include - +#include #include #include #include @@ -21,9 +22,6 @@ #include #include #include - -#include - #include #include @@ -55,6 +53,9 @@ namespace Terrain ->Version(0) ; } + + TerrainDetailTextureComputePassData::Reflect(context); + TerrainMacroTextureComputePassData::Reflect(context); } void TerrainFeatureProcessor::Activate() diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index 53a7c6ac6d..cfc7d40cd5 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -9,6 +9,8 @@ set(FILES Include/Terrain/Ebuses/TerrainAreaSurfaceRequestBus.h Include/Terrain/TerrainDataConstants.h + Include/Terrain/Passes/TerrainDetailTextureComputePass.h + Include/Terrain/Passes/TerrainMacroTextureComputePass.h Source/Components/TerrainHeightGradientListComponent.cpp Source/Components/TerrainHeightGradientListComponent.h Source/Components/TerrainLayerSpawnerComponent.cpp @@ -39,6 +41,8 @@ set(FILES Source/TerrainRenderer/BindlessImageArrayHandler.h Source/TerrainRenderer/ClipmapBounds.cpp Source/TerrainRenderer/ClipmapBounds.h + Source/TerrainRenderer/Passes/TerrainDetailTextureComputePass.cpp + Source/TerrainRenderer/Passes/TerrainMacroTextureComputePass.cpp Source/TerrainRenderer/TerrainFeatureProcessor.cpp Source/TerrainRenderer/TerrainFeatureProcessor.h Source/TerrainRenderer/TerrainDetailMaterialManager.cpp From ff4529fc60b9ec8f481db488ab271aced97e0229 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Tue, 1 Feb 2022 09:36:44 -0700 Subject: [PATCH 375/394] Terrain ray cast benchmarks and optimization. (#7303) * Terrain ray cast benchmarks and optimization: - Added some benchmarks that exercise terrain ray casting. - Optimized terrain ray casting by removing an unnecessary AABB intersection check (this was suggested by @invertednormal in the original review, but I forgot to actually remove it until now). - Fixed a bug where we were not normalizing the ray direction before performing the Moller-Trumbore ray<->triangle intersection calculations. Signed-off-by: bosnichd * Update to make work with changes pulled down from mainline. Signed-off-by: bosnichd --- .../TerrainRaycast/TerrainRaycastContext.cpp | 29 +------ .../Code/Tests/TerrainSystemBenchmarks.cpp | 84 +++++++++++++++++++ 2 files changed, 86 insertions(+), 27 deletions(-) diff --git a/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp index 1f05c44314..1cc95d4efc 100644 --- a/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp +++ b/Gems/Terrain/Code/Source/TerrainRaycast/TerrainRaycastContext.cpp @@ -35,7 +35,6 @@ namespace inline void FindNearestIntersection(const AZ::Aabb& aabb, const AZ::Vector3& rayStart, const AZ::Vector3& rayDirection, - const AZ::Vector3& rayDirectionReciprocal, AzFramework::RenderGeometry::RayResult& result) { float intersectionT; @@ -43,7 +42,7 @@ namespace AZ::Vector3 intersectionNormal; const int intersectionResult = AZ::Intersect::IntersectRayAABB(rayStart, rayDirection, - rayDirectionReciprocal, + rayDirection.GetReciprocal(), aabb, intersectionT, intersectionEndT, @@ -117,7 +116,6 @@ namespace const AZ::Aabb& aabb, const AZ::Vector3& rayStart, const AZ::Vector3& rayDirection, - const AZ::Vector3& rayDirectionReciprocal, AzFramework::RenderGeometry::RayResult& result) { // Obtain the height values at each corner of the AABB. @@ -132,26 +130,6 @@ namespace point2.SetZ(terrainSystem.GetHeight(point2, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT)); point3.SetZ(terrainSystem.GetHeight(point3, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT)); - // Construct a smaller AABB that tightly encloses the four terrain points. - const float refinedMinZ = AZStd::GetMin(AZStd::GetMin(AZStd::GetMin(point0.GetZ(), point1.GetZ()), point2.GetZ()), point3.GetZ()); - const float refinedMaxZ = AZStd::GetMax(AZStd::GetMax(AZStd::GetMax(point0.GetZ(), point1.GetZ()), point2.GetZ()), point3.GetZ()); - const AZ::Vector3 refinedMin(aabbMin.GetX(), aabbMin.GetY(), refinedMinZ); - const AZ::Vector3 refinedMax(aabbMax.GetX(), aabbMax.GetY(), refinedMaxZ); - const AZ::Aabb refinedAABB = AZ::Aabb::CreateFromMinMax(refinedMin, refinedMax); - - // Check for a hit against the refined AABB. - float intersectionT; - float intersectionEndT; - const int intersectionResult = AZ::Intersect::IntersectRayAABB2(rayStart, - rayDirectionReciprocal, - refinedAABB, - intersectionT, - intersectionEndT); - if (intersectionResult == AZ::Intersect::ISECT_RAY_AABB_NONE) - { - return; - } - // Finally, triangulate the four terrain points and check for a hit, // splitting using the top-left -> bottom-right diagonal so to match // the current behavior of the terrain physics and rendering systems. @@ -218,12 +196,10 @@ namespace { // Find the nearest intersection (if any) between the ray and terrain world bounds. // Note that the ray might (and often will) start inside the terrain world bounds. - const AZ::Vector3 rayDirection = rayEnd - rayStart; - const AZ::Vector3 rayDirectionReciprocal = rayDirection.GetReciprocal(); + const AZ::Vector3 rayDirection = (rayEnd - rayStart).GetNormalized(); FindNearestIntersection(terrainWorldBounds, rayStart, rayDirection, - rayDirectionReciprocal, result); if (!result) { @@ -327,7 +303,6 @@ namespace currentVoxel, rayStart, rayDirection, - rayDirectionReciprocal, result); if (result) { diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp index e54747abcc..6aad3f9568 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -682,6 +683,89 @@ namespace UnitTest ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetClosestIntersectionRandom)(benchmark::State& state) + { + // Run the benchmark + const uint32_t numRays = aznumeric_cast(state.range(1)); + RunTerrainApiBenchmark( + state, + [numRays]([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + // Cast rays starting at random positions above the terrain, + // and ending at a random positions below the terrain. + AZ::SimpleLcgRandom random; + AzFramework::RenderGeometry::RayRequest ray; + AzFramework::RenderGeometry::RayResult result; + for (uint32_t i = 0; i < numRays; ++i) + { + ray.m_startWorldPosition.SetX(worldBounds.GetMin().GetX() + (random.GetRandomFloat() * worldBounds.GetXExtent())); + ray.m_startWorldPosition.SetY(worldBounds.GetMin().GetY() + (random.GetRandomFloat() * worldBounds.GetYExtent())); + ray.m_startWorldPosition.SetZ(worldBounds.GetMax().GetZ()); + ray.m_endWorldPosition.SetX(worldBounds.GetMin().GetX() + (random.GetRandomFloat() * worldBounds.GetXExtent())); + ray.m_endWorldPosition.SetY(worldBounds.GetMin().GetY() + (random.GetRandomFloat() * worldBounds.GetYExtent())); + ray.m_endWorldPosition.SetZ(worldBounds.GetMin().GetZ()); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + result, &AzFramework::Terrain::TerrainDataRequests::GetClosestIntersection, ray); + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetClosestIntersectionRandom) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 10, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 10, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 10, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 100, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 100, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 100, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 1000, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1000, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1000, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetClosestIntersectionWorstCase)(benchmark::State& state) + { + // Run the benchmark + const uint32_t numRays = aznumeric_cast(state.range(1)); + RunTerrainApiBenchmark( + state, + [numRays]([[maybe_unused]] float queryResolution, const AZ::Aabb& worldBounds, + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + // Cast rays starting at an upper corner of the terrain world, + // and ending at the opposite top corner of the terrain world, + // traversing the entire grid without finding an intersection. + AzFramework::RenderGeometry::RayRequest ray; + AzFramework::RenderGeometry::RayResult result; + ray.m_startWorldPosition = worldBounds.GetMax(); + ray.m_endWorldPosition = worldBounds.GetMin(); + ray.m_endWorldPosition.SetZ(ray.m_startWorldPosition.GetZ()); + for (uint32_t i = 0; i < numRays; ++i) + { + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + result, &AzFramework::Terrain::TerrainDataRequests::GetClosestIntersection, ray); + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetClosestIntersectionWorstCase) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 10, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 10, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 10, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 100, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 100, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 100, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 1000, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1000, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1000, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); #endif } From 3f63cf3546b26fd5653076c43bebd97ea6bb08db Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:44:14 -0600 Subject: [PATCH 376/394] Misc SurfaceData Optimizations (#7299) * Misc SurfaceData Optimizations. This includes a few different optimizations found while trying to make the bulk query APIs faster: * Switches mutexes over to shared_lock to optimize for the multi-reader-single-writer pattern * Surface provider point creation now uses a pre-created set of masks to initialize with, and uses std::move() to move the created point into the output list instead of copying it. * Splits CombineSortAndFilterNeightboringPoints so that the FilterPoints() can occur separately and efficiently with erase/remove_if, and avoids making a copy of the output points. * Optimized SurfaceDataShapeComponent::ModifySurfacePoints * Fixed potential bug where the sort wasn't stable since it only compared the Z value, and could have produced unexpected results for differing points with the exact same Z value. * Fixed up a couple small bugs and missing checks in the unit tests Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed syntax on unit tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../SurfaceData/SurfaceDataMeshComponent.cpp | 11 +- .../SurfaceData/SurfaceDataMeshComponent.h | 4 +- .../SurfaceData/Utility/SurfaceDataUtility.h | 13 +- .../SurfaceDataColliderComponent.cpp | 16 +- .../Components/SurfaceDataColliderComponent.h | 4 +- .../Components/SurfaceDataShapeComponent.cpp | 40 ++-- .../Components/SurfaceDataShapeComponent.h | 4 +- .../Source/SurfaceDataSystemComponent.cpp | 172 +++++++++--------- .../Code/Source/SurfaceDataSystemComponent.h | 6 +- .../SurfaceDataColliderComponentTest.cpp | 26 ++- .../Code/Tests/SurfaceDataTest.cpp | 104 +++++------ .../TerrainSurfaceDataSystemComponent.cpp | 2 +- 12 files changed, 221 insertions(+), 181 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp index 862e3599a3..71e880fdef 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp @@ -95,6 +95,7 @@ namespace SurfaceData m_refresh = false; // Update the cached mesh data and bounds, then register the surface data provider + AssignSurfaceTagWeights(m_configuration.m_tags, 1.0f, m_newPointWeights); UpdateMeshData(); } @@ -115,7 +116,7 @@ namespace SurfaceData // Clear the cached mesh data { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); m_meshAssetData = {}; m_meshBounds = AZ::Aabb::CreateNull(); m_meshWorldTM = AZ::Transform::CreateIdentity(); @@ -145,7 +146,7 @@ namespace SurfaceData bool SurfaceDataMeshComponent::DoRayTrace(const AZ::Vector3& inPosition, AZ::Vector3& outPosition, AZ::Vector3& outNormal) const { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); // test AABB as first pass to claim the point const AZ::Vector3 testPosition = AZ::Vector3( @@ -181,8 +182,8 @@ namespace SurfaceData point.m_entityId = GetEntityId(); point.m_position = hitPosition; point.m_normal = hitNormal; - AddMaxValueForMasks(point.m_masks, m_configuration.m_tags, 1.0f); - surfacePointList.push_back(point); + point.m_masks = m_newPointWeights; + surfacePointList.push_back(AZStd::move(point)); } } @@ -235,7 +236,7 @@ namespace SurfaceData bool meshValidAfterUpdate = false; { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); meshValidBeforeUpdate = (m_meshAssetData.GetAs() != nullptr) && (m_meshBounds.IsValid()); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.h index 92536f9523..758bb1ee99 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -96,11 +97,12 @@ namespace SurfaceData // cached data AZStd::atomic_bool m_refresh{ false }; - mutable AZStd::recursive_mutex m_cacheMutex; + mutable AZStd::shared_mutex m_cacheMutex; AZ::Data::Asset m_meshAssetData; AZ::Transform m_meshWorldTM = AZ::Transform::CreateIdentity(); AZ::Transform m_meshWorldTMInverse = AZ::Transform::CreateIdentity(); AZ::Vector3 m_meshNonUniformScale = AZ::Vector3::CreateOne(); AZ::Aabb m_meshBounds = AZ::Aabb::CreateNull(); + SurfaceTagWeightMap m_newPointWeights; }; } diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h b/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h index 29b3fac8c7..2a4a39ee3b 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h @@ -88,6 +88,16 @@ namespace SurfaceData const AZ::Vector3& rayStart, const AZ::Vector3& rayEnd, AZ::Vector3& outPosition, AZ::Vector3& outNormal); + AZ_INLINE void AssignSurfaceTagWeights(const SurfaceTagVector& tags, float weight, SurfaceTagWeightMap& weights) + { + weights.clear(); + weights.reserve(tags.size()); + for (auto& tag : tags) + { + weights[tag] = weight; + } + } + AZ_INLINE void AddMaxValueForMasks(SurfaceTagWeightMap& masks, const AZ::Crc32 tag, const float value) { const auto maskItr = masks.find(tag); @@ -166,7 +176,8 @@ namespace SurfaceData } template - AZ_INLINE bool HasMatchingTags(const SurfaceTagWeightMap& sourceTags, const SampleContainer& sampleTags, float valueMin, float valueMax) + AZ_INLINE bool HasMatchingTags( + const SurfaceTagWeightMap& sourceTags, const SampleContainer& sampleTags, float valueMin, float valueMax) { for (const auto& sampleTag : sampleTags) { diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp index d7de299829..dc4e5e6e74 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp @@ -132,6 +132,7 @@ namespace SurfaceData Physics::ColliderComponentEventBus::Handler::BusConnect(GetEntityId()); // Update the cached collider data and bounds, then register the surface data provider / modifier + AssignSurfaceTagWeights(m_configuration.m_providerTags, 1.0f, m_newPointWeights); UpdateColliderData(); } @@ -157,7 +158,7 @@ namespace SurfaceData // Clear the cached mesh data { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); m_colliderBounds = AZ::Aabb::CreateNull(); } } @@ -184,7 +185,7 @@ namespace SurfaceData bool SurfaceDataColliderComponent::DoRayTrace(const AZ::Vector3& inPosition, bool queryPointOnly, AZ::Vector3& outPosition, AZ::Vector3& outNormal) const { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); // test AABB as first pass to claim the point const AZ::Vector3 testPosition = AZ::Vector3( @@ -240,17 +241,14 @@ namespace SurfaceData point.m_entityId = GetEntityId(); point.m_position = hitPosition; point.m_normal = hitNormal; - for (auto& tag : m_configuration.m_providerTags) - { - point.m_masks[tag] = 1.0f; - } - surfacePointList.push_back(point); + point.m_masks = m_newPointWeights; + surfacePointList.push_back(AZStd::move(point)); } } void SurfaceDataColliderComponent::ModifySurfacePoints(SurfacePointList& surfacePointList) const { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); if (m_colliderBounds.IsValid() && !m_configuration.m_modifierTags.empty()) { @@ -308,7 +306,7 @@ namespace SurfaceData bool colliderValidAfterUpdate = false; { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); colliderValidBeforeUpdate = m_colliderBounds.IsValid(); diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.h b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.h index 43528ecae3..50c84f9519 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.h +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -98,7 +99,8 @@ namespace SurfaceData // cached data AZStd::atomic_bool m_refresh{ false }; - mutable AZStd::recursive_mutex m_cacheMutex; + mutable AZStd::shared_mutex m_cacheMutex; AZ::Aabb m_colliderBounds = AZ::Aabb::CreateNull(); + SurfaceTagWeightMap m_newPointWeights; }; } diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp index a45903498e..682bac150a 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp @@ -89,6 +89,7 @@ namespace SurfaceData LmbrCentral::ShapeComponentNotificationsBus::Handler::BusConnect(GetEntityId()); // Update the cached shape data and bounds, then register the surface data provider / modifier + AssignSurfaceTagWeights(m_configuration.m_providerTags, 1.0f, m_newPointWeights); UpdateShapeData(); } @@ -115,7 +116,7 @@ namespace SurfaceData // Clear the cached shape data { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); m_shapeBounds = AZ::Aabb::CreateNull(); m_shapeBoundsIsValid = false; } @@ -143,7 +144,7 @@ namespace SurfaceData void SurfaceDataShapeComponent::GetSurfacePoints(const AZ::Vector3& inPosition, SurfacePointList& surfacePointList) const { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); if (m_shapeBoundsIsValid) { @@ -158,36 +159,35 @@ namespace SurfaceData point.m_entityId = GetEntityId(); point.m_position = rayOrigin + intersectionDistance * rayDirection; point.m_normal = AZ::Vector3::CreateAxisZ(); - for (auto& tag : m_configuration.m_providerTags) - { - point.m_masks[tag] = 1.0f; - } - surfacePointList.push_back(point); + point.m_masks = m_newPointWeights; + surfacePointList.push_back(AZStd::move(point)); } } } void SurfaceDataShapeComponent::ModifySurfacePoints(SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(Entity); - - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); if (m_shapeBoundsIsValid && !m_configuration.m_modifierTags.empty()) { const AZ::EntityId entityId = GetEntityId(); - for (auto& point : surfacePointList) - { - if (point.m_entityId != entityId && m_shapeBounds.Contains(point.m_position)) + LmbrCentral::ShapeComponentRequestsBus::Event( + GetEntityId(), + [entityId, this, &surfacePointList](LmbrCentral::ShapeComponentRequestsBus::Events* shape) { - bool inside = false; - LmbrCentral::ShapeComponentRequestsBus::EventResult(inside, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::IsPointInside, point.m_position); - if (inside) + for (auto& point : surfacePointList) { - AddMaxValueForMasks(point.m_masks, m_configuration.m_modifierTags, 1.0f); + if (point.m_entityId != entityId && m_shapeBounds.Contains(point.m_position)) + { + bool inside = shape->IsPointInside(point.m_position); + if (inside) + { + AddMaxValueForMasks(point.m_masks, m_configuration.m_modifierTags, 1.0f); + } + } } - } - } + }); } } @@ -228,7 +228,7 @@ namespace SurfaceData bool shapeValidAfterUpdate = false; { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); shapeValidBeforeUpdate = m_shapeBoundsIsValid; diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.h b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.h index f2c478ed27..59b7950412 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.h +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -92,9 +93,10 @@ namespace SurfaceData // cached data AZStd::atomic_bool m_refresh{ false }; - mutable AZStd::recursive_mutex m_cacheMutex; + mutable AZStd::shared_mutex m_cacheMutex; AZ::Aabb m_shapeBounds = AZ::Aabb::CreateNull(); bool m_shapeBoundsIsValid = false; static const float s_rayAABBHeightPadding; + SurfaceTagWeightMap m_newPointWeights; }; } diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp index a2a3bc352e..66f282d12b 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp @@ -181,10 +181,10 @@ namespace SurfaceData void SurfaceDataSystemComponent::GetSurfacePoints(const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags, SurfacePointList& surfacePointList) const { - const bool hasDesiredTags = HasValidTags(desiredTags); - const bool hasModifierTags = hasDesiredTags && HasMatchingTags(desiredTags, m_registeredModifierTags); + const bool useTagFilters = HasValidTags(desiredTags); + const bool hasModifierTags = useTagFilters && HasMatchingTags(desiredTags, m_registeredModifierTags); - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::shared_lock registrationLock(m_registrationMutex); surfacePointList.clear(); @@ -195,7 +195,7 @@ namespace SurfaceData const SurfaceDataRegistryEntry& entry = entryPair.second; if (!entry.m_bounds.IsValid() || AabbContains2D(entry.m_bounds, inPosition)) { - if (!hasDesiredTags || hasModifierTags || HasMatchingTags(desiredTags, entry.m_tags)) + if (!useTagFilters || hasModifierTags || HasMatchingTags(desiredTags, entry.m_tags)) { SurfaceDataProviderRequestBus::Event(entryAddress, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, inPosition, surfacePointList); } @@ -219,7 +219,12 @@ namespace SurfaceData // same XY coordinates and extremely similar Z values. This produces results that are sorted in decreasing Z order. // Also, this filters out any remaining points that don't match the desired tag list. This can happen when a surface provider // doesn't add a desired tag, and a surface modifier has the *potential* to add it, but then doesn't. - CombineSortAndFilterNeighboringPoints(surfacePointList, hasDesiredTags, desiredTags); + if (useTagFilters) + { + FilterPoints(surfacePointList, desiredTags); + } + + CombineAndSortNeighboringPoints(surfacePointList); } } @@ -248,34 +253,33 @@ namespace SurfaceData void SurfaceDataSystemComponent::GetSurfacePointsFromList( AZStd::span inPositions, const SurfaceTagVector& desiredTags, SurfacePointLists& surfacePointLists) const { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::shared_lock registrationLock(m_registrationMutex); const size_t totalQueryPositions = inPositions.size(); surfacePointLists.clear(); surfacePointLists.resize(totalQueryPositions); - const bool hasDesiredTags = HasValidTags(desiredTags); - const bool hasModifierTags = hasDesiredTags && HasMatchingTags(desiredTags, m_registeredModifierTags); + const bool useTagFilters = HasValidTags(desiredTags); + const bool hasModifierTags = useTagFilters && HasMatchingTags(desiredTags, m_registeredModifierTags); // Loop through each data provider, and query all the points for each one. This allows us to check the tags and the overall // AABB bounds just once per provider, instead of once per point. It also allows for an eventual optimization in which we could // send the list of points directly into each SurfaceDataProvider. - for (const auto& entryPair : m_registeredSurfaceDataProviders) + for (const auto& [providerHandle, provider] : m_registeredSurfaceDataProviders) { - const SurfaceDataRegistryEntry& entry = entryPair.second; - bool alwaysApplies = !entry.m_bounds.IsValid(); + bool hasInfiniteBounds = !provider.m_bounds.IsValid(); - if (!hasDesiredTags || hasModifierTags || HasMatchingTags(desiredTags, entry.m_tags)) + if (!useTagFilters || hasModifierTags || HasMatchingTags(desiredTags, provider.m_tags)) { for (size_t index = 0; index < totalQueryPositions; index++) { - const auto& inPosition = inPositions[index]; - SurfacePointList& surfacePointList = surfacePointLists[index]; - if (alwaysApplies || AabbContains2D(entry.m_bounds, inPosition)) + bool inBounds = hasInfiniteBounds || AabbContains2D(provider.m_bounds, inPositions[index]); + if (inBounds) { SurfaceDataProviderRequestBus::Event( - entryPair.first, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, inPosition, surfacePointList); + providerHandle, &SurfaceDataProviderRequestBus::Events::GetSurfacePoints, + inPositions[index], surfacePointLists[index]); } } } @@ -289,7 +293,7 @@ namespace SurfaceData for (const auto& entryPair : m_registeredSurfaceDataModifiers) { const SurfaceDataRegistryEntry& entry = entryPair.second; - bool alwaysApplies = !entry.m_bounds.IsValid(); + bool hasInfiniteBounds = !entry.m_bounds.IsValid(); for (size_t index = 0; index < totalQueryPositions; index++) { @@ -297,10 +301,11 @@ namespace SurfaceData SurfacePointList& surfacePointList = surfacePointLists[index]; if (!surfacePointList.empty()) { - if (alwaysApplies || AabbContains2D(entry.m_bounds, inPosition)) + if (hasInfiniteBounds || AabbContains2D(entry.m_bounds, inPosition)) { SurfaceDataModifierRequestBus::Event( - entryPair.first, &SurfaceDataModifierRequestBus::Events::ModifySurfacePoints, surfacePointList); + entryPair.first, &SurfaceDataModifierRequestBus::Events::ModifySurfacePoints, + surfacePointList); } } } @@ -312,88 +317,85 @@ namespace SurfaceData // doesn't add a desired tag, and a surface modifier has the *potential* to add it, but then doesn't. for (auto& surfacePointList : surfacePointLists) { - if (!surfacePointList.empty()) + if (useTagFilters) { - CombineSortAndFilterNeighboringPoints(surfacePointList, hasDesiredTags, desiredTags); + FilterPoints(surfacePointList, desiredTags); } + CombineAndSortNeighboringPoints(surfacePointList); } + } - - - void SurfaceDataSystemComponent::CombineSortAndFilterNeighboringPoints(SurfacePointList& sourcePointList, bool hasDesiredTags, const SurfaceTagVector& desiredTags) const + void SurfaceDataSystemComponent::FilterPoints(SurfacePointList& sourcePointList, const SurfaceTagVector& desiredTags) const { - AZ_PROFILE_FUNCTION(Entity); + // Before sorting and combining, filter out any points that don't match our search tags. + sourcePointList.erase( + AZStd::remove_if( + sourcePointList.begin(), sourcePointList.end(), + [desiredTags](SurfacePoint& point) -> bool + { + return !HasMatchingTags(point.m_masks, desiredTags); + }), + sourcePointList.end()); + } - if (sourcePointList.empty()) + void SurfaceDataSystemComponent::CombineAndSortNeighboringPoints(SurfacePointList& sourcePointList) const + { + // If there's only 0 or 1 point, there is no sorting or combining that needs to happen, so just return. + if (sourcePointList.size() <= 1) { return; } - // Sorting only makes sense if we have two or more points - if (sourcePointList.size() > 1) + // Efficient point consolidation requires the points to be pre-sorted so we are only comparing/combining neighbors. + // Sort XY points together, with decreasing Z. + AZStd::sort(sourcePointList.begin(), sourcePointList.end(), [](const SurfacePoint& a, const SurfacePoint& b) { - //sort by depth/distance before combining points - AZStd::sort(sourcePointList.begin(), sourcePointList.end(), [](const SurfacePoint& a, const SurfacePoint& b) + // Our goal is to have identical XY values sorted adjacent to each other with decreasing Z. + // We sort increasing Y, then increasing X, then decreasing Z, because we need to compare all 3 values for a + // stable sort. The choice of increasing Y first is because we'll often generate the points as ranges of X values within + // ranges of Y values, so this will produce the most usable and expected output sort. + if (a.m_position.GetY() != b.m_position.GetY()) + { + return a.m_position.GetY() < b.m_position.GetY(); + } + if (a.m_position.GetX() != b.m_position.GetX()) + { + return a.m_position.GetX() < b.m_position.GetX(); + } + if (a.m_position.GetZ() != b.m_position.GetZ()) { return a.m_position.GetZ() > b.m_position.GetZ(); - }); - } - - - //efficient point consolidation requires the points to be pre-sorted so we are only comparing/combining neighbors - const size_t sourcePointCount = sourcePointList.size(); - size_t targetPointIndex = 0; - size_t sourcePointIndex = 0; - - m_targetPointList.clear(); - m_targetPointList.reserve(sourcePointCount); - - // Locate the first point that matches our desired tags, if one exists. - for (sourcePointIndex = 0; sourcePointIndex < sourcePointCount; sourcePointIndex++) - { - if (!hasDesiredTags || (HasMatchingTags(sourcePointList[sourcePointIndex].m_masks, desiredTags))) - { - break; - } - } - - if (sourcePointIndex < sourcePointCount) - { - // We found a point that matches our tags, so add it to our target list as the first point. - m_targetPointList.push_back(sourcePointList[sourcePointIndex++]); - - //iterate over subsequent source points for comparison and consolidation with the last added target/unique point - for (; sourcePointIndex < sourcePointCount; ++sourcePointIndex) - { - const auto& sourcePoint = sourcePointList[sourcePointIndex]; - - if (!hasDesiredTags || (HasMatchingTags(sourcePoint.m_masks, desiredTags))) - { - auto& targetPoint = m_targetPointList[targetPointIndex]; - - // [LY-90907] need to add a configurable tolerance for comparison - if (targetPoint.m_position.IsClose(sourcePoint.m_position) && - targetPoint.m_normal.IsClose(sourcePoint.m_normal)) - { - //consolidate points with similar attributes by adding masks to the target point and ignoring the source - AddMaxValueForMasks(targetPoint.m_masks, sourcePoint.m_masks); - continue; - } - - //if the points were too different, we have to add a new target point to compare against - m_targetPointList.push_back(sourcePoint); - ++targetPointIndex; - } } - AZStd::swap(sourcePointList, m_targetPointList); + // If we somehow ended up with two points with identical positions getting generated, use the entity ID as the tiebreaker + // to guarantee a stable sort. We should never have two identical positions generated from the same entity. + return a.m_entityId < b.m_entityId; + }); + + // iterate over subsequent source points for comparison and consolidation with the last added target/unique point + for (auto pointItr = sourcePointList.begin() + 1; pointItr < sourcePointList.end();) + { + auto prevPointItr = pointItr - 1; + + // (Someday we should add a configurable tolerance for comparison) + if (pointItr->m_position.IsClose(prevPointItr->m_position) && pointItr->m_normal.IsClose(prevPointItr->m_normal)) + { + // consolidate points with similar attributes by adding masks/weights to the previous point and deleting this point. + AddMaxValueForMasks(prevPointItr->m_masks, pointItr->m_masks); + + pointItr = sourcePointList.erase(pointItr); + } + else + { + pointItr++; + } } } SurfaceDataRegistryHandle SurfaceDataSystemComponent::RegisterSurfaceDataProviderInternal(const SurfaceDataRegistryEntry& entry) { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::unique_lock registrationLock(m_registrationMutex); SurfaceDataRegistryHandle handle = ++m_registeredSurfaceDataProviderHandleCounter; m_registeredSurfaceDataProviders[handle] = entry; return handle; @@ -401,7 +403,7 @@ namespace SurfaceData SurfaceDataRegistryEntry SurfaceDataSystemComponent::UnregisterSurfaceDataProviderInternal(const SurfaceDataRegistryHandle& handle) { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::unique_lock registrationLock(m_registrationMutex); SurfaceDataRegistryEntry entry; auto entryItr = m_registeredSurfaceDataProviders.find(handle); if (entryItr != m_registeredSurfaceDataProviders.end()) @@ -414,7 +416,7 @@ namespace SurfaceData bool SurfaceDataSystemComponent::UpdateSurfaceDataProviderInternal(const SurfaceDataRegistryHandle& handle, const SurfaceDataRegistryEntry& entry, AZ::Aabb& oldBounds) { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::unique_lock registrationLock(m_registrationMutex); auto entryItr = m_registeredSurfaceDataProviders.find(handle); if (entryItr != m_registeredSurfaceDataProviders.end()) { @@ -427,7 +429,7 @@ namespace SurfaceData SurfaceDataRegistryHandle SurfaceDataSystemComponent::RegisterSurfaceDataModifierInternal(const SurfaceDataRegistryEntry& entry) { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::unique_lock registrationLock(m_registrationMutex); SurfaceDataRegistryHandle handle = ++m_registeredSurfaceDataModifierHandleCounter; m_registeredSurfaceDataModifiers[handle] = entry; m_registeredModifierTags.insert(entry.m_tags.begin(), entry.m_tags.end()); @@ -436,7 +438,7 @@ namespace SurfaceData SurfaceDataRegistryEntry SurfaceDataSystemComponent::UnregisterSurfaceDataModifierInternal(const SurfaceDataRegistryHandle& handle) { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::unique_lock registrationLock(m_registrationMutex); SurfaceDataRegistryEntry entry; auto entryItr = m_registeredSurfaceDataModifiers.find(handle); if (entryItr != m_registeredSurfaceDataModifiers.end()) @@ -449,7 +451,7 @@ namespace SurfaceData bool SurfaceDataSystemComponent::UpdateSurfaceDataModifierInternal(const SurfaceDataRegistryHandle& handle, const SurfaceDataRegistryEntry& entry, AZ::Aabb& oldBounds) { - AZStd::lock_guard registrationLock(m_registrationMutex); + AZStd::unique_lock registrationLock(m_registrationMutex); auto entryItr = m_registeredSurfaceDataModifiers.find(handle); if (entryItr != m_registeredSurfaceDataModifiers.end()) { diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h index 8914ee7972..6ec2cab4eb 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace SurfaceData @@ -57,7 +58,8 @@ namespace SurfaceData void RefreshSurfaceData(const AZ::Aabb& dirtyArea) override; private: - void CombineSortAndFilterNeighboringPoints(SurfacePointList& sourcePointList, bool hasDesiredTags, const SurfaceTagVector& desiredTags) const; + void FilterPoints(SurfacePointList& sourcePointList, const SurfaceTagVector& desiredTags) const; + void CombineAndSortNeighboringPoints(SurfacePointList& sourcePointList) const; SurfaceDataRegistryHandle RegisterSurfaceDataProviderInternal(const SurfaceDataRegistryEntry& entry); SurfaceDataRegistryEntry UnregisterSurfaceDataProviderInternal(const SurfaceDataRegistryHandle& handle); @@ -67,7 +69,7 @@ namespace SurfaceData SurfaceDataRegistryEntry UnregisterSurfaceDataModifierInternal(const SurfaceDataRegistryHandle& handle); bool UpdateSurfaceDataModifierInternal(const SurfaceDataRegistryHandle& handle, const SurfaceDataRegistryEntry& entry, AZ::Aabb& oldBounds); - mutable AZStd::recursive_mutex m_registrationMutex; + mutable AZStd::shared_mutex m_registrationMutex; AZStd::unordered_map m_registeredSurfaceDataProviders; AZStd::unordered_map m_registeredSurfaceDataModifiers; SurfaceDataRegistryHandle m_registeredSurfaceDataProviderHandleCounter = InvalidSurfaceDataRegistryHandle; diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp index b0aa5dd38f..c51ea49f14 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataColliderComponentTest.cpp @@ -93,10 +93,28 @@ namespace UnitTest // Compare two surface points. bool SurfacePointsAreEqual(const SurfaceData::SurfacePoint& lhs, const SurfaceData::SurfacePoint& rhs) { - return (lhs.m_entityId == rhs.m_entityId) - && (lhs.m_position == rhs.m_position) - && (lhs.m_normal == rhs.m_normal) - && (lhs.m_masks == rhs.m_masks); + if ((lhs.m_entityId != rhs.m_entityId) + || (lhs.m_position != rhs.m_position) + || (lhs.m_normal != rhs.m_normal) + || (lhs.m_masks.size() != rhs.m_masks.size())) + { + return false; + } + + for (auto& mask : lhs.m_masks) + { + auto maskEntry = rhs.m_masks.find(mask.first); + if (maskEntry == rhs.m_masks.end()) + { + return false; + } + if (maskEntry->second != mask.second) + { + return false; + } + } + + return true; } // Common test function for testing the "Provider" functionality of the component. diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 1d339edc71..2d6d64f65d 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -204,30 +204,31 @@ public: m_surfaceDataSystemEntity.reset(); } - bool ValidateRegionListSize(AZ::Aabb bounds, AZ::Vector2 stepSize, const SurfaceData::SurfacePointLists& outputLists) - { - // We expect the output list to contain width * height output entries. - // The right edge of the AABB should be treated as exclusive, so a 4x4 box with 1 step size will produce 16 entries (0, 1, 2, 3 on each dimension), - // but a 4.1 x 4.1 box with 1 step size will produce 25 entries (0, 1, 2, 3, 4 on each dimension). - return (outputLists.size() == aznumeric_cast(ceil(bounds.GetXExtent() * stepSize.GetX()) * ceil(bounds.GetYExtent() * stepSize.GetY()))); - } - void CompareSurfacePointListWithGetSurfacePoints( - SurfaceData::SurfacePointLists surfacePointLists, const SurfaceData::SurfaceTagVector& testTags) + const AZStd::vector& queryPositions, SurfaceData::SurfacePointLists surfacePointLists, + const SurfaceData::SurfaceTagVector& testTags) { - for (auto& pointList : surfacePointLists) + SurfaceData::SurfacePointLists singleQueryPointLists; + + for (auto& queryPosition : queryPositions) { - AZ::Vector3 queryPosition(pointList[0].m_position.GetX(), pointList[0].m_position.GetY(), 16.0f); - SurfaceData::SurfacePointList singleQueryPointList; - + SurfaceData::SurfacePointList tempSingleQueryPointList; SurfaceData::SurfaceDataSystemRequestBus::Broadcast( - &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, queryPosition, testTags, singleQueryPointList); + &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, queryPosition, testTags, tempSingleQueryPointList); + singleQueryPointLists.push_back(tempSingleQueryPointList); + } - // Verify the two point lists are the same size, then verify that each point in each list is equal. - ASSERT_EQ(pointList.size(), singleQueryPointList.size()); - for (size_t index = 0; index < pointList.size(); index++) + // Verify the two point lists are the same size, then verify that each point in each list is equal. + ASSERT_EQ(singleQueryPointLists.size(), surfacePointLists.size()); + for (size_t listIndex = 0; listIndex < surfacePointLists.size(); listIndex++) + { + auto& surfacePointList = surfacePointLists[listIndex]; + auto& singleQueryPointList = singleQueryPointLists[listIndex]; + + ASSERT_EQ(singleQueryPointList.size(), surfacePointList.size()); + for (size_t index = 0; index < surfacePointList.size(); index++) { - SurfaceData::SurfacePoint& point1 = pointList[index]; + SurfaceData::SurfacePoint& point1 = surfacePointList[index]; SurfaceData::SurfacePoint& point2 = singleQueryPointList[index]; EXPECT_EQ(point1.m_entityId, point2.m_entityId); @@ -399,8 +400,8 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestAabbOverlaps2D) // Make sure the test produces the correct result. // Also make sure it's correct regardless of which order the boxes are passed in. - EXPECT_TRUE(SurfaceData::AabbOverlaps2D(box1, box2) == testCase.m_overlaps); - EXPECT_TRUE(SurfaceData::AabbOverlaps2D(box2, box1) == testCase.m_overlaps); + EXPECT_EQ(SurfaceData::AabbOverlaps2D(box1, box2), testCase.m_overlaps); + EXPECT_EQ(SurfaceData::AabbOverlaps2D(box2, box1), testCase.m_overlaps); } } @@ -448,9 +449,9 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestAabbContains2D) AZ::Vector3& point = testCase.m_testData[TestCase::POINT]; // Make sure the test produces the correct result. - EXPECT_TRUE(SurfaceData::AabbContains2D(box, point) == testCase.m_contains); + EXPECT_EQ(SurfaceData::AabbContains2D(box, point), testCase.m_contains); // Test the Vector2 version as well. - EXPECT_TRUE(SurfaceData::AabbContains2D(box, AZ::Vector2(point.GetX(), point.GetY())) == testCase.m_contains); + EXPECT_EQ(SurfaceData::AabbContains2D(box, AZ::Vector2(point.GetX(), point.GetY())), testCase.m_contains); } } @@ -482,19 +483,17 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion) &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, testTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // We expect every entry in the output list to have two surface points, at heights 0 and 4, sorted in // decreasing height order. The masks list should be the same size as the set of masks the provider owns. // We *could* check every mask as well for completeness, but that seems like overkill. for (auto& pointList : availablePointsPerPosition) { - EXPECT_TRUE(pointList.size() == 2); - EXPECT_TRUE(pointList[0].m_position.GetZ() == 4.0f); - EXPECT_TRUE(pointList[1].m_position.GetZ() == 0.0f); + EXPECT_EQ(pointList.size(), 2); + EXPECT_EQ(pointList[0].m_position.GetZ(), 4.0f); + EXPECT_EQ(pointList[1].m_position.GetZ(), 0.0f); for (auto& point : pointList) { - EXPECT_TRUE(point.m_masks.size() == providerTags.size()); + EXPECT_EQ(point.m_masks.size(), providerTags.size()); } } } @@ -520,13 +519,11 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_NoMatchingMas &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, testTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // We expect every entry in the output list to have no surface points, since the requested mask doesn't match // any of the masks from our mock surface provider. for (auto& queryPosition : availablePointsPerPosition) { - EXPECT_TRUE(queryPosition.size() == 0); + EXPECT_TRUE(queryPosition.empty()); } } @@ -550,13 +547,11 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_NoMatchingReg &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, testTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // We expect every entry in the output list to have no surface points, since the input points don't overlap with // our surface provider. for (auto& pointList : availablePointsPerPosition) { - EXPECT_TRUE(pointList.size() == 0); + EXPECT_TRUE(pointList.empty()); } } @@ -602,16 +597,17 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_ProviderModif &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, testTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // We expect every entry in the output list to have two surface points (with heights 0 and 4), // and each point should have both the "test_surface1" and "test_surface2" tag. for (auto& pointList : availablePointsPerPosition) { - EXPECT_TRUE(pointList.size() == 2); + EXPECT_EQ(pointList.size(), 2); + float expectedZ = 4.0f; for (auto& point : pointList) { - EXPECT_TRUE(point.m_masks.size() == 2); + EXPECT_EQ(point.m_position.GetZ(), expectedZ); + EXPECT_EQ(point.m_masks.size(), 2); + expectedZ = (expectedZ == 4.0f) ? 0.0f : 4.0f; } } } @@ -624,7 +620,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_SimilarPoints // sets of tags. // Create two mock Surface Providers that covers from (0, 0) - (8, 8) in space, with points spaced 0.25 apart. - // The first has heights 0 and 4, with the tag "surfaceTag1". The second has heights 0.005 and 4.005, with the tag "surfaceTag2". + // The first has heights 0 and 4, with the tag "surfaceTag1". The second has heights 0.0005 and 4.0005, with the tag "surfaceTag2". SurfaceData::SurfaceTagVector provider1Tags = { SurfaceData::SurfaceTag(m_testSurface1Crc) }; MockSurfaceProvider mockProvider1(MockSurfaceProvider::ProviderType::SURFACE_PROVIDER, provider1Tags, AZ::Vector3(0.0f), AZ::Vector3(8.0f), AZ::Vector3(0.25f, 0.25f, 4.0f), @@ -648,16 +644,17 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_SimilarPoints &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, testTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // We expect every entry in the output list to have two surface points, not four. The two points // should have both surface tags on them. for (auto& pointList : availablePointsPerPosition) { - EXPECT_TRUE(pointList.size() == 2); + EXPECT_EQ(pointList.size(), 2); + float expectedZ = 4.0005f; for (auto& point : pointList) { - EXPECT_TRUE(point.m_masks.size() == 2); + EXPECT_EQ(point.m_position.GetZ(), expectedZ); + EXPECT_EQ(point.m_masks.size(), 2); + expectedZ = (expectedZ == 4.0005f) ? 0.0005f : 4.0005f; } } } @@ -692,16 +689,14 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestSurfacePointsFromRegion_DissimilarPoi &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, testTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // We expect every entry in the output list to have four surface points with one tag each, // because the points are far enough apart that they won't merge. for (auto& pointList : availablePointsPerPosition) { - EXPECT_TRUE(pointList.size() == 4); + EXPECT_EQ(pointList.size(), 4); for (auto& point : pointList) { - EXPECT_TRUE(point.m_masks.size() == 1); + EXPECT_EQ(point.m_masks.size(), 1); } } } @@ -727,10 +722,17 @@ TEST_F(SurfaceDataTestApp, SurfaceData_VerifyGetSurfacePointsFromRegionAndGetSur &SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePointsFromRegion, regionBounds, stepSize, providerTags, availablePointsPerPosition); - EXPECT_TRUE(ValidateRegionListSize(regionBounds, stepSize, availablePointsPerPosition)); - // For each point entry returned from GetSurfacePointsFromRegion, call GetSurfacePoints and verify the results match. - CompareSurfacePointListWithGetSurfacePoints(availablePointsPerPosition, providerTags); + AZStd::vector queryPositions; + for (float y = 0.0f; y < 4.0f; y += 1.0f) + { + for (float x = 0.0f; x < 4.0f; x += 1.0f) + { + queryPositions.push_back(AZ::Vector3(x, y, 16.0f)); + } + } + + CompareSurfacePointListWithGetSurfacePoints(queryPositions, availablePointsPerPosition, providerTags); } TEST_F(SurfaceDataTestApp, SurfaceData_VerifyGetSurfacePointsFromListAndGetSurfacePointsMatch) @@ -763,7 +765,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_VerifyGetSurfacePointsFromListAndGetSurfa EXPECT_EQ(availablePointsPerPosition.size(), 16); // For each point entry returned from GetSurfacePointsFromList, call GetSurfacePoints and verify the results match. - CompareSurfacePointListWithGetSurfacePoints(availablePointsPerPosition, providerTags); + CompareSurfacePointListWithGetSurfacePoints(queryPositions, availablePointsPerPosition, providerTags); } // This uses custom test / benchmark hooks so that we can load LmbrCentral and use Shape components in our unit tests and benchmarks. AZ_UNIT_TEST_HOOK(new UnitTest::SurfaceDataTestEnvironment, UnitTest::SurfaceDataBenchmarkEnvironment); diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index 03011db2f3..9a9cb24e4c 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -177,7 +177,7 @@ namespace Terrain const AZ::Crc32 terrainTag = isHole ? Constants::s_terrainHoleTagCrc : Constants::s_terrainTagCrc; point.m_masks[terrainTag] = 1.0f; - surfacePointList.push_back(point); + surfacePointList.push_back(AZStd::move(point)); } AZ::Aabb TerrainSurfaceDataSystemComponent::GetSurfaceAabb() const From 71cc3a256845586f569a46cd0406bbf9c433ba35 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Tue, 1 Feb 2022 09:04:32 -0800 Subject: [PATCH 377/394] Remove -Wno-comment warning suppression Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- Code/Framework/AzCore/Tests/TaskTests.cpp | 64 +-- .../GridMate/Carrier/SecureSocketDriver.h | 16 +- .../Code/Source/Converters/FIR-Filter.cpp | 122 ++--- .../Feature/ParamMacros/ParamMacrosHowTo.inl | 474 +++++++++--------- Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp | 52 +- .../RPI/Code/Tests/Shader/ShaderTests.cpp | 29 +- .../EMotionFX/Rendering/Common/RenderUtil.cpp | 52 +- .../Code/Tests/AutoSkeletonLODTests.cpp | 36 +- Gems/EMotionFX/Code/Tests/BlendSpaceTests.cpp | 28 +- .../Code/Tests/NonUniformMotionDataTests.cpp | 78 +-- .../Code/Source/Shape/TubeShape.cpp | 25 +- .../Common/GCC/Configurations_gcc.cmake | 2 - 12 files changed, 501 insertions(+), 477 deletions(-) diff --git a/Code/Framework/AzCore/Tests/TaskTests.cpp b/Code/Framework/AzCore/Tests/TaskTests.cpp index 4f53772d51..53fa89900e 100644 --- a/Code/Framework/AzCore/Tests/TaskTests.cpp +++ b/Code/Framework/AzCore/Tests/TaskTests.cpp @@ -447,13 +447,13 @@ namespace UnitTest { x -= 1; }); - - // a <-- Root - // / \ - // b c - // \ / - // d - + /* + a <-- Root + / \ + b c + \ / + d + */ a.Precedes(b, c); d.Follows(b, c); @@ -522,20 +522,20 @@ namespace UnitTest { x -= 1; }); - - // NOTE: The ideal way to express this topology is without the wait on the subgraph - // at task g, but this is more an illustrative test. Better is to express the entire - // graph in a single larger graph. - // a <-- Root - // / \ - // b c - f - // \ \ \ - // \ e - g - // \ / - // \ / - // \ / - // d - + /* + NOTE: The ideal way to express this topology is without the wait on the subgraph + at task g, but this is more an illustrative test. Better is to express the entire + graph in a single larger graph. + a <-- Root + / \ + b c - f + \ \ \ + \ e - g + \ / + \ / + \ / + d + */ a.Precedes(b); a.Precedes(c); b.Precedes(d); @@ -593,17 +593,17 @@ namespace UnitTest { x += 0b1000; }); - - // a <-- Root - // / \ - // b c - f - // \ \ \ - // \ e - g - // \ / - // \ / - // \ / - // d - + /* + a <-- Root + / \ + b c - f + \ \ \ + \ e - g + \ / + \ / + \ / + d + */ a.Precedes(b, c); b.Precedes(d); c.Precedes(e, f); diff --git a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h index 76b7958085..30a9f99436 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h +++ b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h @@ -19,13 +19,15 @@ #define AZ_DebugSecureSocket(...) #define AZ_DebugSecureSocketConnection(window, fmt, ...) -//#define AZ_DebugUseSocketDebugLog -//#define AZ_DebugSecureSocket AZ_TracePrintf -//#define AZ_DebugSecureSocketConnection(window, fmt, ...) \ -//{\ -// AZStd::string line = AZStd::string::format(fmt, __VA_ARGS__);\ -// this->m_dbgLog += line;\ -//} +/* + #define AZ_DebugUseSocketDebugLog + #define AZ_DebugSecureSocket AZ_TracePrintf + #define AZ_DebugSecureSocketConnection(window, fmt, ...) \ + {\ + AZStd::string line = AZStd::string::format(fmt, __VA_ARGS__);\ + this->m_dbgLog += line;\ + } +*/ #if AZ_TRAIT_GRIDMATE_SECURE_SOCKET_DRIVER_HOOK_ENABLED struct ssl_st; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/FIR-Filter.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/FIR-Filter.cpp index 0387ec5c7b..2b1e822db4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/FIR-Filter.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/FIR-Filter.cpp @@ -999,79 +999,81 @@ namespace ImageProcessingAtom } // TODO: not working yet, debug and enable - //static void SplitAlgorithm(const void* i, void* o, struct prcparm* templ, int threads = 8) - //{ - // struct prcparm fraction[32]; - // int t, istart = 0, sstart = 0, ostart = 0; - // const bool scaler = true; + /* + static void SplitAlgorithm(const void* i, void* o, struct prcparm* templ, int threads = 8) + { + struct prcparm fraction[32]; + int t, istart = 0, sstart = 0, ostart = 0; + const bool scaler = true; - // int theight = 0; + int theight = 0; - // /* prepare data to be emitted to the threads */ - // for (t = 0; t < threads; t++) - // { - // fraction[t] = *templ; + // prepare data to be emitted to the threads + for (t = 0; t < threads; t++) + { + fraction[t] = *templ; - // /* adjust the processing-region according to the available threads */ - // { - //#undef split /* only prefix-threads need aligned transpose (for not trashing suffix-thread data) */ - //#define split(rows) !scaler \ - // ? ((rows * (t + 1)) / threads) & (~(t != threads - 1 ? 15 : 0)) \ - // : ((rows * (t + 1)) / threads) & (~0) + // adjust the processing-region according to the available threads + { + #undef split // only prefix-threads need aligned transpose (for not trashing suffix-thread data) + #define split(rows) !scaler \ + ? ((rows * (t + 1)) / threads) & (~(t != threads - 1 ? 15 : 0)) \ + : ((rows * (t + 1)) / threads) & (~0) - // /* area covered */ - // const int inrows = (fraction[t].regional ? fraction[t].region.inrows : fraction[t].inrows); - // const int incols = (fraction[t].regional ? fraction[t].region.incols : fraction[t].incols); - // const int subrows = (fraction[t].regional ? fraction[t].region.subrows : fraction[t].subrows); - // const int subcols = (fraction[t].regional ? fraction[t].region.subcols : fraction[t].subcols); - // const int outrows = (fraction[t].regional ? fraction[t].region.outrows : fraction[t].outrows); - // const int outcols = (fraction[t].regional ? fraction[t].region.outcols : fraction[t].outcols); + // area covered + const int inrows = (fraction[t].regional ? fraction[t].region.inrows : fraction[t].inrows); + const int incols = (fraction[t].regional ? fraction[t].region.incols : fraction[t].incols); + const int subrows = (fraction[t].regional ? fraction[t].region.subrows : fraction[t].subrows); + const int subcols = (fraction[t].regional ? fraction[t].region.subcols : fraction[t].subcols); + const int outrows = (fraction[t].regional ? fraction[t].region.outrows : fraction[t].outrows); + const int outcols = (fraction[t].regional ? fraction[t].region.outcols : fraction[t].outcols); - // /* splitting blocks */ - // const int istop = split(inrows), sstop = split(subrows), ostop = split(outrows); - // const int irows = istop - istart, srows = sstop - sstart, orows = ostop - ostart; - // const int icols = incols, scols = subcols, ocols = outcols; + // splitting blocks + const int istop = split(inrows), sstop = split(subrows), ostop = split(outrows); + const int irows = istop - istart, srows = sstop - sstart, orows = ostop - ostart; + const int icols = incols, scols = subcols, ocols = outcols; - // AZ_Assert(irows > 0, "%s: Expect row count to be above zero!", __FUNCTION__); - // AZ_Assert(orows > 0, "%s: Expect row count to be above zero!", __FUNCTION__); - // AZ_Assert(icols > 0, "%s: Expect column count to be above zero!", __FUNCTION__); - // AZ_Assert(ocols > 0, "%s: Expect column count to be above zero!", __FUNCTION__); + AZ_Assert(irows > 0, "%s: Expect row count to be above zero!", __FUNCTION__); + AZ_Assert(orows > 0, "%s: Expect row count to be above zero!", __FUNCTION__); + AZ_Assert(icols > 0, "%s: Expect column count to be above zero!", __FUNCTION__); + AZ_Assert(ocols > 0, "%s: Expect column count to be above zero!", __FUNCTION__); - // /* now we are regional */ - // fraction[t].regional = true; + // now we are regional + fraction[t].regional = true; - // /* take previous regionality into account */ - // fraction[t].region.intop += istart; - // fraction[t].region.subtop += sstart; - // fraction[t].region.outtop += ostart; - // fraction[t].region.inrows = irows; - // fraction[t].region.subrows = srows; - // fraction[t].region.outrows = orows; + // take previous regionality into account + fraction[t].region.intop += istart; + fraction[t].region.subtop += sstart; + fraction[t].region.outtop += ostart; + fraction[t].region.inrows = irows; + fraction[t].region.subrows = srows; + fraction[t].region.outrows = orows; - // /* take previous regionality into account */ - // fraction[t].region.inleft += 0; - // fraction[t].region.subleft += 0; - // fraction[t].region.outleft += 0; - // fraction[t].region.incols = icols; - // fraction[t].region.subcols = scols; - // fraction[t].region.outcols = ocols; + // take previous regionality into account + fraction[t].region.inleft += 0; + fraction[t].region.subleft += 0; + fraction[t].region.outleft += 0; + fraction[t].region.incols = icols; + fraction[t].region.subcols = scols; + fraction[t].region.outcols = ocols; - // /* advance block */ - // istart = istop; - // sstart = sstop; - // ostart = ostop; + // advance block + istart = istop; + sstart = sstop; + ostart = ostop; - // /* check */ - // theight += irows; - // } + // check + theight += irows; + } - // // the algorithm supports "i" and "o" pointing to the same memory - // CheckBoundaries((float*)i, (float*)o, &fraction[t]); - // RunAlgorithm((float*)i, (float*)o, &fraction[t]); - // } + // the algorithm supports "i" and "o" pointing to the same memory + CheckBoundaries((float*)i, (float*)o, &fraction[t]); + RunAlgorithm((float*)i, (float*)o, &fraction[t]); + } - // AZ_Assert(theight >= (templ->regional ? templ->region.inrows : templ->inrows), "%s: Invalid height!", __FUNCTION__); - //} + AZ_Assert(theight >= (templ->regional ? templ->region.inrows : templ->inrows), "%s: Invalid height!", __FUNCTION__); + } + */ /* #################################################################################################################### \ */ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl index e6fd6c10ba..ecf63ff5f6 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl @@ -6,239 +6,241 @@ * */ -// -// This is a quick guide on how to use the parameter macros included in this folder -// -// Part I: The Pattern -// -// The aim of this macro system is to allow users to define parameters once and have the macros generate a bunch of boilerplate code for each defined parameter. -// While these macros makes things a little more complex upfront, the ability to add and remove variables in just one place without having to dig -// through multiple files every time is great for iteration speed and maintenance. To accomplish this, we use a pattern similar to the following example: -// -// Let's say we want to specify class members in one place and have the members, getters and setters be auto generated. -// First, we define a macro MY_CLASS_PARAMS that uses a yet-undefined macro MAKE_PARAM(TYPE, NAME): -// -// #define MY_CLASS_PARAMS \ -// MAKE_PARAM(float, Width) \ -// MAKE_PARAM(float, Height) \ -// MAKE_PARAM(float, Depth) \ -// -// Now we need only specify what MAKE_PARAM needs to do and then we can call the MY_CLASS_PARAMS macro to apply the logic to all defined params. For instance: -// -// #define MAKE_PARAM(TYPE, NAME) TYPE m_##NAME; -// MY_CLASS_PARAMS -// #undef MAKE_PARAM -// -// This will generate the members as follows: -// -// float m_Width; -// float m_Height; -// float m_Depth; -// -// Now elsewhere in the class definition we can generate getters and setters: -// -// #define MAKE_PARAM(TYPE, NAME) \ -// TYPE Get##NAME() { return m_##NAME; } \ -// void Set##NAME(TYPE NAME) { m_##NAME = NAME; } \ -// -// MY_CLASS_PARAMS -// -// #undef MAKE_PARAM -// -// This will generate the following: -// -// float GetWidth() { return m_Width; } -// void SetWidth(float Width) { m_Width = Width; } -// float GetHeight() { return m_Height; } -// void SetHeight(float Width) { m_Height = Height; } -// float GetDepth() { return m_Width; } -// void SetDepth(float Depth) { m_Depth = Depth; } -// -// If we wanted to generate further code for each variable, we need only redefine the MAKE_PARAM macro and invoke MY_CLASS_PARAMS -// -// ___________________________________________________________________________________________________________________________________________________ -// -// Part II: Using .inl files -// -// A key difference between the above example and our macro system is that we put macro definitions in .inl files so they can be easily reused -// If we were to reuse the above example, it would look something like this: -// -// GenerateMembers.inl -// -// #define MAKE_PARAM(TYPE, NAME) TYPE m_##NAME; -// -// GenerateGettersAndSetters.inl -// -// #define MAKE_PARAM(TYPE, NAME) \ -// TYPE Get##NAME() { return m_##NAME; } \ -// void Set##NAME(TYPE NAME) { m_##NAME = NAME; } \ -// -// BoxParams.inl -// -// MAKE_PARAM(float, Width) \ -// MAKE_PARAM(float, Height) \ -// MAKE_PARAM(float, Depth) \ -// -// CylinderParams.inl -// -// MAKE_PARAM(float, Radius) \ -// MAKE_PARAM(float, Height) \ -// -// Now we can use these .inl files to generate two classes, each with members, getters and setters -// -// class Box -// { -// // Auto-gen members from BoxParams.inl -// #include -// #include -// #undef MAKE_PARAM -// -// // Auto-gen getters and setters from BoxParams.inl -// #include -// #include -// #undef MAKE_PARAM -// } -// -// class Cylinder -// { -// // Auto-gen members from CylinderParams.inl -// #include -// #include -// #undef MAKE_PARAM -// -// // Auto-gen getters and setters from CylinderParams.inl -// #include -// #include -// #undef MAKE_PARAM -// } -// -// This will result in the following code: -// -// class Box -// { -// // Auto-gen members from BoxParams.inl -// float m_Width; -// float m_Height; -// float m_Depth; -// -// // Auto-gen getters and setters from BoxParams.inl -// float GetWidth() { return m_Width; } -// void SetWidth(float Width) { m_Width = Width; } -// float GetHeight() { return m_Height; } -// void SetHeight(float Width) { m_Height = Height; } -// float GetDepth() { return m_Width; } -// void SetDepth(float Depth) { m_Depth = Depth; } -// } -// -// class Cylinder -// { -// // Auto-gen members from CylinderParams.inl -// float m_Radius; -// float m_Height; -// -// // Auto-gen getters and setters from CylinderParams.inl -// float GetRadius() { return m_Radius; } -// void SetRadius(float Radius) { m_Radius = Raidus; } -// float GetHeight() { return m_Height; } -// void SetHeight(float Width) { m_Height = Height; } -// } -// -// As you can see, this macro pattern allows us to add a member to Box or Cylinder by adding a single line to BoxParams.inl or CylinderParams.inl -// Because of the number of classes an boiler plate code involved in creating Open 3D Engine Component, this macro system allows us to change one line -// in one file instead of changing over a dozens of lines in half a dozen files. -// -// ___________________________________________________________________________________________________________________________________________________ -// -// Part III: Using the Macros for Post Process members -// -// If you want to create a new post process, you can create a .inl file (see DepthOfFieldParams.inl for an example) and declare members using the macros below: -// -// #define AZ_GFX_BOOL_PARAM(Name, MemberName, DefaultValue) -// #define AZ_GFX_FLOAT_PARAM(Name, MemberName, DefaultValue) -// #define AZ_GFX_UINT32_PARAM(Name, MemberName, DefaultValue) -// #define AZ_GFX_VEC2_PARAM(Name, MemberName, DefaultValue) -// #define AZ_GFX_VEC3_PARAM(Name, MemberName, DefaultValue) -// #define AZ_GFX_VEC4_PARAM(Name, MemberName, DefaultValue) -// -// Where: -// Name - The name of the param that will be used for reflection and appended to setters and getters, for example Width -// MemberName - The name of the member defined inside your class, for example m_width -// DefaultValue - The default value that the member will be statically initialized to, for example 1.0f -// BOOL, FLOAT, UINT32, VEC2 etc. all designate the type of the param you are defining -// -// If you have a custom type for your parameter, you can use the AZ_GFX_COMMON_PARAM macro: -// AZ_GFX_COMMON_PARAM(Name, MemberName, DefaultValue, ValueType) -// The keywords here are the same as above, with the addition of ValueType: the custom type you want your param to be -// -// Example usages: -// -// #define AZ_GFX_VEC3_PARAM(Position, m_position, Vector3(0.0f, 0.0f, 0.0f)) -// -// #define AZ_GFX_COMMON_PARAM(Format, m_format, Format::Unknown, FormatEnum) -// -// ___________________________________________________________________________________________________________________________________________________ -// -// Part IV: Using the Macros for Post Process overrides -// -// The Post Process System allows users to specify whether settings should be overridden or not on a per-member basis. -// To enable this, when you declare a member that can be overridden by higher priority Post Process Settings, in addition -// to using the above macros to define the member, you should also use one of the following to specify the override: -// -// #define AZ_GFX_ANY_PARAM_BOOL_OVERRIDE(Name, MemberName, ValueType) -// #define AZ_GFX_INTEGER_PARAM_FLOAT_OVERRIDE(Name, MemberName, ValueType) -// #define AZ_GFX_FLOAT_PARAM_FLOAT_OVERRIDE(Name, MemberName, ValueType) -// -// Where: -// Name - The name of the param that will be used for reflection and appended to setters and getters, for example Width -// MemberName - The name of the member defined inside your class, for example m_width -// ValueType - The type of the parameter you defined (bool, float, uint32_t, Vector2 etc.) -// -// A bit more details on each of the override macros: -// -// AZ_GFX_ANY_PARAM_BOOL_OVERRIDE can be used for params of any type. The override variable will be a bool (checkbox in the UI). -// The override application is a simple binary operation: take all of the source or the target (no lerp) depending on the bool. -// -// AZ_GFX_INTEGER_PARAM_FLOAT_OVERRIDE should be used for params of integer types (int, uint, integer vectors...) The override variable -// will be a float from 0.0 to 1.0 (slider in the UI). The override will lerp between target and source using the override float -// variable. Note that for this reason the param integer type must support multiplication by a float value. -// -// AZ_GFX_FLOAT_PARAM_FLOAT_OVERRIDE should be used for params of floating point types (float, double, Vector4...) The override variable -// will be a float from 0.0 to 1.0 (slider in the UI). The override will lerp between target and source using the override float. -// -// Example usage: -// -// #define AZ_GFX_VEC3_PARAM(Position, m_position, Vector3(0.0f, 0.0f, 0.0f)) -// #define AZ_GFX_FLOAT_PARAM_FLOAT_OVERRIDE(Position, m_position, Vector3) -// -// ___________________________________________________________________________________________________________________________________________________ -// -// Part V: Defining functionality with .inl files -// -// There are many .inl fies in this folder that provide pre-defined behaviors for params declared with the above macros -// To use these files, start by including the .inl file that specifies the behavior, then include your own .inl that defines your params -// then include EndParams.inl (this will #undef all used macros so as to avoid collisions with subsequent macro usage further in the file) -// -// Here is an example of how that looks: -// -// #include <- The behavior you want (behavior is described in each file) -// #include <- Your file in which you declare your params -// #include <- This #undef a bunch of macros to avoid conflicts -// -// You may of course use your own custom behaviors by specifying your definition for the param and override macros. -// You can specify each macro individually (AZ_GFX_BOOL_PARAM, AZ_GFX_FLOAT_PARAM, AZ_GFX_UINT32_PARAM, AZ_GFX_VEC2_PARAM, etc.) -// or you can specify the AZ_GFX_COMMON_PARAM and AZ_GFX_COMMON_OVERRIDE macros if there's no difference between variable types. -// -// AZ_GFX_COMMON_PARAM and AZ_GFX_COMMON_OVERRIDE are helper macros that the other _PARAM and _OVERRIDE macros can be mapped to -// using MapAllCommon.inl, allowing you to specify one definition for all types rather than each type individually. -// Here is an example of how we can use AZ_GFX_COMMON_PARAM and AZ_GFX_COMMON_OVERRIDE to auto-generate getters for our member parameters: -// -// #define AZ_GFX_COMMON_PARAM(Name, MemberName, DefaultValue, ValueType) \ -// ValueType Get##Name() const override { return MemberName; } \ -// -// #define AZ_GFX_COMMON_OVERRIDE(Name, MemberName, ValueType, OverrideValueType) \ -// OverrideValueType Get##Name##Override() const override { return MemberName##Override; } \ -// -// #include -// #include -// #include -// +/* + + This is a quick guide on how to use the parameter macros included in this folder + + Part I: The Pattern + + The aim of this macro system is to allow users to define parameters once and have the macros generate a bunch of boilerplate code for each defined parameter. + While these macros makes things a little more complex upfront, the ability to add and remove variables in just one place without having to dig + through multiple files every time is great for iteration speed and maintenance. To accomplish this, we use a pattern similar to the following example: + + Let's say we want to specify class members in one place and have the members, getters and setters be auto generated. + First, we define a macro MY_CLASS_PARAMS that uses a yet-undefined macro MAKE_PARAM(TYPE, NAME): + + #define MY_CLASS_PARAMS \ + MAKE_PARAM(float, Width) \ + MAKE_PARAM(float, Height) \ + MAKE_PARAM(float, Depth) \ + + Now we need only specify what MAKE_PARAM needs to do and then we can call the MY_CLASS_PARAMS macro to apply the logic to all defined params. For instance: + + #define MAKE_PARAM(TYPE, NAME) TYPE m_##NAME; + MY_CLASS_PARAMS + #undef MAKE_PARAM + + This will generate the members as follows: + + float m_Width; + float m_Height; + float m_Depth; + + Now elsewhere in the class definition we can generate getters and setters: + + #define MAKE_PARAM(TYPE, NAME) \ + TYPE Get##NAME() { return m_##NAME; } \ + void Set##NAME(TYPE NAME) { m_##NAME = NAME; } \ + + MY_CLASS_PARAMS + + #undef MAKE_PARAM + + This will generate the following: + + float GetWidth() { return m_Width; } + void SetWidth(float Width) { m_Width = Width; } + float GetHeight() { return m_Height; } + void SetHeight(float Width) { m_Height = Height; } + float GetDepth() { return m_Width; } + void SetDepth(float Depth) { m_Depth = Depth; } + + If we wanted to generate further code for each variable, we need only redefine the MAKE_PARAM macro and invoke MY_CLASS_PARAMS + + ___________________________________________________________________________________________________________________________________________________ + + Part II: Using .inl files + + A key difference between the above example and our macro system is that we put macro definitions in .inl files so they can be easily reused + If we were to reuse the above example, it would look something like this: + + GenerateMembers.inl + + #define MAKE_PARAM(TYPE, NAME) TYPE m_##NAME; + + GenerateGettersAndSetters.inl + + #define MAKE_PARAM(TYPE, NAME) \ + TYPE Get##NAME() { return m_##NAME; } \ + void Set##NAME(TYPE NAME) { m_##NAME = NAME; } \ + + BoxParams.inl + + MAKE_PARAM(float, Width) \ + MAKE_PARAM(float, Height) \ + MAKE_PARAM(float, Depth) \ + + CylinderParams.inl + + MAKE_PARAM(float, Radius) \ + MAKE_PARAM(float, Height) \ + + Now we can use these .inl files to generate two classes, each with members, getters and setters + + class Box + { + // Auto-gen members from BoxParams.inl + #include + #include + #undef MAKE_PARAM + + // Auto-gen getters and setters from BoxParams.inl + #include + #include + #undef MAKE_PARAM + } + + class Cylinder + { + // Auto-gen members from CylinderParams.inl + #include + #include + #undef MAKE_PARAM + + // Auto-gen getters and setters from CylinderParams.inl + #include + #include + #undef MAKE_PARAM + } + + This will result in the following code: + + class Box + { + // Auto-gen members from BoxParams.inl + float m_Width; + float m_Height; + float m_Depth; + + // Auto-gen getters and setters from BoxParams.inl + float GetWidth() { return m_Width; } + void SetWidth(float Width) { m_Width = Width; } + float GetHeight() { return m_Height; } + void SetHeight(float Width) { m_Height = Height; } + float GetDepth() { return m_Width; } + void SetDepth(float Depth) { m_Depth = Depth; } + } + + class Cylinder + { + // Auto-gen members from CylinderParams.inl + float m_Radius; + float m_Height; + + // Auto-gen getters and setters from CylinderParams.inl + float GetRadius() { return m_Radius; } + void SetRadius(float Radius) { m_Radius = Raidus; } + float GetHeight() { return m_Height; } + void SetHeight(float Width) { m_Height = Height; } + } + + As you can see, this macro pattern allows us to add a member to Box or Cylinder by adding a single line to BoxParams.inl or CylinderParams.inl + Because of the number of classes an boiler plate code involved in creating Open 3D Engine Component, this macro system allows us to change one line + in one file instead of changing over a dozens of lines in half a dozen files. + + ___________________________________________________________________________________________________________________________________________________ + + Part III: Using the Macros for Post Process members + + If you want to create a new post process, you can create a .inl file (see DepthOfFieldParams.inl for an example) and declare members using the macros below: + + #define AZ_GFX_BOOL_PARAM(Name, MemberName, DefaultValue) + #define AZ_GFX_FLOAT_PARAM(Name, MemberName, DefaultValue) + #define AZ_GFX_UINT32_PARAM(Name, MemberName, DefaultValue) + #define AZ_GFX_VEC2_PARAM(Name, MemberName, DefaultValue) + #define AZ_GFX_VEC3_PARAM(Name, MemberName, DefaultValue) + #define AZ_GFX_VEC4_PARAM(Name, MemberName, DefaultValue) + + Where: + Name - The name of the param that will be used for reflection and appended to setters and getters, for example Width + MemberName - The name of the member defined inside your class, for example m_width + DefaultValue - The default value that the member will be statically initialized to, for example 1.0f + BOOL, FLOAT, UINT32, VEC2 etc. all designate the type of the param you are defining + + If you have a custom type for your parameter, you can use the AZ_GFX_COMMON_PARAM macro: + AZ_GFX_COMMON_PARAM(Name, MemberName, DefaultValue, ValueType) + The keywords here are the same as above, with the addition of ValueType: the custom type you want your param to be + + Example usages: + + #define AZ_GFX_VEC3_PARAM(Position, m_position, Vector3(0.0f, 0.0f, 0.0f)) + + #define AZ_GFX_COMMON_PARAM(Format, m_format, Format::Unknown, FormatEnum) + + ___________________________________________________________________________________________________________________________________________________ + + Part IV: Using the Macros for Post Process overrides + + The Post Process System allows users to specify whether settings should be overridden or not on a per-member basis. + To enable this, when you declare a member that can be overridden by higher priority Post Process Settings, in addition + to using the above macros to define the member, you should also use one of the following to specify the override: + + #define AZ_GFX_ANY_PARAM_BOOL_OVERRIDE(Name, MemberName, ValueType) + #define AZ_GFX_INTEGER_PARAM_FLOAT_OVERRIDE(Name, MemberName, ValueType) + #define AZ_GFX_FLOAT_PARAM_FLOAT_OVERRIDE(Name, MemberName, ValueType) + + Where: + Name - The name of the param that will be used for reflection and appended to setters and getters, for example Width + MemberName - The name of the member defined inside your class, for example m_width + ValueType - The type of the parameter you defined (bool, float, uint32_t, Vector2 etc.) + + A bit more details on each of the override macros: + + AZ_GFX_ANY_PARAM_BOOL_OVERRIDE can be used for params of any type. The override variable will be a bool (checkbox in the UI). + The override application is a simple binary operation: take all of the source or the target (no lerp) depending on the bool. + + AZ_GFX_INTEGER_PARAM_FLOAT_OVERRIDE should be used for params of integer types (int, uint, integer vectors...) The override variable + will be a float from 0.0 to 1.0 (slider in the UI). The override will lerp between target and source using the override float + variable. Note that for this reason the param integer type must support multiplication by a float value. + + AZ_GFX_FLOAT_PARAM_FLOAT_OVERRIDE should be used for params of floating point types (float, double, Vector4...) The override variable + will be a float from 0.0 to 1.0 (slider in the UI). The override will lerp between target and source using the override float. + + Example usage: + + #define AZ_GFX_VEC3_PARAM(Position, m_position, Vector3(0.0f, 0.0f, 0.0f)) + #define AZ_GFX_FLOAT_PARAM_FLOAT_OVERRIDE(Position, m_position, Vector3) + + ___________________________________________________________________________________________________________________________________________________ + + Part V: Defining functionality with .inl files + + There are many .inl fies in this folder that provide pre-defined behaviors for params declared with the above macros + To use these files, start by including the .inl file that specifies the behavior, then include your own .inl that defines your params + then include EndParams.inl (this will #undef all used macros so as to avoid collisions with subsequent macro usage further in the file) + + Here is an example of how that looks: + + #include <- The behavior you want (behavior is described in each file) + #include <- Your file in which you declare your params + #include <- This #undef a bunch of macros to avoid conflicts + + You may of course use your own custom behaviors by specifying your definition for the param and override macros. + You can specify each macro individually (AZ_GFX_BOOL_PARAM, AZ_GFX_FLOAT_PARAM, AZ_GFX_UINT32_PARAM, AZ_GFX_VEC2_PARAM, etc.) + or you can specify the AZ_GFX_COMMON_PARAM and AZ_GFX_COMMON_OVERRIDE macros if there's no difference between variable types. + + AZ_GFX_COMMON_PARAM and AZ_GFX_COMMON_OVERRIDE are helper macros that the other _PARAM and _OVERRIDE macros can be mapped to + using MapAllCommon.inl, allowing you to specify one definition for all types rather than each type individually. + Here is an example of how we can use AZ_GFX_COMMON_PARAM and AZ_GFX_COMMON_OVERRIDE to auto-generate getters for our member parameters: + + #define AZ_GFX_COMMON_PARAM(Name, MemberName, DefaultValue, ValueType) \ + ValueType Get##Name() const override { return MemberName; } \ + + #define AZ_GFX_COMMON_OVERRIDE(Name, MemberName, ValueType, OverrideValueType) \ + OverrideValueType Get##Name##Override() const override { return MemberName##Override; } \ + + #include + #include + #include + +*/ diff --git a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp index 81d773d8c0..cbdb99a008 100644 --- a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp @@ -976,14 +976,14 @@ namespace UnitTest EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x70000F51); } - // - // +----+ - // / /| - // +----+ | - // | | + - // | |/ - // +----+ - // + /* + +----+ + / /| + +----+ | + | | + + | |/ + +----+ + */ static constexpr AZStd::array CubePositions = { -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f }; static constexpr AZStd::array CubeIndices = { @@ -993,23 +993,25 @@ namespace UnitTest static constexpr AZStd::array QuadPositions = { -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f }; static constexpr AZStd::array QuadIndices = { uint32_t{ 0 }, 2, 1, 1, 2, 3 }; - // This class creates a Model with one LOD, whose mesh contains 2 planes. Plane 1 is in the XY plane at Z=-0.5, and - // plane 2 is in the XY plane at Z=0.5. The two planes each have 9 quads which have been triangulated. It only has - // a position and index buffer. - // - // -0.33 - // -1 0.33 1 - // 0.5 *---*---*---* - // \ / \ / \ / \ - // *---*---*---* - // \ / \ / \ / \ - // -0.5 *- *---*---*---* - // \ \ / \ / \ / \ - // *- *---*---*---* - // \ \ \ \ - // *---*---*---* - // \ / \ / \ / \ - // *---*---*---* + /* + This class creates a Model with one LOD, whose mesh contains 2 planes. Plane 1 is in the XY plane at Z=-0.5, and + plane 2 is in the XY plane at Z=0.5. The two planes each have 9 quads which have been triangulated. It only has + a position and index buffer. + + -0.33 + -1 0.33 1 + 0.5 *---*---*---* + \ / \ / \ / \ + *---*---*---* + \ / \ / \ / \ + -0.5 *- *---*---*---* + \ \ / \ / \ / \ + *- *---*---*---* + \ \ \ \ + *---*---*---* + \ / \ / \ / \ + *---*---*---* + */ static constexpr AZStd::array TwoSeparatedPlanesPositions{ -1.0f, -0.333f, -0.5f, -0.333f, -1.0f, -0.5f, -0.333f, -0.333f, -0.5f, 0.333f, -0.333f, -0.5f, 1.0f, -1.0f, -0.5f, 1.0f, -0.333f, -0.5f, 0.333f, -1.0f, -0.5f, 0.333f, 1.0f, -0.5f, 1.0f, 0.333f, -0.5f, 1.0f, 1.0f, -0.5f, diff --git a/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp b/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp index 74f79ad80a..b30fd0ec94 100644 --- a/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp @@ -1666,20 +1666,21 @@ namespace UnitTest EXPECT_FALSE(result7.IsFullyBaked()); EXPECT_EQ(result7.GetStableId().GetIndex(), stableId7); - // All searches so far found exactly the node we were looking for - // The next couple of searches will not find the requested node - // and will instead default to its parent, up the tree to the root - // - // [] [Root] - // / \ - // [Color] [Teal] [Fuchsia] - // / \ - // [Quality] [Sublime] [Auto] - // / - // [NumberSamples] [50] - // / \ - // [Raytracing] [On] [Off] - + /* + All searches so far found exactly the node we were looking for + The next couple of searches will not find the requested node + and will instead default to its parent, up the tree to the root + + [] [Root] + / \ + [Color] [Teal] [Fuchsia] + / \ + [Quality] [Sublime] [Auto] + / + [NumberSamples] [50] + / \ + [Raytracing] [On] [Off] + */ // ---------------------------------------- // [Quality::Poor] diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp index 23e5d25824..7f909e0e5f 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp @@ -1634,19 +1634,19 @@ namespace MCommon AZ::Vector3 vertices[7]; /* - // 4 - // / \ - // / \ - // / \ - // / \ - // / \ - // 5-----6 2-----3 - // | | - // | | - // | | - // | | - // | | - // 0---------1 + 4 + / \ + / \ + / \ + / \ + / \ + 5-----6 2-----3 + | | + | | + | | + | | + | | + 0---------1 */ // construct the arrow vertices vertices[0] = center + AZ::Vector3(-right * trailWidthHalf - forward * trailLengh) * scale; @@ -1744,19 +1744,19 @@ namespace MCommon AZ::Vector3 oldLeft, oldRight; /* - // 4 - // / \ - // / \ - // / \ - // / \ - // / \ - // 5-----6 2-----3 - // | | - // | | - // | | - // | | - // | | - // 0-------1 + 4 + / \ + / \ + / \ + / \ + / \ + 5-----6 2-----3 + | | + | | + | | + | | + | | + 0-------1 */ // construct the arrow vertices vertices[0] = center + (-right * trailWidthHalf - forward * trailLength) * scale; diff --git a/Gems/EMotionFX/Code/Tests/AutoSkeletonLODTests.cpp b/Gems/EMotionFX/Code/Tests/AutoSkeletonLODTests.cpp index 726aa664f0..d445bc62e0 100644 --- a/Gems/EMotionFX/Code/Tests/AutoSkeletonLODTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AutoSkeletonLODTests.cpp @@ -31,23 +31,25 @@ namespace EMotionFX class AutoSkeletonLODActor : public SimpleJointChainActor { - // This creates an Actor with following hierarchy. - // The numbers are the joint indices. - // - // 5 - // / - // / - // 0-----1-----2-----3-----4 - // \ - // \ - // 6 - // - // 7 (a node with skinned mesh) - // - // The mesh is on node 7, which is also a root node, just like joint number 0. - // We (fake) skin the first six joints to the mesh of node 7. - // Our test will actually skin to only a selection of these first seven joints. - // We then test which joints get disabled and which not. + /* + This creates an Actor with following hierarchy. + The numbers are the joint indices. + + 5 + / + / + 0-----1-----2-----3-----4 + \ + \ + 6 + + 7 (a node with skinned mesh) + + The mesh is on node 7, which is also a root node, just like joint number 0. + We (fake) skin the first six joints to the mesh of node 7. + Our test will actually skin to only a selection of these first seven joints. + We then test which joints get disabled and which not. + */ public: explicit AutoSkeletonLODActor(AZ::u32 numSubMeshJoints) : SimpleJointChainActor(5) diff --git a/Gems/EMotionFX/Code/Tests/BlendSpaceTests.cpp b/Gems/EMotionFX/Code/Tests/BlendSpaceTests.cpp index b2f6f49d8f..ce8387f150 100644 --- a/Gems/EMotionFX/Code/Tests/BlendSpaceTests.cpp +++ b/Gems/EMotionFX/Code/Tests/BlendSpaceTests.cpp @@ -254,19 +254,21 @@ namespace EMotionFX EXPECT_EQ(motions.size(), 4); EXPECT_EQ(uniqueData->m_triangles.size(), 2); - // run 2 * - // |\ - // | \ - // | \ - // | \ - // | \ - // forward 1 * * 3 Strafe - // | / - // | / - // | / - // | / - // |/ - // idle 0 * + /* + run 2 * + |\ + | \ + | \ + | \ + | \ + forward 1 * * 3 Strafe + | / + | / + | / + | / + |/ + idle 0 * + */ EXPECT_EQ(uniqueData->m_triangles[0], BlendSpace2DNode::Triangle(1, 0, 3)); EXPECT_EQ(uniqueData->m_triangles[1], BlendSpace2DNode::Triangle(2, 1, 3)); } diff --git a/Gems/EMotionFX/Code/Tests/NonUniformMotionDataTests.cpp b/Gems/EMotionFX/Code/Tests/NonUniformMotionDataTests.cpp index 09a4e46b84..cc3e3c344a 100644 --- a/Gems/EMotionFX/Code/Tests/NonUniformMotionDataTests.cpp +++ b/Gems/EMotionFX/Code/Tests/NonUniformMotionDataTests.cpp @@ -285,12 +285,14 @@ namespace EMotionFX numRemoved = motionData.ReduceSamples(reduceSettings); EXPECT_EQ(motionData.GetNumFloatSamples(0), 2); EXPECT_EQ(numRemoved, 9); - - // Set the sample in the middle to 1.0 and the rest to 0. - // - // /\ - // / \ - // ---------------------/ \--------------------- + + /* + Set the sample in the middle to 1.0 and the rest to 0. + + /\ + / \ + ---------------------/ \--------------------- + */ motionData.AllocateFloatSamples(0, 11); for (size_t i = 0; i < motionData.GetNumFloatSamples(0); ++i) { @@ -301,12 +303,14 @@ namespace EMotionFX numRemoved = motionData.ReduceSamples(reduceSettings); EXPECT_EQ(motionData.GetNumFloatSamples(0), 5); EXPECT_EQ(numRemoved, 6); - - // Make a bump of 2 frames. - // - // /------\ - // / \ - // ---------------------/ \--------------- + + /* + Make a bump of 2 frames. + + /------\ + / \ + ---------------------/ \--------------- + */ motionData.AllocateFloatSamples(0, 11); for (size_t i = 0; i < motionData.GetNumFloatSamples(0); ++i) { @@ -398,11 +402,13 @@ namespace EMotionFX EXPECT_EQ(motionData.GetNumJointRotationSamples(0), 0); EXPECT_EQ(numRemoved, 11); - // Set the sample in the middle to 1.0 and the rest to 0. - // - // /\ - // / \ - // ---------------------/ \--------------------- + /* + Set the sample in the middle to 1.0 and the rest to 0. + + /\ + / \ + ---------------------/ \--------------------- + */ motionData.AllocateJointRotationSamples(0, 11); for (size_t i = 0; i < motionData.GetNumJointRotationSamples(0); ++i) { @@ -413,12 +419,14 @@ namespace EMotionFX numRemoved = motionData.ReduceSamples(reduceSettings); EXPECT_EQ(motionData.GetNumJointRotationSamples(0), 5); EXPECT_EQ(numRemoved, 6); - - // Make a bump of 2 frames. - // - // /------\ - // / \ - // ---------------------/ \--------------- + + /* + Make a bump of 2 frames. + + /------\ + / \ + ---------------------/ \--------------- + */ motionData.AllocateJointRotationSamples(0, 11); for (size_t i = 0; i < motionData.GetNumJointRotationSamples(0); ++i) { @@ -509,11 +517,13 @@ namespace EMotionFX EXPECT_EQ(motionData.GetNumJointPositionSamples(0), 0); EXPECT_EQ(numRemoved, 11); - // Set the sample in the middle to 1.0 and the rest to 0. - // - // /\ - // / \ - // ---------------------/ \--------------------- + /* + Set the sample in the middle to 1.0 and the rest to 0. + + /\ + / \ + ---------------------/ \--------------------- + */ motionData.AllocateJointPositionSamples(0, 11); for (size_t i = 0; i < motionData.GetNumJointPositionSamples(0); ++i) { @@ -525,11 +535,13 @@ namespace EMotionFX EXPECT_EQ(motionData.GetNumJointPositionSamples(0), 5); EXPECT_EQ(numRemoved, 6); - // Make a bump of 2 frames. - // - // /------\ - // / \ - // ---------------------/ \--------------- + /* + Make a bump of 2 frames. + + /------\ + / \ + ---------------------/ \--------------- + */ motionData.AllocateJointPositionSamples(0, 11); for (size_t i = 0; i < motionData.GetNumJointPositionSamples(0); ++i) { diff --git a/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp index 68198c491a..6dc6bf3f18 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp @@ -328,18 +328,19 @@ namespace LmbrCentral sides, capSegments, vertices); } } - - /// Generates vertices and indices for a tube shape - /// Split into two stages: - /// - Generate vertex positions - /// - Generate indices (faces) - /// Heres a rough diagram of how it is built: - /// ____________ - /// /_|__|__|__|_\ - /// \_|__|__|__|_/ - /// - A single vertex at each end of the tube - /// - Angled end cap segments - /// - Middle segments + /* + Generates vertices and indices for a tube shape + Split into two stages: + - Generate vertex positions + - Generate indices (faces) + Heres a rough diagram of how it is built: + ____________ + /_|__|__|__|_\ + \_|__|__|__|_/ + - A single vertex at each end of the tube + - Angled end cap segments + - Middle segments + */ void GenerateSolidTubeMesh( const AZ::SplinePtr& spline, const SplineAttribute& variableRadius, const float radius, const AZ::u32 capSegments, const AZ::u32 sides, diff --git a/cmake/Platform/Common/GCC/Configurations_gcc.cmake b/cmake/Platform/Common/GCC/Configurations_gcc.cmake index 9963c62d39..12dd4d7bdd 100644 --- a/cmake/Platform/Common/GCC/Configurations_gcc.cmake +++ b/cmake/Platform/Common/GCC/Configurations_gcc.cmake @@ -34,7 +34,6 @@ ly_append_configurations_options( -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden - -Wall -Werror @@ -45,7 +44,6 @@ ly_append_configurations_options( -Wno-array-bounds -Wno-attributes -Wno-class-memaccess - -Wno-comment -Wno-delete-non-virtual-dtor -Wno-enum-compare -Wno-format-overflow From 30de4e92e03f04f1b1229af2eaf52e4d4c8e8c04 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Tue, 1 Feb 2022 18:05:58 +0100 Subject: [PATCH 378/394] Motion Matching: Added example level and assets for an automatic demo #7317 * Added camera controller script canvas graph that follows the character and rotates slowly around it. * Added simple motion matching anim graph using the automatic target mode that doesn't need user input and just makes the character run around in the level. * Added example level. Note: As O3DE can't locate level files from within the gems asset folder, the level file needs to manually be copy & pasted to the ${YourProject}\Levels\ folder. Signed-off-by: Benjamin Jillich jillich@amazon.com --- ...ameraController_AutomaticDemo.scriptcanvas | 4255 +++++++++++ ...acterController_AutomaticDemo.scriptcanvas | 6387 +++++++++++++++++ .../MotionMatching_AutomaticDemo.animgraph | 3 + .../MotionMatching_AutomaticDemo.ly | 3 + .../Assets/MotionMatching.animgraph | 4 +- .../Assets/MotionMatching.motionset | 4 +- Gems/MotionMatching/preview.png | 4 +- 7 files changed, 10654 insertions(+), 6 deletions(-) create mode 100644 Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas create mode 100644 Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CharacterController_AutomaticDemo.scriptcanvas create mode 100644 Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.animgraph create mode 100644 Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.ly diff --git a/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas new file mode 100644 index 0000000000..8569d7686b --- /dev/null +++ b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CameraController_AutomaticDemo.scriptcanvas @@ -0,0 +1,4255 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 1874297699023155003 + }, + "Name": "CameraController", + "Components": { + "Component_[18372998151874304809]": { + "$type": "EditorGraph", + "Id": 18372998151874304809, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 58688970296996 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Transform(double )}* RotationXDegreesTraits >)", + "Components": { + "Component_[11367256627712525407]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Transform(double )}* RotationXDegreesTraits >", + "Id": 11367256627712525407, + "Slots": [ + { + "id": { + "m_id": "{DC131C25-5C2C-482D-96A1-88542026DF75}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A4D7609D-9560-43D5-9FDE-36242CE35B48}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{22458849-F990-4D8A-94B2-03D8F3878E19}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: Degrees", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{24EDA641-DBF3-41A8-8D47-60A3D83E3F23}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Transform", + "DisplayDataType": { + "m_type": 7 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": -15.0, + "label": "Number: Degrees" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 58624545787556 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[11451129070958096728]": { + "$type": "OperatorMul", + "Id": 11451129070958096728, + "Slots": [ + { + "id": { + "m_id": "{3180019C-C78A-456E-B3E2-F1601B4A629A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A4F4074B-5E3B-4A5B-A7F7-AC2E4AAA0939}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B2F820AB-9377-4A47-AD2C-03D76C6E4024}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Transform", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5509933D-93A5-483E-B7B5-FDD637C997DA}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Transform", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{96271AD4-A2BB-4597-B78F-8053F0200C3D}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" + }, + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" + } + ] + } + } + }, + { + "Id": { + "id": 58667495460516 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[12391893846605096594]": { + "$type": "EBusEventHandler", + "Id": 12391893846605096594, + "Slots": [ + { + "id": { + "m_id": "{47B8793A-68B3-4DF7-B485-98CF8625EE94}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{75D0B671-F876-4383-B3AE-414B37AD0638}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{03259091-B08D-4118-9AA3-053FD63AD6F7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7C2E17C2-C3A1-4CB1-9AE6-521C4DD0D780}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9EB40EA9-0799-4FFF-9816-D6BEE9302D56}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1D2C5717-17A6-401F-BBF6-08EF84870CD3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ScriptTimePoint", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{4C0F6AD4-0D4F-4354-AD4A-0C01E948245C}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnTick", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{53E6F39B-30C2-4828-83A4-A286E22DD18D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{909B60CC-693B-4DC9-9BC2-65B1D9373B5A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:GetTickOrder", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Result: Number" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1502188240 + }, + "Value": { + "m_eventName": "OnTick", + "m_eventId": { + "Value": 1502188240 + }, + "m_eventSlotId": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + }, + { + "m_id": "{1D2C5717-17A6-401F-BBF6-08EF84870CD3}" + } + ], + "m_numExpectedArguments": 2 + } + }, + { + "Key": { + "Value": 1890826333 + }, + "Value": { + "m_eventName": "GetTickOrder", + "m_eventId": { + "Value": 1890826333 + }, + "m_eventSlotId": { + "m_id": "{909B60CC-693B-4DC9-9BC2-65B1D9373B5A}" + }, + "m_resultSlotId": { + "m_id": "{53E6F39B-30C2-4828-83A4-A286E22DD18D}" + } + } + } + ], + "m_ebusName": "TickBus", + "m_busId": { + "Value": 1209186864 + } + } + } + }, + { + "Id": { + "id": 58633135722148 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[13427352953117170385]": { + "$type": "OperatorMul", + "Id": 13427352953117170385, + "Slots": [ + { + "id": { + "m_id": "{B6D38C30-7BB4-4549-AFFA-C5A52AE9796E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{86D20026-0D06-4DFB-B3CD-9BE5038B8121}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F9E6233F-EAFB-43F5-A10D-96A3A41763A7}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{9D3D613C-ABE4-4028-A1CC-22E6E036376C}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C0EA31C9-71C6-4CCF-A31B-33E7385C78D0}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": -90.0, + "label": "Number" + } + ] + } + } + }, + { + "Id": { + "id": 214400860662419 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[1359072869693534631]": { + "$type": "GetVariableNode", + "Id": 1359072869693534631, + "Slots": [ + { + "id": { + "m_id": "{7500DE86-7349-4213-B3D6-F2872EDF15A6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8C8D3DD7-F821-42F4-AF51-5D976133DAE4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" + }, + "m_variableDataOutSlotId": { + "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" + } + } + } + }, + { + "Id": { + "id": 58577301147300 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[14055904483179664364]": { + "$type": "OperatorMul", + "Id": 14055904483179664364, + "Slots": [ + { + "id": { + "m_id": "{F5BE2CBC-3CA3-44BD-B7D4-71D9CAC023B3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4CD5D25E-73DA-4936-89E9-8F0A7946DED1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2F0B4FC7-0B48-42A9-8073-8493E9F1D2E5}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{67B729E8-73F9-4B97-A67C-C986E874BD01}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{785A9BC8-8F65-4DFE-8809-7C8E937A8D8B}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + } + ] + } + } + }, + { + "Id": { + "id": 58581596114596 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[14210959117790557692]": { + "$type": "OperatorMul", + "Id": 14210959117790557692, + "Slots": [ + { + "id": { + "m_id": "{374AA17F-7CC0-4808-8269-6CC4F64579C3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1E111259-19D2-4180-81A1-F648F79B004D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E7D6A002-7522-4915-BCCB-89A29E3D5582}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Transform", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{0ABC384E-FBE6-40F8-B5C3-7652B814102C}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Transform", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7DA1EC3E-277C-4DDA-94FD-EF2EC66CD272}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" + }, + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" + } + ] + } + } + }, + { + "Id": { + "id": 213241219492499 + }, + "Name": "SC-Node(OperatorAdd)", + "Components": { + "Component_[14948826965328970882]": { + "$type": "OperatorAdd", + "Id": 14948826965328970882, + "Slots": [ + { + "id": { + "m_id": "{56805D2B-0C98-4145-80FB-AA1DCB16CF1A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{008FCEC7-3E86-4249-A736-F158EFDB0EFA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DB849F77-66D0-4D64-A45F-122F93E1E80C}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{CA8ABF3F-BF80-4A8B-A2B2-A1D2C16278C1}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{53895246-F759-4328-AABB-D26E49E5208D}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ] + } + } + }, + { + "Id": { + "id": 58628840754852 + }, + "Name": "SC-Node(SetWorldTM)", + "Components": { + "Component_[15733030521963116718]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 15733030521963116718, + "Slots": [ + { + "id": { + "m_id": "{785CBBEE-E704-4049-A180-8E99E3E1E1F2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A7826FF9-C3B2-4E28-815D-9B07A6EE0949}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Transform: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6BB59597-64B4-458F-9C96-B3E0DA73279A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{44A7845D-724A-4BB6-99F1-12B2E7979D93}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Transform" + }, + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform: 1" + } + ], + "methodType": 0, + "methodName": "SetWorldTM", + "className": "TransformBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{785CBBEE-E704-4049-A180-8E99E3E1E1F2}" + }, + { + "m_id": "{A7826FF9-C3B2-4E28-815D-9B07A6EE0949}" + } + ], + "prettyClassName": "TransformBus" + } + } + }, + { + "Id": { + "id": 239870016727699 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[3092852928531574536]": { + "$type": "OperatorMul", + "Id": 3092852928531574536, + "Slots": [ + { + "id": { + "m_id": "{FEFF67A1-C89B-447E-80D4-CD94CB0C8AD7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7E5D8673-F03A-4134-87DE-88AD13A74C29}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8A243C9C-0D69-4753-B28B-A8D2FAC5D508}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3F3F3DD6-124E-48A8-8373-6666900D8177}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DFD1DE7E-B470-43F6-A6CF-E9E572D0C075}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 10.0, + "label": "Number" + } + ] + } + } + }, + { + "Id": { + "id": 58654610558628 + }, + "Name": "SC Node(SetVariable)", + "Components": { + "Component_[5081311661452231726]": { + "$type": "SetVariableNode", + "Id": 5081311661452231726, + "Slots": [ + { + "id": { + "m_id": "{F32F9B01-14B4-4DC3-AE0E-9E233DE5E941}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the variable referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{47175A2C-5EE4-4C48-8CC1-8F2C84D36FE5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced variable has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B22A0453-9715-46C7-A766-9536020AB59F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1B58C71B-3AB9-4D90-A8D5-164A20B083DA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ], + "m_variableId": { + "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" + }, + "m_variableDataInSlotId": { + "m_id": "{B22A0453-9715-46C7-A766-9536020AB59F}" + }, + "m_variableDataOutSlotId": { + "m_id": "{1B58C71B-3AB9-4D90-A8D5-164A20B083DA}" + } + } + } + }, + { + "Id": { + "id": 58671790427812 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Transform(Vector3 )}* FromTranslationTraits >)", + "Components": { + "Component_[5185507574364590308]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Transform(Vector3 )}* FromTranslationTraits >", + "Id": 5185507574364590308, + "Slots": [ + { + "id": { + "m_id": "{991F134E-88CC-423B-93C9-FFE9A9406739}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FACA9011-E0FC-413E-B8AE-136D7DD2BD14}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{210001FC-BDC8-4E41-9990-6F42A0368833}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector3: Translation", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{49236CAF-226C-4F65-9C1D-92436010232D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Transform", + "DisplayDataType": { + "m_type": 7 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + -0.6499999761581421, + -4.699999809265137, + 0.699999988079071 + ], + "label": "Vector3: Translation" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 58590186049188 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Transform(double )}* RotationZDegreesTraits >)", + "Components": { + "Component_[5714854897173958925]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Transform(double )}* RotationZDegreesTraits >", + "Id": 5714854897173958925, + "Slots": [ + { + "id": { + "m_id": "{4B28D8A2-7F6C-4EB1-A7D5-EA68FB783B52}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A6D81A02-E3CB-44FC-80E6-61D8AB732ACC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{694A218A-8047-4981-BF62-726AF9BCB3C6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: Degrees", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{065D3BDE-D0B8-4F84-82EB-8B48779A80CA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Transform", + "DisplayDataType": { + "m_type": 7 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number: Degrees" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 58607365918372 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Transform(Vector3 )}* FromTranslationTraits >)", + "Components": { + "Component_[6151602155863937217]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Transform(Vector3 )}* FromTranslationTraits >", + "Id": 6151602155863937217, + "Slots": [ + { + "id": { + "m_id": "{AC5F0607-97E7-4EF4-A4A1-7CE21E42A484}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5F03F883-BFAC-424C-BB04-334B68B845FC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E00A1E12-1D89-42EC-939B-284B1D6B4EAE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector3: Translation", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F84430FF-A436-459B-B849-6456573B85E7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Transform", + "DisplayDataType": { + "m_type": 7 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Vector3: Translation" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 58663200493220 + }, + "Name": "SC-Node(GetWorldTranslation)", + "Components": { + "Component_[7931832476506096485]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 7931832476506096485, + "Slots": [ + { + "id": { + "m_id": "{D2B68C1A-14D8-45DE-8AED-DDB02B925B24}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{94D7F295-34CD-42AC-AD7B-65B8407F2CF4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0A0BFDE6-2029-414E-8A8F-41DF60F9C348}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2FAA43A0-BC0B-428B-B0BF-AFDDFDEA474C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Vector3", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 653853330958 + }, + "label": "EntityID: 0" + } + ], + "methodType": 0, + "methodName": "GetWorldTranslation", + "className": "TransformBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{D2B68C1A-14D8-45DE-8AED-DDB02B925B24}" + } + ], + "prettyClassName": "TransformBus" + } + } + }, + { + "Id": { + "id": 58594481016484 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[8136131668650391163]": { + "$type": "GetVariableNode", + "Id": 8136131668650391163, + "Slots": [ + { + "id": { + "m_id": "{09256706-E7A2-47C3-ACE0-3BE7D80E34FD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1ACC7F53-E81A-4721-9AC8-5C1A33C8BE96}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4972DD3B-D554-47B7-816B-CBCF67697ABA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" + }, + "m_variableDataOutSlotId": { + "m_id": "{4972DD3B-D554-47B7-816B-CBCF67697ABA}" + } + } + } + }, + { + "Id": { + "id": 58658905525924 + }, + "Name": "SC-Node(OperatorMul)", + "Components": { + "Component_[8240456843039210842]": { + "$type": "OperatorMul", + "Id": 8240456843039210842, + "Slots": [ + { + "id": { + "m_id": "{472B1FB5-766E-4F47-9955-B655857BE135}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1ACBC12A-7FB1-4ADF-92BC-56B0DCE8CFAD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{73F9A12E-8255-4C5E-89A8-B2F837C29AF6}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Transform", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{89EA50A0-3CD4-46D6-8404-534EDB8C94EE}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Transform", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A56467EC-4D3B-4CBE-847D-E5367BEFF26C}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "OperatorType": "Multiply", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 7 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 7 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" + }, + { + "scriptCanvasType": { + "m_type": 7 + }, + "isNullPointer": false, + "$type": "Transform", + "value": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "Scale": 1.0 + }, + "label": "Transform" + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 58706150166180 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(RotationZDegrees: In)", + "Components": { + "Component_[553961487450147653]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 553961487450147653, + "sourceEndpoint": { + "nodeId": { + "id": 58594481016484 + }, + "slotId": { + "m_id": "{1ACC7F53-E81A-4721-9AC8-5C1A33C8BE96}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58590186049188 + }, + "slotId": { + "m_id": "{4B28D8A2-7F6C-4EB1-A7D5-EA68FB783B52}" + } + } + } + } + }, + { + "Id": { + "id": 58710445133476 + }, + "Name": "srcEndpoint=(Get Variable: Number), destEndpoint=(RotationZDegrees: Number: Degrees)", + "Components": { + "Component_[8946072267986857913]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8946072267986857913, + "sourceEndpoint": { + "nodeId": { + "id": 58594481016484 + }, + "slotId": { + "m_id": "{4972DD3B-D554-47B7-816B-CBCF67697ABA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58590186049188 + }, + "slotId": { + "m_id": "{694A218A-8047-4981-BF62-726AF9BCB3C6}" + } + } + } + } + }, + { + "Id": { + "id": 58714740100772 + }, + "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(SetWorldTM: In)", + "Components": { + "Component_[3188243497734984899]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3188243497734984899, + "sourceEndpoint": { + "nodeId": { + "id": 58581596114596 + }, + "slotId": { + "m_id": "{1E111259-19D2-4180-81A1-F648F79B004D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58628840754852 + }, + "slotId": { + "m_id": "{6BB59597-64B4-458F-9C96-B3E0DA73279A}" + } + } + } + } + }, + { + "Id": { + "id": 58719035068068 + }, + "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(SetWorldTM: Transform: 1)", + "Components": { + "Component_[16154630012362343924]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16154630012362343924, + "sourceEndpoint": { + "nodeId": { + "id": 58581596114596 + }, + "slotId": { + "m_id": "{7DA1EC3E-277C-4DDA-94FD-EF2EC66CD272}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58628840754852 + }, + "slotId": { + "m_id": "{A7826FF9-C3B2-4E28-815D-9B07A6EE0949}" + } + } + } + } + }, + { + "Id": { + "id": 58723330035364 + }, + "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(FromTranslation: Vector3: Translation)", + "Components": { + "Component_[12394822413729075366]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12394822413729075366, + "sourceEndpoint": { + "nodeId": { + "id": 58663200493220 + }, + "slotId": { + "m_id": "{2FAA43A0-BC0B-428B-B0BF-AFDDFDEA474C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58607365918372 + }, + "slotId": { + "m_id": "{E00A1E12-1D89-42EC-939B-284B1D6B4EAE}" + } + } + } + } + }, + { + "Id": { + "id": 58727625002660 + }, + "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(FromTranslation: In)", + "Components": { + "Component_[4243880791484280857]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4243880791484280857, + "sourceEndpoint": { + "nodeId": { + "id": 58663200493220 + }, + "slotId": { + "m_id": "{0A0BFDE6-2029-414E-8A8F-41DF60F9C348}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58607365918372 + }, + "slotId": { + "m_id": "{AC5F0607-97E7-4EF4-A4A1-7CE21E42A484}" + } + } + } + } + }, + { + "Id": { + "id": 58731919969956 + }, + "Name": "srcEndpoint=(FromTranslation: Out), destEndpoint=(GetWorldTranslation: In)", + "Components": { + "Component_[1519056228570549771]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1519056228570549771, + "sourceEndpoint": { + "nodeId": { + "id": 58671790427812 + }, + "slotId": { + "m_id": "{FACA9011-E0FC-413E-B8AE-136D7DD2BD14}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58663200493220 + }, + "slotId": { + "m_id": "{94D7F295-34CD-42AC-AD7B-65B8407F2CF4}" + } + } + } + } + }, + { + "Id": { + "id": 58736214937252 + }, + "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(Multiply (*): In)", + "Components": { + "Component_[6232453632040220382]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6232453632040220382, + "sourceEndpoint": { + "nodeId": { + "id": 58624545787556 + }, + "slotId": { + "m_id": "{A4F4074B-5E3B-4A5B-A7F7-AC2E4AAA0939}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58581596114596 + }, + "slotId": { + "m_id": "{374AA17F-7CC0-4808-8269-6CC4F64579C3}" + } + } + } + } + }, + { + "Id": { + "id": 58740509904548 + }, + "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Multiply (*): Transform)", + "Components": { + "Component_[7007808555566524915]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7007808555566524915, + "sourceEndpoint": { + "nodeId": { + "id": 58624545787556 + }, + "slotId": { + "m_id": "{96271AD4-A2BB-4597-B78F-8053F0200C3D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58581596114596 + }, + "slotId": { + "m_id": "{E7D6A002-7522-4915-BCCB-89A29E3D5582}" + } + } + } + } + }, + { + "Id": { + "id": 58753394806436 + }, + "Name": "srcEndpoint=(TickBus Handler: Number), destEndpoint=(Multiply (*): Value)", + "Components": { + "Component_[1087668963814879388]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1087668963814879388, + "sourceEndpoint": { + "nodeId": { + "id": 58667495460516 + }, + "slotId": { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58577301147300 + }, + "slotId": { + "m_id": "{67B729E8-73F9-4B97-A67C-C986E874BD01}" + } + } + } + } + }, + { + "Id": { + "id": 58783459577508 + }, + "Name": "srcEndpoint=(Set Variable: Out), destEndpoint=(Get Variable: In)", + "Components": { + "Component_[5808096905671825435]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5808096905671825435, + "sourceEndpoint": { + "nodeId": { + "id": 58654610558628 + }, + "slotId": { + "m_id": "{47175A2C-5EE4-4C48-8CC1-8F2C84D36FE5}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58594481016484 + }, + "slotId": { + "m_id": "{09256706-E7A2-47C3-ACE0-3BE7D80E34FD}" + } + } + } + } + }, + { + "Id": { + "id": 58787754544804 + }, + "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Multiply (*): Value)", + "Components": { + "Component_[11775794502882233004]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11775794502882233004, + "sourceEndpoint": { + "nodeId": { + "id": 58577301147300 + }, + "slotId": { + "m_id": "{785A9BC8-8F65-4DFE-8809-7C8E937A8D8B}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58633135722148 + }, + "slotId": { + "m_id": "{F9E6233F-EAFB-43F5-A10D-96A3A41763A7}" + } + } + } + } + }, + { + "Id": { + "id": 58792049512100 + }, + "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(Multiply (*): In)", + "Components": { + "Component_[80299809090156725]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 80299809090156725, + "sourceEndpoint": { + "nodeId": { + "id": 58577301147300 + }, + "slotId": { + "m_id": "{4CD5D25E-73DA-4936-89E9-8F0A7946DED1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58633135722148 + }, + "slotId": { + "m_id": "{B6D38C30-7BB4-4549-AFFA-C5A52AE9796E}" + } + } + } + } + }, + { + "Id": { + "id": 58800639446692 + }, + "Name": "srcEndpoint=(FromTranslation: Result: Transform), destEndpoint=(Multiply (*): Transform)", + "Components": { + "Component_[7632901123910891973]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7632901123910891973, + "sourceEndpoint": { + "nodeId": { + "id": 58671790427812 + }, + "slotId": { + "m_id": "{49236CAF-226C-4F65-9C1D-92436010232D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58581596114596 + }, + "slotId": { + "m_id": "{0ABC384E-FBE6-40F8-B5C3-7652B814102C}" + } + } + } + } + }, + { + "Id": { + "id": 58804934413988 + }, + "Name": "srcEndpoint=(RotationZDegrees: Out), destEndpoint=(RotationXDegrees: In)", + "Components": { + "Component_[10139510177917176292]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10139510177917176292, + "sourceEndpoint": { + "nodeId": { + "id": 58590186049188 + }, + "slotId": { + "m_id": "{A6D81A02-E3CB-44FC-80E6-61D8AB732ACC}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58688970296996 + }, + "slotId": { + "m_id": "{DC131C25-5C2C-482D-96A1-88542026DF75}" + } + } + } + } + }, + { + "Id": { + "id": 58809229381284 + }, + "Name": "srcEndpoint=(RotationXDegrees: Out), destEndpoint=(FromTranslation: In)", + "Components": { + "Component_[14430114494626818296]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14430114494626818296, + "sourceEndpoint": { + "nodeId": { + "id": 58688970296996 + }, + "slotId": { + "m_id": "{A4D7609D-9560-43D5-9FDE-36242CE35B48}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58671790427812 + }, + "slotId": { + "m_id": "{991F134E-88CC-423B-93C9-FFE9A9406739}" + } + } + } + } + }, + { + "Id": { + "id": 58813524348580 + }, + "Name": "srcEndpoint=(FromTranslation: Result: Transform), destEndpoint=(Multiply (*): Value)", + "Components": { + "Component_[4673903760365810060]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4673903760365810060, + "sourceEndpoint": { + "nodeId": { + "id": 58607365918372 + }, + "slotId": { + "m_id": "{F84430FF-A436-459B-B849-6456573B85E7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58658905525924 + }, + "slotId": { + "m_id": "{73F9A12E-8255-4C5E-89A8-B2F837C29AF6}" + } + } + } + } + }, + { + "Id": { + "id": 58817819315876 + }, + "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Multiply (*): Transform)", + "Components": { + "Component_[8661784838702007417]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8661784838702007417, + "sourceEndpoint": { + "nodeId": { + "id": 58658905525924 + }, + "slotId": { + "m_id": "{A56467EC-4D3B-4CBE-847D-E5367BEFF26C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58624545787556 + }, + "slotId": { + "m_id": "{B2F820AB-9377-4A47-AD2C-03D76C6E4024}" + } + } + } + } + }, + { + "Id": { + "id": 58822114283172 + }, + "Name": "srcEndpoint=(FromTranslation: Out), destEndpoint=(Multiply (*): In)", + "Components": { + "Component_[268387562422533755]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 268387562422533755, + "sourceEndpoint": { + "nodeId": { + "id": 58607365918372 + }, + "slotId": { + "m_id": "{5F03F883-BFAC-424C-BB04-334B68B845FC}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58658905525924 + }, + "slotId": { + "m_id": "{472B1FB5-766E-4F47-9955-B655857BE135}" + } + } + } + } + }, + { + "Id": { + "id": 58826409250468 + }, + "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(Multiply (*): In)", + "Components": { + "Component_[3775912189287118250]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3775912189287118250, + "sourceEndpoint": { + "nodeId": { + "id": 58658905525924 + }, + "slotId": { + "m_id": "{1ACBC12A-7FB1-4ADF-92BC-56B0DCE8CFAD}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58624545787556 + }, + "slotId": { + "m_id": "{3180019C-C78A-456E-B3E2-F1601B4A629A}" + } + } + } + } + }, + { + "Id": { + "id": 58830704217764 + }, + "Name": "srcEndpoint=(RotationZDegrees: Result: Transform), destEndpoint=(Multiply (*): Transform)", + "Components": { + "Component_[2967942488527008121]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2967942488527008121, + "sourceEndpoint": { + "nodeId": { + "id": 58590186049188 + }, + "slotId": { + "m_id": "{065D3BDE-D0B8-4F84-82EB-8B48779A80CA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58658905525924 + }, + "slotId": { + "m_id": "{89EA50A0-3CD4-46D6-8404-534EDB8C94EE}" + } + } + } + } + }, + { + "Id": { + "id": 58834999185060 + }, + "Name": "srcEndpoint=(RotationXDegrees: Result: Transform), destEndpoint=(Multiply (*): Transform)", + "Components": { + "Component_[191558726927551301]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 191558726927551301, + "sourceEndpoint": { + "nodeId": { + "id": 58688970296996 + }, + "slotId": { + "m_id": "{24EDA641-DBF3-41A8-8D47-60A3D83E3F23}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58624545787556 + }, + "slotId": { + "m_id": "{5509933D-93A5-483E-B7B5-FDD637C997DA}" + } + } + } + } + }, + { + "Id": { + "id": 164626484669075 + }, + "Name": "srcEndpoint=(: ), destEndpoint=(: )", + "Components": { + "Component_[14524450253664706586]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14524450253664706586, + "sourceEndpoint": { + "nodeId": { + "id": 58667495460516 + }, + "slotId": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58577301147300 + }, + "slotId": { + "m_id": "{F5BE2CBC-3CA3-44BD-B7D4-71D9CAC023B3}" + } + } + } + } + }, + { + "Id": { + "id": 214778817784467 + }, + "Name": "srcEndpoint=(TickBus Handler: ExecutionSlot:OnTick), destEndpoint=(Get Variable: In)", + "Components": { + "Component_[7779223725351419178]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7779223725351419178, + "sourceEndpoint": { + "nodeId": { + "id": 58667495460516 + }, + "slotId": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 214400860662419 + }, + "slotId": { + "m_id": "{7500DE86-7349-4213-B3D6-F2872EDF15A6}" + } + } + } + } + }, + { + "Id": { + "id": 216011473398419 + }, + "Name": "srcEndpoint=(Get Variable: Number), destEndpoint=(Add (+): Value)", + "Components": { + "Component_[16293929363603149316]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16293929363603149316, + "sourceEndpoint": { + "nodeId": { + "id": 214400860662419 + }, + "slotId": { + "m_id": "{5E4734A2-3CAF-4E29-AC72-5689FF1FD619}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 213241219492499 + }, + "slotId": { + "m_id": "{DB849F77-66D0-4D64-A45F-122F93E1E80C}" + } + } + } + } + }, + { + "Id": { + "id": 217330028358291 + }, + "Name": "srcEndpoint=(Add (+): Out), destEndpoint=(Set Variable: In)", + "Components": { + "Component_[13732207464069515508]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13732207464069515508, + "sourceEndpoint": { + "nodeId": { + "id": 213241219492499 + }, + "slotId": { + "m_id": "{008FCEC7-3E86-4249-A736-F158EFDB0EFA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58654610558628 + }, + "slotId": { + "m_id": "{F32F9B01-14B4-4DC3-AE0E-9E233DE5E941}" + } + } + } + } + }, + { + "Id": { + "id": 217626381101715 + }, + "Name": "srcEndpoint=(Add (+): Result), destEndpoint=(Set Variable: Number)", + "Components": { + "Component_[7103679238250108573]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7103679238250108573, + "sourceEndpoint": { + "nodeId": { + "id": 213241219492499 + }, + "slotId": { + "m_id": "{53895246-F759-4328-AABB-D26E49E5208D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 58654610558628 + }, + "slotId": { + "m_id": "{B22A0453-9715-46C7-A766-9536020AB59F}" + } + } + } + } + }, + { + "Id": { + "id": 240698945415827 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(Multiply (*): In)", + "Components": { + "Component_[12012899230680400379]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12012899230680400379, + "sourceEndpoint": { + "nodeId": { + "id": 214400860662419 + }, + "slotId": { + "m_id": "{8C8D3DD7-F821-42F4-AF51-5D976133DAE4}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 239870016727699 + }, + "slotId": { + "m_id": "{FEFF67A1-C89B-447E-80D4-CD94CB0C8AD7}" + } + } + } + } + }, + { + "Id": { + "id": 241158506916499 + }, + "Name": "srcEndpoint=(TickBus Handler: Number), destEndpoint=(Multiply (*): Value)", + "Components": { + "Component_[6729356013537587652]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6729356013537587652, + "sourceEndpoint": { + "nodeId": { + "id": 58667495460516 + }, + "slotId": { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 239870016727699 + }, + "slotId": { + "m_id": "{8A243C9C-0D69-4753-B28B-A8D2FAC5D508}" + } + } + } + } + }, + { + "Id": { + "id": 241845701683859 + }, + "Name": "srcEndpoint=(Multiply (*): Out), destEndpoint=(Add (+): In)", + "Components": { + "Component_[1977054835666987502]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1977054835666987502, + "sourceEndpoint": { + "nodeId": { + "id": 239870016727699 + }, + "slotId": { + "m_id": "{7E5D8673-F03A-4134-87DE-88AD13A74C29}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 213241219492499 + }, + "slotId": { + "m_id": "{56805D2B-0C98-4145-80FB-AA1DCB16CF1A}" + } + } + } + } + }, + { + "Id": { + "id": 242150644361875 + }, + "Name": "srcEndpoint=(Multiply (*): Result), destEndpoint=(Add (+): Number)", + "Components": { + "Component_[4687422202712804034]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4687422202712804034, + "sourceEndpoint": { + "nodeId": { + "id": 239870016727699 + }, + "slotId": { + "m_id": "{DFD1DE7E-B470-43F6-A6CF-E9E572D0C075}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 213241219492499 + }, + "slotId": { + "m_id": "{CA8ABF3F-BF80-4A8B-A2B2-A1D2C16278C1}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 3, + "GraphCanvasData": [ + { + "Key": { + "id": 58577301147300 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -40.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{EB1D5C50-BE43-4D5B-95CA-72BB2444355C}" + } + } + } + }, + { + "Key": { + "id": 58581596114596 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 3540.0, + 580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A3A4908C-0B83-483F-831F-248D6AB79C29}" + } + } + } + }, + { + "Key": { + "id": 58590186049188 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2120.0, + 160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FED059CE-0252-49B1-8138-209A60BA8DA5}" + } + } + } + }, + { + "Key": { + "id": 58594481016484 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1820.0, + 160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".getVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{4F7B87C1-4C5D-4B00-87F1-E742C7F9B0BB}" + } + } + } + }, + { + "Key": { + "id": 58607365918372 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2120.0, + 660.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D8112E71-9789-4C0C-8366-B4F92D91986F}" + } + } + } + }, + { + "Key": { + "id": 58624545787556 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 3180.0, + 360.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{297AAB81-3421-4A7B-8699-ECA4FF4DB2F3}" + } + } + } + }, + { + "Key": { + "id": 58628840754852 + }, + "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": [ + 3860.0, + 580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{71F019FA-B307-4644-BB23-7869C6FEC456}" + } + } + } + }, + { + "Key": { + "id": 58633135722148 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 300.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{3B2FC30A-C96E-4D45-8FB8-D93213E40656}" + } + } + } + }, + { + "Key": { + "id": 58654610558628 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "SetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1300.0, + 480.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".setVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{6FF025AC-1B80-46F9-8827-C1C42EC3C298}" + } + } + } + }, + { + "Key": { + "id": 58658905525924 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2800.0, + 140.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{145EFCDE-FC2F-4B18-AF2D-B6952DC734BA}" + } + } + } + }, + { + "Key": { + "id": 58663200493220 + }, + "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": [ + 1680.0, + 660.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B9601350-A96F-498A-AF35-F2D8374142F8}" + } + } + } + }, + { + "Key": { + "id": 58667495460516 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -480.0, + 500.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1502188240 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A4513B84-5371-4B5E-8D78-6D5B2A9856D0}" + } + } + } + }, + { + "Key": { + "id": 58671790427812 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1980.0, + 500.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{9414796E-C664-46D2-99AD-506FBDFA6D56}" + } + } + } + }, + { + "Key": { + "id": 58688970296996 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2120.0, + 320.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{484503BE-9628-4885-A608-445A99D2768D}" + } + } + } + }, + { + "Key": { + "id": 213241219492499 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 940.0, + 520.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D8706C3B-F5F1-42A9-8717-81AA7769955D}" + } + } + } + }, + { + "Key": { + "id": 214400860662419 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 100.0, + 540.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".getVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{1D7795F6-7D30-4BD9-80E1-7E2525FA859A}" + } + } + } + }, + { + "Key": { + "id": 239870016727699 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 480.0, + 700.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{591ECD3E-51E5-4452-B8F0-91EEC22334EC}" + } + } + } + }, + { + "Key": { + "id": 1874297699023155003 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.6141249999999999, + "AnchorX": -615.5098876953125, + "AnchorY": -29.309993743896484 + } + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 1244476766431948410, + "Value": 1 + }, + { + "Key": 5842117451819972883, + "Value": 1 + }, + { + "Key": 11545666372999204726, + "Value": 2 + }, + { + "Key": 12702286953450386850, + "Value": 6 + }, + { + "Key": 12777283451032324504, + "Value": 2 + }, + { + "Key": 13282221058690490956, + "Value": 1 + }, + { + "Key": 13774516556399355685, + "Value": 1 + }, + { + "Key": 13774516556865812506, + "Value": 1 + }, + { + "Key": 16634824409549490771, + "Value": 1 + }, + { + "Key": 17750282321150628137, + "Value": 1 + } + ] + } + }, + "Component_[5106629331029292502]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 5106629331029292502, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{0620A309-A152-4CF3-BF76-284115B30780}" + }, + "VariableName": "RotateCamZ" + } + }, + { + "Key": { + "m_id": "{6A2D4F20-5402-4283-8799-EB8DEABD6369}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.1 + }, + "VariableId": { + "m_id": "{6A2D4F20-5402-4283-8799-EB8DEABD6369}" + }, + "VariableName": "JoystickDeadzone" + } + }, + { + "Key": { + "m_id": "{7062B1EE-2A8A-4E1D-8275-9DA1C5927FF0}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{7062B1EE-2A8A-4E1D-8275-9DA1C5927FF0}" + }, + "VariableName": "JoystickRight_X" + } + }, + { + "Key": { + "m_id": "{8E040B94-3374-4228-8020-577BB7C70EE7}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{8E040B94-3374-4228-8020-577BB7C70EE7}" + }, + "VariableName": "MoveX" + } + }, + { + "Key": { + "m_id": "{BF2919BD-19B4-4738-AC3A-81857D5204E4}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{BF2919BD-19B4-4738-AC3A-81857D5204E4}" + }, + "VariableName": "MoveY" + } + } + ] + }, + "CopiedVariableRemapping": [ + { + "Key": { + "m_id": "{5EB17E58-0B4E-451D-A1CE-0E7C272CBDEC}" + }, + "Value": { + "m_id": "{BF2919BD-19B4-4738-AC3A-81857D5204E4}" + } + }, + { + "Key": { + "m_id": "{B48E5726-A7FF-42A8-84D2-CF43ABBD1EDC}" + }, + "Value": { + "m_id": "{8E040B94-3374-4228-8020-577BB7C70EE7}" + } + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CharacterController_AutomaticDemo.scriptcanvas b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CharacterController_AutomaticDemo.scriptcanvas new file mode 100644 index 0000000000..3582708516 --- /dev/null +++ b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/CharacterController_AutomaticDemo.scriptcanvas @@ -0,0 +1,6387 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 3794495145504990811 + }, + "Name": "CharacterController", + "Components": { + "Component_[9391142200043061739]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 9391142200043061739, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 246132492243092 + }, + "Name": "SC-Node(InputHandlerNodeableNode)", + "Components": { + "Component_[10263047381934993123]": { + "$type": "InputHandlerNodeableNode", + "Id": 10263047381934993123, + "Slots": [ + { + "id": { + "m_id": "{223DB32E-54FF-41B5-978E-289EA97C1A1C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect Event", + "toolTip": "Connect to input event name as defined in an input binding asset.", + "DisplayGroup": { + "Value": 2173756817 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{56FD98EC-6A1B-4738-898D-8B3B345315D5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event Name", + "toolTip": "Event name as defined in an input binding asset. Example 'Fireball'.", + "DisplayGroup": { + "Value": 2173756817 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{889B7C99-BD3C-4599-B0B4-C79A882B0395}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connect Event", + "toolTip": "Connect to input event name as defined in an input binding asset.", + "DisplayGroup": { + "Value": 2173756817 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C0E40FC8-0D14-4FFD-B8EE-6423B5059AF0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Pressed", + "toolTip": "Signaled when the input event begins.", + "DisplayGroup": { + "Value": 458537082 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C88462F2-E947-4525-9DBB-AE9B3851B2DB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "value", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 458537082 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{12DA88AD-8B23-45AF-991D-456F32377083}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Held", + "toolTip": "Signaled while the input event is active.", + "DisplayGroup": { + "Value": 308119761 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{60393886-46EF-4B82-9009-9B4D9954255B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Released", + "toolTip": "Signaled when the input event ends.", + "DisplayGroup": { + "Value": 4215628054 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "MoveX", + "label": "Event Name" + } + ], + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{223DB32E-54FF-41B5-978E-289EA97C1A1C}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{56FD98EC-6A1B-4738-898D-8B3B345315D5}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{889B7C99-BD3C-4599-B0B4-C79A882B0395}" + }, + "_name": "On Connect Event", + "_interfaceSourceId": "{1B000000-0000-0000-0000-B376C2010000}" + } + ], + "_interfaceSourceId": "{00000000-0000-0000-4082-B80FBB000000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{C0E40FC8-0D14-4FFD-B8EE-6423B5059AF0}" + }, + "_name": "Pressed", + "_outputs": [ + { + "_slotId": { + "m_id": "{C88462F2-E947-4525-9DBB-AE9B3851B2DB}" + } + } + ], + "_interfaceSourceId": "{00000000-0000-0000-4082-B80FBB000000}" + }, + { + "_slotId": { + "m_id": "{12DA88AD-8B23-45AF-991D-456F32377083}" + }, + "_name": "Held", + "_outputs": [ + { + "_slotId": { + "m_id": "{C88462F2-E947-4525-9DBB-AE9B3851B2DB}" + } + } + ], + "_interfaceSourceId": "{00000000-0000-0000-4082-B80FBB000000}" + }, + { + "_slotId": { + "m_id": "{60393886-46EF-4B82-9009-9B4D9954255B}" + }, + "_name": "Released", + "_outputs": [ + { + "_slotId": { + "m_id": "{C88462F2-E947-4525-9DBB-AE9B3851B2DB}" + } + } + ], + "_interfaceSourceId": "{1B000000-0000-0000-0000-B376C2010000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 246089542570132 + }, + "Name": "SC-Node(ConvertQuaternionToEulerDegrees)", + "Components": { + "Component_[12205034688404220919]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 12205034688404220919, + "Slots": [ + { + "id": { + "m_id": "{A96CFD2A-531E-4330-B991-F27754DB21B4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Quaternion: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{CC9077E4-E835-4CAE-90EB-2B5FF8BA8F07}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1286BE0C-88F5-4C0A-ADD6-EEE94AEA78A3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{79FE68CC-45CC-4F5D-87A7-94B9144A3598}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Euler Angle", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 6 + }, + "isNullPointer": false, + "$type": "Quaternion", + "value": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Quaternion" + } + ], + "methodType": 2, + "methodName": "ConvertQuaternionToEulerDegrees", + "className": "MathUtils", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{A96CFD2A-531E-4330-B991-F27754DB21B4}" + } + ], + "prettyClassName": "MathUtils" + } + } + }, + { + "Id": { + "id": 246136787210388 + }, + "Name": "SC-Node(ConvertQuaternionToEulerDegrees)", + "Components": { + "Component_[12205034688404220919]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 12205034688404220919, + "Slots": [ + { + "id": { + "m_id": "{A96CFD2A-531E-4330-B991-F27754DB21B4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Quaternion: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{CC9077E4-E835-4CAE-90EB-2B5FF8BA8F07}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1286BE0C-88F5-4C0A-ADD6-EEE94AEA78A3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{79FE68CC-45CC-4F5D-87A7-94B9144A3598}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Euler Angle", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 6 + }, + "isNullPointer": false, + "$type": "Quaternion", + "value": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Quaternion" + } + ], + "methodType": 2, + "methodName": "ConvertQuaternionToEulerDegrees", + "className": "MathUtils", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{A96CFD2A-531E-4330-B991-F27754DB21B4}" + } + ], + "prettyClassName": "MathUtils" + } + } + }, + { + "Id": { + "id": 246093837537428 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[12391893846605096594]": { + "$type": "EBusEventHandler", + "Id": 12391893846605096594, + "Slots": [ + { + "id": { + "m_id": "{47B8793A-68B3-4DF7-B485-98CF8625EE94}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{75D0B671-F876-4383-B3AE-414B37AD0638}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{03259091-B08D-4118-9AA3-053FD63AD6F7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7C2E17C2-C3A1-4CB1-9AE6-521C4DD0D780}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9EB40EA9-0799-4FFF-9816-D6BEE9302D56}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1D2C5717-17A6-401F-BBF6-08EF84870CD3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ScriptTimePoint", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{4C0F6AD4-0D4F-4354-AD4A-0C01E948245C}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnTick", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{53E6F39B-30C2-4828-83A4-A286E22DD18D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{909B60CC-693B-4DC9-9BC2-65B1D9373B5A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:GetTickOrder", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Result: Number" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 1502188240 + }, + "Value": { + "m_eventName": "OnTick", + "m_eventId": { + "Value": 1502188240 + }, + "m_eventSlotId": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{02148868-388F-44F0-9E3A-C31601701F3B}" + }, + { + "m_id": "{1D2C5717-17A6-401F-BBF6-08EF84870CD3}" + } + ], + "m_numExpectedArguments": 2 + } + }, + { + "Key": { + "Value": 1890826333 + }, + "Value": { + "m_eventName": "GetTickOrder", + "m_eventId": { + "Value": 1890826333 + }, + "m_eventSlotId": { + "m_id": "{909B60CC-693B-4DC9-9BC2-65B1D9373B5A}" + }, + "m_resultSlotId": { + "m_id": "{53E6F39B-30C2-4828-83A4-A286E22DD18D}" + } + } + } + ], + "m_ebusName": "TickBus", + "m_busId": { + "Value": 1209186864 + } + } + } + }, + { + "Id": { + "id": 246128197275796 + }, + "Name": "SC-Node(SetNamedParameterVector3)", + "Components": { + "Component_[12793834298003501509]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 12793834298003501509, + "Slots": [ + { + "id": { + "m_id": "{25F29FBA-7B7B-44FA-869A-48167AE73CD8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DB4C82E4-77C5-4CCF-960E-FFB36CE6A930}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{04958BE6-8525-49CA-9130-8CECD0BE43B3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector3: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5D58862C-5682-4497-A994-F240120E8E62}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8F6FD0FC-11E5-49DD-A7D6-0AC0351E2DCA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + }, + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "GoalFacingDir", + "label": "Name" + }, + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Value" + } + ], + "methodType": 0, + "methodName": "SetNamedParameterVector3", + "className": "AnimGraphComponentRequestBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{25F29FBA-7B7B-44FA-869A-48167AE73CD8}" + }, + { + "m_id": "{DB4C82E4-77C5-4CCF-960E-FFB36CE6A930}" + }, + { + "m_id": "{04958BE6-8525-49CA-9130-8CECD0BE43B3}" + } + ], + "prettyClassName": "AnimGraphComponentRequestBus" + } + } + }, + { + "Id": { + "id": 246171146948756 + }, + "Name": "SC-Node(SetNamedParameterVector3)", + "Components": { + "Component_[12793834298003501509]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 12793834298003501509, + "Slots": [ + { + "id": { + "m_id": "{25F29FBA-7B7B-44FA-869A-48167AE73CD8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DB4C82E4-77C5-4CCF-960E-FFB36CE6A930}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{04958BE6-8525-49CA-9130-8CECD0BE43B3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector3: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5D58862C-5682-4497-A994-F240120E8E62}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8F6FD0FC-11E5-49DD-A7D6-0AC0351E2DCA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + }, + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "GoalPos", + "label": "Name" + }, + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Value" + } + ], + "methodType": 0, + "methodName": "SetNamedParameterVector3", + "className": "AnimGraphComponentRequestBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{25F29FBA-7B7B-44FA-869A-48167AE73CD8}" + }, + { + "m_id": "{DB4C82E4-77C5-4CCF-960E-FFB36CE6A930}" + }, + { + "m_id": "{04958BE6-8525-49CA-9130-8CECD0BE43B3}" + } + ], + "prettyClassName": "AnimGraphComponentRequestBus" + } + } + }, + { + "Id": { + "id": 246184031850644 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Quaternion(double )}* RotationZDegreesTraits >)", + "Components": { + "Component_[13432280424019746829]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Quaternion(double )}* RotationZDegreesTraits >", + "Id": 13432280424019746829, + "Slots": [ + { + "id": { + "m_id": "{424CC5BD-ACB0-4F1E-9700-DE29DE2F908E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6D35C87C-35B1-49F2-9FE6-2FE2991AAB8D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E2E3C0BC-56A7-4504-BEFA-1F1673DE7B0E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Degrees", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C2F9543A-928E-4405-A269-D8F952D227DB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result", + "DisplayDataType": { + "m_type": 6 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Degrees" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 246149672112276 + }, + "Name": "SC-Node(DrawTextAtLocation)", + "Components": { + "Component_[13698618923081442893]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 13698618923081442893, + "Slots": [ + { + "id": { + "m_id": "{C1270538-1843-4392-B23C-12747DD40B15}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector3: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{BE55072D-9B52-484A-BAB6-6847B191F6FA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3DB3F6B0-8401-4068-9ACE-7EEA6717A748}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Color: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{89BAE0A0-D8B2-4150-BFC2-69BACAF0D141}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: 3", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{31C53E9E-3EE2-4476-A4C3-4966FDA539CC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E3D18BB2-B5F4-4AFD-8902-91124330D9E2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Position" + }, + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "Goal", + "label": "Text" + }, + { + "scriptCanvasType": { + "m_type": 12 + }, + "isNullPointer": false, + "$type": "Color", + "value": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Color" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Duration" + } + ], + "NodeDisabledFlag": 1, + "methodType": 0, + "methodName": "DrawTextAtLocation", + "className": "DebugDrawRequestBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{C1270538-1843-4392-B23C-12747DD40B15}" + }, + { + "m_id": "{BE55072D-9B52-484A-BAB6-6847B191F6FA}" + }, + { + "m_id": "{3DB3F6B0-8401-4068-9ACE-7EEA6717A748}" + }, + { + "m_id": "{89BAE0A0-D8B2-4150-BFC2-69BACAF0D141}" + } + ], + "prettyClassName": "DebugDrawRequestBus" + } + } + }, + { + "Id": { + "id": 246098132504724 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Quaternion(double )}* RotationZDegreesTraits >)", + "Components": { + "Component_[15296836612744061228]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Quaternion(double )}* RotationZDegreesTraits >", + "Id": 15296836612744061228, + "Slots": [ + { + "id": { + "m_id": "{C9C41693-0E85-429F-B9CF-87102B7AF399}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DFA7AD12-D253-4B55-95BF-EBD79C9F0986}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5076FEE2-72A1-4E2C-8FAF-649186F6F022}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Degrees", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{59A7EF4E-857E-4F2B-9466-37FE3C783EF9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result", + "DisplayDataType": { + "m_type": 6 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Degrees" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 246106722439316 + }, + "Name": "SC-Node(OperatorAdd)", + "Components": { + "Component_[16975947039966203662]": { + "$type": "OperatorAdd", + "Id": 16975947039966203662, + "Slots": [ + { + "id": { + "m_id": "{1AD1DED1-EDE6-4FAF-B3B6-FB5B26F1B294}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E8BA15CB-A2B1-4824-92D6-2A71EEBF0378}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FBF48C32-3CCB-47CA-BC9E-45567BF1B269}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Vector3", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 8 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C59084D6-69B9-464E-B6C9-910F69509779}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Vector3", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 8 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B87A6F0B-DE2B-4E9E-9C44-D18F1B8706E4}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 8 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Vector3" + }, + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Vector3" + } + ] + } + } + }, + { + "Id": { + "id": 246085247602836 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[17915522105314128859]": { + "$type": "Print", + "Id": 17915522105314128859, + "Slots": [ + { + "id": { + "m_id": "{9FEBBB50-0F94-4781-9B51-88CAA867EC16}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "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": "{CFDEBA73-CAD5-4A66-ACD1-4080334CEED1}" + }, + "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" + } + ], + "NodeDisabledFlag": 1, + "m_format": "MoveX {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + } + } + ], + "m_unresolvedString": [ + "MoveX ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + } + } + } + } + }, + { + "Id": { + "id": 246192621785236 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[17915522105314128859]": { + "$type": "Print", + "Id": 17915522105314128859, + "Slots": [ + { + "id": { + "m_id": "{9FEBBB50-0F94-4781-9B51-88CAA867EC16}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "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": "{CFDEBA73-CAD5-4A66-ACD1-4080334CEED1}" + }, + "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" + } + ], + "NodeDisabledFlag": 1, + "m_format": "MoveY {Value}", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + } + } + ], + "m_unresolvedString": [ + "MoveY ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + } + } + } + } + }, + { + "Id": { + "id": 246080952635540 + }, + "Name": "SC-Node(ExtractProperty)", + "Components": { + "Component_[18182473127226221453]": { + "$type": "ExtractProperty", + "Id": 18182473127226221453, + "Slots": [ + { + "id": { + "m_id": "{B85B623A-CACB-4B96-98DB-E4F289AA01D4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled assigns property values using the supplied source input", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E6DBA835-98FA-4ADB-8F87-15604C8D3FD3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after all property haves have been pushed to the output slots", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8F09882E-A82E-481D-9FBD-FED706BEFB7C}" + }, + "DynamicTypeOverride": 1, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "The value on which to extract properties from.", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{10C2FAA6-AA90-4D62-97FB-1C6C81BA6AB2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "X", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7FAB654B-42B6-4402-91F8-7AD3AB651DE1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Y", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E7EB179B-BACB-44DB-B2D1-D5D4788D80D8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Z", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Source" + } + ], + "m_dataType": { + "m_type": 8 + }, + "m_propertyAccounts": [ + { + "m_propertySlotId": { + "m_id": "{10C2FAA6-AA90-4D62-97FB-1C6C81BA6AB2}" + }, + "m_propertyType": { + "m_type": 3 + }, + "m_propertyName": "x" + }, + { + "m_propertySlotId": { + "m_id": "{7FAB654B-42B6-4402-91F8-7AD3AB651DE1}" + }, + "m_propertyType": { + "m_type": 3 + }, + "m_propertyName": "y" + }, + { + "m_propertySlotId": { + "m_id": "{E7EB179B-BACB-44DB-B2D1-D5D4788D80D8}" + }, + "m_propertyType": { + "m_type": 3 + }, + "m_propertyName": "z" + } + ] + } + } + }, + { + "Id": { + "id": 246102427472020 + }, + "Name": "SC-Node(DrawSphereAtLocation)", + "Components": { + "Component_[217512573203327123]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 217512573203327123, + "Slots": [ + { + "id": { + "m_id": "{67CBBEE3-F9B5-472E-8A3E-A82996CDA2D1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector3: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{0C39ADAF-7C3F-465C-A61F-54FD9E06B6F6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3D43E30E-F93C-4463-AF83-60B68E277D51}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Color: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{12524268-7E71-44A0-B2E2-FAB3465AF3C8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: 3", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{9B026749-1D6E-4F69-9F20-777A510FD7C4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{063DEA47-18F0-45C9-B2D6-BB6767B769DE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Position" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.1, + "label": "Radius" + }, + { + "scriptCanvasType": { + "m_type": 12 + }, + "isNullPointer": false, + "$type": "Color", + "value": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Color" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Duration" + } + ], + "NodeDisabledFlag": 1, + "methodType": 0, + "methodName": "DrawSphereAtLocation", + "className": "DebugDrawRequestBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{67CBBEE3-F9B5-472E-8A3E-A82996CDA2D1}" + }, + { + "m_id": "{0C39ADAF-7C3F-465C-A61F-54FD9E06B6F6}" + }, + { + "m_id": "{3D43E30E-F93C-4463-AF83-60B68E277D51}" + }, + { + "m_id": "{12524268-7E71-44A0-B2E2-FAB3465AF3C8}" + } + ], + "prettyClassName": "DebugDrawRequestBus" + } + } + }, + { + "Id": { + "id": 246145377144980 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Vector3(Quaternion Vector3 )}* RotateVector3Traits >)", + "Components": { + "Component_[2974676320576034178]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Vector3(Quaternion Vector3 )}* RotateVector3Traits >", + "Id": 2974676320576034178, + "Slots": [ + { + "id": { + "m_id": "{9704DF19-1C22-4E87-B461-EBA5E86CA68C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C49165F2-9484-4E70-874F-4FD821B83AB0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6F45F01E-F700-4594-98F0-A02A5BE00617}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Quaternion", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{50A0D858-774F-4379-8B02-C178E5327BE9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{099EF8F5-DE6F-45FC-9AA6-716996AAB7C6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 6 + }, + "isNullPointer": false, + "$type": "Quaternion", + "value": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Quaternion" + }, + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 1.0, + 0.0 + ], + "label": "Vector" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 246166851981460 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Vector3(Quaternion Vector3 )}* RotateVector3Traits >)", + "Components": { + "Component_[2974676320576034178]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Vector3(Quaternion Vector3 )}* RotateVector3Traits >", + "Id": 2974676320576034178, + "Slots": [ + { + "id": { + "m_id": "{9704DF19-1C22-4E87-B461-EBA5E86CA68C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C49165F2-9484-4E70-874F-4FD821B83AB0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6F45F01E-F700-4594-98F0-A02A5BE00617}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Quaternion", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{50A0D858-774F-4379-8B02-C178E5327BE9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{099EF8F5-DE6F-45FC-9AA6-716996AAB7C6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 6 + }, + "isNullPointer": false, + "$type": "Quaternion", + "value": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Quaternion" + }, + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 1.0, + 0.0 + ], + "label": "Vector" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 246076657668244 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Vector3(Quaternion Vector3 )}* RotateVector3Traits >)", + "Components": { + "Component_[3881104967231448701]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Vector3(Quaternion Vector3 )}* RotateVector3Traits >", + "Id": 3881104967231448701, + "Slots": [ + { + "id": { + "m_id": "{8C5BE0B0-13CC-43A5-8F44-9C282B3E4D60}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8D7093BA-E37A-48D7-ABB6-8D3960A60BF0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{72351E0C-D3F5-4181-90CB-8A4E0557A978}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Quaternion", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B46DDF66-DA5E-474C-A740-5472FBBF285A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Vector", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{879125AE-8729-465D-A3E3-1DAF6B9C84C7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 6 + }, + "isNullPointer": false, + "$type": "Quaternion", + "value": [ + 0.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Quaternion" + }, + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Vector" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 246153967079572 + }, + "Name": "SC-Node((NodeFunctionGenericMultiReturn)<{Vector3(double double double )}* FromValuesTraits >)", + "Components": { + "Component_[4092504572586685068]": { + "$type": "(NodeFunctionGenericMultiReturn)<{Vector3(double double double )}* FromValuesTraits >", + "Id": 4092504572586685068, + "Slots": [ + { + "id": { + "m_id": "{7A425E1D-C67F-42D7-8377-124FDDCCD02B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2EAFCACB-BC3D-4748-86F6-E2037A7CF487}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8FACA5C3-ED4D-4DC2-8E6A-28AE1B340BE7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "X", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A01573D8-5F5D-404B-A5BC-193480C65F28}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Y", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{0F6AB874-B298-4425-B142-017E8B7F0501}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Z", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5029C117-20D4-4CE1-9097-FBBC98B4F457}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "X" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Y" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Z" + } + ], + "Initialized": true + } + } + }, + { + "Id": { + "id": 246162557014164 + }, + "Name": "SC Node(SetVariable)", + "Components": { + "Component_[4132372868512871966]": { + "$type": "SetVariableNode", + "Id": 4132372868512871966, + "Slots": [ + { + "id": { + "m_id": "{F83C85A3-77E5-4B09-8FE2-32127A1C6EDE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the variable referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{457D8C40-3373-4DA9-8186-C33DBFA2397F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced variable has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{AFAC9742-D20E-4094-8720-7E4582FE7761}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{954FC5E5-8838-4ABF-8C6E-B6B100C7BD20}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ], + "m_variableId": { + "m_id": "{5EB17E58-0B4E-451D-A1CE-0E7C272CBDEC}" + }, + "m_variableDataInSlotId": { + "m_id": "{AFAC9742-D20E-4094-8720-7E4582FE7761}" + }, + "m_variableDataOutSlotId": { + "m_id": "{954FC5E5-8838-4ABF-8C6E-B6B100C7BD20}" + } + } + } + }, + { + "Id": { + "id": 246119607341204 + }, + "Name": "SC Node(SetVariable)", + "Components": { + "Component_[4132372868512871966]": { + "$type": "SetVariableNode", + "Id": 4132372868512871966, + "Slots": [ + { + "id": { + "m_id": "{F83C85A3-77E5-4B09-8FE2-32127A1C6EDE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the variable referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{457D8C40-3373-4DA9-8186-C33DBFA2397F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced variable has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{AFAC9742-D20E-4094-8720-7E4582FE7761}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{954FC5E5-8838-4ABF-8C6E-B6B100C7BD20}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ], + "m_variableId": { + "m_id": "{B48E5726-A7FF-42A8-84D2-CF43ABBD1EDC}" + }, + "m_variableDataInSlotId": { + "m_id": "{AFAC9742-D20E-4094-8720-7E4582FE7761}" + }, + "m_variableDataOutSlotId": { + "m_id": "{954FC5E5-8838-4ABF-8C6E-B6B100C7BD20}" + } + } + } + }, + { + "Id": { + "id": 246175441916052 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[5278854140649584684]": { + "$type": "GetVariableNode", + "Id": 5278854140649584684, + "Slots": [ + { + "id": { + "m_id": "{17B5B6FD-B942-4C0C-847E-3891BA11743B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{613E9634-0EEC-43EE-A680-94724628BEAB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D44E36FC-7879-4E15-B0AA-0E9F866D2A5C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{B48E5726-A7FF-42A8-84D2-CF43ABBD1EDC}" + }, + "m_variableDataOutSlotId": { + "m_id": "{D44E36FC-7879-4E15-B0AA-0E9F866D2A5C}" + } + } + } + }, + { + "Id": { + "id": 246068067733652 + }, + "Name": "SC-Node(GetWorldTranslation)", + "Components": { + "Component_[6584501548902644902]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 6584501548902644902, + "Slots": [ + { + "id": { + "m_id": "{72B594D3-36EA-4390-A1E3-E8B296D3CC68}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5AAE80BB-C549-4D61-AC36-57FF33A0F9B9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D6245737-F70E-431A-8DB2-D187634B6859}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{EBC733B4-A0E0-4772-888E-082AF8BA2FFF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Vector3", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "methodType": 0, + "methodName": "GetWorldTranslation", + "className": "TransformBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{72B594D3-36EA-4390-A1E3-E8B296D3CC68}" + } + ], + "prettyClassName": "TransformBus" + } + } + }, + { + "Id": { + "id": 246115312373908 + }, + "Name": "SC-Node(InputHandlerNodeableNode)", + "Components": { + "Component_[6810487525300205505]": { + "$type": "InputHandlerNodeableNode", + "Id": 6810487525300205505, + "Slots": [ + { + "id": { + "m_id": "{59344FA8-1BCE-4323-B7ED-963439BB3D43}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect Event", + "toolTip": "Connect to input event name as defined in an input binding asset.", + "DisplayGroup": { + "Value": 2173756817 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DBEB7EFF-188D-498B-A0C7-62A6A379E121}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event Name", + "toolTip": "Event name as defined in an input binding asset. Example 'Fireball'.", + "DisplayGroup": { + "Value": 2173756817 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{ABD24CF7-E97C-41E9-8AC3-EC4C586DDBFC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connect Event", + "toolTip": "Connect to input event name as defined in an input binding asset.", + "DisplayGroup": { + "Value": 2173756817 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DD88EDED-AD61-4BD4-9A2A-2A8F7339CD66}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Pressed", + "toolTip": "Signaled when the input event begins.", + "DisplayGroup": { + "Value": 458537082 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{CDB5418B-2ECA-421E-827E-44835EF28954}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "value", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 458537082 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{C20E41AE-74BA-4E93-B278-841E4F3848DD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Held", + "toolTip": "Signaled while the input event is active.", + "DisplayGroup": { + "Value": 308119761 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{001FCBA0-A022-47DB-A346-782286DA3DE5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Released", + "toolTip": "Signaled when the input event ends.", + "DisplayGroup": { + "Value": 4215628054 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "MoveY", + "label": "Event Name" + } + ], + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{59344FA8-1BCE-4323-B7ED-963439BB3D43}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{DBEB7EFF-188D-498B-A0C7-62A6A379E121}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{ABD24CF7-E97C-41E9-8AC3-EC4C586DDBFC}" + }, + "_name": "On Connect Event" + } + ], + "_interfaceSourceId": "{8087B80F-BB00-0000-0241-25E7FC7F0000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{DD88EDED-AD61-4BD4-9A2A-2A8F7339CD66}" + }, + "_name": "Pressed", + "_outputs": [ + { + "_slotId": { + "m_id": "{CDB5418B-2ECA-421E-827E-44835EF28954}" + } + } + ], + "_interfaceSourceId": "{8087B80F-BB00-0000-0241-25E7FC7F0000}" + }, + { + "_slotId": { + "m_id": "{C20E41AE-74BA-4E93-B278-841E4F3848DD}" + }, + "_name": "Held", + "_outputs": [ + { + "_slotId": { + "m_id": "{CDB5418B-2ECA-421E-827E-44835EF28954}" + } + } + ], + "_interfaceSourceId": "{8087B80F-BB00-0000-0241-25E7FC7F0000}" + }, + { + "_slotId": { + "m_id": "{001FCBA0-A022-47DB-A346-782286DA3DE5}" + }, + "_name": "Released", + "_outputs": [ + { + "_slotId": { + "m_id": "{CDB5418B-2ECA-421E-827E-44835EF28954}" + } + } + ] + } + ] + } + } + } + }, + { + "Id": { + "id": 246072362700948 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[7093473538212812857]": { + "$type": "GetVariableNode", + "Id": 7093473538212812857, + "Slots": [ + { + "id": { + "m_id": "{276F5B6E-2FC8-4EFF-A161-2548BC0E0885}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6D512DCD-4CA6-421F-9C23-214E4A757D5F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{68E66FCE-1DF4-445A-9DD5-7D06D3A3146D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{5EB17E58-0B4E-451D-A1CE-0E7C272CBDEC}" + }, + "m_variableDataOutSlotId": { + "m_id": "{68E66FCE-1DF4-445A-9DD5-7D06D3A3146D}" + } + } + } + }, + { + "Id": { + "id": 246179736883348 + }, + "Name": "EBusEventHandler", + "Components": { + "Component_[7486482846458186344]": { + "$type": "EBusEventHandler", + "Id": 7486482846458186344, + "Slots": [ + { + "id": { + "m_id": "{ACA820F7-7515-4904-AB73-975DE0723CBE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DAA6A799-AB8F-448D-92CD-F431D4A9424C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1E01CC28-0CD3-4E29-9AF5-F51958FBEB44}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A9AF6E0E-6D77-45C4-9720-CF4F488243ED}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4D7CF661-9343-4A44-8095-AFC33096AB20}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{96E803E6-7979-48B7-B473-21D317FC97BD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "ID used to connect on a specific Event address (Type: EntityId)", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8449A9CC-591E-40CD-8122-CDA20BCD226D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FC0FCD21-DA19-4674-9F8C-D79960777B1E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityActivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{24D001AB-332B-41B2-B2AA-AF7D6418DB8F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{3DE59EA1-6365-458A-8806-D42BA4B79F07}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:OnEntityDeactivated", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "m_eventMap": [ + { + "Key": { + "Value": 245425936 + }, + "Value": { + "m_eventName": "OnEntityActivated", + "m_eventId": { + "Value": 245425936 + }, + "m_eventSlotId": { + "m_id": "{FC0FCD21-DA19-4674-9F8C-D79960777B1E}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{8449A9CC-591E-40CD-8122-CDA20BCD226D}" + } + ], + "m_numExpectedArguments": 1 + } + }, + { + "Key": { + "Value": 4273369222 + }, + "Value": { + "m_eventName": "OnEntityDeactivated", + "m_eventId": { + "Value": 4273369222 + }, + "m_eventSlotId": { + "m_id": "{3DE59EA1-6365-458A-8806-D42BA4B79F07}" + }, + "m_parameterSlotIds": [ + { + "m_id": "{24D001AB-332B-41B2-B2AA-AF7D6418DB8F}" + } + ], + "m_numExpectedArguments": 1 + } + } + ], + "m_ebusName": "EntityBus", + "m_busId": { + "Value": 3358774020 + } + } + } + }, + { + "Id": { + "id": 246188326817940 + }, + "Name": "SC-Node(GetWorldRotationQuaternion)", + "Components": { + "Component_[9629672380141390157]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 9629672380141390157, + "Slots": [ + { + "id": { + "m_id": "{C9D6C354-CB4F-40E3-892E-19D7940A9399}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6BCB6E4B-E9C5-4D6E-A4AF-C2C76271E115}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E7F58DBD-3882-43D3-B44F-D2E68E5E7098}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{81953E27-7B51-462D-9AB8-B122F33A7391}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Quaternion", + "DisplayDataType": { + "m_type": 6 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 623788559886 + }, + "label": "Source" + } + ], + "methodType": 0, + "methodName": "GetWorldRotationQuaternion", + "className": "TransformBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{C9D6C354-CB4F-40E3-892E-19D7940A9399}" + } + ], + "prettyClassName": "TransformBus" + } + } + }, + { + "Id": { + "id": 246141082177684 + }, + "Name": "SC-Node(GetWorldRotationQuaternion)", + "Components": { + "Component_[9629672380141390157]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 9629672380141390157, + "Slots": [ + { + "id": { + "m_id": "{C9D6C354-CB4F-40E3-892E-19D7940A9399}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{6BCB6E4B-E9C5-4D6E-A4AF-C2C76271E115}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E7F58DBD-3882-43D3-B44F-D2E68E5E7098}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{81953E27-7B51-462D-9AB8-B122F33A7391}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Quaternion", + "DisplayDataType": { + "m_type": 6 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 653853330958 + }, + "label": "Source" + } + ], + "methodType": 0, + "methodName": "GetWorldRotationQuaternion", + "className": "TransformBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{C9D6C354-CB4F-40E3-892E-19D7940A9399}" + } + ], + "prettyClassName": "TransformBus" + } + } + }, + { + "Id": { + "id": 246158262046868 + }, + "Name": "SC-Node(ExtractProperty)", + "Components": { + "Component_[973963568861268593]": { + "$type": "ExtractProperty", + "Id": 973963568861268593, + "Slots": [ + { + "id": { + "m_id": "{A6542FE6-CFED-4033-AC3A-64614B1BF141}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled assigns property values using the supplied source input", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3EB4F651-DA08-45E5-94FE-432A8FC45914}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after all property haves have been pushed to the output slots", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E14C7719-5419-444C-BCDF-23BFDFD40DA4}" + }, + "DynamicTypeOverride": 1, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "The value on which to extract properties from.", + "DisplayDataType": { + "m_type": 8 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{663DD576-8088-485C-AFFE-DCB0FCAEE679}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "X", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{DB27CBA5-2F04-44AD-A73E-A3772236908A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Y", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B138BB48-9B60-4DE3-8DF0-DCC17D0D6358}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Z", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 8 + }, + "isNullPointer": false, + "$type": "Vector3", + "value": [ + 0.0, + 0.0, + 0.0 + ], + "label": "Source" + } + ], + "m_dataType": { + "m_type": 8 + }, + "m_propertyAccounts": [ + { + "m_propertySlotId": { + "m_id": "{663DD576-8088-485C-AFFE-DCB0FCAEE679}" + }, + "m_propertyType": { + "m_type": 3 + }, + "m_propertyName": "x" + }, + { + "m_propertySlotId": { + "m_id": "{DB27CBA5-2F04-44AD-A73E-A3772236908A}" + }, + "m_propertyType": { + "m_type": 3 + }, + "m_propertyName": "y" + }, + { + "m_propertySlotId": { + "m_id": "{B138BB48-9B60-4DE3-8DF0-DCC17D0D6358}" + }, + "m_propertyType": { + "m_type": 3 + }, + "m_propertyName": "z" + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 246196916752532 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(InputHandler: Connect Event)", + "Components": { + "Component_[8456523383292490588]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8456523383292490588, + "sourceEndpoint": { + "nodeId": { + "id": 246179736883348 + }, + "slotId": { + "m_id": "{FC0FCD21-DA19-4674-9F8C-D79960777B1E}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246132492243092 + }, + "slotId": { + "m_id": "{223DB32E-54FF-41B5-978E-289EA97C1A1C}" + } + } + } + } + }, + { + "Id": { + "id": 246201211719828 + }, + "Name": "srcEndpoint=(EntityBus Handler: ExecutionSlot:OnEntityActivated), destEndpoint=(InputHandler: Connect Event)", + "Components": { + "Component_[12635346401763282235]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12635346401763282235, + "sourceEndpoint": { + "nodeId": { + "id": 246179736883348 + }, + "slotId": { + "m_id": "{FC0FCD21-DA19-4674-9F8C-D79960777B1E}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246115312373908 + }, + "slotId": { + "m_id": "{59344FA8-1BCE-4323-B7ED-963439BB3D43}" + } + } + } + } + }, + { + "Id": { + "id": 246205506687124 + }, + "Name": "srcEndpoint=(InputHandler: value), destEndpoint=(Set Variable: Number)", + "Components": { + "Component_[12090259056249954518]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12090259056249954518, + "sourceEndpoint": { + "nodeId": { + "id": 246132492243092 + }, + "slotId": { + "m_id": "{C88462F2-E947-4525-9DBB-AE9B3851B2DB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246119607341204 + }, + "slotId": { + "m_id": "{AFAC9742-D20E-4094-8720-7E4582FE7761}" + } + } + } + } + }, + { + "Id": { + "id": 246209801654420 + }, + "Name": "srcEndpoint=(InputHandler: Held), destEndpoint=(Set Variable: In)", + "Components": { + "Component_[10496578309013320974]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10496578309013320974, + "sourceEndpoint": { + "nodeId": { + "id": 246132492243092 + }, + "slotId": { + "m_id": "{12DA88AD-8B23-45AF-991D-456F32377083}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246119607341204 + }, + "slotId": { + "m_id": "{F83C85A3-77E5-4B09-8FE2-32127A1C6EDE}" + } + } + } + } + }, + { + "Id": { + "id": 246214096621716 + }, + "Name": "srcEndpoint=(Set Variable: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[5484696725367231856]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5484696725367231856, + "sourceEndpoint": { + "nodeId": { + "id": 246119607341204 + }, + "slotId": { + "m_id": "{457D8C40-3373-4DA9-8186-C33DBFA2397F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246085247602836 + }, + "slotId": { + "m_id": "{9FEBBB50-0F94-4781-9B51-88CAA867EC16}" + } + } + } + } + }, + { + "Id": { + "id": 246218391589012 + }, + "Name": "srcEndpoint=(Set Variable: Number), destEndpoint=(Print: Value)", + "Components": { + "Component_[14254771563627471531]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14254771563627471531, + "sourceEndpoint": { + "nodeId": { + "id": 246119607341204 + }, + "slotId": { + "m_id": "{954FC5E5-8838-4ABF-8C6E-B6B100C7BD20}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246085247602836 + }, + "slotId": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + } + } + } + } + }, + { + "Id": { + "id": 246222686556308 + }, + "Name": "srcEndpoint=(Set Variable: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[4813008405212019270]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4813008405212019270, + "sourceEndpoint": { + "nodeId": { + "id": 246162557014164 + }, + "slotId": { + "m_id": "{457D8C40-3373-4DA9-8186-C33DBFA2397F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246192621785236 + }, + "slotId": { + "m_id": "{9FEBBB50-0F94-4781-9B51-88CAA867EC16}" + } + } + } + } + }, + { + "Id": { + "id": 246226981523604 + }, + "Name": "srcEndpoint=(Set Variable: Number), destEndpoint=(Print: Value)", + "Components": { + "Component_[7843206400486067015]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7843206400486067015, + "sourceEndpoint": { + "nodeId": { + "id": 246162557014164 + }, + "slotId": { + "m_id": "{954FC5E5-8838-4ABF-8C6E-B6B100C7BD20}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246192621785236 + }, + "slotId": { + "m_id": "{3F92B8A4-0A0C-4120-B947-9A64BE38855F}" + } + } + } + } + }, + { + "Id": { + "id": 246231276490900 + }, + "Name": "srcEndpoint=(InputHandler: Held), destEndpoint=(Set Variable: In)", + "Components": { + "Component_[6686521440104763914]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6686521440104763914, + "sourceEndpoint": { + "nodeId": { + "id": 246115312373908 + }, + "slotId": { + "m_id": "{C20E41AE-74BA-4E93-B278-841E4F3848DD}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246162557014164 + }, + "slotId": { + "m_id": "{F83C85A3-77E5-4B09-8FE2-32127A1C6EDE}" + } + } + } + } + }, + { + "Id": { + "id": 246235571458196 + }, + "Name": "srcEndpoint=(InputHandler: value), destEndpoint=(Set Variable: Number)", + "Components": { + "Component_[9188879004341290744]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9188879004341290744, + "sourceEndpoint": { + "nodeId": { + "id": 246115312373908 + }, + "slotId": { + "m_id": "{CDB5418B-2ECA-421E-827E-44835EF28954}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246162557014164 + }, + "slotId": { + "m_id": "{AFAC9742-D20E-4094-8720-7E4582FE7761}" + } + } + } + } + }, + { + "Id": { + "id": 246239866425492 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(Get Variable: In)", + "Components": { + "Component_[11528425355392281835]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11528425355392281835, + "sourceEndpoint": { + "nodeId": { + "id": 246175441916052 + }, + "slotId": { + "m_id": "{613E9634-0EEC-43EE-A680-94724628BEAB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246072362700948 + }, + "slotId": { + "m_id": "{276F5B6E-2FC8-4EFF-A161-2548BC0E0885}" + } + } + } + } + }, + { + "Id": { + "id": 246244161392788 + }, + "Name": "srcEndpoint=(GetWorldRotationQuaternion: Result: Quaternion), destEndpoint=(ConvertQuaternionToEulerDegrees: Quaternion: 0)", + "Components": { + "Component_[12030435265785289825]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12030435265785289825, + "sourceEndpoint": { + "nodeId": { + "id": 246188326817940 + }, + "slotId": { + "m_id": "{81953E27-7B51-462D-9AB8-B122F33A7391}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246136787210388 + }, + "slotId": { + "m_id": "{A96CFD2A-531E-4330-B991-F27754DB21B4}" + } + } + } + } + }, + { + "Id": { + "id": 246248456360084 + }, + "Name": "srcEndpoint=(GetWorldRotationQuaternion: Out), destEndpoint=(ConvertQuaternionToEulerDegrees: In)", + "Components": { + "Component_[9017349526511387231]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9017349526511387231, + "sourceEndpoint": { + "nodeId": { + "id": 246188326817940 + }, + "slotId": { + "m_id": "{E7F58DBD-3882-43D3-B44F-D2E68E5E7098}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246136787210388 + }, + "slotId": { + "m_id": "{CC9077E4-E835-4CAE-90EB-2B5FF8BA8F07}" + } + } + } + } + }, + { + "Id": { + "id": 246252751327380 + }, + "Name": "srcEndpoint=(GetWorldRotationQuaternion: Out), destEndpoint=(ConvertQuaternionToEulerDegrees: In)", + "Components": { + "Component_[13772266509420181725]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13772266509420181725, + "sourceEndpoint": { + "nodeId": { + "id": 246141082177684 + }, + "slotId": { + "m_id": "{E7F58DBD-3882-43D3-B44F-D2E68E5E7098}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246089542570132 + }, + "slotId": { + "m_id": "{CC9077E4-E835-4CAE-90EB-2B5FF8BA8F07}" + } + } + } + } + }, + { + "Id": { + "id": 246257046294676 + }, + "Name": "srcEndpoint=(GetWorldRotationQuaternion: Result: Quaternion), destEndpoint=(ConvertQuaternionToEulerDegrees: Quaternion: 0)", + "Components": { + "Component_[11761142503816878011]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11761142503816878011, + "sourceEndpoint": { + "nodeId": { + "id": 246141082177684 + }, + "slotId": { + "m_id": "{81953E27-7B51-462D-9AB8-B122F33A7391}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246089542570132 + }, + "slotId": { + "m_id": "{A96CFD2A-531E-4330-B991-F27754DB21B4}" + } + } + } + } + }, + { + "Id": { + "id": 246261341261972 + }, + "Name": "srcEndpoint=(GetWorldTranslation: Result: Vector3), destEndpoint=(Add (+): Value)", + "Components": { + "Component_[11437964710666113038]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11437964710666113038, + "sourceEndpoint": { + "nodeId": { + "id": 246068067733652 + }, + "slotId": { + "m_id": "{EBC733B4-A0E0-4772-888E-082AF8BA2FFF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{C59084D6-69B9-464E-B6C9-910F69509779}" + } + } + } + } + }, + { + "Id": { + "id": 246265636229268 + }, + "Name": "srcEndpoint=(Add (+): Out), destEndpoint=(SetNamedParameterVector3: In)", + "Components": { + "Component_[12246932468136989673]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12246932468136989673, + "sourceEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{E8BA15CB-A2B1-4824-92D6-2A71EEBF0378}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246171146948756 + }, + "slotId": { + "m_id": "{5D58862C-5682-4497-A994-F240120E8E62}" + } + } + } + } + }, + { + "Id": { + "id": 246269931196564 + }, + "Name": "srcEndpoint=(SetNamedParameterVector3: Out), destEndpoint=(DrawSphereAtLocation: In)", + "Components": { + "Component_[14273979275766531928]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14273979275766531928, + "sourceEndpoint": { + "nodeId": { + "id": 246171146948756 + }, + "slotId": { + "m_id": "{8F6FD0FC-11E5-49DD-A7D6-0AC0351E2DCA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246102427472020 + }, + "slotId": { + "m_id": "{9B026749-1D6E-4F69-9F20-777A510FD7C4}" + } + } + } + } + }, + { + "Id": { + "id": 246282816098452 + }, + "Name": "srcEndpoint=(RotateVector3: Result), destEndpoint=(DrawRayEntityToDirection: Vector3: 1)", + "Components": { + "Component_[2134692939135952702]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2134692939135952702, + "sourceEndpoint": { + "nodeId": { + "id": 246166851981460 + }, + "slotId": { + "m_id": "{099EF8F5-DE6F-45FC-9AA6-716996AAB7C6}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246123902308500 + }, + "slotId": { + "m_id": "{1ADF8F5A-62E9-41F0-B5BA-A53FA4D60311}" + } + } + } + } + }, + { + "Id": { + "id": 246287111065748 + }, + "Name": "srcEndpoint=(DrawSphereAtLocation: Out), destEndpoint=(DrawTextAtLocation: In)", + "Components": { + "Component_[5472516653628902263]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5472516653628902263, + "sourceEndpoint": { + "nodeId": { + "id": 246102427472020 + }, + "slotId": { + "m_id": "{063DEA47-18F0-45C9-B2D6-BB6767B769DE}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246149672112276 + }, + "slotId": { + "m_id": "{31C53E9E-3EE2-4476-A4C3-4966FDA539CC}" + } + } + } + } + }, + { + "Id": { + "id": 246291406033044 + }, + "Name": "srcEndpoint=(Add (+): Result), destEndpoint=(SetNamedParameterVector3: Vector3: 2)", + "Components": { + "Component_[1844199703114757013]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1844199703114757013, + "sourceEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{B87A6F0B-DE2B-4E9E-9C44-D18F1B8706E4}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246171146948756 + }, + "slotId": { + "m_id": "{04958BE6-8525-49CA-9130-8CECD0BE43B3}" + } + } + } + } + }, + { + "Id": { + "id": 246295701000340 + }, + "Name": "srcEndpoint=(Add (+): Result), destEndpoint=(DrawSphereAtLocation: Vector3: 0)", + "Components": { + "Component_[2568324937444780316]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2568324937444780316, + "sourceEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{B87A6F0B-DE2B-4E9E-9C44-D18F1B8706E4}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246102427472020 + }, + "slotId": { + "m_id": "{67CBBEE3-F9B5-472E-8A3E-A82996CDA2D1}" + } + } + } + } + }, + { + "Id": { + "id": 246299995967636 + }, + "Name": "srcEndpoint=(Add (+): Result), destEndpoint=(DrawTextAtLocation: Vector3: 0)", + "Components": { + "Component_[14096020408718838099]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14096020408718838099, + "sourceEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{B87A6F0B-DE2B-4E9E-9C44-D18F1B8706E4}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246149672112276 + }, + "slotId": { + "m_id": "{C1270538-1843-4392-B23C-12747DD40B15}" + } + } + } + } + }, + { + "Id": { + "id": 246304290934932 + }, + "Name": "srcEndpoint=(RotateVector3: Result), destEndpoint=(SetNamedParameterVector3: Vector3: 2)", + "Components": { + "Component_[16993908198950428448]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16993908198950428448, + "sourceEndpoint": { + "nodeId": { + "id": 246145377144980 + }, + "slotId": { + "m_id": "{099EF8F5-DE6F-45FC-9AA6-716996AAB7C6}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246128197275796 + }, + "slotId": { + "m_id": "{04958BE6-8525-49CA-9130-8CECD0BE43B3}" + } + } + } + } + }, + { + "Id": { + "id": 246308585902228 + }, + "Name": "srcEndpoint=(RotateVector3: Result), destEndpoint=(DrawRayEntityToDirection: Vector3: 1)", + "Components": { + "Component_[8785804684259133429]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8785804684259133429, + "sourceEndpoint": { + "nodeId": { + "id": 246145377144980 + }, + "slotId": { + "m_id": "{099EF8F5-DE6F-45FC-9AA6-716996AAB7C6}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246111017406612 + }, + "slotId": { + "m_id": "{1ADF8F5A-62E9-41F0-B5BA-A53FA4D60311}" + } + } + } + } + }, + { + "Id": { + "id": 246312880869524 + }, + "Name": "srcEndpoint=(ConvertQuaternionToEulerDegrees: Euler Angle), destEndpoint=(Extract Properties: Source)", + "Components": { + "Component_[9719260768879508209]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9719260768879508209, + "sourceEndpoint": { + "nodeId": { + "id": 246136787210388 + }, + "slotId": { + "m_id": "{79FE68CC-45CC-4F5D-87A7-94B9144A3598}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246080952635540 + }, + "slotId": { + "m_id": "{8F09882E-A82E-481D-9FBD-FED706BEFB7C}" + } + } + } + } + }, + { + "Id": { + "id": 246317175836820 + }, + "Name": "srcEndpoint=(RotateVector3: Out), destEndpoint=(SetNamedParameterVector3: In)", + "Components": { + "Component_[14742201364563474463]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14742201364563474463, + "sourceEndpoint": { + "nodeId": { + "id": 246145377144980 + }, + "slotId": { + "m_id": "{C49165F2-9484-4E70-874F-4FD821B83AB0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246128197275796 + }, + "slotId": { + "m_id": "{5D58862C-5682-4497-A994-F240120E8E62}" + } + } + } + } + }, + { + "Id": { + "id": 246321470804116 + }, + "Name": "srcEndpoint=(ConvertQuaternionToEulerDegrees: Out), destEndpoint=(Extract Properties: In)", + "Components": { + "Component_[3599648585598226717]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3599648585598226717, + "sourceEndpoint": { + "nodeId": { + "id": 246136787210388 + }, + "slotId": { + "m_id": "{1286BE0C-88F5-4C0A-ADD6-EEE94AEA78A3}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246080952635540 + }, + "slotId": { + "m_id": "{B85B623A-CACB-4B96-98DB-E4F289AA01D4}" + } + } + } + } + }, + { + "Id": { + "id": 246325765771412 + }, + "Name": "srcEndpoint=(TickBus Handler: ExecutionSlot:OnTick), destEndpoint=(Get Variable: In)", + "Components": { + "Component_[10064893477852139475]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10064893477852139475, + "sourceEndpoint": { + "nodeId": { + "id": 246093837537428 + }, + "slotId": { + "m_id": "{8965578E-A29D-4468-B12B-9D4E4F814641}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246175441916052 + }, + "slotId": { + "m_id": "{17B5B6FD-B942-4C0C-847E-3891BA11743B}" + } + } + } + } + }, + { + "Id": { + "id": 246330060738708 + }, + "Name": "srcEndpoint=(ConvertQuaternionToEulerDegrees: Euler Angle), destEndpoint=(Extract Properties: Source)", + "Components": { + "Component_[15688788304938115651]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 15688788304938115651, + "sourceEndpoint": { + "nodeId": { + "id": 246089542570132 + }, + "slotId": { + "m_id": "{79FE68CC-45CC-4F5D-87A7-94B9144A3598}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246158262046868 + }, + "slotId": { + "m_id": "{E14C7719-5419-444C-BCDF-23BFDFD40DA4}" + } + } + } + } + }, + { + "Id": { + "id": 246334355706004 + }, + "Name": "srcEndpoint=(ConvertQuaternionToEulerDegrees: Out), destEndpoint=(Extract Properties: In)", + "Components": { + "Component_[18268274144592574791]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 18268274144592574791, + "sourceEndpoint": { + "nodeId": { + "id": 246089542570132 + }, + "slotId": { + "m_id": "{1286BE0C-88F5-4C0A-ADD6-EEE94AEA78A3}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246158262046868 + }, + "slotId": { + "m_id": "{A6542FE6-CFED-4033-AC3A-64614B1BF141}" + } + } + } + } + }, + { + "Id": { + "id": 246338650673300 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(FromValues: In)", + "Components": { + "Component_[10607947307671971003]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10607947307671971003, + "sourceEndpoint": { + "nodeId": { + "id": 246072362700948 + }, + "slotId": { + "m_id": "{6D512DCD-4CA6-421F-9C23-214E4A757D5F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246153967079572 + }, + "slotId": { + "m_id": "{7A425E1D-C67F-42D7-8377-124FDDCCD02B}" + } + } + } + } + }, + { + "Id": { + "id": 246342945640596 + }, + "Name": "srcEndpoint=(Get Variable: Number), destEndpoint=(FromValues: X)", + "Components": { + "Component_[6093226963465581941]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6093226963465581941, + "sourceEndpoint": { + "nodeId": { + "id": 246175441916052 + }, + "slotId": { + "m_id": "{D44E36FC-7879-4E15-B0AA-0E9F866D2A5C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246153967079572 + }, + "slotId": { + "m_id": "{8FACA5C3-ED4D-4DC2-8E6A-28AE1B340BE7}" + } + } + } + } + }, + { + "Id": { + "id": 246347240607892 + }, + "Name": "srcEndpoint=(Get Variable: Number), destEndpoint=(FromValues: Y)", + "Components": { + "Component_[9930139812119100083]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9930139812119100083, + "sourceEndpoint": { + "nodeId": { + "id": 246072362700948 + }, + "slotId": { + "m_id": "{68E66FCE-1DF4-445A-9DD5-7D06D3A3146D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246153967079572 + }, + "slotId": { + "m_id": "{A01573D8-5F5D-404B-A5BC-193480C65F28}" + } + } + } + } + }, + { + "Id": { + "id": 246351535575188 + }, + "Name": "srcEndpoint=(FromValues: Out), destEndpoint=(GetWorldRotationQuaternion: In)", + "Components": { + "Component_[13049608142141105699]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13049608142141105699, + "sourceEndpoint": { + "nodeId": { + "id": 246153967079572 + }, + "slotId": { + "m_id": "{2EAFCACB-BC3D-4748-86F6-E2037A7CF487}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246141082177684 + }, + "slotId": { + "m_id": "{6BCB6E4B-E9C5-4D6E-A4AF-C2C76271E115}" + } + } + } + } + }, + { + "Id": { + "id": 246355830542484 + }, + "Name": "srcEndpoint=(Extract Properties: Out), destEndpoint=(RotationZDegrees: In)", + "Components": { + "Component_[2074083843557420377]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2074083843557420377, + "sourceEndpoint": { + "nodeId": { + "id": 246158262046868 + }, + "slotId": { + "m_id": "{3EB4F651-DA08-45E5-94FE-432A8FC45914}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246098132504724 + }, + "slotId": { + "m_id": "{C9C41693-0E85-429F-B9CF-87102B7AF399}" + } + } + } + } + }, + { + "Id": { + "id": 246360125509780 + }, + "Name": "srcEndpoint=(RotationZDegrees: Result), destEndpoint=(RotateVector3: Quaternion)", + "Components": { + "Component_[10610503423712691047]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10610503423712691047, + "sourceEndpoint": { + "nodeId": { + "id": 246098132504724 + }, + "slotId": { + "m_id": "{59A7EF4E-857E-4F2B-9466-37FE3C783EF9}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246166851981460 + }, + "slotId": { + "m_id": "{6F45F01E-F700-4594-98F0-A02A5BE00617}" + } + } + } + } + }, + { + "Id": { + "id": 246364420477076 + }, + "Name": "srcEndpoint=(RotationZDegrees: Out), destEndpoint=(RotateVector3: In)", + "Components": { + "Component_[14370414046864144573]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 14370414046864144573, + "sourceEndpoint": { + "nodeId": { + "id": 246098132504724 + }, + "slotId": { + "m_id": "{DFA7AD12-D253-4B55-95BF-EBD79C9F0986}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246166851981460 + }, + "slotId": { + "m_id": "{9704DF19-1C22-4E87-B461-EBA5E86CA68C}" + } + } + } + } + }, + { + "Id": { + "id": 246368715444372 + }, + "Name": "srcEndpoint=(Extract Properties: Out), destEndpoint=(RotationZDegrees: In)", + "Components": { + "Component_[1859237677254936695]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1859237677254936695, + "sourceEndpoint": { + "nodeId": { + "id": 246080952635540 + }, + "slotId": { + "m_id": "{E6DBA835-98FA-4ADB-8F87-15604C8D3FD3}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246184031850644 + }, + "slotId": { + "m_id": "{424CC5BD-ACB0-4F1E-9700-DE29DE2F908E}" + } + } + } + } + }, + { + "Id": { + "id": 246373010411668 + }, + "Name": "srcEndpoint=(RotationZDegrees: Out), destEndpoint=(RotateVector3: In)", + "Components": { + "Component_[5790169301321537787]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5790169301321537787, + "sourceEndpoint": { + "nodeId": { + "id": 246184031850644 + }, + "slotId": { + "m_id": "{6D35C87C-35B1-49F2-9FE6-2FE2991AAB8D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246145377144980 + }, + "slotId": { + "m_id": "{9704DF19-1C22-4E87-B461-EBA5E86CA68C}" + } + } + } + } + }, + { + "Id": { + "id": 246377305378964 + }, + "Name": "srcEndpoint=(RotationZDegrees: Result), destEndpoint=(RotateVector3: Quaternion)", + "Components": { + "Component_[9113874641309049506]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9113874641309049506, + "sourceEndpoint": { + "nodeId": { + "id": 246184031850644 + }, + "slotId": { + "m_id": "{C2F9543A-928E-4405-A269-D8F952D227DB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246145377144980 + }, + "slotId": { + "m_id": "{6F45F01E-F700-4594-98F0-A02A5BE00617}" + } + } + } + } + }, + { + "Id": { + "id": 246381600346260 + }, + "Name": "srcEndpoint=(Extract Properties: Z), destEndpoint=(RotationZDegrees: Degrees)", + "Components": { + "Component_[16079074013127612900]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16079074013127612900, + "sourceEndpoint": { + "nodeId": { + "id": 246080952635540 + }, + "slotId": { + "m_id": "{E7EB179B-BACB-44DB-B2D1-D5D4788D80D8}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246184031850644 + }, + "slotId": { + "m_id": "{E2E3C0BC-56A7-4504-BEFA-1F1673DE7B0E}" + } + } + } + } + }, + { + "Id": { + "id": 246385895313556 + }, + "Name": "srcEndpoint=(Extract Properties: Z), destEndpoint=(RotationZDegrees: Degrees)", + "Components": { + "Component_[324913126273692816]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 324913126273692816, + "sourceEndpoint": { + "nodeId": { + "id": 246158262046868 + }, + "slotId": { + "m_id": "{B138BB48-9B60-4DE3-8DF0-DCC17D0D6358}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246098132504724 + }, + "slotId": { + "m_id": "{5076FEE2-72A1-4E2C-8FAF-649186F6F022}" + } + } + } + } + }, + { + "Id": { + "id": 246394485248148 + }, + "Name": "srcEndpoint=(FromValues: Result), destEndpoint=(RotateVector3: Vector)", + "Components": { + "Component_[8522346125520723525]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8522346125520723525, + "sourceEndpoint": { + "nodeId": { + "id": 246153967079572 + }, + "slotId": { + "m_id": "{5029C117-20D4-4CE1-9097-FBBC98B4F457}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246076657668244 + }, + "slotId": { + "m_id": "{B46DDF66-DA5E-474C-A740-5472FBBF285A}" + } + } + } + } + }, + { + "Id": { + "id": 246398780215444 + }, + "Name": "srcEndpoint=(RotationZDegrees: Result), destEndpoint=(RotateVector3: Quaternion)", + "Components": { + "Component_[16701501001610934713]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16701501001610934713, + "sourceEndpoint": { + "nodeId": { + "id": 246184031850644 + }, + "slotId": { + "m_id": "{C2F9543A-928E-4405-A269-D8F952D227DB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246076657668244 + }, + "slotId": { + "m_id": "{72351E0C-D3F5-4181-90CB-8A4E0557A978}" + } + } + } + } + }, + { + "Id": { + "id": 246407370150036 + }, + "Name": "srcEndpoint=(RotateVector3: Result), destEndpoint=(Add (+): Vector3)", + "Components": { + "Component_[725702429325335637]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 725702429325335637, + "sourceEndpoint": { + "nodeId": { + "id": 246076657668244 + }, + "slotId": { + "m_id": "{879125AE-8729-465D-A3E3-1DAF6B9C84C7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{FBF48C32-3CCB-47CA-BC9E-45567BF1B269}" + } + } + } + } + }, + { + "Id": { + "id": 246411665117332 + }, + "Name": "srcEndpoint=(RotateVector3: Out), destEndpoint=(GetWorldTranslation: In)", + "Components": { + "Component_[18297619570874862126]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 18297619570874862126, + "sourceEndpoint": { + "nodeId": { + "id": 246076657668244 + }, + "slotId": { + "m_id": "{8D7093BA-E37A-48D7-ABB6-8D3960A60BF0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246068067733652 + }, + "slotId": { + "m_id": "{5AAE80BB-C549-4D61-AC36-57FF33A0F9B9}" + } + } + } + } + }, + { + "Id": { + "id": 246415960084628 + }, + "Name": "srcEndpoint=(GetWorldTranslation: Out), destEndpoint=(Add (+): In)", + "Components": { + "Component_[5276081108224246554]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5276081108224246554, + "sourceEndpoint": { + "nodeId": { + "id": 246068067733652 + }, + "slotId": { + "m_id": "{D6245737-F70E-431A-8DB2-D187634B6859}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246106722439316 + }, + "slotId": { + "m_id": "{1AD1DED1-EDE6-4FAF-B3B6-FB5B26F1B294}" + } + } + } + } + }, + { + "Id": { + "id": 201379649551848 + }, + "Name": "srcEndpoint=(SetNamedParameterVector3: Out), destEndpoint=(RotateVector3: In)", + "Components": { + "Component_[203700470042535327]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 203700470042535327, + "sourceEndpoint": { + "nodeId": { + "id": 246128197275796 + }, + "slotId": { + "m_id": "{8F6FD0FC-11E5-49DD-A7D6-0AC0351E2DCA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246076657668244 + }, + "slotId": { + "m_id": "{8C5BE0B0-13CC-43A5-8F44-9C282B3E4D60}" + } + } + } + } + }, + { + "Id": { + "id": 202487751114216 + }, + "Name": "srcEndpoint=(RotateVector3: Out), destEndpoint=(GetWorldRotationQuaternion: In)", + "Components": { + "Component_[1253233322229674061]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1253233322229674061, + "sourceEndpoint": { + "nodeId": { + "id": 246166851981460 + }, + "slotId": { + "m_id": "{C49165F2-9484-4E70-874F-4FD821B83AB0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 246188326817940 + }, + "slotId": { + "m_id": "{6BCB6E4B-E9C5-4D6E-A4AF-C2C76271E115}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 3, + "GraphCanvasData": [ + { + "Key": { + "id": 246068067733652 + }, + "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": [ + 4540.0, + 2340.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{2FF9E28B-794F-4595-B6CD-F3894076C6E7}" + } + } + } + }, + { + "Key": { + "id": 246072362700948 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 740.0, + 1760.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".getVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{507C10BA-288C-4E68-AEFB-949E4EDA039B}" + } + } + } + }, + { + "Key": { + "id": 246076657668244 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 4200.0, + 2500.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{4BF9A06C-7D50-4FF3-9A4C-55C44FA8F7EF}" + } + } + } + }, + { + "Key": { + "id": 246080952635540 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1300.0, + 2580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{4DED46A4-C20B-43F8-A242-8A379685D4F4}" + } + } + } + }, + { + "Key": { + "id": 246085247602836 + }, + "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": [ + 860.0, + -20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{504E5761-0540-481C-98F1-7C473F7FAD1B}" + } + } + } + }, + { + "Key": { + "id": 246089542570132 + }, + "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": [ + 1980.0, + 1200.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C7970815-CCB0-4FE2-874D-09968D0C09A5}" + } + } + } + }, + { + "Key": { + "id": 246093837537428 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -160.0, + 1840.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 1502188240 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{4BD96082-9121-41AC-9C04-7EED59FF8183}" + } + } + } + }, + { + "Key": { + "id": 246098132504724 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2780.0, + 1240.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{8A15E090-E8AA-4A1E-ABC2-161955729668}" + } + } + } + }, + { + "Key": { + "id": 246102427472020 + }, + "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": [ + 6080.0, + 2280.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{7CCBB240-958D-4A7F-AAB2-C538251C427D}" + } + } + } + }, + { + "Key": { + "id": 246106722439316 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 5140.0, + 2340.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{11DD29F2-0432-479B-AA6A-D1A0A40A6A44}" + } + } + } + }, + { + "Key": { + "id": 246115312373908 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -160.0, + 280.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{CEFD1956-B60A-4727-BEEF-A31E5D712BBF}" + } + } + } + }, + { + "Key": { + "id": 246119607341204 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "SetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 440.0, + 0.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".setVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A6009AED-C3E9-4891-8FB8-E7778CB5A9B5}" + } + } + } + }, + { + "Key": { + "id": 246128197275796 + }, + "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": [ + 2840.0, + 2580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{039ADCFA-B370-4150-96A0-D404A8784B5A}" + } + } + } + }, + { + "Key": { + "id": 246132492243092 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -160.0, + -100.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{E129EEFF-892C-4C5A-86F2-DB349E0BEB1E}" + } + } + } + }, + { + "Key": { + "id": 246136787210388 + }, + "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": [ + 860.0, + 2580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{181C9959-F9CE-4E83-A28F-34A6122A5FBD}" + } + } + } + }, + { + "Key": { + "id": 246141082177684 + }, + "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": [ + 1540.0, + 1200.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{1F571FC4-D31A-45B9-912B-553620D3BD9D}" + } + } + } + }, + { + "Key": { + "id": 246145377144980 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2040.0, + 2580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{92D9C6D1-1261-4404-8F47-B372687FAC49}" + } + } + } + }, + { + "Key": { + "id": 246149672112276 + }, + "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": [ + 6520.0, + 2280.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{86F8827F-9F3C-4A93-89E2-F120EB7DD2AC}" + } + } + } + }, + { + "Key": { + "id": 246153967079572 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1080.0, + 1740.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{070D096C-3906-46C6-9004-AB47CC3CA321}" + } + } + } + }, + { + "Key": { + "id": 246158262046868 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2420.0, + 1200.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A11A84D2-7BF6-4FE1-8C29-E7178CA9AF50}" + } + } + } + }, + { + "Key": { + "id": 246162557014164 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "SetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 440.0, + 360.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".setVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5B946F71-A93B-438E-A7B0-27CE24D672B0}" + } + } + } + }, + { + "Key": { + "id": 246166851981460 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 3440.0, + 1120.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{E9D6CBC8-A0AF-48AF-9432-644B01BD8E87}" + } + } + } + }, + { + "Key": { + "id": 246171146948756 + }, + "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": [ + 5740.0, + 2280.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{96C3A2DA-6948-4773-BBF7-E72690F95D27}" + } + } + } + }, + { + "Key": { + "id": 246175441916052 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 500.0, + 1760.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".getVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C91F684B-BDF4-45B6-8A21-BE01BD0B57E6}" + } + } + } + }, + { + "Key": { + "id": 246179736883348 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -600.0, + 140.0 + ] + }, + "{9E81C95F-89C0-4476-8E82-63CCC4E52E04}": { + "$type": "EBusHandlerNodeDescriptorSaveData", + "EventIds": [ + { + "Value": 245425936 + } + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{ED62B820-56F3-4907-8297-93FACF11D6C7}" + } + } + } + }, + { + "Key": { + "id": 246184031850644 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1640.0, + 2620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{CA7C06D5-1C74-4682-8475-77B4590D1068}" + } + } + } + }, + { + "Key": { + "id": 246188326817940 + }, + "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": [ + 420.0, + 2580.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{40F91617-FB9A-44B0-AB46-7BC49BFA9695}" + } + } + } + }, + { + "Key": { + "id": 246192621785236 + }, + "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": [ + 860.0, + 340.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{25B84E08-7E28-49F4-8D3F-2D5436AD4A59}" + } + } + } + }, + { + "Key": { + "id": 3794495145504990811 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.41824002620728956, + "AnchorX": 1786.0557861328125, + "AnchorY": 686.2088623046875 + } + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 1244476766431948410, + "Value": 1 + }, + { + "Key": 5842116761103598202, + "Value": 1 + }, + { + "Key": 5842117451819972883, + "Value": 1 + }, + { + "Key": 5933558821430063196, + "Value": 1 + }, + { + "Key": 7413323401356093379, + "Value": 2 + }, + { + "Key": 8023800818767041160, + "Value": 2 + }, + { + "Key": 8443300848607535552, + "Value": 1 + }, + { + "Key": 10242161751377247902, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 12812762535860395237, + "Value": 1 + }, + { + "Key": 13501032720093015244, + "Value": 2 + }, + { + "Key": 13774516225767375488, + "Value": 1 + }, + { + "Key": 13774516226110902316, + "Value": 1 + }, + { + "Key": 13774516341676861545, + "Value": 2 + }, + { + "Key": 13774516555191045853, + "Value": 2 + }, + { + "Key": 13774516556399355685, + "Value": 1 + }, + { + "Key": 14285852892804039565, + "Value": 2 + }, + { + "Key": 14759916521179134347, + "Value": 1 + }, + { + "Key": 18182167487771916815, + "Value": 3 + } + ] + } + }, + "Component_[9726965826837406164]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 9726965826837406164, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{5EB17E58-0B4E-451D-A1CE-0E7C272CBDEC}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{5EB17E58-0B4E-451D-A1CE-0E7C272CBDEC}" + }, + "VariableName": "MoveY" + } + }, + { + "Key": { + "m_id": "{B48E5726-A7FF-42A8-84D2-CF43ABBD1EDC}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{B48E5726-A7FF-42A8-84D2-CF43ABBD1EDC}" + }, + "VariableName": "MoveX" + } + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.animgraph b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.animgraph new file mode 100644 index 0000000000..c8633beba2 --- /dev/null +++ b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.animgraph @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6476e88fb2bcda44f7ef57d87f2ff7f4d6e3a30f677ad1b7b235c43b3858aa7f +size 39099 diff --git a/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.ly b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.ly new file mode 100644 index 0000000000..592531e632 --- /dev/null +++ b/Gems/MotionMatching/Assets/Levels/MotionMatching_AutomaticDemo/MotionMatching_AutomaticDemo.ly @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:065170c8b2dca1e481b70ed648fc149767e795b0794b6b4b0af3f79054a2f93c +size 11797 diff --git a/Gems/MotionMatching/Assets/MotionMatching.animgraph b/Gems/MotionMatching/Assets/MotionMatching.animgraph index 10707eb6c4..e5656a3d05 100644 --- a/Gems/MotionMatching/Assets/MotionMatching.animgraph +++ b/Gems/MotionMatching/Assets/MotionMatching.animgraph @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09cc2374b99c219421812ec39b68a350912d44777a50e3078c8cd67e91cc74cf -size 30927 +oid sha256:f974fa29f3542311ee6a4b6fbb92047186c3124b3bd6f88b728646bf9d686c45 +size 39099 diff --git a/Gems/MotionMatching/Assets/MotionMatching.motionset b/Gems/MotionMatching/Assets/MotionMatching.motionset index 276895e3a0..f3f0510e6d 100644 --- a/Gems/MotionMatching/Assets/MotionMatching.motionset +++ b/Gems/MotionMatching/Assets/MotionMatching.motionset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c895a1696f5f37492089ceaef11210d704c1fb7e3dd31305cf4732d63489507 -size 13645 +oid sha256:35bb5b196bc07687004aed1ddff7e3b922f8abe82b0e6b25c88854d9032c6f06 +size 13482 diff --git a/Gems/MotionMatching/preview.png b/Gems/MotionMatching/preview.png index 2979dbb6a4..b3b6192ad5 100644 --- a/Gems/MotionMatching/preview.png +++ b/Gems/MotionMatching/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:de0e6e480ece5b423222f4feacf56553d73713fe9afea8bbc9a2660a3cd54ec7 -size 1232 +oid sha256:e0f8ffb4980f6cfc34135f4a4b9967293ff34bcdb37019181cb22c6a07067ce8 +size 57461 From 9081a0db903cffd8aa4c85a2cedf73b843feaf58 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 1 Feb 2022 09:51:22 -0800 Subject: [PATCH 379/394] use material included and remove unused decal material Signed-off-by: Scott Murray --- .../hydra_AtomEditorComponents_DecalAdded.py | 2 +- .../Materials/decal/scorch_01_decal.material | 35 ------------------- .../Materials/decal/scorch_01_decal.tif | 3 -- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 AutomatedTesting/Materials/decal/scorch_01_decal.material delete mode 100644 AutomatedTesting/Materials/decal/scorch_01_decal.tif diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py index 238a2e31cb..6136e1021b 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py @@ -147,7 +147,7 @@ def AtomEditorComponents_Decal_AddedToEntity(): Report.result(Tests.creation_redo, decal_entity.exists()) # 5. Set Material property on Decal component. - decal_material_asset_path = os.path.join("materials", "basic_grey.azmaterial") + decal_material_asset_path = os.path.join("Materials", "decal", "airship_symbol_decal.azmaterial") decal_material_asset = Asset.find_asset_by_path(decal_material_asset_path, False) decal_component.set_component_property_value(AtomComponentProperties.decal('Material'), decal_material_asset.id) get_material_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Material')) diff --git a/AutomatedTesting/Materials/decal/scorch_01_decal.material b/AutomatedTesting/Materials/decal/scorch_01_decal.material deleted file mode 100644 index 3f700d483a..0000000000 --- a/AutomatedTesting/Materials/decal/scorch_01_decal.material +++ /dev/null @@ -1,35 +0,0 @@ -{ - "materialType": "Materials/Types/StandardPBR.materialtype", - "materialTypeVersion": 4, - "properties": { - "baseColor": { - "textureMap": "Materials/decal/scorch_01_decal.tif" - }, - "general": { - "doubleSided": true - }, - "metallic": { - "useTexture": false - }, - "normal": { - "useTexture": false - }, - "opacity": { - "factor": 1.0, - "mode": "Blended", - "textureMap": "Materials/decal/scorch_01_decal.tif" - }, - "roughness": { - "useTexture": false - }, - "specularF0": { - "useTexture": false - }, - "uv": { - "center": [ - 0.0, - 1.0 - ] - } - } -} \ No newline at end of file diff --git a/AutomatedTesting/Materials/decal/scorch_01_decal.tif b/AutomatedTesting/Materials/decal/scorch_01_decal.tif deleted file mode 100644 index 935388bd93..0000000000 --- a/AutomatedTesting/Materials/decal/scorch_01_decal.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:889072da11d2034a0d37ec6ae81b551a61b62d6d602965b0b919a999c56d67e2 -size 16793812 From 157149928b3d10c1f6e12cf31467ce67d6942902 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 1 Feb 2022 11:24:51 -0800 Subject: [PATCH 380/394] lower casing materials in path to avoid Linux casing issues Signed-off-by: Scott Murray --- .../Atom/tests/hydra_AtomEditorComponents_DecalAdded.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py index 6136e1021b..cb43382e14 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_DecalAdded.py @@ -147,7 +147,7 @@ def AtomEditorComponents_Decal_AddedToEntity(): Report.result(Tests.creation_redo, decal_entity.exists()) # 5. Set Material property on Decal component. - decal_material_asset_path = os.path.join("Materials", "decal", "airship_symbol_decal.azmaterial") + decal_material_asset_path = os.path.join("materials", "decal", "airship_symbol_decal.azmaterial") decal_material_asset = Asset.find_asset_by_path(decal_material_asset_path, False) decal_component.set_component_property_value(AtomComponentProperties.decal('Material'), decal_material_asset.id) get_material_property = decal_component.get_component_property_value(AtomComponentProperties.decal('Material')) From ca0006f57090f2fa203ecceed59c12926ef98ef6 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Tue, 1 Feb 2022 13:32:49 -0600 Subject: [PATCH 381/394] Minor changes and comments after PR feedback Signed-off-by: Guthrie Adams --- .../Code/Source/Document/MaterialDocument.cpp | 15 ++++++++++++++- .../Document/ShaderManagementConsoleDocument.cpp | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index f25400721e..283b7a8a7f 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -165,6 +165,8 @@ namespace MaterialEditor { if (!AtomToolsDocument::Save()) { + // SaveFailed has already been called so just forward the result without additional notifications. + // TODO Replace bool return value with enum for open and save states. return false; } @@ -198,6 +200,8 @@ namespace MaterialEditor { if (!AtomToolsDocument::SaveAsCopy(savePath)) { + // SaveFailed has already been called so just forward the result without additional notifications. + // TODO Replace bool return value with enum for open and save states. return false; } @@ -228,6 +232,8 @@ namespace MaterialEditor { if (!AtomToolsDocument::SaveAsChild(savePath)) { + // SaveFailed has already been called so just forward the result without additional notifications. + // TODO Replace bool return value with enum for open and save states. return false; } @@ -363,11 +369,18 @@ namespace MaterialEditor return true; }); - if (!addPropertiesResult || !AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) + if (!addPropertiesResult) + { + AZ_Error("MaterialDocument", false, "Document properties could not be saved: '%s'.", m_savePathNormalized.c_str()); + return false; + } + + if (!AZ::RPI::JsonUtils::SaveObjectToFile(m_savePathNormalized, sourceData)) { AZ_Error("MaterialDocument", false, "Document could not be saved: '%s'.", m_savePathNormalized.c_str()); return false; } + return true; } diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp index be5adfe4bf..99a3aea347 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.cpp @@ -107,6 +107,8 @@ namespace ShaderManagementConsole { if (!AtomToolsDocument::Save()) { + // SaveFailed has already been called so just forward the result without additional notifications. + // TODO Replace bool return value with enum for open and save states. return false; } @@ -117,6 +119,8 @@ namespace ShaderManagementConsole { if (!AtomToolsDocument::SaveAsCopy(savePath)) { + // SaveFailed has already been called so just forward the result without additional notifications. + // TODO Replace bool return value with enum for open and save states. return false; } @@ -127,6 +131,8 @@ namespace ShaderManagementConsole { if (!AtomToolsDocument::SaveAsChild(savePath)) { + // SaveFailed has already been called so just forward the result without additional notifications. + // TODO Replace bool return value with enum for open and save states. return false; } From 3441c026377bc2d5d9a7b5c0bcde21a458a15983 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 1 Feb 2022 11:42:50 -0800 Subject: [PATCH 382/394] Minor cleanup of some shader option related unit tests. Added new utility functions for easily creating the value set for a ShaderOptionDescriptor. Made ShaderOptionDescriptor default value optional, picking the first available value as the default ... by default. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Shader/ShaderOptionGroupLayout.h | 14 ++++++-- .../RPI.Reflect/Shader/ShaderOptionTypes.h | 1 + .../Shader/ShaderOptionGroupLayout.cpp | 36 ++++++++++++++++++- .../Material/LuaMaterialFunctorTests.cpp | 15 ++------ .../Tests/Material/MaterialFunctorTests.cpp | 5 +-- .../RPI/Code/Tests/Material/MaterialTests.cpp | 15 ++------ .../Tests/Material/MaterialTypeAssetTests.cpp | 19 +++------- .../Material/MaterialTypeSourceDataTests.cpp | 19 +++------- .../RPI/Code/Tests/Shader/ShaderTests.cpp | 22 ++++++------ 9 files changed, 74 insertions(+), 72 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionGroupLayout.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionGroupLayout.h index 396b6d50f0..27c8fff001 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionGroupLayout.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionGroupLayout.h @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -44,6 +45,12 @@ namespace AZ bool m_bakeEmptyAsDefault = false; }; + //! Creates a list of shader option values that can be used to construct a ShaderOptionDescriptor. + ShaderOptionValues CreateEnumShaderOptionValues(AZStd::span enumNames); + ShaderOptionValues CreateEnumShaderOptionValues(AZStd::initializer_list enumNames); + ShaderOptionValues CreateBoolShaderOptionValues(); + ShaderOptionValues CreateIntRangeShaderOptionValues(uint32_t min, uint32_t max); + //! Describes a shader option to the ShaderOptionGroupLayout class. Maps a shader option //! to a set of bits in a mask in order to facilitate packing values into a mask to //! form a ShaderKey. @@ -62,15 +69,16 @@ namespace AZ //! @param optionType Type hint for the option - bool, enum, integer range, etc. //! @param bitOffset Bit offset must match the ShaderOptionGroupLayout where this Option will be added //! @param order The order (rank) of the shader option. Must be unique within a group. Lower order is higher priority. - //! @param nameIndexList List of valid (valueName, value) pairs for this Option + //! @param nameIndexList List of valid (valueName, value) pairs for this Option. See "Create*ShaderOptionValues" utility functions above. //! @param defaultValue Default value name, which must also be in the nameIndexList. In the cases where the list //! defines a range (IntegerRange for instance) defaultValue must be within the range instead. + //! If omitted, the first entry in @nameIndexList will be used. ShaderOptionDescriptor(const Name& name, const ShaderOptionType& optionType, uint32_t bitOffset, uint32_t order, - const AZStd::vector& nameIndexList, - const Name& defaultValue); + const ShaderOptionValues& nameIndexList, + const Name& defaultValue = {}); AZ_DEFAULT_COPY_MOVE(ShaderOptionDescriptor); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionTypes.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionTypes.h index e8be930a22..427f70890c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionTypes.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderOptionTypes.h @@ -18,6 +18,7 @@ namespace AZ using ShaderOptionIndex = RHI::Handle; //!< ShaderOption index in the group layout using ShaderOptionValue = RHI::Handle; //!< Numerical representation for a single value in the ShaderOption using ShaderOptionValuePair = AZStd::pair; //!< Provides a string representation for a ShaderOptionValue + using ShaderOptionValues = AZStd::vector; //!< List of possible values for a shader option enum class ShaderOptionType : uint32_t { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderOptionGroupLayout.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderOptionGroupLayout.cpp index 7e9f62e560..17f5faec98 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderOptionGroupLayout.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderOptionGroupLayout.cpp @@ -35,6 +35,35 @@ namespace AZ default: return ""; } } + + ShaderOptionValues CreateEnumShaderOptionValues(AZStd::span enumNames) + { + ShaderOptionValues values; + values.reserve(enumNames.size()); + for (size_t i = 0; i < enumNames.size(); ++i) + { + values.emplace_back(Name{enumNames[i]}, i); + } + return values; + } + + ShaderOptionValues CreateEnumShaderOptionValues(AZStd::initializer_list enumNames) + { + return CreateEnumShaderOptionValues(AZStd::span(enumNames.begin(), enumNames.end())); + } + + ShaderOptionValues CreateBoolShaderOptionValues() + { + return CreateEnumShaderOptionValues({"False", "True"}); + } + + ShaderOptionValues CreateIntRangeShaderOptionValues(uint32_t min, uint32_t max) + { + AZStd::vector intOptionRange; + intOptionRange.push_back({Name{AZStd::string::format("%u", min)}, RPI::ShaderOptionValue{min}}); + intOptionRange.push_back({Name{AZStd::string::format("%u", max)}, RPI::ShaderOptionValue{max}}); + return intOptionRange; + } void ShaderOptionGroupHints::Reflect(ReflectContext* context) { @@ -90,7 +119,7 @@ namespace AZ const ShaderOptionType& optionType, uint32_t bitOffset, uint32_t order, - const AZStd::vector& nameIndexList, + const ShaderOptionValues& nameIndexList, const Name& defaultValue) : m_name{name} @@ -102,6 +131,11 @@ namespace AZ for (auto pair : nameIndexList) { // Registers the pair in the lookup table AddValue(pair.first, pair.second); + + if (m_defaultValue.IsEmpty()) + { + m_defaultValue = pair.first; + } } uint32_t numValues = (m_type == ShaderOptionType::IntegerRange) ? (m_maxValue.GetIndex() - m_minValue.GetIndex() + 1) : (uint32_t) nameIndexList.size(); diff --git a/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp index 5016f8303e..15f66916a6 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp @@ -70,18 +70,9 @@ namespace UnitTest AZ::RPI::Ptr CreateCommonTestShaderOptionsLayout() { - AZStd::vector boolOptionValues; - boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); - boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); - - AZStd::vector intRangeOptionValues; - intRangeOptionValues.push_back({Name("0"), RPI::ShaderOptionValue(0)}); - intRangeOptionValues.push_back({Name("15"), RPI::ShaderOptionValue(15)}); - - AZStd::vector qualityOptionValues; - qualityOptionValues.push_back({Name("Quality::Low"), RPI::ShaderOptionValue(0)}); - qualityOptionValues.push_back({Name("Quality::Medium"), RPI::ShaderOptionValue(1)}); - qualityOptionValues.push_back({Name("Quality::High"), RPI::ShaderOptionValue(2)}); + AZStd::vector boolOptionValues = CreateBoolShaderOptionValues(); + AZStd::vector intRangeOptionValues = CreateIntRangeShaderOptionValues(0, 15); + AZStd::vector qualityOptionValues = CreateEnumShaderOptionValues({"Quality::Low", "Quality::Medium", "Quality::High"}); AZ::RPI::Ptr shaderOptions = RPI::ShaderOptionGroupLayout::Create(); shaderOptions->AddShaderOption(ShaderOptionDescriptor{Name{"o_bool"}, ShaderOptionType::Boolean, 0, 0, boolOptionValues, Name{"False"}}); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp index 3373646c6e..08049f3393 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp @@ -127,9 +127,7 @@ namespace UnitTest { using namespace AZ::RPI; - AZStd::vector boolOptionValues; - boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); - boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); + AZStd::vector boolOptionValues = CreateBoolShaderOptionValues(); AZ::RPI::Ptr shaderOptions = RPI::ShaderOptionGroupLayout::Create(); shaderOptions->AddShaderOption(ShaderOptionDescriptor{Name{"o_optionA"}, ShaderOptionType::Boolean, 0, 0, boolOptionValues, Name{"False"}}); @@ -138,7 +136,6 @@ namespace UnitTest shaderOptions->Finalize(); Data::Asset materialTypeAsset; - //Data::Asset materialAsset; // Note we don't actually need any properties or functors in the material type. We just need to set up some sample data // structures that we can pass to the functors below, especially the shader with shader options. diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp index 569f8f6df0..02b78d5fd2 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp @@ -389,18 +389,9 @@ namespace UnitTest Ptr CreateTestOptionsLayout() { - AZStd::vector enumOptionValues; - enumOptionValues.push_back({Name("Low"), RPI::ShaderOptionValue(0)}); - enumOptionValues.push_back({Name("Med"), RPI::ShaderOptionValue(1)}); - enumOptionValues.push_back({Name("High"), RPI::ShaderOptionValue(2)}); - - AZStd::vector boolOptionValues; - boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); - boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); - - AZStd::vector rangeOptionValues; - rangeOptionValues.push_back({Name("1"), RPI::ShaderOptionValue(1)}); - rangeOptionValues.push_back({Name("10"), RPI::ShaderOptionValue(10)}); + AZStd::vector enumOptionValues = CreateEnumShaderOptionValues({"Low", "Med", "High"}); + AZStd::vector boolOptionValues = CreateBoolShaderOptionValues(); + AZStd::vector rangeOptionValues = CreateIntRangeShaderOptionValues(1, 10); Ptr shaderOptions = ShaderOptionGroupLayout::Create(); uint32_t order = 0; diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp index 382ab4e149..0fbbcf76c3 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeAssetTests.cpp @@ -103,18 +103,9 @@ namespace UnitTest m_testMaterialSrgLayout = CreateCommonTestMaterialSrgLayout(); - AZStd::vector boolOptionValues; - boolOptionValues.push_back({Name{"False"}, RPI::ShaderOptionValue{0}}); - boolOptionValues.push_back({Name{"True"}, RPI::ShaderOptionValue{1}}); - - AZStd::vector enumOptionValues; - enumOptionValues.push_back({Name{"Low"}, RPI::ShaderOptionValue{0}}); - enumOptionValues.push_back({Name{"Med"}, RPI::ShaderOptionValue{1}}); - enumOptionValues.push_back({Name{"High"}, RPI::ShaderOptionValue{2}}); - - AZStd::vector intOptionRange; - intOptionRange.push_back({Name{"0"}, RPI::ShaderOptionValue{0}}); - intOptionRange.push_back({Name{"8"}, RPI::ShaderOptionValue{8}}); + AZStd::vector boolOptionValues = CreateBoolShaderOptionValues(); + AZStd::vector enumOptionValues = CreateEnumShaderOptionValues({"Low", "Med", "High"}); + AZStd::vector intOptionRange = CreateIntRangeShaderOptionValues(0, 8); m_testShaderOptionsLayout = ShaderOptionGroupLayout::Create(); uint32_t order = 0; @@ -977,9 +968,7 @@ namespace UnitTest { // Create shaders... - AZStd::vector boolOptionValues; - boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); - boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); + AZStd::vector boolOptionValues = CreateBoolShaderOptionValues(); Ptr optionsForShaderA = ShaderOptionGroupLayout::Create(); optionsForShaderA->AddShaderOption(ShaderOptionDescriptor{Name{"o_globalOption_inBothShaders"}, ShaderOptionType::Boolean, 0, 0, boolOptionValues, Name{"False"}}); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp index 206073e96a..948a56f557 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTypeSourceDataTests.cpp @@ -289,10 +289,7 @@ namespace UnitTest m_testMaterialSrgLayout->AddShaderInput(RHI::ShaderInputImageDescriptor{ Name{ "m_image" }, RHI::ShaderInputImageAccess::Read, RHI::ShaderInputImageType::Image2D, 1, 1 }); EXPECT_TRUE(m_testMaterialSrgLayout->Finalize()); - AZStd::vector optionValues; - optionValues.push_back({Name("Low"), RPI::ShaderOptionValue(0)}); - optionValues.push_back({Name("Med"), RPI::ShaderOptionValue(1)}); - optionValues.push_back({Name("High"), RPI::ShaderOptionValue(2)}); + AZStd::vector optionValues = CreateEnumShaderOptionValues({"Low", "Med", "High"}); Ptr shaderOptions = ShaderOptionGroupLayout::Create(); uint32_t order = 0; @@ -703,10 +700,7 @@ namespace UnitTest { // Set up the shaders... - AZStd::vector optionValues; - optionValues.push_back({Name("Low"), RPI::ShaderOptionValue(0)}); - optionValues.push_back({Name("Med"), RPI::ShaderOptionValue(1)}); - optionValues.push_back({Name("High"), RPI::ShaderOptionValue(2)}); + AZStd::vector optionValues = CreateEnumShaderOptionValues({"Low", "Med", "High"}); Ptr shaderOptions = ShaderOptionGroupLayout::Create(); uint32_t order = 0; @@ -1072,10 +1066,7 @@ namespace UnitTest { // Setup the shader... - AZStd::vector optionValues; - optionValues.push_back({ Name("Low"), RPI::ShaderOptionValue(0) }); - optionValues.push_back({ Name("Med"), RPI::ShaderOptionValue(1) }); - optionValues.push_back({ Name("High"), RPI::ShaderOptionValue(2) }); + AZStd::vector optionValues = CreateEnumShaderOptionValues({"Low", "Med", "High"}); uint32_t order = 0; @@ -1402,9 +1393,7 @@ namespace UnitTest layeredMaterialSrgLayout->AddShaderInput(RHI::ShaderInputConstantDescriptor{ Name{ "m_blendFactor" }, 4, 4, 0 }); layeredMaterialSrgLayout->Finalize(); - AZStd::vector boolOptionValues; - boolOptionValues.push_back({Name("False"), RPI::ShaderOptionValue(0)}); - boolOptionValues.push_back({Name("True"), RPI::ShaderOptionValue(1)}); + AZStd::vector boolOptionValues = CreateBoolShaderOptionValues(); Ptr shaderOptionsLayout = ShaderOptionGroupLayout::Create(); uint32_t order = 0; shaderOptionsLayout->AddShaderOption(ShaderOptionDescriptor{Name{"o_layer2_clearCoat_enable"}, ShaderOptionType::Boolean, 0, order++, boolOptionValues, Name{"False"}}); diff --git a/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp b/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp index b30fd0ec94..4fc5f74f3b 100644 --- a/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Shader/ShaderTests.cpp @@ -793,16 +793,6 @@ namespace UnitTest EXPECT_FALSE(success); errorMessageFinder.CheckExpectedErrorsFound(); - // Add shader option with an empty default value. - errorMessageFinder.Reset(); - errorMessageFinder.AddExpectedErrorMessage("invalid default value"); - AZStd::vector list5; - list5.push_back({ Name("0"), RPI::ShaderOptionValue(0) }); // 1+ bit - list5.push_back({ Name("1"), RPI::ShaderOptionValue(1) }); // ... - success = shaderOptionGroupLayout->AddShaderOption(AZ::RPI::ShaderOptionDescriptor{ Name{"Invalid"}, intRangeType, 16, order++, list5, Name() }); - EXPECT_FALSE(success); - errorMessageFinder.CheckExpectedErrorsFound(); - // Add shader option with an invalid default int value. errorMessageFinder.Reset(); errorMessageFinder.AddExpectedErrorMessage("invalid default value"); @@ -886,6 +876,18 @@ namespace UnitTest EXPECT_FALSE(shaderOptionGroupLayout->FindShaderOptionIndex(Name{ "Invalid" }).IsValid()); } + + TEST_F(ShaderTests, ImplicitDefaultValue) + { + // Add shader option with no default value. + + RPI::Ptr shaderOptionGroupLayout = RPI::ShaderOptionGroupLayout::Create(); + + AZStd::vector values = AZ::RPI::CreateEnumShaderOptionValues({"A", "B", "C"}); + bool success = shaderOptionGroupLayout->AddShaderOption(AZ::RPI::ShaderOptionDescriptor{ Name{"NoDefaultSpecified"}, RPI::ShaderOptionType::Enumeration, 0, 0, values }); + EXPECT_TRUE(success); + EXPECT_STREQ("A", shaderOptionGroupLayout->GetShaderOptions().back().GetDefaultValue().GetCStr()); + } TEST_F(ShaderTests, ShaderOptionGroupTest) { From 670d22cb5b32404fd95cfd446e8a976661f64de5 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Tue, 1 Feb 2022 15:34:20 -0600 Subject: [PATCH 383/394] Added notifications after re opening a document Signed-off-by: Guthrie Adams --- .../Code/Source/Document/AtomToolsDocument.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp index 1daf578679..84638eefc4 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocument.cpp @@ -102,6 +102,10 @@ namespace AtomToolsFramework return false; } + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentModified, m_id); + AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentUndoStateChanged, m_id); return true; } From fd20b028a6e077f6c4ec2df06b5c803d94ba345f Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Tue, 1 Feb 2022 13:37:47 -0800 Subject: [PATCH 384/394] Deprecate IsPrefabSystemForLevelsEnabled and use IsPrefabSystemEnabled everywhere (#7327) Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- Code/Editor/Core/LevelEditorMenuHandler.cpp | 2 +- Code/Editor/CryEdit.cpp | 14 +++++++------- Code/Editor/CryEditDoc.cpp | 8 ++++---- Code/Editor/GameEngine.cpp | 2 +- Code/Editor/GameExporter.cpp | 2 +- Code/Editor/GameExporter.h | 2 +- Code/Editor/MainWindow.cpp | 2 +- .../AzFramework/AzFramework/API/ApplicationAPI.h | 1 + .../AzFramework/Application/Application.cpp | 1 + .../AzFramework/AzFramework/Archive/Archive.cpp | 4 ++-- .../AssetBundle/AssetBundleComponent.cpp | 2 +- Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp | 6 +++--- Code/Legacy/CrySystem/SystemInit.cpp | 2 +- .../Include/GameStateSamples/GameStateMainMenu.inl | 2 +- .../Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp | 2 +- .../LevelBuilder/LevelBuilderComponent.cpp | 2 +- 16 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 05f06c87aa..d359d9ef5d 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -588,7 +588,7 @@ QMenu* LevelEditorMenuHandler::CreateGameMenu() bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { // Export to Engine diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 480a973282..f3c38fdef7 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -706,7 +706,7 @@ void CCryEditApp::OnFileSave() bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { @@ -2364,7 +2364,7 @@ void CCryEditApp::ExportLevel(bool bExportToGame, bool bExportTexture, bool bAut { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { AZ_Assert(false, "Prefab system doesn't require level exports."); @@ -2405,7 +2405,7 @@ bool CCryEditApp::UserExportToGame(bool bNoMsgBox) { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { AZ_Assert(false, "Export Level should no longer exist."); @@ -2453,7 +2453,7 @@ void CCryEditApp::ExportToGame(bool bNoMsgBox) { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { AZ_Assert(false, "Prefab system no longer exports levels."); @@ -2961,7 +2961,7 @@ CCryEditApp::ECreateLevelResult CCryEditApp::CreateLevel(const QString& levelNam { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); // If we are creating a new level and we're in simulate mode, then switch it off before we do anything else if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode()) @@ -3107,7 +3107,7 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled) { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName()); @@ -3321,7 +3321,7 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* filename, bool addToMostR bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); // If we are loading and we're in simulate mode, then switch it off before we do anything else if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode()) diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index c7d719184d..cabb82db89 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -371,7 +371,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { @@ -636,7 +636,7 @@ bool CCryEditDoc::SaveModified() bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { QMessageBox saveModifiedMessageBox(AzToolsFramework::GetActiveWindow()); @@ -699,7 +699,7 @@ void CCryEditDoc::OnFileSaveAs() CCryEditApp::instance()->AddToRecentFileList(levelFileDialog.GetFileName()); bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = @@ -728,7 +728,7 @@ bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContex bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index 8aab168b6d..200c48ab81 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -489,7 +489,7 @@ bool CGameEngine::LoadLevel( bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { diff --git a/Code/Editor/GameExporter.cpp b/Code/Editor/GameExporter.cpp index 635281aee5..32429f7f0b 100644 --- a/Code/Editor/GameExporter.cpp +++ b/Code/Editor/GameExporter.cpp @@ -100,7 +100,7 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { diff --git a/Code/Editor/GameExporter.h b/Code/Editor/GameExporter.h index ee4e8df3d9..1ecd2403f2 100644 --- a/Code/Editor/GameExporter.h +++ b/Code/Editor/GameExporter.h @@ -70,7 +70,7 @@ private: { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { AZ_Assert(false, "Level.pak should no longer be used when prefabs are used for levels."); diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index 3a52bb85a1..a1f054b57f 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -659,7 +659,7 @@ void MainWindow::InitActions() bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (!usePrefabSystemForLevels) { am->AddAction(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, tr("&Export to Engine")) diff --git a/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h b/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h index e536082d61..c7a9256c9c 100644 --- a/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h +++ b/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h @@ -112,6 +112,7 @@ namespace AzFramework virtual void SetPrefabSystemEnabled([[maybe_unused]] bool enable) {} /// Returns true if Prefab System is enabled for use with levels, false if legacy level system is enabled (level.pak) + /// @deprecated Use 'IsPrefabSystemEnabled' instead virtual bool IsPrefabSystemForLevelsEnabled() const { return false; } /// Returns true if code should assert when the Legacy Slice System is used diff --git a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp index b3521a877f..b3fed38715 100644 --- a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp +++ b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp @@ -765,6 +765,7 @@ namespace AzFramework bool Application::IsPrefabSystemForLevelsEnabled() const { + AZ_Warning("Application", false, "'IsPrefabSystemForLevelsEnabled' is deprecated, please use 'IsPrefabSystemEnabled' instead."); return IsPrefabSystemEnabled(); } diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index c2fba5c5a3..6f0f3e6d13 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -1208,7 +1208,7 @@ namespace AZ::IO bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { @@ -1274,7 +1274,7 @@ namespace AZ::IO bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); AZStd::unique_lock lock(m_csZips); for (auto it = m_arrZips.begin(); it != m_arrZips.end();) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBundle/AssetBundleComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBundle/AssetBundleComponent.cpp index 6647f48c31..9b3a6379af 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBundle/AssetBundleComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBundle/AssetBundleComponent.cpp @@ -295,7 +295,7 @@ namespace AzToolsFramework bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); for (const AzToolsFramework::AssetFileInfo& assetFileInfo : assetFileInfoList.m_fileInfoList) { diff --git a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp index 0b90e73bc0..bd788fdd73 100644 --- a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp @@ -41,7 +41,7 @@ bool CLevelInfo::OpenLevelPak() { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); // The prefab system doesn't use level.pak if (usePrefabSystemForLevels) @@ -62,7 +62,7 @@ void CLevelInfo::CloseLevelPak() { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); // The prefab system doesn't use level.pak if (usePrefabSystemForLevels) @@ -82,7 +82,7 @@ bool CLevelInfo::ReadInfo() { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); // Set up a default game type for legacy code. m_defaultGameTypeName = "mission0"; diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 600a799bc1..cad914e29d 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -1046,7 +1046,7 @@ AZ_POP_DISABLE_WARNING // LEVEL SYSTEM bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { diff --git a/Gems/GameStateSamples/Code/Include/GameStateSamples/GameStateMainMenu.inl b/Gems/GameStateSamples/Code/Include/GameStateSamples/GameStateMainMenu.inl index 98147756f4..9f61c32175 100644 --- a/Gems/GameStateSamples/Code/Include/GameStateSamples/GameStateMainMenu.inl +++ b/Gems/GameStateSamples/Code/Include/GameStateSamples/GameStateMainMenu.inl @@ -277,7 +277,7 @@ namespace GameStateSamples bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp index ecc97682de..e92d93798d 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp @@ -267,7 +267,7 @@ namespace ImGui bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); if (usePrefabSystemForLevels) { diff --git a/Gems/LmbrCentral/Code/Source/Builders/LevelBuilder/LevelBuilderComponent.cpp b/Gems/LmbrCentral/Code/Source/Builders/LevelBuilder/LevelBuilderComponent.cpp index 7e6fc54830..880a994f5a 100644 --- a/Gems/LmbrCentral/Code/Source/Builders/LevelBuilder/LevelBuilderComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Builders/LevelBuilder/LevelBuilderComponent.cpp @@ -17,7 +17,7 @@ namespace LevelBuilder { bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( - usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); + usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); // No need to build level.pak files when using the prefab system. if (usePrefabSystemForLevels) From 5b9bc3b479fe248bd1aa8713814b408e917d11ed Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Tue, 1 Feb 2022 16:08:10 -0800 Subject: [PATCH 385/394] address PR feedback Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Assets/Materials/Types/BasePBR_ForwardPass.azsl | 1 - .../ShaderLib/Atom/Features/PBR/LightingOptions.azsli | 8 ++++++++ .../Atom/Features/PBR/Surfaces/StandardSurface.azsli | 4 ---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl index be0fcd7250..96318f2284 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/BasePBR_ForwardPass.azsl @@ -180,7 +180,6 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace) } -[earlydepthstencil] ForwardPassOutput BasePbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : SV_IsFrontFace) { ForwardPassOutput OUT; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli index 35d9bced0d..9febc6a9f7 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/LightingOptions.azsli @@ -8,6 +8,14 @@ #pragma once +// --- Note: About this file --- +// This file uses #defines to completely strip out certain lighting features from shaders +// This enables us to avoid code duplication and write an uber-esque shader code and then +// be able to adjust the code for different use cases (for example basic materials can strip +// away transimission related code used for foliage). These are different from shader options +// in that shader options allow more user flexibility to adjust materials at runtime, whereas +// these #define options are for customizing and optimizing material types (like BasePBR) + // --- Light Defines --- #ifndef ENABLE_AREA_LIGHT_VALIDATION diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli index 34d05ecb05..cf4edba923 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli @@ -20,10 +20,6 @@ class Surface ClearCoatSurfaceData clearCoat; #endif -#if ENABLE_TRANSMISSION - TransmissionSurfaceData transmission; // This is not actually used for Standard PBR, but must be present for common lighting code to compile -#endif - // ------- BasePbrSurfaceData ------- precise float3 position; //!< Position in world-space From 743ade176541e36595d16dc657c99acd7c86d11c Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Wed, 2 Feb 2022 00:23:55 -0700 Subject: [PATCH 386/394] Add "Definitions" field to shader asset Shaders can now specify a top-level field "Definitions" which accepts an array of string values. Each string will be appended to the set of preprocessor definitions defined globally and forwarded to the MCPP preprocessor on shader build. The shader-reload soak test was modified to accept a new shader to test this feature in the ASV. Signed-off-by: Jeremy Ong --- .../Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp | 2 +- .../Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp | 3 +++ .../RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h | 1 + Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp index eae4e804e0..7e510e2e3a 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp @@ -82,7 +82,7 @@ namespace AZ // Register Shader Asset Builder AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilderDescriptor; shaderAssetBuilderDescriptor.m_name = "Shader Asset Builder"; - shaderAssetBuilderDescriptor.m_version = 109; // Modify Metal shader platform to permit the precise keyword to fix depth bitwise mismatch between passes + shaderAssetBuilderDescriptor.m_version = 110; // Add "Definitions" field to shader asset to support convenient addition of preprocessor definitions shaderAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); shaderAssetBuilderDescriptor.m_busId = azrtti_typeid(); shaderAssetBuilderDescriptor.m_createJobFunction = AZStd::bind(&ShaderAssetBuilder::CreateJobs, &m_shaderAssetBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp index e431b74282..341f737bd6 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp @@ -413,6 +413,9 @@ namespace AZ // At this moment We have global build options that should be merged with the build options that are common // to all the supervariants of this shader. buildOptions.m_compilerArguments.Merge(shaderSourceData.m_compiler); + buildOptions.m_preprocessorSettings.m_predefinedMacros.insert( + buildOptions.m_preprocessorSettings.m_predefinedMacros.end(), + shaderSourceData.m_definitions.begin(), shaderSourceData.m_definitions.end()); for (RHI::ShaderPlatformInterface* shaderPlatformInterface : platformInterfaces) { diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h index 7742450bd6..a7d28eab14 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h @@ -57,6 +57,7 @@ namespace AZ }; AZStd::string m_source; + AZStd::vector m_definitions; RHI::ShaderCompilerArguments m_compiler; AZStd::string m_drawListName; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp index 20bd36784f..d0abd89af0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp @@ -21,13 +21,14 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(4) + ->Version(5) ->Field("Source", &ShaderSourceData::m_source) ->Field("DrawList", &ShaderSourceData::m_drawListName) ->Field("DepthStencilState", &ShaderSourceData::m_depthStencilState) ->Field("RasterState", &ShaderSourceData::m_rasterState) ->Field("BlendState", &ShaderSourceData::m_blendState) ->Field("ProgramSettings", &ShaderSourceData::m_programSettings) + ->Field("Definitions", &ShaderSourceData::m_definitions) ->Field("CompilerHints", &ShaderSourceData::m_compiler) ->Field("DisabledRHIBackends", &ShaderSourceData::m_disabledRhiBackends) ->Field("Supervariants", &ShaderSourceData::m_supervariants) From 50f34cf445d12c361ce11d343d0d8fe2298746bc Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 2 Feb 2022 00:45:54 -0800 Subject: [PATCH 387/394] Changed how pass system controls pipeline tick rate Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h | 3 +++ Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp | 11 ++++++++++- .../RPI/Code/Source/RPI.Public/RenderPipeline.cpp | 7 ++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h index a3b739ade7..de70726ce3 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h @@ -450,6 +450,9 @@ namespace AZ // Whether the pass should gather pipeline statics uint64_t m_pipelineStatisticsQueryEnabled : 1; + + // Whether the pass is the root pass for a pipeline. Used to control pipeline render tick rate + uint64_t m_isPipelineRoot : 1; }; uint64_t m_allFlags = 0; }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp index 9155c0351a..4b68094f9d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp @@ -1291,7 +1291,16 @@ namespace AZ AZ_PROFILE_SCOPE(RPI, "Pass::FrameBegin() - %s", m_path.GetCStr()); AZ_RPI_BREAK_ON_TARGET_PASS; - if (!IsEnabled()) + bool earlyOut = !IsEnabled(); + + // Skip if this pass is the root of the pipeline and the pipeline is set to not render + if (m_flags.m_isPipelineRoot) + { + AZ_RPI_PASS_ASSERT(m_pipeline != nullptr, "Pass is flagged as a pipeline root but it's pipeline pointer is invalid while trying to render"); + earlyOut = earlyOut || m_pipeline == nullptr || m_pipeline->GetRenderMode() == RenderPipeline::RenderMode::NoRender; + } + + if (earlyOut) { UpdateConnectedBindings(); return; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp index 062eaf02bd..b42d065017 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp @@ -103,6 +103,7 @@ namespace AZ pipeline->m_originalRenderSettings = desc.m_renderSettings; pipeline->m_activeRenderSettings = desc.m_renderSettings; pipeline->m_rootPass->SetRenderPipeline(pipeline); + pipeline->m_rootPass->m_flags.m_isPipelineRoot = true; pipeline->m_rootPass->ManualPipelineBuildAndInitialize(); } @@ -320,8 +321,7 @@ namespace AZ // Attempt to re-create hierarchy under root pass Ptr newRoot = m_rootPass->Recreate(); newRoot->SetRenderPipeline(this); - - // Manually build the pipeline + newRoot->m_flags.m_isPipelineRoot = true; newRoot->ManualPipelineBuildAndInitialize(); // Validate the new root @@ -482,20 +482,17 @@ namespace AZ void RenderPipeline::AddToRenderTickOnce() { - m_rootPass->SetEnabled(true); m_renderMode = RenderMode::RenderOnce; } void RenderPipeline::AddToRenderTick() { - m_rootPass->SetEnabled(true); m_renderMode = RenderMode::RenderEveryTick; } void RenderPipeline::RemoveFromRenderTick() { m_renderMode = RenderMode::NoRender; - m_rootPass->SetEnabled(false); } RenderPipeline::RenderMode RenderPipeline::GetRenderMode() const From 5e85e0e397ffcf32dc2634533d51020109bab840 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 2 Feb 2022 09:55:39 +0100 Subject: [PATCH 388/394] ImGui: Added FindContainerByName() helper (#7313) Added a helper function to find a container by name in the histogram container. Signed-off-by: Benjamin Jillich --- Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h | 2 ++ .../ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h b/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h index b3c7e0e7d8..e3c923d9d9 100644 --- a/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h +++ b/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h @@ -36,6 +36,8 @@ namespace ImGui::LYImGuiUtils void SetHistogramBinCount(int count) { m_histogramBinCount = count; } + ImGui::LYImGuiUtils::HistogramContainer* FindContainerByName(const char* name); + //! Needs to be public for l-value access for ImGui::MenuItem() bool m_show = true; diff --git a/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp b/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp index 62e8eb7b33..2534475712 100644 --- a/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp +++ b/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp @@ -77,6 +77,17 @@ namespace ImGui::LYImGuiUtils } } } + + ImGui::LYImGuiUtils::HistogramContainer* HistogramGroup::FindContainerByName(const char* name) + { + const auto iterator = m_histogramIndexByName.find(name); + if (iterator != m_histogramIndexByName.end()) + { + return &m_histograms[iterator->second]; + } + + return nullptr; + } } // namespace ImGui::LYImGuiUtils #endif // IMGUI_ENABLED From 584f9abf167e4ed80386f977bd8620e5914d10f1 Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Wed, 2 Feb 2022 08:52:53 -0800 Subject: [PATCH 389/394] Add new function to DynamicDrawInterface to support submiting cached DrawPacket (#7337) New function: void AddDrawPacket(Scene* scene, ConstPtr drawPacket) Deprecated function (still supported) : void AddDrawPacket(Scene* scene, AZStd::unique_ptr drawPacket) Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> --- .../Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h | 1 + .../Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h | 5 +++++ .../Atom/RPI.Public/DynamicDraw/DynamicDrawSystem.h | 3 ++- .../Source/RPI.Public/DynamicDraw/DynamicDrawSystem.cpp | 8 +++++++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h index c35d0750a5..be30697980 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h @@ -162,6 +162,7 @@ namespace AZ RHI::DrawListTag GetDrawListTag(); //! Create a draw srg + //! Note: the draw srg can only be used in the current frame. It can't be cached and used for following frames. Data::Instance NewDrawSrg(); //! Get per context srg diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h index 23a93481fd..afc9340521 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h @@ -59,10 +59,15 @@ namespace AZ //! Draw a geometry to a scene with a given material virtual void DrawGeometry(Data::Instance material, const GeometryData& geometry, ScenePtr scene) = 0; + //! Deprecated. Please use AddDrawPacket(Scene* scene, ConstPtr drawPacket) instead //! Submits a DrawPacket to the renderer. //! Note that ownership of the DrawPacket pointer is passed to the dynamic draw system. //! (it will be cleaned up correctly since the DrawPacket keeps track of the allocator that was used when it was built) virtual void AddDrawPacket(Scene* scene, AZStd::unique_ptr drawPacket) = 0; + + //! Submits a DrawPacket to the scene. + //! The dynamic draw system will keep a reference for the DrawPacket until it's rendered. + virtual void AddDrawPacket(Scene* scene, ConstPtr drawPacket) = 0; //! Get DrawLists from any DynamicDrawContext which output to the specified RasterPass. virtual AZStd::vector GetDrawListsForPass(const RasterPass* pass) = 0; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawSystem.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawSystem.h index 4a00566632..369a3a5a55 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawSystem.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawSystem.h @@ -35,6 +35,7 @@ namespace AZ RHI::Ptr GetDynamicBuffer(uint32_t size, uint32_t alignment) override; void DrawGeometry(Data::Instance material, const GeometryData& geometry, ScenePtr scene) override; void AddDrawPacket(Scene* scene, AZStd::unique_ptr drawPacket) override; + void AddDrawPacket(Scene* scene, ConstPtr drawPacket) override; AZStd::vector GetDrawListsForPass(const RasterPass* pass) override; // Submit draw data for selected scene and pipeline @@ -52,7 +53,7 @@ namespace AZ AZStd::list> m_dynamicDrawContexts; AZStd::mutex m_mutexDrawPackets; - AZStd::map>> m_drawPackets; + AZStd::map>> m_drawPackets; }; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawSystem.cpp index c38fbc4480..85391d854a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawSystem.cpp @@ -70,7 +70,13 @@ namespace AZ void DynamicDrawSystem::AddDrawPacket(Scene* scene, AZStd::unique_ptr drawPacket) { AZStd::lock_guard lock(m_mutexDrawPackets); - m_drawPackets[scene].emplace_back(AZStd::move(drawPacket)); + m_drawPackets[scene].emplace_back(ConstPtr(AZStd::move(drawPacket.get()))); + } + + void DynamicDrawSystem::AddDrawPacket(Scene* scene, ConstPtr drawPacket) + { + AZStd::lock_guard lock(m_mutexDrawPackets); + m_drawPackets[scene].emplace_back(drawPacket); } void DynamicDrawSystem::SubmitDrawData(Scene* scene, AZStd::vector views) From 4f47f26249f9252af8b2b6713fb8005e6499cfbb Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Wed, 2 Feb 2022 11:04:18 -0600 Subject: [PATCH 390/394] Move Runtime dependency on AssetBuilder from AssetProcessor.Static to AssetProcessor and AssetProcessorBatch. (#7298) This dependency was causing all of the asset processor modules to have to build gems, namely the unit tests which did not actually require the gems. Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- Code/Tools/AssetProcessor/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index a47ced43be..9fa33d3376 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -44,8 +44,6 @@ ly_add_target( AZ::AssetBuilderSDK AZ::AssetBuilder.Static ${additional_dependencies} - RUNTIME_DEPENDENCIES - AZ::AssetBuilder ) # Aggregates all combined AssetBuilders into a single LY_ASSET_BUILDERS #define @@ -76,6 +74,8 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE AZ::AssetProcessor.Static + RUNTIME_DEPENDENCIES + AZ::AssetBuilder ) # Adds the AssetProcessor target as a C preprocessor define so that it can be used as a Settings Registry @@ -122,6 +122,8 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE AZ::AssetProcessorBatch.Static + RUNTIME_DEPENDENCIES + AZ::AssetBuilder ) if(LY_DEFAULT_PROJECT_PATH) From c1b53f1284e814932724642d2f4c8e706387aef3 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Wed, 2 Feb 2022 11:04:27 -0600 Subject: [PATCH 391/394] [LYN-4034] Asset Processor: Sqlite inclusivity fix (#7291) * Update sqlite package for windows Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add assert to make sure sqlite header and lib version match Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Update linux Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Update Builting Package / Mac for Sqlite 3.37.2-rev1 Signed-off-by: spham <82231385+spham-amzn@users.noreply.github.com> * Re-add newline at end of file Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Inclusivity: change sqlite_master to sqlite_schema alias Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Co-authored-by: spham <82231385+spham-amzn@users.noreply.github.com> --- .../AzToolsFramework/SQLite/SQLiteConnection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/SQLite/SQLiteConnection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/SQLite/SQLiteConnection.cpp index 9e2a458d97..35ff0a88f7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/SQLite/SQLiteConnection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/SQLite/SQLiteConnection.cpp @@ -349,7 +349,7 @@ namespace AzToolsFramework return false; } - StatementPrototype stmt("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name=:1;"); + StatementPrototype stmt("SELECT COUNT(*) FROM sqlite_schema WHERE type='table' AND name=:1;"); Statement* execute = stmt.Prepare(m_db); // execute now belongs to stmt and will die when stmt leaves scope. if (!execute->Prepared()) { @@ -501,7 +501,7 @@ namespace AzToolsFramework // https://www.sqlite.org/c3ref/prepare.html ^^^^^^^^^ int res = sqlite3_prepare_v2(db, m_parentPrototype->GetSqlText().c_str(), (int)m_parentPrototype->GetSqlText().length() + 1, &m_statement, NULL); - + AZ_Assert(res == SQLITE_OK, "Statement::PrepareFirstTime: failed! %s ( prototype is '%s'). Error code returned is %d.", sqlite3_errmsg(db), m_parentPrototype->GetSqlText().c_str(), res); return ((res == SQLITE_OK)&&(m_statement)); } @@ -703,7 +703,7 @@ namespace AzToolsFramework int res = sqlite3_clear_bindings(m_statement); AZ_Assert(res == SQLITE_OK, "Statement::sqlite3_clear_bindings: failed!"); return (res == SQLITE_OK); - + } int Statement::GetNamedParamIdx(const char* name) From daeab4bbb112755d9c4eabc8cdac3f92fec5202e Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Wed, 2 Feb 2022 09:17:59 -0800 Subject: [PATCH 392/394] Focus Mode | Switch instance referencing in Prefab Focus Handler to use more reliable Instance handles (#7304) * Add function to Prefab Instances allowing to get a reference to a nested instance by alias. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Refactor the Prefab Focus Handler to use RootAliasPaths to store the reference to the currently focused prefab instance instead of the previous method (entityId of the prefab container). Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Use existing FindNestedInstance method instead of adding new one. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Minor fixes to style and comments Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Removing indexing in GetInstanceReferenceFromRootAliasPath, turn variables into constants where possible. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Modified the Prefab Focus test fixture to ensure the entity hierarchy is generated under the Prefab EOS, allowing tests to work with the new implementation of the focus mode handler. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Ensure RootAliasPath is iterated by reference in GetInstanceReferenceFromRootAliasPath Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- .../Prefab/Instance/Instance.h | 2 +- .../Prefab/PrefabFocusHandler.cpp | 157 ++++++++---------- .../Prefab/PrefabFocusHandler.h | 13 +- .../Prefab/PrefabFocus/PrefabFocusTests.cpp | 22 ++- 4 files changed, 92 insertions(+), 102 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h index b63eca309a..77ad526979 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h @@ -37,6 +37,7 @@ namespace AzToolsFramework using AliasPath = AZ::IO::Path; using AliasPathView = AZ::IO::PathView; + using RootAliasPath = AliasPath; using EntityAlias = AZStd::string; using EntityAliasView = AZStd::string_view; using InstanceAlias = AZStd::string; @@ -177,7 +178,6 @@ namespace AzToolsFramework AZStd::pair GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath); AZStd::pair GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) const; - /** * Gets the aliases of all the nested instances, which are sourced by the template with the given id. * diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp index 3426c56c99..d8a89109ef 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.cpp @@ -97,9 +97,9 @@ namespace AzToolsFramework::Prefab ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::SetSelectedEntities, selectedEntities); } - // Edit Prefab + // Add undo element { - auto editUndo = aznew PrefabFocusUndo("Edit Prefab"); + auto editUndo = aznew PrefabFocusUndo("Focus Prefab"); editUndo->Capture(entityId); editUndo->SetParent(undoBatch.GetUndoBatch()); FocusOnPrefabInstanceOwningEntityId(entityId); @@ -120,7 +120,7 @@ namespace AzToolsFramework::Prefab } // Retrieve parent of currently focused prefab. - InstanceOptionalReference parentInstance = GetReferenceFromContainerEntityId(m_instanceFocusHierarchy[hierarchySize - 2]); + InstanceOptionalReference parentInstance = GetInstanceReferenceFromRootAliasPath(m_instanceFocusHierarchy[hierarchySize - 2]); // Use container entity of parent Instance for focus operations. AZ::EntityId entityId = parentInstance->get().GetContainerEntityId(); @@ -136,9 +136,9 @@ namespace AzToolsFramework::Prefab ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::SetSelectedEntities, selectedEntities); } - // Edit Prefab + // Add undo element { - auto editUndo = aznew PrefabFocusUndo("Edit Prefab"); + auto editUndo = aznew PrefabFocusUndo("Focus Prefab"); editUndo->Capture(entityId); editUndo->SetParent(undoBatch.GetUndoBatch()); FocusOnPrefabInstanceOwningEntityId(entityId); @@ -154,7 +154,12 @@ namespace AzToolsFramework::Prefab return AZ::Failure(AZStd::string("Prefab Focus Handler: Invalid index on FocusOnPathIndex.")); } - InstanceOptionalReference focusedInstance = GetReferenceFromContainerEntityId(m_instanceFocusHierarchy[index]); + InstanceOptionalReference focusedInstance = GetInstanceReferenceFromRootAliasPath(m_instanceFocusHierarchy[index]); + + if (!focusedInstance.has_value()) + { + return AZ::Failure(AZStd::string::format("Prefab Focus Handler: Could not retrieve instance at index %i.", index)); + } return FocusOnOwningPrefab(focusedInstance->get().GetContainerEntityId()); } @@ -192,12 +197,12 @@ namespace AzToolsFramework::Prefab } // Close all container entities in the old path. - CloseInstanceContainers(m_instanceFocusHierarchy); + SetInstanceContainersOpenState(m_instanceFocusHierarchy, false); - AZ::EntityId previousContainerEntityId = m_focusedInstanceContainerEntityId; + const RootAliasPath previousContainerRootAliasPath = m_focusedInstanceRootAliasPath; + const InstanceOptionalConstReference previousFocusedInstance = GetInstanceReferenceFromRootAliasPath(previousContainerRootAliasPath); - // Do not store the container for the root instance, use an invalid EntityId instead. - m_focusedInstanceContainerEntityId = focusedInstance->get().GetParentInstance().has_value() ? focusedInstance->get().GetContainerEntityId() : AZ::EntityId(); + m_focusedInstanceRootAliasPath = focusedInstance->get().GetAbsoluteInstanceAliasPath(); m_focusedTemplateId = focusedInstance->get().GetTemplateId(); // Focus on the descendants of the container entity in the Editor, if the interface is initialized. @@ -214,7 +219,15 @@ namespace AzToolsFramework::Prefab // Refresh the read-only cache, if the interface is initialized. if (m_readOnlyEntityQueryInterface) { - m_readOnlyEntityQueryInterface->RefreshReadOnlyState({ previousContainerEntityId, m_focusedInstanceContainerEntityId }); + EntityIdList containerEntities; + + if (previousFocusedInstance.has_value()) + { + containerEntities.push_back(previousFocusedInstance->get().GetContainerEntityId()); + } + containerEntities.push_back(focusedInstance->get().GetContainerEntityId()); + + m_readOnlyEntityQueryInterface->RefreshReadOnlyState(containerEntities); } // Refresh path variables. @@ -222,7 +235,7 @@ namespace AzToolsFramework::Prefab RefreshInstanceFocusPath(); // Open all container entities in the new path. - OpenInstanceContainers(m_instanceFocusHierarchy); + SetInstanceContainersOpenState(m_instanceFocusHierarchy, true); PrefabFocusNotificationBus::Broadcast(&PrefabFocusNotifications::OnPrefabFocusChanged); @@ -237,17 +250,12 @@ namespace AzToolsFramework::Prefab InstanceOptionalReference PrefabFocusHandler::GetFocusedPrefabInstance( [[maybe_unused]] AzFramework::EntityContextId entityContextId) const { - return GetReferenceFromContainerEntityId(m_focusedInstanceContainerEntityId); + return GetInstanceReferenceFromRootAliasPath(m_focusedInstanceRootAliasPath); } AZ::EntityId PrefabFocusHandler::GetFocusedPrefabContainerEntityId([[maybe_unused]] AzFramework::EntityContextId entityContextId) const { - if (m_focusedInstanceContainerEntityId.IsValid()) - { - return m_focusedInstanceContainerEntityId; - } - - if (auto instance = GetReferenceFromContainerEntityId(m_focusedInstanceContainerEntityId); instance.has_value()) + if (const InstanceOptionalConstReference instance = GetInstanceReferenceFromRootAliasPath(m_focusedInstanceRootAliasPath); instance.has_value()) { return instance->get().GetContainerEntityId(); } @@ -262,19 +270,13 @@ namespace AzToolsFramework::Prefab return false; } - InstanceOptionalReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId); + const InstanceOptionalConstReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId); if (!instance.has_value()) { return false; } - // If this is owned by the root instance, that corresponds to an invalid m_focusedInstanceContainerEntityId. - if (!instance->get().GetParentInstance().has_value()) - { - return !m_focusedInstanceContainerEntityId.IsValid(); - } - - return (instance->get().GetContainerEntityId() == m_focusedInstanceContainerEntityId); + return (instance->get().GetAbsoluteInstanceAliasPath() == m_focusedInstanceRootAliasPath); } bool PrefabFocusHandler::IsOwningPrefabInFocusHierarchy(AZ::EntityId entityId) const @@ -284,18 +286,10 @@ namespace AzToolsFramework::Prefab return false; } - // If the focus is on the root, m_focusedInstanceContainerEntityId will be the invalid id. - // In those case all entities are in the focus hierarchy and should return true. - if (!m_focusedInstanceContainerEntityId.IsValid()) - { - return true; - } - - InstanceOptionalReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId); - + InstanceOptionalConstReference instance = m_instanceEntityMapperInterface->FindOwningInstance(entityId); while (instance.has_value()) { - if (instance->get().GetContainerEntityId() == m_focusedInstanceContainerEntityId) + if (instance->get().GetAbsoluteInstanceAliasPath() == m_focusedInstanceRootAliasPath) { return true; } @@ -330,9 +324,9 @@ namespace AzToolsFramework::Prefab // Determine if the entityId is the container for any of the instances in the vector. auto result = AZStd::find_if( m_instanceFocusHierarchy.begin(), m_instanceFocusHierarchy.end(), - [&, entityId](const AZ::EntityId& containerEntityId) + [&, entityId](const RootAliasPath& rootAliasPath) { - InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId); + InstanceOptionalReference instance = GetInstanceReferenceFromRootAliasPath(rootAliasPath); return (instance->get().GetContainerEntityId() == entityId); } ); @@ -357,9 +351,9 @@ namespace AzToolsFramework::Prefab // Determine if the templateId matches any of the instances in the vector. auto result = AZStd::find_if( m_instanceFocusHierarchy.begin(), m_instanceFocusHierarchy.end(), - [&, templateId](const AZ::EntityId& containerEntityId) + [&, templateId](const RootAliasPath& rootAliasPath) { - InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId); + InstanceOptionalReference instance = GetInstanceReferenceFromRootAliasPath(rootAliasPath); return (instance->get().GetTemplateId() == templateId); } ); @@ -376,20 +370,10 @@ namespace AzToolsFramework::Prefab { m_instanceFocusHierarchy.clear(); - AZStd::list instanceFocusList; - - InstanceOptionalReference currentInstance = GetReferenceFromContainerEntityId(m_focusedInstanceContainerEntityId); + InstanceOptionalConstReference currentInstance = GetInstanceReferenceFromRootAliasPath(m_focusedInstanceRootAliasPath); while (currentInstance.has_value()) { - if (currentInstance->get().GetParentInstance().has_value()) - { - m_instanceFocusHierarchy.emplace_back(currentInstance->get().GetContainerEntityId()); - } - else - { - m_instanceFocusHierarchy.emplace_back(AZ::EntityId()); - } - + m_instanceFocusHierarchy.emplace_back(currentInstance->get().GetAbsoluteInstanceAliasPath()); currentInstance = currentInstance->get().GetParentInstance(); } @@ -406,9 +390,9 @@ namespace AzToolsFramework::Prefab size_t index = 0; size_t maxIndex = m_instanceFocusHierarchy.size() - 1; - for (const AZ::EntityId& containerEntityId : m_instanceFocusHierarchy) + for (const RootAliasPath& rootAliasPath : m_instanceFocusHierarchy) { - InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId); + const InstanceOptionalConstReference instance = GetInstanceReferenceFromRootAliasPath(rootAliasPath); if (instance.has_value()) { AZStd::string prefabName; @@ -436,26 +420,7 @@ namespace AzToolsFramework::Prefab } } - void PrefabFocusHandler::OpenInstanceContainers(const AZStd::vector& instances) const - { - // If this is called outside the Editor, this interface won't be initialized. - if (!m_containerEntityInterface) - { - return; - } - - for (const AZ::EntityId& containerEntityId : instances) - { - InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId); - - if (instance.has_value()) - { - m_containerEntityInterface->SetContainerOpen(instance->get().GetContainerEntityId(), true); - } - } - } - - void PrefabFocusHandler::CloseInstanceContainers(const AZStd::vector& instances) const + void PrefabFocusHandler::SetInstanceContainersOpenState(const AZStd::vector& instances, bool openState) const { // If this is called outside the Editor, this interface won't be initialized. if (!m_containerEntityInterface) @@ -463,33 +428,51 @@ namespace AzToolsFramework::Prefab return; } - for (const AZ::EntityId& containerEntityId : instances) + for (const RootAliasPath& rootAliasPath : instances) { - InstanceOptionalReference instance = GetReferenceFromContainerEntityId(containerEntityId); + InstanceOptionalReference instance = GetInstanceReferenceFromRootAliasPath(rootAliasPath); if (instance.has_value()) { - m_containerEntityInterface->SetContainerOpen(instance->get().GetContainerEntityId(), false); + m_containerEntityInterface->SetContainerOpen(instance->get().GetContainerEntityId(), openState); } } } - InstanceOptionalReference PrefabFocusHandler::GetReferenceFromContainerEntityId(AZ::EntityId containerEntityId) const + InstanceOptionalReference PrefabFocusHandler::GetInstanceReferenceFromRootAliasPath(RootAliasPath rootAliasPath) const { - if (!containerEntityId.IsValid()) - { - PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface = - AZ::Interface::Get(); + PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface = + AZ::Interface::Get(); - if (!prefabEditorEntityOwnershipInterface) + if (prefabEditorEntityOwnershipInterface) + { + InstanceOptionalReference instance = prefabEditorEntityOwnershipInterface->GetRootPrefabInstance(); + + for (const auto& pathElement : rootAliasPath) { - return AZStd::nullopt; + if (pathElement.Native() == rootAliasPath.begin()->Native()) + { + // If the root is not the root Instance, the rootAliasPath is invalid. + if (pathElement.Native() != instance->get().GetInstanceAlias()) + { + return InstanceOptionalReference(); + } + } + else + { + // If the instance alias can't be found, the rootAliasPath is invalid. + instance = instance->get().FindNestedInstance(pathElement.Native()); + if (!instance.has_value()) + { + return InstanceOptionalReference(); + } + } } - return prefabEditorEntityOwnershipInterface->GetRootPrefabInstance(); + return instance; } - return m_instanceEntityMapperInterface->FindOwningInstance(containerEntityId); + return InstanceOptionalReference(); } } // namespace AzToolsFramework::Prefab diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.h index 4f3dbdd708..75e0a9f1f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabFocusHandler.h @@ -76,18 +76,17 @@ namespace AzToolsFramework::Prefab void RefreshInstanceFocusList(); void RefreshInstanceFocusPath(); - void OpenInstanceContainers(const AZStd::vector& instances) const; - void CloseInstanceContainers(const AZStd::vector& instances) const; + void SetInstanceContainersOpenState(const AZStd::vector& instances, bool openState) const; - InstanceOptionalReference GetReferenceFromContainerEntityId(AZ::EntityId containerEntityId) const; + InstanceOptionalReference GetInstanceReferenceFromRootAliasPath(RootAliasPath rootAliasPath) const; - //! The EntityId of the prefab container entity for the instance the editor is currently focusing on. - AZ::EntityId m_focusedInstanceContainerEntityId = AZ::EntityId(); + //! The alias path for the instance the editor is currently focusing on, starting from the root instance. + RootAliasPath m_focusedInstanceRootAliasPath = RootAliasPath(); //! The templateId of the focused instance. TemplateId m_focusedTemplateId; //! The list of instances going from the root (index 0) to the focused instance, - //! referenced by their prefab container's EntityId. - AZStd::vector m_instanceFocusHierarchy; + //! referenced by their alias path from the root instance. + AZStd::vector m_instanceFocusHierarchy; //! A path containing the filenames of the instances in the focus hierarchy, separated with a /. AZ::IO::Path m_instanceFocusPath; diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabFocus/PrefabFocusTests.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabFocus/PrefabFocusTests.cpp index 6bf964f038..df36a50a8b 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabFocus/PrefabFocusTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabFocus/PrefabFocusTests.cpp @@ -41,6 +41,11 @@ namespace UnitTest &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, AzToolsFramework::EntityList{ m_entityMap[Passenger1EntityName], m_entityMap[Passenger2EntityName], m_entityMap[CityEntityName] }); + // Initialize Prefab EOS Interface + AzToolsFramework::PrefabEditorEntityOwnershipInterface* prefabEditorEntityOwnershipInterface = + AZ::Interface::Get(); + ASSERT_TRUE(prefabEditorEntityOwnershipInterface); + // Create a car prefab from the passenger1 entity. The container entity will be created as part of the process. AZStd::unique_ptr carInstance = m_prefabSystemComponent->CreatePrefab({ m_entityMap[Passenger1EntityName] }, {}, "test/car"); @@ -59,11 +64,14 @@ namespace UnitTest ASSERT_TRUE(streetInstance); m_instanceMap[StreetEntityName] = streetInstance.get(); - // Create a city prefab that nests the street instances created above and the city entity. The container entity will be created as part of the process. - m_rootInstance = - m_prefabSystemComponent->CreatePrefab({ m_entityMap[CityEntityName] }, MakeInstanceList(AZStd::move(streetInstance)), "test/city"); - ASSERT_TRUE(m_rootInstance); - m_instanceMap[CityEntityName] = m_rootInstance.get(); + // Use the Prefab EOS root instance as the City instance. This will ensure functions that go through the EOS work in these tests too. + m_rootInstance = prefabEditorEntityOwnershipInterface->GetRootPrefabInstance(); + ASSERT_TRUE(m_rootInstance.has_value()); + + m_rootInstance->get().AddEntity(*m_entityMap[CityEntityName]); + m_rootInstance->get().AddInstance(AZStd::move(streetInstance)); + + m_instanceMap[CityEntityName] = &m_rootInstance->get(); } void SetUpEditorFixtureImpl() override @@ -84,7 +92,7 @@ namespace UnitTest void TearDownEditorFixtureImpl() override { - m_rootInstance.release(); + m_rootInstance->get().Reset(); PrefabTestFixture::TearDownEditorFixtureImpl(); } @@ -92,7 +100,7 @@ namespace UnitTest AZStd::unordered_map m_entityMap; AZStd::unordered_map m_instanceMap; - AZStd::unique_ptr m_rootInstance; + InstanceOptionalReference m_rootInstance; PrefabFocusInterface* m_prefabFocusInterface = nullptr; PrefabFocusPublicInterface* m_prefabFocusPublicInterface = nullptr; From 608411ab99f97f1dc31142558cde11769bd517a7 Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Wed, 2 Feb 2022 10:50:37 -0800 Subject: [PATCH 393/394] Metal pso caching support via MTLBinaryArchive (#7212) * PipelineLibrary (PSO Caching) support for Metal - API changes to handle Metal drivers implictly doing save/load of PipelineLibrary data - Fixed up code related to Metal device selection - PipelineLibrary support for Mac and ios Signed-off-by: moudgils * Fix compile errors for Dx12, Vulkan backend + Unit tests Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Fixed errors related to M1 GPU Signed-off-by: moudgils * Fix a minor 'tab' validation issue Signed-off-by: moudgils * Addressed feedback Signed-off-by: moudgils * Minor feedback Signed-off-by: moudgils * Added a few asserts Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Fix a typo Signed-off-by: moudgils --- .../DepthOfFieldWriteFocusDepthFromGpu.shader | 3 +- .../Include/Atom/RHI.Reflect/DeviceFeatures.h | 3 + .../RHI.Reflect/PhysicalDeviceDescriptor.h | 17 +- .../Code/Include/Atom/RHI/PipelineLibrary.h | 22 +- .../Include/Atom/RHI/PipelineStateCache.h | 235 +++++++++--------- .../RHI/Code/Source/RHI/PipelineLibrary.cpp | 14 +- .../Code/Source/RHI/PipelineStateCache.cpp | 21 +- Gems/Atom/RHI/Code/Tests/PipelineState.h | 3 +- .../RHI/Code/Tests/PipelineStateTests.cpp | 6 +- .../DX12/Code/Source/RHI/PipelineLibrary.cpp | 16 +- .../DX12/Code/Source/RHI/PipelineLibrary.h | 3 +- .../Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp | 2 +- .../RHI/Metal/Code/Source/RHI/CommandList.cpp | 108 ++++---- .../Atom/RHI/Metal/Code/Source/RHI/Device.cpp | 9 +- .../Metal/Code/Source/RHI/PhysicalDevice.cpp | 35 ++- .../Metal/Code/Source/RHI/PhysicalDevice.h | 4 + .../Metal/Code/Source/RHI/PipelineLibrary.cpp | 131 +++++++++- .../Metal/Code/Source/RHI/PipelineLibrary.h | 16 +- .../Metal/Code/Source/RHI/PipelineState.cpp | 85 ++++--- .../RHI/Metal/Code/Source/RHI/PipelineState.h | 5 +- .../Null/Code/Source/RHI/PipelineLibrary.h | 3 +- .../Code/Source/RHI/PipelineLibrary.cpp | 16 +- .../Vulkan/Code/Source/RHI/PipelineLibrary.h | 3 +- .../Code/Source/RPI.Public/Shader/Shader.cpp | 32 ++- Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h | 3 +- 25 files changed, 520 insertions(+), 275 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/DepthOfFieldWriteFocusDepthFromGpu.shader b/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/DepthOfFieldWriteFocusDepthFromGpu.shader index 5b927869d9..92243acb87 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/DepthOfFieldWriteFocusDepthFromGpu.shader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/PostProcessing/DepthOfFieldWriteFocusDepthFromGpu.shader @@ -10,7 +10,6 @@ "type" : "Compute" } ] - }, - "DisabledRHIBackends": ["metal"] + } } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/DeviceFeatures.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/DeviceFeatures.h index 8cd6194a18..dfe09ed7d4 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/DeviceFeatures.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/DeviceFeatures.h @@ -75,6 +75,9 @@ namespace AZ //! Whether Unbounded Array support is available. bool m_unboundedArrays = false; + //! Whether PipelineLibrary related serialized data needs to be loaded/saved explicitly as drivers (like dx12/vk) do not support it internally + bool m_isPsoCacheFileOperationsNeeded = true; + /// Additional features here. }; } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h index 4d78d24ca8..77c15d5444 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h @@ -22,14 +22,15 @@ namespace AZ { //! A list of popular vendor Ids. AZ_ENUM_CLASS_WITH_UNDERLYING_TYPE(VendorId, uint32_t, - (Unknown, 0), - (Intel, 0x8086), - (nVidia, 0x10de), - (AMD, 0x1002), - (Qualcomm, 0x5143), - (Samsung, 0x1099), - (ARM, 0x13B5), - (Warp, 0x1414) + (Unknown, 0), + (Intel, 0x8086), + (nVidia, 0x10de), + (AMD, 0x1002), + (Qualcomm, 0x5143), + (Samsung, 0x1099), + (ARM, 0x13B5), + (Warp, 0x1414), + (Apple, 0x106B) ); void ReflectVendorIdEnums(ReflectContext* context); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h index 687038f52e..1919b4d9cb 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineLibrary.h @@ -19,7 +19,15 @@ namespace AZ /// A handle typed to the pipeline library. Used by the PipelineStateCache to abstract access. using PipelineLibraryHandle = Handle; - + struct PipelineLibraryDescriptor + { + //Serialized data with which to init the PipelineLibrary + ConstPtr m_serializedData = nullptr; + //The file path name associated with serialized data. It can be passed + //to the RHI backend to do load/save operation via the drivers. + AZStd::string m_filePath; + }; + //! PipelineState initialization is an expensive operation on certain platforms. If multiple pipeline states //! are created with little variation between them, the contents are still duplicated. This class is an allocation //! context for pipeline states, provided at PipelineState::Init, which will perform de-duplication of @@ -50,8 +58,8 @@ namespace AZ //! serialized and the contents saved to disk. Subsequent loads will experience much faster pipeline //! state creation times (on supported platforms). On success, the library is transitioned to the //! initialized state. On failure, the library remains uninitialized. - //! @param serializedData The initial serialized data used to initialize the library. It can be null. - ResultCode Init(Device& device, const PipelineLibraryData* serializedData); + //! @param descriptor The descriptor needed to init the PipelineLibrary. + ResultCode Init(Device& device, const PipelineLibraryDescriptor& descriptor); //! Merges the contents of other libraries into this library. This method must be called //! on an initialized library. A common use case for this method is to construct thread-local @@ -65,6 +73,9 @@ namespace AZ //! this method to extract serialized data prior to application shutdown, save it to disk, and //! use it when initializing on subsequent runs. ConstPtr GetSerializedData() const; + + //! Saves the platform-specific data to disk using the filePath provided. This is done through RHI backend drivers. + bool SaveSerializedData(const AZStd::string& filePath) const; //! Returns whether the current library need to be merged virtual bool IsMergeRequired() const; @@ -79,7 +90,7 @@ namespace AZ // Platform API /// Called when the library is being created. - virtual ResultCode InitInternal(Device& device, const PipelineLibraryData* serializedData) = 0; + virtual ResultCode InitInternal(Device& device, const PipelineLibraryDescriptor& descriptor) = 0; /// Called when the library is being shutdown. virtual void ShutdownInternal() = 0; @@ -89,6 +100,9 @@ namespace AZ /// Called when the library is serializing out platform-specific data. virtual ConstPtr GetSerializedDataInternal() const = 0; + + /// Called when we want the RHI backend to save out the Pipeline Library via the drivers + virtual bool SaveSerializedDataInternal(const AZStd::string& filePath) const = 0; ////////////////////////////////////////////////////////////////////////// }; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateCache.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateCache.h index 9a6c89ae05..7d0b27d9f3 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateCache.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/PipelineStateCache.h @@ -22,131 +22,125 @@ namespace AZ { namespace RHI { - /** - * Problem: High-level rendering code works in 'materials', 'shaders', and 'models', but the RHI works in - * 'pipeline states'. Therefore, a translation process must exist to resolve a shader variation (plus runtime - * state) into a pipeline state suitable for consumption by the RHI. These resolve operations can number in the - * thousands per frame, and (ideally) are heavily jobified. - * - * Another problem is that pipeline state creation is not fast, as on some platforms it will involve synchronous - * byte-code compilation. This could take anywhere from <1ms to >150ms. If compilation is done synchronously and - * immediately, the cache will effectively stall the entire process if multiple threads request the same pending - * pipeline state. - * - * Therefore, PipelineStateCache adheres to the following requirements: - * 1. A cache miss does not serialize all threads on a pipeline state compilation event. - * 2. A cache hit results in zero contention. - * - * Justification: Most pipeline state compilation will occur in the first few frames, but can also occur when new - * 'permutations' are hit while exploring. In the 90% case, the cache is warm and each frame results in a 100% - * cache hit rate. With zero locks, this scales extremely well across threads and removes a bottleneck from the - * render code. In the event that compilations are required, multiple threads are now able to participate in the - * compilation process without serializing each other. - * - * To accomplish this, the pipeline state cache uses three 'phases' of caching. - * 1. A global, read-only cache - designed as the 'fast path' for when the cache is warm. - * 2. A thread-local cache - reduces contention on the global pending cache for successive requests on the same thread. - * 3. A global, locked pending cache - de-duplicates pipeline state allocations. - * - * Each library has global and thread-local caches. Initially, the global cache is checked, if that fails, the - * thread-local cache is checked (no locks taken). Finally, the pending cache is checked under a lock and if - * the entry still doesn't exist, it is allocated and added to the pending cache. A thread-local PipelineLibrary - * is used to compile the pipeline state, which eliminates all locking for compilation. - * - * Pipeline states can be acquired at any time and from any thread. The cache will take a reader lock. During - * AcquirePipelineState, the global read-only cache is not updated, but the thread-local cache and pending - * global cache may be. Furthermore, compilations are performed on the calling thread, which means that separate - * thread may return a pipeline state that is still compiling. It is required that all pending AcquirePipelineState - * calls complete prior to using the returned pipeline state pointers during command list recording. - * - * Example Scenarios: - * - * 1. Threads request the same un-cached pipeline state: - * - * Both the global read-only cache and thread-local caches miss, one thread wins the race to take a lock - * on the global pending cache. It allocates but does not compile the pipeline state. All other threads wait on the - * lock (which should be quick) and then find and return the uninitialized pipeline state. The compiling - * thread uses the thread-local PipelineLibrary instance to compile the pipeline state. Non-compiling threads - * will enter the uninitialized pipeline state into their thread-local cache (as does the compiling thread once it - * completes). Note that the compiling thread is now busy, but all remaining threads are now unblocked to compile other - * pipeline states. - * - * 2. A thread requests a pipeline state being compiled on another thread: - * - * In this case, the global read-only cache won't have the pipeline state (since it's being compiled during - * the current cycle, and the pending cache is only merged at the end of the cycle). It also won't have the - * entry in the thread-local cache. It then hits the global pending cache, which will return the live instance - * (being compiled). It then caches the result in its thread-local cache, so that successive requests will no - * longer require a lock on the pending cache. - * - * 3. The cache is warm and all pipeline states are compiled: - * - * Each thread hits the same read-only cache (which succeeds) and returns the pipeline state immediately. - * This is the fast-path case where multiple threads are now able to resolve pipeline states with very - * little performance overhead. - * - * Example Usage: - * @code{.cpp} - * // Create library instance. - * RHI::PipelineLibraryHandle libraryHandle = pipelineStateCache->CreateLibrary(serializedData); // Initial data loaded from disk. - * - * // In jobs. Lots and lots of requests. - * const RHI::PipelineState* pipelineState = pipelineStateCache->AcquirePipelineState(libraryHandle, descriptor); - * - * // Reset contents of library. Releases all pipeline state references. Library remains valid. - * pipelineStateCache->ResetLibrary(libraryHandle); - * - * // Release library and all held references. - * pipelineStateCache->ReleaseLibrary(libraryHandle); - * @endcode - */ + //! Problem: High-level rendering code works in 'materials', 'shaders', and 'models', but the RHI works in + //! 'pipeline states'. Therefore, a translation process must exist to resolve a shader variation (plus runtime + //! state) into a pipeline state suitable for consumption by the RHI. These resolve operations can number in the + //! thousands per frame, and (ideally) are heavily jobified. + //! + //! Another problem is that pipeline state creation is not fast, as on some platforms it will involve synchronous + //! byte-code compilation. This could take anywhere from <1ms to >150ms. If compilation is done synchronously and + //! immediately, the cache will effectively stall the entire process if multiple threads request the same pending + //! pipeline state. + //! + //! Therefore, PipelineStateCache adheres to the following requirements: + //! 1. A cache miss does not serialize all threads on a pipeline state compilation event. + //! 2. A cache hit results in zero contention. + //! + //! Justification: Most pipeline state compilation will occur in the first few frames, but can also occur when new + //! 'permutations' are hit while exploring. In the 90% case, the cache is warm and each frame results in a 100% + //! cache hit rate. With zero locks, this scales extremely well across threads and removes a bottleneck from the + //! render code. In the event that compilations are required, multiple threads are now able to participate in the + //! compilation process without serializing each other. + //! + //! To accomplish this, the pipeline state cache uses three 'phases' of caching. + //! 1. A global, read-only cache - designed as the 'fast path' for when the cache is warm. + //! 2. A thread-local cache - reduces contention on the global pending cache for successive requests on the same thread. + //! 3. A global, locked pending cache - de-duplicates pipeline state allocations. + //! + //! Each library has global and thread-local caches. Initially, the global cache is checked, if that fails, the + //! thread-local cache is checked (no locks taken). Finally, the pending cache is checked under a lock and if + //! the entry still doesn't exist, it is allocated and added to the pending cache. A thread-local PipelineLibrary + //! is used to compile the pipeline state, which eliminates all locking for compilation. + //! + //! Pipeline states can be acquired at any time and from any thread. The cache will take a reader lock. During + //! AcquirePipelineState, the global read-only cache is not updated, but the thread-local cache and pending + //! global cache may be. Furthermore, compilations are performed on the calling thread, which means that separate + //! thread may return a pipeline state that is still compiling. It is required that all pending AcquirePipelineState + //! calls complete prior to using the returned pipeline state pointers during command list recording. + //! + //! Example Scenarios: + //! + //! 1. Threads request the same un-cached pipeline state: + //! + //! Both the global read-only cache and thread-local caches miss, one thread wins the race to take a lock + //! on the global pending cache. It allocates but does not compile the pipeline state. All other threads wait on the + //! lock (which should be quick) and then find and return the uninitialized pipeline state. The compiling + //! thread uses the thread-local PipelineLibrary instance to compile the pipeline state. Non-compiling threads + //! will enter the uninitialized pipeline state into their thread-local cache (as does the compiling thread once it + //! completes). Note that the compiling thread is now busy, but all remaining threads are now unblocked to compile other + //! pipeline states. + //! + //! 2. A thread requests a pipeline state being compiled on another thread: + //! + //! In this case, the global read-only cache won't have the pipeline state (since it's being compiled during + //! the current cycle, and the pending cache is only merged at the end of the cycle). It also won't have the + //! entry in the thread-local cache. It then hits the global pending cache, which will return the live instance + //! (being compiled). It then caches the result in its thread-local cache, so that successive requests will no + //! longer require a lock on the pending cache. + //! + //! 3. The cache is warm and all pipeline states are compiled: + //! + //! Each thread hits the same read-only cache (which succeeds) and returns the pipeline state immediately. + //! This is the fast-path case where multiple threads are now able to resolve pipeline states with very + //! little performance overhead. + //! + //! Example Usage: + //! @code{.cpp} + //! // Create library instance. + //! RHI::PipelineLibraryHandle libraryHandle = pipelineStateCache->CreateLibrary(serializedData); // Initial data loaded from disk. + //! + //! // In jobs. Lots and lots of requests. + //! const RHI::PipelineState* pipelineState = pipelineStateCache->AcquirePipelineState(libraryHandle, descriptor); + //! + //! // Reset contents of library. Releases all pipeline state references. Library remains valid. + //! pipelineStateCache->ResetLibrary(libraryHandle); + //! + //! // Release library and all held references. + //! pipelineStateCache->ReleaseLibrary(libraryHandle); + //! @endcode + //! class PipelineStateCache final : public AZStd::intrusive_base { public: AZ_CLASS_ALLOCATOR(PipelineStateCache, SystemAllocator, 0); - /** - * The maximum number of libraries is configurable at compile time. A fixed number is used - * to avoid having to lazily resize thread-local arrays when traversing them, and also to - * avoid a pointer indirection on access. - */ + //! The maximum number of libraries is configurable at compile time. A fixed number is used + //! to avoid having to lazily resize thread-local arrays when traversing them, and also to + //! avoid a pointer indirection on access. static const size_t LibraryCountMax = 256; static Ptr Create(Device& device); - /// Resets the caches of all pipeline libraries back to empty. All internal references to pipeline states are released. + //! Resets the caches of all pipeline libraries back to empty. All internal references to pipeline states are released. void Reset(); - /// Creates an internal pipeline library instance and returns its handle. - PipelineLibraryHandle CreateLibrary(const PipelineLibraryData* serializedData); + //! Creates an internal pipeline library instance and returns its handle. + PipelineLibraryHandle CreateLibrary(const PipelineLibraryData* serializedData, const AZStd::string& filePath = ""); - /// Releases the pipeline library and purges it from the cache. Releases all held references to pipeline states for the library. + //! Releases the pipeline library and purges it from the cache. Releases all held references to pipeline states for the library. void ReleaseLibrary(PipelineLibraryHandle handle); - /// Resets cache contents in the library. Releases all held references to pipeline states for the library. + //! Resets cache contents in the library. Releases all held references to pipeline states for the library. void ResetLibrary(PipelineLibraryHandle handle); - /// Returns the serialized data for the library, which can be used to re-initialize it. - ConstPtr GetLibrarySerializedData(PipelineLibraryHandle handle) const; + //! Returns the resulting merged library from all the threadLibraries related to the passed in handle. + //! The merged library can be used to write out the serialized data. + Ptr GetMergedLibrary(PipelineLibraryHandle handle) const; - /** - * Acquires a pipeline state (either draw or dispatch variants) from the cache. Pipeline states are associated - * to a specific library handle. Successive calls with the same pipeline state descriptor hash will return the same - * pipeline state, even across threads. If the library handle is invalid or the acquire operation fails, a null pointer - * is returned. Otherwise, a valid pipeline state pointer is returned (regardless of whether pipeline state compilation succeeds). - * - * It is permitted to take a strong reference to the returned pointer, but is not necessary as long as the reference - * is discarded on a library reset / release event. The cache will store a reference internally. If a strong reference - * is held externally, the instance will remain valid even after the cache is reset / destroyed. - */ + //! Acquires a pipeline state (either draw or dispatch variants) from the cache. Pipeline states are associated + //! to a specific library handle. Successive calls with the same pipeline state descriptor hash will return the same + //! pipeline state, even across threads. If the library handle is invalid or the acquire operation fails, a null pointer + //! is returned. Otherwise, a valid pipeline state pointer is returned (regardless of whether pipeline state compilation succeeds). + //! + //! It is permitted to take a strong reference to the returned pointer, but is not necessary as long as the reference + //! is discarded on a library reset / release event. The cache will store a reference internally. If a strong reference + //! is held externally, the instance will remain valid even after the cache is reset / destroyed. const PipelineState* AcquirePipelineState(PipelineLibraryHandle library, const PipelineStateDescriptor& descriptor); - /** - * This method merges the global pending cache into the global read-only cache and clears all thread-local caches. - * This reduces the total memory footprint of the caches and optimizes subsequent fetches. This method should be called - * once per frame. - */ + //! This method merges the global pending cache into the global read-only cache and clears all thread-local caches. + //! This reduces the total memory footprint of the caches and optimizes subsequent fetches. This method should be called + //! once per frame. void Compact(); private: @@ -198,8 +192,9 @@ namespace AZ // Tracks the number of pipeline states actively being compiled across all threads. AZStd::atomic_uint32_t m_pendingCompileCount = {0}; - // Used to prime the thread libraries. - ConstPtr m_serializedData; + // Contains the initial serialized data (Used to prime the thread libraries) + // or the file name that contains the serialized data + PipelineLibraryDescriptor m_pipelineLibraryDescriptor; }; using GlobalLibrarySet = AZStd::fixed_vector; @@ -209,36 +204,32 @@ namespace AZ // A thread-local cache used to reduce contention on the global pending cache. PipelineStateSet m_threadLocalCache; - /** - * Each thread has its own pipeline library. This allows threads to cache disjoint - * pipeline states without locking. The libraries are coalesced into a single library - * during GetLibrarySerializedData. The library is lazily initialized on the thread - * and uses the initial serialized data passed in at creation time. - */ + //! Each thread has its own pipeline library. This allows threads to cache disjoint + //! pipeline states without locking. The libraries are coalesced into a single library + //! during GetMergedLibrary. The library is lazily initialized on the thread + //! and uses the initial serialized data passed in at creation time. Ptr m_library; }; - /** - * Each thread has its own list of pipeline library entries. The index maps 1-to-1 with GlobalLibrarySet. - * GlobalLibrarySet contains the total size of the array; whereas the ThreadLibrarySet is just an array. - * The size of the global set should be used when traversing the thread library entries. - */ + //! Each thread has its own list of pipeline library entries. The index maps 1-to-1 with GlobalLibrarySet. + //! GlobalLibrarySet contains the total size of the array; whereas the ThreadLibrarySet is just an array. + //! The size of the global set should be used when traversing the thread library entries. using ThreadLibrarySet = AZStd::array; - /// Helper function which binary searches a pipeline state set looking for an entry which matches the requested descriptor. + //! Helper function which binary searches a pipeline state set looking for an entry which matches the requested descriptor. static const PipelineState* FindPipelineState(const PipelineStateSet& pipelineStateSet, const PipelineStateDescriptor& descriptor); - /// Helper function which inserts an entry into the set. Returns true if the entry was inserted, or false is a duplicate entry existed. + //! Helper function which inserts an entry into the set. Returns true if the entry was inserted, or false is a duplicate entry existed. static bool InsertPipelineState(PipelineStateSet& pipelineStateSet, PipelineStateEntry pipelineStateEntry); - /// Performs a pipeline state compilation on the global cache using the thread-local pipeline library. + //! Performs a pipeline state compilation on the global cache using the thread-local pipeline library. ConstPtr CompilePipelineState( GlobalLibraryEntry& globalLibraryEntry, ThreadLibraryEntry& threadLibraryEntry, const PipelineStateDescriptor& pipelineStateDescriptor, PipelineStateHash pipelineStateHash); - /// Resets the library without validating the handle or taking a lock. + //! Resets the library without validating the handle or taking a lock. void ResetLibraryImpl(PipelineLibraryHandle handle); Ptr m_device; diff --git a/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp index 6a05565c38..54a982de3c 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/PipelineLibrary.cpp @@ -25,7 +25,7 @@ namespace AZ return true; } - ResultCode PipelineLibrary::Init(Device& device, const PipelineLibraryData* serializedData) + ResultCode PipelineLibrary::Init(Device& device, const PipelineLibraryDescriptor& descriptor) { if (Validation::IsEnabled()) { @@ -36,7 +36,7 @@ namespace AZ } } - ResultCode resultCode = InitInternal(device, serializedData); + ResultCode resultCode = InitInternal(device, descriptor); if (resultCode == ResultCode::Success) { DeviceObject::Init(device); @@ -72,6 +72,16 @@ namespace AZ return GetSerializedDataInternal(); } + + bool PipelineLibrary::SaveSerializedData(const AZStd::string& filePath) const + { + if (!ValidateIsInitialized()) + { + return false; + } + + return SaveSerializedDataInternal(filePath); + } bool PipelineLibrary::IsMergeRequired() const { diff --git a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp index 3279372052..64ea5f3cfe 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp @@ -81,7 +81,7 @@ namespace AZ } } - PipelineLibraryHandle PipelineStateCache::CreateLibrary(const PipelineLibraryData* serializedData) + PipelineLibraryHandle PipelineStateCache::CreateLibrary(const PipelineLibraryData* serializedData, const AZStd::string& filePath) { AZStd::unique_lock lock(m_mutex); @@ -110,8 +110,8 @@ namespace AZ m_globalLibraryActiveBits[handle.GetIndex()] = true; GlobalLibraryEntry& libraryEntry = m_globalLibrarySet[handle.GetIndex()]; - libraryEntry.m_serializedData = serializedData; - + libraryEntry.m_pipelineLibraryDescriptor.m_serializedData = serializedData; + libraryEntry.m_pipelineLibraryDescriptor.m_filePath = filePath; AZ_Assert(libraryEntry.m_readOnlyCache.empty() && libraryEntry.m_pendingCache.empty(), "Library entry has entries in its caches!"); return handle; @@ -128,8 +128,9 @@ namespace AZ GlobalLibraryEntry& libraryEntry = m_globalLibrarySet[handle.GetIndex()]; libraryEntry.m_readOnlyCache.clear(); - libraryEntry.m_serializedData = nullptr; - + libraryEntry.m_pipelineLibraryDescriptor.m_serializedData = nullptr; + libraryEntry.m_pipelineLibraryDescriptor.m_filePath = ""; + m_globalLibraryActiveBits[handle.GetIndex()] = false; m_libraryFreeList.push_back(handle); } @@ -162,7 +163,7 @@ namespace AZ libraryEntry.m_pendingCacheMutex.unlock(); } - ConstPtr PipelineStateCache::GetLibrarySerializedData(PipelineLibraryHandle handle) const + Ptr PipelineStateCache::GetMergedLibrary(PipelineLibraryHandle handle) const { if (handle.IsNull()) { @@ -188,7 +189,7 @@ namespace AZ } }); - bool doesPSODataExist = entry.m_serializedData.get(); + bool doesPSODataExist = entry.m_pipelineLibraryDescriptor.m_serializedData.get(); for (const RHI::PipelineLibrary* libraryBase : threadLibraries) { const PipelineLibrary* library = static_cast(libraryBase); @@ -198,7 +199,7 @@ namespace AZ if (doesPSODataExist) { Ptr pipelineLibrary = Factory::Get().CreatePipelineLibrary(); - ResultCode resultCode = pipelineLibrary->Init(*m_device, entry.m_serializedData.get()); + ResultCode resultCode = pipelineLibrary->Init(*m_device, entry.m_pipelineLibraryDescriptor); if (resultCode == ResultCode::Success) { @@ -206,7 +207,7 @@ namespace AZ if (resultCode == ResultCode::Success) { - return pipelineLibrary->GetSerializedData(); + return pipelineLibrary; } } } @@ -316,7 +317,7 @@ namespace AZ if (!threadLibraryEntry.m_library) { Ptr pipelineLibrary = Factory::Get().CreatePipelineLibrary(); - RHI::ResultCode resultCode = pipelineLibrary->Init(*m_device, globalLibraryEntry.m_serializedData.get()); + RHI::ResultCode resultCode = pipelineLibrary->Init(*m_device, globalLibraryEntry.m_pipelineLibraryDescriptor); if (resultCode != RHI::ResultCode::Success) { AZ_Warning("PipelineStateCache", false, "Failed to initialize pipeline library. PipelineLibrary usage is disabled."); diff --git a/Gems/Atom/RHI/Code/Tests/PipelineState.h b/Gems/Atom/RHI/Code/Tests/PipelineState.h index ddaedfd73b..7f7303d0b9 100644 --- a/Gems/Atom/RHI/Code/Tests/PipelineState.h +++ b/Gems/Atom/RHI/Code/Tests/PipelineState.h @@ -23,10 +23,11 @@ namespace UnitTest AZStd::unordered_map m_pipelineStates; private: - AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, const AZ::RHI::PipelineLibraryData*) override { return AZ::RHI::ResultCode::Success; } + AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, const RHI::PipelineLibraryDescriptor&) override { return AZ::RHI::ResultCode::Success; } void ShutdownInternal() override; AZ::RHI::ResultCode MergeIntoInternal(AZStd::span) override; AZ::RHI::ConstPtr GetSerializedDataInternal() const override { return nullptr; } + bool SaveSerializedDataInternal([[maybe_unused]] const AZStd::string& filePath) const override { return false; } }; class PipelineState diff --git a/Gems/Atom/RHI/Code/Tests/PipelineStateTests.cpp b/Gems/Atom/RHI/Code/Tests/PipelineStateTests.cpp index ceddc69827..19b1cb1c57 100644 --- a/Gems/Atom/RHI/Code/Tests/PipelineStateTests.cpp +++ b/Gems/Atom/RHI/Code/Tests/PipelineStateTests.cpp @@ -189,12 +189,12 @@ namespace UnitTest RHI::Ptr device = MakeTestDevice(); RHI::Ptr pipelineLibrary = RHI::Factory::Get().CreatePipelineLibrary(); - RHI::ResultCode resultCode = pipelineLibrary->Init(*device, nullptr); + RHI::ResultCode resultCode = pipelineLibrary->Init(*device, RHI::PipelineLibraryDescriptor{}); EXPECT_EQ(resultCode, RHI::ResultCode::Success); // Second init should fail and throw validation error. AZ_TEST_START_ASSERTTEST; - resultCode = pipelineLibrary->Init(*device, nullptr); + resultCode = pipelineLibrary->Init(*device, RHI::PipelineLibraryDescriptor{}); AZ_TEST_STOP_ASSERTTEST(1); EXPECT_EQ(resultCode, RHI::ResultCode::InvalidOperation); @@ -249,7 +249,7 @@ namespace UnitTest // Calling library methods with a null handle should early out. pipelineStateCache->ResetLibrary({}); pipelineStateCache->ReleaseLibrary({}); - EXPECT_EQ(pipelineStateCache->GetLibrarySerializedData({}), nullptr); + EXPECT_EQ(pipelineStateCache->GetMergedLibrary({}), nullptr); EXPECT_EQ(pipelineStateCache->AcquirePipelineState({}, CreatePipelineStateDescriptor(0)), nullptr); pipelineStateCache->Compact(); ValidateCacheIntegrity(pipelineStateCache); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp index 0f1fab642a..a5a149ab13 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp @@ -40,7 +40,7 @@ namespace AZ return aznew PipelineLibrary; } - RHI::ResultCode PipelineLibrary::InitInternal(RHI::Device& deviceBase, [[maybe_unused]] const RHI::PipelineLibraryData* serializedData) + RHI::ResultCode PipelineLibrary::InitInternal(RHI::Device& deviceBase, [[maybe_unused]] const RHI::PipelineLibraryDescriptor& descriptor) { Device& device = static_cast(deviceBase); ID3D12DeviceX* dx12Device = device.GetDevice(); @@ -57,9 +57,9 @@ namespace AZ } - if (serializedData && shouldCreateLibFromSerializedData) + if (descriptor.m_serializedData && shouldCreateLibFromSerializedData) { - bytes = serializedData->GetData(); + bytes = descriptor.m_serializedData->GetData(); } Microsoft::WRL::ComPtr libraryComPtr; @@ -70,7 +70,7 @@ namespace AZ if (SUCCEEDED(hr)) { - m_serializedData = serializedData; + m_serializedData = descriptor.m_serializedData; } else { @@ -270,5 +270,13 @@ namespace AZ return false; #endif } + + bool PipelineLibrary::SaveSerializedDataInternal([[maybe_unused]] const AZStd::string& filePath) const + { + // DX12 drivers cannot save serialized data + [[maybe_unused]] Device& device = static_cast(GetDevice()); + AZ_Assert(!device.GetFeatures().m_isPsoCacheFileOperationsNeeded, "Explicit PSO cache operations should not be disabled for DX12"); + return false; + } } } diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h index f34c5bf8ae..27bc0e8625 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.h @@ -31,11 +31,12 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // RHI::PipelineLibrary - RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryData* serializedData) override; + RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryDescriptor& descriptor) override; void ShutdownInternal() override; RHI::ResultCode MergeIntoInternal(AZStd::span libraries) override; RHI::ConstPtr GetSerializedDataInternal() const override; bool IsMergeRequired() const; + bool SaveSerializedDataInternal(const AZStd::string& filePath) const override; ////////////////////////////////////////////////////////////////////////// ID3D12DeviceX* m_dx12Device = nullptr; diff --git a/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp b/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp index faa1216c25..cc958feefb 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/Platform/iOS/RHI/Metal_RHI_iOS.cpp @@ -24,7 +24,7 @@ namespace Platform { AZ::RHI::PhysicalDeviceList physicalDeviceList; AZ::Metal::PhysicalDevice* physicalDevice = aznew AZ::Metal::PhysicalDevice; - physicalDevice->Init(nil); + physicalDevice->Init(MTLCreateSystemDefaultDevice()); physicalDeviceList.emplace_back(physicalDevice); return physicalDeviceList; } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp index c0277152b6..bdb21a246b 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandList.cpp @@ -73,11 +73,11 @@ namespace AZ const auto* sourceBuffer = static_cast(descriptor.m_sourceBuffer); const auto* destinationBuffer = static_cast(descriptor.m_destinationBuffer); - [blitEncoder copyFromBuffer:sourceBuffer->GetMemoryView().GetGpuAddress>() - sourceOffset:descriptor.m_sourceOffset - toBuffer:destinationBuffer->GetMemoryView().GetGpuAddress>() - destinationOffset:descriptor.m_destinationOffset - size:descriptor.m_size]; + [blitEncoder copyFromBuffer: sourceBuffer->GetMemoryView().GetGpuAddress>() + sourceOffset: descriptor.m_sourceOffset + toBuffer: destinationBuffer->GetMemoryView().GetGpuAddress>() + destinationOffset: descriptor.m_destinationOffset + size: descriptor.m_size]; Platform::SynchronizeBufferOnGPU(blitEncoder, destinationBuffer->GetMemoryView().GetGpuAddress>()); break; @@ -101,14 +101,14 @@ namespace AZ descriptor.m_destinationOrigin.m_front); [blitEncoder copyFromTexture: sourceImage->GetMemoryView().GetGpuAddress>() - sourceSlice: descriptor.m_sourceSubresource.m_arraySlice - sourceLevel: descriptor.m_sourceSubresource.m_mipSlice - sourceOrigin: sourceOrigin - sourceSize: sourceSize - toTexture: destinationImage->GetMemoryView().GetGpuAddress>() - destinationSlice: descriptor.m_destinationSubresource.m_arraySlice - destinationLevel: descriptor.m_destinationSubresource.m_mipSlice - destinationOrigin: destinationOrigin]; + sourceSlice: descriptor.m_sourceSubresource.m_arraySlice + sourceLevel: descriptor.m_sourceSubresource.m_mipSlice + sourceOrigin: sourceOrigin + sourceSize: sourceSize + toTexture: destinationImage->GetMemoryView().GetGpuAddress>() + destinationSlice: descriptor.m_destinationSubresource.m_arraySlice + destinationLevel: descriptor.m_destinationSubresource.m_mipSlice + destinationOrigin: destinationOrigin]; Platform::SynchronizeTextureOnGPU(blitEncoder, destinationImage->GetMemoryView().GetGpuAddress>()); break; @@ -127,15 +127,15 @@ namespace AZ descriptor.m_sourceSize.m_height, descriptor.m_sourceSize.m_depth); - [blitEncoder copyFromBuffer:sourceBuffer->GetMemoryView().GetGpuAddress>() - sourceOffset:sourceBuffer->GetMemoryView().GetOffset() + descriptor.m_sourceOffset - sourceBytesPerRow:descriptor.m_sourceBytesPerRow - sourceBytesPerImage:descriptor.m_sourceBytesPerImage - sourceSize:sourceSize - toTexture:destinationImage->GetMemoryView().GetGpuAddress>() - destinationSlice:descriptor.m_destinationSubresource.m_arraySlice - destinationLevel:descriptor.m_destinationSubresource.m_mipSlice - destinationOrigin:destinationOrigin]; + [blitEncoder copyFromBuffer: sourceBuffer->GetMemoryView().GetGpuAddress>() + sourceOffset: sourceBuffer->GetMemoryView().GetOffset() + descriptor.m_sourceOffset + sourceBytesPerRow: descriptor.m_sourceBytesPerRow + sourceBytesPerImage: descriptor.m_sourceBytesPerImage + sourceSize: sourceSize + toTexture: destinationImage->GetMemoryView().GetGpuAddress>() + destinationSlice: descriptor.m_destinationSubresource.m_arraySlice + destinationLevel: descriptor.m_destinationSubresource.m_mipSlice + destinationOrigin: destinationOrigin]; Platform::SynchronizeTextureOnGPU(blitEncoder, destinationImage->GetMemoryView().GetGpuAddress>()); break; @@ -154,15 +154,15 @@ namespace AZ descriptor.m_sourceSize.m_height, descriptor.m_sourceSize.m_depth); - [blitEncoder copyFromTexture:sourceImage->GetMemoryView().GetGpuAddress>() - sourceSlice:descriptor.m_sourceSubresource.m_arraySlice - sourceLevel:descriptor.m_sourceSubresource.m_mipSlice - sourceOrigin:sourceOrigin - sourceSize:sourceSize - toBuffer:destinationBuffer->GetMemoryView().GetGpuAddress>() - destinationOffset:destinationBuffer->GetMemoryView().GetOffset() + descriptor.m_destinationOffset - destinationBytesPerRow:descriptor.m_destinationBytesPerRow - destinationBytesPerImage:descriptor.m_destinationBytesPerImage]; + [blitEncoder copyFromTexture: sourceImage->GetMemoryView().GetGpuAddress>() + sourceSlice: descriptor.m_sourceSubresource.m_arraySlice + sourceLevel: descriptor.m_sourceSubresource.m_mipSlice + sourceOrigin: sourceOrigin + sourceSize: sourceSize + toBuffer: destinationBuffer->GetMemoryView().GetGpuAddress>() + destinationOffset: destinationBuffer->GetMemoryView().GetOffset() + descriptor.m_destinationOffset + destinationBytesPerRow: descriptor.m_destinationBytesPerRow + destinationBytesPerImage: descriptor.m_destinationBytesPerImage]; Platform::SynchronizeBufferOnGPU(blitEncoder, destinationBuffer->GetMemoryView().GetGpuAddress>()); break; @@ -192,7 +192,7 @@ namespace AZ id computeEncoder = GetEncoder>(); [computeEncoder dispatchThreadgroups: numThreadGroup - threadsPerThreadgroup: threadsPerGroup]; + threadsPerThreadgroup: threadsPerGroup]; } @@ -235,8 +235,8 @@ namespace AZ { id computeEncoder = GetEncoder>(); [computeEncoder setBytes: item.m_rootConstants - length: pipelineLayout.GetRootConstantsSize() - atIndex: pipelineLayout.GetRootConstantsSlotIndex()]; + length: pipelineLayout.GetRootConstantsSize() + atIndex: pipelineLayout.GetRootConstantsSlotIndex()]; } } @@ -434,25 +434,25 @@ namespace AZ case RHI::ShaderStage::Vertex: { id renderEncoder = GetEncoder>(); - [renderEncoder setVertexBuffers:&mtlArgBuffers[startingIndex] - offsets:&mtlArgBufferOffsets[startingIndex] - withRange:range]; + [renderEncoder setVertexBuffers: &mtlArgBuffers[startingIndex] + offsets: &mtlArgBufferOffsets[startingIndex] + withRange: range]; break; } case RHI::ShaderStage::Fragment: { id renderEncoder = GetEncoder>(); - [renderEncoder setFragmentBuffers:&mtlArgBuffers[startingIndex] - offsets:&mtlArgBufferOffsets[startingIndex] - withRange:range]; + [renderEncoder setFragmentBuffers: &mtlArgBuffers[startingIndex] + offsets: &mtlArgBufferOffsets[startingIndex] + withRange: range]; break; } case RHI::ShaderStage::Compute: { id computeEncoder = GetEncoder>(); - [computeEncoder setBuffers:&mtlArgBuffers[startingIndex] - offsets:&mtlArgBufferOffsets[startingIndex] - withRange:range]; + [computeEncoder setBuffers: &mtlArgBuffers[startingIndex] + offsets: &mtlArgBufferOffsets[startingIndex] + withRange: range]; break; } default: @@ -537,13 +537,13 @@ namespace AZ uint32_t indexOffset = indexBuffDescriptor.GetByteOffset() + (indexed.m_indexOffset * indexTypeSize) + buff->GetMemoryView().GetOffset(); [renderEncoder drawIndexedPrimitives: mtlPrimType - indexCount: indexed.m_indexCount - indexType: mtlIndexType - indexBuffer: mtlBuff - indexBufferOffset: indexOffset - instanceCount: indexed.m_instanceCount - baseVertex: indexed.m_vertexOffset - baseInstance: indexed.m_instanceOffset]; + indexCount: indexed.m_indexCount + indexType: mtlIndexType + indexBuffer: mtlBuff + indexBufferOffset: indexOffset + instanceCount: indexed.m_instanceCount + baseVertex: indexed.m_vertexOffset + baseInstance: indexed.m_instanceOffset]; break; } @@ -551,10 +551,10 @@ namespace AZ { const RHI::DrawLinear& linear = drawItem.m_arguments.m_linear; [renderEncoder drawPrimitives: mtlPrimType - vertexStart: linear.m_vertexOffset - vertexCount: linear.m_vertexCount - instanceCount: linear.m_instanceCount - baseInstance: linear.m_instanceOffset]; + vertexStart: linear.m_vertexOffset + vertexCount: linear.m_vertexCount + instanceCount: linear.m_instanceCount + baseInstance: linear.m_instanceOffset]; break; } } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/Device.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/Device.cpp index 91d8287e8d..c42b57aa7e 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/Device.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/Device.cpp @@ -15,6 +15,7 @@ #include #include #include +#include //Symbols related to Obj-c categories are getting stripped out as part of the link step for monolithic builds //This forces the linker to not strip symbols related to categories without actually referencing the dummy function. @@ -40,9 +41,10 @@ namespace AZ return aznew Device(); } - RHI::ResultCode Device::InitInternal(RHI::PhysicalDevice& physicalDevice) + RHI::ResultCode Device::InitInternal(RHI::PhysicalDevice& physicalDeviceBase) { - m_metalDevice = MTLCreateSystemDefaultDevice(); + PhysicalDevice& physicalDevice = static_cast(physicalDeviceBase); + m_metalDevice = physicalDevice.GetNativeDevice(); AZ_Assert(m_metalDevice, "Native device wasnt created"); m_eventListener = [[MTLSharedEventListener alloc] init]; @@ -340,6 +342,9 @@ namespace AZ m_features.m_customResolvePositions = m_metalDevice.programmableSamplePositionsSupported; m_features.m_indirectDrawSupport = false; + //Metal drivers save and load serialized PipelineLibrary internally + m_features.m_isPsoCacheFileOperationsNeeded = false; + RHI::QueryTypeFlags counterSamplingFlags = RHI::QueryTypeFlags::None; bool supportsInterDrawTimestamps = true; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.cpp index f165f26625..e92e21f89a 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.cpp @@ -15,11 +15,15 @@ namespace Platform AZ::RHI::PhysicalDeviceList EnumerateDevices(); } - namespace AZ { namespace Metal { + id PhysicalDevice::GetNativeDevice() + { + return m_mtlNativeDevice; + } + RHI::PhysicalDeviceList PhysicalDevice::Enumerate() { return Platform::EnumerateDevices(); @@ -29,15 +33,34 @@ namespace AZ { if(mtlDevice) { + m_mtlNativeDevice = mtlDevice; NSString * deviceName = [mtlDevice name]; - const char * secondName = [ deviceName UTF8String ]; - m_descriptor.m_description = AZStd::string(secondName); - m_descriptor.m_deviceId = [mtlDevice registryID]; + const char * deviceNameCStr = [ deviceName UTF8String ]; + m_descriptor.m_description = AZStd::string(deviceNameCStr); + m_descriptor.m_deviceId = deviceName.hash; //Used for storing PipelineLibraries - //Currently no way of knowing vendor id through metal. Using AMD as a placeholder for now. - m_descriptor.m_vendorId = RHI::VendorId::AMD; + if(strstr(m_descriptor.m_description.c_str(), ToString(RHI::VendorId::Apple).data())) + { + m_descriptor.m_vendorId = RHI::VendorId::Apple; + } + else if(strstr(m_descriptor.m_description.c_str(), ToString(RHI::VendorId::Intel).data())) + { + m_descriptor.m_vendorId = RHI::VendorId::Intel; + } + else if(strstr(m_descriptor.m_description.c_str(), ToString(RHI::VendorId::nVidia).data())) + { + m_descriptor.m_vendorId = RHI::VendorId::nVidia; + } + else if(strstr(m_descriptor.m_description.c_str(), ToString(RHI::VendorId::AMD).data())) + { + m_descriptor.m_vendorId = RHI::VendorId::AMD; + } m_descriptor.m_type = Platform::GetPhysicalDeviceType(mtlDevice); + + NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; + AZStd::string concatVer = AZStd::string::format("%li%li%li", version.majorVersion, version.minorVersion, version.patchVersion); + m_descriptor.m_driverVersion = AZStd::stoi(concatVer); } } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.h b/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.h index db21b67e4e..7337585fc6 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.h +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PhysicalDevice.h @@ -26,8 +26,12 @@ namespace AZ void Init(id mtlDevice); static RHI::PhysicalDeviceList Enumerate(); + id GetNativeDevice(); + private: void Shutdown() override; + + id m_mtlNativeDevice = nil; }; } } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp index 63d741dffd..79bd110dde 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AZ { @@ -18,17 +19,111 @@ namespace AZ return aznew PipelineLibrary; } - RHI::ResultCode PipelineLibrary::InitInternal(RHI::Device& deviceBase, const RHI::PipelineLibraryData* serializedData) + id PipelineLibrary::GetNativePipelineCache() const { + return m_mtlBinaryArchive; + } + + RHI::ResultCode PipelineLibrary::InitInternal(RHI::Device& deviceBase, const RHI::PipelineLibraryDescriptor& descriptor) + { + DeviceObject::Init(deviceBase); + auto& device = static_cast(deviceBase); + + m_descriptor = descriptor; + NSError* error = nil; + MTLBinaryArchiveDescriptor* desc = [[MTLBinaryArchiveDescriptor alloc] init]; + + NSString* psoCacheFilePath = [NSString stringWithCString:descriptor.m_filePath.c_str() encoding:NSUTF8StringEncoding]; + NSURL* filePathURL = [NSURL fileURLWithPath:psoCacheFilePath isDirectory:NO]; + + //Pass in the file path if it exists + if ([filePathURL checkResourceIsReachableAndReturnError:&error]) + { + desc.url = filePathURL; + } + + //Create a new Pso cache. Use the existing fOile on disk if provided + m_mtlBinaryArchive = [device.GetMtlDevice() newBinaryArchiveWithDescriptor:desc error:&error]; + [desc release]; + desc = nil; + + SetName(GetName()); + NSString* labelName = [NSString stringWithCString:GetName().GetCStr() encoding:NSUTF8StringEncoding]; + m_mtlBinaryArchive.label = labelName; return RHI::ResultCode::Success; } void PipelineLibrary::ShutdownInternal() { + [m_mtlBinaryArchive release]; + m_mtlBinaryArchive = nil; + m_renderPipelineStates.clear(); + m_computePipelineStates.clear(); } + id PipelineLibrary::CreateGraphicsPipelineState(uint64_t hash, MTLRenderPipelineDescriptor* pipelineStateDesc) + { + Device& device = static_cast(GetDevice()); + NSError* error = nil; + AZStd::lock_guard lock(m_mutex); + + NSArray* binArchives = [NSArray arrayWithObjects:m_mtlBinaryArchive,nil]; + pipelineStateDesc.binaryArchives = binArchives; + //Create a new PSO. The drivers will use the Pso cache if the PSO resides in it + id graphicsPipelineState = + [device.GetMtlDevice() newRenderPipelineStateWithDescriptor:pipelineStateDesc + error:&error]; + m_renderPipelineStates.emplace(hash, pipelineStateDesc); + return graphicsPipelineState; + } + + id PipelineLibrary::CreateComputePipelineState(uint64_t hash, MTLComputePipelineDescriptor* pipelineStateDesc) + { + Device& device = static_cast(GetDevice()); + NSError* error = nil; + MTLComputePipelineReflection* ref; + AZStd::lock_guard lock(m_mutex); + + NSArray* binArchives = [NSArray arrayWithObjects:m_mtlBinaryArchive,nil]; + pipelineStateDesc.binaryArchives = binArchives; + //Create a new PSO. The drivers will use the Pso cache if the PSO resides in it + id computePipelineState = + [device.GetMtlDevice() newComputePipelineStateWithDescriptor: pipelineStateDesc + options: MTLPipelineOptionBufferTypeInfo + reflection: &ref + error: &error]; + m_computePipelineStates.emplace(hash, pipelineStateDesc); + return computePipelineState; + } + RHI::ResultCode PipelineLibrary::MergeIntoInternal(AZStd::span pipelineLibraries) { + AZStd::lock_guard lock(m_mutex); + NSError* error = nil; + for (const RHI::PipelineLibrary* libraryBase : pipelineLibraries) + { + const PipelineLibrary* library = static_cast(libraryBase); + for (const auto& pipelineStateEntry : library->m_renderPipelineStates) + { + if (m_renderPipelineStates.find(pipelineStateEntry.first) == m_renderPipelineStates.end()) + { + [m_mtlBinaryArchive addRenderPipelineFunctionsWithDescriptor:pipelineStateEntry.second + error:&error]; + m_renderPipelineStates.emplace(pipelineStateEntry.first, pipelineStateEntry.second); + } + } + + for (const auto& pipelineStateEntry : library->m_computePipelineStates) + { + if (m_computePipelineStates.find(pipelineStateEntry.first) == m_computePipelineStates.end()) + { + [m_mtlBinaryArchive addComputePipelineFunctionsWithDescriptor:pipelineStateEntry.second + error:&error]; + m_computePipelineStates.emplace(pipelineStateEntry.first, pipelineStateEntry.second); + } + } + } + return RHI::ResultCode::Success; } @@ -36,5 +131,39 @@ namespace AZ { return nullptr; } + + bool PipelineLibrary::SaveSerializedDataInternal(const AZStd::string& filePath) const + { + AZStd::lock_guard lock(m_mutex); + + NSError* error = nil; + NSString* psoCacheFilePath = [NSString stringWithCString:filePath.c_str() encoding:NSUTF8StringEncoding]; + NSURL *baseURL = [NSURL fileURLWithPath:psoCacheFilePath]; + + BOOL isDir; + NSFileManager *fileManager= [NSFileManager defaultManager]; + NSString *directory = [psoCacheFilePath stringByDeletingLastPathComponent]; + //If the directory where the PSO cache will reside does not exist create one + if(![fileManager fileExistsAtPath:directory isDirectory:&isDir]) + { + if(![fileManager createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:NULL]) + { + AZ_Error("PipelineStateCache", false, "Error: Unable to create the folder %s in order to save the PSO Cache", psoCacheFilePath); + return false; + } + } + + if(m_mtlBinaryArchive) + { + [m_mtlBinaryArchive serializeToURL:baseURL + error:&error]; + } + return error==nil; + } + + bool PipelineLibrary::IsMergeRequired() const + { + return !m_renderPipelineStates.empty() || !m_computePipelineStates.empty(); + } } } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h index f462e20a8e..15f225631f 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineLibrary.h @@ -22,18 +22,30 @@ namespace AZ AZ_DISABLE_COPY_MOVE(PipelineLibrary); static RHI::Ptr Create(); - + id GetNativePipelineCache() const; + id CreateGraphicsPipelineState(uint64_t hash, MTLRenderPipelineDescriptor* pipelineStateDesc); + id CreateComputePipelineState(uint64_t hash, MTLComputePipelineDescriptor* pipelineStateDesc); + private: PipelineLibrary() = default; ////////////////////////////////////////////////////////////////////////// // RHI::PipelineLibrary - RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryData* serializedData) override; + RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryDescriptor& descriptor) override; void ShutdownInternal() override; RHI::ResultCode MergeIntoInternal(AZStd::span libraries) override; RHI::ConstPtr GetSerializedDataInternal() const override; + bool IsMergeRequired() const; + bool SaveSerializedDataInternal(const AZStd::string& filePath) const; ////////////////////////////////////////////////////////////////////////// + RHI::PipelineLibraryDescriptor m_descriptor; + id m_mtlBinaryArchive = nil; + mutable AZStd::mutex m_mutex; + + // Internally tracks additions to the library. Used when merging libraries together. + AZStd::unordered_map m_renderPipelineStates; + AZStd::unordered_map m_computePipelineStates; }; } } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp index 002a8b9bd9..e8e4df9412 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace AZ { @@ -110,8 +111,6 @@ namespace AZ [source release]; source = nil; - - return pFunction; } @@ -119,68 +118,71 @@ namespace AZ const RHI::PipelineStateDescriptorForDraw& descriptor, RHI::PipelineLibrary* pipelineLibraryBase) { + NSError* error = 0; Device& device = static_cast(deviceBase); RHI::ConstPtr pipelineLayout = device.AcquirePipelineLayout(*descriptor.m_pipelineLayoutDescriptor); AZ_Assert(pipelineLayout, "PipelineLayout can not be null"); const RHI::RenderAttachmentConfiguration& attachmentsConfiguration = descriptor.m_renderAttachmentConfiguration; - MTLRenderPipelineDescriptor* desc = [[MTLRenderPipelineDescriptor alloc] init]; + m_renderPipelineDesc = [[MTLRenderPipelineDescriptor alloc] init]; for (AZ::u32 i = 0; i < attachmentsConfiguration.GetRenderTargetCount(); ++i) { - desc.colorAttachments[i].pixelFormat = ConvertPixelFormat(attachmentsConfiguration.GetRenderTargetFormat(i)); - desc.colorAttachments[i].writeMask = ConvertColorWriteMask(descriptor.m_renderStates.m_blendState.m_targets[i].m_writeMask); - desc.colorAttachments[i].blendingEnabled = descriptor.m_renderStates.m_blendState.m_targets[i].m_enable; - desc.colorAttachments[i].alphaBlendOperation = ConvertBlendOp(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendAlphaOp); - desc.colorAttachments[i].rgbBlendOperation = ConvertBlendOp(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendOp); - desc.colorAttachments[i].destinationAlphaBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendAlphaDest); - desc.colorAttachments[i].destinationRGBBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendDest);; - desc.colorAttachments[i].sourceAlphaBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendAlphaSource); - desc.colorAttachments[i].sourceRGBBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendSource);; + m_renderPipelineDesc.colorAttachments[i].pixelFormat = ConvertPixelFormat(attachmentsConfiguration.GetRenderTargetFormat(i)); + m_renderPipelineDesc.colorAttachments[i].writeMask = ConvertColorWriteMask(descriptor.m_renderStates.m_blendState.m_targets[i].m_writeMask); + m_renderPipelineDesc.colorAttachments[i].blendingEnabled = descriptor.m_renderStates.m_blendState.m_targets[i].m_enable; + m_renderPipelineDesc.colorAttachments[i].alphaBlendOperation = ConvertBlendOp(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendAlphaOp); + m_renderPipelineDesc.colorAttachments[i].rgbBlendOperation = ConvertBlendOp(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendOp); + m_renderPipelineDesc.colorAttachments[i].destinationAlphaBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendAlphaDest); + m_renderPipelineDesc.colorAttachments[i].destinationRGBBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendDest);; + m_renderPipelineDesc.colorAttachments[i].sourceAlphaBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendAlphaSource); + m_renderPipelineDesc.colorAttachments[i].sourceRGBBlendFactor = ConvertBlendFactor(descriptor.m_renderStates.m_blendState.m_targets[i].m_blendSource);; } MTLVertexDescriptor* vertexDescriptor = [[MTLVertexDescriptor alloc] init]; ConvertInputElements(descriptor.m_inputStreamLayout, vertexDescriptor); - desc.vertexDescriptor = vertexDescriptor; + m_renderPipelineDesc.vertexDescriptor = vertexDescriptor; [vertexDescriptor release]; vertexDescriptor = nil; - desc.vertexFunction = ExtractMtlFunction(device.GetMtlDevice(), descriptor.m_vertexFunction.get()); - AZ_Assert(desc.vertexFunction, "Vertex mtlFuntion can not be null"); - desc.fragmentFunction = ExtractMtlFunction(device.GetMtlDevice(), descriptor.m_fragmentFunction.get()); + m_renderPipelineDesc.vertexFunction = ExtractMtlFunction(device.GetMtlDevice(), descriptor.m_vertexFunction.get()); + AZ_Assert(m_renderPipelineDesc.vertexFunction, "Vertex mtlFuntion can not be null"); + m_renderPipelineDesc.fragmentFunction = ExtractMtlFunction(device.GetMtlDevice(), descriptor.m_fragmentFunction.get()); RHI::Format depthStencilFormat = attachmentsConfiguration.GetDepthStencilFormat(); if(descriptor.m_renderStates.m_depthStencilState.m_stencil.m_enable || IsDepthStencilMerged(depthStencilFormat)) { - desc.stencilAttachmentPixelFormat = ConvertPixelFormat(depthStencilFormat); + m_renderPipelineDesc.stencilAttachmentPixelFormat = ConvertPixelFormat(depthStencilFormat); } //Depthstencil state if(descriptor.m_renderStates.m_depthStencilState.m_depth.m_enable || IsDepthStencilMerged(depthStencilFormat)) { - desc.depthAttachmentPixelFormat = ConvertPixelFormat(depthStencilFormat); + m_renderPipelineDesc.depthAttachmentPixelFormat = ConvertPixelFormat(depthStencilFormat); MTLDepthStencilDescriptor* depthStencilDesc = [[MTLDepthStencilDescriptor alloc] init]; ConvertDepthStencilState(descriptor.m_renderStates.m_depthStencilState, depthStencilDesc); m_depthStencilState = [device.GetMtlDevice() newDepthStencilStateWithDescriptor:depthStencilDesc]; AZ_Assert(m_depthStencilState, "Could not create Depth Stencil state."); - [m_depthStencilState retain]; [depthStencilDesc release]; depthStencilDesc = nil; } - desc.sampleCount = descriptor.m_renderStates.m_multisampleState.m_samples; - desc.alphaToCoverageEnabled = descriptor.m_renderStates.m_blendState.m_alphaToCoverageEnable; + m_renderPipelineDesc.sampleCount = descriptor.m_renderStates.m_multisampleState.m_samples; + m_renderPipelineDesc.alphaToCoverageEnabled = descriptor.m_renderStates.m_blendState.m_alphaToCoverageEnable; - NSError* error = 0; - MTLRenderPipelineReflection* ref; - m_graphicsPipelineState = [device.GetMtlDevice() newRenderPipelineStateWithDescriptor:desc options : MTLPipelineOptionBufferTypeInfo reflection : &ref error : &error]; + PipelineLibrary* pipelineLibrary = static_cast(pipelineLibraryBase); + if (pipelineLibrary && pipelineLibrary->IsInitialized()) + { + m_graphicsPipelineState = pipelineLibrary->CreateGraphicsPipelineState(static_cast(descriptor.GetHash()), m_renderPipelineDesc); + } + else + { + MTLRenderPipelineReflection* ref; + m_graphicsPipelineState = [device.GetMtlDevice() newRenderPipelineStateWithDescriptor:m_renderPipelineDesc options : MTLPipelineOptionBufferTypeInfo reflection : &ref error : &error]; + } AZ_Assert(m_graphicsPipelineState, "Could not create Pipeline object!."); - [m_graphicsPipelineState retain]; - [desc release]; - desc = nil; - m_pipelineStateMultiSampleState = descriptor.m_renderStates.m_multisampleState; //Cache the rasterizer state @@ -207,20 +209,25 @@ namespace AZ RHI::PipelineLibrary* pipelineLibraryBase) { Device& device = static_cast(deviceBase); - MTLComputePipelineDescriptor* desc = [[MTLComputePipelineDescriptor alloc] init]; + NSError* error = 0; + m_computePipelineDesc = [[MTLComputePipelineDescriptor alloc] init]; RHI::ConstPtr pipelineLayout = device.AcquirePipelineLayout(*descriptor.m_pipelineLayoutDescriptor); AZ_Assert(pipelineLayout, "PipelineLayout can not be null"); - desc.computeFunction = ExtractMtlFunction(device.GetMtlDevice(), descriptor.m_computeFunction.get()); - AZ_Assert(desc.computeFunction, "Compute mtlFuntion can not be null"); + m_computePipelineDesc.computeFunction = ExtractMtlFunction(device.GetMtlDevice(), descriptor.m_computeFunction.get()); + AZ_Assert(m_computePipelineDesc.computeFunction, "Compute mtlFuntion can not be null"); - NSError* error = 0; - MTLComputePipelineReflection* ref; - m_computePipelineState = [device.GetMtlDevice() newComputePipelineStateWithDescriptor:desc options:MTLPipelineOptionBufferTypeInfo reflection:&ref error:&error]; + PipelineLibrary* pipelineLibrary = static_cast(pipelineLibraryBase); + if (pipelineLibrary && pipelineLibrary->IsInitialized()) + { + m_computePipelineState = pipelineLibrary->CreateComputePipelineState(static_cast(descriptor.GetHash()), m_computePipelineDesc); + } + else + { + MTLComputePipelineReflection* ref; + m_computePipelineState = [device.GetMtlDevice() newComputePipelineStateWithDescriptor:m_computePipelineDesc options:MTLPipelineOptionBufferTypeInfo reflection:&ref error:&error]; + } AZ_Assert(m_computePipelineState, "Could not create Pipeline object!."); - [m_computePipelineState retain]; - [desc release]; - desc = nil; if (m_computePipelineState) { @@ -262,12 +269,16 @@ namespace AZ { if (m_graphicsPipelineState) { + [m_renderPipelineDesc release]; + m_renderPipelineDesc = nil; [m_graphicsPipelineState release]; m_graphicsPipelineState = nil; } if (m_computePipelineState) { + [m_computePipelineDesc release]; + m_computePipelineDesc = nil; [m_computePipelineState release]; m_computePipelineState = nil; } diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.h b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.h index 678d5e83be..baa764ce7e 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.h +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.h @@ -75,10 +75,13 @@ namespace AZ RHI::ConstPtr m_pipelineLayout; AZStd::atomic_bool m_isCompiled = {false}; - // Platform pipeline state. + // PSOs + descriptors id m_graphicsPipelineState = nil; id m_computePipelineState = nil; id m_depthStencilState = nil; + MTLRenderPipelineDescriptor* m_renderPipelineDesc = nil; + MTLComputePipelineDescriptor* m_computePipelineDesc = nil; + AZ::u32 m_stencilRef = 0; RasterizerState m_rasterizerState; MTLPrimitiveType m_primitiveTopology = MTLPrimitiveTypeTriangle; diff --git a/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h index e30b4c0ac7..c7f2197619 100644 --- a/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Null/Code/Source/RHI/PipelineLibrary.h @@ -28,10 +28,11 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // RHI::PipelineLibrary - RHI::ResultCode InitInternal([[maybe_unused]] RHI::Device& device, [[maybe_unused]] const RHI::PipelineLibraryData* serializedData) override { return RHI::ResultCode::Success;} + RHI::ResultCode InitInternal([[maybe_unused]] RHI::Device& device, [[maybe_unused]] const RHI::PipelineLibraryDescriptor& descriptor) override { return RHI::ResultCode::Success;} void ShutdownInternal() override {} RHI::ResultCode MergeIntoInternal([[maybe_unused]] AZStd::span libraries) override { return RHI::ResultCode::Success;} RHI::ConstPtr GetSerializedDataInternal() const override { return nullptr;} + bool SaveSerializedDataInternal([[maybe_unused]] const AZStd::string& filePath) const override { return true;} ////////////////////////////////////////////////////////////////////////// }; } diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp index c9e35a481b..a948826ead 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.cpp @@ -23,7 +23,7 @@ namespace AZ return m_nativePipelineCache; } - RHI::ResultCode PipelineLibrary::InitInternal(RHI::Device& deviceBase, const RHI::PipelineLibraryData* serializedData) + RHI::ResultCode PipelineLibrary::InitInternal(RHI::Device& deviceBase, const RHI::PipelineLibraryDescriptor& descriptor) { DeviceObject::Init(deviceBase); auto& device = static_cast(deviceBase); @@ -35,10 +35,10 @@ namespace AZ createInfo.initialDataSize = 0; createInfo.pInitialData = nullptr; - if (serializedData) + if (descriptor.m_serializedData) { - createInfo.initialDataSize = static_cast(serializedData->GetData().size()); - createInfo.pInitialData = serializedData->GetData().data(); + createInfo.initialDataSize = static_cast(descriptor.m_serializedData->GetData().size()); + createInfo.pInitialData = descriptor.m_serializedData->GetData().data(); } const VkResult result = vkCreatePipelineCache(device.GetNativeDevice(), &createInfo, nullptr, &m_nativePipelineCache); @@ -108,5 +108,13 @@ namespace AZ Debug::SetNameToObject(reinterpret_cast(m_nativePipelineCache), name.data(), VK_OBJECT_TYPE_PIPELINE_CACHE, static_cast(GetDevice())); } } + + bool PipelineLibrary::SaveSerializedDataInternal([[maybe_unused]] const AZStd::string& filePath) const + { + //Vulkan drivers cannot save serialized data + [[maybe_unused]] Device& device = static_cast(GetDevice()); + AZ_Assert(!device.GetFeatures().m_isPsoCacheFileOperationsNeeded, "Explicit PSO cache operations should not be disabled for Vulkan"); + return false; + } } } diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h index 34c254ec65..1ec3c0d107 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLibrary.h @@ -40,10 +40,11 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // RHI::PipelineLibrary - RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryData* serializedData) override; + RHI::ResultCode InitInternal(RHI::Device& device, const RHI::PipelineLibraryDescriptor& descriptor) override; void ShutdownInternal() override; RHI::ResultCode MergeIntoInternal(AZStd::span libraries) override; RHI::ConstPtr GetSerializedDataInternal() const override; + bool SaveSerializedDataInternal(const AZStd::string& filePath) const override; ////////////////////////////////////////////////////////////////////////// VkPipelineCache m_nativePipelineCache = VK_NULL_HANDLE; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index de79931ed0..f4ae8b3e7f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -104,7 +104,7 @@ namespace AZ char pipelineLibraryPathTemp[AZ_MAX_PATH_LEN]; azsnprintf( - pipelineLibraryPathTemp, AZ_MAX_PATH_LEN, "@user@/Atom/PipelineStateCache_%s_%i_%i _Ver_%i/%s/%s_%s_%d.bin", + pipelineLibraryPathTemp, AZ_MAX_PATH_LEN, "@user@/Atom/PipelineStateCache_%s_%u_%u_Ver_%i/%s/%s_%s_%d.bin", ToString(physicalDeviceDesc.m_vendorId).data(), physicalDeviceDesc.m_deviceId, physicalDeviceDesc.m_driverVersion, PSOCacheVersion, platformName.GetCStr(), shaderName.GetCStr(), @@ -146,7 +146,7 @@ namespace AZ RHI::PipelineStateCache* pipelineStateCache = rhiSystem->GetPipelineStateCache(); ConstPtr serializedData = LoadPipelineLibrary(); - RHI::PipelineLibraryHandle pipelineLibraryHandle = pipelineStateCache->CreateLibrary(serializedData.get()); + RHI::PipelineLibraryHandle pipelineLibraryHandle = pipelineStateCache->CreateLibrary(serializedData.get(), m_pipelineLibraryPath); if (pipelineLibraryHandle.IsNull()) { @@ -321,8 +321,10 @@ namespace AZ /////////////////////////////////////////////////////////////////// ConstPtr Shader::LoadPipelineLibrary() const - { - if (m_pipelineLibraryPath[0] != 0) + { + RHI::Device* device = RHI::RHISystemInterface::Get()->GetDevice(); + //Check if explicit file load/save operation is needed as the RHI backend api may not support it + if (m_pipelineLibraryPath[0] != 0 && device->GetFeatures().m_isPsoCacheFileOperationsNeeded) { return Utils::LoadObjectFromFile(m_pipelineLibraryPath); } @@ -331,12 +333,28 @@ namespace AZ void Shader::SavePipelineLibrary() const { + RHI::Device* device = RHI::RHISystemInterface::Get()->GetDevice(); if (m_pipelineLibraryPath[0] != 0) { - RHI::ConstPtr serializedData = m_pipelineStateCache->GetLibrarySerializedData(m_pipelineLibraryHandle); - if (serializedData) + RHI::ConstPtr pipelineLib = m_pipelineStateCache->GetMergedLibrary(m_pipelineLibraryHandle); + if(!pipelineLib) { - Utils::SaveObjectToFile(m_pipelineLibraryPath, DataStream::ST_BINARY, serializedData.get()); + return; + } + + //Check if explicit file load/save operation is needed as the RHI backend api may not support it + if (device->GetFeatures().m_isPsoCacheFileOperationsNeeded) + { + RHI::ConstPtr serializedData = pipelineLib->GetSerializedData(); + if(serializedData) + { + Utils::SaveObjectToFile(m_pipelineLibraryPath, DataStream::ST_BINARY, serializedData.get()); + } + } + else + { + [[maybe_unused]] bool result = pipelineLib->SaveSerializedData(m_pipelineLibraryPath); + AZ_Error("Shader", result, "Pipeline Library %s was not saved", &m_pipelineLibraryPath); } } } diff --git a/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h b/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h index 400eb9521c..c2c1ae3601 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h +++ b/Gems/Atom/RPI/Code/Tests/Common/RHI/Stubs.h @@ -262,10 +262,11 @@ namespace UnitTest AZ_CLASS_ALLOCATOR(PipelineLibrary, AZ::SystemAllocator, 0); private: - AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, const AZ::RHI::PipelineLibraryData*) override { return AZ::RHI::ResultCode::Success; } + AZ::RHI::ResultCode InitInternal(AZ::RHI::Device&, [[maybe_unused]] const AZ::RHI::PipelineLibraryDescriptor& descriptor) override { return AZ::RHI::ResultCode::Success; } void ShutdownInternal() override {} AZ::RHI::ResultCode MergeIntoInternal(AZStd::span) override { return AZ::RHI::ResultCode::Success; } AZ::RHI::ConstPtr GetSerializedDataInternal() const override { return nullptr; } + bool SaveSerializedDataInternal([[maybe_unused]] const AZStd::string& filePath) const { return true;} }; class ShaderStageFunction From 5509764fc2b793db31110cf610ff76d0cff3263a Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Wed, 2 Feb 2022 11:46:00 -0800 Subject: [PATCH 394/394] Make atom render viewport the default for animation editor. (#7282) * Make atom render viewport the default for animation editor. Signed-off-by: rhhong * Fixed the automated test problem caused by making atom vp the default Signed-off-by: rhhong * Fix another test failure Signed-off-by: rhhong * fix failed test Signed-off-by: rhhong * more fix to the automation test Signed-off-by: rhhong * we don't need to manuelly call init on the ragdoll plugin anymore Signed-off-by: rhhong --- .../Code/Tools/EMStudio/AtomRenderPlugin.cpp | 2 +- .../Assets/Editor/Layouts/AnimGraph.layout | Bin 7200 -> 7432 bytes .../Assets/Editor/Layouts/Animation.layout | Bin 3212 -> 3683 bytes .../Assets/Editor/Layouts/Character.layout | Bin 5005 -> 5097 bytes .../Assets/Editor/Layouts/Physics.layout | Bin 4411 -> 4503 bytes .../Editor/Layouts/SimulatedObjects.layout | Bin 7805 -> 7772 bytes .../Source/OpenGLRender/OpenGLRenderPlugin.h | 2 +- .../Code/Tests/Mocks/AtomRenderPlugin.h | 52 ++++++++++++++++++ .../Ragdoll/CanCopyPasteColliders.cpp | 10 +--- .../Ragdoll/CanCopyPasteJointLimits.cpp | 8 +-- .../Code/Tests/UI/CanAddToSimulatedObject.cpp | 15 +---- .../Code/Tests/UI/ClothColliderTests.cpp | 25 +++++---- .../Code/Tests/UI/RagdollEditTests.cpp | 15 ++--- Gems/EMotionFX/Code/Tests/UI/UIFixture.cpp | 24 ++++++++ Gems/EMotionFX/Code/Tests/UI/UIFixture.h | 6 ++ .../Code/emotionfx_editor_tests_files.cmake | 1 + 16 files changed, 110 insertions(+), 50 deletions(-) create mode 100644 Gems/EMotionFX/Code/Tests/Mocks/AtomRenderPlugin.h diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp index c39012d303..131cbd7053 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp @@ -51,7 +51,7 @@ namespace EMStudio const char* AtomRenderPlugin::GetName() const { - return "Atom Render Window (Preview)"; + return "Atom Render Window"; } uint32 AtomRenderPlugin::GetClassID() const diff --git a/Gems/EMotionFX/Assets/Editor/Layouts/AnimGraph.layout b/Gems/EMotionFX/Assets/Editor/Layouts/AnimGraph.layout index e85d6054a3e54df86030125994f050171e52f622..62c9e1bb4e0333cc3bbf2dfd8801bb22db42bd09 100644 GIT binary patch literal 7432 zcmc&%TWl0n82+bAfnbc7l6W^`1Omn;bKe;>N~KW1wlrKcBqp%ZP1(@ht=mN;K_!6) z5HvhU;+q=rLF0ol1~lIA#TPa4fy5Uv*hs<)KIoeu`h92S)Sb55jB&}F&CHoOd(QWt z|NAfJpY=oA2K#ny*|Gh*i8Bi%ZktOr(+N$-avb>^Egqfvctw}U$dN%_Ikd&_ojO1np?VgkJ|+HBbcZ0^*Her z&O6VYIe|aT-eHBS@n+7~@8>a}>kfYv_rENR_kZ}w2NfRiFXGbktsj~%asKX}7+=qC z$A{jZUO)3)%fGbqfWp;y8eb&lw{`uJ1Y}*kS}oN^%_m9?v5t?c_1`XgVT$}~ynpwl zC5t?aM?L?@>YtCc&gU%Zr{(GO8tYLViZ=8Nb$a|J9mj}nU!@#woB1o|PAU7V&_0N}U%}L429~`fU1mQcOZMlx*!NXvE%zV01 z8?7IZ9C>gpJ8~UzVcT9Y4<7pVFfPoEmC0tkaZqx~4}R$TxSYsyijoTt+bh+w`BbG0 zcgT?k_(K>vZsd`Q$jL81Y%3!w^79AV@k0<1I#CqZk_Qini+aNxD%DD3<%Z-H7j`l7 zY{w4Z4}ll>Iru|gtx`1y8l{Q7k|z(YXBTbTcfp0_74zVsS+AN~%eB#RL!TRxLmlM> zL1f#-V%UpQ!?i*?=nadW9ooJZ%FV8$mfg-us^?Wy+xOr>)%JhkAt~Jos0Rzzud^yF zT*GaHjL4wukOA2w!(xkvgFcW5PqrY-ODMev?V?!X;tDYuU?jwdhiAU~cnXs$lj!mY zYdT`Dnt|;D!2_CubuJJbB?riQ^+7CBjjQ`*mz1R{b!kck_nJ)NX}^rBw@LK-FvD#5 z*$U57$QJeq8PK|b&lTe~^mhUDM_iD$;7`Q@IWex|c0XV7{35rm$XSfn0xH!4YII{< z4RiJq?(CtIUgU+6-GnFVNA|dnfSN7CbrhFsT)#ZE-Ul1L`mrY`Q2Xp6;K~#rb1^~rBh`eAK!;68Gy}d7x4Cufnn%*cl%!s4m0K?29^mfb*NbNt z>RUc{gQ*#|`93PA9c z7B?cMor9XwptK1?C+3TN5OZ)GOPa}Ynz*nEFTdmZGHv2CZ0vKffn6m)drl-yLalK^ z!*-fl9dn3#Wqdl;G_~6pD{~RyDjJHQfjNWGLPD4k=nt$(Ti2(PfkS?=l39s95(gmIr_Juex-EJw zoUi*%yj)TP%!5pL>X6u&NyP!EScP)yKw3>1r4E&;bZf+@bhul|z>NxbF6uQkaY!&c zR02kJ@4i<{gqmG{;EL3MPWLK}X7dhOlBt5K(w42tb%#JbtwnWKITMz&U`rQvWV*!} z3L7qlV#ZXf#I>1>wF?@wkDTs05LakaP___Ng>e-FQ`1MGqO5baGpUeD3v_t8thSxO z^5tEX4q-PKQytkKrSoG}ttaNQ-Ukr$z1F(()?*Aa0(l(csD$;>v{GVLJ!}d_Gx=ICBh7zd8&2Rf5~QC#PREZr?xI9m3mqzd+LVDSzU|Kvy^7jh4?}^ zlfk2&lWuAPNeoUoS>vj0Rs=@Ill4DHYa7MD=wO5ajjfYhvw%%yvxIBb3|YBun~Q<* zzcLn;MeC%#vpy$Ud~0SNny2K)uF_t_>@?@c8fK<(=dA>1&1N>_XUClNHfA%2c9Nf2 b-vkLil#|wD-ftJo&h&NM2DQysIA+T~j?<=s literal 7200 zcmc&&Ux-vy82@J1RWV4TAPb8tSZD~{bN|epD^YD~F8q?~xIc5abQ$-r z#FKHU8_%6MAKsaqe;wnAW7@lZ^nT{i?kT~|RO7Bu;?HhIpOfFO*Yf53#aZKqrigE* zPVEd5Gxiv~Wf&OE zN$Sh_e8;x6-m2DX*5+3$wbq2Zq3zuB#|}sPBj#sDuV@aBYtZfKX#CN2XRlCCBcJcd ztI^lYH}8M94r{wse)rYY((tb0&^E^lY{&7Pg0fvl)*f5_4e`ynamhc^>Ccm^Kh^TC zAD`ie@-9xUzSKGHlM^2&_*)@SApLatvr`;r^rF7Q^)c(YYHhTBNHXNXwN>akFt|_0!w3PjeU!^k zIbjCzu(LW|v7W6~4oQ|gATJ69#|=G(MCfF|!}dm{Rvfl=RBEG@rl}MQUMH1rdyZ3Z z1B8R^N(MYc>&1j*%Y);qLf*B*07;?zEb3&uZjMy2T4Wdxj$c4x6r3>3E6IWftQYmB zwY6L;k5!ryub>N`7eVMLN99o;@?PH0ATI`M)p4uXEI0N`mOQwg3Y79)aAAAF0`stb z1$R<+zmMG|YLndL-QVbayb$R>A~LXQn!Ccj8#t_$k_^i(Daw#+6D7Xb;)#P_L0k!N z4)N3$H{M5bzP!v`8)t8ly;6~JsY^?$IM!qWSCcZT?hPa&T1CZf&D>((@^3Zb?~Ql6~3$1^jqM9O60+f4^Cho6-k&vRvwc< z%&)?=MPQVrA^Tz0LAZ8IBX5umc((%*D6t7gQ`RP2?~?;S%v}da`>ScLpHw6p+R#6F zuuQgj&Wlftj-j{Ebpthv`T-i??n097Te&~t+SSf8P7K8{jK3G73f1Z*wIv-o z+z#6jlQT(;6++bm1sIK=uLGBaFbf%WxhJ6HZ=D)Hp2{_YV6O$2R1p-DxTo}(rVf%b(l<}J2OUCrWdsg9Eje#&@|LUDZ%v6wGdf9u*yh; znSFnvhx!4{WWMO~lP)^wNtOzlN?&#wH&6i92_vev##!*B4PUy52>2exajjYk!*Z<7 zx>4ejshqVJ7Ie>?fjWR5iZF$Xz>*)q(W7{9t-UJsykc`9=6c3}XUH1g^>OKVTbDy9 zaT=X@{ZX<$rnR~;pZ87y_Xl*{dhb2vFf))Vqo)_7B(1mOy;`>#g_u}82?L&v&Cn^9 zZkgMQN_UGY1;iyoK>N89@tKrSHWp{f{6%5Oukh;q20uFMl-0S3dwoV6>I*E9`kbtk zTw%DzFnqY^J2*y_5=YKwj9RSG z(h4q7xDN&4lfJk<_8>_iMlTTsLC|A`8i6l?ZwhUzzu&p{?Cz{uKB)H$=bnGx_xrx{ z`@VC|Y~A^0rT^{SgL}q58Y@X!ULR_DI`OoxwcJHXXK!3uUl6HIoSdBfP-Ml*Q-85t zlIggyzk2^Pr#MfXz)x|eF5UiM1N6TTsTA64l9%%ez+o+?o{M$v=z_3$Q?c z@z~iPpW0_}9iGD%N%?j5slO}(+1cvUTTO54@mjOfmc5q0pH{thgZw+ZdB2=xk(bf+ ztEv3N#y?Iil&2K;?d&;yhxfO4)W-SdH|Hm-mBDR0c4?!_i86`ON$dym*~#CDKb5uD zzW(hi7e`{Bd;U9X@8&0IzHpBAdVihzexckKpMPxaaGj-B(ky&+Y|BQ>9P(~RLp<;RZ=VDL2QSAx2$j-x12fr+#-k9SPaut2*STaPgpX0{4vGgCtC?Oocu7hcwj7K^PxPg^P@>4WdSCD!0eOUCWw z3P4|>heUs&3q1xV(HRWl@(VVgS^O6D8IXI}X}CnMg#ok&90}c_Wk}NiC}0F|g%sLAK)Wyu4|tUJQ5!7^)7bul zq(8J^GnO6xlV|%ufPVRJNBxb|3%C~%mbbJu}2ilh1i>e~71 z;IUvGoYT)O*XIi8NvMJ&+4Cz`7n1C&Q3UfK_V+UP&g{&r5Uh!=!umsLW<~z(P)qHu>}nc4R1XG% zQ7;umgkcXwK|w@6Priy$+e`EmfdoZ86hs+q+BtXTf~$-4qH~s+d+*$H&iCE#o_n{h z=|Hrmv!%W5_Vtl<;99-Yt1?~X8rPtE;>ORz3c#k^^yrUbfNaN(i!|=vb!~*&r8a4N z{!ZVD@L8NEeE(xs#C5ia_({a0@vj9p!=C1bsV8Hf0*mng@%lY~i6{N{ZkQSUeGcHm zQ#UX1qwzOy4A3`Q2yZ-FCGZK4kR=aQ@|tq<$#|FD^7q42ugVEe@_T+|{hLDTk@J$@ zobq18$^4{KAtV11Z=xwR5Kkr5y3~8d)2LaL4akV3!jHQOaM;$_%$vLw^ z24g|X@I!~1K2Z-1@ytLfeFj85lh&k@Y*)V?n8s0pkZy51s9ApKP@765dXh19Ur!qR z(}6P^4+S%rfkH6LJD*{%XxHLgw8aySdNA$`fuA~)qA8F?jBpq}_VxS=c;c~F?sOb>&u#}sa<0a)F zo|Spg7W!Kviuh5aV2+W>Eo51Z>pUSNk3ttXkbo2nKpfvm$Y5^}Vq%oR_9TvbpcneY zEcN5)<=_?61!}>cfruO#kS2Wb|C(KBDd6?T=@@(;shH8B7H diff --git a/Gems/EMotionFX/Assets/Editor/Layouts/Character.layout b/Gems/EMotionFX/Assets/Editor/Layouts/Character.layout index 5d42b49035b76325479b317cb411fc2f558bdb5e..cfaf839c85ec218de323e2c76086752c1c845171 100644 GIT binary patch literal 5097 zcmc&%U1%It6h7HqV-IU+DON1Zo!=dbh1A;En#5odr6A~MQRRj^LFA6FYDTN}4g7}~h_Q3}QE3qK>;)_V3m`1E2-?@eK#x8#E8&4W> z(|WkkPU6-JQVxA z#ENH<{f#Czh=R@w6-3p@QP?I_P^|_9)J0zsPg#%En-lfc(mmq;zdv|z-isWRMpfC4 z@2POB@_d{kw(A9Qqwfz_*YO6i;dPN-7Xy8#y^2A{l|^KMv!1{4+9^*-U8W?KL>hQE zQAml*$b_D?(LVpy>v*y14JT}UgPg0N2@^e>E0P`b#?iz4L(t?Q-*EZxB=zU<;< zXMq>85|`0>Kf>z+y-dsWaz+gcmZ)j)W*L?N8Iyk5EkhFEUgEs_OZ+`Dqzq^4ya=m{BZt>R4peXLUE zR=hp!4YkG%qT9iyktF}!IeuD0 zkCe91(QnuX&eH98-UNeg5@oIo{@2#OdL0mRCS!!%cT*q(U?%<1t>X}>Jy>H zd=!XF0BU*~!eb&wEJN|YU9N-Su;E6;dp}0Hjp&C-#M~-hFVuk;29g1xF$yyV7a@R9 z*$9680ZALvh?%(w{Y!|)Vw%Sk+8q@}HqyA#JH!%VZ5`hbVk@V?@-`mb$iJ4@GM20g z>eDzu;}RIQt|&OM16qH?^F`i~e2F2!wHy2kVC#oz?`v$zp8=b*+5^1S+6lAkFdj^7 z7TS^%Bc>Sc%q6p@Z4BXbmKFd)r!pgWq|?&8mn?7k7wCX7SRs7O%HVtOz0%2>Ps+69 zh)NX_(xePvuP-(%E<50SZ+UJe1#^!4^pbhUa!ma#T?Qxj){e$al>4jR({*na%Grm! zeUwY9xTO#kS8HL`vuN^vJvq-Bzpcsf06DXGmX0E=6dwEu4-Q>Bin{A(gm8`Bl` oBv7-hB`VhyaE1!e&-<|KCIiZDAJXFBdBxK--L_diEMT;M0l>5i6951J literal 5005 zcmc&%OK2Qr9RFu`i>U~T4=O3jASJYlFyFlA)@UWIY|_#;TJgDNmvqtWESp`_`aCFB zQ7RIODAfc#cu)^k^y;m65F-dZcvTR+iD=cB`1^e`Uy|KyBtp{pFEiik|9;K4ca0q@ zkKA{7;`p*iNm3YTwk#{M9NV$Qy6VLRqP>QGEiLE2T(~gb?|g}ZG9ccG-TSmZd->1#AM1U? zpCmg;0Jt-mo~|^i)*Y4BI{CyS&XYsF*3a-iw)=FspFRfP$a~}T@)tv(zrXX>gT&u^ zbIQkzuWMvh$J6BEmtP-PG-rpKwZ>@KI$CQ~Yc1>EdZU^=Va|+Q+wTY04ppqez>7jB zj`Q%t$YeWdS!0z(WvbSa-24!z(24BWQ-SN-dHA86Oqndm(GN%kH&9+2M@ogZlC&S~ z&l2-;)CKaPo;0k3^%>;FQ<76%#Bm(B%2syh_^#yPhw-FZvqoD}29Fo%2?OIpp7*6~Vfs@9&7yz;@bRTwHi^devK@xw^FU70*NU2DJ#`T4;`Nd#yR zLFg-A^2mp~lX|0VC7t%;^#&ScPW?dzaTGfWy;22H6kO)Im>*NyB0HC$#E_P?gLj*2xx~q^;1aV41Sw=!oK5l^aXtp|0PNtkhKl{o-TSyrc_0I@ZcNvg0gTEo;N|M zfs!BCL`d6Gkw;}x2b}Xd0$-EXhM}gl3^n~)Sb&hvQ+XomJr%=K)RC5ku-L=M*o5NI z(i$kAHq?m9;Pr_8&v<@ZiGLsWJ77a+M_@%|6jls?EiRY}dEio?LY8Z#B9%7{cf*E#L^9%8cN1 zYc=h*k|jv{0v#|0D};?%8GHk}SJu+@mM;s2UWvdVP09fJ`eH-lq613(cb**9r!+eq zbB^@1l6l8+OzkcF4x(97t^yk!d!X*SdSq5|!mQ-jtsnVPE95g~h@6(ftY^`nj{`XN z0ME9hg@eyCcve0aS|}9#6&9RY{apNyu9j(9IF(JZVc;H2_@|c-zg2^D48VLrN-x7l zJ~!}eYrSPYr6S$INc(f&WC89bk{MW=OkH61`t(0~60iwd>6LW_oOy-b@3vvXCIie~ T8`9!n$$7dpv3OWMEMUODiL86- diff --git a/Gems/EMotionFX/Assets/Editor/Layouts/Physics.layout b/Gems/EMotionFX/Assets/Editor/Layouts/Physics.layout index 2e59ab6b0ec6dd6ed6a7fd4e54bc1eac851c8e83..ffde15b36772368017a0688a788efd60a635a65e 100644 GIT binary patch literal 4503 zcmc&%TWDNG82-DPrhQQY?VBh^snx2%nK{?R2T4;~D@hxBK?I@MCQDtq*@fgpizXFm zkt&Ks>IFrJ`XmT~l!D|%p{P*ABKoGKEeJj+76e}!qu)2@j6Ekc(n9J^IA<>B|NhH2 z|38y`Xn6O~z~ejj?sc|8SG3<)Z63U=K7>uI=%TY<2bYa&_(j^^j-1GSr)ku zLnnV^)48KXc}h`_v*++m->+WF?(^CC_l}JW?cKJ0htah_`8xFd*aU%`nE8?VkLUgQ zPk%V&c%<&R+dsGVettR27p~D>-*?BqD9XL{`b*Xhzq9p8o`us}Hc{UB#cu;+X=lnqjwA1!>PN%JA8(efFAGA@SuT2~pR#(q$%B|26?DBa*; zu+>SQ^aha<&GE+Mlys*qf+*6;Pn3=WC0*fRAnie8?nNQSdAlmHXE73v@p~g6Z26 zvQHW^AstDjiFaG3Fq)QeJDWm(5c9h1mofX5<0hmUsP=v0E%V2?v_!DjgKSv!Jq+FK zEN&=8LpgG&;c0{j_=fL5R&K@fT9Jnv;VbvfdP|FEVeM4WVtL>vIjvYWfQQ z1E8x7AfI(;Q2tCHa)_=0OO3KSh4b(7o5~!jxObVux5+6!sJ#^sT&a5$UT`d$U zhf1%`u@FkhC8Gwyw$gdPy<~3E9&*~UvxE$geFnDYt$o%yW3AAU za#5qCY#1ySWgn(JQXBHsPr%Jds{yZ-4#K523DhVhmS)c-IC*c;;vJ=AW~niqnbbBd zK!i=mrq;`7A zxX4jplezpe2?~mh7FP14x~iJ;pJ@Eub{*RR>1!k(lGjA_zu4z}lcf?jgd4+~Ej!mC bj<%A_xDxeX#ojkLGu+mt%>2ilOSk?8kGW@{ literal 4411 zcmc&%ONbmr82+6Z-PMbtg0fL*B*b6>>8gI;vTnjAvX78;QSq^iJ53xiJG0ErYCzO@ zi=Zef@uY0fvu{kmi;_bkA((?lk2we)^rTVOUB9ooOQ&ac#lR+0Lw8km|KI=k{=cev z_D{}Cj6Oa+`^dUTMY1-!*mj)Q(XMvo_&xjIU%4TFfo}1FHuD#EeE;F^FN^G&I`Hl1 zul-m)|7m2NU)po>JxUYOt;for$>k`+X7$_NzQ61aO$zjHX77`4D*xD{e=GUi%KwIV z*sOo{IsK#jI$9=?-K~FCt`~o$bj#C>*W$ae9RGCg+^LP;uhCH6D0k-akny`$|Kiz) z3-J&#L;%`YYhj_3}0-G&ESi(g;dw`$)_FQ(1$3FmOytfg(|(R#DidfvXXab0^JJU3E_ib6k* zbdn5$htc^?tL;oyo7E#}TL#60ia>yJl^1I-)UjmiYHyy9>roFgN7F{yX*HecQ#uN?_JSxG01t<&M{2D`Lk7%494lXk*dshQQNaLsI8g66`_fK2->J8n zGO&6GBF|5fSVgWM$RKzaYqUDgI%6n_IyTBB8O*xy!%(?i?5fCj<+}4QH_VObj@LzQ zdK&|CM*f8Xze{l4ye4wv$STjKVV*CybBg{0d>E{)QmB+4JHvYb_<`RGM%p~yK>ANW zcE}-_kXad*gEA$dC`7GIpN(RS15wnDR(>PvMXt(Hg_d>}EP3Ke1ZxSd2sV6)(QC{T zYwJ0HK4K6=KUhF3NV@RL16l(|pEYIy#>AJ-gMe+;SK^yS!OiF4v?@}q4fAuN`U;al`HtnRiRZ!dUEImW3FX9!<;2gCIB zUR-ZoYhTH)@s<`Z!P=MI7K^z_z%6~$#^(gNQS=r5`;0UN@&$`V9SkdkebHRD;>x7F zs8mA@(;Gt-onhjba#uVkl{mYzqa>?j?<2Nerf}u+u{Z$i4vcUl|w34r49Rk>bKb*_$v}(5|_-7*ODlFMkGZzAzea z+v*@}X_G*OCB)@Z`2|ky>b7`)p_qN+V}zjdvH%gLl$pVox^cxQx#$^RXcER`ap~sE z;5*=6?Zy`C$1@nR5<^2)l%ZMjE;-Ubnm=*WK#q!NZWpXM;u$6Dj>|ENxAZFj?-0pG zbZ?o(2F(iQR)w0yk6z@ye+ zGX{8om`gtc@UBH>y*Uu@PIyX~o@~O zs|m}6M*FB{O!3IUHWCCS zf`%B3L_vu!V$#G&^o>YVOfWG%;EOS0f>A^gjA)GF8(Putn{#F_Wm~t`oz0v%GduJB z_kZThx{mJlrY)U4kKY&=_K8#4;@N;14VXdGlz&m2(W__fs}t!uwExJh=S1c&I(&_- z$6cfQr`|tsfI}Q7jumupRu5l1ung-Do_=eXt)Aa^v%_GYWxLz*y&wDt`Wl~OEW}qh zTL*{p_`j?D8`al%qvz}XLCoj6FB4Atqu=2_@XjB3P2Y#fh57QtGaO&o?BMJ9W9h@; zuDE`5U(-K7(yMSap2in(^sDJ}eS-_KCYQ;?vxz`+d_bi=TOh6MeCm_8k94*7w6tz8jaVpX8DYz^%}_{=@Bg0o z$K3YHhu?ib|Ip>s(oYq=pN~5J!f~a~uaA9RI`8C(mlPenZlSndcy{dy&eweL|L#4> zbTXgI20DlG=~Om3fU()vgJA~4mSNgq)3m~NOlDsX9l3lemmQSa>cO?k2c>rYU`6bRX-18Z5sAjaQUg6SWmB0z%Rsz;m()-X;aJ3unX#~8h0G`- zbN1t+JCzwq$MeZVpmY1~UZ#_Z<@+cL0mMl8#OJJ_|*LsLGN32aPe6Ul+Vrc^eO zd%6~SXf%Vi83{$A5xX%Owu6>!S&>G=4qIXDAePMResORKt-t7HoHVxKMV(>(!Ar>& zB{IUE|8G3jO0Og(BRR=S3eT(z;%!J0syB#s4`u{Peuf0`v&5DNenE+e0W^OcU@Tij zyd#rCE>bap8WcQ%Tz?3NUToMo)az44Hh>z&FGQXfg5MJkviIAmBL^h}uERiXxC_Yh zQMZHlNg|uTvL&jtOl^dep65RWeqm1^&HU!%cs6J=;Mvec5cseqc%Ih^CwU(Hz5(RD zs5l`t+@dv=w|GV{bT_+b&*6A-YXlQyF1sl8?_$Aeo?42&b-#2;yYxtlw8{ohq%@>S z4>CYCigye2O^Fg}F=~ofEH1UW9@Qf(r_@p4l`AZlWglbVA=+jeyLAG ztyXyt>tpCqhh92r!A3B9{d=zGwH1P*g7?}m1;c?%F%T`q9MxpgFo-u#0BylAk+tG8k4kG%g$o>pe{fnM+u|T=9U6hj=C~zBP2D*3m_guIgUnxEkgR#p`bARwfyO zA>!B;l2CppB4an+cA&or|0ZCdB;FkZ^V)fp2QV-*%G%6^Ma$JOc=}LPfkSzIN9Eus zhgwxtl#^6iktx@q{|?}tRj7E(l!Gwys$2zS`4>Qr{!)rrStlK`UN+0h2?WRg%^fc+ zJb!|RuS$7%xGF7fR6)iNW5z5q*P}pd(}*xv-Enk42BmDLy|-+e38_rOBTiJMK;|8! zRH(_j5-e^}>+zT=!|>on%JkxTT*1)EoI;9^Ri%^`*Mrx%dpoz0v~sqBf`G+?p=X{8 zuH;!=6?!kw$4CJHYdD8Tv#RbkTPSdD=CI{v z$0W$Z0^9N<0*|IV%kju$C~xOyj)@VKImx*Cp29+12vV(j#&eEo`3?gwe$z{YXJkcyg0{&KCh)qq@ywymK2-WuJN$AMDd`tTfyl8V*H&{@nQjjEMu}BxJ4d z^#h!vsH0`|p1|PdqO4Qcy#S=jX8q!}8_`yhQ-6#t_yKa>#H5Maw8D2fa9%|nEhjcJ z@%~kmb2|JPWPpiBAESmnw^Wi=Umo~B!XkRr#HB5MXB6%ZfK$nXJsE`lrJ}UedGMHL zJ69|ZkJ+WA51mS~>gx>u4gCKrCQU`w!fgg{DtRzv^oob#x+d2nC3oU?pN14k^Qb;F}}MIX@DLk)vi^b;m=f11&Qzq@lW uiPuIq(yUD;+oWDsNRVvwZ7UM_C+aE8GrXZuw{TxOV}VE&l=8o2fYf literal 7805 zcmc&&TWl0n82-20ZZQa=KumnlAzlK;;LgnM&Q871f>29J+fXZDjO~_AV9R!QZMR-X z)I_3*5ie1y#3ziJ7!!jJCM3cGi9RU45CSIfps3M^#v4yw3ibQW%yf6#Y29Avp3R&y zGkebW-@fyoGiT$L&eo)X-%N#eLhGe=;P}vG3x#v1de< zEN}RbEncbOKcD<->=a+{eJReek5=Ed7caFVznvnE-~W7r`^+&%S$QQ2eF#FF(n5TW z*N)tJ<}S473u_dvk2kTu|IGdz*LdLEX|~@+T>U$4xbzgCSxj7h|7hm(ca$7)@%{c& z`9lGejGy@I%kQcALgD&&nujmq`q!7w@%0|ahTOnFD%+>6PYp`G*R|uz7598V|ND4F zy?n_cIo$gF_pN!qv9v#X(LP_EKih`>oZEn@JI@vyFP}`Qy_T?Uz1^0s)wRBsz60xLZ*mgDi(7DISIE7qRYacFT(phIv zs^JISh{jFbu;PYc#w}YGo)24cg>)`EB-QnUVHt5tPwG)yPuNMbYJSi0j1pL!ZXy9YhAlAkV7{7kVVfnQW?(Sa68dDst$ghywGT$Ew}H7clq zT(=L1VJz5Kbwd~CimU@Qj$e#AFN4k_E^_$X+>xUagVu2%*Ix(ZCAfN_`z( zUZyu<%Fjz4g}#VqEyMiQ>~z){GvHb9MHKjmC3Ifg0+KunecuG~6S%NxslUu(N+?x<&NRm)1aHVmnLf9K2xeM)k zfW54w)zGrlWw565hpRie7xRSJViOc4)b6$-9Q|+w%q~a@A=;^U&-*m^@5taJ#*>dU z#8y%f6Hg+YA^pl3FyS$%@Gf2)D>vh|GBe@;Nx(ZcykUcggpK*0!QjwARI1Fc5yi=6 zLMA2qZYxHV67Q8JI3bOc&oG~mBBxU3JZVxJuT%OjEG;K)5d zz+4r1o)t?_AZb6@06st$5F1ZP>IAoj&tT9aYN$85oLz=uRvfjiMymvb@iv}Jjwg}E zeF%1iKSgK`!?ByjNgKc}3t=E#sT5~~sg$FeEXEoP4QXf}BnC|?SBhB$Ghbm)!MMUP zIa;|n)C3*QV%UhsmB=svU%-pnqEeg*$Qw1UqebGz1fyi7Yrk}=kPIUbDdcAd&Tj{E z`*F7u&)e{C9|Gjy-VIPU@;HMy)rc0A>GR(B9Kz@Y5Hjm-hFmD1o3r-bHtbFQqfB~GC11j3gR>jEGaPst&7#I2-j^)bUMzEomXHp&*+B->@}3?|3_^_^~7gf2n{b;d(IX!YF{d2y?n zWSnBmm}TKw2awG~V*%Z34xoh?l(PAMOW6_O>@AQ2>U3nkuPkyDyI25<1zUM?dUMYeGV0gF4d&|(i<+0$4NdNM*yP^ zr)!}*akJh>-CUthcU2U#x(nd(N*^CBipq05-@-mq7O`b+XAUxF*_(#Z1Eg6z!Z3K0^#JQT1@v z@X0Gd*7{%Zkxwv)teUyC#qW&qk9gn&F*r1UseiU;ZDkCea&PCE72-C#wDjO1$X5Sc zA@V2w{{@}qV(a*^0&s#DOk2Yzinh+3!Qm4SRZ`S48Dyt_%2EF`?95`s-0buYIe>E< z*CYn_l-s$$yEJITGSN5OY6o(_Kc}f5!k`~H64(4~{K<+52M6BDHF?RK=6C}-vCN-d y0UsnKdQ~T8^J$%*gT_xfJnI(RenderPlugin::CLASS_ID); } const char* GetCreatorName() const override { return "O3DE"; } float GetVersion() const override { return 1.0f; } diff --git a/Gems/EMotionFX/Code/Tests/Mocks/AtomRenderPlugin.h b/Gems/EMotionFX/Code/Tests/Mocks/AtomRenderPlugin.h new file mode 100644 index 0000000000..5be74a5d41 --- /dev/null +++ b/Gems/EMotionFX/Code/Tests/Mocks/AtomRenderPlugin.h @@ -0,0 +1,52 @@ +/* + * 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 + +namespace EMStudio +{ + // The Mock version of AtomRenderPlugin. It have the same name, class_id and type of the actual version. + // The actual implementation of the AtomRenderPlugin is defined outside of EMotionFX gem. This Mock version + // exists so we could load the default layouts without errors. + class MockAtomRenderPlugin + : public DockWidgetPlugin + { + enum + { + CLASS_ID = 0x32b0c04d + }; + + // Plugin information + const char* GetName() const override + { + return "Atom Render Window"; + }; + uint32 GetClassID() const override + { + return CLASS_ID; + }; + + bool Init() override + { + return true; + }; + + EMStudioPlugin* Clone() + { + return new MockAtomRenderPlugin(); + }; + + EMStudioPlugin::EPluginType GetPluginType() const override + { + return EMStudioPlugin::PLUGINTYPE_RENDERING; + }; + }; + +} diff --git a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp index 17f07b2180..5e3eff1453 100644 --- a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp +++ b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp @@ -40,11 +40,6 @@ namespace EMotionFX UIFixture::SetUp(); - AZ::SerializeContext* serializeContext = GetSerializeContext(); - - Physics::MockPhysicsSystem::Reflect(serializeContext); // Required by Ragdoll plugin to fake PhysX Gem is available - D6JointLimitConfiguration::Reflect(serializeContext); - EXPECT_CALL(m_jointHelpers, GetSupportedJointTypeIds) .WillRepeatedly(testing::Return(AZStd::vector{ azrtti_typeid() })); @@ -68,7 +63,9 @@ namespace EMotionFX { return AZStd::make_unique(); }); } - private: + protected: + virtual bool ShouldReflectPhysicSystem() override { return true; } + Physics::MockPhysicsSystem m_physicsSystem; Physics::MockPhysicsInterface m_physicsInterface; Physics::MockJointHelpersInterface m_jointHelpers; @@ -116,7 +113,6 @@ namespace EMotionFX auto* ragdollPlugin = EMStudio::GetPluginManager()->FindActivePlugin(); ASSERT_TRUE(ragdollPlugin) << "Ragdoll plugin not found."; - ragdollPlugin->Init(); auto* skeletonOutlinerPlugin = EMStudio::GetPluginManager()->FindActivePlugin(); ASSERT_TRUE(skeletonOutlinerPlugin) << "Skeleton outliner plugin not found."; diff --git a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp index 3f475c7916..6ff00e4e1b 100644 --- a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp +++ b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp @@ -31,6 +31,8 @@ namespace EMotionFX { class CopyPasteRagdollJointLimitsFixture : public UIFixture { + protected: + virtual bool ShouldReflectPhysicSystem() override { return true; } }; #if AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_EDITOR_TESTS @@ -41,16 +43,10 @@ namespace EMotionFX { using testing::_; - AZ::SerializeContext* serializeContext = GetSerializeContext(); - - Physics::MockPhysicsSystem::Reflect(serializeContext); // Required by Ragdoll plugin to fake PhysX Gem is available - D6JointLimitConfiguration::Reflect(serializeContext); - EMStudio::GetMainWindow()->ApplicationModeChanged("Physics"); auto ragdollPlugin = static_cast(EMStudio::GetPluginManager()->FindActivePlugin(EMotionFX::RagdollNodeInspectorPlugin::CLASS_ID)); ASSERT_TRUE(ragdollPlugin) << "Ragdoll plugin not found."; - ragdollPlugin->Init(); Physics::MockPhysicsSystem physicsSystem; Physics::MockPhysicsInterface physicsInterface; diff --git a/Gems/EMotionFX/Code/Tests/UI/CanAddToSimulatedObject.cpp b/Gems/EMotionFX/Code/Tests/UI/CanAddToSimulatedObject.cpp index a10ba352d2..de4eb001c3 100644 --- a/Gems/EMotionFX/Code/Tests/UI/CanAddToSimulatedObject.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/CanAddToSimulatedObject.cpp @@ -34,19 +34,8 @@ namespace EMotionFX class CanAddToSimulatedObjectFixture : public UIFixture { - public: - void SetUp() override - { - SetupQtAndFixtureBase(); - - AZ::SerializeContext* serializeContext = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - - Physics::MockPhysicsSystem::Reflect(serializeContext); // Required by Ragdoll plugin to fake PhysX Gem is available - D6JointLimitConfiguration::Reflect(serializeContext); - - SetupPluginWindows(); - } + protected: + virtual bool ShouldReflectPhysicSystem() override { return true; } }; TEST_F(CanAddToSimulatedObjectFixture, CanAddExistingJointsAndUnaddedChildren) diff --git a/Gems/EMotionFX/Code/Tests/UI/ClothColliderTests.cpp b/Gems/EMotionFX/Code/Tests/UI/ClothColliderTests.cpp index d87c35a4fa..59066ca1b8 100644 --- a/Gems/EMotionFX/Code/Tests/UI/ClothColliderTests.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/ClothColliderTests.cpp @@ -49,18 +49,6 @@ namespace EMotionFX class ClothColliderTestsFixture : public UIFixture { public: - void SetUp() override - { - SetupQtAndFixtureBase(); - - AZ::SerializeContext* serializeContext = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - - SystemComponent::Reflect(serializeContext); - - SetupPluginWindows(); - } - void TearDown() override { QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); @@ -86,6 +74,19 @@ namespace EMotionFX } protected: + bool ShouldReflectPhysicSystem() override { return true; } + + void ReflectMockedSystems() override + { + UIFixture::ReflectMockedSystems(); + + // Reflect the mocked version of the cloth system. + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + + SystemComponent::Reflect(serializeContext); + } + QModelIndexList m_indexList; ReselectingTreeView* m_treeView; EMotionFX::SkeletonOutlinerPlugin* m_skeletonOutliner; diff --git a/Gems/EMotionFX/Code/Tests/UI/RagdollEditTests.cpp b/Gems/EMotionFX/Code/Tests/UI/RagdollEditTests.cpp index d097e67d15..94b659ab91 100644 --- a/Gems/EMotionFX/Code/Tests/UI/RagdollEditTests.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/RagdollEditTests.cpp @@ -31,19 +31,13 @@ namespace EMotionFX { class RagdollEditTestsFixture : public UIFixture { - public: + public: void SetUp() override { + UIFixture::SetUp(); + using ::testing::_; - SetupQtAndFixtureBase(); - - AZ::SerializeContext* serializeContext = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - - Physics::MockPhysicsSystem::Reflect(serializeContext); // Required by Ragdoll plugin to fake PhysX Gem is available - D6JointLimitConfiguration::Reflect(serializeContext); - EXPECT_CALL(m_jointHelpers, GetSupportedJointTypeIds) .WillRepeatedly(testing::Return(AZStd::vector{ azrtti_typeid() })); @@ -67,7 +61,6 @@ namespace EMotionFX return AZStd::make_unique(); }); - SetupPluginWindows(); } void TearDown() override @@ -95,6 +88,8 @@ namespace EMotionFX } protected: + virtual bool ShouldReflectPhysicSystem() override { return true; } + QModelIndexList m_indexList; ReselectingTreeView* m_treeView; EMotionFX::SkeletonOutlinerPlugin* m_skeletonOutliner; diff --git a/Gems/EMotionFX/Code/Tests/UI/UIFixture.cpp b/Gems/EMotionFX/Code/Tests/UI/UIFixture.cpp index ea1f1c9148..2a1c7b190d 100644 --- a/Gems/EMotionFX/Code/Tests/UI/UIFixture.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/UIFixture.cpp @@ -8,6 +8,9 @@ #include #include +#include +#include +#include #include #include @@ -69,6 +72,7 @@ namespace EMotionFX // Set ignore visibilty so that the visibility check can be ignored in plugins EMStudio::GetManager()->SetIgnoreVisibility(true); } + void UIFixture::SetupPluginWindows() { // Plugins have to be created after both the QApplication object and @@ -81,11 +85,30 @@ namespace EMotionFX } } + void UIFixture::ReflectMockedSystems() + { + if (ShouldReflectPhysicSystem()) + { + AZ::SerializeContext* serializeContext = GetSerializeContext(); + + Physics::MockPhysicsSystem::Reflect(serializeContext); // Required by Ragdoll plugin to fake PhysX Gem is available + D6JointLimitConfiguration::Reflect(serializeContext); + } + } + + void UIFixture::OnRegisterPlugin() + { + EMStudio::PluginManager* pluginManager = EMStudio::EMStudioManager::GetInstance()->GetPluginManager(); + pluginManager->RegisterPlugin(new EMStudio::MockAtomRenderPlugin()); + } void UIFixture::SetUp() { + Integration::SystemNotificationBus::Handler::BusConnect(); + using namespace testing; SetupQtAndFixtureBase(); + ReflectMockedSystems(); SetupPluginWindows(); m_animGraphPlugin = static_cast(EMStudio::GetPluginManager()->FindActivePlugin(EMStudio::AnimGraphPlugin::CLASS_ID)); @@ -97,6 +120,7 @@ namespace EMotionFX void UIFixture::TearDown() { m_assetSystemRequestMock.BusDisconnect(); + Integration::SystemNotificationBus::Handler::BusDisconnect(); CloseAllNotificationWindows(); DeselectAllAnimGraphNodes(); diff --git a/Gems/EMotionFX/Code/Tests/UI/UIFixture.h b/Gems/EMotionFX/Code/Tests/UI/UIFixture.h index 7d22f0ce58..59b517ee33 100644 --- a/Gems/EMotionFX/Code/Tests/UI/UIFixture.h +++ b/Gems/EMotionFX/Code/Tests/UI/UIFixture.h @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -68,6 +69,7 @@ namespace EMotionFX class UIFixture : public MakeQtApplicationBase , public UIFixtureBase + , private Integration::SystemNotificationBus::Handler { public: void SetUp() override; @@ -108,6 +110,10 @@ namespace EMotionFX SimulatedObjectColliderWidget* GetSimulatedObjectColliderWidget() const; protected: + virtual bool ShouldReflectPhysicSystem() { return false; } + virtual void ReflectMockedSystems(); + + void OnRegisterPlugin(); void SetupQtAndFixtureBase(); void SetupPluginWindows(); diff --git a/Gems/EMotionFX/Code/emotionfx_editor_tests_files.cmake b/Gems/EMotionFX/Code/emotionfx_editor_tests_files.cmake index c7e0e57256..ee71677f9a 100644 --- a/Gems/EMotionFX/Code/emotionfx_editor_tests_files.cmake +++ b/Gems/EMotionFX/Code/emotionfx_editor_tests_files.cmake @@ -99,5 +99,6 @@ set(FILES Tests/EMotionFXBuilderFixture.cpp Tests/TestAssetCode/TestActorAssets.h Tests/TestAssetCode/TestActorAssets.cpp + Tests/Mocks/AtomRenderPlugin.h Tests/Mocks/PhysicsSystem.h )